/* Meetings, "Soft Studio": white cards on a cool grey ground, a pastel tile per meeting (one of six
   colors, the same on every page), black pills for what is selected, Bricolage Grotesque for
   headings and Figtree for text. Light and dark follow the system setting.

   The fonts are served from /static/fonts (SIL Open Font License 1.1, the OFL-*.txt files beside
   them): the CSP (default-src 'self') loads nothing from elsewhere. No inline styles anywhere. */

/* ---------------------------------------------------------------- fonts */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light dark;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f2f3f7;
  --surface: #ffffff;
  --track: #e3e5ec;
  --ink: #1b1d24;
  --ink-2: #3e4250;
  --muted: #5c6170;
  --faint: #8a8f9c;
  --line: #e4e6ec;
  --pill: #1b1d24;
  --on-pill: #ffffff;
  --accent: #6b5ce7;
  --link: #3d2db0;
  --ok: #17603f;
  --ok-bg: #ddf4e7;
  --warn: #8f3e12;
  --warn-bg: #ffe7d9;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --bad-solid: #c0362c;
  --card-edge: transparent;
  --shadow-sm: 0 1px 2px rgba(27, 29, 36, 0.06);
  --shadow-md: 0 1px 2px rgba(27, 29, 36, 0.06), 0 6px 18px rgba(27, 29, 36, 0.05);
  --shadow-lg: 0 10px 30px rgba(27, 29, 36, 0.14), 0 1px 3px rgba(27, 29, 36, 0.08);
  --bar-bg: rgba(242, 243, 247, 0.84);
  --chip-bg: rgba(255, 255, 255, 0.72);
  --radius-card: 24px;
  --tabbar-space: 112px;

  /* The six meeting colors (background, text, the deep tone of a hero title) and the grey of a
     meeting still on its way. */
  --t1-bg: #ece8ff; --t1-ink: #3d2db0; --t1-deep: #221a73;
  --t2-bg: #ddf4e7; --t2-ink: #17603f; --t2-deep: #0e3f28;
  --t3-bg: #ffe7d9; --t3-ink: #8f3e12; --t3-deep: #5c260a;
  --t4-bg: #dcebff; --t4-ink: #1d4e99; --t4-deep: #10336b;
  --t5-bg: #ffe4ec; --t5-ink: #9b1b4b; --t5-deep: #651030;
  --t6-bg: #fff3c4; --t6-ink: #6e5200; --t6-deep: #463400;
  --t0-bg: #e9ebf0; --t0-ink: #3e4250; --t0-deep: #1b1d24;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #1a1d23;
    --track: #23262e;
    --ink: #f2f3f6;
    --ink-2: #cdd0d8;
    --muted: #a4a9b6;
    --faint: #6e7380;
    --line: #2a2e37;
    --pill: #f2f3f6;
    --on-pill: #15171c;
    --accent: #a99cff;
    --link: #b9aeff;
    --ok: #8fe0b5;
    --ok-bg: #173a2b;
    --warn: #ffc29e;
    --warn-bg: #43281a;
    --bad: #ffa69e;
    --bad-bg: #4a1f1c;
    --bad-solid: #c9372c;
    --card-edge: rgba(255, 255, 255, 0.06);
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
    --bar-bg: rgba(15, 17, 21, 0.84);
    --chip-bg: rgba(255, 255, 255, 0.09);

    --t1-bg: #2b2650; --t1-ink: #d4ccff; --t1-deep: #ece8ff;
    --t2-bg: #173a2b; --t2-ink: #b5ebcf; --t2-deep: #ddf4e7;
    --t3-bg: #43281a; --t3-ink: #ffcdb2; --t3-deep: #ffe7d9;
    --t4-bg: #1b3150; --t4-ink: #b9d5ff; --t4-deep: #dcebff;
    --t5-bg: #45202e; --t5-ink: #ffc2d5; --t5-deep: #ffe4ec;
    --t6-bg: #3d3315; --t6-ink: #fbe39a; --t6-deep: #fff3c4;
    --t0-bg: #23262e; --t0-ink: #cdd0d8; --t0-deep: #f2f3f6;
  }
}

