/* DiplomAI v4 — Notion/Linear Stil */

:root {
  --bg: #0e0f11;
  --s1: #16181c;
  --s2: #1c1f24;
  --s3: #23262d;
  --s4: #2a2e36;
  --acc: #7c6ff5;
  --acc2: #5b8def;
  --acc3: #a39bf8;
  --green: #34d399;
  --red: #f87171;
  --gold: #fcd34d;
  --t1: #e8e9ec;
  --t2: #9a9da6;
  --t3: #5a5d66;
  --br: #262931;
  --br-soft: #1f2228;
  --br-strong: #3a3e48;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-modal: 0 24px 80px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Inter', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow: hidden;
  /* iOS Safe-Area-Insets (Notch + Home-Indicator) */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* iOS: kein Bouncing-Scroll auf body, kein Pull-to-Refresh */
  overscroll-behavior: none;
  touch-action: manipulation;
}

#app { display: flex; flex-direction: column; height: 100%; }

/* iOS-spezifisch: kein blauer Selektion-Highlight auf interaktiven Elementen */
[data-platform="ios"] button,
[data-platform="ios"] a,
[data-platform="ios"] .sc-card,
[data-platform="ios"] .ws-list-item {
  -webkit-touch-callout: none;
}

/* Add-to-Home-Screen Banner (nur iOS, nur Safari, nur first-visit) */
#a2hs-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 95;
  background: rgba(124, 111, 245, 0.95);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
}
#a2hs-bar .a2hs-body { flex: 1; display: flex; gap: 10px; align-items: flex-start; }
#a2hs-bar .a2hs-icon { font-size: 22px; flex-shrink: 0; }
#a2hs-bar .a2hs-text { font-size: 13px; line-height: 1.45; }
#a2hs-bar .a2hs-text strong { font-weight: 700; }
#a2hs-bar .a2hs-close {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== HEADER ===== */
.hdr {
  border-bottom: 1px solid var(--br-soft);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(14, 15, 17, 0.85);
  backdrop-filter: blur(12px);
}
.logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-ic { font-size: 18px; }
.logo-v {
  font-size: 11px;
  color: var(--t3);
  margin-left: 4px;
  font-weight: 500;
}
.hdr-r { display: flex; gap: 8px; align-items: center; }
.hbtn {
  background: transparent;
  border: 1px solid var(--br);
  color: var(--t2);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
}
.hbtn:hover {
  background: var(--s2);
  border-color: var(--br-strong);
  color: var(--t1);
}
.cost-badge {
  background: rgba(124, 111, 245, 0.08);
  border: 1px solid rgba(124, 111, 245, 0.25);
  color: var(--acc3);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  transition: all 0.14s;
}
.cost-badge:hover {
  background: rgba(124, 111, 245, 0.16);
  border-color: rgba(124, 111, 245, 0.45);
  color: #fff;
}
.cost-badge.hot {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--gold);
}

/* ===== MAIN LAYOUT ===== */
main { flex: 1; overflow: hidden; display: flex; }
.workspace-col {
  width: 280px;
  border-right: 1px solid var(--br-soft);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.workspace-col.collapsed { width: 0; border-right: none; overflow: hidden; }
.main-col {
  flex: 1;
  overflow-y: auto;
}

/* ===== WORKSPACE SIDEBAR ===== */
.ws-hdr {
  padding: 12px 14px;
  border-bottom: 1px solid var(--br-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ws-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
}
.ws-body { padding: 14px 12px; overflow-y: auto; }
.ws-section { margin-bottom: 18px; }
.ws-sec-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}
.ws-sec-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t3);
}
.ws-add {
  background: transparent;
  border: 1px solid var(--br);
  color: var(--t2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  padding: 3px 9px;
  font-weight: 500;
  cursor: pointer;
}
.ws-add:hover {
  background: var(--s2);
  color: var(--t1);
  border-color: var(--br-strong);
}
.ws-list-item {
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--t1);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  border: 1px solid transparent;
  transition: all 0.12s;
}
.ws-list-item:hover {
  background: var(--s2);
  border-color: var(--br-soft);
}
.ws-list-item.active {
  background: rgba(124, 111, 245, 0.1);
  border-color: rgba(124, 111, 245, 0.3);
  color: #fff;
}
.ws-list-item-emoji { font-size: 14px; flex-shrink: 0; }
.ws-list-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-list-empty {
  font-size: 11px;
  color: var(--t3);
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}

