/* Meetbot — app shell: sticky top bar, one 1120px column; the home page splits into
   meetings | side panel, the meeting page into transcript | minutes. Everything stacks below 900px. */
/* Colours follow the SDVico logo: its blue drives the UI, its red-orange marks recording. */
:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --fg: #142030;
  --muted: #5a6779;
  --faint: #8a96a7;
  --line: #dfe5ee;
  --accent: #1d63b4;
  --accent-strong: #154f93;
  --accent-fg: #ffffff;
  --accent-soft: #e6effa;
  --brand-blue: #1f64b3;
  --brand-red: #e5432d;
  --warn: #a86400;
  --warn-soft: #fbefd9;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --live: #e5432d;
  --shadow: 0 1px 2px rgba(20, 32, 48, .05), 0 4px 16px rgba(20, 32, 48, .06);
  --shadow-pop: 0 12px 40px rgba(20, 32, 48, .18);
  --radius: 14px;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d131b; --surface: #141c27; --surface-2: #19232f; --fg: #e4eaf2; --muted: #9ba8b8; --faint: #6d7a8a;
    --line: #243142; --accent: #6aa8ef; --accent-strong: #93c1f5; --accent-fg: #07121f; --accent-soft: #1b3150a0;
    --brand-blue: #6cb4fc; --brand-red: #fc846c;
    --warn: #f0b552; --warn-soft: #3a2d1466; --bad: #f2867c; --bad-soft: #3d1f1c80; --live: #ff6a55;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