.tile-1, .spk-1 { --tile-bg: var(--t1-bg); --tile-ink: var(--t1-ink); --tile-deep: var(--t1-deep); }
.tile-2, .spk-2 { --tile-bg: var(--t2-bg); --tile-ink: var(--t2-ink); --tile-deep: var(--t2-deep); }
.tile-3, .spk-3 { --tile-bg: var(--t3-bg); --tile-ink: var(--t3-ink); --tile-deep: var(--t3-deep); }
.tile-4, .spk-4 { --tile-bg: var(--t4-bg); --tile-ink: var(--t4-ink); --tile-deep: var(--t4-deep); }
.tile-5, .spk-5 { --tile-bg: var(--t5-bg); --tile-ink: var(--t5-ink); --tile-deep: var(--t5-deep); }
.tile-6, .spk-6 { --tile-bg: var(--t6-bg); --tile-ink: var(--t6-ink); --tile-deep: var(--t6-deep); }
.tile-busy { --tile-bg: var(--t0-bg); --tile-ink: var(--t0-ink); --tile-deep: var(--t0-deep); }

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
img { display: block; }
svg.icon { display: inline-block; flex: none; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--track);
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- app bar */

/* Phones: the meeting pages have a bar with round buttons; the other pages start with their big
   title, and the tab bar does the navigation. Wider screens: a bar with the menu everywhere. */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .appbar {
    background: var(--bar-bg);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
  }
}
body:not(.is-detail) .appbar { display: none; }
.appbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 700 19px/1 var(--display);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; border-radius: 9px; }
.topnav { display: none; align-items: center; gap: 4px; margin-left: auto; }
.topnav a, .link-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 20px;
  background: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.topnav a:hover, .link-button:hover { background: var(--surface); color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--pill); color: var(--on-pill); }
.inline-form { display: inline; margin: 0; }
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}
.icon-button::-webkit-details-marker { display: none; }
.appbar-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--ink);
  font: 700 16px/1.2 var(--display);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The title fades in once the big one has scrolled away (where scroll timelines exist). */
@supports (animation-timeline: scroll()) {
  .appbar-title {
    animation: appbar-title linear both;
    animation-timeline: scroll(root block);
    animation-range: 150px 230px;
  }
  @keyframes appbar-title { to { opacity: 1; } }
}

/* The actions menu of a meeting (details/summary, no JavaScript). */
.menu { position: relative; flex: none; }
.menu > summary { list-style: none; }
.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 236px;
  padding: 6px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--card-edge);
}
.menu[open] .menu-panel { animation: menu-in 0.14s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-panel a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.menu-panel a:hover { background: var(--bg); }
.menu-panel .icon { color: var(--muted); }
.menu-panel .danger-link, .menu-panel .danger-link .icon { color: var(--bad); }

/* ---------------------------------------------------------------- page */

.page { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }
body:not(.is-detail) .page { padding-top: calc(env(safe-area-inset-top) + 14px); }
.has-tabbar .page { padding-bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-space)); }
.page-head { padding: 16px 4px 0; }
.is-detail .page-head { padding-top: 6px; }
.page-title {
  font: 700 42px/1.02 var(--display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.page-title-small { font-size: 30px; line-height: 1.08; }
.page-sub { margin-top: 6px; color: var(--muted); font-size: 15px; font-weight: 500; }
.page-sub strong { color: var(--ink); }

/* ---------------------------------------------------------------- tab bar */

.tabbar {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  left: 16px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-width: 440px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--card-edge);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background: color-mix(in srgb, red 50%, blue)) {
  .tabbar {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
  }
}
.tabbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 52px;
  border-radius: 26px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.tabbar a[aria-current="page"] { background: var(--pill); color: var(--on-pill); }
@media (max-width: 370px) {
  .tabbar a { gap: 5px; font-size: 13px; }
  .tabbar .icon { width: 18px; height: 18px; }
}

/* ---------------------------------------------------------------- list */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  margin-top: 18px;
  padding: 0 4px 0 18px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--card-edge);
}
.search:focus-within { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }
.search-icon { display: flex; color: var(--muted); }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  color: var(--ink-2);
}
.search-clear:hover { background: var(--track); }

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 15px;
  font-weight: 600;
}

