:root {
  color-scheme: light;
  --ink: #142432;
  --ink-soft: #50616d;
  --navy: #102e42;
  --navy-deep: #092231;
  --teal: #087f79;
  --teal-soft: #e0f2ef;
  --amber: #cc8a21;
  --amber-soft: #fff4d9;
  --red: #b94b4b;
  --red-soft: #fae8e6;
  --green: #3f7d5c;
  --green-soft: #e4f1e9;
  --paper: #f4f1ea;
  --surface: #fffdf9;
  --line: #d8ddd9;
  --shadow: 0 18px 50px rgba(17, 42, 55, 0.09);
  --radius-lg: 20px;
  --radius-md: 13px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: white;
  background: var(--navy);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(20, 36, 50, 0.12);
  background: rgba(244, 241, 234, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark, .brand-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 11px 11px 11px 3px;
  background: var(--navy);
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.04em;
}
.brand-logo { object-fit: cover; border: 1px solid rgba(20, 36, 50, .08); background: white; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: var(--serif); font-size: 18px; letter-spacing: -0.02em; }
.brand small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.privacy-chip, .connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--green);
  border: 1px solid #bfd5c8;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.7);
  font-size: 12px;
  font-weight: 700;
}
.privacy-chip span { font-size: 8px; }
.topbar-actions, .consultant-chip { display: flex; align-items: center; gap: 10px; }
.consultant-chip { padding: 6px 7px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 800; }
.consultant-chip button { padding: 5px 9px; color: var(--red); border: 0; border-radius: 999px; background: var(--red-soft); font-size: 11px; font-weight: 800; }

