/* harmem design system: warm neutrals, bento tiles, serif numbers. No external fonts (CSP allows only 'self'). */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f3ede3;
  --bg-deep: #ebe3d6;
  --surface: #fffcf6;
  --surface-2: #f8f2e8;
  --surface-3: #f1e9dc;
  --ink: #2b221c;
  --ink-2: #5a4e44;
  --muted: #8b7e71;
  --line: #e9e0d2;
  --line-strong: #d8cbb9;
  --focus: #3b6a4a;

  --forest: #2e4b37;
  --forest-ink: #f2ecdc;
  --forest-accent: #c8e6a0;
  --terracotta: #b9532f;
  --terracotta-soft: #f6ddd1;
  --amber: #a86d0c;
  --amber-soft: #f8e7bf;
  --sage: #4d7148;
  --sage-soft: #e1ead6;
  --plum: #6e4f78;
  --plum-soft: #ece0ee;
  --clay: #9a5a4b;
  --clay-soft: #f4dfd8;
  --sky: #3f6378;
  --sky-soft: #dde8ec;

  --tile-butter: #f6e7a8;
  --tile-butter-ink: #3b3112;
  --tile-clay: #f1cfc3;
  --tile-clay-ink: #43231a;
  --tile-sage: #cfdec3;
  --tile-sage-ink: #1f3019;
  --tile-plum: #dccfe6;
  --tile-plum-ink: #2f2138;
  --tile-terracotta: #e98b6a;
  --tile-terracotta-ink: #2f130a;

  --shadow-sm: 0 1px 2px rgba(60, 40, 20, .06);
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -12px rgba(60, 40, 20, .18);
  --shadow-lg: 0 24px 64px -24px rgba(40, 25, 10, .35);
  --glow: none;

  --r-tile: 20px;
  --r-inner: 12px;
  --r-sm: 9px;
  --gap: 16px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171411;
    --bg-deep: #120f0d;
    --surface: #211c18;
    --surface-2: #29231e;
    --surface-3: #312a24;
    --ink: #f0e8dc;
    --ink-2: #cdbfae;
    --muted: #9c8e7f;
    --line: #362e27;
    --line-strong: #4a4037;
    --focus: #a7d08a;
    --forest: #253d2c;
    --forest-ink: #eef2dd;
    --forest-accent: #b5dc87;
    --terracotta: #ec9673;
    --terracotta-soft: #42251b;
    --amber: #e9b858;
    --amber-soft: #3f3018;
    --sage: #a8c79c;
    --sage-soft: #263423;
    --plum: #cfb2d9;
    --plum-soft: #352a3a;
    --clay: #e0a594;
    --clay-soft: #3c2721;
    --sky: #a4c3d3;
    --sky-soft: #213039;
    --tile-butter: #4b4224;
    --tile-butter-ink: #f6e9b8;
    --tile-clay: #4a2f28;
    --tile-clay-ink: #f6d9cf;
    --tile-sage: #2f3d2a;
    --tile-sage-ink: #dcebd0;
    --tile-plum: #3b2f43;
    --tile-plum-ink: #eadcf1;
    --tile-terracotta: #6a3423;
    --tile-terracotta-ink: #ffe3d8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 64px -20px rgba(0, 0, 0, .7);
    --glow: 0 0 0 1px rgba(181, 220, 135, .08), 0 0 48px -12px rgba(181, 220, 135, .22);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171411;
  --bg-deep: #120f0d;
  --surface: #211c18;
  --surface-2: #29231e;
  --surface-3: #312a24;
  --ink: #f0e8dc;
  --ink-2: #cdbfae;
  --muted: #9c8e7f;
  --line: #362e27;
  --line-strong: #4a4037;
  --focus: #a7d08a;
  --forest: #253d2c;
  --forest-ink: #eef2dd;
  --forest-accent: #b5dc87;
  --terracotta: #ec9673;
  --terracotta-soft: #42251b;
  --amber: #e9b858;
  --amber-soft: #3f3018;
  --sage: #a8c79c;
  --sage-soft: #263423;
  --plum: #cfb2d9;
  --plum-soft: #352a3a;
  --clay: #e0a594;
  --clay-soft: #3c2721;
  --sky: #a4c3d3;
  --sky-soft: #213039;
  --tile-butter: #4b4224;
  --tile-butter-ink: #f6e9b8;
  --tile-clay: #4a2f28;
  --tile-clay-ink: #f6d9cf;
  --tile-sage: #2f3d2a;
  --tile-sage-ink: #dcebd0;
  --tile-plum: #3b2f43;
  --tile-plum-ink: #eadcf1;
  --tile-terracotta: #6a3423;
  --tile-terracotta-ink: #ffe3d8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 64px -20px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(181, 220, 135, .08), 0 0 48px -12px rgba(181, 220, 135, .22);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