.day { margin-top: 26px; }
.day-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 4px 10px;
  font: 700 18px/1.2 var(--display);
  letter-spacing: -0.01em;
}
.day-date { color: var(--muted); font: 500 14px/1.2 var(--font); letter-spacing: 0; }
.cards { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.card-link {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card-link:hover { box-shadow: var(--shadow-md), inset 0 0 0 1px var(--card-edge); }
.card-link:active { transform: scale(0.985); }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: var(--tile-bg, var(--t1-bg));
  color: var(--tile-ink, var(--t1-ink));
}
.tile-time {
  font: 700 18px/1 var(--display);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.tile-sub { font-size: 12px; font-weight: 600; line-height: 1; }
.card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding-top: 3px;
}
.card-title { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; text-wrap: pretty; }
.card-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--t1-bg);
  color: var(--t1-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.pill-failed { background: var(--bad-bg); color: var(--bad); }
.pill-skipped { background: var(--track); color: var(--ink-2); }
.pulse {
  position: relative;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  from { transform: scale(0.5); opacity: 0.45; }
  to { transform: scale(1.7); opacity: 0; }
}

/* ---------------------------------------------------------------- empty states, alerts */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 32px 24px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 18px;
  background: var(--t1-bg);
  color: var(--t1-ink);
}
.empty-title { font: 700 19px/1.3 var(--display); }
.empty .muted { max-width: 36ch; font-size: 15px; }
.empty .button { margin-top: 8px; }
.alert {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 20px;
  background: var(--bad-bg);
  color: var(--bad);
}
.alert-icon { display: flex; flex: none; padding-top: 1px; }
.alert-title { font-weight: 700; }
.alert .error-text, .alert .hint { margin-top: 4px; color: inherit; }
.alert-compact { align-items: center; margin: 0 0 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; text-align: left; }
.error-text { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- meeting */

.hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
  padding: 22px;
  border-radius: 28px;
  background: var(--tile-bg, var(--t1-bg));
  color: var(--tile-deep, var(--t1-deep));
}
.hero-date { color: var(--tile-ink, var(--t1-ink)); font-size: 14px; font-weight: 600; }
.hero-title {
  font: 700 31px/1.08 var(--display);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hero .chip {
  padding: 7px 12px;
  background: var(--chip-bg);
  color: var(--tile-deep, var(--t1-deep));
  font-size: 13px;
  font-weight: 600;
}
.progress-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}
.progress-note .pulse { margin-top: 6px; color: var(--t1-ink); }
.progress-note strong { color: var(--ink); }
.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 16px;
  padding: 5px;
  border-radius: 27px;
  background: var(--track);
}
.tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 22px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.tabs a[aria-current="page"] { background: var(--pill); color: var(--on-pill); }
.template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin-top: 12px;
  padding: 0 16px 0 18px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
  color: var(--ink);
  text-decoration: none;
}
.template-row-label { color: var(--muted); font-size: 14px; font-weight: 500; }
.template-row-value { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.template-row-value .icon { color: var(--muted); }
.summary-foot { margin: 16px 8px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* The summary: each h2 section a card (app.py, _sectioned); "Full Summary" a heading over a card
   per topic; the key points with colored bullets. */
.prose { font-size: 16px; line-height: 1.55; overflow-wrap: break-word; }
.prose > .sec:not(.sec-group), .prose .sec-card {
  margin-top: 12px;
  padding: 22px 20px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
}
.prose > .sec-intro:not(.sec-group) {
  padding: 8px 8px 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 14px;
}
.prose .sec-group { margin-top: 28px; }
.prose .sec-group > h2 { margin: 0 4px; font-size: 23px; letter-spacing: -0.015em; }
.prose h1 { margin: 0 0 12px; font: 700 24px/1.2 var(--display); letter-spacing: -0.015em; }
.prose h2 { margin: 0 0 14px; font: 700 21px/1.2 var(--display); letter-spacing: -0.01em; }
.prose h3 { margin: 0 0 12px; font: 700 18px/1.25 var(--display); letter-spacing: -0.005em; }
.prose h4, .prose h5, .prose h6 { margin: 16px 0 8px; font-size: 15px; font-weight: 700; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding: 0; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.prose .sec-key ul > li::before { top: 0.52em; left: 2px; width: 8px; height: 8px; background: var(--accent); }
.prose .sec li > ul > li::before {
  top: 0.55em;
  left: 2px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--faint);
  background: none;
}
.prose ol { padding-left: 24px; }
.prose ol > li { padding-left: 4px; }
.prose ol > li::marker { color: var(--muted); font-weight: 700; }
.prose li + li { margin-top: 10px; }
.prose li > ul, .prose li > ol { margin: 8px 0 0; }
.prose li li { color: var(--ink-2); font-size: 15px; }
.prose li > p { margin: 0 0 6px; }
.prose li > p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose blockquote { margin: 0 0 12px; padding: 12px 16px; border-radius: 16px; background: var(--bg); color: var(--ink-2); }
.prose hr { height: 1px; margin: 18px 0; border: 0; background: var(--line); }
.prose pre { margin: 0 0 12px; padding: 12px 14px; overflow-x: auto; border-radius: 14px; background: var(--bg); font-size: 13px; }
.prose pre code { padding: 0; background: none; }
.prose .sec > :last-child, .prose .sec-card > :last-child { margin-bottom: 0; }
.prose li.task { padding-left: 32px; }
.prose li.task::before { content: none; }
.task-box {
  position: absolute;
  top: 0.1em;
  left: 0;
  width: 21px;
  height: 21px;
  border: 2px solid var(--faint);
  border-radius: 7px;
}
.task.done { color: var(--muted); }
.task.done .task-box { border-color: var(--ok); background: var(--ok); }
.task.done .task-box::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 5.5px;
  width: 5px;
  height: 10px;
  border: solid var(--surface);
  border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg);
}
.table-wrap { margin: 0 0 12px; overflow-x: auto; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg); font-weight: 700; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* Transcript */
.transcript { padding: 6px 20px; }
.turn { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
.turn + .turn { border-top: 1px solid var(--line); }
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--tile-bg, var(--track));
  color: var(--tile-ink, var(--ink-2));
  font-size: 12px;
  font-weight: 700;
}
.avatar-none { background: var(--track); }
.turn-body { min-width: 0; }
.speaker { display: block; margin-bottom: 2px; color: var(--tile-ink, var(--muted)); font-size: 13px; font-weight: 700; }
.turn-text { font-size: 16px; line-height: 1.55; overflow-wrap: break-word; }

