/* ============================================================
   Meeting Notes UI: tokens, app shell and components.
   Light palette on :root; dark is a separate palette, not an inversion.
   Tailwind (CDN) is still loaded for layout utilities (flex, grid, gap,
   spacing, hidden); everything visual lives here.
   ============================================================ */

:root {
  --bg: #fbfaf8;
  --sidebar: #f4f3f0;
  --panel: #ffffff;
  --panel-2: #f6f5f2;
  --panel-3: #eeede9;
  --sunken: #f7f6f3;
  --backdrop: rgba(24, 22, 19, 0.28);

  --line: #e9e7e2;
  --line-strong: #dad7d0;
  --divider: #f0eeea;

  --text: #1d1c1a;
  --text-2: #57544e;
  --text-3: #6b6760;
  --text-4: #8c8880;

  --accent: #4b5bd6;
  --on-accent: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 38%, transparent);

  --green: #25754b;
  --amber: #8f5e0e;
  --red: #b23c30;
  --blue: #3570c4;
  --violet: #7652c2;
  --teal: #1e8580;
  --rose: #bc4270;
  --orange: #c0612b;
  --green-soft: color-mix(in srgb, var(--green) 11%, transparent);
  --amber-soft: color-mix(in srgb, var(--amber) 12%, transparent);
  --red-soft: color-mix(in srgb, var(--red) 10%, transparent);
  --blue-soft: color-mix(in srgb, var(--blue) 10%, transparent);

  --shadow-sm: 0 1px 2px rgba(28, 25, 20, 0.05);
  --shadow-card: 0 1px 2px rgba(28, 25, 20, 0.04), 0 0 0 1px var(--line);
  --shadow-pop: 0 12px 32px -8px rgba(28, 25, 20, 0.16), 0 2px 6px -2px rgba(28, 25, 20, 0.06), 0 0 0 1px var(--line);
  --active-item: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--line);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-w: 252px;
  --topbar-h: 46px;
  --gutter: 24px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --dur: 140ms;
  color-scheme: light;
}

/* Dark palette: applied when the OS asks for it (unless the user chose
   light) or when the user picked dark explicitly. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #1a1a19; --sidebar: #151514; --panel: #1d1d1c; --panel-2: #252524; --panel-3: #2d2d2b;
    --sunken: #181817; --backdrop: rgba(0, 0, 0, 0.55);
    --line: #2c2b29; --line-strong: #3a3936; --divider: #252523;
    --text: #eceae5; --text-2: #b5b2ab; --text-3: #9a968f; --text-4: #6f6c66;
    --accent: #8e9af3; --on-accent: #12131c;
    --green: #5cba86; --amber: #d8a443; --red: #e57d70; --blue: #72a5ea; --violet: #a98deb;
    --teal: #58c0b6; --rose: #e68aab; --orange: #e3925f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 0 0 1px var(--line);
    --shadow-pop: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-strong);
    --active-item: none;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #1a1a19; --sidebar: #151514; --panel: #1d1d1c; --panel-2: #252524; --panel-3: #2d2d2b;
  --sunken: #181817; --backdrop: rgba(0, 0, 0, 0.55);
  --line: #2c2b29; --line-strong: #3a3936; --divider: #252523;
  --text: #eceae5; --text-2: #b5b2ab; --text-3: #9a968f; --text-4: #6f6c66;
  --accent: #8e9af3; --on-accent: #12131c;
  --green: #5cba86; --amber: #d8a443; --red: #e57d70; --blue: #72a5ea; --violet: #a98deb;
  --teal: #58c0b6; --rose: #e68aab; --orange: #e3925f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 0 0 1px var(--line);
  --shadow-pop: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-strong);
  --active-item: none;
  color-scheme: dark;
}

/* ---------- base ----------
   "html body" outranks Tailwind's preflight, which loads after this file. */