/* ===== START SCREEN ===== */
.start-screen {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 32px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.start-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.start-sub {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.5;
}
.start-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t3);
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 900px;
}
@media (max-width: 700px) {
  .start-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1400px) {
  .start-grid { grid-template-columns: repeat(4, 1fr); max-width: 1300px; }
}
.sc-card {
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.16s;
  box-shadow: var(--shadow-card);
  min-height: 170px;
}
.sc-card:hover {
  background: var(--s2);
  border-color: var(--br-strong);
}
.sc-card-emoji { font-size: 24px; }
.sc-card-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
}
.sc-card-goal {
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.5;
  flex: 1;
}
.sc-card-person {
  font-size: 11.5px;
  color: var(--t3);
}
.sc-card-btn {
  margin-top: 6px;
  padding: 7px 14px;
  background: var(--s3);
  border: 1px solid var(--br);
  border-radius: var(--radius-sm);
  color: var(--t1);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  font-family: inherit;
  transition: all 0.14s;
}
.sc-card:hover .sc-card-btn {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}
.create-card, .import-card {
  background: transparent;
  border: 1.5px dashed var(--br-strong);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  min-height: 170px;
  color: var(--t2);
  transition: all 0.16s;
  text-align: center;
}
.create-card:hover {
  border-color: var(--acc);
  color: var(--acc3);
  background: rgba(124, 111, 245, 0.05);
}
.import-card:hover {
  border-color: var(--acc2);
  color: #cbd5f5;
  background: rgba(91, 141, 239, 0.05);
}
.create-plus { font-size: 28px; font-weight: 300; line-height: 1; }
.create-label { font-size: 13.5px; font-weight: 600; }
.create-sub { font-size: 11px; color: var(--t3); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 11, 0.78);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 24px;
  box-shadow: var(--shadow-modal);
}
.modal-wide { max-width: 760px; }
.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.modal-sub {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ===== FORM CONTROLS ===== */
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; margin-bottom: 14px; }
.field-row > .field { flex: 1; margin-bottom: 0; }
.label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 6px;
  display: block;
}
.label-required::after { content: ' *'; color: var(--red); }
.inp, .ta, .sel {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--t1);
  font-family: inherit;
  transition: all 0.14s;
  outline: none;
}
.inp:focus, .ta:focus, .sel:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(124, 111, 245, 0.12);
}
.ta { min-height: 70px; resize: vertical; }
.inp::placeholder, .ta::placeholder { color: var(--t3); }
.field-hint {
  font-size: 11.5px;
  color: var(--t3);
  margin-top: 4px;
  font-style: italic;
}

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 22px;
}
.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--t2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
}
.tab:hover { color: var(--t1); }
.tab.active {
  background: var(--s4);
  color: var(--t1);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== BUTTONS ===== */
.btn {
  background: var(--s3);
  border: 1px solid var(--br);
  color: var(--t1);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
}
.btn:hover { background: var(--s4); border-color: var(--br-strong); }
.btn-primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: transparent;
  color: var(--t2);
}
.btn-danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--red);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.08); }
.btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--br-soft);
  margin-top: 8px;
}

/* ===== Inline lists (notes, blindspots) ===== */
.inline-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.inline-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12.5px;
}
.inline-list-item input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--t1);
  font: inherit;
  outline: none;
}
.inline-rm {
  background: transparent;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 13px;
}
.inline-rm:hover { color: var(--red); }
.add-mini {
  background: transparent;
  color: var(--t2);
  border: 1px dashed var(--br-strong);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  align-self: flex-start;
}
.add-mini:hover {
  background: rgba(124, 111, 245, 0.06);
  border-color: var(--acc);
  color: var(--acc3);
}

/* AI-Block (generierte Felder) */
.ai-block {
  background: rgba(124, 111, 245, 0.04);
  border: 1px solid rgba(124, 111, 245, 0.18);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  position: relative;
}
.ai-block::before {
  content: '🤖 KI-generiert · editierbar';
  position: absolute;
  top: -9px;
  left: 12px;
  background: var(--s1);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--acc3);
  letter-spacing: 0.04em;
}