p { margin: 0 0 .75em; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font: 500 clamp(26px, 3.2vw, 34px)/1.15 var(--serif); letter-spacing: -.015em; }
h2 { font: 500 21px/1.25 var(--serif); }
h3 { font-size: 15px; }
code, kbd, pre { font-family: var(--mono); font-size: 13px; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
pre {
  white-space: pre-wrap; word-break: break-word; line-height: 1.55;
  background: var(--surface-2); padding: 14px 16px; border-radius: var(--r-inner); border: 1px solid var(--line);
  max-height: 640px; overflow: auto; margin: 0;
}
mark { background: var(--amber-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
svg.i.lg { width: 22px; height: 22px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--forest-accent); color: #1b2a12; }

.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 10px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 10px max(16px, calc((100vw - 1400px) / 2 + 16px));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font: 600 17px/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--forest); color: var(--forest-accent); font: 600 16px/1 var(--serif);
}
.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav a, .nav summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.nav a:hover, .nav summary:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.nav .count { font: 600 11px/1 var(--mono); background: var(--terracotta); color: #fff; border-radius: 99px; padding: 3px 6px; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
  display: grid;
}
.menu-panel a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); font-size: 14px; }
.menu-panel a:hover { background: var(--surface-2); }
.menu-panel a[aria-current="page"] { background: var(--surface-3); font-weight: 600; }

.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input {
  width: 230px; padding: 8px 36px 8px 34px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font: inherit; font-size: 14px; color: var(--ink); transition: width .25s var(--ease), border-color .2s;
}
.search input:focus { width: 300px; border-color: var(--line-strong); }
.search kbd {
  position: absolute; right: 10px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; background: var(--surface-2);
}
.top-actions { display: flex; align-items: center; gap: 6px; }
.top-actions form { margin: 0; display: contents; }
.live {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 13px; cursor: pointer;
  max-width: 280px; font-family: inherit;
}
.live:hover { border-color: var(--line-strong); color: var(--ink); }
.live-text { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The last-event text must never push the header past the nav; below wide screens the dot and a short label suffice. */
@media (max-width: 1399px) {
  .live-text { display: none; }
  .live { padding: 0 12px; }
  .search input { width: 150px; }
  .search input:focus { width: 220px; }
  .search kbd { display: none; }
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; position: relative; }
.live[data-state="live"] .dot { background: #4caf50; }
.live[data-state="live"] .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #4caf50; opacity: 0; animation: ping 2.4s var(--ease) infinite;
}
.live[data-state="connecting"] .dot { background: var(--amber); }
.live[data-state="offline"] .dot { background: var(--terracotta); }
.live.flash .dot { background: var(--forest-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--forest-accent) 40%, transparent); }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); padding: 0; text-decoration: none;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-ic { display: none; }
:root:not([data-theme]) .theme-ic.auto, :root[data-theme="auto"] .theme-ic.auto, :root[data-theme="light"] .theme-ic.light, :root[data-theme="dark"] .theme-ic.dark { display: block; }

/* mobile tab bar */
.tabbar { display: none; }