html body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
html .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 350, 'GRAD' 0, 'opsz' 20;
  user-select: none;
}
html .material-symbols-outlined.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-4 { color: var(--text-4); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.truncate-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; overflow: hidden; }
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  user-select: none;
}
.side-top { padding: 8px 8px 4px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: var(--radius-sm); }
.brand-mark {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}
.brand-mark .material-symbols-outlined { font-size: 16px; }
.brand-name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-4); line-height: 1.2; }
.side-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 10px; }
.side-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-4); padding: 16px 8px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 30px; padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 450;
  transition: background var(--dur), color var(--dur);
}
.side-link:hover { background: var(--panel-3); color: var(--text); }
.side-link.active { background: var(--panel); color: var(--text); box-shadow: var(--active-item); font-weight: 500; }
:root[data-theme='dark'] .side-link.active { background: var(--panel-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .side-link.active { background: var(--panel-3); } }
.side-link .material-symbols-outlined { color: var(--text-4); }
.side-link.active .material-symbols-outlined { color: var(--accent); }
.side-count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-count:empty, .side-count.pill:empty { display: none; }
.side-count.pill {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600;
}
.side-meeting { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--radius-sm); color: var(--text-2); }
.side-meeting:hover { background: var(--panel-3); color: var(--text); }
.side-meeting.active { background: var(--panel); color: var(--text); box-shadow: var(--active-item); }
.side-meeting .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--text-4); margin-left: auto; }
.side-foot { border-top: 1px solid var(--line); padding: 8px; }
.rec-chip {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 12.5px;
}
.rec-chip.on { background: var(--red-soft); color: var(--red); font-weight: 500; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex-shrink: 0; }
.rec-chip.on .rec-dot { background: var(--red); animation: pulse 1.4s ease-in-out infinite; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--text-4); }
.crumbs .current { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.searchbox {
  width: 300px; height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 6px 0 9px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--text-4);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.searchbox:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; padding: 0; }
.searchbox input::placeholder { color: var(--text-4); }
.kbd {
  font-family: var(--mono); font-size: 11px; line-height: 16px; padding: 0 5px;
  border: 1px solid var(--line); border-radius: var(--radius-xs); color: var(--text-3); background: var(--panel-2);
}
.content { flex: 1; overflow-y: auto; min-height: 0; }
.page { padding: 26px var(--gutter) 56px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-size: 23px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin: 0; }
.page-sub { color: var(--text-3); margin-top: 5px; font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }

/* ---------- colored tiles ----------
   Small tinted squares carry most of the color: one per meeting (letter),
   per card title, per stat and per notes section. --c sets the hue. */
.tile {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent);
}
html .tile .material-symbols-outlined { font-size: 16px; color: inherit; }
.tile-sm { width: 20px; height: 20px; border-radius: 6px; font-size: 10.5px; }
html .tile-sm .material-symbols-outlined { font-size: 13px; }
.tile-lg { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; }
html .tile-lg .material-symbols-outlined { font-size: 20px; }

/* ---------- buttons ---------- */
.btn {
  height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 11px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; user-select: none;
  border: 1px solid transparent; background: transparent; color: var(--text);
  transition: background var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur), transform var(--dur);
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn .material-symbols-outlined { font-size: 17px; }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn-lg { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-secondary { background: var(--panel); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--panel-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 88%, #000); }
.btn-record { background: var(--red); color: #fff; }
.btn-record:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 88%, #000); }
.icon-btn {
  width: 30px; height: 30px; display: inline-grid; place-items: center; flex-shrink: 0;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-3);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.icon-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.icon-btn.bordered { border-color: var(--line-strong); background: var(--panel); box-shadow: var(--shadow-sm); }
.icon-btn.bordered:hover:not(:disabled) { background: var(--panel-2); }
.icon-btn.danger:hover:not(:disabled) { background: var(--red-soft); color: var(--red); }
.icon-btn.on { color: var(--accent); }
.icon-btn-sm { width: 26px; height: 26px; }
.icon-btn-sm .material-symbols-outlined { font-size: 16px; }

/* ---------- cards ---------- */
.card { background: var(--panel); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; min-height: 52px; }
.card-head.ruled { border-bottom: 1px solid var(--divider); }
.card-title { font-size: 14.5px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title .material-symbols-outlined { color: var(--text-3); }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--divider); }
.section-label { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.stat { padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--text-3); }
.stat-label .material-symbols-outlined { font-size: 17px; color: var(--text-4); }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-foot { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

/* ---------- segmented control / tabs ---------- */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-sm); background: var(--panel-3); }
.seg button {
  height: 24px; padding: 0 9px; border-radius: 5px; border: 0; background: transparent;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--dur), color var(--dur);
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--line); }
.seg .count { color: var(--text-4); font-variant-numeric: tabular-nums; }
.seg button.on .count { color: var(--text-3); }
.seg .material-symbols-outlined { font-size: 16px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px;
  border-radius: 5px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge .material-symbols-outlined { font-size: 14px; }
.badge.green { color: var(--green); background: var(--green-soft); border-color: transparent; }
.badge.amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.badge.red { color: var(--red); background: var(--red-soft); border-color: transparent; }
.badge.blue { color: var(--blue); background: var(--blue-soft); border-color: transparent; }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.outline { background: var(--panel); }
.badge.outline .dot.green { color: var(--green); } .badge.outline .dot.amber { color: var(--amber); }
.badge.outline .dot.red { color: var(--red); } .badge.outline .dot.blue { color: var(--blue); }

/* ---------- lists ---------- */
.list-row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px;
  border-top: 1px solid var(--divider); cursor: pointer; transition: background var(--dur);
}
.list-row:hover { background: var(--sunken); }
/* Row actions float over the right edge on hover, so idle rows end cleanly
   at their date instead of leaving a gap for invisible buttons. */