/* AI-Aktion Block */
.ai-action {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ai-btn {
  background: var(--acc);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.14s;
  font-family: inherit;
}
.ai-btn:hover { filter: brightness(1.08); }
.ai-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ai-hint {
  font-size: 11.5px;
  color: var(--t3);
  font-style: italic;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
}
.alert-error { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.25); color: var(--red); }
.alert-info  { background: rgba(124, 111, 245, 0.06); border: 1px solid rgba(124, 111, 245, 0.2); color: var(--acc3); }

/* Section group inside modal */
.group { margin-bottom: 20px; }
.group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t3);
  margin-bottom: 8px;
}
.group-hint {
  font-size: 11.5px;
  color: var(--t3);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ===== CHAT VIEW ===== */
.chat-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}
.chat-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}
.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.bubble.user {
  align-self: flex-end;
  background: var(--acc);
  color: #fff;
}
.bubble.ai {
  align-self: flex-start;
  background: var(--s2);
  color: var(--t1);
  border: 1px solid var(--br);
}
.input-row {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--br-soft);
}
.input-row textarea {
  flex: 1;
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--t1);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  font-family: inherit;
}
.input-row textarea:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(124, 111, 245, 0.12);
}
.send-btn {
  background: var(--acc);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.session-meta {
  font-size: 12px;
  color: var(--t3);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--br-soft);
}
.session-meta strong { color: var(--t1); font-weight: 600; }

/* ===== INSPECTOR (active scenario in sidebar) ===== */
.insp-card {
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}
.insp-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
}
.insp-meta {
  font-size: 11px;
  color: var(--t3);
  margin-bottom: 10px;
}
.insp-row {
  border-top: 1px solid var(--br-soft);
  padding-top: 9px;
  margin-top: 9px;
}
.insp-row-lbl {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t2);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.insp-row-edit {
  background: transparent;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 11px;
}
.insp-row-edit:hover { color: var(--acc3); }
.insp-row-body {
  font-size: 11.5px;
  color: var(--t2);
  line-height: 1.5;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--br); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--br-strong); }

