/* GenossenStart – Vibe-Engine UI (preset-driven tokens) */

:root {
  --bg-color: #070b14;
  --surface-color: rgba(15, 23, 42, 0.72);
  --text-main: #e8eef7;
  --accent-color: #0D9488;
  --border-radius: 0.75rem;
  --box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --color-bg: #070b14;
  --color-surface: #0f172a;
  --color-text: #e8eef7;
  --color-accent: #0d9488;
  --color-border: #1e293b;
  --hero-overlay: 0.6;

  --accent: var(--accent-color);
  --radius: var(--border-radius);
  --anim-speed: 1;
  --duration: 0.45s;
  --bg-1: var(--bg-color);
  --bg-2: #0f172a;
  --surface: var(--surface-color);
  --card: rgba(18, 26, 43, 0.85);
  --text: var(--text-main);
  --muted: #8b9bb4;
  --border: rgba(255,255,255,0.1);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  margin: 0;
  color: var(--text-main);
}

.display {
  font-family: var(--font-heading);
}

.app-shell {
  background:
    radial-gradient(1100px 520px at 8% -8%, color-mix(in srgb, var(--accent-color) 32%, transparent), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, color-mix(in srgb, var(--accent-color) 18%, transparent), transparent 50%),
    linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-1) 100%);
  background-attachment: fixed;
}

html[data-theme-preset="brutalist"] .app-shell {
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      color-mix(in srgb, var(--accent-color) 10%, transparent) 18px,
      color-mix(in srgb, var(--accent-color) 10%, transparent) 19px
    ),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

html[data-theme-preset="solarpunk"] .app-shell {
  background:
    radial-gradient(900px 480px at 10% -10%, color-mix(in srgb, var(--accent-color) 22%, transparent), transparent 60%),
    radial-gradient(700px 420px at 95% 5%, color-mix(in srgb, #a7c957 28%, transparent), transparent 55%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-1) 100%);
}

.glass-card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--border-width, 1px) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: box-shadow var(--duration) var(--ease, ease), transform var(--duration) var(--ease, ease);
}

html[data-theme-preset="brutalist"] .glass-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 4px solid #111;
  background: var(--surface-color);
  box-shadow: 8px 8px 0 #111;
  border-radius: 0;
}

html[data-theme-preset="solarpunk"] .glass-card {
  border: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-color) 88%, #fff), var(--surface-color));
  box-shadow: var(--box-shadow);
}

/* Nested panels / role cards – theme-reactive, no hardcoded Tailwind radii/shadows */
.surface-panel {
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-1) 35%, var(--surface-color));
  padding: 1rem 1.15rem;
  transition: border-color var(--duration) var(--ease, ease), box-shadow var(--duration) var(--ease, ease);
}

html[data-theme-preset="brutalist"] .surface-panel {
  border: 3px solid #111;
  border-radius: 0;
  background: #fff;
  box-shadow: 4px 4px 0 #111;
}