.list-row .row-actions {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 2px; padding-left: 16px;
  background: linear-gradient(to right, transparent, var(--sunken) 16px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur);
}
.list-row:hover .row-actions, .list-row:focus-within .row-actions { opacity: 1; pointer-events: auto; }
.list-row .title { font-weight: 500; color: var(--text); }
.list-row .meta { font-size: 12.5px; color: var(--text-3); }
html .status-ring { width: 18px; height: 18px; flex-shrink: 0; font-size: 18px; }
.empty { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty .material-symbols-outlined { font-size: 30px; color: var(--text-4); }
.empty h4 { color: var(--text); font-weight: 600; font-size: 14.5px; margin: 10px 0 4px; }

/* ---------- forms ---------- */
.input, .select, .textarea {
  height: 30px; padding: 0 9px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font-size: 13px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.textarea { height: auto; padding: 8px 9px; }
.select { padding-right: 26px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 13px) 12px, calc(100% - 9px) 12px; background-size: 4px 4px; background-repeat: no-repeat; }
.select-sm { height: 26px; font-size: 12px; width: auto; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.help { font-size: 12.5px; color: var(--text-3); }
.check { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 30px; height: 18px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background var(--dur); flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform var(--dur) var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(12px); }
.switch input:disabled + .track { opacity: 0.5; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; }
.alert .material-symbols-outlined { margin-top: 1px; }
.alert.danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.alert.info { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.alert.info .material-symbols-outlined { color: var(--accent); }
.alert .alert-body { color: var(--text-2); }
.alert.danger .alert-title { color: var(--red); font-weight: 600; }

/* ---------- avatars ---------- */
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 22%, transparent);
}
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; }

/* ---------- menus & dialogs ---------- */
.menu { position: absolute; z-index: 60; min-width: 220px; padding: 4px; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.menu-label { font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-4); padding: 6px 8px 4px; }
.menu-item { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text); }
.menu-item:hover { background: var(--panel-2); }
.menu-item .help { font-size: 12px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--backdrop); align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-pop); max-height: 90vh; overflow-y: auto; animation: pop-in 160ms var(--ease); }
.modal-lg { max-width: 560px; }
.modal-head { padding: 18px 20px 6px; display: flex; gap: 12px; align-items: flex-start; }
.modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.modal-body { padding: 6px 20px 16px; color: var(--text-2); }
.modal-foot { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--divider); }
.modal-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--panel-3); color: var(--text-2); }
.modal-icon.danger { background: var(--red-soft); color: var(--red); }
.option-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.option-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--divider); cursor: pointer; }
.option-row:first-child { border-top: 0; }
.option-row:hover { background: var(--sunken); }

