/* Sofo Command Center — design system (Builder 6 owns this file and the theme tokens).
   Two looks: LIGHT "HALO" (default: warm frosted glass on a sunlit peach/rose room, dark warm text) and DARK (the first
   look: warm dark glass). <html data-theme="light|dark"> is set before the first paint by index.html (Settings → Appearance).
   Every colour in the app comes from the tokens below; screens never write #hex or rgba(). See js/API.md § Theme.
   Phone first (390 px) up to the computer (1280–1440 px). No horizontal page scroll. 44 px tap targets. */
:root{
  --r:20px; --r2:14px; --side:256px;
  --font:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px);
  --nav-h:56px; --nav-gap:max(6px, calc(var(--safe-b) - 14px)); --nav-top:calc(var(--nav-gap) + var(--nav-h) + 20px);   /* main 30 Nov: + the floating button rising above the bar (pills.css .fabbar) */   /* phone bottom bar sits low, just above the home line; everything floating sits above --nav-top */
  /* the same in both looks: the logo mark, white buttons on the hero, white tiles, paper, controls over photos */
  --logo:linear-gradient(135deg,#FB923C,#C2410C); --logo-tile:#FFFFFF; --hero-btn:#FFFFFF; --hero-btn-text:#7C2D12; --hero-btn-h:#FFF1E6;
  --white-tile:#FFFFFF; --paper-bg:#E6E6EB; --knob:#FFFFFF; --knob-shadow:0 1px 3px rgba(40,16,8,.25);
  --photo-chip:rgba(20,11,8,.68); --on-photo:#FFFFFF; --star:#FDE68A; --photo-bad:#FCA5A5;
  --pin-shadow:drop-shadow(0 4px 8px rgba(0,0,0,.5));
  --btn-glow:0 10px 26px -10px rgba(249,115,22,.85),0 0 0 1px rgba(255,190,140,.22) inset;
}
/* ── LIGHT · HALO (default) ── */
:root,:root[data-theme="light"]{
  color-scheme:light;
  /* page: a sunlit room behind frosted glass, peach → rose → terracotta, two soft light streaks */
  --bg:#EDD2C3;
  --bg-img:
    linear-gradient(112deg,transparent 0 33%,rgba(255,255,255,.30) 39%,transparent 46%,transparent 58%,rgba(255,255,255,.20) 62%,transparent 68%),
    radial-gradient(1100px 680px at 4% -14%,rgba(255,226,206,.95),transparent 62%),
    radial-gradient(900px 700px at 104% -8%,rgba(247,158,126,.70),transparent 60%),
    radial-gradient(1000px 760px at 94% 114%,rgba(201,98,72,.55),transparent 62%),
    radial-gradient(820px 680px at -8% 106%,rgba(228,142,112,.60),transparent 60%),
    linear-gradient(165deg,#F6E0D3 0%,#EDC9B6 48%,#E1AF99 100%);
  --pane:rgba(255,248,243,.42); --pane-line:rgba(255,255,255,.58); --pane-shadow:0 40px 90px -50px rgba(110,46,26,.40);
  /* glass levels */
  --glass:rgba(255,251,248,.72); --glass-2:rgba(255,255,255,.55); --glass-in:rgba(255,255,255,.76); --glass-hover:rgba(255,255,255,.84);
  --glass-press:rgba(255,255,255,.95); --glass-solid:rgba(255,249,245,.97); --panel2:#FFF8F4;
  --line:rgba(255,255,255,.75); --line-2:rgba(96,52,36,.20); --sep:rgba(96,52,36,.11); --line-h:rgba(255,255,255,.98); --handle:rgba(96,52,36,.25);
  --hi:inset 0 1px 0 rgba(255,255,255,.80); --edge:inset 0 0 0 1px rgba(255,255,255,.60);
  --sheen:linear-gradient(118deg,transparent 28%,rgba(255,255,255,.30) 44%,rgba(255,255,255,.08) 52%,transparent 62%);
  --shadow:0 1px 2px rgba(110,50,30,.05),0 14px 34px -18px rgba(110,50,30,.30);
  --shadow-2:0 2px 6px rgba(110,50,30,.07),0 22px 48px -20px rgba(110,50,30,.40);
  --shadow-pop:0 2px 10px rgba(90,40,24,.08),0 30px 70px -24px rgba(90,40,24,.45);
  --blur:blur(18px);   /* same cost as the dark look; over a smooth background more blur shows no difference */
  --tile-shadow:0 6px 14px -8px rgba(90,40,24,.40); --bar-shadow:0 14px 36px -12px rgba(90,40,24,.35); --btn-shadow:0 8px 18px -9px rgba(234,88,12,.65);
  --viewer-bg:#E8DAD0;
  /* sidebar: rosy terracotta glass, light text, white active pill */
  --side-bg:linear-gradient(180deg,rgba(154,63,45,.95),rgba(138,54,38,.96));
  --side-text:#FFF6F0; --side-nav:#FFF6F0; --side-muted:rgba(255,239,230,.92); --side-field:rgba(60,18,8,.20); --side-kbd:rgba(60,18,8,.28); --side-hover:rgba(255,255,255,.15); --side-on:rgba(255,251,248,.96); --side-on-text:#3A1A10; --side-line:rgba(255,255,255,.24); --side-on-shadow:0 4px 14px -4px rgba(90,30,16,.40);
  --bar-bg:rgba(255,246,240,.86);
  /* text (AA on glass and on the page) */
  --text-strong:#1C110C; --text:#2B1B14; --muted:#5E463D; --faint:#684F45; --link:#9A3412; --link-hover:#7C2D12;
  /* accent: Sofo orange */
  --orange:#F97316; --orange-h:#FB8534; --ink:#1A0D06;
  --accent:#9A3412; --accent-2:#7C2D12; --accent-bg:rgba(249,115,22,.14); --accent-bg-2:rgba(249,115,22,.25); --accent-line:rgba(234,88,12,.45);
  --sel:#241913; --on-sel:#FFF8F4; --inv:#241913; --on-inv:#FFF8F4;
  --nav-bg:#17100C; --nav-line:rgba(255,246,240,.06); --nav-ic:rgba(255,246,240,.74); --nav-on-bg:#3B2D26; --nav-on:#FFFFFF; --nav-shadow:0 12px 30px rgba(70,24,6,.26),0 2px 6px rgba(70,24,6,.16);   /* phone bottom bar: black pill */
  /* status pairs: text · soft background · solid */
  --ok:#14532D; --ok-bg:rgba(22,163,74,.14); --ok-dot:#16A34A;
  --warn:#713F12; --warn-bg:rgba(234,179,8,.18); --warn-dot:#D97706; --warn-line:rgba(202,138,4,.40);
  --bad:#A61B1B; --bad-bg:rgba(239,68,68,.12); --bad-dot:#DC2626; --bad-line:rgba(220,38,38,.35);
  --info:#1E40AF; --info-bg:rgba(59,130,246,.12); --info-dot:#3B82F6;
  --purple:#5B21B6; --purple-bg:rgba(139,92,246,.13); --purple-dot:#8B5CF6;
  --cyan:#0E5A70; --cyan-bg:rgba(6,182,212,.13); --cyan-dot:#0891B2;
  --bad-solid:#DC2626; --on-bad:#FFFFFF;
  /* hero: vivid coral-red → Sofo orange. Every stop keeps white text at WCAG AA (≥ 4.5 : 1), also the small labels */
  --hero:linear-gradient(135deg,#DC3138 0%,#D63C2C 48%,#CF4410 100%);
  --hero-text:#FFFFFF; --hero-muted:#FFFFFF; --hero-accent:#FFE7D4; --hero-glass:rgba(70,8,0,.16); --hero-glass-h:rgba(70,8,0,.26); --hero-line:rgba(255,255,255,.55);
  --hero-track:rgba(255,255,255,.30); --hero-fill:#FFF4EC; --hero-shadow:inset 0 1px 0 rgba(255,255,255,.30),0 30px 70px -30px rgba(206,64,36,.55); --hero-shadow-h:inset 0 1px 0 rgba(255,255,255,.30),0 34px 80px -28px rgba(206,64,36,.68); --hero-tshadow:0 1px 2px rgba(110,24,10,.20);
  --money:linear-gradient(135deg,#D42F33 0%,#C42A2A 100%);
  --money-text:#FFFFFF;
  /* charts */
  --ch-1:#EA580C; --ch-2:#2563EB; --ch-3:#0D9488; --ch-4:#7C3AED; --ch-5:#CA8A04; --ch-6:#E11D48;
  --ch-grid:rgba(96,52,36,.12); --ch-axis:#6B5248; --ch-track:rgba(96,52,36,.12); --ch-area:rgba(234,88,12,.16);
  --age-1:#FB9A5B; --age-2:#F97316; --age-3:#C2410C; --age-4:#991B1B;
  /* map, focus, overlays, loaders, documents, opening light */
  --map-tiles:saturate(.8) sepia(.10); --map-pane:saturate(.8) sepia(.10); --map-bg:#F1E4DA;
  --focus:#C2410C; --focus-glow:rgba(249,115,22,.24); --scrim:rgba(64,28,16,.32);
  --skel:rgba(110,56,36,.07); --skel-hi:rgba(255,255,255,.55);
  --doc-shadow:0 1px 3px rgba(90,40,24,.10),0 12px 28px -10px rgba(90,40,24,.32);
  --veil:#F2DACD; --veil-glow:rgba(255,190,140,.55); --veil-glow-2:rgba(249,115,22,.22);
  /* people */
  --av-1:#FFE3CC; --av-2:#FDE68A; --av-3:#BBF7D0; --av-4:#BFDBFE; --av-5:#E9D5FF; --av-6:#FBCFE8; --av-7:#FED7AA; --av-ink:#3B1306; --av-ring:0 0 0 2px rgba(255,255,255,.85);
  /* WhatsApp preview (follows WhatsApp's own light / dark look) */
  --wa-bg:#EFE7DE; --wa-dot:rgba(0,0,0,.05); --wa-bubble:#D9FDD3; --wa-text:#111B21;
}
/* ── DARK (the first look, unchanged) ── */
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#140b08;
  --bg-img:radial-gradient(900px 520px at 80% -8%,rgba(249,115,22,.28),transparent 62%),radial-gradient(760px 620px at 4% 110%,rgba(220,38,38,.18),transparent 60%),linear-gradient(#140b08,#140b08);
  --pane:transparent; --pane-line:transparent; --pane-shadow:0 0 #0000;
  --glass:rgba(255,236,224,.055); --glass-2:rgba(255,236,224,.05); --glass-in:rgba(255,236,224,.06); --glass-hover:rgba(255,236,224,.09);
  --glass-press:rgba(255,236,224,.14); --glass-solid:rgba(40,22,15,.97); --panel2:#2a1810;
  --line:rgba(255,236,224,.10); --line-2:rgba(255,236,224,.16); --sep:rgba(255,236,224,.07); --line-h:rgba(255,236,224,.17); --handle:rgba(255,236,224,.25);
  --hi:0 0 #0000; --edge:0 0 #0000; --shadow:0 0 #0000; --sheen:none;
  --shadow-2:0 0 0 1px rgba(249,115,22,.07),0 18px 50px -28px rgba(249,115,22,.45);
  --shadow-pop:0 30px 80px rgba(0,0,0,.6);
  --blur:blur(18px);
  --tile-shadow:0 0 #0000; --bar-shadow:0 16px 40px rgba(0,0,0,.45); --btn-shadow:0 0 #0000;
  --viewer-bg:#1a0f0a;
  --side-bg:rgba(255,236,224,.055);
  --side-text:#F7EDE6; --side-nav:rgba(247,237,230,.82); --side-muted:rgba(247,237,230,.66); --side-field:rgba(255,236,224,.06); --side-kbd:rgba(255,236,224,.10); --side-hover:rgba(255,236,224,.07); --side-on:rgba(249,115,22,.18); --side-on-text:#FFE3CC; --side-line:rgba(255,236,224,.10); --side-on-shadow:0 0 #0000;
  --bar-bg:rgba(36,20,14,.86);
  --text-strong:#FFFFFF; --text:#F7EDE6; --muted:rgba(247,237,230,.66); --faint:rgba(247,237,230,.56); --link:#FFB27A; --link-hover:#FFD9BF;
  --orange:#F97316; --orange-h:#FF8A3D; --ink:#1a0d06;
  --accent:#FDBA74; --accent-2:#FFD2B0; --accent-bg:rgba(249,115,22,.16); --accent-bg-2:rgba(249,115,22,.30); --accent-line:rgba(249,115,22,.45);
  --sel:#F97316; --on-sel:#1a0d06; --inv:#F7EDE6; --on-inv:#1a0d06;
  --nav-bg:#0B0604; --nav-line:rgba(255,236,224,.10); --nav-ic:rgba(247,237,230,.72); --nav-on-bg:#3B2D26; --nav-on:#FFFFFF; --nav-shadow:0 12px 30px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.35);
  --ok:#86EFAC; --ok-bg:rgba(74,222,128,.15); --ok-dot:#4ADE80;
  --warn:#FDE68A; --warn-bg:rgba(253,230,138,.15); --warn-dot:#FBBF24; --warn-line:rgba(253,230,138,.30);
  --bad:#FCA5A5; --bad-bg:rgba(248,113,113,.15); --bad-dot:#F87171; --bad-line:rgba(248,113,113,.30);
  --info:#93C5FD; --info-bg:rgba(147,197,253,.15); --info-dot:#60A5FA;
  --purple:#C4B5FD; --purple-bg:rgba(167,139,250,.18); --purple-dot:#A78BFA;
  --cyan:#67E8F9; --cyan-bg:rgba(56,189,248,.12); --cyan-dot:#38BDF8;
  --bad-solid:#DC2626; --on-bad:#FFFFFF;
  --hero:radial-gradient(380px 300px at 88% 30%,rgba(255,190,140,.24),transparent 70%),linear-gradient(135deg,#C2410C 0%,#B4321E 55%,#7F1D1D 100%);
  --hero-text:#FFFFFF; --hero-muted:#FFFFFF; --hero-accent:#FFE3CC; --hero-glass:rgba(60,10,0,.22); --hero-glass-h:rgba(60,10,0,.32);
  --hero-line:rgba(255,255,255,.35); --hero-track:rgba(255,255,255,.22); --hero-fill:#FFE3CC; --hero-shadow:0 30px 80px -30px rgba(234,88,12,.55); --hero-shadow-h:0 34px 90px -36px rgba(249,115,22,.75); --hero-tshadow:none;
  --money:radial-gradient(260px 160px at 90% 0%,rgba(255,190,140,.20),transparent 70%),linear-gradient(135deg,#C2410C,#9A3412 60%,#7F1D1D);
  --money-text:#FFFFFF;
  --ch-1:#EA580C; --ch-2:#3B82F6; --ch-3:#0D9488; --ch-4:#8B5CF6; --ch-5:#CA8A04; --ch-6:#F87171;
  --ch-grid:rgba(255,236,224,.08); --ch-axis:rgba(247,237,230,.62); --ch-track:rgba(255,236,224,.08); --ch-area:rgba(249,115,22,.18);
  --age-1:#FDBA74; --age-2:#FB923C; --age-3:#EA580C; --age-4:#B91C1C;
  --map-tiles:invert(1) hue-rotate(180deg) brightness(.82) contrast(.92) saturate(.6); --map-pane:invert(1) hue-rotate(185deg) brightness(.82) contrast(.92) saturate(.55) sepia(.22); --map-bg:#1d1410;
  --focus:#FDBA74; --focus-glow:rgba(249,115,22,.22); --scrim:rgba(10,5,3,.6);
  --skel:rgba(255,236,224,.07); --skel-hi:rgba(255,236,224,.09);
  --doc-shadow:0 10px 26px rgba(0,0,0,.45);
  --veil:#140b08; --veil-glow:rgba(253,186,116,.40); --veil-glow-2:rgba(249,115,22,.32);
  --av-1:#FFE3CC; --av-2:#FDE68A; --av-3:#BBF7D0; --av-4:#BFDBFE; --av-5:#E9D5FF; --av-6:#FBCFE8; --av-7:#FED7AA; --av-ink:#3B1306; --av-ring:0 0 #0000;
  --wa-bg:#0b141a; --wa-dot:rgba(255,255,255,.05); --wa-bubble:#005c4b; --wa-text:#e9edef;
}
/* old names (aliases) */
:root,:root[data-theme]{--bg2:var(--bg);--panel:var(--panel2);--glass2:var(--glass-hover);--line2:var(--line-2);--orange2:var(--orange-h);--accent2:var(--accent-2);
  --okbg:var(--ok-bg);--badbg:var(--bad-bg);--violet:var(--purple);--yellow:var(--warn)}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--bg);min-height:100vh}   /* main 30 Nov (Cedric: "The nav bar is high when in the email tab"): with Text size Small the body is zoomed (.94), so a short page (Inbox, 3 emails) ended ~6% above the screen bottom and iOS pinned the bottom bar to the page end; html is never zoomed, so the page always fills the screen */
html.noscroll{overflow:hidden}
body{margin:0;min-height:100vh;font-family:var(--font);font-size:15px;line-height:1.45;color:var(--text);-webkit-font-smoothing:antialiased;
  background:var(--bg-img);background-color:var(--bg);background-attachment:fixed;overflow-x:hidden}
a{color:var(--link);text-decoration:none}a:hover{color:var(--link-hover)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.5}
img{max-width:100%}
h1,h2,h3{margin:0;letter-spacing:-.02em}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.t{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)} .faint{color:var(--faint)}
.lbl{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.serif{font-family:'Instrument Serif',Georgia,serif;font-style:italic;font-weight:400;color:var(--accent);letter-spacing:0}
.ic{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* the shell painted by index.html before any JavaScript (replaced by the app, or by the saved copy of the screen) */
.boot{min-height:100vh;display:flex;gap:20px;padding:20px}
.boot i{display:block;border-radius:14px;background:linear-gradient(90deg,var(--skel),var(--skel-hi),var(--skel));background-size:200% 100%;animation:shimmer 1.2s infinite}
.boot-side{width:var(--side);flex:none;height:calc(100vh - 40px);border-radius:20px;background:var(--side-bg);border:1px solid var(--side-line);padding:18px 12px;display:flex;flex-direction:column;gap:12px}
.boot-side i{height:32px}.boot-side .logo-s{margin:0 6px 8px}
.boot-top,.boot-tabs{display:none}
.boot-main{flex:1;display:flex;flex-direction:column;gap:16px;min-width:0}
.boot-main .h{height:64px;width:min(420px,70%)}.boot-main .c{height:190px;border-radius:20px}.boot-main .c.s{height:120px}
@media (max-width:899px){.boot{display:block;padding:0}.boot-side{display:none}.boot-top{display:flex;align-items:center;gap:10px;padding:8px 14px;height:52px;border-bottom:1px solid var(--sep);background:var(--bar-bg)}.boot-top .logo-s{width:34px;height:34px;border-radius:11px}
  .boot-main{padding:14px 16px}.boot-tabs{display:flex;align-items:center;justify-content:space-between;position:fixed;left:12px;right:12px;bottom:var(--nav-gap);height:var(--nav-h);border-radius:999px;background:var(--nav-bg);border:1px solid var(--nav-line);box-shadow:var(--nav-shadow);padding:8px 25px}.boot-tabs i{width:22px;height:22px;border-radius:7px;background:var(--nav-ic);opacity:.35}.boot-tabs i:first-child{width:98px;height:44px;margin-left:-17px;border-radius:999px;background:var(--nav-on-bg);opacity:1}}
.logo-s{width:38px;height:38px;border-radius:12px;background:var(--logo-tile) url(/logo-mark.png) center/64% no-repeat;display:grid;place-items:center;font-size:0;color:transparent;flex:none;box-shadow:0 1px 3px rgba(0,0,0,.12),inset 0 0 0 1px rgba(0,0,0,.04)}   /* Cedric's own Sofo mark (the favicon) on a white tile, like the app icon; the old "S" letter is hidden */

/* ── glass, cards ── */
.gl{background-color:var(--glass);background-image:var(--sheen);border:1px solid var(--line);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);border-radius:var(--r);box-shadow:var(--hi),var(--shadow)}
.card{padding:20px;display:flex;flex-direction:column;gap:12px;min-width:0}
.card-h{display:flex;flex-wrap:wrap;gap:8px 12px;justify-content:space-between;align-items:center}
.card-h h2{font-size:17px;font-weight:800}
.card-r{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.hero{border-radius:22px;padding:22px;color:var(--hero-text);background:var(--hero);display:flex;flex-direction:column;gap:12px;box-shadow:var(--hero-shadow)}
.hero .k{font-size:13px;color:var(--hero-muted)}
.hero .v{font-size:32px;font-weight:800;letter-spacing:-.02em;line-height:1.1}
.hero .v2{font-size:22px;font-weight:800}
.bar{height:10px;border-radius:999px;background:var(--hero-track);overflow:hidden}
.bar>i{display:block;height:100%;border-radius:999px;background:var(--hero-fill);animation:grow 1.1s cubic-bezier(.2,.7,.2,1) both}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:12px;border-radius:var(--r2);background:var(--glass-2);box-shadow:var(--edge);min-width:0}
.row .grow{flex:1 1 180px;min-width:0}
.row b{font-weight:700}
.note{font-size:13px;color:var(--muted)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:14px}
.kv span{color:var(--muted)}
.cols{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start}
.col{flex:1 1 440px;min-width:0;display:flex;flex-direction:column;gap:16px}
.col.side-c{flex:1 1 320px}
.divider{height:1px;background:var(--sep);margin:4px 0}

/* ── buttons ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 17px;border-radius:12px;border:0;background:var(--orange);color:var(--ink);font-weight:700;font-size:14px;white-space:nowrap;box-shadow:var(--btn-shadow);transition:background .15s,transform .1s}
.btn:hover{background:var(--orange-h);color:var(--ink)}
.btn:active{transform:scale(.98)}
.btn.ghost{background:var(--glass-hover);color:var(--text);box-shadow:var(--edge)}.btn.ghost:hover{background:var(--glass-press)}
.btn.inv,.mini.inv{background:var(--inv);color:var(--on-inv);box-shadow:none}.btn.inv:hover,.mini.inv:hover{background:var(--inv);color:var(--on-inv);filter:brightness(1.12)}
.btn.white{background:var(--hero-btn);color:var(--hero-btn-text);box-shadow:none}.btn.white:hover{background:var(--hero-btn-h);color:var(--hero-btn-text)}
.btn.glass{background:var(--hero-glass);color:var(--hero-text);box-shadow:inset 0 0 0 1px var(--hero-line)}.btn.glass:hover{background:var(--hero-glass-h);color:var(--hero-text)}
.btn.danger{background:var(--bad-bg);color:var(--bad);box-shadow:none}.btn.danger.armed,.mini.r.armed{background:var(--bad-solid);color:var(--on-bad)}
.chip{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:9px 15px;border-radius:999px;background:var(--glass-2);border:1px solid var(--line);color:var(--text);font-weight:600;font-size:13.5px;white-space:nowrap}
.chip:hover{background:var(--glass-press);color:var(--text-strong)}
.chip.on{background:var(--sel);border-color:var(--sel);color:var(--on-sel)}
.mini{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 12px;border:0;border-radius:10px;background:var(--glass-hover);box-shadow:var(--edge);color:var(--text);font-weight:600;font-size:13px;white-space:nowrap}
.mini:hover{background:var(--glass-press);color:var(--text-strong)}
.mini.o{background:var(--accent-bg);color:var(--accent-2);box-shadow:none}.mini.o:hover{background:var(--accent-bg-2);color:var(--accent-2)}
.mini.r{background:var(--bad-bg);color:var(--bad);box-shadow:none}
.mini .ic{width:16px;height:16px}
.pill{display:inline-flex;align-items:center;gap:6px;border:0;min-height:36px;padding:7px 13px;border-radius:999px;font-weight:600;font-size:13px;background:var(--glass-hover);box-shadow:var(--edge);color:var(--text)}
.pill.on{background:var(--sel);color:var(--on-sel);box-shadow:none}
.pill .n{opacity:.82;font-weight:700}
.iconb{width:44px;height:44px;border-radius:50%;border:0;background:var(--glass-hover);box-shadow:var(--edge);color:var(--text);display:grid;place-items:center;flex:none}
.iconb:hover{background:var(--glass-press)}
.vclose{width:44px;height:44px;border-radius:50%;border:0;background:var(--glass-hover);box-shadow:var(--edge);color:var(--text);display:grid;place-items:center;flex:none}
.stp{display:inline-flex;align-items:center;gap:4px;border:0;min-height:30px;padding:5px 11px;border-radius:999px;font-weight:700;font-size:12.5px;white-space:nowrap}
.stp.big{min-height:36px;padding:7px 14px;font-size:13.5px}
button.stp{min-height:36px}
.stp .ic{width:13px;height:13px}
.tag{display:inline-flex;align-items:center;gap:6px;padding:5px 11px;border-radius:999px;font-weight:700;font-size:13px;white-space:nowrap}
.brandtag{font-size:12px;font-weight:700}
.badge{min-width:20px;padding:2px 7px;border-radius:999px;background:var(--orange);color:var(--ink);font-size:11px;font-weight:800;text-align:center;margin-left:auto}
.av{border-radius:50%;color:var(--av-ink);box-shadow:var(--av-ring);display:inline-grid;place-items:center;font-weight:800;flex:none}
.av.me{width:36px;height:36px;background:var(--av-1);font-size:13px}
.ib{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--accent-bg);color:var(--accent);flex:none}
.ptile{display:inline-block;flex:none;border-radius:14px;overflow:hidden;background:var(--panel2);border:1px solid var(--line);box-shadow:var(--tile-shadow)}
.ptile img{width:100%;height:100%;object-fit:cover;display:block}
.ptile.white{background:var(--white-tile)}.ptile.white img{object-fit:contain;padding:5px}
.ptile.icon{display:inline-grid;place-items:center;background:var(--accent-bg);color:var(--accent);box-shadow:none}

/* ── app layout ── */
.app{display:flex;gap:20px;align-items:flex-start;padding:20px;min-height:100vh}
.side{position:sticky;top:20px;width:var(--side);flex:none;height:calc(100vh - 40px);padding:18px 12px 12px;display:flex;flex-direction:column;gap:14px}
.brand{display:flex;align-items:center;gap:11px;padding:2px 6px;color:var(--text)}
.brand b{display:block;font-weight:800;font-size:15px}.brand small{display:block;font-size:12px;color:var(--muted)}
.brand:hover{color:var(--text)}
.search-b{justify-content:space-between;border-radius:12px;width:100%}
.search-b>span{display:inline-flex;gap:8px;align-items:center}
kbd{font:600 11px var(--font);padding:3px 7px;border-radius:6px;background:var(--glass-hover);color:var(--muted)}
.side-scroll{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:10px;margin:0 -4px;padding:0 4px;scrollbar-width:thin;scrollbar-color:var(--line-2) transparent}
.navg{display:flex;flex-direction:column;gap:2px}
.navg-items{display:flex;flex-direction:column;gap:2px}.navg-items[hidden]{display:none}
.grp{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:32px;padding:6px 12px;border:0;border-radius:10px;background:none;font:600 12px var(--font);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.grp:hover{color:var(--text)}
.nav{display:flex;align-items:center;gap:11px;min-height:40px;padding:8px 12px;border-radius:12px;color:var(--text);font-size:14px;font-weight:500}
.nav:hover{background:var(--glass-hover);color:var(--text)}
.nav.on{background:var(--accent-bg);color:var(--accent-2);font-weight:600}
.side-foot{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:var(--glass-2)}
.side-foot b{display:block;font-size:14px}
.sync{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);white-space:nowrap}
.sync .dot{width:8px;height:8px;border-radius:50%;background:var(--ok-dot);box-shadow:0 0 8px var(--ok-dot)}
.sync.saving .dot,.sync.loading .dot{background:var(--orange);box-shadow:0 0 8px var(--orange);animation:pulse 1s infinite}
.sync.offline .dot,.sync.error .dot{background:var(--bad-dot);box-shadow:none}
.main{flex:1;min-width:0}
.screen{min-width:0;display:flex;flex-direction:column;gap:16px;padding-bottom:40px}
.screen-in{display:flex;flex-direction:column;gap:16px;min-width:0}
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:10px;justify-content:space-between;padding:calc(8px + var(--safe-t)) 14px 8px;background:var(--bar-bg);backdrop-filter:blur(16px) saturate(1.4);-webkit-backdrop-filter:blur(16px) saturate(1.4);border-bottom:1px solid var(--sep)}
.topbar .brand{padding:0}.topbar .logo-s{width:34px;height:34px;border-radius:11px}
.topbar .sync{margin-left:auto}
.tabbar{position:fixed;z-index:40;left:12px;right:12px;bottom:var(--nav-gap);height:var(--nav-h);padding:6px;display:flex;align-items:center;justify-content:space-between;gap:4px;border-radius:999px;background:var(--nav-bg);border:1px solid var(--nav-line);box-shadow:var(--nav-shadow)}
nav.tabbar .tab{flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:0;height:44px;min-width:46px;padding:0 13px;border-radius:999px;color:var(--nav-ic);font-size:13.5px;font-weight:600;letter-spacing:.01em;position:relative;-webkit-tap-highlight-color:transparent;transition:background-color .3s var(--mo-out,ease),color .2s ease,padding .3s var(--mo-out,ease),gap .3s var(--mo-out,ease)}
.tab .tic{position:relative;display:flex}
.tab .ic{width:22px;height:22px}
nav.tabbar .tab > span:not(.tic):not(.tbadge){display:block;max-width:0;overflow:hidden;white-space:nowrap;opacity:0;transition:max-width .32s var(--mo-out,ease),opacity .2s ease}
nav.tabbar .tab.on,nav.tabbar.mo-pill.mo-pill-has .tab.on{background:var(--nav-on-bg);color:var(--nav-on);gap:8px;padding:0 18px 0 14px}
nav.tabbar .tab.on > span:not(.tic):not(.tbadge){max-width:96px;opacity:1}
.tab.on .ic{stroke-width:2.1;fill:currentColor;fill-opacity:.22}
nav.tabbar.mo-pill::before{content:none}
@media (hover:hover){nav.tabbar .tab:not(.on):hover{color:var(--nav-on)}}
html.mo-reduced nav.tabbar .tab,html.mo-reduced nav.tabbar .tab > span:not(.tic):not(.tbadge){transition:none}
.tbadge{position:absolute;top:-7px;left:12px;min-width:17px;padding:0 5px;border-radius:999px;background:var(--orange);color:var(--ink);font-size:10px;font-weight:800;line-height:16px;text-align:center;box-shadow:0 0 0 2px var(--nav-bg)}
.loading-screen{min-height:50vh;display:flex;gap:12px;align-items:center;justify-content:center;color:var(--muted);text-align:center;padding:20px}
.spin{width:22px;height:22px;border-radius:50%;border:3px solid var(--line-2);border-top-color:var(--orange);animation:spin .8s linear infinite}

/* ── page head, tabs ── */
.phead{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;justify-content:space-between}
.phead-l{min-width:0;flex:1 1 320px}
.phead h1{margin-top:6px;font-size:32px;font-weight:800;line-height:1.12;overflow-wrap:anywhere}
.phead .serif{font-size:1.06em}
.phead-r{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.crumbs{font-size:13px;color:var(--muted);display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.tabs{padding:6px;display:flex;gap:4px;border-radius:16px;overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.ctab{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:10px 16px;border-radius:12px;color:var(--text);font-size:14px;font-weight:600;white-space:nowrap;flex:none}
.ctab:hover{background:var(--glass-hover);color:var(--text-strong)}
.ctab.on{background:var(--sel);color:var(--on-sel)}
.ctab .badge{margin-left:2px}

/* ── form fields ── */
.fg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.fg3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.f{display:flex;flex-direction:column;gap:5px;min-width:0}
.f.wide{grid-column:1/-1}
.fl{font-size:12.5px;font-weight:600;color:var(--muted)}
.hint{font-size:12px;color:var(--faint)}
.in{width:100%;min-height:44px;padding:10px 12px;border-radius:11px;border:1px solid var(--line-2);background:var(--glass-in);color:var(--text);font-size:15px;font-weight:500}
.in:focus{outline:2px solid var(--focus);outline-offset:0;border-color:transparent}
.in::placeholder{color:var(--faint)}
textarea.in{resize:vertical;min-height:104px;line-height:1.45}   /* main 30 Nov: room for 4 lines from the start; ui.js growBox grows it with the words */
select.in{appearance:none;-webkit-appearance:none;padding-right:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FDBA74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:16px}
option{background:var(--panel2);color:var(--text)}
input[type=date].in{color-scheme:inherit;display:block;min-width:0;max-width:100%;-webkit-appearance:none;appearance:none;text-align:left}   /* iPhone gives date fields a fixed inner width: they ran off the sheet's right edge */
:root:not([data-theme=dark]) select.in{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B23E0C' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")}
.seg{display:flex;gap:4px;padding:4px;border-radius:12px;background:var(--glass-2);box-shadow:var(--edge)}
.seg button{flex:1;min-height:40px;border:0;padding:8px 10px;border-radius:9px;font-weight:600;font-size:14px;background:transparent;color:var(--text)}
.seg button.on{background:var(--sel);color:var(--on-sel)}
.toggle{display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer;font-size:14px}
.toggle input{position:absolute;opacity:0;width:1px;height:1px}
.toggle .tg{width:44px;height:26px;border-radius:999px;background:var(--line-2);position:relative;flex:none;transition:background .2s}
.toggle .tg:after{content:'';position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:var(--knob);box-shadow:var(--knob-shadow);transition:transform .2s}
.toggle input:checked+.tg{background:var(--orange)}
.toggle input:checked+.tg:after{transform:translateX(18px)}
.toggle input:focus-visible+.tg{outline:2px solid var(--orange);outline-offset:2px}
.toggle .tl small{display:block;font-size:12px;color:var(--faint)}
.savebar{position:fixed;z-index:45;left:calc(var(--side) + 40px);right:20px;bottom:20px;display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;padding:12px 14px 12px 18px;border-radius:16px;background:var(--glass-solid);border:1px solid var(--accent-line);box-shadow:var(--shadow-pop);animation:up .3s cubic-bezier(.2,.7,.2,1) both}
.savebar span{display:flex;gap:10px}

/* ── overlays: sheets, viewer, menu, toasts ── */
.scrim{position:fixed;inset:0;z-index:60;background:var(--scrim);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);display:flex;align-items:flex-start;justify-content:center;padding:6vh 20px 20px;overflow-y:auto;animation:fade .2s both}
.sheet{width:min(560px,100%);background:var(--glass-solid);border:1px solid var(--line);border-radius:22px;box-shadow:var(--hi),var(--shadow-pop);padding:20px;animation:pop .25s cubic-bezier(.2,.7,.2,1) both;position:relative}
.sheet.wide{width:min(880px,100%)}
.scrim.v{padding:16px;align-items:center}
.scrim.closing{pointer-events:none}
.sheet.viewer-s{width:min(940px,100%);padding:0;overflow:hidden;max-height:calc(100vh - 32px);display:flex}
.scrim.m{justify-content:flex-end;padding:70px 24px 24px}
.sheet.menu-s{width:360px;padding:14px;max-height:calc(100vh - 100px);overflow-y:auto}
.sheet-h{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;margin-bottom:12px}
.sheet-h h2{font-size:20px;font-weight:800;margin-top:2px}
.sheet-f{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end;margin-top:16px}
.sheet-body{display:flex;flex-direction:column;gap:12px}
.demo-note{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-radius:12px;background:var(--info-bg);color:var(--info);font-size:13px;line-height:1.45;margin:4px 0 12px}
.demo-note .ic{color:var(--info);margin-top:1px}
.msgp{display:flex;flex-direction:column}
.msg-to{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;padding:8px 0;border-bottom:1px solid var(--sep);font-size:14px}
.msg-to .lbl{min-width:58px}
.bubble-wrap{margin-top:12px;padding:12px;border-radius:16px;display:flex;flex-direction:column;gap:10px}
.bubble-wrap.wa{background-color:var(--wa-bg);background-image:radial-gradient(circle at 4px 4px,var(--wa-dot) 1px,transparent 1.6px);background-size:40px 40px}
.bubble-wrap.mail{background:var(--glass-2);border:1px solid var(--line)}
.bubble{width:100%;border:0;border-radius:12px;padding:10px 12px;font-size:15px;line-height:1.5;resize:vertical;min-height:120px}
.wa .bubble{background:var(--wa-bubble);color:var(--wa-text);border-top-right-radius:4px}
.mail .bubble{background:transparent;color:var(--text)}
.msg-att{display:flex;flex-wrap:wrap;gap:8px}
.att-ph{width:92px;height:92px;border-radius:10px;overflow:hidden;display:block}.att-ph img{width:100%;height:100%;object-fit:cover}
.att-f{display:inline-flex;gap:6px;align-items:center;padding:8px 10px;border-radius:10px;background:var(--glass-hover);font-size:13px}
.bigphone{font-size:30px;font-weight:800;letter-spacing:-.01em;margin:6px 0}
.viewer{display:flex;flex-direction:column;width:100%;min-height:0}
.viewer-h{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--sep)}
.viewer-t{flex:1 1 200px;min-width:0}.viewer-t b{display:block;font-size:16px;font-weight:800}.viewer-t span{display:block;font-size:12.5px;color:var(--muted)}
.viewer-a{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.vb{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:0 15px;border:0;border-radius:12px;background:var(--glass-hover);box-shadow:var(--edge);color:var(--text);font-weight:700;font-size:13.5px}
.vb:hover{background:var(--glass-press);color:var(--text-strong)}
.vb.pri{background:var(--orange);color:var(--ink);box-shadow:none}
.viewer-b{flex:1;min-height:0;overflow-y:auto;padding:16px;background:var(--viewer-bg)}
.docframe{position:relative;width:100%;max-width:794px;margin:0 auto;overflow:hidden;border-radius:8px}
.docframe iframe{position:absolute;left:0;top:0;border:0;transform-origin:0 0;background:var(--paper-bg)}
.docframe{box-shadow:var(--doc-shadow)}
.vphoto{position:relative;display:flex;justify-content:center;align-items:center;min-height:300px;touch-action:pan-y;overflow:hidden}
.viewer-b:has(.vphoto){touch-action:pan-y}   /* sideways moves = next/previous photo (ui.js Viewer) */
.vphoto img{will-change:transform;-webkit-user-drag:none;user-select:none;-webkit-touch-callout:none}
.vphoto img{max-width:100%;max-height:calc(100vh - 150px);border-radius:10px;display:block}
.vnav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:50%;border:0;background:var(--photo-chip);color:var(--on-photo);display:grid;place-items:center}
.vnav.l{left:8px}.vnav.r{right:8px}
.vcount{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);padding:4px 10px;border-radius:999px;background:var(--photo-chip);color:var(--on-photo);font-size:12px}
.dthumb{display:inline-flex;flex-direction:column;gap:6px;padding:0;border:0;background:none;color:var(--text);text-align:left;cursor:zoom-in;flex:none}
.dthumb-p{position:relative;display:block;width:100%;border-radius:10px;overflow:hidden;background:var(--white-tile);box-shadow:var(--doc-shadow);border:1px solid var(--line)}
.dthumb-p iframe{position:absolute;left:0;top:0;border:0;transform-origin:0 0;pointer-events:none;background:var(--white-tile)}
.dthumb.big .dthumb-p{border-radius:12px}
.dthumb:hover .dthumb-p{box-shadow:var(--doc-shadow),0 0 0 2px var(--accent-line)}
.dzoom{position:absolute;right:8px;bottom:8px;padding:5px 11px;border-radius:999px;background:var(--photo-chip);color:var(--on-photo);font-weight:700;font-size:12px}
.dthumb:not(.big) .dzoom{display:none}
.dlock{position:absolute;inset:0;display:grid;place-items:center;background:var(--photo-chip);color:var(--on-photo)}
.dthumb-t{font-size:13px;font-weight:700;padding:0 2px;line-height:1.3;overflow-wrap:anywhere}
.dthumb-s{font-size:12px;color:var(--muted);padding:0 2px;margin-top:-4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu .sheet-h{margin-bottom:6px}
.menu-groups{display:flex;flex-direction:column;gap:10px}
.menu-g .lbl{padding:4px 4px 6px}
.menu-list{padding:4px;border-radius:16px}
.mi{display:flex;align-items:center;gap:12px;width:100%;min-height:46px;padding:8px 10px;border:0;border-radius:11px;background:none;color:var(--text);font-weight:600;font-size:14.5px;text-align:left}
.mi:hover{background:var(--glass-hover)}
.mi .ic{color:var(--accent)}
.mi .mi-t{flex:1;min-width:0}.mi small{display:block;font-weight:500;font-size:12px;color:var(--faint)}
.mi.danger,.mi.danger .ic{color:var(--bad)}
.mi.armed{background:var(--bad-solid);color:var(--on-bad)}.mi.armed .ic{color:var(--on-bad)}
.toasts{position:fixed;z-index:80;right:24px;bottom:24px;display:flex;flex-direction:column;gap:8px;align-items:flex-end;pointer-events:none}
.toast{pointer-events:auto;display:flex;align-items:center;gap:12px;max-width:min(520px,calc(100vw - 28px));padding:11px 12px 11px 16px;border-radius:14px;background:var(--glass-solid);border:1px solid var(--line);color:var(--text);font-weight:700;font-size:14px;box-shadow:var(--hi),var(--shadow-pop);animation:up .3s cubic-bezier(.2,.7,.2,1) both}
.toast>.ic{color:var(--ok-dot)}.toast.info>.ic{color:var(--accent)}.toast.bad>.ic{color:var(--bad)}
.toast span{flex:1;min-width:0}
.tundo{min-height:36px;padding:6px 14px;border:0;border-radius:999px;background:var(--orange);color:var(--ink);font-weight:800;font-size:13px;flex:none}
.tundo.ghost{background:var(--glass-press);box-shadow:var(--edge);color:var(--text)}
.search{display:flex;flex-direction:column;gap:8px;margin:-6px}
.search-in{display:flex;align-items:center;gap:10px;padding:6px 8px 10px;border-bottom:1px solid var(--line)}
.search-in input{flex:1;min-width:0;min-height:44px;background:transparent;border:0;color:var(--text);font:600 18px var(--font);outline:none}
.search-res{max-height:60vh;overflow-y:auto;display:flex;flex-direction:column;gap:2px}
.sr{display:flex;gap:12px;align-items:center;min-height:48px;padding:8px 12px;border-radius:12px;color:var(--text)}
.sr.on{background:var(--accent-bg);color:var(--text-strong)}
.sr-k{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);min-width:70px}
.sr-t{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sr-m{font-size:12px;color:var(--muted);white-space:nowrap}
.search-hint{padding:18px 12px;display:flex;flex-direction:column;gap:4px;color:var(--muted)}.search-hint b{color:var(--text)}

/* ── empty, skeleton, placeholder ── */
.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:26px 16px;color:var(--muted)}
.empty b{color:var(--text);font-size:16px}.empty p{margin:0;max-width:44ch;font-size:14px}
.empty-i{width:54px;height:54px;border-radius:16px;display:grid;place-items:center;background:var(--accent-bg);color:var(--accent);margin-bottom:4px}
.skel{display:block;background:linear-gradient(90deg,var(--skel),var(--skel-hi),var(--skel));background-size:200% 100%;animation:shimmer 1.2s infinite}
.ph-grid{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start}
.ph-card{flex:2 1 420px;padding:26px;gap:10px;background:radial-gradient(420px 260px at 100% 0%, var(--accent-bg), transparent 70%), var(--glass)}
.ph-card h2{font-size:24px;font-weight:800}
.ph-ic{width:60px;height:60px;border-radius:18px;display:grid;place-items:center;background:var(--logo);color:var(--ink);margin-bottom:6px}
.ph-list{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.ph-list li{display:flex;gap:10px;align-items:flex-start;font-size:15px}
.ph-list .ic{color:var(--ok-dot);margin-top:2px}
.ph-grid>.card:not(.ph-card){flex:1 1 300px}
.ph-links{display:flex;flex-direction:column;gap:6px}
.ph-link{display:flex;align-items:center;gap:12px;min-height:52px;padding:8px 12px;border-radius:14px;background:var(--glass-2);box-shadow:var(--edge);color:var(--text);font-weight:600}
.ph-link:hover{background:var(--glass-hover);color:var(--text-strong)}
.ph-link span:nth-child(2){flex:1}

/* ═════════ screens ═════════ */
.grow{flex:1 1 180px;min-width:0}
.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:100%}
.clamp2{display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line}
.two{display:flex;gap:8px;min-width:0}.two .in{flex:1;min-width:0}
.pills{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.pill.big{min-height:44px;padding:9px 15px}
.searchbox{flex:1 1 280px;min-width:0;display:flex;align-items:center;gap:10px;min-height:46px;padding:0 6px 0 14px;border-radius:12px;border:1px solid var(--line-2);background:var(--glass-in)}
.searchbox:focus-within{outline:2px solid var(--focus);border-color:transparent}
.searchbox input{flex:1;min-width:0;background:transparent;border:0;outline:none;font-size:15px;min-height:44px}
.searchbox input::placeholder{color:var(--faint)}
.xbtn{width:36px;height:36px;border:0;border-radius:50%;background:var(--glass-hover);display:grid;place-items:center}
.warnbox,.lockbox{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:12px 14px;border-radius:14px;background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn);font-size:14px}
.warnbox span{flex:1 1 220px}.lockbox{background:var(--bad-bg);border-color:var(--bad-line);color:var(--bad)}.lockbox span{flex:1}
.quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:-4px}
.in-big{font-size:22px!important;font-weight:800!important}
.mono{font-family:ui-monospace,'Cascadia Mono',Consolas,monospace;font-size:13.5px!important;line-height:1.5}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px;max-height:46vh;overflow-y:auto;padding:2px}
.pcard{display:flex;align-items:center;gap:12px;min-height:64px;padding:6px 10px 6px 6px;border-radius:14px;border:1px solid var(--line);background:var(--glass-2);text-align:left}
.pcard:hover{background:var(--accent-bg);border-color:var(--accent-line)}
.pcard>span:not(.ptile){flex:1;min-width:0}.pcard .ic{color:var(--accent)}
.qty{display:inline-flex;align-items:center;gap:8px}.qty b{min-width:20px;text-align:center}
.payrow .toggle{min-height:36px}
/* all customers */
.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.kpi{padding:14px 16px;border-radius:18px;display:flex;flex-direction:column;gap:2px}
.kpi b{font-size:24px;font-weight:800;letter-spacing:-.02em}
.kpi b.due,.due{color:var(--bad)}
.kpi-s{font-size:12px;color:var(--muted)}
.filters{padding:14px;display:flex;flex-direction:column;gap:12px;border-radius:18px}
.frow{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.fsel{width:auto;min-width:150px;flex:none}
.views{display:flex;gap:6px;margin-left:auto}
.bulk-st{display:flex;flex-wrap:wrap;gap:6px}
.bulkbar{position:sticky;top:12px;z-index:20;display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px 14px;border-radius:16px;background:var(--glass-solid);border:1px solid var(--accent-line);box-shadow:var(--shadow-pop)}
.bulkbar .bl{font-size:13px;color:var(--muted)}
.bulk-r{display:flex;gap:6px;margin-left:auto}
.bulk-list{display:flex;flex-direction:column;gap:8px;max-height:52vh;overflow-y:auto}
.bulk-t{display:block;font-size:13.5px;margin-top:4px;color:var(--text)}
.ctable{padding:6px 6px 8px;border-radius:18px}
.ctable-in{overflow-x:auto}
.crow{display:grid;grid-template-columns:30px 108px minmax(160px,1.5fr) 120px minmax(110px,1fr) 134px 100px 96px 124px 92px 36px;gap:5px;align-items:center;min-height:56px;padding:6px 8px;border-radius:12px;min-width:1050px}
.crow.head{min-height:36px;font-size:11px}
.crow-w{border-top:1px solid var(--sep)}
.crow-w:hover>.crow{background:var(--glass-2)}
.crow-w.sel>.crow{background:color-mix(in srgb,var(--orange) 10%,transparent)}
.ck{display:grid;place-items:center;width:30px;height:44px;cursor:pointer}
.ck input{width:18px;height:18px;accent-color:var(--orange);cursor:pointer}
.ck.big input{width:22px;height:22px}
.c-cert{display:flex;flex-direction:column;min-width:0;font-size:12.5px}.c-cert b{font-weight:700}.c-cert span{font-size:11.5px;font-weight:600}
.c-cust{display:flex;flex-direction:column;gap:1px;min-width:0}
.cellb{display:block;max-width:100%;background:none;border:0;padding:4px 6px;margin:-2px -6px;border-radius:8px;text-align:left;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}
.cellb:hover{background:var(--glass-hover)}
.cellb.strong{font-weight:700;font-size:14.5px}.cellb.sub{font-size:12.5px;color:var(--muted)}
.cin{width:100%;min-width:0;padding:6px 8px;border-radius:8px;border:1px solid var(--orange);background:var(--glass-in);color:var(--text);font-weight:600;font-size:13.5px;outline:none}
.csel{width:100%;min-width:0;appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;border-radius:8px;padding:6px;font-size:13px;font-weight:500;cursor:pointer;color-scheme:inherit}
.csel:hover,.csel:focus{border-color:var(--line-2);outline:none}
.c-bal{font-size:13.5px;font-weight:700}.c-bal.due{color:var(--bad)}.c-bal.ok{color:var(--ok)}
.c-open{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:var(--accent-bg);color:var(--accent)}
.c-open:hover{background:var(--accent-bg-2);color:var(--accent-2)}
.st-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:2px 10px 12px 156px}
.st-row>span{font-size:12.5px;color:var(--muted);margin-right:4px}
.listfoot{display:flex;flex-wrap:wrap;gap:6px 16px;justify-content:space-between;font-size:12.5px;color:var(--muted);padding:0 4px}
@media (max-width:1560px) and (min-width:900px){.crow{grid-template-columns:30px 108px minmax(160px,1.5fr) 120px minmax(110px,1fr) 134px 100px 96px 124px 36px;min-width:0}.c-tech{display:none!important}}
@media (max-width:1320px) and (min-width:900px){.crow{grid-template-columns:30px 104px minmax(150px,1.6fr) minmax(104px,1fr) 132px 100px 94px 122px 36px}.c-dist{display:none!important}.st-row{padding-left:146px}}
.plist{display:flex;flex-direction:column;gap:8px}
.prow{display:flex;align-items:center;gap:8px;padding:8px 10px 8px 8px;border-radius:18px;background:var(--glass);border:1px solid var(--line);box-shadow:var(--hi),var(--shadow)}
.prow.sel{background:var(--accent-bg);border-color:var(--accent-line)}
.pr-tap{flex:1;min-width:0;display:flex;align-items:center;gap:12px;color:var(--text);background:none;border:0;padding:0;text-align:left;min-height:56px}
.pr-tap:hover{color:var(--text)}
.pr-main{flex:1;min-width:0;display:flex;flex-direction:column}
.pr-main b{font-size:15px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pr-sub,.pr-sys{font-size:12.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pr-sys span{font-weight:700}
.pr-r{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.pr-amt{font-size:12.5px;font-weight:700;color:var(--muted);white-space:nowrap}.pr-amt.due{color:var(--bad)}
.st-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.st-opt{display:flex;align-items:center;gap:10px;min-height:52px;padding:10px 14px;border-radius:14px;border:1px solid var(--line);background:var(--glass-2);font-weight:700;font-size:15px;color:var(--c);text-align:left}
.st-opt .dot{width:10px;height:10px;border-radius:50%;background:var(--c);flex:none}
.st-opt.on{background:var(--b);border-color:var(--c)}.st-opt .ic{margin-left:auto}
/* customer card */
.sibs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}.sibs .pill{flex:none;min-height:40px}
.steps{display:flex;flex-wrap:wrap;gap:8px;padding:14px 18px;border-radius:18px}
.step{flex:1 1 110px;display:flex;align-items:center;gap:10px;min-width:0}
.step b{display:block;font-size:13px}.step small{display:block;font-size:11.5px;color:var(--muted);white-space:nowrap}
.step-m{width:28px;height:28px;flex:none;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:800;background:var(--glass-hover);box-shadow:var(--edge);color:var(--accent)}
.step.done .step-m{background:var(--orange);color:var(--ink)}
.step.now .step-m{background:var(--accent-bg-2);box-shadow:0 0 0 4px var(--accent-bg)}
.row.line{flex-wrap:nowrap}.row.line .grow b{font-size:14.5px;line-height:1.3}.row.line>b.t{white-space:nowrap}
.docrow{display:flex;flex-wrap:wrap;gap:14px;padding-top:4px}
.hero-top{display:flex;flex-wrap:wrap;justify-content:space-between;gap:16px}
.hero-2{display:flex;gap:26px}
.hero-b{display:flex;flex-wrap:wrap;gap:8px}
.feed{display:flex;flex-direction:column}
.fe{display:flex;gap:14px}
.fe-l{display:flex;flex-direction:column;align-items:center;width:10px;flex:none}
.fe-l i{width:10px;height:10px;margin-top:5px;border-radius:50%;flex:none}
.fe-l:after{content:'';flex:1;width:2px;background:var(--ch-track);margin-top:2px}
.fe:last-child .fe-l:after{display:none}
.fe>span:last-child{padding-bottom:14px;min-width:0}
.fe b{display:block;font-size:14px}.fe small{display:block;font-size:12.5px;color:var(--muted)}
.who{display:flex;gap:12px;align-items:center;min-width:0}
.who b{display:block;font-weight:800;overflow-wrap:anywhere}.who small{display:block;font-size:12.5px;color:var(--muted)}
.who.sm b{font-weight:700;font-size:14px}
.chips3{display:flex;flex-wrap:wrap;gap:8px}.chips3 .chip{flex:1 1 90px;justify-content:center}
.phgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.phbtn{position:relative;display:block;width:100%;aspect-ratio:4/3;padding:0;border:0;border-radius:12px;overflow:hidden;cursor:zoom-in;background:var(--panel2);box-shadow:var(--tile-shadow)}
.phbtn img{width:100%;height:100%;object-fit:cover;display:block}
.phbtn>span{position:absolute;left:8px;bottom:8px;padding:2px 8px;border-radius:999px;background:var(--photo-chip);font-size:11.5px;color:var(--on-photo)}
.phcell{position:relative}
.star,.phdel{position:absolute;top:6px;width:36px;height:36px;border:0;border-radius:10px;background:var(--photo-chip);display:grid;place-items:center;font-size:17px}
.star{left:6px;color:var(--star)}.star.on{background:var(--orange);color:var(--ink)}
.phdel{right:6px;color:var(--photo-bad)}
.mapbox{position:relative;border-radius:14px;overflow:hidden;background:var(--map-bg);border:1px solid var(--line);box-shadow:var(--tile-shadow)}
.mapbox-in{position:absolute;inset:0}
.mapbox-err{position:absolute;inset:0;display:grid;place-items:center;padding:16px;text-align:center;font-size:13px;color:var(--muted)}
.mapbox .leaflet-tile{filter:var(--map-tiles)}
.mapbox .leaflet-container{background:var(--map-bg);font-family:var(--font)}
.mapbox .leaflet-control-zoom a{background:var(--glass-solid);color:var(--text);border-color:var(--sep)}
.mapbox .leaflet-control-attribution{background:var(--glass-solid);color:var(--muted);font-size:10px}.mapbox .leaflet-control-attribution a{color:var(--muted)}
.sofo-pin{background:none;border:0;filter:var(--pin-shadow)}
.lines{display:flex;flex-direction:column;gap:8px}
.lrow{display:grid;grid-template-columns:44px minmax(0,1fr) 132px 110px 104px 40px;gap:8px;align-items:center}
.l-q{display:flex;align-items:center;gap:4px}.l-q .in{text-align:center;padding:10px 4px}.l-q .mini{min-height:40px;min-width:36px;padding:0}
.l-a{text-align:right;white-space:nowrap}.l-x{min-height:40px;min-width:40px;padding:0}
.lfoot{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between}
.ltot{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.ltot b{font-size:18px}
.tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.tagx{display:inline-flex;align-items:center;gap:6px;padding:4px 4px 4px 12px;border-radius:999px;background:var(--glass-hover);box-shadow:var(--edge);font-size:13px;font-weight:600}
.tagx button{width:28px;height:28px;border:0;border-radius:50%;background:var(--glass-press);display:grid;place-items:center}
.bigdocs{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.bigdoc{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:16px;background:var(--glass-2);box-shadow:var(--edge);align-items:flex-start}
.bigdoc .dthumb{width:100%!important}
.bd-a{display:flex;flex-wrap:wrap;gap:6px}
.nodoc{width:100%;min-height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:1px dashed var(--line-2);border-radius:12px;color:var(--muted)}
.nodoc b{color:var(--text)}
.unitgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px}
.unitgrid .row{color:var(--text)}.unitgrid .row.cur{border:1px solid var(--accent-line)}
.payline{flex-wrap:nowrap;align-items:center}
.payline .dthumb-p{border-radius:6px;box-shadow:none}
.okt{display:inline-block;font-size:12px;font-weight:700;color:var(--ok);margin-top:2px}
.pa{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.docline .dthumb-p{border-radius:6px;box-shadow:none}
.msgrow{align-items:flex-start;flex-wrap:nowrap}
.chn{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;flex:none;background:var(--ok-bg);color:var(--ok)}
.chn.mail{background:var(--info-bg);color:var(--info)}.chn.team{background:var(--accent-bg);color:var(--accent)}
.danger-card{border-color:var(--bad-line)}.danger-card h2{color:var(--bad)}
.wgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.svc{align-items:flex-start}
.svc-h{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.svc-t{display:block;font-size:14px;margin-top:4px}
.hrow{align-items:flex-start;flex-wrap:nowrap}
.hrow.undone{opacity:.62}
.h-t{display:block;font-size:14.5px}
.h-c{display:block;font-size:13.5px;margin-top:2px;overflow-wrap:anywhere}.h-c s{color:var(--muted)}
.undone-t{font-size:12.5px;font-weight:700;color:var(--accent);padding:8px 4px;white-space:nowrap}
.cmp{align-items:center}
.cmp-v{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:6px;font-size:13.5px;overflow-wrap:anywhere}
.cmp-v small{display:block;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.cmp-v span:first-child{color:var(--muted)}
/* more, help, checklist, settings */
.more-g{display:flex;flex-direction:column;gap:6px}
.more-list{padding:2px 14px;border-radius:18px}
.more-it{display:flex;align-items:center;gap:12px;min-height:52px;border-bottom:1px solid var(--sep);color:var(--text);font-weight:600;font-size:15px}
.more-it:last-child{border-bottom:0}.more-it:hover{color:var(--text-strong)}
.more-me{display:flex;align-items:center;gap:12px;padding:14px 16px;color:var(--text)}
.more-me b{display:block}.more-me small{display:block;font-size:12.5px;color:var(--muted)}
.bigtxt{font-size:20px;font-weight:800;letter-spacing:-.01em}
.check-top{flex-direction:row;flex-wrap:wrap;align-items:center;gap:18px}
.cstats{display:flex;gap:8px}
.cstat{min-width:86px;min-height:64px;padding:8px 12px;border-radius:14px;border:1px solid var(--line);background:var(--glass-2);display:flex;flex-direction:column;align-items:center;justify-content:center}
.cstat b{font-size:22px;font-weight:800;color:var(--c)}.cstat span{font-size:12px;color:var(--muted);font-weight:600}
.cstat.on{background:var(--b);border-color:var(--c)}
.ck-row{flex-wrap:nowrap;align-items:flex-start}.ck-row .stp{min-width:64px;justify-content:center;margin-top:1px}
.help-hero{flex-direction:row;align-items:center;gap:16px;color:var(--text)}
.help-hero:hover{color:var(--text);background:var(--glass-hover)}
.binrow{flex-wrap:nowrap}

/* ── motion ── */
/* decorative motion (opening reveal, page and list entries, press feedback) lives in motion.css (Builder 3) */
@keyframes up{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
@keyframes pop{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
@keyframes sheetup{from{transform:translateY(100%)}to{transform:none}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes grow{from{width:0}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pulse{50%{opacity:.4}}
@keyframes shimmer{to{background-position:-200% 0}}
/* reduced motion, unless this device chose "Animations: always on" (html.mo-on, set by motion.js) */
@media (prefers-reduced-motion:reduce){html:not(.mo-on) *,html:not(.mo-on) *:before,html:not(.mo-on) *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}

/* ── phone ── */
@media (max-width:899px){
  body{font-size:15.5px}
  .app{display:block;padding:0}
  .topbar{position:fixed;left:0;right:0;top:0}   /* pinned like an iPhone app: the pen (fixed), the bell and search never drift apart when iOS bounces the page */
  .main{padding-top:calc(var(--safe-t) + 61px)}
  .topbar .sync{font-size:0;gap:0;padding:6px;margin-left:auto}   /* the phone bar keeps only the coloured dot (green saved · orange saving · red offline); the words stay in title + role=status */
  .topbar .sync .dot{width:9px;height:9px}
  @media (max-width:359px){html:has(.topbar .backb) .topbar .sync{display:none}}   /* the smallest phones: Back + pen leave no room for the dot */
  .screen{padding:14px 16px calc(var(--nav-top) + 22px);gap:14px}
  .phead h1{font-size:26px}
  .phead-r{width:100%}
  .card{padding:16px}
  .fg,.fg3{grid-template-columns:minmax(0,1fr)}
  .in{font-size:16px}
  .scrim:not(.v){padding:0;align-items:flex-end}
  .sheet{width:100%;border-radius:26px 26px 0 0;max-height:92vh;max-height:calc(100dvh - var(--safe-t) - 8px);overflow-y:auto;padding:16px 16px calc(22px + var(--safe-b));animation:sheetup .32s cubic-bezier(.2,.7,.2,1) both}
  .sheet:before{content:'';display:block;width:40px;height:5px;border-radius:999px;background:var(--handle);margin:-4px auto 12px}
  .scrim.m{padding:0}
  .sheet.menu-s{width:100%;max-height:84vh;max-height:calc(100dvh - var(--safe-t) - 56px);padding:14px 14px calc(22px + var(--safe-b))}   /* dvh = the screen really visible on the iPhone: the menu's last items can always be scrolled into view */
  .scrim.v{padding:0}
  .sheet.viewer-s{width:100%;height:100%;max-height:none;border-radius:0;animation:fade .2s both}
  .sheet.viewer-s:before{display:none}
  .viewer-h{padding:calc(10px + var(--safe-t)) 12px 10px}
  .viewer-a{width:100%}
  .viewer-a .vb{flex:1 1 auto;justify-content:center;padding:0 10px;white-space:nowrap;font-size:13px}.viewer-a .vb .ic{display:none}
  .viewer-a .vclose{position:absolute;right:10px;top:calc(8px + var(--safe-t))}
  .viewer-t{padding-right:50px}
  .viewer-b{padding:10px}
  .toasts{left:12px;right:12px;bottom:calc(var(--nav-top) + 10px);align-items:stretch}
  .toast{max-width:none}
  .savebar{left:10px;right:10px;bottom:calc(var(--nav-top) + 8px);padding:10px 10px 10px 14px}
  .savebar b{font-size:14px}
  .savebar span{margin-left:auto}
  .savebar .btn{min-height:42px;padding:8px 14px}
  .chip{min-height:44px}
  .sr-m{display:none}
  .brandpills{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -10px;padding:0 10px}.brandpills::-webkit-scrollbar{display:none}.brandpills .pill{flex:none}
  .tabs{padding:4px;gap:2px}.ctab{flex:1 1 auto;justify-content:center;padding:8px 9px;font-size:13.5px}
  .row.line .grow b{font-size:13.5px}
  .kpis{gap:8px}.kpi{padding:10px 12px}.kpi b{font-size:17px}.kpi .lbl{font-size:10.5px;letter-spacing:.05em}
  .filters{padding:10px}
  .frow{gap:8px}.fsel{flex:1 1 140px;min-width:0}
  .searchbox{flex-basis:100%}
  .bulkbar{position:fixed;top:auto;left:10px;right:10px;bottom:calc(var(--nav-top) + 8px);z-index:44}
  .bulk-r{margin-left:0;width:100%}.bulk-r .pill{flex:1;justify-content:center;min-height:42px}
  .bulk-st{width:100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.bulk-st::-webkit-scrollbar{display:none}.bulk-st .stp{flex:none}
  .st-grid{grid-template-columns:minmax(0,1fr)}
  .steps{padding:10px 12px;gap:6px 4px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .step{gap:7px}.step b{font-size:12.5px}.step small{font-size:11px}.step-m{width:24px;height:24px}
  .hero{padding:18px;border-radius:20px}.hero .v{font-size:26px}.hero .v2{font-size:18px}.hero-2{gap:18px}
  .hero-b .btn{flex:1 1 140px}
  .lrow{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px;border-radius:14px;background:var(--glass-2);box-shadow:var(--edge)}
  .lrow>.ptile{order:1}.lrow .l-name{order:2;flex:1 1 calc(100% - 112px);min-width:0}.lrow .l-x{order:3}
  .lrow .l-q{order:4}.lrow .l-q .in{width:58px;flex:none}.lrow .l-p{order:5;flex:1 1 70px;min-width:0}.lrow .l-a{order:6;flex:none;font-size:14px}
  .lfoot,.ltot{width:100%}.ltot{justify-content:space-between}
  .wgrid{grid-template-columns:minmax(0,1fr)}
  .payline{flex-wrap:wrap}.payline .pa{width:100%;justify-content:flex-start;padding-left:58px}
  .svc .pa{width:100%;justify-content:flex-start}
  .hrow{flex-wrap:wrap}.hrow .mini{margin-left:48px}
  .phead-r .btn{flex:1 1 auto}
  .card-screen .phead-r{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .check-top{gap:12px}.cstats{width:100%}.cstat{flex:1}
  .docrow{gap:10px}
  .pgrid{grid-template-columns:minmax(0,1fr);max-height:40vh}
  .cmp-v{grid-template-columns:minmax(0,1fr)}
}
@media (min-width:900px) and (max-width:1180px){ :root{--side:232px} .app{gap:16px;padding:16px} }

/* ── sidebar: its own glass (light: rosy terracotta, light text, white active pill) ── */
.side.gl{background:var(--side-bg);border-color:var(--side-line);color:var(--side-text)}
.side .brand,.side .brand:hover{color:var(--side-text)}.side .brand small,.side .grp,.side .sync{color:var(--side-muted)}
.side .grp:hover{color:var(--side-text)}
.side .search-b{background:var(--side-field);border-color:var(--side-line);color:var(--side-text)}.side .search-b:hover{background:var(--side-hover);color:var(--side-text);filter:brightness(1.06)}
.side kbd{background:var(--side-kbd);color:var(--side-text)}
.side .nav{color:var(--side-nav)}.side .nav:hover{background:var(--side-hover);color:var(--side-text)}
.side .nav.on{background:var(--side-on);color:var(--side-on-text);box-shadow:var(--side-on-shadow)}
.side-scroll.mo-pill.mo-pill-has .nav.on{box-shadow:none}
.side .side-foot{background:var(--side-field)}.side .side-foot b{color:var(--side-text)}
.side-scroll{scrollbar-color:var(--side-line) transparent}
/* ── status helpers (soft background + text, or text only) ── */
.tone-ok{background:var(--ok-bg);color:var(--ok)}.tone-warn{background:var(--warn-bg);color:var(--warn)}.tone-bad{background:var(--bad-bg);color:var(--bad)}
.tone-info{background:var(--info-bg);color:var(--info)}.tone-purple{background:var(--purple-bg);color:var(--purple)}.tone-cyan{background:var(--cyan-bg);color:var(--cyan)}
.tone-accent{background:var(--accent-bg);color:var(--accent)}.tone-muted{background:var(--glass-hover);color:var(--muted)}
.t-ok{color:var(--ok)}.t-warn{color:var(--warn)}.t-bad{color:var(--bad)}.t-info{color:var(--info)}.t-purple{color:var(--purple)}.t-cyan{color:var(--cyan)}.t-accent{color:var(--accent)}
/* ── LIGHT (HALO) only: on the computer the screen sits on one big frosted pane, like a glass desk in a sunlit room ── */
@media (min-width:900px){
    /* the pane reaches out into the page margin, so the screen keeps exactly the dark look's width (tables do not get narrower) */
  :root:not([data-theme=dark]) .main{position:relative;isolation:isolate;min-height:calc(100vh - 40px)}
  :root:not([data-theme=dark]) .main::before{content:'';position:absolute;inset:-13px;z-index:-1;border-radius:28px;background:var(--pane);border:1px solid var(--pane-line);
    box-shadow:var(--hi),var(--pane-shadow);pointer-events:none}   /* no backdrop blur: it would only blur a smooth gradient, at a cost on every scroll */
}
@media (min-width:900px) and (max-width:1180px){ :root:not([data-theme=dark]) .main::before{inset:-10px} }
:root:not([data-theme=dark]) .phead h1{color:var(--text-strong)}
.hero .v,.hero .v2{text-shadow:var(--hero-tshadow)}
/* ── Builder 2's dimmed figures and calendar cells: AA in both looks (no opacity on text) ── */
/* "html" lifts these above the screens' own <style> blocks, which load after app.css */
html :is(.b2-stat,.b2-kpi) :is(.k-l,.k-n){opacity:1}
html :is(.b2-stat,.b2-kpi):not(.b2-hot) .k-n{color:var(--muted)}
html .b2-hot.b2-hot,html .b2-hot.b2-hot:hover{color:var(--money-text)}
html .b2-day.out{opacity:1;background:transparent;border-color:transparent}
html .b2-day.out .n,html .b2-day.out .n .b2-muted{color:var(--muted)}
html .b2-ev.done{opacity:1;background:transparent!important;color:var(--muted)!important}
.b2-card:not(.b2-hot),.prow{background-image:var(--sheen)}
/* Back: phone top bar + computer detail pages */
.backb{display:inline-flex;align-items:center;gap:2px;height:38px;padding:0 14px 0 8px;border-radius:999px;background:var(--glass-2);border:1px solid var(--line);color:var(--text-strong);font:inherit;font-size:14.5px;font-weight:700;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .15s ease}
.backb .ic{width:20px;height:20px;stroke-width:2.3}
.backb:active{transform:scale(.95)}
.backb:focus-visible{outline:2px solid var(--orange);outline-offset:2px}
.topbar .backb{margin-left:-4px}
.backb-d{display:flex;width:max-content;height:32px;font-size:13.5px;margin-bottom:8px}
/* a section opened from a link glows once (router scrollToHash) */
.hash-glow{animation:hash-glow 1.4s var(--mo-out,ease) 1}
@keyframes hash-glow{0%,30%{box-shadow:0 0 0 3px var(--orange),var(--shadow-2,none)}100%{box-shadow:0 0 0 0 transparent}}
html.mo-off .hash-glow{animation:none;outline:2px solid var(--orange)}
[id]{scroll-margin-top:calc(var(--safe-t) + 72px)}
/* the empty document tile on the card overview: text on top, the button inside the tile at any width */
.docrow .doc-empty{flex:1 1 120px;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:12px;padding:14px;border-radius:16px;background:var(--glass-2);border:1px solid var(--line);color:var(--muted);font-size:14px;line-height:1.35}
.docrow .doc-empty .mini{white-space:normal;max-width:100%;align-self:stretch;justify-content:center;text-align:center}
