[hidden] { display: none !important; }   /* component display rules must never reveal a hidden element */

/* Ciferník — one stylesheet. Tokens first (OKLCH); dark mode follows the system or the choice in Nastavení.
   Neutrals carry a faint tint of the dial blue; colour is reserved for state, focus and the primary action. */
:root {
  --bg: oklch(0.978 0.004 255);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.963 0.005 255);
  --surface-3: oklch(0.938 0.0075 255);
  --line: oklch(0.915 0.0075 255);
  --line-strong: oklch(0.855 0.01 255);
  --text: oklch(0.24 0.015 255);
  --muted: oklch(0.51 0.015 255);
  --faint: oklch(0.64 0.0125 255);
  --placeholder: oklch(0.58 0.0125 255);
  --accent: oklch(0.48 0.15 258);           /* dial blue (PO choice 2026-11-07) */
  --accent-strong: oklch(0.42 0.15 258);
  --accent-soft: oklch(0.955 0.03 258);
  --accent-line: oklch(0.83 0.08 258);
  --accent-text: oklch(0.99 0 0);
  --ok: oklch(0.5 0.12 150);    --ok-soft: oklch(0.96 0.03 150);
  --warn: oklch(0.53 0.12 62);  --warn-soft: oklch(0.966 0.04 82);
  --bad: oklch(0.53 0.17 27);   --bad-soft: oklch(0.965 0.022 25);
  --info-soft: oklch(0.962 0.018 250);
  --inverse: oklch(0.25 0.015 255); --inverse-text: oklch(0.97 0.004 255);
  --track: oklch(0.925 0.0075 255);
  --shortfall: oklch(0.86 0.07 25);          /* plan not yet worked, on the pace meter */
  /* project dots: same lightness and chroma, eight hues */
  --p0: oklch(0.64 0.11 188); --p1: oklch(0.62 0.13 255); --p2: oklch(0.62 0.13 300); --p3: oklch(0.65 0.14 350);
  --p4: oklch(0.66 0.14 35);  --p5: oklch(0.72 0.13 80);  --p6: oklch(0.64 0.13 145); --p7: oklch(0.65 0.1 225);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px oklch(0.3 0.02 255 / 0.06);
  --shadow: 0 1px 2px oklch(0.3 0.02 255 / 0.05), 0 10px 28px -8px oklch(0.3 0.02 255 / 0.18);
  --ring: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quint */
  --fast: 120ms;
  --mid: 200ms;
  --gutter: 16px;
  --z-raised: 2; --z-sticky: 20; --z-dropdown: 30; --z-toast: 50;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
/* dark tokens live in theme-dark.css, linked per Nastavení → Vzhled */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -0.012em; font-weight: 640; text-wrap: balance; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; text-wrap: pretty; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 500 11.5px/1 var(--mono); background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px;
      border-radius: 5px; padding: 3px 5px 2px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in oklch, var(--accent) 25%, transparent); }

/* icons from /static/icons.svg (macro in partials/icon.html) */
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round;
     stroke-linejoin: round; vertical-align: -3px; }
.i.solid { fill: currentColor; stroke-width: 1; }
.i.sm { width: 14px; height: 14px; vertical-align: -2px; }

/* --- app shell: top bar with a tab row under 1024 px, left sidebar from 1024 px ------------ */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: var(--z-sticky); }
.topbar-inner { padding: 8px 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 52px; }
.brand { font-weight: 680; letter-spacing: -0.01em; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px;
         min-height: 40px; }
.brand:hover { color: var(--text); }
.brand .i { width: 22px; height: 22px; color: var(--accent); stroke-width: 1.8; vertical-align: 0; }
.nav { order: 3; flex-basis: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 2px -8px 0; }
.nav a { color: var(--muted); text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 6px;
         padding: 8px 4px 10px; font-size: .85rem; font-weight: 500; white-space: nowrap; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
         transition: color var(--fast) ease-out, background-color var(--fast) ease-out, box-shadow var(--fast) ease-out; }
.nav a .i { color: var(--faint); transition: color var(--fast) ease-out; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a:hover .i { color: var(--muted); }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.nav a[aria-current="page"] .i { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.topbar-right .who { display: none; }
.timer-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--accent-line); border-radius: 999px; padding: 3px 3px 3px 12px;
              font-size: .875rem; max-width: 320px; min-width: 0; margin-left: auto; background: var(--accent-soft); color: var(--text); }