/* ---------------------------------------------------------------- sheets, facts, chips */

.sheet {
  margin-top: 12px;
  padding: 20px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
}
.sheet-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font: 700 19px/1.25 var(--display);
  letter-spacing: -0.01em;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--track);
  color: var(--ink-2);
  font: 700 13px/1 var(--font);
}
.details { margin-top: 16px; padding: 0; }
.details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.details > summary::-webkit-details-marker { display: none; }
.details > summary > span { display: inline-flex; align-items: center; gap: 10px; }
.details > summary .icon { color: var(--muted); }
.details-chevron { transition: transform 0.2s; }
.details[open] .details-chevron { transform: rotate(180deg); }
.details .facts { padding: 0 20px 20px; }
.facts {
  display: grid;
  grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
  gap: 10px 16px;
  font-size: 14px;
}
.facts dt { color: var(--muted); }
.facts dd { overflow-wrap: anywhere; }
.facts code { font-size: 12px; }
.facts-status { align-items: center; }
.facts-status dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--track);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.chip-ok, .chip-done { background: var(--ok-bg); color: var(--ok); }
.chip-bad, .chip-failed { background: var(--bad-bg); color: var(--bad); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-new, .chip-waiting, .chip-downloaded, .chip-transcribing, .chip-summarizing { background: var(--t1-bg); color: var(--t1-ink); }
.counts { width: 100%; border-collapse: collapse; font-size: 15px; }
.counts th, .counts td { padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 400; text-align: left; }
.counts td { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.counts tr:last-child th, .counts tr:last-child td { border-bottom: 0; }
.counts .zero { opacity: 0.55; }
.logout-form { margin-top: 16px; }

/* ---------------------------------------------------------------- forms, buttons */

.form-sheet { margin-top: 12px; }
.form-sheet .sheet-heading { margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
label { font-size: 14px; font-weight: 600; }
input[type="text"], input[type="password"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  outline: none;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--ink);
  font-size: 16px;
}
input[type="text"]:focus, input[type="password"]:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.hint { color: var(--muted); font-size: 14px; }
.hint-strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.actions-stacked { flex-direction: column; }
.actions-stacked .button { width: 100%; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 26px;
  background: var(--pill);
  color: var(--on-pill);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s;
}
.button:active { transform: scale(0.98); }
.button.secondary { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); }
.button.danger { background: var(--bad-solid); color: #ffffff; }
.button-block { width: 100%; }
.reset-link {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 4px;
  color: var(--link);
  font-size: 15px;
  text-decoration: underline;
}
.reset-link:hover { background: none; color: var(--link); }

/* Delete */
.confirm { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 22px 22px; text-align: center; }
.confirm-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: var(--bad-bg);
  color: var(--bad);
}
.confirm .sheet-heading { margin: 0; }
.confirm-what {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 20px;
  background: var(--bg);
  text-align: left;
}
.confirm-what .tile { flex: none; width: 48px; height: 48px; border-radius: 16px; }
.confirm-what strong { display: block; font-weight: 700; overflow-wrap: anywhere; }
.confirm-what .muted { display: block; font-size: 14px; }
.confirm-text { color: var(--ink-2); font-size: 15px; }
.confirm .actions { width: 100%; }

/* ---------------------------------------------------------------- templates */

.template-list { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.template-card { margin: 0; }
.template-head { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 14px; }
.template-head .tile, .choice .tile { width: 48px; height: 48px; border-radius: 16px; }
.template-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 700 18px/1.25 var(--display); }
.template-desc { margin-top: 4px; color: var(--muted); font-size: 15px; }
.template-best { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; color: var(--ink-2); font-size: 14px; }
.template-best .icon { margin-top: 2px; color: var(--ok); }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--on-pill);
  font: 700 11px/1.4 var(--font);
  letter-spacing: 0.02em;
}
.example { margin-top: 14px; border-radius: 18px; background: var(--bg); }
.example > summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: var(--link);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.example > summary::-webkit-details-marker { display: none; }
.example .prose { padding: 0 12px 12px; }
.prose-small { font-size: 14px; }
.prose-small > .sec:not(.sec-group), .prose-small .sec-card { margin-top: 8px; padding: 14px 16px; border-radius: 16px; box-shadow: none; }
.prose-small > .sec:first-child { margin-top: 0; }
.prose-small h2 { margin-bottom: 8px; font-size: 16px; }
.prose-small .sec-group { margin-top: 16px; }
.prose-small .sec-group > h2 { font-size: 17px; }
.prose-small h3 { margin-bottom: 8px; font-size: 15px; }
.prose-small li li { font-size: 13px; }