html[data-theme-preset="solarpunk"] .surface-panel {
  border: none;
  background: color-mix(in srgb, var(--surface-color) 70%, color-mix(in srgb, var(--accent-color) 12%, #fff));
  box-shadow: 0 10px 28px rgba(28, 51, 32, 0.08);
}

/* Atomic task cards – quiet surfaces, strong action hierarchy */
.task-card {
  border: 0;
  border-radius: var(--border-radius);
  background: color-mix(in srgb, var(--text) 5.5%, transparent);
  padding: 1.05rem 1.15rem;
  transition: opacity 0.22s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.task-card.is-done {
  opacity: 0.5;
}
.task-card.is-focused {
  background: color-mix(in srgb, var(--accent) 10%, color-mix(in srgb, var(--text) 5.5%, transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}
html[data-theme-preset="brutalist"] .task-card {
  border-radius: 0;
  background: color-mix(in srgb, #111 6%, #fff);
}
html[data-theme-preset="brutalist"] .task-card.is-focused {
  box-shadow: 3px 3px 0 #111;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}
html[data-theme-preset="solarpunk"] .task-card {
  background: color-mix(in srgb, var(--accent-color) 7%, color-mix(in srgb, var(--surface-color) 55%, #fff));
}

.task-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.task-card-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
}
.task-meta {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  opacity: 0.9;
}

.task-check {
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.1rem;
  border-radius: calc(var(--border-radius) * 0.85 + 2px);
  border: 2px solid color-mix(in srgb, var(--text) 28%, var(--border));
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.task-check:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transform: scale(1.04);
}
.task-check:active:not(:disabled) {
  transform: scale(0.92);
}
.task-check:disabled {
  opacity: 0.55;
  cursor: wait;
}
.task-check.is-checked {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent-color) 35%, transparent);
}
html[data-theme-preset="brutalist"] .task-check {
  border-radius: 0;
  border-width: 2px;
  border-color: #111;
}
html[data-theme-preset="brutalist"] .task-check.is-checked {
  box-shadow: 3px 3px 0 #111;
  color: #111;
}

.task-card-actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.task-blocker-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  margin-left: auto;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  opacity: 0.8;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.task-blocker-link:hover {
  color: var(--text);
  opacity: 1;
}

/* Activity feed – system logs vs human chat */
.activity-feed {
  min-height: 420px;
  max-height: min(70vh, 640px);
}
.activity-feed-panel {
  min-height: 0;
}
.activity-feed-scroll {
  max-height: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.activity-feed-composer {
  background: color-mix(in srgb, var(--card, var(--surface-color)) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2;
}
html[data-theme-preset="brutalist"] .activity-feed-composer {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--surface-color);
}

.feed-system-log {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.15rem auto;
  max-width: 95%;
  padding: 0.15rem 0.35rem;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--muted);
}
.feed-system-log span {
  overflow-wrap: anywhere;
}

.feed-bubble {
  max-width: 92%;
  border: 0;
  border-radius: calc(var(--border-radius) * 1.1 + 2px);
  padding: 0.7rem 0.85rem;
  color: var(--text);
}
.feed-bubble.is-other {
  margin-right: auto;
  background: color-mix(in srgb, var(--text) 9%, var(--surface-color));
  border-bottom-left-radius: 4px;
}
.feed-bubble.is-own {
  margin-left: auto;
  background: color-mix(in srgb, var(--accent-color) 28%, var(--surface-color));
  border-bottom-right-radius: 4px;
}
.feed-bubble.is-failed {
  outline: 2px dashed color-mix(in srgb, #e11d48 55%, var(--border));
}
.feed-bubble.is-deleted {
  opacity: 0.72;
  font-style: italic;
}
.feed-bubble .chat-link {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.feed-bubble .chat-mention {
  font-weight: 600;
  color: var(--accent);
}
.feed-bubble .break-words {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.collab-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.collab-tab {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.collab-tab.is-active {
  background: color-mix(in srgb, var(--accent-color) 18%, var(--surface-color));
  border-color: color-mix(in srgb, var(--accent-color) 45%, var(--border));
  color: var(--accent);
}
.chat-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-color);
  color: #fff;
}
.chat-unread-divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chat-unread-divider::before,
.chat-unread-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--accent-color) 40%, var(--border));
}
.chat-reply-quote,
.chat-reply-preview {
  border-left: 3px solid var(--accent);
  padding: 0.35rem 0.55rem;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}
.chat-action-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  min-height: 32px;
  padding: 0.2rem 0.45rem;
  border-radius: calc(var(--border-radius) * 0.7);
}
.chat-action-btn:hover,
.chat-action-btn:focus-visible {
  color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent-color) 50%, transparent);
  outline-offset: 1px;
}
.chat-textarea {
  min-height: 44px;
  max-height: 160px;
  resize: none;
  overflow-y: auto;
}
.chat-composer {
  padding-bottom: max(0.25rem, env(safe-area-inset-bottom, 0px));
}
.chat-attachment-preview {
  max-width: min(100%, 220px);
  max-height: 160px;
  border-radius: calc(var(--border-radius) * 0.8);
  object-fit: cover;
}
.chat-file-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  max-width: 100%;
}
.mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.25rem);
  z-index: 20;
  max-height: 180px;
  overflow-y: auto;
  background: var(--surface-color);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}