.timer-pill + .topbar-right { margin-left: 0; }
.timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none;
                   box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 45%, transparent); animation: pulse 2s var(--ease) infinite; }
.timer-pill .task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; min-width: 0; }
.timer-pill .num { font-weight: 600; color: var(--accent); }
.timer-pill form { display: contents; }
.timer-pill button { border-radius: 999px; min-height: 28px; padding: 2px 10px 2px 8px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 45%, transparent); }
                   70%, 100% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent) 0%, transparent); } }
@media (max-width: 720px) {
  .nav a { flex-direction: column; gap: 3px; padding: 6px 2px 8px; font-size: .7rem; }
  .nav a .i { width: 20px; height: 20px; }
  .topbar-inner:has(.timer-pill) .brand span { display: none; }
}
@media (min-width: 1024px) {
  :root { --sidebar: 232px; --gutter: 32px; }
  body { padding-left: var(--sidebar); }
  .topbar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); border-bottom: 0; border-right: 1px solid var(--line); }
  .topbar-inner { flex-direction: column; flex-wrap: nowrap; align-items: stretch; height: 100%; padding: 14px 12px 12px; gap: 14px; overflow-y: auto; }
  .brand { padding: 0 10px; font-size: 1.05rem; }
  .nav { order: 0; flex-basis: auto; display: flex; flex-direction: column; gap: 2px; margin: 0; }
  .nav a { justify-content: flex-start; gap: 10px; padding: 7px 10px; font-size: .92rem; border-radius: var(--radius-sm); }
  .nav a .i { width: 18px; height: 18px; }
  .nav a[aria-current="page"] { background: var(--accent-soft); box-shadow: none; }
  .timer-pill { margin: 0; max-width: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
                gap: 6px 10px; border-radius: var(--radius); padding: 10px 10px 10px 12px; }
  .timer-pill .dot { grid-row: 1; }
  .timer-pill .task { grid-column: 2 / -1; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                      line-height: 1.35; }
  .timer-pill .num { grid-column: 1 / 3; font-size: 1.2rem; letter-spacing: -0.01em; }
  .timer-pill + .topbar-right, .topbar-right { margin: auto 0 0; }
  .topbar-right { border-top: 1px solid var(--line); padding: 10px 2px 0 10px; justify-content: space-between; }
  .topbar-right .who { display: block; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toasts { left: calc(50% + var(--sidebar) / 2); width: min(560px, calc(100% - var(--sidebar) - 32px)); }
}

main { max-width: calc(1148px + 2 * var(--gutter)); margin: 0 auto; padding: 24px var(--gutter) 72px; }

/* --- banners, flash, toast ------------------------------------------------------------- */
.banners { max-width: calc(1148px + 2 * var(--gutter)); margin: 14px auto 0; padding: 0 var(--gutter); display: grid; gap: 8px; }
.banner { border-radius: var(--radius-sm); padding: 10px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
          border: 1px solid transparent; font-size: .92rem; }
.banner .grow { flex: 1; min-width: 200px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in oklch, var(--warn) 28%, transparent); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in oklch, var(--bad) 28%, transparent); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in oklch, var(--ok) 28%, transparent); }
.banner.info { background: var(--info-soft); }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: var(--z-toast);
          width: min(560px, calc(100% - 32px)); }
.toast { background: var(--inverse); color: var(--inverse-text); border-radius: var(--radius-sm); padding: 8px 8px 8px 16px; display: flex;
         gap: 12px; align-items: center; box-shadow: var(--shadow); font-size: .92rem; min-height: 46px;
         animation: toast-in 260ms var(--ease); }
.toast .grow { flex: 1; }
.toast button { background: transparent; color: var(--inverse-text); border-color: color-mix(in oklch, var(--inverse-text) 30%, transparent);
                box-shadow: none; }
.toast button:hover { background: color-mix(in oklch, var(--inverse-text) 12%, transparent); border-color: transparent; }
.toast.bad { background: var(--bad); color: oklch(1 0 0); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } }

/* --- buttons and forms ------------------------------------------------------------------ */
button, .btn { font: inherit; font-size: .9rem; font-weight: 500; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
               background: var(--surface); color: var(--text); padding: 6px 12px; cursor: pointer; text-decoration: none;
               display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.3; min-height: 36px;
               box-shadow: var(--shadow-sm);
               transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out, color var(--fast) ease-out,
                           box-shadow var(--fast) ease-out, transform var(--fast) ease-out; }
