/* THE app header + tab bar (T-605: moved out of index.html so records.html draws THE SAME one; the rules are unchanged, in their old order).
   The website's logo row (brand, the light / dark switch, Account) and the tab row (icon over word on a phone, icon + word in a row from 560 px). Tokens only. */
/* ── header ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
.top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:2px 0 10px;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:8px;min-width:0}
a.brand{color:inherit;text-decoration:none;border-radius:10px}a.brand:focus-visible{outline:2px solid var(--focus);outline-offset:3px}   /* T-180: the logo is the way home, on every page */
.brand h1{display:flex;margin:0}
.brand .mark{width:40px;height:40px;flex:none;display:block}   /* T-42 round-6 H1 (his pick 10-11): the tile = the wordmark block's height (40 px), gap 8 px · the E-edged mark (brand/icon-e-edged/tile-rounded-11.svg, T-42), coloured by the theme */
.brand .mark .mark-tile{fill:var(--logo-tile)}.brand .mark .mark-glyph{fill:var(--logo-glyph)}   /* T-512 L0 (his pick 18 Nov): red tile, white house, no glow */
.brand .wordmark{width:100px;height:40px;flex:none;display:block}   /* T-135: THE wordmark (brand/wordmark-2c, Geist — TM30 over Autofill, outlined paths), the name is the sr-only text beside it */
.brand .wordmark .wm-main{color:var(--wm-main)}.brand .wordmark .wm-sub{color:var(--wm-sub)}   /* T-512: "TM30" and "Autofill" black in light, white in dark */
.brand .beta-tag{height:40px;width:calc(40px * 164 / 158.8);margin-left:calc(40px * 16 / 158.8 - 8px)}   /* T-543: THE beta tag (src/core/beta-tag.css), as tall as the wordmark, after the <h1> in a.brand (gap 8) */
@media (max-width:380px){.brand .mark{width:32px;height:32px}.brand .wordmark{width:80px;height:32px}.brand .beta-tag{height:32px;width:calc(32px * 164 / 158.8);margin-left:calc(32px * 16 / 158.8 - 8px)}}   /* T-543: a narrow phone (≤ 370 px): the lockup at 32 px so the tag, the theme switch and Log In stay on one line, the header 69 px as before (measured at 40 px: 337 px wide at 320, the header 75 px tall at 341-360) */
@media (max-width:334px){.brand .beta-tag{display:none}}   /* L0330-R2 (the panel's rule, the 0.3.30 restart batch): 32 px lockup to 380 px (was 370: 1 px sideways at 371 signed in); under 335 px the tag is off (signed in, the theme switch + Account need its room: the header was 335 px wide at 320-334, Account cut). test/responsive.test.js sweeps 320-420 px */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.nav{display:flex;align-items:center;gap:4px}
/* the Light / Dark switch (src/theme.js) — shown only once the script has resolved the theme */
.theme-toggle{display:inline-grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border-radius:var(--radius-s);border:1px solid var(--line);background:transparent;color:var(--ink-2);flex:none;transition:background-color .15s ease,color .15s ease,border-color .15s ease}
.theme-toggle svg{width:18px;height:18px}
.theme-toggle .t-sun{display:none}
:root[data-theme="dark"] .theme-toggle .t-sun{display:block}:root[data-theme="dark"] .theme-toggle .t-moon{display:none}
:root:not([data-theme]) .theme-toggle{display:none}
@media (hover:hover){.theme-toggle:hover{background:var(--surface-2);color:var(--ink);border-color:var(--line-strong)}}
.nav a.link{display:none;align-items:center;min-height:44px;padding:0 12px;border-radius:var(--radius-s);color:var(--ink-2);text-decoration:none;font-weight:500;font-size:var(--fs-1);transition:background-color .2s ease,color .2s ease}
.nav a.link:hover{background:var(--surface-2);color:var(--ink)}
@media (min-width:720px){.nav a.link{display:inline-flex}}
.top .btn{min-height:44px;padding:6px 16px;font-size:var(--fs-1)}

