/* SetterOS · base: tokens, type, app shell */
:root{
  color-scheme:light;
  --bg:#F5F5F7; --card:#FFFFFF; --inset:#F5F5F7;
  --text:#1D1D1F; --text-2:#6E6E73; --text-3:#8E8E93;
  --line:rgba(0,0,0,.08); --line-soft:rgba(0,0,0,.05);
  --fill:rgba(118,118,128,.12); --fill-soft:rgba(118,118,128,.06);
  --accent:#0071E3; --accent-press:#0062C4; --accent-soft:rgba(0,113,227,.10); --accent-ink:#0066CC; --on-accent:#FFFFFF;
  --green:#34C759; --green-ink:#1E7B34; --green-soft:rgba(52,199,89,.14);
  --amber:#FF9F0A; --amber-ink:#A35200; --amber-soft:rgba(255,159,10,.16);
  --red:#FF3B30; --red-ink:#D70015; --red-soft:rgba(255,59,48,.10);
  --blue:#007AFF; --blue-ink:#0066CC; --blue-soft:rgba(0,122,255,.10);
  --grey:#8E8E93; --grey-ink:#636366; --grey-soft:rgba(142,142,147,.16);
  --glass:rgba(246,246,248,.78); --glass-strong:rgba(255,255,255,.92);
  --hud:rgba(29,29,31,.92); --on-hud:#F5F5F7;
  --shadow-1:0 1px 2px rgba(0,0,0,.04);
  --shadow-2:0 1px 2px rgba(0,0,0,.03),0 8px 28px rgba(0,0,0,.06);
  --shadow-3:0 2px 8px rgba(0,0,0,.06),0 28px 72px rgba(0,0,0,.18);
  --scrim:rgba(0,0,0,.26);
  --r-card:18px; --r-inner:14px; --r-btn:12px;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue",Helvetica,Arial,sans-serif;
  --mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --sidebar-w:220px; --tabbar-h:58px;
  --ease:cubic-bezier(.2,.8,.2,1);
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#000000; --card:#1C1C1E; --inset:#2C2C2E;
  --text:#F5F5F7; --text-2:#A1A1A6; --text-3:#8D8D93;
  --line:rgba(255,255,255,.12); --line-soft:rgba(255,255,255,.07);
  --fill:rgba(118,118,128,.28); --fill-soft:rgba(118,118,128,.16);
  --accent:#0A84FF; --accent-press:#0071E3; --accent-soft:rgba(10,132,255,.20); --accent-ink:#5AA9FF;
  --green:#30D158; --green-ink:#4ADE7B; --green-soft:rgba(48,209,88,.18);
  --amber:#FF9F0A; --amber-ink:#FFB340; --amber-soft:rgba(255,159,10,.20);
  --red:#FF453A; --red-ink:#FF6B61; --red-soft:rgba(255,69,58,.20);
  --blue:#0A84FF; --blue-ink:#5AA9FF; --blue-soft:rgba(10,132,255,.20);
  --grey:#8E8E93; --grey-ink:#AEAEB2; --grey-soft:rgba(142,142,147,.24);
  --glass:rgba(22,22,24,.78); --glass-strong:rgba(36,36,38,.94);
  --hud:rgba(58,58,60,.94);
  --shadow-1:0 0 0 1px rgba(255,255,255,.04);
  --shadow-2:0 0 0 1px rgba(255,255,255,.05);
  --shadow-3:0 0 0 1px rgba(255,255,255,.08),0 28px 72px rgba(0,0,0,.6);
  --scrim:rgba(0,0,0,.5);
}
*,*::before,*::after{box-sizing:border-box}
/* touch-action:manipulation switches off double-tap-to-zoom, which is also what makes the phone hold every tap back for
   a moment in case a second one follows — that pause is what reads as a button not working. html carries the background
   too, so a rubber-band scroll shows the app's own colour instead of bare black behind it. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;background:var(--bg);touch-action:manipulation;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
body{margin:0;background:var(--bg);color:var(--text);font:400 15px/1.45 var(--font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overscroll-behavior:none}
h1,h2,h3,h4,p,ul,ol,figure{margin:0}
ul,ol{padding:0;list-style:none}
button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit}
button{cursor:pointer}
a{color:var(--accent-ink);text-decoration:none}
svg{display:block;flex:none}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
::selection{background:var(--accent-soft)}
.num{font-variant-numeric:tabular-nums}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.t-title{font-size:32px;line-height:1.12;font-weight:700;letter-spacing:-.02em;text-wrap:balance}
.t-section{font-size:22px;line-height:1.25;font-weight:700;letter-spacing:-.014em;text-wrap:balance}
.t-card{font-size:17px;line-height:1.3;font-weight:600;letter-spacing:-.008em}
.t-body{font-size:15px;line-height:1.45}
.t-meta{font-size:13px;line-height:1.35;color:var(--text-2)}
.t-label{font-size:13px;line-height:1.3;font-weight:600;color:var(--text-2)}
.muted{color:var(--text-2)}
.ink-green{color:var(--green-ink)} .ink-amber{color:var(--amber-ink)} .ink-red{color:var(--red-ink)} .ink-blue{color:var(--blue-ink)} .ink-grey{color:var(--grey-ink)}

/* shell */
.sidebar{position:fixed;top:0;bottom:0;left:0;width:var(--sidebar-w);display:flex;flex-direction:column;padding:16px 12px 12px;background:var(--glass);-webkit-backdrop-filter:saturate(180%) blur(24px);backdrop-filter:saturate(180%) blur(24px);border-right:1px solid var(--line-soft);z-index:20}
.brand{display:flex;align-items:center;gap:9px;padding:4px 10px 16px;font-size:15px;font-weight:700;letter-spacing:-.01em}
.brand-mark{width:24px;height:24px;border-radius:7px;background:var(--accent);color:#fff;display:grid;place-items:center}
.nav-search{display:flex;align-items:center;gap:8px;width:100%;min-height:34px;margin:0 0 14px;padding:0 8px 0 10px;border:0;border-radius:9px;background:var(--fill);color:var(--text-2);font-size:14px;text-align:left}
.nav-search .kbd{margin-left:auto}
.nav{display:grid;gap:2px}
.nav a{display:flex;align-items:center;gap:10px;min-height:36px;padding:0 10px;border-radius:9px;color:var(--text);font-size:15px;font-weight:500}
.nav a svg{width:20px;height:20px;color:var(--text-2)}
@media (hover:hover){.nav a:hover{background:var(--fill-soft)}}
.nav a[aria-current="page"]{background:var(--accent-soft);color:var(--accent-ink)}
.nav a[aria-current="page"] svg{color:var(--accent)}
.nav .count{margin-left:auto;font-size:13px;font-weight:600;color:var(--text-2)}
.nav .count.alert{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--red);color:#fff;display:grid;place-items:center;font-size:12px}
.sidebar-foot{margin-top:auto;display:grid;gap:6px}
.sync-line{display:flex;align-items:center;gap:6px;padding:0 10px;font-size:12px;color:var(--text-2)}
.profile-btn{display:flex;align-items:center;gap:10px;width:100%;padding:8px;border:0;border-radius:12px;background:transparent;text-align:left}
@media (hover:hover){.profile-btn:hover{background:var(--fill-soft)}}
.profile-btn .who{min-width:0;display:grid}
.profile-btn .who b{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-btn .who span{font-size:12px;color:var(--text-2)}
.main{margin-left:var(--sidebar-w);min-height:100vh;min-height:100dvh}
.page{max-width:1400px;margin:0 auto;padding:40px clamp(24px,4vw,56px) 96px}
.page.narrow{max-width:760px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;margin-bottom:28px}
.page-head .sub{margin-top:6px;font-size:17px;line-height:1.35;color:var(--text-2)}
.mtop{display:none}
.tabbar{display:none}
@media (max-width:760px){
  /* On a phone the app is a fixed frame exactly the size of the screen, whatever screen that is. Only the content
     scrolls, inside .main — the page as a whole can't slide up any more and leave a bare strip under the tab bar. */
  html,body{height:100%;overflow:hidden}
  #app{display:flex;flex-direction:column;height:100%}
  .main,.picker{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
  .sidebar{display:none}
  .main{margin-left:0;padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom))}
  .page{padding:12px 16px 40px}
  .page-head{margin-bottom:20px}
  .mtop{display:flex;align-items:center;gap:8px;flex:none;z-index:25;min-height:48px;padding:0 8px;padding-top:env(safe-area-inset-top);background:var(--glass);-webkit-backdrop-filter:saturate(180%) blur(24px);backdrop-filter:saturate(180%) blur(24px);border-bottom:1px solid var(--line-soft)}
  .mtop .grow{flex:1}
  .tabbar{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;z-index:30;height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--glass);-webkit-backdrop-filter:saturate(180%) blur(24px);backdrop-filter:saturate(180%) blur(24px);border-top:1px solid var(--line-soft)}
  .tabbar a{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;font-weight:500;color:var(--text-3)}
  .tabbar a svg{width:24px;height:24px}
  .tabbar a[aria-current="page"]{color:var(--accent)}
  .tabbar .dot{position:absolute;top:6px;left:calc(50% + 8px);width:8px;height:8px;border-radius:50%;background:var(--red)}
}
/* A finger can't hover, so on a phone the hover styles above only ever appeared after a tap and then stayed stuck on
   the thing last tapped. They're kept for the Mac; touch gets a press state instead, which shows the moment a finger
   lands and is gone when it lifts. */
@media (hover:none){
  .nav a:active,.profile-btn:active,.icon-btn:active,a.li:active,button.li:active,.chip:active,.choice:active,.back:active{background:var(--fill)}
  .btn:active{filter:brightness(.94)}
  .tabbar a:active{opacity:.5}
}
.tabbar a,.nav a,.btn,.icon-btn,.chip{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