button:hover, .btn:hover { background: var(--surface-2); border-color: color-mix(in oklch, var(--muted) 45%, var(--line-strong)); color: var(--text); }
button:active:not(:disabled), .btn:active { transform: translateY(1px); box-shadow: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
button.danger, .btn.danger { color: var(--bad); }
button.danger:hover, .btn.danger:hover { background: var(--bad-soft); border-color: color-mix(in oklch, var(--bad) 35%, transparent); color: var(--bad); }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); border-color: transparent; }
button.small, .btn.small { padding: 3px 10px; min-height: 30px; font-size: .85rem; }
button.icon, .btn.icon { padding: 0; width: 32px; min-height: 32px; color: var(--muted); }
button.icon:hover, .btn.icon:hover { color: var(--text); }
button.icon.danger:hover { color: var(--bad); background: var(--bad-soft); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
                          border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px; width: 100%;
                          transition: border-color var(--fast) ease-out, box-shadow var(--fast) ease-out, background-color var(--fast) ease-out; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklch, var(--muted) 40%, var(--line-strong)); }
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: auto; accent-color: var(--accent); margin: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
input[type="date"] { width: auto; }
label { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
label.inline { display: inline-flex; gap: 8px; align-items: center; color: var(--text); font-size: .92rem; font-weight: 400; margin: 0; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.board-list { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.error-text { color: var(--bad); font-size: .85rem; }
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 20px; }
.subnav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 500; padding: 8px 12px 10px; margin-bottom: -1px;
            border-bottom: 2px solid transparent; transition: color var(--fast) ease-out, border-color var(--fast) ease-out; }
.subnav a:hover { color: var(--text); border-bottom-color: var(--line-strong); }
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; flex: none; }
.segmented a, .segmented label { color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 500; padding: 4px 12px; border-radius: 7px;
               margin: 0; position: relative; cursor: pointer;
               transition: color var(--fast) ease-out, background-color var(--fast) ease-out, box-shadow var(--fast) ease-out; }
.segmented a:hover, .segmented label:hover { color: var(--text); }
.segmented a[aria-current="page"], .segmented label:has(:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented label:has(:focus-visible) { box-shadow: var(--ring); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }   /* radio as a segment: the label is the control */
.search-field { position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 0; }
.search-field > .i { position: absolute; left: 10px; color: var(--faint); pointer-events: none; }
.search-field input { padding-left: 32px; }
.error-text:empty { display: none; }
details > summary { cursor: pointer; }
summary::marker { color: var(--faint); }

/* --- cards, tables, badges -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 14px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.grid-2 > .card + .card { margin-top: 0; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { transition: background-color var(--fast) ease-out; }
.table tbody tr:hover { background: color-mix(in oklch, var(--surface-2) 70%, transparent); }
.table tr:last-child td { border-bottom: none; }
.table tfoot td, .table tr.total td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: none; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 500; line-height: 1.5; padding: 0 8px;
         border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.badge .i { width: 12px; height: 12px; vertical-align: 0; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.key { font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .value { font-size: 1.3rem; font-weight: 640; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .value .muted { font-weight: 500; }
.stat .label { font-size: .8rem; color: var(--muted); }
.stats { display: flex; gap: 32px; flex-wrap: wrap; }
.status-behind { color: var(--bad); } .status-ahead { color: var(--ok); }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--pc, var(--faint)); flex: none; vertical-align: 1px; }
.p0 { --pc: var(--p0); } .p1 { --pc: var(--p1); } .p2 { --pc: var(--p2); } .p3 { --pc: var(--p3); }
.p4 { --pc: var(--p4); } .p5 { --pc: var(--p5); } .p6 { --pc: var(--p6); } .p7 { --pc: var(--p7); }
.pdot.off { --pc: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }

/* meter: two native <progress> stacked — plan to yesterday (soft) under worked (accent); no CSSOM needed */
.meter { display: grid; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter progress { grid-area: 1 / 1; appearance: none; -webkit-appearance: none; border: 0; width: 100%; height: 100%; background: transparent;
                  color: var(--accent); }
.meter progress::-webkit-progress-bar { background: transparent; }
.meter progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .6s var(--ease); }
.meter progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.meter progress.plan::-webkit-progress-value { background: var(--shortfall); }
.meter progress.plan::-moz-progress-bar { background: var(--shortfall); }
.meter.lg { height: 8px; }

/* --- dialogs ----------------------------------------------------------------------------- */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text);
         box-shadow: var(--shadow); width: min(560px, calc(100% - 32px)); }
