/* ═════════ Shell chrome shared by every page: the section tab bar, page transitions, page header rhythm, placeholders, the shortcut list, focus and loading polish.
   Motion comes from the tokens (--dur-fast / --dur-page / --ease-std, css/tokens.css) and is switched off under prefers-reduced-motion at the end of this file. ═════════ */

/* ── section tabs (js/shell.js subnav): role=tablist, a sliding indicator, scrolls sideways when it does not fit ── */
.subnav { position: absolute; z-index: 6; top: 0; left: 0; right: 0; height: var(--subnav-h); display: flex; align-items: stretch; gap: 0; padding: 0 clamp(8px, 2vw, 32px) 0 clamp(16px, 2.6vw, 40px); background: var(--bg); border-bottom: 1.5px solid var(--line-strong); }
.subnav__sec { flex: none; display: flex; align-items: center; padding-right: 16px; margin-right: 6px; color: var(--ink-3); font-size: 10px; letter-spacing: .18em; border-right: 1.5px solid var(--line); }
.subnav__tabs { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.subnav__tabs::-webkit-scrollbar { display: none; }
.subnav__t { position: relative; flex: none; display: flex; align-items: center; gap: 7px; padding: 0 14px; font: 700 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; white-space: nowrap; color: var(--ink-3); transition: color var(--dur-fast) var(--ease-std), background var(--dur-fast) var(--ease-std); }
.subnav__t:hover { color: var(--ink); background: color-mix(in srgb, var(--bg-3) 70%, transparent); } .subnav__t.is-on { color: var(--ink); }
.subnav__t:focus-visible { outline: 3px solid var(--hit); outline-offset: -4px; } [data-theme='light'] .subnav__t:focus-visible { outline-color: var(--blue); }
.subnav__soon { font-size: 8.5px; letter-spacing: .1em; padding: 1px 4px; border: 1px solid currentColor; opacity: .75; }
.subnav__ink { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--hit); pointer-events: none; transform: translateX(0); transition: transform var(--dur-page) var(--ease-std), width var(--dur-page) var(--ease-std), opacity var(--dur-fast); will-change: transform; }
[data-theme='light'] .subnav__ink { background: var(--blue); } .subnav__ink.no-anim { transition: none; }
/* a quiet "loading" line while a tab's page is on its way (the old page stays, dimmed): shown only after a short delay so a fast switch shows nothing */
.subnav__busy { position: absolute; left: 0; right: 0; bottom: -1.5px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) 0s; }
.subnav.is-busy .subnav__busy { opacity: 1; transition-delay: .2s; }
.subnav__busy::after { content: ''; position: absolute; top: 0; bottom: 0; left: -30%; width: 30%; background: var(--hit); animation: subbusy 1.1s var(--ease-io) infinite; } [data-theme='light'] .subnav__busy::after { background: var(--blue); }
@keyframes subbusy { to { left: 100%; } }
.stage > .page { top: var(--subnav-h); }
.page.is-busy > *:not(.tasks) { opacity: .6; transition: opacity var(--dur-fast) .12s; } .page.is-busy { cursor: progress; }

/* ── page transition: <= 180 ms fade + a few pixels of slide in the direction you moved (transform only: no layout shift) ── */
.page.rise > * { animation: pagein var(--dur-page) var(--ease-std) both; }
.page.rise[data-dir='r'] > * { --dx: 12px; } .page.rise[data-dir='l'] > * { --dx: -12px; } .page.rise[data-dir='u'] > * { --dy: 8px; }
@keyframes pagein { from { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)); } }
/* the skeleton never flashes: it only exists after 300 ms (js/shell.js SKEL_DELAY), then fades in */
.loading--skel { animation: fadein .2s var(--ease-std) both; } @keyframes fadein { from { opacity: 0; } }