main { width: 100%; }
.login-view { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 38px 20px; }
.login-card { width: min(460px, 100%); padding: clamp(24px, 5vw, 42px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.login-logo { width: 76px; height: 76px; margin-bottom: 22px; object-fit: cover; border-radius: 18px 18px 18px 6px; box-shadow: 0 10px 25px rgba(16, 46, 66, .12); }
.login-card h1 { margin: 0; font-family: var(--serif); font-size: clamp(34px, 6vw, 48px); font-weight: 500; line-height: 1.05; }
.login-card > p:not(.eyebrow) { margin: 16px 0 24px; color: var(--ink-soft); line-height: 1.55; }
.login-card form { display: grid; gap: 15px; }
.team-card { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 253, 249, .72); }
.team-card summary { cursor: pointer; color: var(--teal); font-size: 13px; font-weight: 800; }
.team-card > p { color: var(--ink-soft); font-size: 12px; }
.team-card form { display: grid; gap: 12px; }
.setup-view {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  padding: 60px 0 80px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow.accent { color: var(--amber); }
.setup-copy h1 {
  max-width: 680px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.lede { max-width: 620px; margin: 25px 0 32px; color: var(--ink-soft); font-size: 18px; line-height: 1.65; }

.setup-card {
  max-width: 620px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.field { min-width: 0; }
.field label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.field small { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 11px; }
select, input {
  width: 100%;
  height: 45px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid #c7cfcc;
  border-radius: 9px;
  outline: none;
  background: white;
}
select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 121, 0.13); }
.secret-field { position: relative; }
.secret-field input { padding-right: 54px; }
.reveal-button { position: absolute; inset: 5px 5px 5px auto; border: 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 800; }
.primary-button {
  grid-column: 1 / -1;
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: white;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  font-weight: 800;
}
.primary-button:hover { background: var(--navy-deep); }
.primary-button:disabled { opacity: 0.65; cursor: wait; }
.form-error { grid-column: 1 / -1; margin: 0; color: var(--red); font-size: 13px; }

.orientation-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: white;
  background: var(--navy);
  box-shadow: 0 30px 70px rgba(9, 34, 49, 0.22);
}
.orientation-header { display: flex; align-items: center; gap: 10px; padding: 22px 26px; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #6bd1c2; box-shadow: 0 0 0 5px rgba(107,209,194,.12); }
.orientation-list { margin: 0; padding: 12px 26px; list-style: none; }
.orientation-list li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.orientation-list li > span { color: #78d5c9; font-family: var(--serif); font-size: 15px; }
.orientation-list strong { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.orientation-list p { margin: 6px 0 0; color: #bfd0d8; font-size: 13px; line-height: 1.5; }
.orientation-note { margin: 0; padding: 18px 26px; color: #9eb4bf; background: rgba(0,0,0,.12); font-size: 11px; }

.workspace { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 60px; }
.session-strip { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.session-title-row { display: flex; align-items: center; gap: 13px; }
.session-title-row h1 { margin: 0; font-family: var(--serif); font-size: 36px; font-weight: 500; }
.connection-badge[data-state="connected"] { color: var(--green); }
.connection-badge[data-state="connecting"] { color: var(--amber); border-color: #ead09a; }
.connection-badge[data-state="disconnected"] { color: var(--red); border-color: #e5b8b4; }
.session-meta { display: flex; align-items: center; gap: 10px; }
.session-meta > span { min-width: 72px; padding-right: 18px; text-align: right; }
.session-meta small, .session-meta strong { display: block; }
.session-meta small { color: var(--ink-soft); font-size: 10px; text-transform: uppercase; }
.session-meta strong { margin-top: 2px; font-variant-numeric: tabular-nums; }
.secondary-button, .end-button, .report-button, .copy-question, .microphone-button { min-height: 38px; padding: 0 14px; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 800; }
.secondary-button { color: var(--navy); border: 1px solid #bdc8c9; }
.end-button { color: var(--red); border: 1px solid #dfbfbb; }
.report-button { color: white; border: 1px solid var(--navy); background: var(--navy); }
.report-button:hover { background: var(--navy-deep); }
.report-button:disabled { opacity: .6; cursor: wait; }
.microphone-button { color: var(--teal); border: 1px solid #96c8c3; }
.microphone-button.recording { color: white; border-color: var(--red); background: var(--red); }
.microphone-button:disabled { opacity: .6; cursor: wait; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(350px, .75fr); gap: 22px; align-items: start; }
.primary-column, .insight-column { display: grid; gap: 22px; }
.panel, .question-card, .objective-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 8px 26px rgba(17,42,55,.045); }
.question-card { min-height: 230px; padding: 25px 28px; border-top: 4px solid var(--amber); }
.card-heading-row, .panel-header { display: flex; justify-content: space-between; gap: 20px; }
.card-heading-row h2, .panel-header h2, .objective-card h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.priority-badge, .count-badge { display: inline-grid; place-items: center; border-radius: 999px; font-size: 11px; font-weight: 800; }
.priority-badge { height: 27px; padding: 0 10px; color: #8b5c0f; background: var(--amber-soft); }
.count-badge { width: 28px; height: 28px; color: var(--teal); background: var(--teal-soft); }
.question-empty { margin-top: 32px; color: var(--ink-soft); }
.question-empty p { margin: 0 0 5px; font-family: var(--serif); font-size: clamp(24px, 3vw, 36px); line-height: 1.25; }
.question-empty small { color: #7a898e; }
.question-text { max-width: 800px; margin: 28px 0 15px; font-family: var(--serif); font-size: clamp(27px, 3.2vw, 42px); line-height: 1.18; letter-spacing: -.025em; }
.question-rationale { max-width: 760px; color: var(--ink-soft); line-height: 1.55; }
.copy-question { margin-top: 12px; color: #7b5719; border: 1px solid #e2c98f; }

.transcript-panel { min-height: 420px; overflow: hidden; }
.panel-header { padding: 21px 24px; border-bottom: 1px solid var(--line); }
.panel-header.compact { align-items: center; }
.listening-indicator { align-self: center; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.listening-indicator i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #9babae; }
.listening-indicator.active i { background: var(--teal); animation: pulse 1.4s infinite; }
.audio-controls { display: flex; align-items: center; gap: 12px; }
.meeting-capture { border-color: #b8d9d5; background: linear-gradient(135deg, #ffffff, #f4fbfa); }
.capture-explanation { margin: 0 0 14px; color: var(--ink-soft); line-height: 1.55; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 12px; border: 1px solid #d7e3e1; border-radius: 8px; background: white; font-size: 13px; line-height: 1.45; }
.consent-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--teal); }
.capture-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.capture-status { padding: 6px 10px; border-radius: 999px; background: #edf1f1; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.capture-status[data-state="recording"] { color: white; background: var(--red); }
.capture-status[data-state="uploading"] { color: white; background: var(--teal); }
.capture-status[data-state="saved"] { color: white; background: #257250; }
.source-statuses { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--ink-soft); font-size: 12px; }
.source-statuses span { display: inline-flex; align-items: center; gap: 6px; }
.source-statuses i { width: 8px; height: 8px; border-radius: 50%; background: #aab4b4; }
.source-statuses span.active i { background: #2d9d6f; box-shadow: 0 0 0 3px rgba(45,157,111,.13); }
.source-statuses span.error i { background: var(--red); }
.upload-progress { margin-top: 14px; }
.upload-progress > div { height: 8px; overflow: hidden; border-radius: 999px; background: #dfe9e8; }
.upload-progress span { display: block; width: 0; height: 100%; background: var(--teal); transition: width .2s ease; }
.upload-progress small { display: block; margin-top: 6px; color: var(--ink-soft); }
.drive-file-link { display: inline-block; margin-top: 12px; color: var(--teal); font-size: 13px; font-weight: 800; }
.transcript-feed { max-height: 460px; overflow-y: auto; padding: 16px 24px; }
.transcript-entry { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid #e8e9e4; }
.speaker { color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.transcript-entry p { margin: 0; line-height: 1.55; }
.partial-transcript { margin: 0 24px 20px 130px; padding: 12px; color: var(--ink-soft); border-left: 2px solid var(--teal); background: var(--teal-soft); font-style: italic; }
.empty-state { display: grid; place-items: center; min-height: 250px; color: #7a898e; text-align: center; }
.empty-state span { color: #c4cdca; font-family: var(--serif); font-size: 72px; line-height: .5; }
.empty-state p { max-width: 320px; margin: 0; line-height: 1.5; }
.empty-state.small { min-height: 110px; padding: 18px; }
.empty-state.small small { display: block; max-width: 280px; margin-top: 8px; line-height: 1.45; }

.objective-card { padding: 23px 24px; color: white; border: 0; background: var(--navy); }
.objective-card .eyebrow { color: #72cec2; }
.objective-card h2 { color: #dae8eb; font-size: 16px; }
.objective-card > p:last-child { margin: 20px 0 0; font-family: var(--serif); font-size: 23px; line-height: 1.35; }
.evidence-list, .gap-list { max-height: 320px; overflow-y: auto; padding: 8px 20px 16px; }
.evidence-item, .gap-item { padding: 15px 3px; border-bottom: 1px solid #e8e9e4; }
.evidence-item:last-child, .gap-item:last-child { border-bottom: 0; }
.evidence-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.evidence-item h3, .gap-item h3 { margin: 0; font-size: 13px; line-height: 1.4; }
.evidence-item p, .gap-item p { margin: 7px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: #a1aaac; box-shadow: 0 0 0 4px #edf0ef; }
.status-dot.confirmed { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-dot.partial { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.status-dot.mentioned { background: #4f7e9d; box-shadow: 0 0 0 4px #e2edf4; }
.status-dot.nonexistent { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.gap-priority { display: inline-block; margin-top: 8px; padding: 4px 7px; color: #8b5c0f; border-radius: 5px; background: var(--amber-soft); font-size: 10px; font-weight: 800; }

.report-view { outline: none; }
.report-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
  padding: 30px;
  color: white;
  border-radius: var(--radius-lg);
  background: var(--navy);
}
.report-hero .eyebrow { color: #72cec2; }
.report-hero h2 { margin: 0; font-family: var(--serif); font-size: clamp(32px, 4vw, 52px); font-weight: 500; letter-spacing: -.035em; }
.report-hero p:last-child { max-width: 760px; margin: 16px 0 0; color: #c8d8de; line-height: 1.6; }
.report-actions { display: flex; flex: 0 0 auto; gap: 10px; }
.report-actions .secondary-button { color: white; border-color: rgba(255,255,255,.38); }
.compact-button { min-width: 160px; min-height: 40px; grid-column: auto; background: var(--teal); }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 22px; align-items: start; }
.report-evaluation, .report-coverage { padding: 24px; }
.evaluation-title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.report-evaluation h3, .report-coverage h3 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 500; }
.evaluation-status { padding: 7px 10px; color: #8b5c0f; border-radius: 999px; background: var(--amber-soft); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.evaluation-status.ready_for_review { color: var(--green); background: var(--green-soft); }
.evaluation-status.insufficient_data { color: var(--ink-soft); background: #edf0ef; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 24px 0; }
.metric { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f5; }
.metric strong, .metric span { display: block; }
.metric strong { font-family: var(--serif); font-size: 28px; font-weight: 500; }
.metric span { margin-top: 5px; color: var(--ink-soft); font-size: 10px; line-height: 1.3; text-transform: uppercase; }
.observation-item { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 15px 0; border-top: 1px solid #e8e9e4; }
.observation-item i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); }
.observation-item.attention i { background: var(--amber); }
.observation-item strong { font-size: 13px; }
.observation-item p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.report-side { display: grid; gap: 12px; }
.report-coverage dl { display: grid; grid-template-columns: 1fr auto; gap: 11px 20px; margin: 22px 0; }
.report-coverage dt { color: var(--ink-soft); font-size: 12px; }
.report-coverage dd { margin: 0; font-weight: 800; }
.hash-line { margin: 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.hash-line code { display: block; overflow: hidden; margin-top: 5px; color: var(--ink); text-overflow: ellipsis; }
.report-warning { padding: 18px 20px; color: #714e18; border: 1px solid #ead09a; border-radius: var(--radius-md); background: var(--amber-soft); }
.report-warning strong { font-family: var(--serif); font-size: 17px; }
.report-warning p { margin: 8px 0 0; font-size: 11px; line-height: 1.55; }
.wide-button { width: 100%; min-height: 42px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 340px; padding: 13px 16px; color: white; border-radius: 9px; background: var(--navy); box-shadow: var(--shadow); font-size: 13px; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }

@media (max-width: 980px) {
  .setup-view, .workspace-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .setup-view { padding-top: 42px; }
  .orientation-card { max-width: 680px; }
  .insight-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .objective-card { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar { height: 68px; padding: 0 16px; }
  .privacy-chip { display: none; }
  .consultant-chip { max-width: 180px; }
  .consultant-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .setup-view, .workspace { width: min(100% - 24px, 1180px); }
  .setup-view { min-height: auto; padding: 38px 0; }
  .setup-copy h1 { font-size: 44px; }
  .lede { font-size: 16px; }
  .setup-card { grid-template-columns: 1fr; padding: 17px; }
  .session-strip { align-items: flex-start; flex-direction: column; }
  .session-meta { width: 100%; flex-wrap: wrap; }
  .audio-controls { align-items: flex-end; flex-direction: column; }
  .session-meta > span { margin-right: auto; text-align: left; }
  .insight-column { grid-template-columns: 1fr; }
  .objective-card { grid-column: auto; }
  .question-card { padding: 21px; }
  .report-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .report-actions { width: 100%; flex-direction: column; }
  .report-actions button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transcript-entry { grid-template-columns: 1fr; gap: 5px; }
  .partial-transcript { margin-left: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