/* ===== COST MODAL details ===== */
.cost-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.cost-card {
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: var(--radius-md);
  padding: 12px;
}
.cost-card-lbl {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t3);
  font-weight: 600;
  margin-bottom: 4px;
}
.cost-card-val {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--t1);
}
.cost-card-sub {
  font-size: 10.5px;
  color: var(--t3);
  margin-top: 2px;
}
.cost-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--br-soft);
  background: var(--s2);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 12.5px;
}
.cost-row-kind { flex: 1; }
.cost-row-val {
  color: var(--acc3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ===== LIVE-COACHING-PANEL ===== */
.live-col {
  width: 310px;
  border-left: 1px solid var(--br-soft);
  flex-shrink: 0;
  overflow-y: auto;
  background: rgba(124,111,245,0.02);
}
.live-col.hidden { display: none; }

.lp-wrap { padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.lp-section {
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: var(--radius-md);
  padding: 11px 12px;
}
.lp-section-lbl {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t3);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lp-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.lp-mission {
  border-color: rgba(124,111,245,0.3);
  background: linear-gradient(180deg, rgba(124,111,245,0.06), var(--s1));
}
.lp-mission-text {
  font-size: 13px;
  color: var(--t1);
  line-height: 1.5;
  font-weight: 500;
}
.lp-playfield {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.55;
  font-style: italic;
}
.lp-tip-section {
  border-color: rgba(167, 139, 250, 0.35);
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.08), var(--s1));
}
.lp-tip {
  font-size: 13px;
  color: var(--acc3);
  line-height: 1.5;
  font-weight: 500;
}
.lp-quest {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 5px 0;
  font-size: 12px;
  line-height: 1.45;
}
.lp-quest-icon {
  font-size: 11px;
  color: var(--t3);
  flex-shrink: 0;
  margin-top: 2px;
}
.lp-quest.done .lp-quest-icon { color: var(--green); }
.lp-quest-text { color: var(--t2); }
.lp-quest.done .lp-quest-text {
  color: var(--t3);
  text-decoration: line-through;
}

/* ─────────────────────────────────────────────────────────────
   Sprint 2 (Bauplan v3): Persona-Detail-View + Drop-Zone
   ───────────────────────────────────────────────────────── */

.pd-header { margin-bottom: 20px; }
.pd-back   { color: var(--acc3); text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 14px; }
.pd-back:hover { text-decoration: underline; }
.pd-hero   { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pd-avatar { font-size: 44px; line-height: 1; padding: 8px 12px; background: var(--s2); border-radius: var(--radius-lg); border: 1px solid var(--br-soft); }
.pd-titlewrap { flex: 1 1 auto; min-width: 0; }
.pd-name   { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--t1); }
.pd-role   { font-size: 13px; color: var(--t2); margin-top: 2px; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pd-quality { background: var(--s1); border: 1px solid var(--br-soft); border-radius: var(--radius-md); padding: 14px 16px; margin: 18px 0 22px; }
.pd-q-head  { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pd-q-score { font-size: 22px; font-weight: 700; color: var(--acc3); }
.pd-q-sub   { font-size: 12.5px; color: var(--t2); }
.pd-qbar    { height: 6px; background: var(--s3); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.pd-qbar-fill { height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc3)); border-radius: 99px; }
.pd-q-suggest { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--t2); line-height: 1.6; }

/* Sprint B / Mobile-Wizard: Gap-Cards */
.pd-gap-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--br-soft);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.pd-gap-row-label {
  grid-column: 1 / -1;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t3);
  font-weight: 600;
  margin-bottom: 4px;
}
.pd-gap-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--s2);
  border: 1px solid var(--br-soft);
  border-radius: var(--radius-sm);
  transition: border-color 0.14s;
}
.pd-gap-card:hover { border-color: var(--br-strong); }
.pd-gap-icon { font-size: 22px; flex-shrink: 0; }
.pd-gap-body { flex: 1; min-width: 0; }
.pd-gap-title { font-size: 13px; font-weight: 600; color: var(--t1); }
.pd-gap-hint  { font-size: 11.5px; color: var(--t2); line-height: 1.45; margin-top: 2px; }
.pd-gap-impact {
  font-size: 12px;
  font-weight: 700;
  color: var(--acc3);
  background: rgba(124, 111, 245, 0.12);
  border: 1px solid rgba(124, 111, 245, 0.25);
  padding: 4px 10px;
  border-radius: 99px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 700px) {
  .pd-gap-row { grid-template-columns: repeat(3, 1fr); }
  .pd-gap-row-label { grid-column: 1 / -1; }
  .pd-gap-card { flex-direction: column; align-items: flex-start; gap: 6px; }
  .pd-gap-impact { align-self: flex-start; margin-top: 4px; }
}

