:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #eef2f4;
  --border: #e3e8ec;
  --border-strong: #cfd7de;
  --text: #0f1b24;
  --text-2: #4a5b68;
  --text-3: #7b8b97;
  --accent: #0f766e;
  --accent-hover: #0b5f58;
  --accent-soft: #e2f4f1;
  --accent-text: #0b5f58;
  --on-accent: #ffffff;
  --blue: #2563eb;
  --blue-soft: #e8effd;
  --amber: #b45309;
  --amber-soft: #fef3dc;
  --amber-border: #f3d28b;
  --red: #c2362f;
  --red-soft: #fdecea;
  --green: #15803d;
  --green-soft: #e3f5ea;
  --shadow-sm: 0 1px 2px rgba(15, 27, 36, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 27, 36, 0.07);
  --shadow-lg: 0 12px 32px rgba(15, 27, 36, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1217;
    --surface: #131b22;
    --surface-2: #17212a;
    --surface-3: #1d2933;
    --border: #223039;
    --border-strong: #2f414d;
    --text: #e8eef2;
    --text-2: #a5b4bf;
    --text-3: #75868f;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: #11332f;
    --accent-text: #5eead4;
    --on-accent: #04201d;
    --blue: #7ea6ff;
    --blue-soft: #16264a;
    --amber: #f5b64a;
    --amber-soft: #33270f;
    --amber-border: #5c4516;
    --red: #ff8a80;
    --red-soft: #3a1a18;
    --green: #5fd68b;
    --green-soft: #12301f;
    --shadow-sm: none;
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
  height: 100dvh;
  max-width: 1680px;
  margin: 0 auto;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #0a4f49);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
}
.brand-mark svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}
.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand p {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}
.topbar-spacer {
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 550;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover:not(:disabled) {
  background: var(--surface-3);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-danger {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, var(--border));
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-soft);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
}
.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 8px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.live {
  background: var(--green-soft);
  color: var(--green);
}
.pill.live .dot {
  animation: pulse 1.4s ease-in-out infinite;
}
.pill.busy {
  background: var(--amber-soft);
  color: var(--amber);
}
.pill.error {
  background: var(--red-soft);
  color: var(--red);
}
.pill.done {
  background: var(--blue-soft);
  color: var(--blue);
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent);
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}

/* Summary strip */
.summary {
  margin: 0 24px;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat {
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid var(--border);
}
.stat:first-child {
  border-left: 0;
  padding-left: 0;
}
.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.stat-value.muted {
  color: var(--text-3);
  font-weight: 500;
}
.mini-bar {
  height: 5px;
  margin-top: 7px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.mini-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Mobile tabs */
.tabs {
  display: none;
}

/* Workspace */
.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 5fr) minmax(0, 7fr);
  gap: 16px;
  padding: 16px 24px;
  min-height: 0;
}
.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.panel-head .sub {
  font-size: 12px;
  color: var(--text-3);
}
.panel-head .grow {
  flex: 1;
  min-width: 0;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scroll-behavior: smooth;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.badge svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}