/* ---------- layout ---------- */
main { max-width: 1400px; margin: 0 auto; padding: 24px 16px 80px; }
main.narrow { max-width: 920px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.page-head .lede { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }
.page-head .spacer, .spacer { flex: 1; }
.eyebrow, .label {
  font: 600 11px/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px;
}
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; }
.section-title h2 { font-size: 19px; }
.section-title .count { font: 500 13px var(--mono); color: var(--muted); }
.stack { display: grid; gap: var(--gap); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12px; }
.serif { font-family: var(--serif); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.content { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); grid-auto-flow: row dense; }
.s-2 { grid-column: span 2; } .s-3 { grid-column: span 3; } .s-4 { grid-column: span 4; } .s-5 { grid-column: span 5; }
.s-6 { grid-column: span 6; } .s-7 { grid-column: span 7; } .s-8 { grid-column: span 8; } .s-9 { grid-column: span 9; } .s-12 { grid-column: span 12; }
.r-2 { grid-row: span 2; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* ---------- tiles / cards ---------- */
.tile, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-tile); box-shadow: var(--shadow);
  padding: 20px; min-width: 0; position: relative;
}
.card { border-radius: 18px; padding: 18px 20px; }
.card + .card { margin-top: 12px; }
.card.flat, .tile.flat { box-shadow: none; }
.tile { display: flex; flex-direction: column; gap: 14px; }
.tile.push { justify-content: space-between; }
.tile-head { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.tile-head h2 { font: 500 19px/1.2 var(--serif); }
.tile-head .label { margin-right: auto; }
.tile-link { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tile-link:hover { color: var(--ink); }
.tile-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tile .scroll { overflow: auto; min-height: 0; flex: 1; margin: 0 -6px; padding: 0 6px; }
a.tile { text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.big { font: 400 clamp(40px, 4.4vw, 58px)/1 var(--serif); letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; }
.big.md { font-size: clamp(32px, 3.2vw, 42px); }
.big small { font-size: .45em; letter-spacing: 0; margin-left: 4px; }
.caption { font-size: 14px; line-height: 1.4; }

.tone-hero { background: var(--forest); color: var(--forest-ink); border-color: transparent; }
.tone-hero .label, .tone-hero .muted, .tone-hero .tile-link { color: color-mix(in srgb, var(--forest-ink) 70%, transparent); }
.tone-hero .chip-accent { background: var(--forest-accent); color: #1d2f14; }
.tone-hero hr { margin-top: auto; }
.tone-hero hr { border-top-color: color-mix(in srgb, var(--forest-ink) 18%, transparent); }
.tone-butter { background: var(--tile-butter); color: var(--tile-butter-ink); border-color: transparent; }
.tone-clay { background: var(--tile-clay); color: var(--tile-clay-ink); border-color: transparent; }
.tone-sage { background: var(--tile-sage); color: var(--tile-sage-ink); border-color: transparent; }
.tone-plum { background: var(--tile-plum); color: var(--tile-plum-ink); border-color: transparent; }
.tone-terracotta { background: var(--tile-terracotta); color: var(--tile-terracotta-ink); border-color: transparent; }
:is(.tone-butter, .tone-clay, .tone-sage, .tone-plum, .tone-terracotta) :is(.label, .muted, .tile-link) { color: inherit; opacity: .72; }
:is(.tone-butter, .tone-clay, .tone-sage, .tone-plum, .tone-terracotta) hr { border-top-color: currentColor; opacity: .15; }
.tile.glow { box-shadow: var(--shadow), var(--glow); }
.tile-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.chip-accent { font: 600 10.5px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: var(--forest-accent); color: #1d2f14; }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 18px; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent; vertical-align: 1px; text-decoration: none;
}
.pill svg.i { width: 13px; height: 13px; vertical-align: -2px; }
.pill.overdue, .pill.warn, .pill.danger { background: var(--terracotta-soft); color: var(--terracotta); }
.pill.soon { background: var(--amber-soft); color: var(--amber); }
.pill.ok, .pill.done { background: var(--sage-soft); color: var(--sage); }
.pill.info { background: var(--sky-soft); color: var(--sky); }
.pill.plum { background: var(--plum-soft); color: var(--plum); }
.pill.outline { background: transparent; border-color: var(--line-strong); }
.pill.mono { font-family: var(--mono); font-size: 11px; }
.badge-ext {
  display: inline-flex; align-items: center; gap: 4px; font: 600 10.5px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 6px; background: var(--clay-soft); color: var(--clay); white-space: nowrap; vertical-align: 1px;
}
.tag { font-size: 12px; color: var(--muted); }
.tag::before { content: "#"; opacity: .6; }

/* ---------- buttons ---------- */
button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 999px; padding: 8px 16px; min-height: 38px; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--bg); transition: transform .12s var(--ease), background .15s, border-color .15s, opacity .15s;
}
button:hover, .btn:hover { opacity: .92; }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: progress; }
.btn.primary, button.primary { background: var(--forest); color: var(--forest-ink); }
.btn.ghost, button.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); opacity: 1; }
.btn.quiet, button.quiet { background: transparent; color: var(--ink-2); padding: 6px 10px; min-height: 32px; }
.btn.quiet:hover, button.quiet:hover { background: var(--surface-3); color: var(--ink); opacity: 1; }
.btn.danger, button.danger { background: var(--terracotta); color: #fff; }
.btn.danger.ghost, button.danger.ghost { background: transparent; color: var(--terracotta); border-color: color-mix(in srgb, var(--terracotta) 40%, transparent); }
.btn.sm, button.sm { font-size: 13px; padding: 5px 12px; min-height: 32px; }
.btn.accept, button.accept { background: var(--sage-soft); color: var(--sage); border-color: color-mix(in srgb, var(--sage) 25%, transparent); }
.tone-hero .btn.ghost { background: transparent; color: var(--forest-ink); border-color: color-mix(in srgb, var(--forest-ink) 30%, transparent); }
form.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.actions a:not(.btn) { font-weight: 600; }

/* ---------- inputs ---------- */
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-inner); padding: 9px 12px; max-width: 100%; min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); }
select { padding-right: 30px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { width: 100%; min-height: 140px; line-height: 1.55; resize: vertical; }
textarea.short { min-height: 84px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 17px; height: 17px; accent-color: var(--forest); vertical-align: -3px; }
input[type="file"] { padding: 7px; background: var(--surface-2); border-style: dashed; }
input[type="date"] { min-width: 150px; }
.w-full { width: 100%; }
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span, label.lbl { font-size: 13px; color: var(--muted); font-weight: 500; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { margin-top: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row > input:not([type="checkbox"]):not([type="hidden"]), .form-row > select { flex: 1 1 160px; min-width: 0; }
.form-row > input.grow { flex: 3 1 220px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list.compact > li { padding: 8px 0; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; display: block; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
a.li-title:hover { text-decoration: underline; }
.li-meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.empty {
  text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-inner); font-size: 14px;
  display: grid; gap: 6px; justify-items: center;
}
.empty svg.i { width: 26px; height: 26px; opacity: .6; }
.tile .empty { border-color: color-mix(in srgb, currentColor 18%, transparent); color: inherit; opacity: .8; }

/* ---------- tasks ---------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); transition: opacity .3s, transform .3s var(--ease); }
.task:last-child { border-bottom: 0; }
.task .tick { margin: 0; flex: none; }
.tick button {
  width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 7px; background: var(--surface); border: 1.5px solid var(--line-strong);
  color: transparent; display: grid; place-items: center; margin-top: 1px;
}
.tick button:hover { border-color: var(--sage); color: var(--sage); opacity: 1; }
.tick button svg.i { width: 14px; height: 14px; stroke-width: 2.5; }
.task.done .tick button, .task.is-done .tick button { background: var(--sage); border-color: var(--sage); color: #fff; }
.task.done .task-title, .task.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task.is-done { opacity: .55; }
.task.leaving { opacity: 0; transform: translateX(16px); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.amount { font: 500 16px/1.2 var(--serif); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.task.payment .amount { font-size: 18px; }
.task.direct-debit .tick button { border-style: dashed; }
.kind-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); }
.kind-ic.payment { background: var(--amber-soft); color: var(--amber); }
.kind-ic.direct_debit { background: var(--plum-soft); color: var(--plum); }
.kind-ic.followup { background: var(--sky-soft); color: var(--sky); }
.task-side { display: flex; align-items: center; gap: 6px; flex: none; }
.task details { margin-top: 8px; }
.task details > summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: inline-flex; gap: 4px; align-items: center; }
.task details > summary::-webkit-details-marker { display: none; }
.task details[open] > summary { color: var(--ink); }
.task details .edit { margin-top: 10px; padding: 14px; border-radius: var(--r-inner); background: var(--surface-2); border: 1px solid var(--line); }
.add-task { display: flex; gap: 8px; align-items: center; padding-top: 4px; flex-wrap: wrap; }
.add-task input[name="title"] { flex: 1 1 140px; min-width: 0; }
.add-task select { flex: 0 1 140px; }

/* ---------- command bar ---------- */
.command { gap: 16px; }
.command h2 { font: 400 clamp(22px, 2.2vw, 28px)/1.15 var(--serif); }
.command-form { display: flex; flex-direction: column; gap: 10px; }
.command-input {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line-strong); transition: border-color .15s, box-shadow .15s;
}
.command-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 15%, transparent); }
.command-input .spark { color: var(--forest); }
.command-input input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; padding: 8px 4px; font-size: 16px; }
.command-input input:focus { box-shadow: none; }
.command-input .btns { display: flex; gap: 6px; flex: none; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; }
.suggest button { background: transparent; color: var(--ink-2); border: 1px solid var(--line); font-weight: 500; font-size: 13px; padding: 4px 11px; min-height: 30px; }
.suggest button:hover { background: var(--surface-2); color: var(--ink); opacity: 1; }
.answer { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 18px; max-height: 460px; overflow: auto; }
.turn { display: grid; gap: 10px; }
.answer-q { font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.answer-q::before { content: "Jij"; font: 600 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.step {
  display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--mono); padding: 6px 9px; border-radius: 8px;
  background: var(--surface-3); color: var(--ink-2); animation: rise .35s var(--ease) both;
}
.step.tool { background: var(--plum-soft); color: var(--plum); }
.step.ok { background: var(--sage-soft); color: var(--sage); }
.step.err { background: var(--terracotta-soft); color: var(--terracotta); }
.step.thinking::after { content: ""; width: 14px; height: 4px; background: radial-gradient(circle, currentColor 1.5px, transparent 2px) 0 0/5px 4px repeat-x; animation: dots 1s steps(3) infinite; }
@keyframes dots { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.answer-text { line-height: 1.65; overflow-wrap: anywhere; }
.answer-text p { margin: 0 0 .7em; }
.answer-text ul, .md ul, .md ol { margin: 0 0 .7em; padding-left: 1.2em; }
.answer-text .iter + .iter { margin-top: .8em; padding-top: .8em; border-top: 1px dashed var(--line); }
.cursor::after { content: ""; display: inline-block; width: 7px; height: 1em; background: currentColor; vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; opacity: .6; }
@keyframes blink { 50% { opacity: 0; } }
.md h3, .md h4 { font: 600 15px/1.3 var(--sans); margin: .9em 0 .35em; }
.md p { margin: 0 0 .65em; }
.md li { margin: .15em 0; }

/* ---------- activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.ev { display: flex; gap: 11px; align-items: flex-start; padding: 9px 8px; border-radius: 12px; cursor: default; min-width: 0; }
.ev.new { animation: rise .45s var(--ease) both; }
.ev:is(button, a) { width: 100%; text-align: left; background: transparent; color: inherit; border: 0; font: inherit; font-weight: 400; cursor: pointer; min-height: 0; text-decoration: none; justify-content: flex-start; white-space: normal; }
.ev:is(button, a):hover { background: color-mix(in srgb, var(--ink) 5%, transparent); opacity: 1; }
.ev-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); position: relative; }
.ev-ic svg.i { width: 16px; height: 16px; }
.ev-body { flex: 1; min-width: 0; }
.ev-sum, .ev-sub, .ev-meta { display: block; }
.ev-meta { display: flex; }
.drawer-panel:focus, .drawer-panel:focus-visible { outline: none; }
.ev-sum { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.ev-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-meta { font: 11.5px/1.4 var(--mono); color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.ev.lvl-warn .ev-ic::after, .ev.lvl-error .ev-ic::after { content: ""; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: var(--amber); }
.ev.lvl-error .ev-ic::after { background: var(--terracotta); }
.t-ingest { background: var(--clay-soft); color: var(--clay); }
.t-mcp { background: var(--plum-soft); color: var(--plum); }
.t-agent { background: var(--sage-soft); color: var(--sage); }
.t-llm { background: var(--amber-soft); color: var(--amber); }
.t-ai, .t-suggestion { background: var(--amber-soft); color: var(--amber); }
.t-task { background: var(--sage-soft); color: var(--sage); }
.t-file, .t-upload { background: var(--sky-soft); color: var(--sky); }
.t-oauth { background: var(--plum-soft); color: var(--plum); }
.feed .steps-n { font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 5px; background: var(--surface-3); color: var(--muted); }
.tile .feed { margin: 0 -8px; }
.live-tile .feed { max-height: 520px; overflow: auto; }
.pulse-bar { height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--forest-accent), transparent); background-size: 200% 100%; animation: sweep 2.2s linear infinite; opacity: .9; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* timeline (trace + deadlines) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline > li { position: relative; padding: 0 0 16px 26px; min-width: 0; }
.timeline > li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.timeline > li:last-child::before { display: none; }
.timeline > li::after { content: ""; position: absolute; left: 1px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline > li.lvl-info::after, .timeline > li.ok::after { border-color: var(--sage); background: var(--sage-soft); }
.timeline > li.lvl-warn::after, .timeline > li.soon::after { border-color: var(--amber); background: var(--amber-soft); }
.timeline > li.lvl-error::after, .timeline > li.overdue::after { border-color: var(--terracotta); background: var(--terracotta-soft); }
.timeline > li.done::after { background: var(--sage); border-color: var(--sage); }
.tl-date { font: 600 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tl-title { font-weight: 600; overflow-wrap: anywhere; }
.tl-detail { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.kv { font: 11.5px/1.3 var(--mono); padding: 3px 6px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); overflow-wrap: anywhere; }
.kv b { font-weight: 600; color: var(--muted); margin-right: 4px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(30, 20, 10, .28); animation: fade .25s var(--ease) both; }
.drawer-panel {
  position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(460px, calc(100vw - 20px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slidein .32s var(--ease) both; overflow: hidden;
}
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin-right: auto; }
.drawer-body { flex: 1; overflow: auto; padding: 10px 12px 20px; }
.drawer .trace-head { display: flex; gap: 8px; align-items: center; margin: 4px 0 14px; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; animation: toastin .3s var(--ease) both;
}
.toast.err { background: var(--terracotta); color: #fff; }
.toast .grow { overflow-wrap: anywhere; }
.toast button { background: color-mix(in srgb, var(--bg) 16%, transparent); color: inherit; min-height: 30px; padding: 4px 12px; font-size: 13px; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }

/* ---------- flash / notices ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; background: var(--sage-soft); color: var(--sage); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }
.flash.warn { background: var(--terracotta-soft); color: var(--terracotta); }
.notice-ext { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--clay-soft); color: var(--clay); font-size: 14px; margin-bottom: 14px; }
.secret { font: 14px/1.5 var(--mono); background: var(--surface); color: var(--ink); padding: 12px; border-radius: 10px; border: 1px dashed var(--sage); word-break: break-all; margin-top: 8px; user-select: all; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { font: 600 11px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.actions-cell { white-space: nowrap; text-align: right; }
td .muted { font-size: 13px; }
.cell-wrap { overflow-wrap: anywhere; }
tr.dim td { opacity: .5; }

/* ---------- meters ---------- */
progress, meter { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: color-mix(in srgb, currentColor 12%, transparent); border-radius: 99px; }
progress::-webkit-progress-value { background: currentColor; border-radius: 99px; transition: width .6s var(--ease); }
progress::-moz-progress-bar { background: currentColor; border-radius: 99px; }
meter::-webkit-meter-bar { background: color-mix(in srgb, currentColor 12%, transparent); border: 0; border-radius: 99px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--sage); border-radius: 99px; }
meter::-webkit-meter-suboptimum-value { background: var(--amber); border-radius: 99px; }
meter::-webkit-meter-even-less-good-value { background: var(--terracotta); border-radius: 99px; }
meter:-moz-meter-optimum::-moz-meter-bar { background: var(--sage); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--amber); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--terracotta); }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; font-size: 14px; }
.bar-row progress { grid-column: 1 / -1; height: 6px; }
.bar-row .n { font: 500 16px/1 var(--serif); font-variant-numeric: tabular-nums; }

