:root {
  --navy: #0d1f33;
  --navy-2: #16304d;
  --gold: #c8a24a;
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #18212b;
  --muted: #667085;
  --line: #e4e7ec;
  --green: #12805c;
  --green-bg: #e7f6ef;
  --amber: #b54708;
  --amber-bg: #fff4e5;
  --red: #c4320a;
  --red-bg: #fdeee9;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
  display: flex; flex-direction: column; min-height: 100vh;
}
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row.gap { justify-content: flex-start; gap: 10px; }

/* header */
.top {
  background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 20px; padding: 10px 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: var(--navy);
  display: grid; place-items: center; font-weight: 800; letter-spacing: .5px;
}
.brand-name { font-weight: 700; }
.brand-sub { font-size: 12px; opacity: .7; }
.calltype { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .95; }
.calltype select {
  background: var(--navy-2); color: #fff; border: 1px solid #2d4a6b; border-radius: 6px; padding: 6px 8px; font: inherit;
}
.status { display: flex; align-items: center; gap: 10px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.idle { background: #263b55; color: #c9d4e2; }
.pill.live { background: #d92d20; color: #fff; animation: pulse 1.6s infinite; }
.pill.paused { background: var(--amber-bg); color: var(--amber); }
.pill.notes { background: #e0e7ff; color: #3538cd; }
.pill.demo { background: var(--gold); color: var(--navy); }
@keyframes pulse { 50% { opacity: .75; } }
.timer { font-variant-numeric: tabular-nums; opacity: .85; }
.actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 12px; border-radius: 7px; font-weight: 600;
}
.top .btn { border-color: #2d4a6b; background: var(--navy-2); color: #fff; }
.btn.primary, .top .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.danger, .top .btn.danger { background: #fff; color: var(--red); border-color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:hover { filter: brightness(.97); }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: 40px; z-index: 20; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  display: flex; flex-direction: column; min-width: 280px; padding: 6px;
}
.menu-list button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; }
.menu-list button:hover { background: var(--bg); }

/* readiness */
.readiness { display: flex; align-items: center; gap: 14px; padding: 10px 18px; font-weight: 600; }
.readiness.ok { background: var(--green-bg); color: var(--green); }
.readiness.no { background: var(--amber-bg); color: var(--amber); }
.ready-count { font-size: 20px; font-variant-numeric: tabular-nums; min-width: 52px; }
.meter { width: 160px; height: 8px; border-radius: 99px; background: rgba(0,0,0,.08); overflow: hidden; flex: none; }
.meter span { display: block; height: 100%; background: currentColor; transition: width .4s; }
.ready-msg { flex: 1; font-size: 13px; }
.notice { background: #eef4ff; color: #1849a9; padding: 8px 18px; font-size: 13px; }

/* layout */
.grid {
  flex: 1; display: grid; grid-template-columns: minmax(280px, 340px) minmax(360px, 1fr) minmax(300px, 400px);
  gap: 14px; padding: 14px 18px; align-items: start;
}
@media (max-width: 1100px) { .grid { grid-template-columns: 1fr 1fr; } .col-transcript { grid-column: 1 / -1; } }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }

/* next question */
.next-card { border: 2px solid var(--gold); position: sticky; top: 10px; }
.next-q { font-size: 21px; line-height: 1.3; font-weight: 650; color: var(--navy); }
.next-alt { margin-top: 8px; color: var(--muted); }
.next-why { margin-top: 8px; font-size: 12px; color: var(--muted); }
.next-actions { margin-top: 12px; display: flex; gap: 8px; }
.then-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.then-list li { cursor: pointer; }
.then-list li:hover { color: var(--navy); text-decoration: underline; }
.then-list li.snoozed { color: var(--muted); }
.file-list { margin: 0; font-size: 13px; }
.file-list dt { color: var(--muted); font-size: 11px; margin-top: 6px; }
.file-list dd { margin: 0; }
.reject-list { margin: 0; padding-left: 18px; font-size: 12px; color: var(--amber); display: flex; flex-direction: column; gap: 4px; }

/* intake */
#intake { display: flex; flex-direction: column; gap: 14px; }
.group .count { font-variant-numeric: tabular-nums; }
.frow { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: start; }
.frow:first-of-type { border-top: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; border: 2px solid var(--red); background: transparent; }
.frow.partial .dot { border-color: var(--amber); background: var(--amber); }
.frow.answered .dot { border-color: var(--green); background: var(--green); }
.frow.na .dot { border-color: #98a2b3; background: #98a2b3; }
.group-extra .frow.missing .dot { border-color: #98a2b3; }
.flabel { font-weight: 600; font-size: 13px; }
.fval { font-size: 14px; }
.frow.missing .fval { color: var(--red); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.group-extra .frow.missing .fval { color: var(--muted); }
.frow.na .fval { color: var(--muted); }
.frow.partial .fval { color: var(--amber); }
.fev { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 2px; }
.tag { margin-left: 8px; font-size: 10px; font-weight: 600; color: var(--muted); background: var(--bg); padding: 1px 6px; border-radius: 99px; }
.ftools { display: flex; gap: 2px; }
.icon { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 3px 6px; border-radius: 5px; }
.icon:hover { background: var(--bg); color: var(--ink); }
.fedit { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.fedit input:not([type]) , .fedit input[type="text"] { flex: 1; min-width: 160px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.frow.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0% { background: #fff3c4; } 100% { background: transparent; } }

/* transcript */
.transcript-card { position: sticky; top: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 170px); }
.ai-state { text-transform: none; letter-spacing: 0; font-weight: 500; }
.transcript { overflow-y: auto; flex: 1; min-height: 240px; padding-right: 4px; }
.seg { margin: 0 0 8px; display: grid; grid-template-columns: 58px 1fr; gap: 6px; }
.seg .ts { color: var(--muted); font-size: 11px; padding-top: 2px; }
.seg.typed span:last-child { color: #3538cd; }
.seg.interim { color: var(--muted); font-style: italic; display: block; }
.note-form { display: flex; gap: 6px; margin-top: 10px; }
.note-form input { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }

.foot { padding: 10px 18px 16px; font-size: 12px; color: var(--muted); text-align: center; }

/* dialogs */
.dlg { border: 0; border-radius: 12px; padding: 22px; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg.wide { max-width: 860px; }
.dlg::backdrop { background: rgba(13,31,51,.55); }
.dlg h2 { margin: 0 0 8px; font-size: 19px; color: var(--navy); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.script { margin: 12px 0; padding: 14px 16px; background: #fbf6e9; border-left: 4px solid var(--gold); font-size: 16px; border-radius: 6px; }
.summary-status { padding: 10px 12px; border-radius: 8px; font-weight: 600; margin: 8px 0 12px; font-size: 13px; }
.summary-status.ok { background: var(--green-bg); color: var(--green); }
.summary-status.no { background: var(--red-bg); color: var(--red); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { border: 0; background: none; padding: 8px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.out { width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.all-row { display: grid; grid-template-columns: 240px 1fr; gap: 2px 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.all-row i { grid-column: 2; color: var(--muted); font-size: 12px; }
.all-row.missing span { color: var(--red); font-weight: 700; }
.all-row.partial span { color: var(--amber); }
#importText { width: 100%; margin-top: 10px; font: 12px ui-monospace, monospace; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.tips { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