.mention-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
}
.mention-item.is-active,
.mention-item:hover {
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
}
.team-collab {
  min-height: min(70vh, 640px);
}
.chat-scroll {
  max-height: min(52vh, 420px);
}
@media (max-width: 1023px) {
  .team-collab {
    width: 100%;
    min-height: min(100dvh, 100vh);
    max-height: none;
  }
  .chat-scroll {
    max-height: none;
    flex: 1 1 auto;
    min-height: 40dvh;
  }
  .chat-msg-actions {
    gap: 0.25rem;
  }
  .chat-action-btn {
    min-height: 44px;
    min-width: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .activity-feed-scroll {
    scroll-behavior: auto;
  }
}

html[data-theme-preset="brutalist"] .feed-bubble {
  border-radius: 0;
  border: 2px solid #111;
  box-shadow: 3px 3px 0 #111;
}
html[data-theme-preset="brutalist"] .feed-bubble.is-own {
  background: color-mix(in srgb, var(--accent-color) 35%, #fff);
}
html[data-theme-preset="solarpunk"] .feed-bubble.is-other {
  background: color-mix(in srgb, var(--surface-color) 75%, #fff);
}
html[data-theme-preset="solarpunk"] .feed-bubble.is-own {
  background: color-mix(in srgb, var(--accent-color) 22%, #fff);
}

.step-pill {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--border-radius) * 2 + 999px);
  border: 1px solid var(--border);
  transition: border-color var(--duration) var(--ease, ease), background var(--duration) var(--ease, ease), opacity var(--duration) var(--ease, ease);
  background: transparent;
  color: var(--text-main);
}
html[data-theme-preset="brutalist"] .step-pill {
  border-radius: 0;
  border: 2px solid #111;
  box-shadow: 2px 2px 0 #111;
}
.step-pill.is-current {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.step-pill.is-done { opacity: 0.7; }
.step-pill.is-todo { opacity: 0.4; }

.chip-soft {
  border-radius: calc(var(--border-radius) * 2 + 999px);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
}
html[data-theme-preset="brutalist"] .chip-soft {
  border-radius: 0;
  border: 2px solid #111;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent-color) 35%, transparent);
  border: 0;
}
html[data-theme-preset="brutalist"] .btn-primary {
  color: #fff;
  border: 3px solid #111;
  box-shadow: 6px 6px 0 #111;
  border-radius: 0;
  transition: transform 0.08s steps(2, end), box-shadow 0.08s steps(2, end);
}
html[data-theme-preset="brutalist"] .btn-primary:hover {
  filter: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #111;
}
html[data-theme-preset="solarpunk"] .btn-primary {
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent-color) 28%, transparent);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  transition: background 0.2s ease, transform 0.15s ease;
  background: transparent;
  color: var(--text-main);
}
html[data-theme-preset="brutalist"] .btn-ghost {
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--border);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn-ghost:active { transform: scale(0.98); }

.tag-chip {
  border: 1px solid var(--border);
  border-radius: calc(var(--border-radius) * 1.4 + 0.01px);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
}
html[data-theme-preset="brutalist"] .tag-chip {
  border: 2px solid var(--border);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--border);
}
.tag-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.tag-chip.is-active {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
html[data-theme-preset="brutalist"] .tag-chip.is-active {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 3px 3px 0 #111;
}

.score-ring {
  --p: 0;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background:
    conic-gradient(var(--accent) calc(var(--p) * 1%), color-mix(in srgb, var(--text) 12%, transparent) 0);
  display: grid;
  place-items: center;
  position: relative;
}
html[data-theme-preset="brutalist"] .score-ring {
  border-radius: 0;
  border: 2px solid #111;
  box-shadow: 4px 4px 0 #111;
}
.score-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: var(--card);
}
html[data-theme-preset="brutalist"] .score-ring::before {
  border-radius: 0;
  background: var(--surface-color);
}
.score-ring span {
  position: relative;
  font-weight: 700;
  font-size: 0.95rem;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
}
html[data-theme-preset="brutalist"] .progress-track {
  border-radius: 0;
  border: 2px solid #111;
  height: 10px;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
  transition: width var(--duration) cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-theme-preset="brutalist"] .progress-fill {
  background: var(--accent-color);
}

