/* Workshop Copilot - modern dark workspace. Soft layered surfaces, one blue-violet
   accent, generous radii, mono only for numbers and micro-labels. Status is always
   a text label as well as a color. */
:root {
  --bg: #0f0d0b;
  --s1: #191713;
  --s2: #201d19;
  --s3: #2a2721;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #e8e7e5;
  --text-strong: #f9f9f8;
  --muted: #8693a6;
  --blue: #f3c067;
  --violet: #f5ae85;
  --grad: linear-gradient(135deg, #f1b54d 0%, #f4a476 100%);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 500px at 8% -8%, rgba(241, 181, 77, 0.16), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(244, 164, 118, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

h2, h3, p { margin: 0; }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1840px;
  margin: 0 auto;
  padding: 0 20px 14px;
}

.label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 4px;
  flex-wrap: wrap;
  background: linear-gradient(to bottom, rgba(15, 13, 11, 0.92), rgba(15, 13, 11, 0.7));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo { height: 36px; width: 36px; display: block; filter: drop-shadow(0 4px 12px rgba(226, 59, 50, 0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.company { font-size: 15px; font-weight: 650; color: var(--text-strong); letter-spacing: 0.01em; }
.product { font-size: 12.5px; color: var(--muted); }
.product i { font-style: normal; opacity: 0.8; }

.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--s1);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
}
.session-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.session-pill .clock { font-family: var(--mono); font-weight: 500; letter-spacing: 0.04em; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.session-pill[data-state="active"] { border-color: rgba(248, 113, 113, 0.5); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.08); }
.session-pill[data-state="active"] .dot { background: var(--red); animation: blink 1.2s ease-in-out infinite; }
.session-pill[data-state="paused"] .dot { background: var(--amber); }
.session-pill[data-state="stopped"] .dot { background: var(--green); }
@keyframes blink { 50% { opacity: 0.25; } }

.systems { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.system {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.system::before { content: ""; align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.system .value { color: var(--text-strong); font-weight: 600; }
.system .state { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.system[data-state="live"]::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.system[data-state="connecting"]::before, .system[data-state="degraded"]::before { background: var(--amber); }
.system[data-state="stopped"]::before, .system[data-state="failed"]::before { background: var(--red); }

/* ---------------- setup strip ---------------- */
.setup { display: flex; align-items: flex-end; gap: 14px; padding: 14px 0; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; min-width: 260px; }
.field.grow input { width: 100%; }

select,
input[type="text"],
input[type="password"],
input[type="date"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--text-strong);
  background: var(--s1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(226, 59, 50, 0.2); }
input::placeholder, textarea::placeholder { color: #5d6a7c; }
.file-path { min-width: 260px; align-self: flex-end; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.slider { position: relative; width: 38px; height: 22px; background: var(--s3); border: 1px solid var(--line-2); border-radius: 999px; transition: background 0.2s; }
.slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.switch input:checked + .slider { background: var(--grad); border-color: transparent; }
.switch input:checked + .slider::after { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; font-weight: 650; color: var(--text-strong); }

/* ---------------- grid + panels ---------------- */
.grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 4fr) minmax(420px, 6fr) minmax(250px, 2.6fr);
  gap: 14px;
  min-height: 0;
  align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, var(--s2), var(--s1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
}
.panel-head h2 { font-size: 13px; font-weight: 650; letter-spacing: 0.02em; color: var(--text-strong); }
.head-actions { display: flex; gap: 6px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  background: var(--s3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:hover:not(:disabled) { background: #36322a; border-color: rgba(255, 255, 255, 0.22); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 11px 15px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(241, 181, 77, 0.3); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); background: var(--grad); }
.btn.ghost { background: transparent; }
.btn.danger { color: #fecaca; border-color: rgba(248, 113, 113, 0.4); background: transparent; }
.btn.danger:hover { background: rgba(248, 113, 113, 0.14); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 12.5px; cursor: pointer; }
.link:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  background: var(--s1);
  border-radius: 5px;
}

/* ---------------- capture ---------------- */
.capture-bar { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }

.record-btn {
  position: relative;
  flex: none;
  width: 58px;
  height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #ff7a7a, #e23d4d);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(226, 61, 77, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s;
}
.record-btn:hover { transform: scale(1.05); }
.record-icon { width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: border-radius 0.15s, width 0.15s, height 0.15s; }
.record-btn[data-state="active"] .record-icon, .record-btn[data-state="paused"] .record-icon { width: 18px; height: 18px; border-radius: 4px; }
.record-btn[data-state="active"]::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(248, 113, 113, 0.5);
  border-radius: 50%;
  animation: ring 1.8s ease-out infinite;
}
@keyframes ring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.25); opacity: 0; } }

.capture-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 120px; }
.capture-status { font-size: 12.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.capture-status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--muted); }
.capture-status[data-state="active"]::before { background: var(--red); }
.capture-status[data-state="paused"]::before { background: var(--amber); }
.capture-status[data-state="failed"]::before, .capture-status[data-state="unavailable"]::before { background: var(--red); }
#level-meter { flex: 1; min-width: 120px; max-width: 100%; height: 44px; }

#hint-container:empty { display: none; }
.hint, .error-banner, .notice-banner {
  margin: 12px 16px 0;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--s1);
}
.hint { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.07); color: #fde7a8; }
.hint-info { border-color: rgba(243, 192, 103, 0.4); background: rgba(243, 192, 103, 0.08); color: #e7e6e3; }
.error-banner { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.08); color: #fecaca; }
.notice-banner { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); color: #c7f3df; }

.saved-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 16px 0;
  padding: 11px 14px;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: var(--radius-sm);
}
.saved-card[data-saved="false"] { background: rgba(251, 191, 36, 0.07); border-color: rgba(251, 191, 36, 0.4); }
.saved-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.saved-main strong { color: var(--text-strong); font-size: 13px; }
.saved-path { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.saved-actions { display: flex; gap: 6px; }

.transcript { flex: 1; overflow-y: auto; padding: 8px 16px 16px; max-height: calc(100vh - 380px); min-height: 220px; }
.transcript:empty::before {
  content: "Press the record button and start talking. Your words appear here as you speak.";
  display: block;
  padding: 40px 10px;
  text-align: center;
  color: var(--muted);
}
.transcript-line { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.55; animation: rise 0.25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.timestamp { flex: none; margin-top: 3px; padding: 1px 7px; height: fit-content; border-radius: 6px; background: rgba(243, 192, 103, 0.12); color: var(--blue); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.transcript-interim { color: var(--muted); font-style: italic; border-bottom: 0; }
.transcript-interim::after { content: " ▍"; animation: blink 1s steps(2) infinite; }

.media-panel > summary { list-style: none; cursor: pointer; }
.media-panel > summary::-webkit-details-marker { display: none; }
.media-panel > summary h2::after { content: "  ▸"; color: var(--muted); }
.media-panel[open] > summary h2::after { content: "  ▾"; }
.media-panel[open] > summary { border-bottom: 1px solid var(--line); }
.media-body { padding: 14px 16px 16px; }
.media-body .topic-form { padding: 0 0 12px; border: 0; }
.media-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.note { margin-top: 9px; font-size: 12px; line-height: 1.55; color: var(--muted); }

/* ---------------- workspace: tabs ---------------- */
.workspace { align-self: stretch; }
.tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.tab[aria-selected="true"] { color: var(--text-strong); border-bottom-color: var(--blue); background: rgba(243, 192, 103, 0.08); }
.badge { min-width: 22px; padding: 0 7px; text-align: center; font-family: var(--mono); font-size: 11px; line-height: 18px; color: var(--text); background: var(--s3); border-radius: 999px; }
.tab[aria-selected="true"] .badge { background: rgba(243, 192, 103, 0.25); color: #fff; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live-dot[data-state="working"] { background: var(--blue); animation: blink 0.9s ease-in-out infinite; }
.live-dot[data-state="ready"] { background: var(--green); }
.live-dot[data-state="error"] { background: var(--red); }

.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-tools { display: flex; align-items: center; padding: 12px 16px 0; }

.filters { display: inline-flex; padding: 3px; background: var(--s1); border: 1px solid var(--line); border-radius: 999px; }
.filter {
  padding: 4px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.filter[aria-selected="true"] { color: #fff; background: var(--grad); }
.filter .count { margin-left: 5px; font-family: var(--mono); font-size: 11px; opacity: 0.85; }

.topic-form { display: flex; gap: 8px; padding: 12px 16px; }
.topic-form input { flex: 1; min-width: 0; }
.topic-line { display: flex; align-items: baseline; gap: 12px; margin: 0 16px 4px; padding: 8px 12px; background: rgba(243, 192, 103, 0.1); border: 1px solid rgba(243, 192, 103, 0.25); border-radius: var(--radius-sm); }
.topic-line strong { color: var(--text-strong); font-size: 13.5px; }

/* ---------------- question backlog ---------------- */
.board { flex: 1; overflow-y: auto; padding: 2px 16px 16px; max-height: calc(100vh - 330px); min-height: 280px; }
.board:empty::before { content: "Questions you can ask appear here as the conversation unfolds, and stay until you skip them."; display: block; padding: 44px 12px; text-align: center; color: var(--muted); }

.group-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 9px; }
.group-head .rule { flex: 1; height: 1px; background: var(--line); }
.group-head .count { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.q {
  margin-bottom: 9px;
  padding: 13px 15px 11px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, transform 0.15s;
}
.q:hover { border-color: var(--line-2); border-left-color: var(--blue); }
.q[data-status="asked"] { border-left-color: var(--amber); }
.q[data-status="answered"] { border-left-color: var(--green); }
.q[data-status="skipped"] { border-left-color: var(--line-2); opacity: 0.55; }
.q.is-new { animation: arrive 1.8s ease-out; }
@keyframes arrive { from { background: rgba(243, 192, 103, 0.22); transform: translateY(-4px); } to { background: var(--s1); transform: none; } }

.q-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.q-status { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.q[data-status="open"] .q-status { color: var(--blue); border-color: rgba(243, 192, 103, 0.45); }
.q[data-status="asked"] .q-status { color: var(--amber); border-color: rgba(251, 191, 36, 0.45); }
.q[data-status="answered"] .q-status { color: var(--green); border-color: rgba(52, 211, 153, 0.45); }
.q-new { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: #fff; background: var(--grad); padding: 2px 8px; border-radius: 999px; }
.q-time { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.q-text { font-size: 15.5px; line-height: 1.45; font-weight: 600; color: var(--text-strong); }
.q-why { margin-top: 5px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.q-listen { margin-top: 6px; font-size: 12.5px; color: #cecbc5; }
.q-listen .label { color: var(--blue); }
.q-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.q-note { margin-top: 10px; }
.q-note textarea { width: 100%; min-height: 64px; resize: vertical; }
.q-answer { margin-top: 8px; padding: 8px 11px; font-size: 13.5px; color: var(--text); border-radius: 8px; background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.22); white-space: pre-wrap; }
.more { margin: 2px 0 6px; }

/* ---------------- technical design ---------------- */
.design-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.design-status { display: flex; flex-direction: column; gap: 1px; }
.design-status-text { font-weight: 650; color: var(--text-strong); font-size: 14px; }
.design-status-text::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--muted); }
.design-status[data-state="working"] .design-status-text::before { background: var(--blue); animation: blink 0.9s ease-in-out infinite; }
.design-status[data-state="ready"] .design-status-text::before { background: var(--green); }
.design-status[data-state="error"] .design-status-text::before { background: var(--red); }
.design-status-sub { font-size: 12px; color: var(--muted); padding-left: 16px; }

.design { padding: 6px 16px 18px; max-height: calc(100vh - 280px); overflow-y: auto; }

.report { padding: 6px 16px 18px; max-height: calc(100vh - 280px); overflow-y: auto; }
.report-empty { padding: 36px 14px; text-align: center; color: var(--muted); line-height: 1.6; }
.report-section { margin-top: 18px; }
.report-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.report-overview { font-size: 15px; line-height: 1.65; color: var(--text-strong); }
.report-none { color: var(--muted); font-size: 13px; font-style: italic; }
.report-list { margin: 0; padding-left: 18px; line-height: 1.6; }
.report-list li { margin: 3px 0; }
.report-topic { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); }
.report-topic-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: var(--text-strong); }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.report-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-qa { padding: 8px 12px; margin-bottom: 6px; border-left: 2px solid var(--blue); background: rgba(243, 192, 103, 0.05); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.report-q { font-weight: 600; color: var(--text-strong); }
.report-a { color: var(--text); margin-top: 2px; }

.d-empty { padding: 36px 14px; text-align: center; color: var(--muted); }
.d-empty h3 { font-size: 17px; color: var(--text-strong); margin-bottom: 8px; }
.d-empty p { max-width: 520px; margin: 0 auto 14px; line-height: 1.6; }
.d-steps { text-align: left; max-width: 460px; margin: 0 auto; padding-left: 20px; line-height: 1.7; }

.d-section { margin-top: 18px; }
.d-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: default; }
.d-head h3 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.d-count { font-family: var(--mono); font-size: 11px; color: var(--blue); background: rgba(243, 192, 103, 0.12); padding: 0 8px; border-radius: 999px; line-height: 18px; }
.d-summary { font-size: 16px; line-height: 1.6; color: var(--text-strong); padding: 14px 16px; background: linear-gradient(135deg, rgba(241, 181, 77, 0.12), rgba(244, 164, 118, 0.08)); border: 1px solid rgba(243, 192, 103, 0.25); border-radius: var(--radius-sm); }

.diagram { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; padding-bottom: 4px; }
.diagram.crosscut { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.layer { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.layer-empty { font-size: 12px; color: #5d6a7c; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); text-align: center; }

.comp, .decision { padding: 11px 12px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.comp[data-status="confirmed"] { border-color: rgba(52, 211, 153, 0.4); }
.comp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.comp-name { font-size: 13.5px; color: var(--text-strong); line-height: 1.3; }
.comp-role { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.comp-options { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.comp-why { margin-top: 7px; font-size: 11.5px; color: var(--blue); cursor: help; }

.chip { display: inline-block; padding: 1px 8px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.chip-confirmed { color: var(--green); border-color: rgba(52, 211, 153, 0.45); }
.chip-proposed { color: var(--blue); border-color: rgba(243, 192, 103, 0.45); }
.chip-heard { color: var(--amber); border-color: rgba(251, 191, 36, 0.45); }
.chip-option { color: #d4d1cc; background: var(--s3); border-color: transparent; font-weight: 500; }
.chip-decision-open { color: var(--amber); border-color: rgba(251, 191, 36, 0.45); }
.chip-decision-proposed { color: var(--blue); border-color: rgba(243, 192, 103, 0.45); }
.chip-decision-decided { color: var(--green); border-color: rgba(52, 211, 153, 0.45); }
.chip-risk-high { color: var(--red); border-color: rgba(248, 113, 113, 0.5); }
.chip-risk-medium { color: var(--amber); border-color: rgba(251, 191, 36, 0.45); }
.chip-risk-low { color: var(--muted); }

.flow { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(90px, auto) minmax(110px, 1fr); align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 6px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }
.flow-end { font-weight: 600; color: var(--text-strong); }
.flow-end:last-of-type { text-align: left; }
.flow-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.flow-arrow::after { content: ""; width: 100%; height: 2px; background: var(--grad); border-radius: 2px; }
.flow-mode { font-size: 10.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.flow-what { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

.decisions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.decision[data-status="open"] { border-color: rgba(251, 191, 36, 0.35); }

.d-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.d-list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.d-list li { margin-bottom: 4px; }
.d-list.asks { list-style: none; padding: 0; }
.ask { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; margin-bottom: 6px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.risk { list-style: none; margin-left: -18px; }

.d-facts > summary { cursor: pointer; list-style: none; }
.d-facts > summary::-webkit-details-marker { display: none; }
.d-facts > summary h3::after { content: "  ▸"; }
.d-facts[open] > summary h3::after { content: "  ▾"; }
.fact-group { display: block; margin: 12px 0 6px; }
.fact { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }

/* ---------------- coverage ---------------- */
.coverage { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.ring { width: 66px; height: 66px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring-track { stroke: var(--s3); }
.ring-fill { stroke: var(--blue); stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; transition: stroke-dashoffset 0.5s ease; }
.coverage-text { display: flex; flex-direction: column; gap: 1px; }
.coverage-text strong { font-family: var(--mono); font-size: 22px; color: var(--text-strong); }

.map { overflow-y: auto; max-height: calc(100vh - 430px); }
.dim { display: block; width: 100%; padding: 10px 16px; text-align: left; color: inherit; font: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; cursor: pointer; transition: background 0.15s; }
.dim:hover { background: rgba(255, 255, 255, 0.03); }
.dim[aria-pressed="true"] { background: rgba(243, 192, 103, 0.1); border-left-color: var(--blue); }
.dim-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dim-name { font-weight: 600; color: var(--text-strong); font-size: 13.5px; }
.dim-counts { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.dim-hint { margin: 2px 0 7px; font-size: 11.5px; color: var(--muted); }
.bar { height: 4px; background: var(--s3); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 0.4s; }
.dim[data-empty="true"] .dim-name { color: var(--muted); font-weight: 500; }
.map-foot { padding: 14px 16px 16px; }

/* ---------------- status bar + dialogs ---------------- */
.statusbar { display: flex; align-items: center; gap: 18px; margin-top: 14px; padding: 9px 16px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; flex-wrap: wrap; }
.status-item { font-family: var(--mono); font-size: 11px; }
.spacer { flex: 1; }

dialog { padding: 0; color: var(--text); background: var(--s2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65); max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(8, 8, 7, 0.72); backdrop-filter: blur(3px); }
.dialog-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
.dialog-body h3 { font-size: 16px; color: var(--text-strong); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
dialog:has(.wide-dialog) { max-width: 980px; }
.brief-text { margin: 0; max-height: 58vh; overflow: auto; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; color: #e5e3e0; }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }

.scaffold-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr); gap: 12px; }
.scaffold-tree { display: flex; flex-direction: column; max-height: 58vh; overflow-y: auto; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.scaffold-tree button { text-align: left; padding: 5px 10px; font-family: var(--mono); font-size: 11.5px; color: var(--text); background: transparent; border: 0; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.scaffold-tree button:hover { background: rgba(255, 255, 255, 0.05); }
.scaffold-tree button[aria-current="true"] { background: rgba(243, 192, 103, 0.18); color: #fff; }

a.skip-link { position: absolute; left: -999px; }
a.skip-link:focus { left: 12px; top: 12px; z-index: 10; padding: 8px 12px; background: var(--blue); color: #fff; border-radius: 8px; }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

@media (max-width: 1400px) {
  .grid { grid-template-columns: minmax(300px, 1fr) minmax(420px, 1.4fr); }
  .map-panel { grid-column: 1 / -1; }
  .map { max-height: none; }
  .transcript, .board, .design { max-height: 56vh; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .scaffold-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.live-status { display: flex; align-items: center; gap: 9px; margin: 0 16px 6px; font-size: 12.5px; color: var(--muted); }
.live-status .live-dot { background: var(--green); animation: blink 1.4s ease-in-out infinite; }

/* ---- customer, projects, saved-call review, transcript <-> questions links ---- */
.field.customer { width: 190px; }
.field.cust { width: 270px; position: relative; }
.field.customer input { width: 100%; }

.review-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border: 1px solid rgba(245, 174, 133, 0.4); border-radius: var(--radius-sm); background: linear-gradient(135deg, rgba(241, 181, 77, 0.12), rgba(244, 164, 118, 0.12)); }
.review-bar strong { color: var(--text-strong); }
.review-sub { color: var(--muted); font-size: 12.5px; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.line-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 16px 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: rgba(243, 192, 103, 0.1); border: 1px solid rgba(243, 192, 103, 0.3); font-size: 13px; color: var(--text-strong); }

.transcript-line { cursor: pointer; border-radius: 6px; }
.transcript-line:hover { background: rgba(255, 255, 255, 0.03); }
.transcript-line.is-linked { background: rgba(243, 192, 103, 0.14); box-shadow: inset 2px 0 0 var(--blue); }
.line-q { margin-left: auto; flex: none; align-self: flex-start; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

.projects-body { min-width: min(720px, 90vw); }
.projects-list { max-height: 60vh; overflow-y: auto; padding: 4px 2px; }
.project { margin-bottom: 16px; }
.project-name { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.call { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); }
.call-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.call-info strong { color: var(--text-strong); }
.call-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- projects: one space per customer ---- */
.projects-split { display: grid; grid-template-columns: 200px 1fr; gap: 16px; min-height: 340px; }
.projects-nav { display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; padding-right: 4px; border-right: 1px solid var(--line); }
.project-tab { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.project-tab:hover { background: rgba(255, 255, 255, 0.04); }
.project-tab[aria-current="true"] { background: rgba(243, 192, 103, 0.14); color: var(--text-strong); box-shadow: inset 2px 0 0 var(--blue); }
.project-tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projects-detail { max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.project-title { font-size: 17px; color: var(--text-strong); }
.call-card { padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); }
.call-top { display: flex; align-items: center; gap: 8px; }
.call-context { margin: 8px 0 6px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.call-questions summary { cursor: pointer; font-size: 12.5px; color: var(--blue); padding: 4px 0; }
.call-q { padding: 8px 0 8px 10px; border-left: 2px solid var(--line); margin: 6px 0; }
.call-q[data-status="answered"] { border-left-color: var(--green); }
.call-q-text { margin-top: 4px; color: var(--text-strong); }
.call-q-answer { margin-top: 3px; color: var(--text); font-size: 13.5px; }
.call-q-answer::before { content: "Answer: "; color: var(--muted); }

/* ---- sign-in page ---- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 32px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.03); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.login-card .logo { height: 34px; margin-bottom: 10px; }
.login-card .company { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.login-card h1 { margin: 4px 0 6px; font-size: 24px; color: var(--text-strong); }
.login-sub { color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input { width: 100%; }
.login-error { padding: 9px 12px; border-radius: var(--radius-sm); background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: #fecaca; font-size: 13px; }
.login-card .note { margin-top: 16px; }

.account { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 12px; }
.account-name { color: var(--muted); font-size: 13px; }

/* ---- diagram, graph, export ---- */
.diagram-wrap { padding: 12px 16px 16px; }
.diagram-frame { width: 100%; height: calc(100vh - 300px); min-height: 380px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #12110f; }
.graph-body { display: grid; grid-template-columns: 1fr 230px; gap: 14px; padding: 8px 16px 16px; }
.graph-svg { width: 100%; height: calc(100vh - 320px); min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: radial-gradient(circle at 50% 40%, rgba(243, 192, 103, 0.06), transparent 70%); }
.graph-node { cursor: pointer; outline: none; }
.graph-node:focus-visible circle { stroke: #fff; }
.graph-label { fill: var(--text-strong); font-size: 12px; paint-order: stroke; stroke: #12110f; stroke-width: 3px; }
.graph-edge-label { fill: var(--muted); font-size: 10px; paint-order: stroke; stroke: #12110f; stroke-width: 3px; }
.graph-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.graph-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-item i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.graph-detail { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); overflow-y: auto; max-height: calc(100vh - 420px); }
.graph-detail-title { color: var(--text-strong); font-size: 15px; margin-bottom: 4px; }

.export-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.export-item { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); color: var(--text); font: inherit; cursor: pointer; }
.export-item:hover:not(:disabled) { border-color: rgba(243, 192, 103, 0.5); background: rgba(243, 192, 103, 0.08); }
.export-item:disabled { opacity: 0.55; cursor: progress; }
.export-item strong { color: var(--text-strong); }
.export-item span { font-size: 12.5px; color: var(--muted); }

/* the workspace is not wide: the graph takes the full width, details sit underneath */
.graph-body { display: flex; flex-direction: column; }
.graph-svg { height: clamp(320px, calc(100vh - 480px), 560px); }
.graph-side { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
.graph-legend { flex: 1 1 100%; }
.graph-detail { flex: 1 1 100%; max-height: 220px; }

/* the customer logo: a white tile (logos are made for light backgrounds) with a monogram until there is one */
.clogo { --s: 40px; --h: 38; position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; width: var(--s); height: var(--s); padding: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: calc(var(--s) * 0.26); background: linear-gradient(135deg, hsl(var(--h) 70% 46%), hsl(calc(var(--h) + 40) 70% 32%)); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.7); }
.clogo-mono { font-size: calc(var(--s) * 0.38); font-weight: 800; letter-spacing: 0.02em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.clogo img { position: absolute; inset: 0; width: 100%; height: 100%; padding: calc(var(--s) * 0.14); box-sizing: border-box; object-fit: contain; background: #fff; opacity: 0; transition: opacity 0.35s ease; }
.clogo[data-has="1"] img { opacity: 1; }
.clogo[data-has="1"] .clogo-mono { opacity: 0; }
.cust-logo { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease; }
.cust-logo:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(236, 156, 19, 0.55); }
.cust-logo[data-state="loading"]::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%); background-size: 200% 100%; animation: clogo-shimmer 1.1s linear infinite; }
@keyframes clogo-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.cust-row { display: flex; gap: 10px; align-items: center; }
.cust-row input { flex: 1; min-width: 0; }
.cust-note { min-height: 14px; font-size: 11px; color: var(--muted); }
.cust-pop { position: absolute; z-index: 40; top: 100%; left: 0; width: 340px; margin-top: 6px; padding: 14px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: #2b2721; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.85); }
.cust-pop[hidden] { display: none; }
.pop-head { display: flex; gap: 12px; align-items: center; }
.pop-head strong { display: block; font-size: 15px; color: var(--text-strong); }
.pop-sub { font-size: 11.5px; color: var(--muted); }
.pop-row { display: flex; gap: 8px; align-items: center; }
.pop-row input { flex: 1; min-width: 0; }
.pop-cands { display: grid; gap: 4px; }
.pop-cand { display: grid; gap: 1px; padding: 6px 10px; text-align: left; font: inherit; color: var(--text); cursor: pointer; border: 1px solid var(--line); border-radius: 10px; background: rgba(236, 156, 19, 0.06); }
.pop-cand:hover { border-color: var(--neon); }
.pop-cand span { font-size: 11.5px; color: var(--muted); }
.pop-status { margin: 0; min-height: 16px; font-size: 12.5px; color: #5ef0b0; }
.pop-status[data-bad="1"] { color: #ffc857; }
.pop-note { margin: 0; font-size: 11px; line-height: 1.45; color: var(--muted); }
.dash-logo { display: inline-flex; margin-right: 10px; vertical-align: middle; }