dialog[open] { animation: dialog-in var(--mid) var(--ease); }
dialog::backdrop { background: oklch(0.2 0.01 255 / .4); animation: fade var(--mid) ease-out; }
dialog .dialog-body { padding: 22px 22px 18px; }
dialog .dialog-body h2 { font-size: 1.1rem; }
dialog .dialog-actions { padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px;
                         justify-content: flex-end; flex-wrap: wrap; border-radius: 0 0 13px 13px; }
dialog .table td { padding: 7px 8px; }
#help-dialog td:first-child { width: 1%; white-space: nowrap; padding-right: 20px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
dialog .dialog-actions .order-first { order: -1; margin-right: auto; }   /* shown first, but not the Enter default */

/* --- task picker (combobox) -------------------------------------------------------------- */
.picker { position: relative; }
.picker-list { position: absolute; z-index: var(--z-dropdown); left: 0; right: 0; top: calc(100% + 6px); background: var(--surface);
               border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 360px;
               overflow-y: auto; padding: 6px; min-width: 320px; animation: pop 140ms var(--ease); }
.picker-section { font-size: .75rem; font-weight: 600; color: var(--faint); padding: 8px 10px 4px; }
.picker-option { padding: 7px 10px; border-radius: var(--radius-xs); cursor: pointer; display: grid; gap: 1px; font-size: .92rem;
                 transition: background-color 80ms ease-out; }
.picker-option:hover { background: var(--surface-2); }
.picker-option .where { font-size: .78rem; color: var(--muted); }
.picker-option[aria-selected="true"] { background: var(--accent-soft); }
.picker-option.create { color: var(--accent); font-weight: 500; }
.picker-chip { font-size: .78rem; color: var(--muted); margin-top: 2px; min-height: 1.2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- day ---------------------------------------------------------------------------------- */
.day-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.day-head h1 { margin: 0; font-size: 1.4rem; }
.day-head .badge { align-self: center; }
.day-nav { display: flex; gap: 6px; align-items: center; }
.day-nav .btn.icon { width: 34px; min-height: 34px; color: var(--text); }
.day-nav input[type="date"] { width: auto; min-height: 34px; padding: 4px 10px; font-size: .9rem; color: var(--muted); }
.day-summary { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; margin-left: auto; }
.day-summary .stat-month { min-width: 190px; }
.day-summary .meter { margin-top: 6px; }

.quick { position: relative; z-index: var(--z-raised); display: grid;
         grid-template-columns: minmax(240px, 2.4fr) 88px 88px 128px minmax(150px, 1.6fr) auto;
         background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-sm);
         transition: border-color var(--mid) ease-out, box-shadow var(--mid) ease-out; }
.quick:focus-within { border-color: var(--accent-line); box-shadow: var(--shadow-sm), 0 0 0 4px color-mix(in oklch, var(--accent) 7%, transparent); }
.quick > div { position: relative; padding: 9px 12px 6px; min-width: 0; }
.quick > div + div { border-left: 1px solid var(--line); }
.quick > div::before { content: ""; position: absolute; inset: 4px; border-radius: var(--radius-xs); background: var(--accent-soft); z-index: -1;
                       opacity: 0; transition: opacity var(--fast) ease-out; }
.quick > div:focus-within::before { opacity: 1; }
.quick > div:focus-within > label { color: var(--accent); }
.quick label { margin-bottom: 1px; font-size: .75rem; font-weight: 600; transition: color var(--fast) ease-out; }
.quick input { border: 0; background: transparent; padding: 0; min-height: 26px; border-radius: 0; box-shadow: none; font-size: .98rem; }
.quick input:focus { box-shadow: none; }
.quick .num-field input, .quick input[inputmode="numeric"], .quick input[name="duration"] { font-variant-numeric: tabular-nums; }
.quick .interp { font-size: .76rem; color: var(--muted); min-height: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick .interp.bad { color: var(--bad); white-space: normal; }
.quick .submit { display: flex; gap: 6px; align-items: center; padding: 8px 10px; }
.quick .submit::before { display: none; }
.quick .submit button { min-height: 40px; padding: 6px 16px; }
.quick .kbd-hint { font: 500 .8rem var(--mono); opacity: .7; margin-left: 2px; }
.quick > .error-text { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--bad-soft);
                       border-radius: 0 0 11px 11px; }

