@font-face { font-family: "Roboto"; src: url(/fonts/Roboto.ttf) format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url(/fonts/Roboto-Italic.ttf) format("truetype"); font-weight: 100 900; font-style: italic; font-display: swap; }

/* ---------- Tokens ----------
   Every color is written once as light-dark(light value, dark value). The page
   follows the computer's light or dark setting unless the person picks one
   (html[data-mode]). A theme sets only --brand; the shades are mixed from it.
   The default is Hunsaker Red, #740F22, from the Hunsaker Dental brand guide. */
:root {
  color-scheme: light dark;
  --brand: #740F22;

  --bg: light-dark(#ffffff, #141619);
  --sidebar: light-dark(#f6f7f8, #101215);
  --surface: light-dark(#ffffff, #1b1e22);
  --sunken: light-dark(#f3f4f6, #17191d);
  --hover: light-dark(#eef0f2, #24282d);
  --ink: light-dark(#1b1e22, #e9ebee);
  --ink-2: light-dark(#444b54, #b9bfc7);
  --muted: light-dark(#666d77, #8f969f);
  --line: light-dark(#e6e8eb, #2a2e34);
  --line-strong: light-dark(#d2d6db, #3b4047);

  --accent: light-dark(var(--brand), color-mix(in oklab, var(--brand) 50%, white));
  --accent-fill: light-dark(var(--brand), color-mix(in oklab, var(--brand) 85%, white));
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 11%, var(--surface));
  --accent-line: color-mix(in oklab, var(--accent) 40%, var(--surface));
  --ring: color-mix(in oklab, var(--accent) 32%, transparent);

  --good: light-dark(#1f6b43, #79c99a);
  --good-soft: light-dark(#e6f3ec, #1b3326);
  --bad: light-dark(#b42318, #f2948b);
  --bad-soft: light-dark(#fdeceb, #3a2120);
  --warn: light-dark(#8a5300, #e9bf6b);
  --warn-soft: light-dark(#fdf3dc, #392d15);
  --rec: #d92d20;

  --shadow-color: light-dark(rgb(16 24 40 / .08), rgb(0 0 0 / .5));
  --shadow-sm: 0 1px 2px var(--shadow-color);
  --shadow: 0 1px 2px var(--shadow-color), 0 6px 16px -6px var(--shadow-color);
  --shadow-lg: 0 2px 6px var(--shadow-color), 0 24px 48px -12px var(--shadow-color);

  --r: 8px;
  --r-lg: 12px;
  --side-w: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-mode="light"] { color-scheme: light; }
:root[data-mode="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.5 "Roboto", -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; display: block; }
[hidden] { display: none !important; }

/* ---------- Shell: sidebar and main ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side {
  background: var(--sidebar); border-right: 1px solid var(--line);
  padding: 14px 10px 10px; display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; min-width: 0; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--accent-fill); color: var(--accent-ink); font-weight: 700; font-size: 15px;
}
.brand-mark.has-logo { background: transparent; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-name {
  font-family: var(--brand-font, inherit); font-weight: var(--brand-weight, 700); font-style: var(--brand-style, normal);
  font-size: var(--brand-size, 18px); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.side-search { position: relative; margin: 0 0 10px; }
.side-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.side-search input {
  width: 100%; height: 34px; padding: 0 10px 0 34px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
}
.side-search input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--ring); }

.nav-label { font-size: 12px; font-weight: 500; color: var(--muted); padding: 14px 10px 4px; }
.side a.nav {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 7px;
  text-decoration: none; color: var(--ink-2); font-weight: 450; transition: background .12s, color .12s;
}
.side a.nav .icon { color: var(--muted); transition: color .12s; }
.side a.nav:hover { background: var(--hover); color: var(--ink); }
.side a.nav.on { background: color-mix(in oklab, var(--accent) 15%, var(--sidebar)); color: var(--accent); font-weight: 550; }
.side a.nav.on .icon { color: var(--accent); }
.side a.nav.recording, .side a.nav.recording .icon { color: var(--rec); font-weight: 550; }
.rec-badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--rec); display: inline-flex; align-items: center; gap: 5px; }
.rec-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s ease-in-out infinite; }
.side-list { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 4px; }
.side-list a {
  display: block; padding: 5px 10px 5px 38px; border-radius: 7px; font-size: 13.5px; text-decoration: none; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-list a:hover { background: var(--hover); color: var(--ink); }
.side-list a.on { color: var(--accent); font-weight: 550; }

.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px 8px; border-top: 1px solid var(--line); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comment .who { display: flex; align-items: center; gap: 8px; }

/* Branding: how the app's name looks */
.name-style { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: flex-end; margin-top: 14px; }
.name-style label.stack { margin-bottom: 0; }
.name-style input[type="range"] { width: 180px; accent-color: var(--accent-fill); }
.name-preview {
  /* As wide as the name gets in the sidebar, so a name too long for its size shows cut off here too. */
  width: calc(var(--side-w) - 80px); box-sizing: content-box;
  margin-top: 6px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--sidebar);
  color: var(--ink); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main { min-width: 0; outline: none; padding: 28px 40px 80px; }
main > * { max-width: 1160px; }
main > .board { max-width: none; }

/* Phones and small tablets: the sidebar slides in from the left. */
.topbar { display: none; }
.scrim { position: fixed; inset: 0; background: rgb(10 12 16 / .32); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
body.drawer-open .scrim, body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* ---------- Type ---------- */
h1 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; max-width: 72ch; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head > div:first-child { flex: 1; min-width: 240px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title, .group h2 {
  font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 28px 0 10px; display: flex; align-items: center; gap: 8px;
}
.count { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--hover); border-radius: 999px; padding: 0 8px; line-height: 20px; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { color: var(--muted); padding: 20px 0; }
.empty-state {
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 36px 24px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-state .icon { color: var(--accent); opacity: .8; }
.empty-state b { color: var(--ink); font-weight: 600; }
.error { color: var(--bad); background: var(--bad-soft); padding: 10px 12px; border-radius: var(--r); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font-weight: 500; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent-fill); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in oklab, var(--accent-fill) 88%, black); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.icon-only { width: 34px; padding: 0; }
.btn.big { height: 40px; padding: 0 18px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

.input, select.input, textarea.input {
  height: 36px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink);
  padding: 0 10px; transition: border-color .12s, box-shadow .12s;
}
select.input { padding-right: 28px; }
textarea.input { height: auto; width: 100%; min-height: 140px; padding: 10px 12px; resize: vertical; font: 13.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-fill); width: 16px; height: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 22px; padding: 0 9px; border-radius: 999px;
  background: var(--hover); color: var(--ink-2); white-space: nowrap;
}
.chip .icon { width: 13px; height: 13px; }
.chip.due-late, .chip.pri-high, .chip.status-failed { background: var(--bad-soft); color: var(--bad); }
.chip.due-soon, .chip.status-waiting, .chip.status-queued, .chip.status-transcribing, .chip.status-summarizing,
.chip.status-waiting_for_audio, .chip.status-recording { background: var(--warn-soft); color: var(--warn); }
.chip.status-done { background: var(--good-soft); color: var(--good); }

/* ---------- Lists: rows that sit next to each other join into one panel ---------- */
.task-row {
  display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--line); border-top-width: 0; cursor: pointer; transition: background .1s;
}
.task-row:not(.task-row + .task-row) { border-top-width: 1px; border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.task-row:not(:has(+ .task-row)) { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.task-row:hover { background: var(--sunken); }
.task-row > .icon { color: var(--muted); }
.check {
  width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 50%; flex: none; display: grid; place-items: center;
  background: none; padding: 0; color: #fff; transition: border-color .12s, background .12s;
}
.check:hover { border-color: var(--good); }
.check.done { background: var(--good); border-color: var(--good); }
.check.done::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { color: var(--muted); font-size: 13px; }
.task-row.is-done .task-title, .card.is-done .card-title { color: var(--muted); text-decoration: line-through; }
.group { margin-bottom: 8px; }

/* Quick-add bar on top of a list */
.quick-add {
  display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.quick-add:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--ring); }
.quick-add > .icon { color: var(--muted); }
.quick-add .bare { flex: 1; min-width: 160px; border: 0; background: transparent; height: 34px; outline: none; color: var(--ink); }
.quick-add .bare::placeholder { color: var(--muted); }

/* ---------- Projects and boards ---------- */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.project-tile {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .15s, transform .15s var(--ease);
}
.project-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.project-tile .tile-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.project-tile b { font-size: 15px; font-weight: 600; }
.project-tile small { color: var(--muted); font-size: 12.5px; }

.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; }
.column { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-lg); width: 288px; flex: none; padding: 10px; }
.column h3 { font-size: 13px; font-weight: 600; margin: 2px 4px 10px; display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.column h3 span { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--hover); border-radius: 999px; padding: 0 7px; line-height: 20px; }
.column.drop { outline: 2px dashed var(--accent-line); outline-offset: -2px; }
.cards { min-height: 24px; display: flex; flex-direction: column; gap: 8px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: var(--shadow-sm); cursor: grab; transition: border-color .12s, box-shadow .15s, transform .15s var(--ease);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.card.dragging { opacity: .4; }
.card-title { margin-bottom: 8px; font-weight: 500; }
.card .row { gap: 6px; }
.add-card { width: 100%; margin-top: 8px; display: flex; align-items: center; gap: 6px; text-align: left; color: var(--muted); background: none; border: 0; padding: 7px 6px; border-radius: 7px; }
.add-card:hover { background: var(--hover); color: var(--ink); }
.add-card-form input { width: 100%; margin-top: 8px; }
.add-column {
  flex: none; width: 220px; height: 46px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: transparent; color: var(--muted); font-weight: 500;
}
.add-column:hover { background: var(--hover); color: var(--ink); border-style: solid; }
.add-column-form { flex: none; width: 260px; }
.add-column-form .input { width: 100%; }

/* The project editor in the side panel */
.col-list { display: flex; flex-direction: column; gap: 6px; }
.col-row { display: flex; align-items: center; gap: 4px; }
.col-row .input { flex: 1; min-width: 0; }
.col-row .task-meta { margin: 0 6px; white-space: nowrap; }
textarea.input.plain { min-height: 0; font: inherit; line-height: 1.5; }
.danger-zone { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Task drawer ---------- */
.drawer {
  position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(600px, calc(100vw - 16px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow-y: auto; padding: 18px 24px 40px; z-index: 30;
  /* Closed, it waits just inside the right edge, faded out. Parking it past
     the edge would make phones scroll sideways. */
  transform: translateX(8px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .2s var(--ease), opacity .16s, visibility 0s .2s;
}
.drawer.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition: transform .2s var(--ease), opacity .16s; }
.drawer .title-input {
  width: 100%; font-size: 21px; font-weight: 650; letter-spacing: -.015em; border: 1px solid transparent; border-radius: var(--r);
  padding: 6px 8px; margin: 8px 0 4px -8px; background: none;
}
.drawer .title-input:hover { border-color: var(--line); }
.drawer .title-input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--ring); }
.fields { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; align-items: center; margin: 12px 0 4px; font-size: 13.5px; }
.fields label { color: var(--muted); }
.fields .input { height: 32px; }
.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment .who { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.membership { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }

/* ---------- Files: folder tree on the left, the note on the right ---------- */
.files { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.tree {
  position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sidebar); padding: 6px;
}
.tree a {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-size: 13.5px;
  min-width: 0;
}
.tree a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree a .icon { color: var(--muted); }
.tree a.dir .icon { color: var(--accent); opacity: .85; }
.tree a:hover { background: var(--hover); color: var(--ink); }
.tree a.on { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.tree a.on .icon { color: var(--accent); }
.tree a.up { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.crumbs a { text-decoration: none; color: var(--muted); padding: 1px 4px; border-radius: 5px; }
.crumbs a:hover { background: var(--hover); color: var(--ink); }
.crumbs .icon { opacity: .6; }

.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 36px; box-shadow: var(--shadow-sm); }
.md { font-size: 15px; line-height: 1.68; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md p, .md ul, .md ol { max-width: 75ch; }
.md h1 { font-size: 26px; margin: 0 0 14px; }
.md h2 { font-size: 19px; margin: 28px 0 8px; letter-spacing: -.01em; }
.md h3 { font-size: 16px; margin: 22px 0 6px; }
.md li + li { margin-top: 3px; }
.md code { background: var(--sunken); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.md pre { background: var(--sunken); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--r); overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; }
.md blockquote { border-left: 3px solid var(--accent-line); margin: 12px 0; padding: 2px 14px; color: var(--ink-2); }
.md table { border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.md td, .md th { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--sunken); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.md .wikilink { text-decoration: none; color: var(--accent); background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
.md .props { font-size: 12.5px; color: var(--muted); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin-bottom: 18px; line-height: 1.6; }
.history { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; }
.history li { margin-bottom: 4px; }
.backlinks { margin-top: 20px; }
.backlink {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 14px; margin-bottom: 6px; transition: border-color .12s;
}
.backlink:hover { border-color: var(--line-strong); }
.backlink span { display: block; color: var(--muted); font-size: 13px; }
.attach-img { max-width: 100%; border-radius: var(--r-lg); border: 1px solid var(--line); }
.attach-pdf { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.attach-text { white-space: pre-wrap; font-size: 13px; max-height: 50vh; overflow: auto; }
details.doc > summary { cursor: pointer; font-weight: 500; }

/* ---------- Meetings ---------- */
.recorder-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 8px; box-shadow: var(--shadow);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%);
}
.recorder-card .title-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.recorder-card .title-row .input { flex: 1; min-width: 220px; height: 42px; font-size: 16px; }
.recorder-card .options { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-top: 14px; font-size: 13.5px; color: var(--ink-2); }
.recorder-card .options label { display: flex; gap: 8px; align-items: center; }
.recorder-card .hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); max-width: 80ch; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.template-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .12s, box-shadow .15s;
}
.template-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.template-card b { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.template-card span { color: var(--muted); font-size: 13px; }
.template-card .chip { align-self: flex-start; margin-top: 6px; }

.meeting-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.meeting-bar audio { height: 34px; }
.md .mine { color: var(--ink); font-weight: 600; }
.md .ai { color: var(--ink-2); }
.md .legend, .md .byline { color: var(--muted); font-size: 13px; }
.rec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 4px color-mix(in oklab, var(--rec) 20%, transparent); }
.rec-clock { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 18px; font-weight: 500; }
@keyframes pulse { 50% { opacity: .35; } }

.rewrite { flex-basis: 100%; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 14px; background: var(--surface); }
.rewrite summary { cursor: pointer; font-weight: 600; }
.rewrite[open] summary { margin-bottom: 10px; }
.rewrite .row, .rewrite .stack { margin-bottom: 10px; }
.template-section { margin-bottom: 10px; }
.template-section textarea, .rewrite textarea { min-height: 0; height: auto; font: inherit; line-height: 1.45; }

/* ---------- Tables, tabs and settings ---------- */
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
table.grid th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 500; padding: 9px 12px; background: var(--sunken); border-bottom: 1px solid var(--line); }
table.grid td { padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td .input { width: 100%; height: 32px; }
table.grid td select.input { min-width: 96px; }
table.grid td input.input { min-width: 110px; }
@media (max-width: 860px) { table.grid { display: block; overflow-x: auto; } }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 22px; }
.tab { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.setting-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.input.narrow { width: 90px; }
.input.wide { width: 100%; min-width: 220px; }
.notice { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 14px; }
.notice p { margin: 0 0 8px; }
code.token { font-size: 13px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; word-break: break-all; }
label.stack { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
label.stack .input { color: var(--ink); max-width: 100%; font-weight: 400; }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 4px; }
.panel .sub { margin: 0 0 14px; }

/* Who's talking, while recording, and the Speakers panel afterward. */
.talking { gap: 6px; margin-bottom: 8px; }
.chip-btn { border-radius: 999px; height: 30px; padding: 0 12px; font-size: 13.5px; box-shadow: none; }
.speakers { margin-bottom: 16px; }
.speaker-row { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.speaker-row .samples { margin: 4px 0 6px; padding-left: 18px; color: var(--muted); font-size: 13px; }

/* Branding: theme swatches and the logo */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.swatch {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer; font-size: 13.5px; transition: border-color .12s, box-shadow .12s;
}
.swatch:hover { border-color: var(--line-strong); }
.swatch.on { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--ring); }
.swatch input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.swatch i { width: 22px; height: 22px; border-radius: 6px; flex: none; border: 1px solid rgb(0 0 0 / .12); }
.swatch input[type="color"] { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
.logo-preview {
  width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunken);
  display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted);
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

.help { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 24px; align-items: start; }
.help-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.help-list a { display: block; padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--ink); }
.help-list a b { font-weight: 550; }
.help-list a span { display: block; font-size: 12.5px; color: var(--muted); }
.help-list a:hover { background: var(--hover); }
.help-list a.on { background: var(--accent-soft); }
.help-list a.on b { color: var(--accent); }
.help input[type="search"] { width: 100%; }

/* ---------- Leadership ---------- */
.rock-row { align-items: center; }
.rock-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rock-title { font-weight: 550; }
.rock-figure { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.rock-bar { position: relative; height: 6px; border-radius: 999px; background: var(--hover); }
.rock-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--good); }
.rock-bar .fill.behind { background: var(--warn); }
.rock-bar .mark { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--ink-2); border-radius: 1px; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.segmented .btn { border: 0; border-radius: 0; box-shadow: none; height: 32px; }
.segmented .btn + .btn { border-left: 1px solid var(--line-strong); }
.segmented .btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.owner-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.owner-list .setting-check { margin: 4px 0; }

/* ---------- Profile photo crop ---------- */
.crop-dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 20px 22px; max-width: calc(100vw - 32px); }
.crop-dialog::backdrop { background: rgb(10 12 16 / .45); }
.crop-dialog h2 { margin: 0; font-size: 18px; }
.crop-view { position: relative; overflow: hidden; margin: 14px auto 0; border-radius: var(--r); background: #000; touch-action: none; cursor: grab; user-select: none; }
.crop-view:active { cursor: grabbing; }
.crop-view canvas { display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgb(0 0 0 / .5); pointer-events: none; outline: 2px solid rgb(255 255 255 / .8); outline-offset: -2px; }
.crop-zoom-row { margin-top: 12px; color: var(--muted); }
.crop-zoom { flex: 1; accent-color: var(--accent-fill); }

/* ---------- Team schedule ---------- */
.sc-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); max-height: 70vh; }
.sc-grid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.sc-grid th, .sc-grid td { padding: 2px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.sc-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--sunken); font-weight: 500; color: var(--muted); padding: 6px 2px; line-height: 1.2; }
.sc-grid thead th span { display: block; font-size: 11px; }
.sc-grid thead th b { font-weight: 600; color: var(--ink); }
.sc-grid .sc-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 4px 10px; min-width: 150px; font-weight: 500; }
.sc-grid thead .sc-name { z-index: 3; background: var(--sunken); }
.sc-grid .sc-name small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.sc-grid .sc-name a { color: var(--ink); text-decoration: none; }
.sc-grid tr.sc-team th { text-align: left; background: var(--hover); color: var(--ink-2); font-weight: 600; padding: 6px 10px; position: sticky; left: 0; }
.sc-cell { display: block; width: 46px; height: 26px; line-height: 26px; box-sizing: border-box; border: 1px solid transparent; border-radius: 5px; text-align: center; font: inherit; font-size: 12px; color: var(--ink); background: transparent; padding: 0 2px; }
input.sc-cell:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--ring); }
.sc-cell.sc-s { background: light-dark(#dbe9f7, #1f3349); }
.sc-cell.sc-m { background: light-dark(#f6e0e3, #45252b); }
.sc-cell.sc-off { background: var(--sunken); color: var(--muted); }
.sc-cell.sc-leave { background: light-dark(#ebe2f7, #33284a); }
.sc-cell.sc-other { background: light-dark(#fff2d6, #3a3020); }
.sc-cell.sc-flag { border-color: var(--warn); }
.sc-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sc-check { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 13px; min-width: 150px; }
.sc-check.short { border-color: var(--warn); background: var(--warn-soft); }
.sc-over summary, .sc-legend summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 8px 0; }
.sc-legend p { font-size: 13px; color: var(--muted); max-width: 90ch; }
.sc-import { width: min(760px, calc(100vw - 32px)); }
.sc-notes { margin: 4px 0 14px; }
.sc-notes ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); columns: 2 320px; }
.sc-notes li { margin: 2px 0; break-inside: avoid; }
.tm-fun textarea.input { min-height: 34px; resize: vertical; }

/* ---------- Inventory ---------- */
.inv-fields { grid-template-columns: 150px minmax(0, 420px); }
.inv-fields .input { width: 100%; }
.inv-fields textarea.input, textarea.inv-notes { font: inherit; }
.inv-stock { overflow-x: auto; }
.inv-stock table.grid td input.input { min-width: 64px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--sunken); }
table.grid tfoot td { font-weight: 600; background: var(--sunken); }
/* Settings, Modules: one switch per person and module. */
table.mod-grid th.mod-cell, table.mod-grid td.mod-cell { text-align: center; }
table.mod-grid tr.mod-everyone td { background: var(--sunken); font-weight: 500; }
/* Case board, Not on the Board: patients the Doctor Site read found with no card. */
.cb-tab-count { margin-left: 6px; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--sunken); }
.cb-held-actions { gap: 6px; flex-wrap: nowrap; }
.cb-held-actions select.input { min-width: 220px; max-width: 280px; }
.cb-held-head { margin: 22px 0 8px; font-size: 15px; }
.inv-vendor { margin-bottom: 22px; }
.inv-dept-title { font-size: 17px; margin: 26px 0 4px; }
.inv-vendor:first-of-type .inv-dept-title { margin-top: 6px; }
.inv-codes { list-style: none; padding: 0; margin: 8px 0; }
.inv-codes li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.inv-label-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.inv-label-preview img { height: 58px; background: #fff; padding: 4px; border-radius: 4px; }
.inv-details > summary, .inv-field > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.inv-details > summary::-webkit-details-marker, .inv-field > summary::-webkit-details-marker { display: none; }
.inv-field { border-top: 1px solid var(--line); padding: 8px 0; }
.inv-field > summary .btn { margin-left: auto; }
.inv-add-field { margin-top: 8px; }
.inv-add-field > summary { display: inline-flex; list-style: none; }
.inv-add-field > summary::-webkit-details-marker { display: none; }
.inv-count-card { max-width: 720px; }
.inv-slip-bar { margin-bottom: 12px; }
.inv-where { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.inv-where:first-of-type { border-top: 0; }
.inv-where.compact { border: 0; padding: 0 0 12px; align-items: center; }
.inv-where-photo { flex: none; width: 132px; height: 99px; border-radius: var(--r); overflow: hidden; background: var(--sunken); display: grid; place-items: center; color: var(--muted); }
.inv-where.compact .inv-where-photo { width: 88px; height: 66px; }
.inv-where-photo img { width: 100%; height: 100%; object-fit: cover; }
.inv-where-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.inv-where-body .row { max-width: 520px; }
.inv-where-body .row .input { flex: 1; min-width: 0; }
.inv-where.compact .inv-where-body { gap: 2px; }
.inv-slip td { vertical-align: top; }
.inv-slip td select.input { min-width: 220px; }
tr.inv-slip-skip td { color: var(--muted); }
table.grid.inv-seed td select.input { min-width: 170px; }
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-bar-cell { width: 40%; }
.inv-bar { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.inv-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.inv-labels { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-label {
  width: 2.25in; height: 1.25in; box-sizing: border-box; padding: 0.08in 0.1in; border: 1px dashed var(--line-strong);
  display: flex; flex-direction: column; gap: 2px; background: #fff; color: #000; overflow: hidden; break-inside: avoid;
}
.inv-label b { font-size: 10pt; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.inv-label span { font-size: 8pt; }
.inv-label img { margin-top: auto; height: 0.55in; max-width: 100%; object-fit: contain; object-position: left; }
@media print {
  .side, .topbar, .tabs, .no-print, .page-head .actions, .toast { display: none !important; }
  .shell, main { display: block !important; padding: 0 !important; margin: 0 !important; }
  body { background: #fff !important; }
  .inv-labels { gap: 0; }
  .inv-label { border: 0; }
}

/* ---------- Dictation download ---------- */
.steps { margin: 0 0 12px; padding-left: 22px; line-height: 2; }
.steps code { font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--hover); }
.steps .btn { padding: 2px 8px; min-height: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 8px); max-width: min(560px, calc(100vw - 32px));
  background: light-dark(#1b1e22, #e9ebee); color: light-dark(#fff, #141619); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s var(--ease); z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10; height: 52px; padding: 0 10px;
    background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; }
  .topbar .brand-name { font-size: min(var(--brand-size, 18px), 20px); }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: 100dvh; z-index: 25; box-shadow: var(--shadow-lg);
    transform: translateX(-105%); transition: transform .22s var(--ease);
  }
  body.nav-open .side { transform: none; }
  main { padding: 18px 16px 64px; }
  h1 { font-size: 21px; }
  .files, .help { grid-template-columns: 1fr; }
  .tree { position: static; max-height: none; }
  .doc { padding: 18px 16px; }
  .task-row { flex-wrap: wrap; row-gap: 6px; }
  .task-title { flex: 1 1 calc(100% - 40px); white-space: normal; }
  .fields { grid-template-columns: 1fr; gap: 2px; }
  .fields label { margin-top: 8px; }
  .help article { order: -1; }
  .recorder-card { padding: 16px; }
  .quick-add { flex-wrap: wrap; padding: 6px 6px 6px 12px; }
  .quick-add .bare { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .quick-add .input { flex: 1; min-width: 0; }
  .page-head .actions { width: 100%; }
}

/* ---------- The note editor (CodeMirror, Obsidian-style live preview) ---------- */
.save-status { font-size: 12.5px; color: var(--muted); padding: 0 6px; min-width: 70px; text-align: right; }
.save-status.bad { color: var(--bad); font-weight: 500; }
.editor-doc { padding: 24px 36px 40px; min-height: 60vh; }
.editor-doc .cm-editor { font-size: 15px; background: transparent; }
.editor-doc .cm-editor.cm-focused { outline: none; }
.editor-doc .cm-scroller { font-family: "Roboto", -apple-system, "Segoe UI", system-ui, sans-serif; line-height: 1.68; overflow: visible; }
.editor-doc .cm-content { padding: 0; caret-color: var(--ink); max-width: 80ch; }
.editor-doc .cm-line { padding: 1px 0; }
.editor-doc .cm-cursor { border-left: 2px solid var(--accent); }
.editor-doc .cm-selectionBackground, .editor-doc .cm-focused .cm-selectionBackground { background: color-mix(in oklab, var(--accent) 18%, transparent) !important; }
.editor-doc .cm-placeholder { color: var(--muted); }
.cm-h { font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.cm-h1 { font-size: 1.75em; padding-top: 6px !important; }
.cm-h2 { font-size: 1.35em; padding-top: 14px !important; }
.cm-h3 { font-size: 1.15em; padding-top: 10px !important; }
.cm-h4, .cm-h5, .cm-h6 { font-size: 1em; }
.cm-strong { font-weight: 650; }
.cm-em { font-style: italic; }
.cm-strike { text-decoration: line-through; color: var(--muted); }
.cm-inline-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; background: var(--sunken); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.cm-codeblock { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13.5px; background: var(--sunken); padding: 0 12px !important; }
.cm-quote { border-left: 3px solid var(--accent-line); padding-left: 14px !important; color: var(--ink-2); }
.cm-link { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }
.cm-wikilink { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 3px; cursor: pointer; }
.cm-tag { color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 7px; font-size: .9em; }
.cm-bullet { display: inline-block; width: 1em; color: var(--muted); }
.cm-task-box { accent-color: var(--accent-fill); width: 15px; height: 15px; margin: 0 6px 0 0; vertical-align: -2px; cursor: pointer; }
.cm-task-done { color: var(--muted); text-decoration: line-through; }
.cm-hr { display: inline-block; width: 100%; height: 1px; background: var(--line); vertical-align: middle; }
.cm-embed-image { display: block; max-width: 100%; max-height: 480px; border-radius: var(--r); border: 1px solid var(--line); margin: 6px 0; }
.cm-frontmatter { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; color: var(--muted); background: var(--sunken); padding: 0 12px !important; }
.cm-md-mark, .cm-md-url { color: var(--muted); }
.cm-tooltip.cm-tooltip-autocomplete {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; font-size: 13.5px;
}
.cm-editor .cm-tooltip.cm-tooltip-autocomplete { background: var(--surface); }
.cm-editor .cm-tooltip.cm-tooltip-autocomplete > ul { font-family: "Roboto", -apple-system, "Segoe UI", system-ui, sans-serif; max-height: 260px; }
.cm-editor .cm-tooltip.cm-tooltip-autocomplete > ul > li { padding: 6px 10px; color: var(--ink); }
.cm-editor .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] { background: var(--accent-soft); color: var(--accent); }
.cm-completionDetail { color: var(--muted); font-style: normal; margin-left: 8px; font-size: 12px; }
.cm-completionMatchedText { text-decoration: none; font-weight: 600; }
@media (max-width: 860px) { .editor-doc { padding: 16px 14px 32px; } }

/* ---------- The Access panel ---------- */
.access-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.access-row > .icon { color: var(--muted); }
.access-row.muted .access-who { color: var(--ink-2); }
.access-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-row select.input { height: 32px; }
.access-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.access-add select.input { flex: 1; min-width: 140px; }
.access-people .avatar { width: 26px; height: 26px; font-size: 11px; }
.chip.level-editor { background: var(--good-soft); color: var(--good); }
.chip.level-viewer { background: var(--hover); color: var(--ink-2); }
.chip.level-none { background: var(--bad-soft); color: var(--bad); }
.chip.level-owner { background: var(--accent-soft); color: var(--accent); }
.chip.level-full { background: var(--good-soft); color: var(--good); font-weight: 600; }

/* A meeting's notes use the note editor, in a box sized for typing during a meeting. */
.meeting-editor { min-height: 40vh; padding: 18px 22px 24px; }
.mine-editor { min-height: 28vh; padding: 4px 0 12px; }

/* ---------- The file explorer ---------- */
.explorer { padding: 4px; }
.explorer-head { display: flex; align-items: center; gap: 2px; padding: 4px 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; border-radius: 8px; }
.explorer-head .btn.icon-only { width: 28px; height: 28px; }
.tree a.explorer-title { padding: 0; font-weight: 600; color: var(--ink); font-size: 13px; }
.explorer-head.drop, .tree-root.drop { background: var(--accent-soft); }
.tree-root { min-height: 40px; border-radius: 8px; }
.tree a.tree-row {
  display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px calc(6px + var(--depth, 0) * 16px); border-radius: 6px;
  color: var(--ink-2); font-size: 13.5px; text-decoration: none; user-select: none;
}
.tree a.tree-row:hover { background: var(--hover); color: var(--ink); }
.tree a.tree-row.on { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.tree a.tree-row.drop { background: var(--accent-soft); outline: 1px dashed var(--accent-line); }
.tree-caret { width: 16px; height: 16px; display: grid; place-items: center; flex: none; color: var(--muted); border-radius: 4px; }
.tree-row.dir .tree-caret:hover { background: var(--line); }
.tree-icon { display: grid; place-items: center; flex: none; color: var(--muted); }
.tree-row.dir .tree-icon { color: var(--accent); opacity: .85; }
.tree-row.on .tree-icon { color: var(--accent); }
.tree-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-more { opacity: 0; flex: none; width: 24px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 5px; padding: 0; }
.tree-row:hover .tree-more, .tree-more:focus-visible, .tree-row.on .tree-more { opacity: 1; }
.tree-more:hover { background: var(--line); color: var(--ink); }
.tree-empty { padding: 3px 4px 3px calc(28px + var(--depth, 0) * 16px); font-size: 12.5px; color: var(--muted); }
@media (hover: none) { .tree-more { opacity: 1; } }

.tree-menu {
  position: fixed; z-index: 50; min-width: 190px; padding: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px;
  color: var(--ink); font-size: 13.5px; text-align: left;
}
.menu-item .icon { color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item.danger, .menu-item.danger .icon { color: var(--bad); }

dialog.ask {
  border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog.ask::backdrop { background: rgb(10 12 16 / .35); }
dialog.ask h2 { margin: 0 0 6px; font-size: 17px; }
dialog.ask .sub { margin: 0 0 12px; }
dialog.move-dialog { width: min(560px, calc(100vw - 32px)); }
.move-tree {
  height: min(420px, 55vh); overflow-y: auto; margin-top: 10px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.move-row {
  display: flex; align-items: center; gap: 4px; width: 100%; padding: 4px 6px 4px calc(6px + var(--depth, 0) * 16px); border: 0; background: none;
  border-radius: 6px; color: var(--ink-2); font-size: 13.5px; text-align: left; user-select: none; cursor: default;
}
.move-row:hover { background: var(--hover); color: var(--ink); }
.move-row:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
.move-row.on { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.move-row.dir .tree-icon { color: var(--accent); opacity: .85; }
.move-row.dir .tree-icon.tinted { color: var(--fc); opacity: 1; }
.move-row.dir .tree-caret:hover { background: var(--line); }
.move-row.file, .move-row.off { color: var(--muted); }
.move-row.file .tree-icon, .move-row.off .tree-icon { opacity: .5; }
.move-row.off:hover { background: none; color: var(--muted); }
.move-empty { padding: 3px 4px 3px calc(28px + var(--depth, 0) * 16px); font-size: 12.5px; color: var(--muted); }
.move-where { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.move-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-where .icon { color: var(--muted); flex: none; }
dialog.quick-open { padding: 12px; top: 12vh; margin-top: 0; width: min(560px, calc(100vw - 32px)); }
.quick-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; max-height: 50vh; overflow-y: auto; }
.quick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; color: var(--ink); }
.quick-item .icon { color: var(--muted); }
.quick-item b { font-weight: 550; }
.quick-item span { color: var(--muted); font-size: 12.5px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.quick-item.on, .quick-item:hover { background: var(--accent-soft); }

/* Live meeting notes: the page is the notepad. */
.live-notes { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 80px); }
.live-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); min-height: 36px; margin-bottom: 20px; }
.live-bar .rec-dot { width: 9px; height: 9px; box-shadow: 0 0 0 3px color-mix(in oklab, var(--rec) 20%, transparent); }
.live-bar .rec-clock { font-size: 13.5px; color: var(--ink-2); }
.live-bar .sub, .live-bar .error { margin: 0; font-size: 13.5px; }
.live-title { font-size: 32px; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
.live-meta { color: var(--muted); font-size: 14px; margin: 6px 0 26px; }
.live-notes .meeting-editor { flex: 1; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.live-notes .meeting-editor .cm-editor { font-size: 16.5px; }
.live-notes .meeting-editor .cm-content { max-width: none; min-height: 50vh; }
.live-notes .cm-h1 { font-size: 1.4em; }
.live-notes .cm-h2 { font-size: 1.2em; }
.live-dock {
  position: sticky; bottom: 16px; align-self: center; z-index: 5; max-width: 100%;
  display: flex; align-items: center; gap: 8px; margin-top: 24px; padding: 7px 8px 7px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.live-dock .talking { margin: 0; flex-wrap: wrap; }
.live-help {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none;
}
.live-help:hover { color: var(--ink); background: var(--hover); }
@media (max-width: 860px) {
  .live-title { font-size: 26px; }
  .live-meta { margin-bottom: 18px; }
  .live-dock { bottom: 10px; align-self: stretch; }
}

/* Access board: one person's or group's access, as columns */
.ab-whole { margin: 14px 0 6px; gap: 10px; }
.ab-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; margin: 8px 0 0; color: var(--muted); }
.ab-crumbs a { color: var(--accent); }
.ab-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.ab-col { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); padding: 8px; min-height: 140px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.ab-col.over { border-color: var(--accent-line); background: var(--accent-soft); }
.ab-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px; font-size: 13px; }
.ab-head span { color: var(--muted); }
.ab-full .ab-head b, .ab-editor .ab-head b { color: var(--good); }
.ab-viewer .ab-head b { color: var(--warn); }
.ab-none .ab-head b { color: var(--muted); }
.ab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 8px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); cursor: grab; font-size: 14px; }
.ab-row.dragging { opacity: .5; }
.ab-row .ab-name { flex: 1 1 calc(100% - 28px); min-width: 0; overflow-wrap: break-word; color: var(--ink); }
.ab-row a.ab-name:hover { color: var(--accent); }
.ab-count { color: var(--muted); font-size: 12px; padding-left: 22px; }
.ab-arrows { display: flex; margin-left: auto; }
.ab-row .btn.icon-only { width: 24px; height: 24px; padding: 0; }
.ab-empty { color: var(--muted); font-size: 13px; text-align: center; margin: 28px 0; }

/* Folder colors in the file tree */
:root {
  --fc-red: light-dark(#d1434b, #f07f84);
  --fc-orange: light-dark(#d9731a, #f2a35c);
  --fc-yellow: light-dark(#c29a0b, #e8c95a);
  --fc-green: light-dark(#2f8a4f, #72c98f);
  --fc-teal: light-dark(#13878c, #5cc6c9);
  --fc-blue: light-dark(#2f6fd0, #7aa9f0);
  --fc-purple: light-dark(#7a4fc9, #b293ee);
  --fc-pink: light-dark(#c74583, #ee8ab9);
  --fc-gray: light-dark(#6b7280, #a3a9b3);
}
.tree-row.dir .tree-icon.tinted { color: var(--fc); opacity: 1; }
.tree-pinned { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.tree-row.pinned .tree-name { font-weight: 600; }
.tree-row.on .tree-icon.tinted, .tree a .tree-icon.tinted .icon { color: var(--fc); }
.menu-colors { display: grid; grid-template-columns: repeat(5, 22px); gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; }
.fc-swatch { width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; background: var(--fc); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.fc-swatch.none { background: var(--sunken); border: 1px solid var(--line-strong); }
.fc-swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--fc, var(--line-strong)); }
.fc-swatch:hover { transform: scale(1.1); }
.fc-swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#d1434b, #d9731a, #c29a0b, #2f8a4f, #13878c, #2f6fd0, #7a4fc9, #c74583, #d1434b); color: #fff; }
.fc-swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }

/* Settings, Storage: connecting Dropbox, Google Drive or SharePoint (2026-10-30). */
.storage-form { margin-top: 16px; max-width: 560px; }
.storage-form .row .input.wide { flex: 1; }
.storage-form + .sub { margin-top: 14px; }

/* Files: the storage sync line, and the Dropbox page (2026-10-30). */
.tree-sync { display: flex; align-items: center; gap: 6px; padding: 2px 8px 8px; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.tree-sync-add { margin-left: auto; height: 26px; padding: 0 10px; font-size: 12.5px; gap: 4px; }
.tree-sync .icon { color: var(--accent); }
.tree-sync-add .icon { color: inherit; }
.db-tag { font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }

/* Files: adding from Dropbox (2026-10-30), a picker like attaching a file in Claude. */
dialog.ask.db-picker { width: min(640px, calc(100vw - 32px)); padding: 16px 18px; }
.db-head { margin-bottom: 10px; }
.db-head h2 { margin: 0; }
.db-picker .crumbs { margin: 10px 0 6px; min-height: 22px; flex-wrap: wrap; }
.db-open { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.db-open:hover { color: var(--accent); text-decoration: underline; }
.db-list { display: flex; flex-direction: column; height: min(46vh, 420px); overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.db-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; min-width: 0; cursor: pointer; }
.db-row:hover { background: var(--accent-soft); }
.db-row.taken { cursor: default; opacity: .75; }
.db-row .icon { color: var(--muted); flex: none; }
.db-row > .db-open, .db-row > span:not(.db-tag):not(.db-meta) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-meta { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; flex: none; }
.db-note { min-height: 18px; margin: 8px 0 0; }
.db-foot { margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.db-show { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.db-show .input { max-width: 260px; }
.ms-app { margin-top: 14px; }
.ms-app summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.db-row .ms-gap { width: 13px; flex: none; }
.tree-badge { display: inline-flex; color: var(--muted); margin-left: 4px; flex: none; }
.remote-note { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; }
.remote-note .btn.ghost { height: 26px; padding: 0 8px; font-size: 13px; }
.remote-note a { white-space: nowrap; }

/* Add Context (2026-11-07): your own accounts, or this computer. */
.ctx-tabs { margin-bottom: 10px; flex-wrap: wrap; }
a.db-row { color: inherit; text-decoration: none; }
a.db-row > span:first-of-type { color: var(--accent); }
.ctx-pane { min-height: min(46vh, 420px); }
.ctx-pane > .row { margin-bottom: 10px; }
.ctx-connect { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px 4px; }
.ctx-connect p { margin: 0; }
.ctx-opts { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.ctx-opts label { display: flex; align-items: center; gap: 6px; }
.tree-notice a { color: var(--accent); }
.ctx-progress { margin-top: 12px; }
.ctx-progress-track { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.ctx-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .2s ease; }
.ctx-progress-text { margin: 6px 0 0; min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings, Connect Claude, and the Allow page (2026-10-30). */
.cc-copy { margin-top: 6px; }
.cc-copy .input.wide { flex: 1; font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; }
.cc-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.cc-steps li { line-height: 1.5; }
.cc-approve { max-width: 520px; margin: 48px auto 0; }

/* Sign-in pages (2026-11-01): no sidebar, one card in the middle. */
body.signed-out .side, body.signed-out .topbar { display: none; }
body.signed-out .shell { grid-template-columns: minmax(0, 1fr); }
.si-card { max-width: 420px; margin: 8vh auto 40px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 26px 28px; }
.si-card h1 { margin: 0 0 18px; }
.si-card .btn.primary { width: 100%; justify-content: center; margin-top: 6px; }
.si-card .error:empty { display: none; }
.si-help { margin-top: 16px; font-size: 13px; }
.si-change { max-width: 380px; }
.si-status { white-space: nowrap; }

/* Locked folders */
.lk-note { display: flex; align-items: center; gap: 5px; }
.lk-note .icon { flex: none; }
.lk-path { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.lk-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lk-people .lk-add { width: auto; min-width: 145px; padding-top: 3px; padding-bottom: 3px; }
.lk-x { display: inline-flex; padding: 0; margin-left: 3px; border: 0; background: none; color: inherit; cursor: pointer; opacity: .65; }
.lk-x:hover { opacity: 1; }

/* Proposals */
.pr-count { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent, #740f22); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.pr-list { display: flex; flex-direction: column; gap: 6px; }
.pr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: inherit; }
.pr-row:hover { background: var(--hover); }
.pr-main { display: flex; flex-direction: column; min-width: 180px; flex: 1; }
.pr-reason { flex: 2; min-width: 180px; font-size: 13.5px; color: var(--ink-2); }
.pr-diff { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 0; overflow-x: auto; font-size: 13.5px; }
.pr-line { padding: 1px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pr-add { background: var(--good-soft); }
.pr-del { background: var(--bad-soft); text-decoration: line-through; }
.pr-fold { color: var(--muted); font-size: 12.5px; padding: 4px 14px; }
.pr-text { min-height: 360px; font-family: var(--mono, ui-monospace, monospace); font-size: 13px; }

/* ---------- Invisalign Case Board ---------- */
.cb-search { position: relative; display: block; width: 300px; }
.cb-search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cb-search > .input { width: 100%; padding-left: 34px; }
.cb-muted { color: var(--muted); }
.cb-tiers { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px 30px; margin: 14px 0 4px; background: var(--surface); }
.cb-tiers-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cb-tiers-head .btn { margin-left: auto; }
.cb-track { position: relative; height: 8px; border-radius: 999px; background: var(--sunken); margin: 0 18px 0 4px; }
.cb-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent-fill); }
.cb-tier { position: absolute; top: -4px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cb-tick { width: 2px; height: 16px; background: var(--line-strong); }
.cb-tier.reached .cb-tick { background: var(--accent); }
.cb-tier.reached .cb-tier-name { color: var(--accent); font-weight: 600; }
.cb-tier-name { margin-top: 3px; }
.cb-tier-pts { font-size: 10.5px; }
.cb-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; font-size: 13px; color: var(--ink-2); }
.cb-key { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--sunken); font-size: 12.5px; }
.cb-key.cb-green, .cb-key.cb-yellow, .cb-key.cb-orange, .cb-key.cb-red { border-left: 4px solid var(--cb); background: var(--cb-soft); }
.cb-scope { height: 30px; width: auto; margin-left: auto; }
.cb-green { --cb: light-dark(#2e8b57, #79c99a); --cb-soft: light-dark(#e8f5ee, #1b3326); }
.cb-yellow { --cb: light-dark(#d4a017, #e9cf6b); --cb-soft: light-dark(#fdf6dc, #3a3115); }
.cb-orange { --cb: light-dark(#e07b00, #f0a65a); --cb-soft: light-dark(#fdeedd, #3d2a15); }
.cb-red { --cb: light-dark(#c62828, #f2948b); --cb-soft: light-dark(#fdeceb, #3a2120); }
.cb-card.cb-green, .cb-card.cb-yellow, .cb-card.cb-orange, .cb-card.cb-red { border-left: 5px solid var(--cb); background: var(--cb-soft); }
/* Deep red: the ClinCheck review is close and the card isn't in ClinCheck Ready.
   A solid fill with white text, so it can't be mistaken for the Over 21 pink. */
.cb-review { --cb: light-dark(#4a0606, #ffb3ab); --cb-fill: light-dark(#8e1414, #7d1212); }
.cb-card.cb-review { border-left: 5px solid var(--cb); background: var(--cb-fill); border-color: var(--cb-fill); border-left-color: var(--cb); color: #fff; }
.cb-card.cb-review:hover { border-color: var(--cb-fill); border-left-color: var(--cb); }
.cb-card.cb-review .chip { background: rgb(255 255 255 / .2); color: #fff; }
.cb-card.cb-review .cb-flag, .cb-card.cb-review .cb-caution { color: #fff; }
.cb-key.cb-review { background: var(--cb-fill); color: #fff; border-left: 4px solid var(--cb); }
.cb-name { display: flex; align-items: center; gap: 6px; }
.cb-flag { color: var(--accent); display: inline-flex; }
.cb-caution { color: light-dark(#c99700, #e9cf6b); display: inline-flex; }
.chip.cb-series { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cb-board .column.cb-clincheck h3 { color: var(--accent); }
.cb-h { font-size: 14px; margin: 22px 0 6px; }
.cb-fields { grid-template-columns: 190px 1fr; }
@media (max-width: 860px) { .cb-fields { grid-template-columns: 1fr; } }
.cb-waiting-key { background: var(--surface); border: 1px solid var(--line-strong); }
.cb-stamp { display: flex; align-items: center; min-height: 32px; padding: 0 2px; }
.cb-history li { white-space: pre-wrap; overflow-wrap: anywhere; }
button.cb-key { border: 0; font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; outline-offset: 2px; }
button.cb-key.cb-green, button.cb-key.cb-yellow, button.cb-key.cb-orange, button.cb-key.cb-red { border-left: 4px solid var(--cb); }
button.cb-key:hover { box-shadow: inset 0 0 0 1px var(--cb); }
button.cb-key[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--cb); font-weight: 600; }
button.cb-key.cb-review { color: #fff; }
button.cb-key.cb-review:hover, button.cb-key.cb-review[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--cb); }
.cb-legend.cb-filtering button.cb-key[aria-pressed="false"] { opacity: .5; }
.cb-recall-note { margin: -6px 0 14px; }
.cb-save { justify-content: flex-end; margin-top: 14px; }
.cb-ds { display: flex; flex-direction: column; gap: 6px; }
.cb-notes { white-space: pre-wrap; background: var(--sunken); border-radius: var(--r); padding: 10px 12px; margin: 0; }
.cb-history { list-style: none; padding: 0; margin: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.cb-removed { display: flex; flex-direction: column; }
.cb-timeline { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; }
.cb-tl-row { display: grid; grid-template-columns: 200px minmax(480px, 1fr); align-items: center; gap: 10px; min-height: 26px; }
.cb-tl-head { position: sticky; top: 0; background: var(--bg); z-index: 1; }
.cb-tl-name { text-align: left; background: none; border: 0; padding: 2px 4px; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; display: flex; gap: 5px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cb-tl-name:hover { color: var(--accent); }
.cb-tl-track { position: relative; height: 14px; background: var(--sunken); border-radius: 4px; }
.cb-tl-head .cb-tl-track { background: none; height: 18px; }
.cb-tl-month { position: absolute; font-size: 11.5px; color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 4px; }
.cb-tl-band { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: color-mix(in oklab, var(--accent) calc(15% + var(--step) * 6.5%), var(--surface)); }
/* The case board's own look (2026-11-11): the brand's deep navy #022B41 for
   titles, rules, and buttons, light tints of the cool grey-blue #94A6B1 for
   fills. The rest of the app keeps Hunsaker Red. The card colors keep their
   meanings: white waiting, green to red for days since ClinCheck, deep red
   when the review is close. */
.cb-page, .cb-panel {
  --cb-navy: #022B41;
  --cb-blue: #94A6B1;
  --accent: light-dark(var(--cb-navy), #a9c6d8);
  --accent-fill: light-dark(var(--cb-navy), #2c5c78);
  --accent-soft: color-mix(in oklab, var(--accent) 10%, var(--surface));
  --accent-line: color-mix(in oklab, var(--accent) 38%, var(--surface));
  --ring: color-mix(in oklab, var(--accent) 28%, transparent);
  --cb-tint: light-dark(color-mix(in oklab, var(--cb-blue) 13%, var(--surface)), color-mix(in oklab, var(--cb-blue) 8%, var(--surface)));
  --cb-tint-2: light-dark(color-mix(in oklab, var(--cb-blue) 24%, var(--surface)), color-mix(in oklab, var(--cb-blue) 15%, var(--surface)));
  --cb-rule: light-dark(color-mix(in oklab, var(--cb-blue) 55%, var(--line)), color-mix(in oklab, var(--cb-blue) 30%, var(--line)));
  --cb-shadow: light-dark(color-mix(in oklab, #022B41 15%, transparent), rgb(0 0 0 / .45));
}
.cb-head {
  align-items: center; padding: 18px 22px; border: 1px solid var(--cb-rule); border-radius: 16px;
  background: linear-gradient(120deg, var(--cb-tint-2), var(--surface) 62%); box-shadow: 0 1px 2px var(--cb-shadow), 0 10px 28px -18px var(--cb-shadow);
  margin-bottom: 16px;
}
.cb-titleblock { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; }
.cb-titleblock .cb-mark { grid-row: span 2; width: 64px; height: auto; display: block; }
.cb-titleblock h1 { color: var(--accent); font-size: 26px; letter-spacing: -.025em; }
.cb-titleblock .sub { margin-top: 2px; font-weight: 500; }
.cb-version { margin-left: 10px; vertical-align: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--cb-rule); }
.cb-head .cb-search > .input { height: 36px; background: var(--surface); }
.cb-page .btn.primary:hover { background: color-mix(in oklab, var(--accent-fill) 82%, light-dark(white, black)); }
.cb-tiers {
  border-color: var(--cb-rule); border-radius: 16px; padding: 16px 22px 14px; margin-top: 0; container-type: inline-size;
  background: linear-gradient(180deg, var(--surface), var(--cb-tint)); box-shadow: 0 1px 2px var(--cb-shadow);
}
.cb-tiers-head > b { font-size: 17px; color: var(--accent); letter-spacing: -.01em; }
.cb-tiers .cb-track { height: 10px; margin: 6px 34px 66px 4px; background: color-mix(in oklab, var(--cb-blue) 22%, var(--sunken)); }
/* Each tier hangs below the bar: tick, badge, name, points. The bar's bottom
   margin leaves room for all four, so nothing spills out of the box. */
.cb-tiers .cb-tier { top: -3px; gap: 2px; }
.cb-tiers .cb-tick { height: 12px; }
.cb-tier-icon { display: block; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .18)); transition: transform .15s var(--ease); }
.cb-tier:not(.reached) .cb-tier-icon { opacity: .55; filter: grayscale(.5); }
.cb-tier .cb-tier-name { margin-top: 1px; line-height: 15px; }
.cb-tier .cb-tier-pts { line-height: 13px; }
.cb-tier.cb-current .cb-tier-icon { opacity: 1; filter: none; transform: scale(1.18); border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.cb-tier.cb-next .cb-tier-icon { transform: scale(1.12); border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in oklab, var(--accent) 45%, transparent); opacity: .9; filter: none; }
.cb-tier.cb-current .cb-tier-name, .cb-tier.cb-next .cb-tier-name { color: var(--accent); font-weight: 650; }
/* Narrow boards: every badge stays, but only the current and next tiers keep
   their names and points, and below that only the next one. */
@container (max-width: 600px) {
  .cb-tier:not(.cb-next):not(.cb-current) .cb-tier-name, .cb-tier:not(.cb-next):not(.cb-current) .cb-tier-pts { display: none; }
  .cb-tiers .cb-track { margin-right: 30px; }
}
@container (max-width: 420px) {
  .cb-tier.cb-current:not(.cb-next) .cb-tier-name, .cb-tier.cb-current:not(.cb-next) .cb-tier-pts { display: none; }
  .cb-tiers .cb-tier-icon { width: 18px; height: 18px; }
}
.cb-tiers .cb-fill { background: linear-gradient(90deg, color-mix(in oklab, var(--accent-fill) 55%, var(--surface)), var(--accent-fill)); box-shadow: 0 1px 4px var(--cb-shadow); }
.cb-tiers .cb-tier.reached .cb-tick { width: 3px; }
.cb-tabs { margin: 14px 0 16px; border-bottom-color: var(--cb-rule); }
.cb-tabs .tab.on { color: var(--accent); font-weight: 600; border-bottom-width: 3px; }
.cb-legend { margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cb-legend > span:first-child { font-weight: 600; color: var(--ink); }

.cb-board { gap: 16px; padding: 2px 2px 20px; }
.cb-board .column {
  width: 292px; padding: 0 10px 12px; border-radius: 16px; border-color: var(--cb-rule);
  background: color-mix(in oklab, var(--accent) 3%, var(--sunken));
}
.cb-board .column h3 {
  margin: 0 -10px 12px; padding: 12px 14px 11px; border-radius: 15px 15px 0 0; font-size: 13.5px; font-weight: 650; letter-spacing: .005em;
  color: var(--accent); background: var(--cb-tint); border-bottom: 1px solid var(--cb-rule); box-shadow: inset 0 3px 0 var(--accent);
}
.cb-board .column.cb-clincheck h3 { background: var(--cb-tint-2); }
.cb-board .column h3 span {
  margin-left: auto; min-width: 26px; text-align: center; font-weight: 650; color: var(--accent);
  background: var(--surface); border: 1px solid var(--cb-rule); line-height: 20px;
}
.cb-board .cards { gap: 10px; }
.cb-board .cb-card {
  border-radius: 12px; padding: 11px 13px 11px 12px; border-color: color-mix(in oklab, var(--accent) 7%, var(--line));
  border-left: 4px solid var(--line-strong);
  box-shadow: 0 1px 2px var(--cb-shadow), 0 6px 14px -10px var(--cb-shadow);
}
.cb-board .cb-card:hover { transform: translateY(-2px); border-color: var(--cb-rule); border-left-color: var(--line-strong); box-shadow: 0 2px 4px var(--cb-shadow), 0 14px 26px -14px var(--cb-shadow); }
.cb-board .cb-card.cb-green, .cb-board .cb-card.cb-yellow, .cb-board .cb-card.cb-orange, .cb-board .cb-card.cb-red { border-left: 4px solid var(--cb); }
.cb-board .cb-card.cb-green:hover, .cb-board .cb-card.cb-yellow:hover, .cb-board .cb-card.cb-orange:hover, .cb-board .cb-card.cb-red:hover { border-left-color: var(--cb); }
.cb-board .cb-card.cb-review, .cb-board .cb-card.cb-review:hover { border-color: var(--cb-fill); border-left: 4px solid var(--cb); }
.cb-board .cb-card .cb-name { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; letter-spacing: -.005em; }
.cb-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.cb-days { display: inline-flex; align-items: center; gap: 4px; }
.cb-card.cb-review .cb-meta { color: rgb(255 255 255 / .82); }
.cb-chips { margin-top: 9px; }
.cb-board .cb-card .chip { line-height: 21px; font-size: 11.5px; }
.cb-empty-col {
  padding: 16px 10px; text-align: center; font-size: 12.5px; color: var(--muted);
  border: 1.5px dashed var(--cb-rule); border-radius: 12px;
}

.cb-panel-head {
  margin: -18px -24px 14px; padding: 20px 24px 14px; border-bottom: 1px solid var(--cb-rule);
  background: linear-gradient(180deg, var(--cb-tint-2), var(--surface)); border-radius: 14px 14px 0 0;
}
.cb-panel .cb-title { font-size: 21px; font-weight: 650; letter-spacing: -.015em; color: var(--accent); margin: 0; }
.cb-panel-sub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.cb-panel-flags:empty { display: none; }
.cb-panel .cb-fields { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--cb-tint); }
.cb-panel .cb-h { color: var(--accent); font-size: 14px; font-weight: 650; margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--cb-rule); }
.cb-panel .cb-history li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.cb-panel .cb-history li:last-child { border-bottom: 0; }

@media (max-width: 700px) {
  .cb-tier:not(.cb-next):not(.cb-current) .cb-tier-name, .cb-tier:not(.cb-next):not(.cb-current) .cb-tier-pts { display: none; }
  .cb-search { width: 100%; }
  .cb-head { padding: 14px 16px; }
  .cb-titleblock .cb-mark { width: 48px; }
}

/* Team > Training: the quiz grid scrolls sideways on a narrow screen, and its
   last row counts who has passed. */
.tr-wrap { overflow-x: auto; }
.tr-total td { font-weight: 600; border-top: 2px solid var(--line, #ddd); }
/* Team > Settings > Quizzes: one block per quiz, two lines that wrap. */
.tr-quiz { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.tr-quiz-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tr-quiz-line > label:not(.setting-check) { display: grid; gap: 4px; font-size: 13px; color: var(--muted, inherit); flex: 1 1 180px; }
.tr-quiz-line > label:last-child:not(.setting-check) { flex: 0 0 auto; }
.tr-group td { background: var(--line); font-weight: 600; padding-top: 6px; padding-bottom: 6px; }
.tr-group .count { margin-left: 6px; }

/* Team > Training: check-off sheets. ck- is this feature's prefix. */
.ck-cell { display: grid; grid-template-columns: 64px auto; align-items: center; gap: 2px 8px; text-decoration: none; color: inherit; }
.ck-cell .task-meta { grid-column: 1 / -1; }
.ck-bar { display: inline-block; height: 8px; width: 64px; border-radius: 4px; background: var(--line); overflow: hidden; vertical-align: middle; }
.ck-bar > span { display: block; height: 100%; background: var(--good); border-radius: 4px; }
.ck-bar.wide { width: 160px; }
.ck-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ck-percent { font-size: 28px; }
.ck-sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ck-sec-head h2 { margin: 0; }
.ck-sec-progress { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ck-items { display: table; width: 100%; }
.ck-items td:first-child { width: 50%; }
.ck-step { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 2px 0; }
.ck-doc { font-weight: 600; min-width: 120px; }
.ck-reps { display: inline-flex; align-items: center; gap: 4px; }
.ck-rep-btn { padding: 0 8px; min-height: 26px; }
.ck-edit-sec { border-top: 1px solid var(--line); padding: 8px 0; }
.ck-edit-sec > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
@media print {
  .ck-rep-btn { display: none; }
  .ck-section { break-inside: avoid-page; }
}

/* Scanning with the camera (Count tab). */
.scan-overlay { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: 84%; height: min(60%, 340px); max-width: 640px; border: 3px solid rgba(255, 255, 255, 0.9); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); pointer-events: none; }
.scan-status { position: absolute; left: 16px; right: 16px; bottom: calc(28px + env(safe-area-inset-bottom)); margin: 0; text-align: center; color: #fff; font-size: 17px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.scan-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; }

/* Settings, AI Access, and the choices on the Allow page (2026-11-15). */
.aa-apps { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.aa-apps legend { font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.aa-app, .aa-attest, .aa-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.4; }
.aa-app > span, .aa-attest > span, .aa-toggle > span { display: flex; flex-direction: column; gap: 2px; }
.aa-app input, .aa-attest input, .aa-toggle input { margin-top: 3px; }
.aa-attest { margin: 4px 0 14px; padding: 12px; border-radius: 8px; background: var(--hover); }
.aa-toggle { margin-bottom: 10px; }
.aa-list .row { margin-top: 8px; }
.aa-list .row .input { flex: 1; max-width: 360px; }
.aa-names { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.aa-names li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.aa-names li > span { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
