/* ==========================================================================
   Timer: tokens
   One accent (raspberry, "recording"), cool neutral surfaces, IBM Plex Sans.
   ========================================================================== */

@font-face { font-family: "IBM Plex Sans"; font-weight: 300; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f0f0f4;
  --hover: #f6f6f9;
  --line: #e2e2e9;
  --line-strong: #cdcdd8;
  --ink: #17171c;
  --muted: #646472;
  --faint: #9a9aa8;
  --accent: #2457d6;
  --accent-hover: #1b45ae;
  --accent-ink: #ffffff;
  --accent-soft: #e4ecfc;
  --danger: #b42318;
  --seg-default: #9a9aa8;
  --ribbon-track: #e8e8ef;
  --ribbon-tick: #d2d2dc;
  --shadow-pop: 0 1px 2px rgb(23 23 28 / 0.06), 0 10px 30px rgb(23 23 28 / 0.12);
  --shadow-sm: 0 1px 2px rgb(23 23 28 / 0.08);

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0e12;
    --surface: #17171d;
    --surface-2: #1d1d25;
    --hover: #1b1b22;
    --line: #2a2a34;
    --line-strong: #3b3b49;
    --ink: #ececf2;
    --muted: #a0a0b0;
    --faint: #6e6e7e;
    --accent: #7aa7ff;
    --accent-hover: #9dbbff;
    --accent-ink: #07173a;
    --accent-soft: #17284d;
    --danger: #ff7b6e;
    --seg-default: #6e6e7e;
    --ribbon-track: #23232d;
    --ribbon-tick: #343442;
    --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.5);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e12;
  --surface: #17171d;
  --surface-2: #1d1d25;
  --hover: #1b1b22;
  --line: #2a2a34;
  --line-strong: #3b3b49;
  --ink: #ececf2;
  --muted: #a0a0b0;
  --faint: #6e6e7e;
  --accent: #7aa7ff;
  --accent-hover: #9dbbff;
  --accent-ink: #07173a;
  --accent-soft: #17284d;
  --danger: #ff7b6e;
  --seg-default: #6e6e7e;
  --ribbon-track: #23232d;
  --ribbon-tick: #343442;
  --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.5);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 600; }

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

.icon { flex: none; display: block; }