/* ── page header rhythm: the tab already names the page, so the title is calmer than before ── */
.ph__t { font-size: clamp(26px, 2.8vw, 38px); letter-spacing: -.035em; line-height: 1; } .ph__t--sm { font-size: clamp(22px, 2.3vw, 30px); }   /* page titles lead the page; they do not fill it */
.ph { padding-bottom: 16px; margin-bottom: 20px; }

/* ── keyboard shortcuts (?): a two-column list ── */
.keys { display: grid; gap: 16px; } .keys section { min-width: 0; } .keys__h { color: var(--ink-3); margin: 0 0 8px; font-size: 10px; }
.keys__l { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px; margin: 0; } .keys__l div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line); }
.keys__l dt { flex: none; } .keys__l dd { margin: 0; color: var(--ink-2); font-size: 13.5px; text-align: right; }
.keys kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border: 1.5px solid var(--line-strong); font-size: 10.5px; letter-spacing: .04em; text-align: center; }

/* ── consistent focus for the things every page shares ── */
a.rowname:focus-visible, a.drill:focus-visible, .lnk:focus-visible, .tlink:focus-visible, summary:focus-visible { outline: 2px solid var(--hit); outline-offset: 2px; }
[data-theme='light'] a.rowname:focus-visible, [data-theme='light'] a.drill:focus-visible, [data-theme='light'] .lnk:focus-visible, [data-theme='light'] .tlink:focus-visible, [data-theme='light'] summary:focus-visible { outline-color: var(--blue); }
.empty { animation: fadein var(--dur-page) var(--ease-std) both; }

/* ── phones: the section name goes (the bottom bar already shows it), tabs get bigger targets ── */
@media (max-width: 760px) {
  .subnav { padding: 0 4px; } .subnav__sec { display: none; } .subnav__t { padding: 0 12px; }
  .subnav__tabs { scroll-snap-type: x proximity; } .subnav__t { scroll-snap-align: center; }
  .subnav__tabs { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .subnav__ink, .subnav__t, .mode, .mode__i, .mode::before, .rail__fold svg { transition: none !important; }
  .page.rise > *, .loading--skel, .empty, .subnav__busy::after { animation: none !important; }
  .page.is-busy > * { transition: none !important; }
}

/* Header sync button: a compact icon that refreshes the ClickUp sync. idle · running (spins) · done (check) · error · disabled. */
.syncbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: 8px; flex: none; border: 1.5px solid var(--line-strong); color: var(--ink-2); background: transparent; transition: border-color .2s, color .2s; }
.syncbtn svg { width: 18px; height: 18px; }
.syncbtn:hover:not([data-state='disabled']) { border-color: var(--ink); color: var(--ink); }
.syncbtn[data-state='disabled'] { opacity: .45; cursor: not-allowed; } .syncbtn[data-state='running'] { cursor: progress; }
.syncbtn .syncbtn__ok { display: none; }
.syncbtn[data-state='running'] { color: var(--blue-hot); border-color: var(--blue-hot); }
.syncbtn[data-state='running'] .syncbtn__arrows { transform-origin: 12px 12px; animation: syncbtn-spin 1s linear infinite; }
.syncbtn[data-state='done'] { color: var(--ok); border-color: var(--ok); }
.syncbtn[data-state='done'] .syncbtn__arrows { display: none; } .syncbtn[data-state='done'] .syncbtn__ok { display: block; }
.syncbtn[data-state='error'] { color: var(--alert); border-color: var(--alert); }
@keyframes syncbtn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .syncbtn[data-state='running'] .syncbtn__arrows { animation: none; } .syncbtn[data-state='running'] { animation: blink 1s steps(2) infinite; } }
.keys__pref { margin-top: 18px; } .keys__prefrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--ink-2); }
.keys__prefrow select { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); padding: 6px 8px; }

/* ── hierarchy pass: figures inform, they do not shout; borders are hairlines; only exceptions get colour ── */
.big { padding: 10px 14px; border-width: 1px; border-color: var(--line); } .big .big__n { font-size: clamp(24px, 2.4vw, 34px); line-height: 1; }
@media (max-width: 720px) { .big .big__n { font-size: 26px; } }