/* ---------- recorder ---------- */
.timer { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text-4); line-height: 1.1; }
.timer.live { color: var(--text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; animation: pulse 1.4s ease-in-out infinite; }

/* ---------- transcript & chat ---------- */
.turn { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--divider); }
.turn:first-child { border-top: 0; }
.turn-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.turn-name { font-weight: 600; font-size: 13px; }
.turn-time { font-family: var(--mono); font-size: 11.5px; color: var(--text-4); }
.turn-text { color: var(--text-2); line-height: 1.6; word-break: break-word; }
.mixed-script { line-height: 1.65; }
.chat-msg { display: flex; gap: 10px; margin-bottom: 14px; }
.chat-msg.user { justify-content: flex-end; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.chat-msg.user .bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.chat-msg.ai .bubble { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.ai .bubble.pending { color: var(--text-3); }
.proposal { margin-top: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); padding: 12px; }
.proposal-title { font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.proposal li { padding: 7px 0; border-top: 1px solid var(--divider); }
.proposal li:first-child { border-top: 0; padding-top: 0; }
.change-kind { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.change-kind.create { color: var(--green); background: var(--green-soft); }
.change-kind.update { color: var(--blue); background: var(--blue-soft); }
.change-kind.delete { color: var(--red); background: var(--red-soft); }
.diff-old { text-decoration: line-through; color: var(--text-4); }
.composer { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); transition: border-color var(--dur), box-shadow var(--dur); }
.composer:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13.5px; height: 30px; padding: 0; }
.composer input::placeholder { color: var(--text-4); }

/* ---------- floating "Ask AI" chat ---------- */
.chat-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 65;
  height: 46px; padding: 0 18px 0 14px; border-radius: 999px; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--on-accent); font-size: 13.5px; font-weight: 500;
  box-shadow: 0 10px 28px -8px rgba(28, 25, 20, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  transition: transform var(--dur) var(--ease), background var(--dur), width var(--dur);
}
.chat-launcher:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.chat-launcher .material-symbols-outlined { font-size: 20px; }
.chat-launcher.open { width: 46px; padding: 0; justify-content: center; }
.chat-launcher.open .chat-launcher-label { display: none; }
.chat-launcher .unread {
  position: absolute; top: -2px; right: -2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg);
}
.chat-popup {
  position: fixed; right: 24px; bottom: 82px; z-index: 66;
  width: 400px; height: min(620px, calc(100vh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-pop);
  transform-origin: bottom right;
  /* Closed: invisible and unfocusable, after the fade-out finishes. */
  visibility: hidden; opacity: 0; transform: translateY(10px) scale(0.97);
  transition: opacity 170ms var(--ease), transform 170ms var(--ease), visibility 0s linear 170ms;
}
.chat-popup.open { visibility: visible; opacity: 1; transform: none; transition: opacity 170ms var(--ease), transform 170ms var(--ease), visibility 0s; }
.chat-pop-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--divider); }
.chat-pop-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 8px; background: var(--bg); }
.chat-pop-foot { padding: 10px 12px 10px; border-top: 1px solid var(--divider); }
.chat-pop-foot .help { font-size: 11.5px; }
.chat-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 8px 4px; color: var(--text-3); }
.chat-welcome h4 { color: var(--text); font-weight: 600; font-size: 15px; margin: 12px 0 4px; }
.chat-welcome p { font-size: 13px; line-height: 1.55; }
.suggestion {
  text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 13px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text-2);
  transition: border-color var(--dur), background var(--dur), color var(--dur);
}
.suggestion:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.chat-popup .bubble { max-width: 92%; }

