/*
 * Trello Timesheet: design tokens (reference/design-tokens.md) and base components.
 * No inline styles anywhere in templates: the CSP forbids them. Dynamic values use utility
 * classes (.pct-N) or CSS custom properties set from Stimulus controllers.
 */

:root {
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface2: #FFFFFF;
  --border: #E1E5EA;
  --border2: #D3D9E0;
  --border3: #BCC4CE;
  --sunken: #EEF1F4;
  --ink: #14181F;
  --ink2: #3A4350;
  --muted: #4A5463;
  --hover: #E8ECF0;
  --accent-text: #0F766E;
  --accent-soft: #E3F1EF;
  --accent-soft2: #F0F8F7;
  --accent-soft-border: #BFE0DB;
  --accent-soft-border2: #8CC3BC;
  --accent-ink: #0B5A54;
  --accent-ink2: #2F4A47;
  --inv-bg: #14181F;
  --inv-fg: #FFFFFF;
  --axis: #8A94A3;
  --danger: #B42318;
  --ok: #15803D;
  --focus: #0F766E;
  --markbg: #FFE58F;
  --markfg: #14181F;
  --accent-fill: #0F766E;
  --on-accent: #FFFFFF;
  --show-sun: none;
  --show-moon: inline;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0E1318;
  --surface: #161C23;
  --surface2: #2B3441;
  --border: #2A333E;
  --border2: #3A4553;
  --border3: #657283;
  --sunken: #1B222B;
  --ink: #E8ECF1;
  --ink2: #C3CBD5;
  --muted: #9AA5B3;
  --hover: #202833;
  --accent-text: #5EEAD4;
  --accent-soft: #12302D;
  --accent-soft2: #112725;
  --accent-soft-border: #1F5750;
  --accent-soft-border2: #2F7F75;
  --accent-ink: #7FDCCF;
  --accent-ink2: #A9DDD6;
  --inv-bg: #E8ECF1;
  --inv-fg: #0E1318;
  --axis: #6B7685;
  --danger: #F97066;
  --ok: #4ADE80;
  --focus: #5EEAD4;
  --markbg: #6B5410;
  --markfg: #FFEBB0;
  --show-sun: inline;
  --show-moon: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0E1318;
    --surface: #161C23;
    --surface2: #2B3441;
    --border: #2A333E;
    --border2: #3A4553;
    --border3: #657283;
    --sunken: #1B222B;
    --ink: #E8ECF1;
    --ink2: #C3CBD5;
    --muted: #9AA5B3;
    --hover: #202833;
    --accent-text: #5EEAD4;
    --accent-soft: #12302D;
    --accent-soft2: #112725;
    --accent-soft-border: #1F5750;
    --accent-soft-border2: #2F7F75;
    --accent-ink: #7FDCCF;
    --accent-ink2: #A9DDD6;
    --inv-bg: #E8ECF1;
    --inv-fg: #0E1318;
    --axis: #6B7685;
    --danger: #F97066;
    --ok: #4ADE80;
    --focus: #5EEAD4;
    --markbg: #6B5410;
    --markfg: #FFEBB0;
    --show-sun: inline;
    --show-moon: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent-text); }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1, h2, h3, p { margin-top: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border3); border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* Shell */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar {
  flex: 0 0 232px; padding: 24px 16px;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; box-sizing: border-box;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-toggle { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 8px; color: var(--muted); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px 22px; padding-left: 12px; border-left: 1px solid var(--border2); }
.nav-sub a { min-height: 36px; padding: 6px 10px; font-size: 13px; font-weight: 500; }
html[data-sidebar="collapsed"] .sidebar { flex-basis: 72px; padding-left: 12px; padding-right: 12px; }
html[data-sidebar="collapsed"] .sidebar-head { flex-direction: column; gap: 12px; }
html[data-sidebar="collapsed"] .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[data-sidebar="collapsed"] .nav a { justify-content: center; padding-left: 0; padding-right: 0; }
html[data-sidebar="collapsed"] .brand { padding: 0; }
html[data-sidebar="collapsed"] .nav-sub { display: none; }
html[data-sidebar="collapsed"] .sidebar-foot > :not(.sidebar-status) { display: none; }
html[data-sidebar="collapsed"] .sidebar-foot { padding: 8px 0; background: none; align-items: center; }
html[data-sidebar="collapsed"] .sidebar-status .status > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[data-sidebar="collapsed"] .sidebar-toggle svg { transform: rotate(180deg); }
.panel[id] { scroll-margin-top: 16px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.settings-sub { display: flex; flex-direction: column; gap: 16px; }
.settings-sub + .settings-sub { padding-top: 20px; border-top: 1px solid var(--border); }
.settings-sub h3 { margin: 0; font-size: 14px; font-weight: 700; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: #0F766E; display: flex; align-items: center; justify-content: center; color: #fff; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; border-radius: 8px;
  color: var(--ink2); font-weight: 500; font-size: 14px; text-decoration: none;
}
.nav a:hover { background: var(--hover); color: var(--ink2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 12px; border-radius: 8px; background: var(--bg); font-size: 12px; line-height: 1.5; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.sidebar-foot strong { color: var(--ink); }
.sidebar-foot .mono { font-size: 11px; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; text-align: left; font-size: 12px; cursor: pointer; }

.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.search-trigger {
  flex: 1 1 280px; max-width: 560px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border3); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 14px; text-align: left;
}
.search-trigger span { flex: 1; }
kbd { font-family: var(--font-mono); font-size: 12px; padding: 2px 6px; border: 1px solid var(--border3); border-radius: 6px; color: var(--ink2); }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border3); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.icon-btn:hover { background: var(--hover); }
.toolbar .icon-btn:last-child { margin-left: auto; }
.theme-toggle .icon-sun { display: var(--show-sun); }
.theme-toggle .icon-moon { display: var(--show-moon); }

.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.flashes { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 8px; font-size: 14px; border: 1px solid var(--border2); background: var(--surface); }
.flash-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flash-close { flex: 0 0 auto; width: 24px; height: 24px; margin: -2px -6px -2px 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0.7; }
.flash-close:hover { opacity: 1; background: var(--hover); }
.flash-success { border-color: var(--accent-soft-border2); background: var(--accent-soft); color: var(--accent-ink); }
.flash-error, .flash-warning { border-color: var(--danger); color: var(--danger); }

.banner-warning {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--danger); background: var(--surface); color: var(--ink);
}
.banner-warning strong { color: var(--danger); }

@media (max-width: 800px) {
  .sidebar { position: static; height: auto; overflow: visible; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot, .sidebar-toggle, .nav-sub { display: none; }
  html[data-sidebar="collapsed"] .nav-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  html[data-sidebar="collapsed"] .nav a { justify-content: flex-start; padding: 10px 12px; }
  .main { padding: 20px 16px; flex-basis: 100%; }
}

/* Panels, forms */
.panels { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.panel { flex: 1 1 420px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.panel.narrow { flex-basis: 380px; gap: 12px; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--sunken); border-radius: 10px; }
.seg a, .seg button {
  flex: 1 1 120px; min-height: 44px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink2); font-size: 14px; font-weight: 500; text-decoration: none;
}
.seg a:hover, .seg button:hover { background: var(--hover); color: var(--ink2); }
.seg [aria-current="page"], .seg [aria-pressed="true"] {
  border-color: var(--border2); background: var(--surface2); color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 24, 31, 0.12);
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row .field { flex: 1 1 140px; }
.input, .field select, .field input[type="text"], .field input[type="date"], .field input[type="time"], .field input[type="number"], .field input[type="email"], .field input[type="password"] {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border3); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px;
}
.field-errors, .form-error { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--danger); }
.field-errors li, .form-error { margin-top: 2px; }
.callout { padding: 12px 16px; border-radius: 8px; background: var(--bg); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--border3); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--hover); color: var(--ink); }
.btn-primary { min-height: 48px; padding: 0 24px; border-color: #0F766E; background: #0F766E; color: #FFFFFF; font-size: 15px; }
.btn-primary:hover { background: #0B5A54; border-color: #0B5A54; color: #FFFFFF; }
.btn-inverse { min-height: 48px; padding: 0 22px; border: 0; background: var(--inv-bg); color: var(--inv-fg); font-size: 15px; }
.btn-inverse:hover { background: var(--inv-bg); color: var(--inv-fg); opacity: 0.9; }
.btn-soft { min-height: 48px; border-color: var(--accent-soft-border2); color: var(--accent-ink); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-danger { color: var(--danger); }
.btn-start { min-height: 44px; border-color: var(--accent-soft-border); background: var(--accent-soft2); color: var(--accent-ink); }
.btn-icon { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink2); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--hover); }
.btn-icon.danger { color: var(--danger); }
form.inline { display: inline; margin: 0; }

/* Timer */
.timer-box {
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-soft-border);
}
.timer-clock { font-family: var(--font-mono); font-size: 56px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer-box .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.timer-box small { font-size: 13px; color: var(--accent-ink2); text-align: center; }
.timer-idle { text-align: center; }
@media (max-width: 480px) { .timer-clock { font-size: 44px; } }

/* Tables */
.table-wrap { overflow-x: auto; }
table.entries { width: 100%; border-collapse: collapse; font-size: 13px; }
table.entries th { text-align: left; padding: 8px; font-weight: 600; color: var(--muted); }
table.entries th:first-child, table.entries td:first-child { padding-left: 0; }
table.entries td { padding: 12px 8px; border-top: 1px solid var(--sunken); vertical-align: middle; }
table.entries td.num, table.entries th.num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.entries td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.entries td.actions { padding: 4px 0 4px 8px; white-space: nowrap; text-align: right; }
table.entries tfoot th, table.entries tfoot td { border-top: 2px solid var(--ink); padding-top: 12px; color: var(--ink); font-weight: 700; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--sunken); color: var(--ink2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.empty { padding: 16px 0; color: var(--muted); font-size: 14px; }

/* Login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px 28px; display: flex; flex-direction: column; gap: 20px; }
.auth-card h1 { margin: 0; font-size: 22px; }

.optional { font-weight: 400; color: var(--muted); }

/* Feed */
.head-split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.head-split .page-head, header.head-split > div:first-child p { margin-bottom: 0; }
.status {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: 0 0 auto; }
.status[data-state="ok"] i { background: var(--ok); }
.status[data-state="bad"] i { background: var(--danger); }
.sidebar-status .status { padding: 0; border: 0; background: none; font-size: 12px; gap: 6px; align-items: flex-start; line-height: 1.4; }
.sidebar-status .status i { margin-top: 4px; }
.feed-col { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side-col { flex: 1 1 300px; min-width: 0; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border2);
  background: var(--surface); color: var(--ink2); font-size: 13px; font-weight: 500;
}
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { border-color: #0F766E; background: #0F766E; color: #FFFFFF; font-weight: 600; }

#feed { list-style: none; margin: 0; padding: 0; }
.feed-item { position: relative; display: flow-root; margin: 0; padding: 0; }
.feed-item .card {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 14px 18px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.avatar {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700;
}
.av-0 { background: #DCEBFA; color: #124A7C; }
.av-1 { background: #F6E3D0; color: #7A3E0C; }
.av-2 { background: #E3F1EF; color: #0B5A54; }
.av-3 { background: #E9E1F5; color: #4B2B80; }
:root[data-theme="dark"] .av-0 { background: #1B3A57; color: #BBD9F5; }
:root[data-theme="dark"] .av-1 { background: #4A3320; color: #F5D3B3; }
:root[data-theme="dark"] .av-2 { background: #12302D; color: #9BE3D8; }
:root[data-theme="dark"] .av-3 { background: #3A2D52; color: #D6C5F2; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .av-0 { background: #1B3A57; color: #BBD9F5; }
  :root[data-theme="auto"] .av-1 { background: #4A3320; color: #F5D3B3; }
  :root[data-theme="auto"] .av-2 { background: #12302D; color: #9BE3D8; }
  :root[data-theme="auto"] .av-3 { background: #3A2D52; color: #D6C5F2; }
}
.feed-item .text { flex: 1 1 260px; min-width: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.feed-item .text .action { color: var(--ink2); }
.feed-item time { flex: 0 0 auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

#feed[data-filter="comment"] .feed-item:not([data-type="comment"]),
#feed[data-filter="move"] .feed-item:not([data-type="move"]),
#feed[data-filter="edit"] .feed-item:not([data-type="edit"]) { display: none; }

.feed-empty, .feed-empty-filter {
  display: none; padding: 32px; text-align: center; color: var(--muted); background: var(--surface);
  border: 1px dashed var(--border2); border-radius: 12px; font-size: 14px; margin: 0;
}
#feed:not(:has(.feed-item)) ~ .feed-empty { display: block; }
#feed:has(.feed-item):not(:has(.feed-item:not([hidden]))) ~ .feed-empty-filter { display: none; }
#feed[data-filter="comment"]:not(:has(.feed-item[data-type="comment"])):has(.feed-item) ~ .feed-empty-filter,
#feed[data-filter="move"]:not(:has(.feed-item[data-type="move"])):has(.feed-item) ~ .feed-empty-filter,
#feed[data-filter="edit"]:not(:has(.feed-item[data-type="edit"])):has(.feed-item) ~ .feed-empty-filter { display: block; }
.small { font-size: 12px; }
.err { color: var(--danger); }
.btn-compact { min-height: 44px; padding: 10px 16px; font-size: 14px; }

.timer-card {
  padding: 20px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-soft-border);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.timer-card .eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
.timer-card .dot { width: 8px; height: 8px; border-radius: 50%; background: #0F766E; }
.timer-card .strong { font-size: 15px; font-weight: 600; line-height: 1.4; }
.timer-card .muted-ink { font-size: 13px; color: var(--accent-ink2); }
.timer-clock.small { font-size: 40px; }
.summary { padding: 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.summary h2 { margin: 0; font-size: 14px; font-weight: 600; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; }
.sum-row span { font-size: 13px; color: var(--muted); }
.sum-row strong { font-size: 20px; font-weight: 700; }

/* Reports */
.head-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.seg-inline { flex-wrap: nowrap; }
.seg-inline a { flex: 0 0 auto; padding: 8px 16px; }
.pager { display: inline-flex; gap: 6px; }
.pager .btn { min-width: 44px; min-height: 44px; }
.range-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tile { flex: 1 1 200px; padding: 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-value { margin-top: 6px; font-size: 28px; font-weight: 700; }
.bars { display: flex; align-items: stretch; gap: 12px; height: 240px; padding-top: 8px; border-bottom: 1px solid var(--axis); }
.bars.dense { gap: 3px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-val.zero { color: var(--muted); font-weight: 400; }
.bars.dense .bar-val { display: none; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.bar { width: 100%; max-width: 56px; height: var(--pct); background: #0F766E; border-radius: 6px 6px 0 0; }
.bar-labels { display: flex; gap: 12px; font-size: 13px; color: var(--ink2); }
.bar-labels.dense { gap: 3px; font-size: 11px; }
.bar-labels span { flex: 1; text-align: center; min-width: 0; }
.bar-labels .today { font-weight: 700; color: var(--ink); }
.share { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.share-track { flex: 1; height: 8px; border-radius: 4px; background: var(--sunken); }
.share-fill { width: var(--pct); height: 8px; border-radius: 4px; background: #0F766E; }
.share span { width: 56px; text-align: right; }

/* Settings */
.settings { display: flex; flex-direction: column; gap: 24px; max-width: 760px; }
.settings .panel { flex: 0 0 auto; }
.panel form:not(.inline):not(.range-form):not(.actions) { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.panel form:not(.inline):not(.range-form):not(.actions) > :is(.field, .field-row, fieldset, .range-field) { align-self: stretch; }
.howto { font-size: 13px; color: var(--ink2); }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.howto code { font-size: 12px; word-break: break-all; }
.facts { margin: 0; display: grid; gap: 8px; }
.facts > div { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.facts dt { flex: 0 0 180px; color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.check label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: #0F766E; }

/* Command palette (Ctrl+K) */
dialog.palette { padding: 0; border: 0; background: transparent; width: 100%; max-width: 680px; max-height: none; margin: 96px auto auto; color: var(--ink); overflow: visible; }
dialog.palette::backdrop { background: rgba(8, 12, 16, 0.55); }
.pal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); overflow: hidden; display: flex; flex-direction: column; margin: 0 16px; }
.pal-head { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal-head input { flex: 1; min-width: 0; min-height: 60px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 17px; }
.pal-head input:focus-visible { outline: none; }
.pal-esc { min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid var(--border3); border-radius: 8px; background: transparent; color: var(--ink2); font-family: var(--font-mono); font-size: 12px; }
.pal-list { max-height: 420px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pal-group { display: flex; flex-direction: column; gap: 2px; }
.pal-heading { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pal-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; cursor: pointer; }
.pal-row:hover { color: var(--ink); }
.pal-row.active { background: var(--accent-soft); }
.pal-icon { flex: 0 0 32px; height: 32px; border-radius: 8px; background: var(--sunken); color: var(--ink2); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.pal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pal-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pal-row mark, .pal-title mark, .pal-sub mark { background: var(--markbg); color: var(--markfg); padding: 0; border-radius: 2px; }
.pal-empty { padding: 32px 16px; text-align: center; font-size: 14px; color: var(--muted); }
.pal-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* Stick figure (assets/lib/pusher.js). Transform origins here, not inline, because of the CSP. */
.pusher { position: absolute; z-index: 5; overflow: visible; pointer-events: none; color: var(--ink); }
.pusher .thigh { transform-origin: 46px 38px; }
.pusher .shin { transform-origin: 46px 50px; }
.pusher .upper { transform-origin: 41px 29px; }
.pusher .arm { transform-origin: 37px 24px; }
.pusher .fore-a { transform-origin: 23.7px 25.6px; }
.pusher .fore-b { transform-origin: 24.5px 29px; }

/* Settings preview of the animation */
.preview { padding: 16px; border: 1px dashed var(--border2); border-radius: 12px; overflow-x: clip; min-height: 96px; }
.preview ul { list-style: none; margin: 0; padding: 0; }
.range-field output { font-family: var(--font-mono); font-size: 13px; color: var(--accent-ink); }
.range-field input[type="range"] { width: 100%; min-height: 28px; accent-color: #0F766E; }
.range-field .range-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
fieldset.unsupported { opacity: 0.6; }
.note-warn { padding: 12px 16px; border-radius: 8px; border: 1px solid var(--danger); color: var(--danger); font-size: 14px; }
.fieldset-plain { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.preview .feed-item { max-width: 360px; }
.main { overflow-x: clip; }

/* Cards list and card detail */
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.view-switch { flex-wrap: nowrap; }
.card-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--ink); text-decoration: none; }
.card-row:hover { background: var(--hover); }
.card-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.card-row-time { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.card-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.comment { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.comment:first-of-type { border-top: 0; padding-top: 0; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.check-list .done { color: var(--muted); text-decoration: line-through; }

/* Comment attachments and viewer */
.att-list { display: inline-flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.att { padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 6px; }
.att:hover .att-ico { filter: brightness(1.08); transform: translateY(-1px); }
.att-ico { display: flex; align-items: flex-end; justify-content: center; width: 34px; height: 42px; padding-bottom: 5px; box-sizing: border-box; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; color: #fff; background: #64748B; clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%); transition: transform 0.1s; }
.att-pdf .att-ico { background: #C2410C; }
.att-image .att-ico { background: #0F766E; }
.att-doc .att-ico { background: #1D4ED8; }
.att-sheet .att-ico { background: #15803D; }
.att-slide .att-ico { background: #B45309; }
.att-archive .att-ico { background: #7C3AED; }
dialog.att-dialog { padding: 0; border: 0; background: transparent; width: min(96vw, 1000px); max-width: none; max-height: none; margin: auto; color: var(--ink); overflow: visible; }
dialog.att-dialog::backdrop { background: rgba(8, 12, 16, 0.65); }
.att-box { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; max-height: 92vh; }
.att-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.att-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.att-body { display: flex; align-items: center; justify-content: center; min-height: 160px; padding: 12px; overflow: auto; background: var(--sunken); }
.att-body img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.att-body iframe { width: 100%; height: 80vh; border: 0; background: #fff; }

/* Card status path */
.card-row-side { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; flex: 0 1 auto; min-width: 0; }
.status-path { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px; font-size: 12px; }
.status-step { padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--ink2); white-space: nowrap; }
.status-step.current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.status-step.more { background: none; padding: 2px 0; color: var(--muted); }
.status-step + .status-step::before { content: "→"; margin-right: 4px; color: var(--muted); font-weight: 400; }
.status-step + .status-step { padding-left: 4px; }
.status-history { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

.ai-row { margin-top: 12px; align-items: center; }

/* API tokens */
.token-reveal { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--accent-soft-border2); background: var(--accent-soft); color: var(--accent-ink); border-radius: 10px; font-size: 14px; }
.token-row { display: flex; flex-wrap: wrap; gap: 8px; }
.token-row input { flex: 1 1 320px; min-width: 0; min-height: 40px; padding: 0 12px; font-family: var(--font-mono); font-size: 13px; border: 1px solid var(--border3); border-radius: 8px; background: var(--surface); color: var(--ink); }

/* Plan from the AI session */
.markdown { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1, .markdown h2, .markdown h3 { margin: 1.2em 0 0.4em; font-size: 15px; }
.markdown pre { padding: 10px 12px; overflow-x: auto; background: var(--sunken); border-radius: 8px; font-size: 12.5px; }
.markdown code { font-family: var(--font-mono); font-size: 12.5px; }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 4px 8px; }
.plan-questions { border-color: var(--danger); }

#card-plan.plan-updated .plan-panel { animation: plan-flash 2.5s ease-out; }
@keyframes plan-flash { from { box-shadow: 0 0 0 3px var(--accent-soft-border2); } to { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { #card-plan.plan-updated .plan-panel { animation: none; } }

.feed-item .card-link { color: inherit; text-decoration: none; }
.feed-item .card-link:hover strong, .feed-item .card-link:focus-visible strong { text-decoration: underline; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-soft-border); color: var(--accent-ink); font-size: 13px; font-weight: 600; line-height: 1.6; }
.status-menu { display: inline-block; position: relative; vertical-align: middle; }
.status-menu > summary { list-style: none; cursor: pointer; }
.status-menu > summary::-webkit-details-marker { display: none; }
.status-menu > summary:hover, .status-menu[open] > summary { border-color: var(--accent-soft-border2); }
.status-menu > summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.status-caret { font-size: 11px; }
.status-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 180px; display: grid; padding: 4px; background: var(--surface); border: 1px solid var(--border2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.status-option { text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.status-option:hover:not(:disabled), .status-option:focus-visible { background: var(--accent-soft); }
.status-option.is-current { font-weight: 600; color: var(--accent-ink); cursor: default; }