.entries { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.entry { display: grid; grid-template-columns: 116px 56px minmax(0, 1fr) auto; gap: 16px; padding: 12px 12px 12px 18px;
         border-bottom: 1px solid var(--line); align-items: start; transition: background-color var(--fast) ease-out; }
.entries > :first-child { border-top-left-radius: 11px; border-top-right-radius: 11px; }
.entries > :last-child { border-bottom: none; border-bottom-left-radius: 11px; border-bottom-right-radius: 11px; }
.entry:hover { background: color-mix(in oklch, var(--surface-2) 70%, transparent); }
.entry.selected { background: var(--accent-soft); }
.entry:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.entry.overlap { background: color-mix(in srgb, var(--bad-soft) 45%, var(--surface)); }
.entry.overlap.selected { background: var(--accent-soft); }
.entry.fresh { animation: fresh 1.4s var(--ease); }
@keyframes fresh { from { background-color: color-mix(in srgb, var(--accent) 18%, var(--surface)); } }
.entry .when { font-variant-numeric: tabular-nums; color: var(--text); padding-top: 1px; white-space: nowrap; }
.entry .dur { font-variant-numeric: tabular-nums; font-weight: 640; text-align: right; padding-top: 1px; }
.entry .what .name { font-weight: 550; overflow-wrap: anywhere; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.entry .what .name .pdot { margin-right: -2px; }
.entry .what .where { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.entry .what .note { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.entry .tools { display: flex; gap: 2px; margin: -4px -4px -4px 0; transition: opacity var(--fast) ease-out; }
@media (hover: hover) {
  .entry .tools { opacity: 0; }
  .entry:hover .tools, .entry.selected .tools, .entry:focus-within .tools { opacity: 1; }
}
.entry button.icon[data-action="timer"]:hover { color: var(--accent); background: var(--accent-soft); }
.gap { display: flex; align-items: center; gap: 10px; padding: 3px 18px; font-size: .78rem; color: var(--faint); font-variant-numeric: tabular-nums;
       border-bottom: 1px solid var(--line); background: var(--bg); }
.gap::before, .gap::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.gap::before { flex: 0 0 104px; }
.section-label { padding: 7px 18px; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.source { font-size: .7rem; font-weight: 500; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 6px; line-height: 1.5; }
a.ext { text-decoration: none; color: var(--faint); display: inline-flex; padding: 2px; border-radius: 4px; transition: color var(--fast) ease-out; }
a.ext:hover { color: var(--accent); }
.entry form.edit { grid-column: 1 / -1; margin: -4px -4px -4px -10px; }
.entry:has(form.edit) { background: var(--surface-2); }
.day-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.day-foot .label { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-right: 2px; }
.locked-note { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
               padding: 12px 16px; margin-bottom: 16px; color: var(--muted); }
.locked-note .i { color: var(--muted); }

/* --- week, month -------------------------------------------------------------------------- */
.week-table td.cell a { display: block; color: inherit; text-decoration: none; text-align: right; font-variant-numeric: tabular-nums; }
.week-table td.cell a:hover { color: var(--accent); }
.week-table th.day.today, .week-table td.today { background: color-mix(in oklch, var(--accent-soft) 80%, transparent); }
.week-table th.day.off, .week-table td.off { background: color-mix(in oklch, var(--surface-2) 70%, transparent); }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar .dow { font-size: .78rem; font-weight: 500; color: var(--muted); padding: 0 8px 2px; }
.calendar .cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 88px; padding: 8px 10px;
                  color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 2px; position: relative;
                  transition: border-color var(--fast) ease-out, box-shadow var(--fast) ease-out, transform var(--fast) var(--ease); }
.calendar .cell:hover { border-color: var(--accent-line); box-shadow: var(--shadow-sm); transform: translateY(-1px); color: inherit; }
.calendar .cell.outside { visibility: hidden; }
.calendar .cell.weekend, .calendar .cell.holiday { background: transparent; border-style: dashed; }
.calendar .cell.missing { border-color: color-mix(in oklch, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.calendar .cell.overlap { border-color: color-mix(in oklch, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)); }
.calendar .cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.calendar .date { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.calendar .cell.today .date { color: var(--accent); font-weight: 600; }
.calendar .total { font-weight: 640; font-variant-numeric: tabular-nums; font-size: 1.05rem; margin-top: auto; }
.calendar .tag { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.calendar .cell.missing .tag { color: var(--warn); }
.calendar .cell.overlap .tag { color: var(--bad); }
.progress { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; margin: 6px 0 2px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s var(--ease); }

/* --- tree (tasks, reports) ---------------------------------------------------------------- */
details.node > summary { list-style: none; cursor: pointer; }
details.node > summary::-webkit-details-marker { display: none; }
details.node > summary .chev { display: inline-flex; width: 16px; justify-content: center; transition: transform var(--mid) var(--ease); color: var(--faint); vertical-align: -2px; }
details.node[open] > summary .chev { transform: rotate(90deg); }
.report-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 72px 72px 64px; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line);
              align-items: baseline; font-variant-numeric: tabular-nums; }
.report-row.head { color: var(--muted); font-size: .8rem; font-weight: 500; }
.report-row.total { font-weight: 640; background: var(--surface-2); }
.report-row .label { overflow-wrap: anywhere; }
.indent-1 { padding-left: 28px !important; } .indent-2 { padding-left: 48px !important; } .indent-3 { padding-left: 68px !important; }

/* --- auth --------------------------------------------------------------------------------- */
.auth-page { background: radial-gradient(120% 70% at 50% 0%, var(--accent-soft), var(--bg) 60%); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: min(400px, 100%); padding: 32px 28px 28px; box-shadow: var(--shadow); }
.auth .banner { margin-bottom: 16px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; margin-bottom: 22px; }
.auth-brand .mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--accent-text); }
.auth-brand .mark .i { width: 24px; height: 24px; vertical-align: 0; }
.auth .actions { margin-top: 18px; }
.auth button.primary { min-height: 40px; padding: 8px 20px; }

/* --- responsive --------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick > div + div { border-left: 0; }
  .quick > div:nth-child(n+2) { border-top: 1px solid var(--line); }
  .quick > div:nth-child(3), .quick > div:nth-child(4) { border-left: 1px solid var(--line); }
  .quick .task-field, .quick .note-field, .quick .submit { grid-column: 1 / -1; }
  .quick .submit { justify-content: stretch; }
  .quick .submit button { flex: 1; }
  .day-summary { margin-left: 0; width: 100%; }
  .report-row { grid-template-columns: minmax(0, 1fr) 64px 56px; }
  .report-row .col-days, .report-row .col-share { display: none; }
}
@media (max-width: 600px) {
  .entry { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 12px 10px 14px; }
  .entry .what { grid-column: 1; grid-row: 1; }
  .entry .dur { grid-column: 2; grid-row: 1; }
  .entry .when { grid-column: 1; grid-row: 2; font-size: .85rem; align-self: center; }
  .entry .tools { grid-column: 2; grid-row: 2; justify-content: flex-end; opacity: 1; }
  .entry .tools button.icon { width: 30px; min-height: 30px; }
  .gap::before { flex: 0 0 12px; }
  .calendar { gap: 3px; }
  .calendar .cell { min-height: 58px; padding: 5px 6px; border-radius: var(--radius-xs); }
  .calendar .cell:hover { transform: none; }
  .calendar .total { font-size: .9rem; }
  .calendar .tag { display: none; }
  .timer-pill { max-width: 220px; }
  .timer-pill button .label { display: none; }
  main { padding-top: 16px; }
  .card { padding: 16px; }
  .stats { gap: 16px 24px; }
  .day-summary { gap: 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { animation-duration: 1ms !important; animation-iteration-count: 1 !important;
                                       transition-duration: 1ms !important; }
}
@media print {
  .topbar, .banners, .toasts, .actions, .quick { display: none !important; }
  body { background: #fff; }
}

.narrow { max-width: 220px; }
.hidden { display: none !important; }
.narrow-card { max-width: 460px; }
.grow { flex: 1; }

.week-table tr.group-row td { background: var(--surface-2); border-top: 1px solid var(--line); }
.week-table tr.group-row .pdot { margin-right: 6px; }
.week-table th.day { white-space: nowrap; font-size: .8rem; }
.week-table th.day a { color: inherit; text-decoration: none; }
.week-table th.day a:hover { color: var(--accent); }
/* the task column stays put while the days scroll sideways on narrow screens */
.week-table th:first-child, .week-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 168px; }
.week-table tr.group-row td:first-child { background: var(--surface-2); }
@media (max-width: 600px) {
  .page-head h1 .muted { display: block; font-size: .95rem; font-weight: 500; margin-top: 2px; }
  .week-table th:first-child, .week-table td:first-child { min-width: 148px; box-shadow: 1px 0 0 var(--line); }
}

.card > h1:first-child { font-size: 1.25rem; margin-bottom: 16px; }