/* ---------- playback ---------- */
.wave-lane { display: flex; align-items: stretch; gap: 12px; }
.wave-chips { width: 150px; flex-shrink: 0; display: flex; flex-wrap: wrap; align-content: center; gap: 4px; }
.wave-box { position: relative; flex: 1; cursor: pointer; }
.wave { display: flex; align-items: center; gap: 1px; height: 44px; padding: 0 2px; border-radius: var(--radius-sm); background: var(--sunken); border: 1px solid var(--line); }
.wave > div { flex: 1; background: var(--line-strong); border-radius: 1px; }
.wave > .help { flex: none; }
.wave.you > div { background: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); }
.playhead { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--red); pointer-events: none; }
.speaker-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: 11.5px; font-weight: 500; color: var(--text-2);
}
.speaker-chip:hover { background: var(--panel-2); }
.speaker-chip.muted { color: var(--text-4); text-decoration: line-through; }
.speaker-chip .material-symbols-outlined { font-size: 14px; }
.video { width: 100%; height: min(380px, 42vh); object-fit: contain; border-radius: var(--radius); background: #000; display: block; }

/* ---------- AI notes (rendered markdown) ---------- */
.notes { color: var(--text-2); line-height: 1.65; font-size: 14px; }
.notes h1, .notes h2 { font-size: 15px; font-weight: 600; color: var(--text); margin: 24px 0 10px; letter-spacing: -0.005em; display: flex; align-items: center; gap: 9px; }
.notes h2:first-child, .notes h1:first-child { margin-top: 0; }
.notes p { margin: 0 0 10px; }
.notes ul, .notes ol { padding-left: 20px; margin: 0 0 12px; }
.notes ul { list-style: disc; } .notes ol { list-style: decimal; }
.notes li { margin: 4px 0; } .notes li::marker { color: var(--text-4); }
.notes .sec-summary li::marker { color: var(--blue); }
.notes .sec-decisions li::marker { color: var(--violet); }
.notes .sec-questions li::marker { color: var(--amber); }
.notes .sec-decisions li strong { color: var(--text); }
.notes strong { color: var(--text); font-weight: 600; }
.notes table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.notes th, .notes td { border-bottom: 1px solid var(--divider); padding: 8px 10px; text-align: left; }
.notes th { color: var(--text-3); font-weight: 500; }
/* Each action item is an h3 followed by its details: usually one paragraph
   ("What to do" + "Deadline" on separate lines), in older notes two. The
   sibling chain frames the heading and its details as one card. */
.notes h3 {
  font-size: 13.5px; font-weight: 600; color: var(--text); margin: 10px 0 0;
  padding: 11px 10px 6px 14px; border: 1px solid var(--line); border-left: 3px solid var(--st, var(--green)); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--panel);
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
}
.notes h3 + p { margin: 0 0 4px; padding: 0 14px 11px; border: 1px solid var(--line); border-left: 3px solid var(--st, var(--green)); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel); }
.notes h3 + p:has(+ p) { margin-bottom: 0; padding-bottom: 6px; border-bottom: 0; border-radius: 0; }
.notes h3 + p:has(+ p) + p { margin: 0 0 4px; padding: 0 14px 11px; border: 1px solid var(--line); border-left: 3px solid var(--st, var(--green)); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel); }
.notes h3 + p strong { font-weight: 500; color: var(--text-3); }
.notes .badge { vertical-align: middle; margin-top: 4px; }
.ai-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--st, var(--green)); background: color-mix(in srgb, var(--st, var(--green)) 13%, transparent);
}
.notes h3 .task-status { margin-left: auto; }
.notes h3.is-done .ai-title { text-decoration: line-through; color: var(--text-3); font-weight: 500; }
.notes h3.is-done + p, .notes h3.is-done + p + p { color: var(--text-4); }

/* ---------- tasks ---------- */
.task-status {
  width: 26px; height: 26px; flex-shrink: 0; display: inline-grid; place-items: center;
  border-radius: 50%; border: 0; background: transparent;
  transition: background var(--dur), transform var(--dur);
}
.task-status:hover { background: var(--panel-3); transform: scale(1.06); }
html .task-status .material-symbols-outlined { font-size: 20px; }
.menu .task-menu-item { flex-direction: row; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; }
.menu .task-menu-item.current { background: var(--panel-2); }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--divider); transition: background var(--dur); }
.task-row:hover { background: var(--sunken); }
.task-row .task-status { margin-top: -2px; }
.task-title { font-weight: 500; color: var(--text); cursor: pointer; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--text-3); }
.task-what { font-size: 12.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.task-what.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.meeting-link { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; font-size: 12px; color: var(--text-3); }
.meeting-link:hover { color: var(--text); }
.group-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 8px; border-top: 1px solid var(--divider); }
.group-head:first-child { border-top: 0; }
.owner-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 12px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}

/* ---------- live panel ---------- */
.live-box { height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); padding: 12px 14px; }
.mic-canvas { display: block; width: 100%; height: 72px; margin: 8px 0; border-radius: var(--radius-sm); background: #0a0e14; }

/* ---------- settings & search ---------- */
.setting { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 8px 28px; padding: 16px 18px; border-top: 1px solid var(--divider); align-items: start; }
.setting:first-child { border-top: 0; }
.setting-name { font-weight: 500; color: var(--text); }
.setting-desc { font-size: 12.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.check-card {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: border-color var(--dur), background var(--dur), color var(--dur);
}
.check-card:hover { background: var(--sunken); }
.check-card:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.device-name { font-weight: 500; color: var(--text); word-break: break-word; line-height: 1.35; }
mark.hit { background: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.result-turn { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--divider); }
.result-turn:first-child { border-top: 0; }

/* ---------- motion ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .setting { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 80; transform: translateX(-100%); transition: transform 200ms var(--ease); box-shadow: var(--shadow-pop); }
  .app.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-grid; }
  .searchbox { display: none; }
  :root { --gutter: 16px; }
}
@media (max-width: 560px) {
  .chat-popup { inset: 0; width: auto; height: auto; border-radius: 0; }
  .chat-launcher { right: 16px; bottom: 16px; }
  .chat-launcher.open { display: none; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .wave-chips { width: 92px; }
}