.shell { max-width: 980px; margin: 0 auto; padding: 24px 20px 96px; }
.page { display: grid; gap: 20px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.title-stack { display: grid; gap: 2px; min-width: 0; }

.list-note { color: var(--muted); padding: 32px 0; text-align: center; }

.empty { text-align: center; padding: 56px 16px; display: grid; gap: 8px; justify-items: center; }
.empty h2 { font-size: 17px; }
.empty p { color: var(--muted); max-width: 44ch; }
.empty .btn { margin-top: 8px; }

/* ==========================================================================
   Controls
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-wide { width: 100%; }
.btn.is-disabled { pointer-events: none; opacity: 0.5; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 0; border-radius: 8px; color: var(--muted);
  transition: background-color 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.play:hover { color: var(--accent); }

.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input[readonly] { background: var(--surface-2); }
.input[aria-invalid="true"] { border-color: var(--danger); }
select.input { padding-right: 8px; }
.title-input { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; height: 44px; padding: 0 8px; margin-left: -9px; background: transparent; border-color: transparent; }
.title-input:hover:not([readonly]) { border-color: var(--line-strong); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; }
.field small { font-size: 12px; }

.form-error { color: var(--danger); font-size: 13px; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; }

.check {
  width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center;
  border: 1.5px solid var(--line-strong); border-radius: 5px; color: var(--accent-ink);
}
.check.is-on { background: var(--accent); border-color: var(--accent); }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.color-input { width: 32px; height: 32px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600;
}

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.segmented button:hover { color: var(--ink); }
.segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Chips: the project / tag buttons shared by the timer bar and every row. */
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 200px; height: 30px; padding: 0 10px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); font-size: 13px; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip.has-value { color: var(--ink); }
.chip-text { overflow: hidden; text-overflow: ellipsis; }
.filter-chip { border-color: var(--line-strong); background: var(--surface); max-width: none; }
.filter-chip.has-value { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 980px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }
.logo-mark circle:first-child { stroke: var(--accent); }
.logo-mark circle:last-child { fill: var(--accent); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; text-decoration: none; }
.tabs a:hover { color: var(--ink); background: var(--surface-2); }
.tabs a.is-active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.top-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  background: transparent; border: 0; border-radius: 8px; color: var(--muted);
}
.top-btn:hover { background: var(--surface-2); color: var(--ink); }
.top-btn.icon-only { width: 36px; justify-content: center; padding: 0; }
.top-btn.avatar-btn { padding: 0 4px; }
.ws-btn { color: var(--ink); font-weight: 500; }
.ws-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banner { background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.banner-inner { max-width: 980px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 12px; }
.banner-inner p { flex: 1; font-size: 14px; }

/* ==========================================================================
   Timer bar: the one loud thing on the page
   ========================================================================== */

.timerbar {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px 14px; box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.timerbar:focus-within { border-color: var(--line-strong); }
.timerbar[data-state="running"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.tb-desc {
  width: 100%; border: 0; outline: 0; background: transparent; padding: 4px 0 12px;
  font-size: 22px; font-weight: 400; letter-spacing: -0.01em;
}
.tb-desc::placeholder { color: var(--muted); opacity: 0.75; }

.tb-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.tb-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: -10px; }
.tb-clock { display: flex; align-items: center; gap: 14px; margin-left: auto; }

.tb-live { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: none; }
.timerbar[data-state="running"] .tb-live { display: block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 60% { box-shadow: 0 0 0 7px transparent; } }

.tb-elapsed {
  background: none; border: 0; padding: 2px 4px; border-radius: 6px;
  font-size: 40px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums;
  color: var(--faint);
}
.timerbar[data-state="running"] .tb-elapsed { color: var(--ink); }
.timerbar[data-state="running"] .tb-elapsed:hover { background: var(--surface-2); }
.tb-elapsed:disabled { cursor: default; }

.tb-go {
  width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  transition: background-color 0.12s, transform 0.12s;
}
.tb-go:hover { background: var(--accent-hover); }
.tb-go:active { transform: scale(0.95); }
.tb-go:disabled { opacity: 0.6; }
.timerbar[data-state="running"] .tb-go { background: var(--ink); color: var(--bg); }
.timerbar[data-state="running"] .tb-go:hover { background: var(--muted); }

/* ==========================================================================
   Entry list: days, ribbons, rows, groups
   ========================================================================== */

.entry-list { margin-top: 8px; }

.day { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 16px; padding: 12px 16px 14px; background: var(--surface-2); }
.day-title { font-size: 15px; display: flex; align-items: baseline; gap: 10px; }
.day-sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.day-total { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }

.ribbon {
  position: relative; grid-column: 1 / -1; height: 8px; border-radius: 4px; overflow: hidden; background-color: var(--ribbon-track);
  background-image:
    linear-gradient(var(--ribbon-tick), var(--ribbon-tick)),
    linear-gradient(var(--ribbon-tick), var(--ribbon-tick)),
    linear-gradient(var(--ribbon-tick), var(--ribbon-tick));
  background-repeat: no-repeat;
  background-size: 1px 100%;
  background-position: 25% 0, 50% 0, 75% 0;
}
.seg { position: absolute; top: 0; bottom: 0; min-width: 3px; background: var(--c); border-radius: 2px; }
.seg.from-prev { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.seg.to-next { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.row {
  display: grid; align-items: center; column-gap: 8px;
  grid-template-columns: 34px minmax(150px, 1fr) 284px 164px 88px 68px;
  min-height: 52px; padding: 4px 12px 4px 10px; border-top: 1px solid var(--line);
}
.day-body > .row:first-child, .day-body > .group:first-child > .row:first-child { border-top: 0; }
.row:hover { background: var(--hover); }
.row-child { background: var(--surface-2); }
.row-child:hover { background: var(--surface-2); }
.group-children { border-top: 1px solid var(--line); }
.group-children .row:first-child { border-top: 0; }
.row-child .row-lead { box-shadow: inset 2px 0 0 var(--line-strong); margin-left: 12px; height: 100%; }

.row-desc, .row-dur {
  min-width: 0; width: 100%; height: 36px; padding: 0 8px;
  background: transparent; border: 1px solid transparent; border-radius: 8px; outline: 0;
}
.row-desc:hover, .row-dur:hover:not([readonly]) { border-color: var(--line); }
.row-desc:focus, .row-dur:focus:not([readonly]) { border-color: var(--accent); background: var(--surface); }
.row-desc::placeholder { color: var(--muted); opacity: 0.7; }
.row-dur { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.row-dur[readonly] { cursor: default; font-weight: 500; }

.row-meta { display: flex; align-items: center; gap: 2px; min-width: 0; }
/* Fixed meta column so chips line up across rows; empty chips collapse to their icon. */
.row .chip-project { max-width: 150px; }
.row .chip-tags { max-width: 130px; }
.row .chip:not(.has-value) .chip-text { display: none; }
.row .chip:not(.has-value) { padding: 0 8px; }

.row-time {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; justify-self: end;
  height: 32px; padding: 0 8px; background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.row-time:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.plus-days { font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.row-time-static { justify-self: end; padding: 0 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }

.row-actions { display: flex; justify-content: flex-end; gap: 0; }
.row-actions .danger { opacity: 0; }
.row:hover .row-actions .danger, .row:focus-within .row-actions .danger { opacity: 1; }

.group-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  height: 28px; min-width: 34px; padding: 0 4px 0 6px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.group-toggle:hover { color: var(--ink); background: var(--surface-2); }
.group-toggle .icon { transition: transform 0.15s; }
.group-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }

.load-more { margin-top: 24px; display: flex; justify-content: center; }

/* ==========================================================================
   Popovers, menus, pickers, toasts, dialog
   ========================================================================== */

#popover-root { position: relative; z-index: 60; }
.popover {
  position: fixed; min-width: 220px; max-width: calc(100vw - 16px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.popover-picker { width: 280px; }
.popover-range { width: 360px; padding: 16px; }
.popover-account { width: 300px; padding: 16px; }
.popover-menu { min-width: 200px; }

.menu { display: grid; padding: 6px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left;
  background: none; border: 0; border-radius: 8px;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.is-danger { color: var(--danger); }
.menu-label { flex: 1; }
.menu-check { color: var(--accent); }
.menu-divider { height: 1px; background: var(--line); }

.picker { display: grid; }
.pick-search { border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 14px; outline: 0; border-radius: var(--radius) var(--radius) 0 0; }
.pick-list { display: grid; padding: 6px; max-height: 260px; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left; background: none; border: 0; border-radius: 8px; }
.pick-item:hover, .pick-item.is-active { background: var(--surface-2); }
.pick-item .icon { color: var(--accent); }
.pick-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-name.is-muted { color: var(--muted); }
.pick-create { color: var(--accent); }
.pick-empty { padding: 12px 10px; color: var(--muted); font-size: 13px; }
.pick-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }

.range-form { display: grid; gap: 12px; }
.range-grid { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; align-items: center; }
.range-label { font-size: 13px; color: var(--muted); }
.range-grid input { height: 36px; min-width: 0; padding: 0 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; font-variant-numeric: tabular-nums; }
.range-summary { font-size: 13px; font-weight: 500; min-height: 20px; }
.range-zone { font-size: 12px; color: var(--muted); margin-top: -6px; }
.range-actions { display: flex; justify-content: flex-end; gap: 8px; }

.account-panel, .ws-create { display: grid; gap: 12px; }
.account-name { font-weight: 600; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-panel { display: grid; }
.ws-create { padding: 12px; grid-template-columns: 1fr auto; }
.ws-create p { grid-column: 1 / -1; }
.ws-create .input { height: 32px; }

#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(520px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 14px;
}
.toast-error { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .toast-error { color: #1a0610; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast-error { color: #1a0610; } }
.toast-text { flex: 1; }
.toast-action { background: none; border: 0; padding: 4px 8px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.toast-close { background: none; border: 0; opacity: 0.7; font-size: 20px; line-height: 1; padding: 0 4px; }
.toast-close:hover { opacity: 1; }

dialog.dialog {
  width: min(400px, calc(100vw - 32px)); padding: 24px; margin: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop);
}
dialog.dialog::backdrop { background: rgb(10 10 14 / 0.55); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 20px; }
.auth-form { display: grid; gap: 14px; }

/* ==========================================================================
   Reports
   ========================================================================== */

.report-controls { display: grid; gap: 12px; }
.toolbar { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-group.filters { margin-left: auto; }
.toolbar-label { font-size: 13px; color: var(--muted); }
.custom-range { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.custom-range label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.custom-range input { height: 36px; padding: 0 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; font-variant-numeric: tabular-nums; }
.report-exports { display: flex; gap: 8px; flex-wrap: wrap; }

.report-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 8px; transition: opacity 0.15s; }
.report-result.is-stale { opacity: 0.6; }
.summary { margin-bottom: 16px; }
.summary-total { display: grid; gap: 2px; }
.summary-num { font-size: 44px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary-label { color: var(--muted); font-size: 14px; }

.bars { list-style: none; margin: 0; padding: 0; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 240px) 1fr 92px 44px; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.bar-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 5px; background: var(--ribbon-track); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--c); }
.bar-time { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.bar-pct { text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.footnote { margin-top: 16px; color: var(--muted); font-size: 13px; max-width: 70ch; }

/* ==========================================================================
   Workspace + join
   ========================================================================== */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.panel > h2 { font-size: 16px; }
.panel-foot { display: flex; gap: 8px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .input { height: 34px; }
.list-main { display: grid; flex: 1; min-width: 0; }
.list-row.is-archived .input { opacity: 0.55; }
.invite-row .input { flex: 1; }
.add-row { display: flex; gap: 8px; }
.add-row .input { max-width: 320px; }

.join-card { max-width: 440px; margin: 48px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 14px; }
.row-actions-inline { display: flex; gap: 8px; }

/* ==========================================================================
   Narrow screens
   ========================================================================== */

@media (max-width: 860px) {
  .row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas:
      "lead desc act"
      ".    meta meta"
      ".    time dur";
    row-gap: 2px; padding-block: 8px;
  }
  .row > .row-lead { grid-area: lead; }
  .row > .row-desc { grid-area: desc; }
  .row > .row-meta { grid-area: meta; flex-wrap: wrap; }
  .row > .row-time, .row > .row-time-static { grid-area: time; justify-self: start; }
  .row > .row-dur { grid-area: dur; width: 96px; justify-self: end; }
  .row > .row-actions { grid-area: act; }
  .row-actions .danger { opacity: 1; }
  .toolbar-group.filters { margin-left: 0; }
  .bar-row { grid-template-columns: 1fr auto 44px; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 560px) {
  .shell { padding: 16px 12px 96px; }
  .topbar-inner { padding: 0 12px; gap: 8px; }
  .brand span { display: none; }
  .tabs a { padding: 6px 8px; }
  .ws-name { max-width: 90px; }
  .tb-desc { font-size: 19px; }
  .tb-elapsed { font-size: 32px; }
  .tb-go { width: 48px; height: 48px; }
  .report-result { padding: 16px; }
  .summary-num { font-size: 36px; }
  .popover-range { width: calc(100vw - 16px); }
  .invite-row { flex-wrap: wrap; }
  .invite-row .input { flex-basis: 100%; }
}

@media (hover: none) {
  .row-actions .danger { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