.card-enter {
  animation: cardIn var(--duration) var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
html[data-theme-preset="brutalist"] .card-enter {
  animation: brutalIn calc(var(--duration) * 0.7) steps(4, end) both;
}
@keyframes brutalIn {
  from { opacity: 0; transform: translate(10px, 10px); }
  to { opacity: 1; transform: none; }
}
html[data-theme-preset="solarpunk"] .card-enter {
  animation: softIn calc(var(--duration) * 1.15) cubic-bezier(0.33, 1, 0.68, 1) both;
}
@keyframes softIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.synth-bar {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.field {
  width: 100%;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-1) 55%, transparent);
  color: var(--text);
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-body);
}
html[data-theme-preset="brutalist"] .field {
  border: 2px solid #111;
  background: #fff;
  box-shadow: 3px 3px 0 #111;
  border-radius: 0;
}
html[data-theme-preset="solarpunk"] .field {
  background: color-mix(in srgb, var(--surface-color) 80%, #fff);
}
.field:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
html[data-theme-preset="brutalist"] .field:focus {
  box-shadow: 4px 4px 0 var(--accent-color);
  border-color: #111;
}

[x-cloak] { display: none !important; }

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  border-radius: calc(var(--border-radius) * 0.9 + 0.01px);
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.admin-nav a:hover,
.admin-nav a.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.haptic-flash {
  animation: haptic 0.28s ease;
}
@keyframes haptic {
  0% { transform: scale(1); }
  40% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* Tailwind Typography–style article prose (no plugin required) */
.prose {
  color: var(--text);
  max-width: 65ch;
  line-height: 1.75;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose :where(p) { margin: 1.1em 0; }
.prose :where(h1) {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.8em;
}
.prose :where(h2) {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 1.6em 0 0.55em;
}
.prose :where(h3) {
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
  margin: 1.35em 0 0.45em;
}
.prose :where(ul) { list-style: disc; padding-left: 1.35rem; margin: 1em 0; }
.prose :where(ol) { list-style: decimal; padding-left: 1.35rem; margin: 1em 0; }
.prose :where(li) { margin: 0.35em 0; padding-left: 0.2rem; }
.prose :where(li)::marker { color: var(--accent); }
.prose :where(blockquote) {
  border-left: 3px solid color-mix(in srgb, var(--accent) 65%, transparent);
  margin: 1.25em 0;
  padding: 0.35rem 0 0.35rem 1rem;
  color: var(--muted);
  font-style: italic;
}
.prose :where(a) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose :where(strong) { font-weight: 700; color: var(--text); }
.prose :where(em) { font-style: italic; }
.prose :where(hr) {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.prose :where(code) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.prose-invert { color: var(--text); }
.prose-lg { font-size: 1.075rem; line-height: 1.8; }
.prose-lg :where(h1) { font-size: 2.35rem; }
.prose-lg :where(h2) { font-size: 1.65rem; }
.prose-lg :where(h3) { font-size: 1.25rem; }
@media (min-width: 1024px) {
  .lg\:prose-lg { font-size: 1.075rem; line-height: 1.8; }
  .lg\:prose-lg :where(h1) { font-size: 2.35rem; }
  .lg\:prose-lg :where(h2) { font-size: 1.65rem; }
  .lg\:prose-lg :where(h3) { font-size: 1.25rem; }
}

.academy-search {
  font-size: 1.15rem;
  padding: 1.15rem 1.25rem 1.15rem 3.25rem;
}
.academy-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg-1) 88%, transparent);
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
}

/* Admin preset cards */
.preset-card {
  display: block;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.preset-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.preset-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.preset-swatch {
  height: 2.5rem;
  border-radius: calc(var(--border-radius) * 0.7 + 0.01px);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

/* Wizard geo / location step */
.geo-mode-card {
  display: block;
  width: 100%;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: color-mix(in srgb, var(--surface-color, var(--card)) 88%, transparent);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}
.geo-mode-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-1px);
}
.geo-mode-card.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-color, var(--card)));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.geo-mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.85rem;
  border-radius: calc(var(--border-radius) * 0.85 + 0.01px);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.geo-map-frame {
  border: 1px solid var(--border);
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-1) 80%, #94a3b8);
  position: relative;
}
.geo-map-frame .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
  background: transparent;
}
.geo-search-dropdown {
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: var(--bg-1, var(--card));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.geo-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.geo-search-item:last-child { border-bottom: 0; }
.geo-search-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.geo-radius-slider {
  accent-color: var(--accent);
  height: 0.35rem;
  cursor: pointer;
}

/* Kickstarter-style campaign (validate.php) */
/* Hero overlay: Tailwind gradient uses --hero-overlay from admin settings */
.campaign-hero {
  position: relative;
}
.campaign-hero__media {
  object-fit: cover;
}
.campaign-progress {
  height: 1.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text, var(--text)) 12%, transparent);
  overflow: hidden;
  border: 1px solid var(--color-border, var(--border));
}
html[data-theme-preset="brutalist"] .campaign-progress {
  border-radius: 0;
  border-width: 3px;
  height: 1.5rem;
}
.campaign-progress__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-accent, var(--accent)) 75%, #fff),
    var(--color-accent, var(--accent))
  );
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}
.media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .media-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}
.media-gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border, var(--border));
  overflow: hidden;
  background: var(--color-surface, var(--surface));
  padding: 0;
  cursor: pointer;
  transition: transform var(--duration) var(--ease, ease), box-shadow var(--duration) var(--ease, ease);
}
.media-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}
.media-gallery-item__img,
.media-gallery-item__doc {
  width: 100%;
  height: 100%;
}
.media-gallery-item__doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.media-upload-zone {
  border: 2px dashed var(--color-border, var(--border));
  border-radius: var(--border-radius);
  padding: 1.25rem;
  text-align: center;
  background: color-mix(in srgb, var(--color-surface, var(--surface)) 80%, transparent);
  transition: border-color var(--duration) ease, background var(--duration) ease;
}
.media-upload-zone.is-dragover {
  border-color: var(--color-accent, var(--accent));
  background: color-mix(in srgb, var(--color-accent, var(--accent)) 12%, transparent);
}
.cover-preview {
  aspect-ratio: 21 / 9;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--color-border, var(--border));
  background: var(--color-bg, var(--bg-1));
  position: relative;
}
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wizard-cover {
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--color-border, var(--border));
  background: var(--color-bg, var(--bg-1));
}
.wizard-cover__img {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}
.wizard-cover--compact .wizard-cover__img {
  aspect-ratio: 16 / 7;
}
.wizard-cover--compact {
  border: 0;
  border-radius: 0;
}