.pd-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 980px) { .pd-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.pd-col-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pd-col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.pd-section { background: var(--s1); border: 1px solid var(--br-soft); border-radius: var(--radius-md); padding: 16px 18px; }
.pd-section-side { background: var(--s1); }
.pd-sec-title { font-size: 13px; font-weight: 600; color: var(--t1); letter-spacing: 0.01em; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.pd-sec-sub   { font-weight: 400; font-size: 11.5px; color: var(--t3); }
.pd-sec-count { font-weight: 400; font-size: 12px; color: var(--t3); }
.pd-sub-title { font-size: 11.5px; font-weight: 600; color: var(--t2); text-transform: uppercase; letter-spacing: 0.04em; margin: 4px 0 8px; }

.pd-empty    { color: var(--t3); font-style: italic; font-size: 13px; padding: 10px 4px; }
.pd-empty-sm { font-size: 12px; padding: 4px 4px; }

.pd-list     { margin: 0; padding-left: 18px; font-size: 13px; color: var(--t1); line-height: 1.7; }
.pd-list li  { margin-bottom: 2px; }

.pd-dim      { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(120px, 3fr) 90px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--br-soft); font-size: 12.5px; }
.pd-dim:last-child { border-bottom: none; }
.pd-dim-lbl  { color: var(--t1); }
.pd-dim-bar  { height: 5px; background: var(--s3); border-radius: 99px; overflow: hidden; }
.pd-dim-fill { height: 100%; background: linear-gradient(90deg, var(--acc2), var(--acc3)); }
.pd-dim-val  { color: var(--t1); font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; }
.pd-dim-conf { color: var(--t3); }

.pd-src-row  { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--br-soft); }
.pd-src-row:last-child { border-bottom: none; }
.pd-src-main { flex: 1; min-width: 0; }
.pd-src-line { font-size: 13px; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-src-meta { font-size: 11px; color: var(--t3); margin-top: 2px; }
.pd-src-del  { background: transparent; border: 1px solid var(--br); color: var(--t3); padding: 2px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.pd-src-del:hover { color: var(--red); border-color: var(--red); }

/* Drop-Zone */
.dz-root      { padding: 14px; border: 1.5px dashed var(--br-strong); border-radius: var(--radius-md); background: var(--s2); transition: border-color 0.15s, background 0.15s; }
.dz-root.dz-hover { border-color: var(--acc3); background: rgba(124, 111, 245, 0.07); }
.dz-title     { font-size: 13px; font-weight: 600; color: var(--t1); margin-bottom: 4px; }
.dz-hint      { font-size: 12px; color: var(--t2); margin-bottom: 12px; line-height: 1.5; }
.dz-actions   { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dz-textwrap  { margin-top: 6px; }
.dz-status    { margin-top: 10px; min-height: 16px; }

/* ─── Briefing-Sektion (das Herzstueck fuer den Nutzer) ─── */
.pd-briefing { background: linear-gradient(180deg, rgba(124,111,245,0.08), var(--s1)); border: 1px solid rgba(124,111,245,0.30); border-radius: var(--radius-md); padding: 20px 22px; margin: 18px 0 22px; }
.pd-briefing-empty { background: var(--s1); border-color: var(--br-soft); }
.pd-bf-head     { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 6px; }
.pd-bf-title    { font-size: 15px; font-weight: 700; color: var(--t1); letter-spacing: -0.01em; }
.pd-bf-meta     { font-size: 11.5px; color: var(--t3); }
.pd-bf-oneline  { font-size: 16px; line-height: 1.45; color: var(--t1); font-style: italic; margin: 6px 0 14px; padding: 10px 14px; background: rgba(255,255,255,0.04); border-left: 3px solid var(--acc); border-radius: 4px; }
.pd-bf-empty    { color: var(--t2); font-size: 13px; line-height: 1.6; padding: 8px 0; }
.pd-bf-sec      { margin-top: 12px; }
.pd-bf-sec-title{ font-size: 12.5px; font-weight: 600; color: var(--acc3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.pd-bf-list     { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--t1); line-height: 1.65; }
.pd-bf-list li  { margin-bottom: 5px; }
.pd-bf-ev       { font-size: 11.5px; color: var(--t3); font-style: italic; margin-top: 1px; }
.pd-bf-conf     { margin-top: 16px; padding: 8px 12px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); font-size: 12px; color: var(--t2); }

/* ─── Foldable-Details mit Chevron ─── */
.pd-foldable { cursor: default; }
.pd-foldable-summary { cursor: pointer; list-style: none; user-select: none; padding: 2px 0; transition: color 0.12s; }
.pd-foldable-summary::-webkit-details-marker { display: none; }
.pd-foldable-summary:hover { color: var(--acc3); }
.pd-chev { display: inline-block; width: 14px; color: var(--t3); font-size: 10px; transition: transform 0.15s; }

.pd-bf-confidence-top { margin: 4px 0 12px; padding: 9px 12px; background: rgba(252,211,77,0.10); border: 1px solid rgba(252,211,77,0.30); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--t1); line-height: 1.5; }

/* Quellen-Viewer-Modal */
.src-view-section  { margin-bottom: 16px; }
.src-view-label    { font-size: 11.5px; font-weight: 600; color: var(--t2); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.src-view-content  { background: var(--s2); border: 1px solid var(--br-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; line-height: 1.55; color: var(--t1); white-space: pre-wrap; max-height: 320px; overflow-y: auto; font-family: ui-monospace, SFMono-Regular, monospace; }
.src-view-summary  { background: rgba(124,111,245,0.08); border-left: 3px solid var(--acc); padding: 10px 12px; font-size: 13px; color: var(--t1); line-height: 1.5; border-radius: 4px; }
.src-view-msg      { padding: 6px 10px; margin-bottom: 4px; background: var(--s2); border-radius: var(--radius-sm); font-size: 13px; color: var(--t1); }
.src-view-meta-row { font-size: 12.5px; color: var(--t1); margin: 4px 0; }
.pd-src-row:hover  { background: rgba(255,255,255,0.02); border-radius: 4px; }

.dz-audience { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 6px 10px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); border: 1px solid var(--br-soft); }
.dz-audience label { font-size: 12px; color: var(--t2); flex-shrink: 0; }
.dz-audience select { flex: 1; background: var(--s2); color: var(--t1); border: 1px solid var(--br); border-radius: var(--radius-sm); padding: 5px 8px; font-size: 12.5px; }

.set-test-status   { margin-top: 6px; font-size: 12px; min-height: 14px; }
.model-rec-box     { margin-top: 8px; padding: 8px 12px; background: rgba(124,111,245,0.08); border-left: 3px solid var(--acc); border-radius: 4px; }
.model-rec-title   { font-size: 11.5px; font-weight: 600; color: var(--acc3); }
.model-rec-body    { font-size: 12px; color: var(--t2); line-height: 1.5; margin-top: 2px; }

.rt-explain { background: rgba(124,111,245,0.06); border: 1px solid rgba(124,111,245,0.25); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 12.5px; line-height: 1.55; color: var(--t1); margin-bottom: 16px; }
.rt-explain strong { color: var(--acc3); }

/* ===== Sync-Pill (Header-Indikator fuer OneDrive-Sync) ===== */
.sync-pill {
  background: transparent;
  border: 1px solid var(--br);
  color: var(--t2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
}
.sync-pill:hover { background: var(--s2); border-color: var(--br-strong); color: var(--t1); }
.sync-pill-off  { color: var(--t3); }
.sync-pill-idle { color: var(--green); border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.06); }
.sync-pill-busy { color: var(--acc3); border-color: rgba(124,111,245,.4); background: rgba(124,111,245,.08); }
.sync-pill-busy #sync-pill-icon { animation: sp-spin 1s linear infinite; display: inline-block; }
.sync-pill-err  { color: var(--red); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* ===== MOBILE (≤768px) — Sidebar als Slide-In Drawer ===== */
.hdr-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--br);
  color: var(--t1);
  width: 34px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  margin-right: 8px;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.hdr-burger:hover { background: var(--s2); border-color: var(--br-strong); }

.ws-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.ws-backdrop.show { display: block; }

@media (max-width: 768px) {
  .hdr-burger { display: inline-flex; }
  .hdr { padding: 8px 12px; gap: 4px; }
  .logo { font-size: 14px; }
  .logo-v { display: none; }

  /* Workspace wird zum links-einfahrenden Drawer */
  .workspace-col {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    z-index: 100;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
    border-right: 1px solid var(--br);
  }
  .workspace-col.mobile-open { transform: translateX(0); }

  /* Main column nimmt die ganze Breite */
  .main-col { width: 100%; }

  /* Persona-Detail einspaltig auf Mobile */
  .pd-grid { grid-template-columns: 1fr; }

  /* Modals deutlich groesser nutzen */
  .modal {
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 40px);
    margin: 8px;
  }

  /* Header-Buttons kompakter */
  .cost-badge { padding: 4px 8px; font-size: 11px; }
  .hbtn { padding: 4px 10px; font-size: 11px; }
  .sync-pill { padding: 3px 7px; font-size: 12px; min-width: 26px; height: 24px; }

  /* Inspector-Karten kompakter */
  .ws-body { padding: 10px 10px 30px; }

  /* Touch-Targets gem. Apple HIG / WCAG: min 44x44 */
  .input-row button,
  .input-row .icon-btn,
  .chat-input-bar button,
  .modal .btn-row .btn,
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
  }
  .input-row textarea, .chat-textarea {
    min-height: 44px;
  }
}

/* ─── Sprint 4 P1: First-Run-Setup-Banner ──────────────────────────── */
.setup-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(252, 211, 77, 0.08);
  border: 1px solid rgba(252, 211, 77, 0.3);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}