img, video, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; height: 60px; display: flex; align-items: center; gap: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--fg); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: block; flex: none; }
/* SDVico logo next to Meetbot's: the company image, or its name in brand blue until the file exists. */
.cobrand { display: inline-flex; align-items: center; gap: 14px; }
.company { text-decoration: none; }
.sdv-logo { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.sdv-word { display: inline-flex; align-items: center; font: 600 25px/1 var(--font); letter-spacing: .03em; color: var(--brand-blue); }
.sdv-o { width: .8em; height: .8em; margin-left: .02em; flex: none; }
.sdv-b { fill: var(--brand-blue); }
.sdv-r { fill: var(--brand-red); }
.sdv-tag { font: 400 9.5px/1 var(--font); color: var(--muted); margin-top: 3px; white-space: nowrap; }
.cobrand-divider { width: 1px; height: 26px; background: var(--line); }
/* Thin SDVico blue → red-orange strip along the top of every page. */
.brand-strip { height: 3px; background: linear-gradient(90deg, var(--brand-blue) 0 62%, var(--brand-red) 62% 100%); }
.app-footer { max-width: 1120px; margin: 0 auto; padding: 8px 16px 28px; color: var(--faint); font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.app-footer strong { color: var(--muted); font-weight: 650; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 8px; }
.nav a:hover { color: var(--fg); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--fg); background: var(--surface); box-shadow: var(--shadow); }
.topbar .spacer { flex: 1; }


/* dropdown menus: <details class="menu"><summary>…</summary><div class="menu-list">…</div></details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
  padding: 6px; display: grid;
}
.menu-list.align-left { left: 0; right: auto; }
.menu-list .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-list .menu-head strong { display: block; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  border: 0; background: none; color: var(--fg); font: 500 14px var(--font); text-decoration: none; cursor: pointer;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.menu-list .danger-item { color: var(--bad); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); user-select: none;
}

/* ---------- layout ---------- */
.container {
  max-width: 1120px; margin: 0 auto; display: grid; gap: 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 72px;
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head .lede { color: var(--muted); margin-top: 6px; max-width: 64ch; }
/* Home: the "record a new meeting" form is the main, wide column; the meeting list is a
   narrower column on the right; the extension card sits under the form. */
.home-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start;
  grid-template-areas: "create list" "ext list";
}
.create-card { grid-area: create; padding: 28px; gap: 18px; }
.home-list { grid-area: list; }
.ext-card { grid-area: ext; }
.create-card h1 { display: flex; align-items: center; gap: 14px; font-size: 26px; }
.create-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); flex: none; }
.create-icon .icon { width: 22px; height: 22px; stroke-width: 2; }
.create-card .lede { margin-top: -6px; }
.create-fields { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.create-card input, .create-card select { min-height: 48px; font-size: 16px; }
.create-card .btn.big { min-height: 52px; font-size: 16.5px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 4px; }
/* The narrow list column: status goes under the title. */
.home-list .mrow { grid-template-columns: 38px minmax(0, 1fr); padding: 12px 14px; gap: 12px; }
.home-list .mrow-icon { width: 38px; height: 38px; border-radius: 10px; }
.home-list .mrow-side { grid-column: 2; }
.home-list .mrow-side .chev { display: none; }
.stack { display: grid; gap: 16px; min-width: 0; align-content: start; }
@media (max-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "create" "list" "ext"; }
}
@media (max-width: 560px) {
  .create-card { padding: 18px; }
  .create-card h1 { font-size: 22px; }
  .create-icon { width: 40px; height: 40px; }
  .create-fields { grid-template-columns: minmax(0, 1fr); }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; min-width: 0;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.note { color: var(--muted); font-size: 13.5px; }
.hint { color: var(--faint); font-size: 12.5px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label { font-weight: 600; font-size: 13.5px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; width: 100%; min-width: 0;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--faint) 55%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
textarea { resize: vertical; min-height: 72px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
details.more > summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more[open] { display: grid; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  border-radius: 10px; padding: 9px 16px; font: 600 14px var(--font); cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--fg); }
.btn.ghost:hover { border-color: color-mix(in srgb, var(--faint) 60%, var(--line)); background: var(--surface-2); }
.btn.subtle { background: transparent; color: var(--muted); padding-inline: 10px; }
.btn.subtle:hover { color: var(--fg); background: var(--surface-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.big { padding: 12px 20px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.error { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.ok-box { color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 9px 12px; font-size: 14px; }

/* ---------- status pills, chips ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.status.waiting { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--bad-soft); color: var(--bad); }
.status.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.status.live { background: var(--bad-soft); color: var(--live); }
.status.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chip.ok::before { background: var(--accent); }
.chip.warn::before { background: var(--warn); }
.chip.bad::before { background: var(--bad); }

/* ---------- meeting list ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; background: var(--surface); }
.mlist { display: grid; gap: 10px; }
.mrow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.mrow:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.mrow-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mrow-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.mrow-meta span { display: inline-flex; align-items: center; gap: 5px; }
.mrow-meta .icon { width: 14px; height: 14px; }
.mrow-side { display: flex; align-items: center; gap: 10px; }
.mrow-side .chev { color: var(--faint); }
@media (max-width: 560px) {
  .mrow { grid-template-columns: 38px minmax(0, 1fr); padding: 12px; gap: 12px; }
  .mrow-icon { width: 38px; height: 38px; border-radius: 10px; }
  .mrow-side { grid-column: 2; }
  .mrow-side .chev { display: none; }
}
.empty-state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty-state .icon { width: 36px; height: 36px; color: var(--faint); stroke-width: 1.4; }
.empty-state strong { color: var(--fg); font-size: 16px; }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.steps a { overflow-wrap: anywhere; }

/* ---------- dialogs, toast ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 32px));
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(10, 16, 13, .45); backdrop-filter: blur(2px); }
.dialog-body { padding: 22px; display: grid; gap: 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: var(--mono); font-size: 13px; }
#toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- meeting page ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.crumb:hover { color: var(--fg); }
.meeting-head { display: grid; gap: 12px; }
.meeting-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 13.5px; }
.meeting-head h1 { font-size: 28px; }
.recorder .timer { font: 700 22px var(--mono); font-variant-numeric: tabular-nums; color: var(--live); }
.level { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.level-bar { height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
#video { width: 100%; max-height: 70vh; border-radius: var(--radius); background: #000; border: 1px solid var(--line); }
.panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .panes { grid-template-columns: minmax(0, 1fr); } }
.transcript { display: grid; gap: 2px; max-height: 70vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 7px 6px; border-radius: 8px; align-items: baseline; }
.line:hover { background: var(--surface-2); }
.line .ts { font: 12px var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.line .text { overflow-wrap: anywhere; }
.line .who { font-weight: 650; color: var(--muted); margin-right: 6px; }
.line .who::after { content: ":"; }
.line .who.me { color: var(--accent); }
.drive-hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.drive-hint .icon { width: 15px; height: 15px; }
.linklike { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.device-code { flex: 1; text-align: center; font: 700 30px/1.2 var(--mono); letter-spacing: .14em; padding: 12px; border: 1.5px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); user-select: all; }
.line .fixed-mark { margin-left: 6px; font-size: 12px; color: var(--accent); cursor: help; opacity: .75; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1.5px dashed var(--line); border-radius: 12px; font-size: 14px; }
.answer { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.summary { overflow-wrap: anywhere; }
.summary h1 { font-size: 20px; margin: 0 0 10px; }
.summary h2 { font-size: 16px; margin: 20px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.summary h2:first-of-type { border-top: 0; padding-top: 0; }
.summary ul, .summary ol { padding-left: 20px; margin: 6px 0; }
.summary li { margin: 3px 0; }
.summary table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.summary th, .summary td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.summary th { background: var(--surface-2); }
.summary.streaming { white-space: pre-wrap; font-size: 14px; color: var(--muted); }
.shared-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; }

/* ---------- settings ---------- */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; font-size: 14px; align-items: center; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }

/* ---------- sign-in page ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth { width: min(420px, 100%); display: grid; gap: 22px; }
.auth .cobrand { justify-self: center; flex-direction: column; gap: 14px; }
.auth .sdv-word { font-size: 52px; }
.auth .sdv-tag { font-size: 17px; margin-top: 6px; }
.auth .cobrand-divider { display: none; }
.auth .brand { font-size: 22px; }
.auth .brand-mark { width: 40px; height: 40px; }
.auth-wrap { background: radial-gradient(1000px 500px at 50% -10%, var(--accent-soft), transparent 70%); }
.auth-lede { text-align: center; color: var(--muted); font-size: 14.5px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.tabs button { border: 0; background: none; padding: 8px; border-radius: 8px; font: 600 14px var(--font); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; animation: none !important; }
}
@media (max-width: 640px) {
  h1, .meeting-head h1 { font-size: 22px; }
  .container { padding-block: 20px 56px; }
  .nav { display: none; }
  .card { padding: 16px; }
  .topbar-inner { gap: 10px; }
  .topbar .sdv-word { font-size: 20px; }
  .topbar .sdv-tag { display: none; }
  .topbar .cobrand { gap: 10px; }
  .topbar .brand-name { display: none; }
}