.apptabs{position:sticky;top:0;z-index:20;display:flex;align-items:stretch;gap:4px;background:var(--bg);border-bottom:1px solid var(--line)}
.tablist{flex:1;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);min-width:0}
.tab{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;padding:6px 4px;border:0;border-radius:var(--radius-s) var(--radius-s) 0 0;background:none;color:var(--ink-2);font:600 .75rem/1.15 var(--f-body);letter-spacing:.005em;text-decoration:none;cursor:pointer;transition:color .15s ease,background-color .15s ease}
.tab svg{width:20px;height:20px;flex:none}
.tab::after{content:"";position:absolute;left:16%;right:16%;bottom:-1px;height:2px;border-radius:2px 2px 0 0;background:var(--brand-text);transform:scaleX(0);transition:transform .2s var(--ease)}
.tab[aria-selected="true"]{color:var(--ink);background:var(--brand-soft)}   /* T-512: the open tab leads in the soft powder blue, --ink words (black in light, white on the dark shade: --ink on --brand-soft, t512-look's table) */
.tab[aria-selected="true"]::after{transform:none}
@media (hover:hover){.tab:hover{color:var(--ink);background:var(--surface-2)}}
.tab:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.tab-admin{flex:none;padding:6px 10px}
.tablist{position:relative}
.tab-ind{position:absolute;left:0;bottom:-1px;width:1px;height:2px;background:var(--brand-text);transform-origin:0 0;pointer-events:none;opacity:0}
.tab-ind.ready{opacity:1;transition:transform .2s cubic-bezier(.2,.7,.2,1)}   /* T-61: the underline slides to the chosen tab */
.tablist.has-ind .tab::after{display:none}
/* T-601 (his rulings 25 Nov 12:50 + 13:05, the approved mock-up v7): computer / iPad: Submit TM30 · History · Records · Documents · Settings
   · Plan · bell, Settings with its full word; a phone (under 560 px): "TM30" for Submit TM30, Settings as a gear icon tab (44 px, like the
   bell) after Plan */
.tab .tw-short,.tab .tab-gear{display:none}

@media (max-width:559px){
  .tablist{display:flex;overflow-x:auto;scrollbar-width:none}
  .tablist::-webkit-scrollbar{display:none}
  .tablist>.tab{flex:1 0 auto;min-width:0;padding:6px 5px}
  .tab .tw-long{display:none}
  .tab .tw-short{display:inline}
  #tabSettings svg:not(.tab-gear){display:none}
  #tabSettings .tab-gear{display:block}
  #tabSettings,.tablist>.tab-bell{flex:0 0 44px;padding:6px 0}
  .tablist>.tab{font-size:.68rem;letter-spacing:-.005em}
  .tablist>.tab>span{white-space:nowrap}   /* History stays for now (ruling 1): five words + two icons share the width; each word whole (a narrower phone: the row scrolls sideways inside itself, never the page) */
  #tabSettings{order:8}
  .tablist>.tab-bell{order:9}
}
@media (min-width:560px){
  .tablist{grid-auto-columns:max-content;gap:2px}
  .tab{flex-direction:row;gap:8px;min-height:48px;padding:0 14px;font-size:var(--fs-1);font-weight:500}
  .tab svg{width:18px;height:18px}
  .tab[aria-selected="true"]{font-weight:600}
  .tab::after{left:10px;right:10px}
}

html:not([data-home="today"]) .top{padding:10px 0 14px}
html:not([data-home="today"]) .nav a.link{border-radius:999px;font-weight:550}
html:not([data-home="today"]) .theme-toggle{border-radius:999px;border-color:var(--line-strong);background:var(--surface);margin:0 4px 0 6px}
html:not([data-home="today"]) .top .btn{border-radius:12px;background:var(--sec-bg);color:var(--sec-ink);border-color:var(--sec-line);font-weight:650;box-shadow:var(--shadow)}
@media (hover:hover){html:not([data-home="today"]) .top .btn:hover{background:var(--sec-bg);color:var(--sec-ink);border-color:var(--line-strong)}}