/* Proof of Work / Execution Board (validate.php) */
.execution-board .execution-col {
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border, var(--border));
  background: color-mix(in srgb, var(--color-bg, var(--bg-1)) 55%, transparent);
  padding: 1rem;
  min-height: 12rem;
}
.execution-col__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--color-border, var(--border));
}
.execution-col__head h3 {
  flex: 1;
  margin: 0;
  letter-spacing: 0.06em;
}
.execution-col--done .execution-col__head {
  color: #16a34a;
}
.execution-col--active {
  border-color: color-mix(in srgb, var(--color-accent, var(--accent)) 55%, var(--color-border, var(--border)));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent, var(--accent)) 25%, transparent);
}
.execution-col--active .execution-col__head {
  color: var(--color-accent, var(--accent));
}
.execution-col--planned .execution-col__head {
  color: var(--muted);
}
.execution-col__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.execution-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.875rem;
  line-height: 1.35;
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--border-radius) * 0.7);
  background: color-mix(in srgb, var(--color-surface, var(--surface)) 80%, transparent);
}
.execution-item--done {
  opacity: 0.72;
  background: color-mix(in srgb, #16a34a 8%, transparent);
}
.execution-item--done .execution-item__label {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.execution-item--done .execution-item__icon {
  color: #16a34a;
}
.execution-item--active {
  background: color-mix(in srgb, var(--color-accent, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent, var(--accent)) 35%, transparent);
  font-weight: 500;
}
.execution-item--active .execution-item__icon {
  color: var(--color-accent, var(--accent));
}
.execution-item--planned {
  color: var(--muted);
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--color-border, var(--border)) 80%, transparent);
}
.execution-item--planned .execution-item__icon {
  opacity: 0.65;
}
.execution-item__date {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.35rem;
  color: var(--muted);
  text-decoration: none !important;
}
.execution-item--empty {
  background: transparent;
  border: 0;
  padding-left: 0;
}
.execution-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border, var(--border));
  background: color-mix(in srgb, var(--color-accent, var(--accent)) 10%, transparent);
  color: var(--color-text, var(--text));
  font-size: 0.75rem;
  font-weight: 500;
}
.execution-badge i {
  color: var(--color-accent, var(--accent));
}
.execution-cta {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.5;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border, var(--border));
}
.execution-cta__link {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--color-accent, var(--accent));
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.execution-spin {
  animation: executionSpin 1.1s linear infinite;
}
@keyframes executionSpin {
  to { transform: rotate(360deg); }
}