/* ---------- small cards (projects, clients) ---------- */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.mini {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line);
  text-decoration: none; min-width: 0; scroll-snap-align: start; transition: transform .2s var(--ease), background .2s;
}
a.mini:hover { transform: translateY(-2px); background: var(--surface-3); }
.mini b { font-family: var(--serif); font-weight: 500; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .muted { font-size: 12.5px; }
.mini .cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--sage); margin-right: 6px; }
.mini .cat-dot.c1 { background: var(--terracotta); } .mini .cat-dot.c2 { background: var(--plum); } .mini .cat-dot.c3 { background: var(--amber); }
.client { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.client:last-child { border-bottom: 0; }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font: 600 14px/1 var(--serif); background: var(--surface-3); color: var(--ink-2); flex: none; position: relative; }
.avatar.a1 { background: var(--clay-soft); color: var(--clay); } .avatar.a2 { background: var(--plum-soft); color: var(--plum); }
.avatar.a3 { background: var(--sage-soft); color: var(--sage); } .avatar.a4 { background: var(--amber-soft); color: var(--amber); }
.client .presence { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--line-strong); }
.client.active .presence { background: #4caf50; }
.client.active .presence::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #4caf50; animation: ping 1.6s var(--ease) infinite; }

/* inbox items */
.inbox-item { display: grid; gap: 10px; }
.inbox-item .form-row select { flex: 1 1 180px; }
.suggestion-chip { display: inline-flex; align-items: center; gap: 6px; }
.conf { font: 600 11px/1 var(--mono); opacity: .75; }

/* suggestions page */
.sugg { display: grid; gap: 12px; }
.sugg-head { display: flex; gap: 12px; align-items: flex-start; }
.sugg-head h3 { font: 500 19px/1.3 var(--serif); }
.sugg-items { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg-steps { margin: 0; padding-left: 1.3em; color: var(--ink-2); font-size: 14px; }
.sugg-steps li { margin: 3px 0; }
.sugg.resolved { opacity: .62; }
.progress-log { display: grid; gap: 4px; font-size: 14px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--ink-2); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }

/* login / single card pages */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.solo-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 30px 28px; box-shadow: var(--shadow-lg); }
.solo-card .brand { margin-bottom: 22px; }
.solo-card h1 { margin-bottom: 8px; }
.solo-card .btn, .solo-card button { width: 100%; }
.solo-card .checks { display: grid; gap: 2px; }
main.solo { max-width: none; padding: 24px 16px; }
main:not(.solo) > .solo-card { margin: 48px auto; }

/* skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sweep 1.4s linear infinite; border-radius: 8px; height: 14px; }
.skeleton + .skeleton { margin-top: 8px; }
.skeleton.w60 { width: 60%; } .skeleton.w80 { width: 80%; }

/* counters */
.ticked { animation: tick .5s var(--ease); }
@keyframes tick { 40% { transform: translateY(-3px); color: var(--forest-accent); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .s-2 { grid-column: span 2; } .s-3, .s-4, .s-5 { grid-column: span 3; } .s-6, .s-7, .s-8, .s-9, .s-12 { grid-column: span 6; }
  .nav a span.lbl-long { display: none; }
  .search input { width: 170px; }
  .search input:focus { width: 210px; }
  .live-text { display: none; }
  .live { padding: 0 12px; }
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .topbar .nav { display: none; }
  .topbar { gap: 10px; }
  .topbar .search { margin-left: auto; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 6px;
  }
  .tabbar > a, .tabbar summary {
    display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; font-size: 11px; color: var(--muted); text-decoration: none; cursor: pointer; list-style: none;
  }
  .tabbar summary::-webkit-details-marker { display: none; }
  .tabbar > a[aria-current="page"] { color: var(--ink); background: var(--surface-3); font-weight: 600; }
  .tabbar svg.i { width: 21px; height: 21px; }
  .tabbar details.menu { display: grid; }
  .tabbar .menu-panel { top: auto; bottom: calc(100% + 12px); left: auto; right: -2px; min-width: 220px; }
  main { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  /* iOS zooms into inputs under 16px */
  input, select, textarea, .search input, .command-input input { font-size: 16px; }
  .icon-btn, .live { width: 44px; height: 44px; }
  .live { padding: 0; justify-content: center; }
  .menu-panel a { padding: 12px; min-height: 44px; }
  .tabbar > a, .tabbar summary { min-height: 52px; align-content: center; }
}
@media (max-width: 680px) {
  :root { --gap: 12px; }
  html, body { font-size: 15px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  main { padding: 16px 16px 120px; }
  .topbar { padding: 8px 16px; }
  .brand-name { display: none; }
  .search { flex: 1; }
  .search input, .search input:focus { width: 100%; }
  .search kbd { display: none; }
  .tile, .card { padding: 16px; border-radius: 18px; }
  .command-input { flex-wrap: wrap; padding: 8px; }
  .command-input input { flex-basis: calc(100% - 40px); }
  .command-input .btns { width: 100%; }
  .command-input .btns button { flex: 1; }
  .hide-sm { display: none !important; }
  th, td { padding: 9px 10px; }
  .table-wrap.responsive table, .table-wrap.responsive tbody, .table-wrap.responsive tr, .table-wrap.responsive td { display: block; width: 100%; }
  .table-wrap.responsive thead, .table-wrap.responsive tr:first-child:has(th) { display: none; }
  .table-wrap.responsive tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table-wrap.responsive tr:last-child { border-bottom: 0; }
  .table-wrap.responsive td { border: 0; padding: 3px 14px; }
  .table-wrap.responsive td.actions-cell { text-align: left; }
  .drawer-panel { top: max(12px, env(safe-area-inset-top)); left: 0; right: 0; bottom: 0; width: auto; height: auto; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); animation-name: slideup; }
  .drawer-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-strong); }
  .drawer-head { position: relative; padding-top: 20px; }
  .live-tile .feed > li:nth-child(n+6) { display: none; }
  .live-tile .feed { max-height: none; }
  /* phone order: ask, to do, briefing, live first */
  .bento > .o-1 { order: 1; } .bento > .o-2 { order: 2; } .bento > .o-3 { order: 3; } .bento > .o-4 { order: 4; } .bento > * { order: 5; }
  /* tap targets */
  button, .btn { min-height: 44px; }
  .btn.sm, button.sm, .btn.quiet, button.quiet, .suggest button { min-height: 44px; }
  .tick button { position: relative; width: 26px; height: 26px; }
  .tick button::after { content: ""; position: absolute; inset: -10px; }
  .ev:is(button, a) { min-height: 48px; }
  .list > li a.li-title { padding: 4px 0; }
  .tabs a { padding: 11px 14px; }
  .filters select, .filters input { min-height: 44px; font-size: 16px; }
  .toasts { bottom: 96px; }
  .page-head { margin-bottom: 16px; }
}
@keyframes slideup { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

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

@media print {
  .topbar, .tabbar, .drawer, .toasts { display: none !important; }
  body { background: #fff; }
}