.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.choice {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-edge);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease;
}
.choice:active { transform: scale(0.985); }
.choice.is-current { box-shadow: inset 0 0 0 2px var(--pill); }
.choice-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.choice-desc { color: var(--muted); font-size: 14px; line-height: 1.4; }
.choice-arrow { color: var(--muted); }
.page .center { margin-top: 18px; font-size: 15px; }

/* ---------------------------------------------------------------- login */

.login-page .page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(env(safe-area-inset-top) + 16px);
}
.login {
  width: 100%;
  max-width: 380px;
  padding: 32px 24px 26px;
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--card-edge);
  text-align: center;
}
.login-logo { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; }
.login-title { font: 700 32px/1.1 var(--display); letter-spacing: -0.02em; }
.login-sub { margin: 6px 0 22px; color: var(--muted); font-size: 15px; }
.login .stack { text-align: left; }
.input-icon { position: relative; }
.input-icon-glyph {
  position: absolute;
  top: 50%;
  left: 16px;
  display: flex;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}
.input-icon input { padding-left: 46px; }

/* ---------------------------------------------------------------- wider screens */

@media (min-width: 760px) {
  body:not(.is-detail) .appbar { display: block; }
  .appbar-inner { max-width: 760px; padding: 10px 24px; }
  .topnav { display: flex; }
  .tabbar { display: none; }
  .page { max-width: 760px; padding-right: 24px; padding-left: 24px; }
  .has-tabbar .page { padding-bottom: 64px; }
  body:not(.is-detail) .page { padding-top: 8px; }
  .page-title { font-size: 48px; }
  .hero { padding: 28px; }
  .hero-title { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .appbar-title { opacity: 0; }
}