.setup-banner-icon { font-size: 22px; flex-shrink: 0; }
.setup-banner-body { flex: 1; min-width: 0; }
.setup-banner-title { font-size: 13.5px; font-weight: 600; color: var(--t1); margin-bottom: 3px; }
.setup-banner-sub { font-size: 12px; color: var(--t2); line-height: 1.4; }
.setup-banner .btn { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 600px) {
  .setup-banner { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
  .setup-banner-icon { align-self: center; }
}

/* ─── Sprint 4 D2: Diarize-Checkbox in DropZone ────────────────────── */
.dz-diarize {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--t2);
  margin-top: 6px;
  cursor: pointer;
  user-select: none;
}
.dz-diarize input[type="checkbox"] { margin: 0; cursor: pointer; }

/* ─── Sprint 4 D2: Speaker-Mapping-Modal ───────────────────────────── */
.sm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}
.sm-row {
  border: 1px solid var(--br);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--s1);
}
.sm-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sm-speaker-label { font-weight: 600; font-size: 14px; color: var(--t1); }
.sm-speaker-stats { font-size: 11.5px; color: var(--t3); flex: 1; min-width: 0; }
.sm-play { font-size: 12px; padding: 4px 10px; }
.sm-play.playing { background: var(--acc3); color: #fff; border-color: var(--acc3); }
.sm-row-preview {
  margin-top: 8px;
  font-style: italic;
  color: var(--t2);
  font-size: 13px;
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.sm-row-map { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.sm-row-map .label { font-size: 11.5px; color: var(--t3); }
.sm-status { min-height: 20px; }
@media (max-width: 768px) {
  .sm-row-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sm-speaker-stats { font-size: 11px; }
}

/* ─── Sprint B 4/4: Pre-Roll für Mission-Driven-Sammeln ──────────────── */
.pr-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pr-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--br-soft);
  border-radius: 6px;
  background: var(--s2);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.pr-chip:hover { border-color: var(--br-strong); background: var(--s3); }
.pr-chip input[type="checkbox"] { margin: 4px 0 0 0; cursor: pointer; flex-shrink: 0; }
.pr-chip:has(input:checked) {
  border-color: rgba(124, 111, 245, 0.45);
  background: rgba(124, 111, 245, 0.08);
}
.pr-chip-icon { font-size: 20px; flex-shrink: 0; }
.pr-chip-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pr-chip-label { font-size: 13.5px; font-weight: 600; color: var(--t1); }
.pr-chip-hint  { font-size: 11.5px; color: var(--t2); line-height: 1.4; }

/* ─── Sprint B 3/4: Floating Action Button für Voice-Memos ─────────── */
.fab-voice-root {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  right: calc(22px + env(safe-area-inset-right));
  z-index: 90;
}
.fab-voice-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--acc);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  box-shadow: 0 6px 20px rgba(124, 111, 245, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.14s, background 0.14s, box-shadow 0.14s;
}
.fab-voice-btn:hover {
  background: var(--acc3);
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(124, 111, 245, 0.55);
}
.fab-voice-btn.recording {
  background: var(--red);
  box-shadow: 0 6px 20px rgba(248, 113, 113, 0.55);
  animation: fabPulse 1.4s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.fab-voice-rec-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}
.fab-voice-toast {
  position: fixed;
  bottom: 90px;
  right: 22px;
  z-index: 91;
  padding: 10px 14px;
  background: var(--s1);
  border: 1px solid var(--acc3);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--acc3);
  max-width: 320px;
  opacity: 0;
  transition: opacity 0.25s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
@media (max-width: 700px) {
  .fab-voice-root { bottom: 16px; right: 16px; }
  .fab-voice-btn { width: 52px; height: 52px; font-size: 20px; }
  .fab-voice-toast { right: 16px; bottom: 76px; left: 16px; max-width: none; }
}
50%;
  background: var(--acc);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  box-shadow: 0 6px 20px rgba(124, 111, 245, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.14s, background 0.14s, box-shadow 0.14s;
}
.fab-voice-btn:hover {
  background: var(--acc3);
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(124, 111, 245, 0.55);
}
.fab-voice-btn.recording {
  background: var(--red);
  box-shadow: 0 6px 20px rgba(248, 113, 113, 0.55);
  animation: fabPulse 1.4s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.fab-voice-rec-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}
.fab-voice-toast {
  position: fixed;
  bottom: 90px;
  right: 22px;
  z-index: 91;
  padding: 10px 14px;
  background: var(--s1);
  border: 1px solid var(--acc3);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--acc3);
  max-width: 320px;
  opacity: 0;
  transition: opacity 0.25s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
@media (max-width: 700px) {
  .fab-voice-root { bottom: 16px; right: 16px; }
  .fab-voice-btn { width: 52px; height: 52px; font-size: 20px; }
  .fab-voice-toast { right: 16px; bottom: 76px; left: 16px; max-width: none; }
}
h: none; }
}