.badge.green {
  background: var(--green-soft);
  color: var(--green);
}
.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
}
.badge.red {
  background: var(--red-soft);
  color: var(--red);
}
.badge.accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---------- Transcript ---------- */
.transcript {
  padding: 8px 20px 16px;
}
.turn {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: rise 0.25s ease;
}
.turn:last-child {
  border-bottom: 0;
}
.turn.flash {
  animation: flash 1.6s ease;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes flash {
  0%,
  30% {
    background: var(--amber-soft);
    box-shadow: 0 0 0 8px var(--amber-soft);
  }
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 13px;
  flex: none;
}
.avatar.applicant {
  background: var(--blue-soft);
  color: var(--blue);
}
.avatar.assistant {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.turn-main {
  flex: 1;
  min-width: 0;
}
.turn-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.turn-name {
  font-weight: 600;
  font-size: 13.5px;
}
.turn-time {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.turn-text {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.turn.speaking .turn-text::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 14px;
  margin-left: 3px;
  vertical-align: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.empty {
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 32px 28px;
  color: var(--text-3);
}
.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.empty-icon svg {
  width: 28px;
  height: 28px;
}
.empty h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}
.empty p {
  margin: 0;
  max-width: 360px;
  font-size: 13.5px;
}
.empty .btn {
  margin-top: 14px;
}

/* Audio dock */
.dock {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-md);
  flex: none;
}
.mic-btn:disabled {
  background: var(--surface-3);
  color: var(--text-3);
  box-shadow: none;
  cursor: not-allowed;
}
.mic-btn.muted {
  background: var(--red);
  color: #fff;
}
.mic-btn svg {
  width: 18px;
  height: 18px;
}
.wave {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.wave span {
  flex: 1;
  min-width: 2px;
  max-width: 5px;
  height: 4px;
  border-radius: 3px;
  background: var(--border-strong);
  transition: height 0.08s linear, background 0.15s;
}
.wave.active span {
  background: var(--accent);
}
.dock-label {
  min-width: 86px;
  text-align: right;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- Statement panel ---------- */
.stmt-scroll {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.banner {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.banner svg {
  margin-top: 2px;
  color: var(--text-3);
}
.banner.warn {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: var(--amber);
}
.banner.warn svg {
  color: var(--amber);
}
.banner.error {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
  color: var(--red);
  font-weight: 550;
}
.banner.error svg {
  color: var(--red);
}
.banner ul {
  margin: 0;
  padding-left: 16px;
}

/* Coverage card */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
}
.card-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
}
.card-head .grow {
  flex: 1;
  min-width: 0;
}
.chev {
  transition: transform 0.2s;
  color: var(--text-3);
}
.collapsed .chev {
  transform: rotate(-90deg);
}
.collapsed .card-body {
  display: none;
}
.coverage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.cov {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.cov-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
  background: var(--surface-3);
  color: var(--text-3);
}
.cov-icon svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}
.cov.ok .cov-icon {
  background: var(--green-soft);
  color: var(--green);
}
.cov-title {
  font-weight: 600;
  font-size: 13px;
}
.cov-notes {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}

/* Generate hero */
.hero {
  padding: 28px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.hero .empty-icon {
  margin: 0 auto 12px;
}
.hero h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.hero p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--text-3);
  font-size: 13.5px;
}

/* Draft summary chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.progress {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.progress .mini-bar {
  flex: 1;
  margin: 0;
}

/* Section cards */
.sec {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sec:hover {
  border-color: var(--border-strong);
}
.sec.reviewed {
  border-left: 3px solid var(--green);
}
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.sec-num {
  min-width: 26px;
  padding: 0 6px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 12.5px;
  font-weight: 650;
  background: var(--surface-3);
  color: var(--text-2);
}
.sec-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
.sec-title h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
}
.sec.collapsed .sec-body {
  display: none;
}
.sec-body {
  padding: 0 16px 16px 54px;
}
.para {
  display: flex;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
.para-n {
  flex: none;
  width: 22px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}
.para-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.para textarea,
.sec-body textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
mark.confirm {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  scroll-margin: 120px;
}
mark.confirm.flash {
  animation: markflash 1.4s ease;
}
@keyframes markflash {
  0%,
  40% {
    box-shadow: 0 0 0 4px var(--amber-border);
  }
}
.refs {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: 1px;
}
.ref {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  height: 18px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}
.ref:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.sec-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sec-foot .grow {
  flex: 1;
}
.gap-box {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 4px;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--text-2);
  font-size: 13px;
}
.gap-box svg {
  color: var(--blue);
  margin-top: 2px;
}
.gap-box b {
  color: var(--text);
  font-weight: 600;
}
.gap-box small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
}
.group-head {
  margin: 14px 2px 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text-2);
}
.group-head small {
  display: block;
  margin-top: 2px;
  font-weight: 450;
  color: var(--text-3);
}
.ftable {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  font-size: 13.5px;
  table-layout: fixed;
}
.ftable th,
.ftable td {
  text-align: left;
  vertical-align: top;
  padding: 7px 10px;
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.ftable th {
  width: 38%;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
}
.ftable td.empty {
  color: var(--text-3);
}
.ftable textarea {
  min-height: 38px;
}
.opts {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 14px;
}
.opts li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 2px 0;
}
.opts .box {
  flex: none;
  font-size: 15px;
}
.opts li.on {
  font-weight: 600;
}
.opts .detail {
  font-weight: 400;
  color: var(--text-2);
}
.sub-label {
  margin: 4px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.sec-none {
  margin: 0 0 8px;
  color: var(--text-3);
  font-size: 13.5px;
  font-style: italic;
}
.sign {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.sign div {
  border-top: 1px solid var(--border-strong);
  padding-top: 6px;
  margin-top: 28px;
}
.sign p {
  grid-column: 1 / -1;
  margin: 0;
}

/* Skeletons */
.skel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 16px;
  display: grid;
  gap: 10px;
}
.skel i {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: var(--surface-3);
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 80%, transparent) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Menu */
.menu-wrap {
  position: relative;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 210px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: none;
}
.menu.open {
  display: block;
}
.menu button,
.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
}
.menu button:hover:not(:disabled),
.menu a:hover {
  background: var(--surface-3);
}
.menu button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.menu a.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Popover for source refs */
.pop {
  position: fixed;
  z-index: 50;
  max-width: 340px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.pop b {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 60;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Stepper ---------- */
.stepper {
  display: flex;
  align-items: center;
  padding: 14px 24px 18px;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 12.5px;
  font-weight: 650;
  background: var(--surface-3);
  color: var(--text-3);
  border: 2px solid transparent;
  transition: all 0.25s;
}
.step-dot svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.8;
}
.step-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.step-sub {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.step.done .step-dot {
  background: var(--accent);
  color: var(--on-accent);
}
.step.current .step-dot {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.step.current .step-title {
  color: var(--accent-text);
}
.step-line {
  flex: 1;
  min-width: 16px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.step-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}
.step-line.done::after {
  transform: scaleX(1);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 14px;
  }
  .stat:nth-child(4) {
    border-left: 0;
    padding-left: 0;
  }
  .step-sub {
    display: none;
  }
}
@media (max-width: 860px) {
  .app {
    height: auto;
    min-height: 100dvh;
  }
  .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .summary {
    margin: 0 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat,
  .stat:nth-child(4) {
    border-left: 0;
    padding-left: 0;
  }
  .tabs {
    display: flex;
    gap: 6px;
    margin: 12px 16px 0;
    padding: 4px;
    background: var(--surface-3);
    border-radius: 11px;
  }
  .tabs button {
    flex: 1;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-weight: 600;
    color: var(--text-2);
  }
  .tabs button[aria-selected="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 16px;
  }
  .workspace[data-view="call"] #statementPanel,
  .workspace[data-view="statement"] #callPanel {
    display: none;
  }
  .panel {
    min-height: 70vh;
  }
  body {
    overflow-x: hidden;
  }
  .panel-head {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
  .panel-head .grow {
    flex-basis: 100%;
  }
  .topbar-actions {
    flex: 1 0 100%;
  }
  .topbar-actions .btn {
    flex: 1;
  }
  .stmt-scroll {
    padding: 12px 14px 20px;
  }
  .coverage-list {
    grid-template-columns: 1fr;
  }
  .stepper {
    padding: 12px 16px 16px;
    overflow-x: auto;
  }
  .step-title {
    display: none;
  }
  .sec-body {
    padding-left: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .topbar,
  .summary,
  .tabs,
  #callPanel,
  .stepper,
  .panel-head .btn,
  .menu-wrap,
  .banner,
  .card,
  .hero,
  .sec-foot,
  .gap-box,
  .sec-num,
  .chips,
  .refs {
    display: none !important;
  }
  .app,
  .workspace,
  .panel,
  .panel-body {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    border: 0;
    box-shadow: none;
  }
  .sec {
    break-inside: avoid;
    border: 0;
    box-shadow: none;
  }
  .sec.collapsed .sec-body {
    display: block;
  }
  .sec-body {
    padding-left: 0;
  }
}