/* Social share bar (validate.php) */
.share-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: calc(var(--border-radius, var(--radius)) * 0.7);
  border: 1px solid var(--color-border, var(--border));
  background: color-mix(in srgb, var(--color-bg, var(--bg-1)) 70%, transparent);
  color: var(--color-text, var(--text));
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.share-bar__btn:hover {
  border-color: color-mix(in srgb, var(--color-accent, var(--accent)) 45%, var(--color-border, var(--border)));
  background: color-mix(in srgb, var(--color-accent, var(--accent)) 10%, transparent);
  color: var(--color-accent, var(--accent));
}
.share-bar__btn i {
  opacity: 0.9;
}
.share-bar__tooltip {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
  background: var(--color-text, var(--text));
  color: var(--color-bg, var(--bg-1));
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
html[data-theme-preset="brutalist"] .share-bar__btn,
html[data-theme-preset="brutalist"] .share-bar__tooltip {
  border-radius: 0;
}

html[data-theme-preset="brutalist"] .execution-badge {
  border-radius: 0;
  border-width: 2px;
}
html[data-theme-preset="brutalist"] .execution-item {
  border-radius: 0;
}

/* Project Logbook / Updates timeline (validate.php) */
.project-logbook {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.project-logbook__item {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 1rem 1.15rem;
  position: relative;
}
.project-logbook__rail {
  position: relative;
  display: flex;
  justify-content: center;
}
.project-logbook__rail::before {
  content: '';
  position: absolute;
  top: 0.35rem;
  bottom: -0.35rem;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--color-accent, var(--accent)) 35%, var(--color-border, var(--border)));
}
.project-logbook__item:last-child .project-logbook__rail::before {
  bottom: calc(100% - 1.1rem);
}
.project-logbook__dot {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--color-accent, var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent, var(--accent)) 18%, transparent);
  flex-shrink: 0;
}
.project-logbook__card {
  min-width: 0;
  margin-bottom: 1.35rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--border-radius, var(--radius));
  border: 1px solid var(--color-border, var(--border));
  background: color-mix(in srgb, var(--color-bg, var(--bg-1)) 55%, transparent);
}
.project-logbook__item:last-child .project-logbook__card {
  margin-bottom: 0;
}
.project-logbook__date {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.project-logbook__title {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.project-logbook__body {
  color: color-mix(in srgb, var(--color-text, var(--text)) 92%, transparent);
}
.project-logbook-empty {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  border-radius: var(--border-radius, var(--radius));
  border: 1px dashed color-mix(in srgb, var(--color-accent, var(--accent)) 40%, var(--color-border, var(--border)));
  background: color-mix(in srgb, var(--color-accent, var(--accent)) 7%, transparent);
}
.project-logbook-empty__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: calc(var(--border-radius, var(--radius)) * 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-accent, var(--accent)) 16%, transparent);
  color: var(--color-accent, var(--accent));
}
.project-logbook-empty__text {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 500;
  color: var(--color-text, var(--text));
}
html[data-theme-preset="brutalist"] .project-logbook__card,
html[data-theme-preset="brutalist"] .project-logbook-empty,
html[data-theme-preset="brutalist"] .project-logbook-empty__icon,
html[data-theme-preset="brutalist"] .project-logbook__dot {
  border-radius: 0;
}



/* ===== Decisions / Abstimmungen ===== */
.decision-panel { overflow-x: hidden; }
.decision-stats { margin-bottom: 0.5rem; }
.decision-stat {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: color-mix(in srgb, var(--surface-color, var(--card)) 88%, transparent);
}
.decision-stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  tabular-nums: true;
  line-height: 1.2;
}
.decision-stat__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.25rem;
}
.decision-filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.decision-filter {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.decision-filter.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}
.decision-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: color-mix(in srgb, var(--card, var(--surface-color)) 90%, transparent);
}
.decision-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: calc(var(--border-radius) * 0.6);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.decision-badge.is-muted {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
}
.decision-badge.is-binding {
  background: color-mix(in srgb, #c2410c 18%, transparent);
  color: #ea580c;
}
.decision-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--text);
}
textarea.decision-input { min-height: 88px; }
.decision-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
}
.decision-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
}
.decision-tab.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.decision-vote-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
}
.decision-vote-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.decision-comment {
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--muted) 6%, transparent);
}
.decision-discuss-bucket {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  min-height: 120px;
}
.decision-pre {
  white-space: pre-wrap;
  font-size: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  max-height: 220px;
  overflow: auto;
}
.decision-sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0;
  background: color-mix(in srgb, var(--card, #0b1220) 92%, transparent);
  border-top: 1px solid var(--border);
  z-index: 5;
}
.decision-input:focus, .decision-filter:focus-visible, .decision-tab:focus-visible, .btn-primary:focus-visible, .btn-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .decision-panel *, .progress-fill {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 640px) {
  .decision-panel { padding: 1rem !important; }
  .decision-sticky-actions {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
