/* Inter, stored in the app (no outside font service): loads fast, works offline, nothing sent to third parties */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-ext-400.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-ext-500.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-ext-600.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-ext-700.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ════════════════════════════════════════════════════════════════
   SPORT ZONE ACADEMY — Liquid Glass design system (iOS-inspired)
   ─ Font: the iOS system font (SF Pro / SF Pro Rounded on Apple devices)
   ─ Glass material: translucent fill + backdrop blur + light-catching rim
   ─ Concentric corners: inner radius = outer radius − padding  (--ri)
   ─ Skins: ember (warm) · lilac (cool)      Modes: light · dark
   ════════════════════════════════════════════════════════════════ */

:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-round: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;

  --bg: #F2F2F7;
  --mesh-1: #FFD9C2; --mesh-2: #DCE6FF; --mesh-3: #F6E3FF; --mesh-o: .85;

  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-thick: rgba(250, 250, 252, .92);
  --glass-blur: blur(30px) saturate(190%);
  --edge-hi: rgba(255, 255, 255, .95);
  --edge-lo: rgba(255, 255, 255, .25);
  --glass-shadow: 0 1px 1px rgba(255, 255, 255, .8) inset, 0 12px 32px -14px rgba(28, 28, 60, .18), 0 2px 6px -2px rgba(28, 28, 60, .06);

  --ink: #1C1C1E;
  --ink-2: rgba(60, 60, 67, .72);
  --ink-3: rgba(60, 60, 67, .5);
  --sep: rgba(60, 60, 67, .16);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --thumb: #FFFFFF;
  --dark: #1C1C1E;
  --on-dark: #FFFFFF;

  --accent: #F26B2A;
  --accent-2: #FF9A5C;
  --accent-ink: #FFFFFF;
  --accent-tint: rgba(242, 107, 42, .13);
  --accent-grad: linear-gradient(155deg, #FF9F66 0%, #F57A3A 45%, #EC5A1A 100%);

  --green: #34C759; --red: #FF3B30; --orange: #FF9500; --blue: #007AFF; --indigo: #5E5CE6; --teal: #30B0C7; --pink: #FF2D55; --gray: #8E8E93;
  --green-ink: #1E9E46; --red-ink: #E0281E; --amber-ink: #C77700; --blue-ink: #0066D6;
  --green-tint: rgba(52, 199, 89, .14); --red-tint: rgba(255, 59, 48, .12); --amber-tint: rgba(255, 149, 0, .14); --blue-tint: rgba(0, 122, 255, .12);
  --green-soft: var(--green-tint); --red-soft: var(--red-tint); --amber-soft: var(--amber-tint); --blue-soft: var(--blue-tint);
  --accent-soft: var(--accent-tint); --accent-softer: rgba(242, 107, 42, .07); --amber: var(--orange);
  --surface: var(--glass); --surface-2: var(--fill); --surface-3: var(--fill-2); --line: var(--sep); --line-2: var(--sep);
  --pastel-1: rgba(175, 160, 255, .28); --pastel-2: rgba(120, 175, 255, .26); --pastel-3: rgba(110, 215, 140, .26);

  --r: 30px; --pad: 20px; --ri: calc(var(--r) - var(--pad));

  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: light;
}
:root[data-skin="lilac"] {
  --bg: #EFEDFB;
  --mesh-1: #D9D2FF; --mesh-2: #FBD9EC; --mesh-3: #CFE4FF; --mesh-o: .95;
  --accent: #6E5BFF; --accent-2: #A397FF; --accent-tint: rgba(110, 91, 255, .13); --accent-softer: rgba(110, 91, 255, .07);
  --accent-grad: linear-gradient(155deg, #A79BFF 0%, #7B6BFF 50%, #5B47F0 100%);
}
:root[data-mode="dark"] {
  --bg: #000000;
  --mesh-1: #4A2412; --mesh-2: #142446; --mesh-3: #2C1640; --mesh-o: .7;
  --glass: rgba(44, 44, 48, .5);
  --glass-strong: rgba(44, 44, 48, .76);
  --glass-thick: rgba(30, 30, 34, .92);
  --edge-hi: rgba(255, 255, 255, .28);
  --edge-lo: rgba(255, 255, 255, .04);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 16px 40px -16px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --ink: #F5F5F7; --ink-2: rgba(235, 235, 245, .7); --ink-3: rgba(235, 235, 245, .42);
  --sep: rgba(84, 84, 88, .55); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .32);
  --thumb: #636366; --dark: #F5F5F7; --on-dark: #1C1C1E;
  --green: #30D158; --red: #FF453A; --orange: #FF9F0A; --blue: #0A84FF;
  --green-ink: #30D158; --red-ink: #FF6961; --amber-ink: #FFB340; --blue-ink: #64A8FF;
  color-scheme: dark;
}
:root[data-mode="dark"][data-skin="lilac"] { --mesh-1: #2A1F5C; --mesh-2: #3D1530; --mesh-3: #12264A; }

/* ═══════════════ BASE ═══════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.4; letter-spacing: -.01em;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .6s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
code { background: var(--fill); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
::selection { background: var(--accent-tint); }
.i { width: 20px; height: 20px; flex: none; }
.i.sm { width: 17px; height: 17px; } .i.lg { width: 24px; height: 24px; }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .strong { font-weight: 600; }
.num { font-family: var(--font-round); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 2px; border-radius: 10px; }

.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--mesh-o); transition: background 1s var(--ease), opacity 1s; }
.bg-orbs span:nth-child(1) { width: 60vw; height: 60vw; max-width: 820px; max-height: 820px; right: -12vw; top: -22vw; background: var(--mesh-1); animation: drift 28s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(2) { width: 55vw; height: 55vw; max-width: 760px; max-height: 760px; left: -18vw; bottom: -20vw; background: var(--mesh-2); animation: drift 34s ease-in-out infinite alternate-reverse; }
.bg-orbs span:nth-child(3) { width: 38vw; height: 38vw; max-width: 520px; max-height: 520px; left: 30%; top: 30%; background: var(--mesh-3); animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(5vw, -3vw) scale(1.12); } }

/* ═══════════════ LIQUID GLASS MATERIAL ═══════════════ */
.glass, .glass-solid, .card, .s-card, .table-wrap, .sheet, .menu, .nav-pill, .brand-pill, .icon-btn, .mode-toggle,
.tabbar, .skin-switch, .search-field, .search-box, .seg, .tabs, .att-tile, .search-pop, .auth-card, .chip, .select, .btn.light {
  position: relative;
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
/* light-catching rim: 1px gradient border, brighter at the corners */
.glass::before, .glass-solid::before, .card::before, .s-card::before, .table-wrap::before, .sheet::before, .menu::before, .nav-pill::before,
.brand-pill::before, .icon-btn::before, .mode-toggle::before, .tabbar::before, .skin-switch::before, .search-field::before, .search-box::before,
.seg::before, .tabs::before, .att-tile::before, .search-pop::before, .auth-card::before, .chip::before, .btn.light::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(150deg, var(--edge-hi) 0%, var(--edge-lo) 30%, transparent 55%, var(--edge-lo) 80%, var(--edge-hi) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.sheet, .menu, .search-pop { background-color: var(--glass-strong); }

/* ═══════════════ LAYOUT ═══════════════ */
#app { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 16px 28px 120px; }
.topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 12px; z-index: 40; margin-bottom: 26px; }
.brand-pill { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 20px 0 12px; border-radius: 999px; font-weight: 600; font-size: 16px; white-space: nowrap; min-width: 0; transition: transform .4s var(--spring); }
.brand-pill > * { position: relative; z-index: 3; }
.brand-pill:active { transform: scale(.96); }
.brand-mark { color: var(--accent); display: grid; place-items: center; width: 30px; height: 30px; }
.brand-mark img { width: 30px; height: 30px; object-fit: contain; border-radius: 8px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

.nav-pill { display: flex; align-items: center; margin: 0 auto; height: 50px; padding: 4px; border-radius: 999px; }
.nav-pill a { position: relative; z-index: 3; padding: 0 18px; height: 42px; display: grid; place-items: center; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: color .35s var(--ease); white-space: nowrap; }
.nav-pill a:hover { color: var(--ink); }
.nav-pill a.on { color: var(--ink); font-weight: 600; }
.nav-ind { position: absolute; z-index: 1; top: 4px; left: 0; height: 42px; width: 0; border-radius: 999px; opacity: 0;
  background: var(--thumb); box-shadow: 0 3px 10px -2px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04);
  transition: transform .6s var(--spring), width .5s var(--ease), opacity .3s; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.mode-toggle { display: flex; padding: 4px; border-radius: 999px; height: 50px; align-items: center; }
.mode-toggle button { position: relative; z-index: 3; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background .45s var(--ease), color .45s, box-shadow .45s; }
.mode-toggle button.on { background: var(--thumb); color: var(--ink); box-shadow: 0 3px 10px -2px rgba(0, 0, 0, .14); }
.icon-btn { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: transform .4s var(--spring); }
.icon-btn:active { transform: scale(.9); }
.icon-btn .i { position: relative; z-index: 3; }
.icon-btn .dot { position: absolute; z-index: 3; top: 13px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--glass-strong); }
.avatar-btn { width: 50px; height: 50px; border-radius: 50%; overflow: hidden; background: var(--accent-grad); color: #fff; font-weight: 600; display: grid; place-items: center; box-shadow: var(--glass-shadow), inset 0 0 0 1px rgba(255,255,255,.35); transition: transform .4s var(--spring); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn:active { transform: scale(.9); }

.tabbar { display: none; }

.skin-switch { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 45; display: flex; padding: 4px; border-radius: 999px; transition: opacity .4s var(--ease), transform .5s var(--ease); }
.skin-switch button { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 500; transition: background .45s var(--ease), color .45s, box-shadow .45s; }
.skin-switch button.on { background: var(--thumb); color: var(--ink); font-weight: 600; box-shadow: 0 3px 10px -2px rgba(0,0,0,.14); }
.skin-switch .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sw.lilac { background: #6E5BFF; } .sw.ember { background: #F26B2A; }

/* ═══════════════ MOTION ═══════════════ */
.view { outline: none; min-height: 60vh; }
.view.leaving { animation: viewOut .16s var(--ease) forwards; }
.view.entering > * { animation: viewIn .6s var(--ease) both; }
@keyframes viewOut { to { opacity: 0; transform: scale(.992); filter: blur(3px); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } }
.rise { animation: rise .7s var(--ease) both; }
.stagger > * { animation: rise .75s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s } .stagger > *:nth-child(2) { animation-delay: .05s }
.stagger > *:nth-child(3) { animation-delay: .08s } .stagger > *:nth-child(4) { animation-delay: .11s }
.stagger > *:nth-child(5) { animation-delay: .14s } .stagger > *:nth-child(6) { animation-delay: .17s }
.stagger > *:nth-child(7) { animation-delay: .2s } .stagger > *:nth-child(n+8) { animation-delay: .23s }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); filter: blur(4px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(-4px); } }

/* ═══════════════ PAGE HEAD (iOS large title) ═══════════════ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 4px 20px; flex-wrap: wrap; }
.page-title { font-size: clamp(32px, 3.8vw, 42px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.page-sub { color: var(--ink-3); margin-top: 6px; font-size: 15px; }
.eyebrow { color: var(--ink-3); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 4px 18px; flex-wrap: wrap; }
.search-field { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 16px; border-radius: 999px; width: min(440px, 100%); color: var(--ink-3); }
.search-field > * { position: relative; z-index: 3; }
.search-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--ink); height: 100%; }
.search-field input::placeholder { color: var(--ink-3); }
.search-field kbd { font: 600 12px var(--font); color: var(--ink-3); background: var(--fill); border-radius: 8px; padding: 4px 8px; }
.search-field:focus-within { box-shadow: var(--glass-shadow), 0 0 0 4px var(--accent-tint); }
.search-pop { position: absolute !important; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; border-radius: 26px; padding: 8px; max-height: 420px; overflow: auto; animation: pop .4s var(--spring); }
.search-pop .row { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 18px; color: var(--ink); }
.search-pop .row:hover, .search-pop .row.sel { background: var(--fill); }
.search-pop .empty { position: relative; z-index: 3; }

/* Grouped stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 !important; margin-bottom: 18px; }
.stat-strip .stat { min-width: 0; } .stat .v { overflow-wrap: anywhere; }
.stat-strip .stat { position: relative; z-index: 3; padding: 18px 22px; }
.stat-strip .stat + .stat::after { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: .5px; background: var(--sep); }
.stat .k { color: var(--ink-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .v { font-family: var(--font-round); font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.up { color: var(--green-ink); font-weight: 600; } .down { color: var(--red-ink); font-weight: 600; }

/* ═══════════════ BADGES (only where they carry meaning) ═══════════════ */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--green-tint); color: var(--green-ink); }
.badge.red { background: var(--red-tint); color: var(--red-ink); }
.badge.amber { background: var(--amber-tint); color: var(--amber-ink); }
.badge.blue { background: var(--blue-tint); color: var(--blue-ink); }
.badge.gray { background: var(--fill); color: var(--ink-2); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.chip > * { position: relative; z-index: 3; }
.chip b { color: var(--ink); }
.chip.on { background-color: var(--dark); color: var(--on-dark); }
.chip.on b { color: inherit; }

/* Segmented control with sliding thumb — thumb positioned by core.js */
.seg, .tabs { display: inline-flex; align-items: center; padding: 3px; border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; vertical-align: middle; }
.seg::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.seg > button, .tabs > button { position: relative; z-index: 3; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: color .3s var(--ease), transform .3s var(--spring); display: inline-flex; align-items: center; gap: 6px; flex: none; }
.seg > button:active, .tabs > button:active { transform: scale(.95); }
.seg > button.on, .tabs > button.on { color: var(--ink); font-weight: 600; }
.seg > button .n, .tabs > button .n { font-size: 12.5px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.seg, .tabs { min-width: 0; }
.set-layout > *, .att-layout > *, .dash-grid > *, .sched > * { min-width: 0; }
.sheet-b { overflow-x: hidden; }
.seg-thumb { position: absolute; z-index: 1; left: 0; top: 0; border-radius: 999px; background: var(--thumb); opacity: 0;
  box-shadow: 0 3px 8px -1px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); pointer-events: none; }
.seg-thumb.ready { transition: transform .55s var(--spring), width .45s var(--ease), height .3s, opacity .25s; }
.tabs { margin-bottom: 16px; }
#revRange > button { height: 30px; padding: 0 12px; font-size: 13px; }

/* ═══════════════ BUTTONS ═══════════════ */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap; transition: transform .35s var(--spring), filter .2s, background .3s, opacity .2s; user-select: none; }
.btn > * { position: relative; z-index: 3; }
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.dark { background: var(--dark); color: var(--on-dark); box-shadow: 0 6px 16px -8px rgba(0,0,0,.45); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent), inset 0 1px 0 rgba(255,255,255,.3); }
.btn.primary:hover, .btn.dark:hover { filter: brightness(1.06); }
.btn.light { color: var(--ink); }
.btn.ghost { background: var(--fill); color: var(--ink); }
.btn.ghost:hover { background: var(--fill-2); }
.btn.tinted { background: var(--accent-tint); color: var(--accent); }
.btn.danger { background: var(--red-tint); color: var(--red-ink); }
.btn.wa { background: #25D366; color: #fff; box-shadow: 0 8px 20px -10px #25D366; }
.btn.white { background: rgba(255,255,255,.95); color: #1C1C1E; box-shadow: 0 6px 16px -8px rgba(0,0,0,.3); }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; } .btn.icon.sm { width: 34px; }
.round { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink); transition: transform .35s var(--spring), background .3s; flex: none; }
.round:hover { background: var(--fill-2); }
.round:active { transform: scale(.88); }
.round.sm { width: 32px; height: 32px; } .round.sm .i { width: 16px; height: 16px; }
.round.dark { background: var(--dark); color: var(--on-dark); }
.round.white { background: rgba(255,255,255,.24); color: #fff; }
.round.wa { background: #25D366; color: #fff; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Grouped actions: one material, hairline separators, concentric corners */
.actions { display: flex; align-items: stretch; height: 44px; border-radius: var(--ri); background: var(--fill); overflow: hidden; }
.actions > button, .actions > a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); position: relative; transition: background .25s; }
.actions > * + *::before { content: ''; position: absolute; left: 0; top: 11px; bottom: 11px; width: .5px; background: var(--sep); }
.actions > *:hover { background: var(--fill); }
.actions > *:active { background: var(--fill-2); }
.actions .hl { color: var(--accent); }
.actions .wa-ic { flex: 0 0 54px; color: #1FAD55; }

/* iOS Settings-style icon tiles */
.tile-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.tile-ic .i { width: 18px; height: 18px; }
.tile-ic.lg { width: 42px; height: 42px; border-radius: 12px; } .tile-ic.lg .i { width: 22px; height: 22px; }
.t-orange { background: linear-gradient(180deg, #FFA149, #FF7A1A); } .t-green { background: linear-gradient(180deg, #4CD964, #28B04A); }
.t-red { background: linear-gradient(180deg, #FF6259, #F2362B); } .t-blue { background: linear-gradient(180deg, #3D9BFF, #0A72E8); }
.t-indigo { background: linear-gradient(180deg, #8A7BFF, #5B4BEE); } .t-pink { background: linear-gradient(180deg, #FF6A8A, #F0365C); }
.t-gray { background: linear-gradient(180deg, #A5A5AB, #7E7E85); } .t-teal { background: linear-gradient(180deg, #4FC8DC, #2398B0); }
.t-yellow { background: linear-gradient(180deg, #FFCF3B, #F5A800); } .t-dark { background: linear-gradient(180deg, #48484A, #1C1C1E); }

/* ═══════════════ CARDS & GRID ═══════════════ */
.grid { display: grid; gap: 18px; }
.dash-grid { grid-template-columns: repeat(12, 1fr); }
.c-2 { grid-column: span 2; } .c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-6 { grid-column: span 6; }
.c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; }
.card { border-radius: var(--r); padding: var(--pad); min-width: 0; overflow: hidden; transition: transform .6s var(--ease); }
.card > * { position: relative; z-index: 3; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 32px; }
.card-t { font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.card-s { color: var(--ink-3); font-size: 13px; margin-top: 2px; font-weight: 400; }
.big-num { font-family: var(--font-round); font-size: 44px; font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }

.card.accent { background: var(--accent-grad); color: #fff; box-shadow: 0 24px 50px -24px var(--accent), inset 0 1px 0 rgba(255,255,255,.35); }
.card.accent::after { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(120% 70% at 0% 0%, rgba(255,255,255,.35), transparent 55%); pointer-events: none; }
.card.accent .card-t { color: #fff; }
.card.accent .muted { color: rgba(255,255,255,.82); }
.card.accent .big-num { font-size: 60px; }

.pastel { border-radius: var(--ri); padding: 16px; }
.p1 { background: var(--pastel-1); } .p2 { background: var(--pastel-2); } .p3 { background: var(--pastel-3); }

.kpi { display: flex; flex-direction: column; gap: 12px; }
.kpi .v { font-family: var(--font-round); font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k { color: var(--ink-3); font-size: 13px; }

.av { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; font-weight: 600; font-size: 15px; color: #fff; background: var(--accent-grad); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 34px; height: 34px; font-size: 12.5px; } .av.lg { width: 54px; height: 54px; font-size: 19px; }
.av.xl { width: 104px; height: 104px; font-size: 34px; }
.av-stack { display: flex; } .av-stack .av { box-shadow: 0 0 0 2.5px var(--glass-strong); margin-left: -10px; } .av-stack .av:first-child { margin-left: 0; }

/* Inset grouped lists — separators start after the leading element */
.list { display: flex; flex-direction: column; margin: 0 -8px; }
.li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--ri); min-width: 0; transition: background .25s; }
.li + .li::before { content: ''; position: absolute; top: 0; left: 64px; right: 8px; height: .5px; background: var(--sep); }
.list.flat .li + .li::before { left: 8px; }
.list.sm-lead .li + .li::before { left: 54px; }
.li.link { cursor: pointer; } .li.link:hover { background: var(--fill); }
.li.link:hover::before, .li.link:hover + .li::before { opacity: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .amt { font-family: var(--font-round); font-size: 17px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; padding: 30px 16px; color: var(--ink-3); }
.empty .i { width: 34px; height: 34px; margin: 0 auto 10px; opacity: .45; }

.bar { height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); width: 0; transition: width 1.2s var(--ease); }
.bar.thin { height: 6px; }
.life { padding: 0 4px; }
.life-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; white-space: nowrap; }
.life-h b { font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.life .bar > i { animation: grow 1.1s var(--ease) both; background: var(--green); }
.life.warn .bar > i { background: var(--orange); } .life.warn .life-h b { color: var(--amber-ink); }
.life.bad .bar { background: var(--red-tint); } .life.bad .life-h b { color: var(--red-ink); }
.life.compact { padding: 0; } .life.compact .life-h { font-size: 12px; margin-bottom: 4px; }
@keyframes grow { from { width: 0; } }
.bar.teal > i { background: linear-gradient(90deg, #34C7B0, #30A0E0); }

/* Key/value rows */
.kv { display: flex; flex-direction: column; }
.kv > div { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.kv > div + div::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: .5px; background: var(--sep); }
.kv .k { color: var(--ink-3); flex: none; }
.kv .v { font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .v small { color: var(--ink-3); font-weight: 400; margin-left: 4px; font-size: 13px; }

/* ═══════════════ DASHBOARD PIECES ═══════════════ */
.gauge-wrap { position: relative; display: grid; place-items: center; }
.gauge-wrap svg { width: 100%; max-width: 230px; overflow: visible; }
.gauge-arc { transition: stroke-dashoffset 1.4s var(--ease); }
.gauge-needle { transform-origin: 120px 120px; transition: transform 1.5s var(--spring); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; border-radius: var(--ri); background: var(--fill); overflow: hidden; }
.quick a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; font-size: 12.5px; color: var(--ink-2); text-align: center; transition: background .25s; }
.quick a + a::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: .5px; background: var(--sep); }
.quick a:hover { background: var(--fill); }
.quick a:active { background: var(--fill-2); }
.quick b { font-family: var(--font-round); font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.quick b.bad { color: var(--red-ink); }

.map-bg { position: absolute !important; inset: 0; z-index: 1 !important; opacity: .7; pointer-events: none; }
:root[data-mode="dark"] .map-bg { opacity: .35; }
.loc-pill { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border-radius: var(--ri); background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); }
.flag { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 24px -8px currentColor, inset 0 1px 0 rgba(255,255,255,.4); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--ink-3); font-size: 11.5px; font-family: var(--font); }
.chart .grid-l { stroke: var(--sep); }
.bar-r { transition: y .9s var(--ease), height .9s var(--ease); }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--dark); color: var(--on-dark); font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 10px; white-space: nowrap; pointer-events: none; transition: left .4s var(--ease), top .4s var(--ease), opacity .2s; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.sched { display: grid; grid-template-columns: 1fr 250px; gap: 20px; }
.sched-side { position: relative; padding-left: 20px; display: flex; flex-direction: column; }
.sched-side::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: .5px; background: var(--sep); }
.week { display: grid; grid-template-columns: 32px repeat(7, minmax(0, 1fr)) 32px; align-items: center; gap: 4px; }
.week .d { text-align: center; font-size: 12.5px; color: var(--ink-2); height: 30px; display: grid; place-items: center; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.week .d.on { background: var(--dark); color: var(--on-dark); }
.week-dots { display: grid; grid-template-columns: 32px repeat(7, minmax(0, 1fr)) 32px; gap: 4px; margin-top: 16px; align-items: center; }
.wdot { aspect-ratio: 1; max-width: 54px; width: 100%; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-round); font-size: 14px; font-weight: 600; transition: transform .4s var(--spring); }
.wdot.e0 { background: var(--fill); }
.wdot.e1 { background: var(--accent-tint); color: var(--accent); }
.wdot.e2 { background: var(--accent-2); color: #fff; }
.wdot.e3 { background: var(--accent); color: #fff; box-shadow: 0 8px 18px -8px var(--accent); }
.wdot:hover { transform: scale(1.1); }

/* ═══════════════ STUDENTS ═══════════════ */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { flex: 1; min-width: 220px; max-width: 420px; height: 44px; border-radius: 999px; display: flex; align-items: center; padding: 0 14px; gap: 8px; color: var(--ink-3); }
.search-box > * { position: relative; z-index: 3; }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 15px; color: var(--ink); }
.search-box input::placeholder { color: var(--ink-3); }
.search-box:focus-within { box-shadow: var(--glass-shadow), 0 0 0 4px var(--accent-tint); }
.select { height: 44px; border-radius: 999px; border: 0; padding: 0 34px 0 16px; appearance: none; -webkit-appearance: none; outline: none; font-weight: 500; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
.select:focus { box-shadow: var(--glass-shadow), 0 0 0 4px var(--accent-tint); }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }

.s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.s-card { --pad: 16px; --r: 28px; display: flex; flex-direction: column; gap: 10px; padding: var(--pad); border-radius: var(--r); cursor: pointer; transition: transform .6s var(--ease); }
.s-card > * { position: relative; z-index: 3; }
.s-card:hover { transform: translateY(-4px); }
.s-card:active { transform: scale(.985); }
.s-card .top { display: flex; gap: 12px; align-items: center; }
.s-card .nm { font-weight: 600; font-size: 16.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; }
.s-card .sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.s-card .kv { padding: 0 4px; }
.sport-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.warn-t { color: var(--amber-ink) !important; } .bad-t { color: var(--red-ink) !important; }

.table-wrap { overflow-x: auto; border-radius: var(--r); }
table.t { position: relative; z-index: 3; width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 16px 16px 10px; white-space: nowrap; }
.t td { padding: 12px 16px; border-top: .5px solid var(--sep); white-space: nowrap; }
.t tbody tr { transition: background .25s; }
.t tbody tr.link { cursor: pointer; } .t tbody tr.link:hover { background: var(--fill); }
.t .r { text-align: right; } .t tr.void td { opacity: .4; text-decoration: line-through; }
.load-more { display: flex; justify-content: center; margin-top: 18px; }

/* Profile */
.profile-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.photo-edit { position: relative; }
.photo-edit .cam { position: absolute; right: 0; bottom: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--dark); color: var(--on-dark); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--glass-strong); transition: transform .35s var(--spring); }
.photo-edit .cam:active { transform: scale(.88); }
.p-name { font-size: clamp(26px, 2.8vw, 36px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.p-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.p-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.p-meta .i { color: var(--ink-3); }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 108px; height: 108px; }
.ring .ring-fg { transition: stroke-dashoffset 1.3s var(--ease); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .h { font-size: 11px; color: var(--ink-3); text-align: center; font-weight: 600; }
.cal .d { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.cal .d.P { background: var(--green); color: #fff; } .cal .d.A { background: var(--red-tint); color: var(--red-ink); } .cal .d.L { background: var(--amber-tint); color: var(--amber-ink); }
.cal .d.today { box-shadow: 0 0 0 2px var(--accent); }

/* ═══════════════ ATTENDANCE ═══════════════ */
.att-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.batch-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--ri); cursor: pointer; transition: background .3s var(--ease); }
.batch-row + .batch-row::before { content: ''; position: absolute; top: 0; left: 56px; right: 10px; height: .5px; background: var(--sep); }
.batch-row:hover { background: var(--fill); }
.batch-row.on { background: var(--accent-tint); }
.batch-row.on::before, .batch-row.on + .batch-row::before { opacity: 0; }
.batch-row.on .pct { color: var(--accent); }
.batch-row .pct { font-family: var(--font-round); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.att-tile { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 24px; cursor: pointer; user-select: none; transition: transform .35s var(--spring), background-color .35s var(--ease); }
.att-tile > * { position: relative; z-index: 3; }
.att-tile:active { transform: scale(.95); }
.att-tile .st { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--fill); color: var(--ink-3); transition: all .4s var(--spring); }
.att-tile.P { background-color: rgba(52, 199, 89, .16); } .att-tile.P .st { background: var(--green); color: #fff; transform: scale(1.06); }
.att-tile.A { background-color: rgba(255, 59, 48, .11); } .att-tile.A .st { background: var(--red); color: #fff; }
.att-tile.L { background-color: rgba(255, 149, 0, .13); } .att-tile.L .st { background: var(--orange); color: #fff; }
.att-tile .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-bar { position: sticky; bottom: 84px; z-index: 20; display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 8px 8px 8px 20px; border-radius: 999px; }
.att-bar > * { position: relative; z-index: 3; }
.save-state { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }

/* ═══════════════ RENEWALS ═══════════════ */
.rn-list { padding: 6px 12px !important; }
.rn-row { position: relative; display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 12px 4px; transition: opacity .4s; }
.rn-row + .rn-row::before { content: ''; position: absolute; top: 0; left: 62px; right: 4px; height: .5px; background: var(--sep); }
.rn-row.sent { opacity: .55; }
.rn-row .when { text-align: right; }
.rn-row .when .v { font-family: var(--font-round); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.sent-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--green-ink); font-size: 12.5px; font-weight: 500; }

/* ═══════════════ SETTINGS ═══════════════ */
.set-layout { display: grid; grid-template-columns: 270px 1fr; gap: 18px; align-items: start; }
.set-nav { position: sticky !important; top: 92px; --pad: 10px; }
.set-nav a { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--ri); color: var(--ink); font-weight: 500; transition: background .3s; }
.set-nav a + a::before { content: ''; position: absolute; top: 0; left: 54px; right: 10px; height: .5px; background: var(--sep); }
.set-nav a:hover { background: var(--fill); }
.set-nav a.on { background: var(--accent-tint); color: var(--accent); }
.set-nav a.on::before, .set-nav a.on + a::before { opacity: 0; }
.set-section + .set-section { margin-top: 18px; }
.cat-row { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 0; }
.cat-row + .cat-row::before { content: ''; position: absolute; top: 0; left: 46px; right: 0; height: .5px; background: var(--sep); }
.cat-row.arch { opacity: .45; }
.swatch { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tpl-vars button { font-size: 12.5px; font-weight: 500; padding: 5px 10px; border-radius: 999px; background: var(--fill); color: var(--ink-2); transition: all .2s; }
.tpl-vars button:hover { background: var(--accent-tint); color: var(--accent); }
.wa-preview { border-radius: var(--ri); padding: 14px; background: #E9E1D8 radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px) 0 0 / 12px 12px; }
:root[data-mode="dark"] .wa-preview { background-color: #0B141A; }
.wa-bubble { max-width: 92%; margin-left: auto; background: #D9FDD3; color: #111; padding: 8px 12px 18px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; font-size: 14px; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
:root[data-mode="dark"] .wa-bubble { background: #005C4B; color: #E9EDEF; }
.wa-bubble::after { content: 'now'; position: absolute; right: 10px; bottom: 3px; font-size: 10.5px; opacity: .5; }

/* ═══════════════ FORMS ═══════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* grid children may never grow wider than the screen (long rows scroll/wrap inside instead) */
.form-grid > * { min-width: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; padding-left: 4px; }
.field > span em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; border-radius: var(--ri, 12px); border: 0; background: var(--fill);
  padding: 0 14px; outline: none; transition: background .3s, box-shadow .3s; font-size: 16px; -webkit-appearance: none; appearance: none; color: var(--ink);
}
.field select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { background-color: var(--glass-thick); box-shadow: 0 0 0 3px var(--accent); }
.field input[type=color] { padding: 6px; cursor: pointer; }
.field .hint { font-size: 12px; color: var(--ink-3); padding-left: 4px; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 70px; }
.input-btn { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.prefix-wrap { position: relative; } .prefix-wrap .pre { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.prefix-wrap input { padding-left: 30px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.switch { position: relative; width: 51px; height: 31px; flex: none; cursor: pointer; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-2); transition: background .35s var(--ease); }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .45s var(--spring); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { cursor: pointer; position: relative; }
.pick input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick span { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 9px 14px; border-radius: var(--ri, 12px); background: var(--fill); box-shadow: inset 0 0 0 1.5px transparent; transition: all .3s var(--ease); font-size: 14px; font-weight: 500; }
.pick span small { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.pick input:checked + span { background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.pick input:checked + span small { color: var(--accent); opacity: .75; }
.form-sec { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; margin: 10px 0 -4px 4px; grid-column: 1 / -1; }
.summary { border-radius: var(--ri, 12px); padding: 2px 14px; background: var(--fill); display: flex; flex-direction: column; font-size: 14px; }
.summary .row { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; }
.summary .row + .row::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: .5px; background: var(--sep); }
.summary .row.total { font-size: 17px; font-weight: 600; }
.summary .row.due b { color: var(--red-ink); }
.alert { display: block; padding: 12px 14px; border-radius: var(--ri, 12px); font-size: 14px; line-height: 1.5; margin-bottom: 14px; overflow-wrap: anywhere; }
.alert > .i { vertical-align: -3px; margin-right: 8px; }
.alert small { display: block; margin-top: 6px; opacity: .85; }
.alert.danger { background: var(--red-tint); color: var(--red-ink); }
.alert.info { background: var(--blue-tint); color: var(--blue-ink); }
.alert.warn { background: var(--amber-tint); color: var(--amber-ink); }
.alert.ok { background: var(--green-tint); color: var(--green-ink); }
/* Staff permission list */
.perm-list { display: flex; flex-direction: column; background: var(--fill); border-radius: var(--ri, 12px); padding: 0 14px; }
.perm-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 0; cursor: pointer; }
.perm-row + .perm-row::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: .5px; background: var(--sep); }
.perm-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.perm-row .switch { flex: none; }
@media (max-width: 640px) { .perm-list { padding: 0 12px; } .perm-row { gap: 10px; } #stfPresets .chip { flex: 1 1 calc(50% - 8px); justify-content: center; } }
.perm-row .switch input:disabled + i { opacity: .55; }
@media (max-width: 640px) { .stf-row .btn.sm span { display: none; } .stf-row .btn.sm { width: 34px; padding: 0; } .stf-row .s { white-space: normal; } }

/* "Powered by StackUp" credit */
.powered { position: relative; z-index: 1; display: flex; justify-content: center; margin: 34px 0 8px; }
.powered a { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 12px; color: var(--ink-3);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 0 0 .5px var(--sep); transition: color .3s, transform .35s var(--spring); }
.powered a b { color: var(--ink-2); font-weight: 600; letter-spacing: -.01em; }
.powered a:hover { color: var(--accent); } .powered a:hover b { color: var(--accent); }
.powered a:active { transform: scale(.95); }
.powered svg { opacity: .6; }
.auth-powered { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); margin: 0; }
.bill-powered { margin-top: 18px; }
@media (max-height: 820px), (max-width: 640px) { .auth-powered { position: static; margin: 18px 0 0; } body.auth { grid-auto-flow: row; align-content: center; } }
.setup-nudge { display: block; margin: -10px 4px 18px; text-decoration: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ═══════════════ SHEETS ═══════════════ */
#layer { position: relative; z-index: 100; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .22); opacity: 0; transition: opacity .5s var(--ease); z-index: 100; }
.scrim.in { opacity: 1; }
.sheet { --r: 34px; --pad: 22px; position: fixed !important; z-index: 101; left: 50%; top: 50%; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  border-radius: var(--r); transform: translate(-50%, -46%) scale(.94); opacity: 0;
  transition: transform .6s var(--spring), opacity .35s var(--ease);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.45), 0 0 0 .5px rgba(0,0,0,.06); }
.sheet > * { position: relative; z-index: 3; }
.sheet.in { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.sheet.wide { width: min(820px, calc(100vw - 32px)); }
.sheet.narrow { width: min(440px, calc(100vw - 32px)); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px var(--pad) 8px; }
.sheet-h h3 { font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.sheet-b { padding: 8px var(--pad) 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-f { display: flex; gap: 10px; justify-content: flex-end; padding: 12px var(--pad) var(--pad); }
.sheet-f .btn { min-width: 110px; }
.grab { display: none; }
.done-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 4px 0 8px; }
.done-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; box-shadow: 0 12px 30px -10px var(--green); animation: pop .6s var(--spring); margin-bottom: 6px; }
.done-check .i { width: 32px; height: 32px; stroke-width: 2.6; }

/* Context menu */
.menu { position: fixed !important; z-index: 120; min-width: 240px; padding: 6px; border-radius: 22px; transform-origin: top right; animation: menuIn .4s var(--spring); box-shadow: 0 30px 70px -20px rgba(0,0,0,.35), 0 0 0 .5px rgba(0,0,0,.05); }
@keyframes menuIn { from { opacity: 0; transform: scale(.85); } }
.menu > * { position: relative; z-index: 3; }
.menu button, .menu a { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; text-align: left; font-size: 15px; }
.menu button:hover, .menu a:hover { background: var(--fill); }
.menu .i { color: var(--ink-2); }
.menu .sep { height: 6px; margin: 4px -6px; background: var(--fill); }
.menu .danger, .menu .danger .i { color: var(--red-ink); }
.menu .lbl { padding: 8px 12px 6px; font-size: 12.5px; color: var(--ink-3); }

/* Toasts — Dynamic Island */
#toasts { position: fixed; z-index: 200; left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 10px; border-radius: 999px; background: #000; color: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.3); font-size: 14.5px; font-weight: 500; animation: island .6s var(--spring); max-width: calc(100vw - 32px); overflow: hidden; white-space: nowrap; }
.toast .ti { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green); flex: none; }
.toast.err .ti { background: var(--red); }
.toast.out { animation: islandOut .4s var(--ease) forwards; }
@keyframes island { from { opacity: 0; max-width: 120px; transform: scale(.7); } 60% { opacity: 1; } }
@keyframes islandOut { to { opacity: 0; transform: scale(.7) translateY(-10px); } }

.skel { border-radius: var(--r); background: linear-gradient(90deg, var(--glass) 0%, var(--glass-strong) 50%, var(--glass) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; min-height: 140px; }

.crop-box { position: relative; width: 100%; max-width: 360px; aspect-ratio: 1; margin: 0 auto; border-radius: var(--ri, 12px); overflow: hidden; background: #111; touch-action: none; cursor: grab; }
.crop-box img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crop-box::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.5); pointer-events: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* ═══════════════ AUTH ═══════════════ */
body.auth { display: grid; place-items: center; padding: 24px 16px; min-height: 100vh; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.auth-bg span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--mesh-o); }
.auth-bg span:nth-child(1) { width: 520px; height: 520px; background: var(--mesh-1); left: -140px; top: -120px; animation: drift 18s ease-in-out infinite alternate; }
.auth-bg span:nth-child(2) { width: 480px; height: 480px; background: var(--mesh-2); right: -120px; bottom: -140px; animation: drift 22s ease-in-out infinite alternate-reverse; }
.auth-bg span:nth-child(3) { width: 320px; height: 320px; background: var(--mesh-3); right: 30%; top: 12%; animation: drift 26s ease-in-out infinite alternate; }
.auth-card { --r: 34px; --pad: 30px; z-index: 1; width: min(440px, 100%); padding: var(--pad); border-radius: var(--r); }
.auth-card > * { position: relative; z-index: 3; }
.auth-card:has(.form-grid) { width: min(600px, 100%); }
.auth-card h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 22px 0 6px; }
.auth-card > .muted { margin-bottom: 22px; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.auth-logo-img { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; }
.logo-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.logo-dot.lg { width: 56px; height: 56px; border-radius: 15px; }
.auth-foot { margin-top: 18px; font-size: 13px; text-align: center; }

/* ═══════════════ BILL ═══════════════ */
body.bill-page { padding: 24px 16px 60px; background: var(--bg); }
.bill-actions { max-width: 820px; margin: 0 auto 14px; display: flex; gap: 10px; justify-content: flex-end; }
.bill { max-width: 820px; margin: 0 auto; background: #fff; color: #1C1C1E; border-radius: 28px; padding: 44px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.25); }
.bill .muted { color: #8E8E93; }
.bill-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: .5px solid #E5E5EA; flex-wrap: wrap; }
.bill-brand { display: flex; gap: 14px; align-items: center; }
.bill-brand h1 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.bill-logo { width: 60px; height: 60px; object-fit: contain; border-radius: 14px; }
.bill-from { text-align: right; font-size: 13.5px; color: #55555E; line-height: 1.6; }
.bill-meta { display: flex; justify-content: space-between; gap: 24px; padding: 26px 0; flex-wrap: wrap; }
.bill .label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: #8E8E93; margin-bottom: 6px; font-weight: 600; }
.bill .big { font-size: 21px; font-weight: 600; letter-spacing: -.02em; display: block; }
.bill-no { text-align: right; }
.stamp { display: inline-block; margin-top: 10px; padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.stamp.paid { background: #E3F8E8; color: #1E9E46; } .stamp.partial { background: #FFF1DC; color: #C77700; }
.stamp.unpaid { background: #FFE5E3; color: #E0281E; } .stamp.void { background: #EEE; color: #666; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.bill-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #8E8E93; padding: 12px 16px; background: #F2F2F7; font-weight: 600; }
.bill-table th:first-child { border-radius: 12px 0 0 12px; } .bill-table th:last-child { border-radius: 0 12px 12px 0; }
.bill-table td { padding: 14px 16px; border-bottom: .5px solid #E5E5EA; vertical-align: top; }
.bill-table .r { text-align: right; white-space: nowrap; }
.bill-table tfoot td { border: 0; padding: 7px 16px; color: #55555E; }
.bill-table tfoot tr.grand td { font-size: 20px; font-weight: 700; color: #1C1C1E; padding-top: 16px; }
.bill-table tfoot tr.due td { color: #E0281E; font-weight: 600; }
.bill-payments { margin-top: 22px; padding: 16px 18px; border-radius: 16px; background: #F2F2F7; }
.bill-payments .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.bill-note { margin-top: 16px; font-size: 14px; color: #55555E; } .bill-note.danger { color: #E0281E; }
.bill-foot { margin-top: 30px; padding-top: 22px; border-top: .5px solid #E5E5EA; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: #55555E; }
.bill-foot .thanks { font-size: 16px; color: #1C1C1E; font-weight: 600; }
@media print {
  body { background: #fff !important; padding: 0 !important; }
  .no-print, .bg-orbs { display: none !important; }
  .bill { box-shadow: none; border-radius: 0; padding: 10mm; max-width: none; animation: none; }
  @page { margin: 8mm; }
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 1180px) {
  .c-2 { grid-column: span 4; } .dash-top .c-3 { grid-column: span 4; }
  .c-3 { grid-column: span 6; } .c-4 { grid-column: span 6; } .c-5, .c-7 { grid-column: span 12; }
  .c-6, .c-8 { grid-column: span 12; }
  .nav-pill a { padding: 0 13px; }
  .brand-name { max-width: 150px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip .stat:nth-child(3)::after { display: none; }
}
@media (max-width: 960px) {
  .nav-pill { display: none; }
  .topbar { justify-content: space-between; }
  .tabbar { display: flex; position: fixed; z-index: 50; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 64px; border-radius: 999px; padding: 4px; justify-content: space-around; }
  .tabbar a { position: relative; z-index: 3; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); border-radius: 999px; transition: color .3s, background .45s var(--ease); }
  .tabbar a.on { color: var(--accent); background: var(--fill); }
  .skin-switch { bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(.9); }
  .skin-switch.hide { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(12px) scale(.9); }
  .att-layout, .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: relative !important; top: 0; display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .set-nav a { white-space: nowrap; } .set-nav a + a::before { display: none; }
  .att-bar { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .profile-hero { grid-template-columns: auto 1fr; } .profile-hero .p-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .sched { grid-template-columns: 1fr; } .sched-side { padding-left: 0; padding-top: 18px; } .sched-side::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: .5px; }
}
@media (max-width: 640px) {
  :root { --r: 26px; --pad: 16px; }
  #app { padding: 10px 14px 170px; }
  .topbar { top: 8px; gap: 8px; margin-bottom: 18px; }
  .brand-pill { height: 46px; padding: 0 14px 0 10px; font-size: 15px; }
  .brand-name { max-width: 130px; }
  .mode-toggle { display: none; }
  .icon-btn, .avatar-btn { width: 46px; height: 46px; }
  .c-2, .c-3, .c-4, .dash-top .c-3 { grid-column: span 12; }
  .search-field { width: 100%; }
  .stat-strip .stat { padding: 14px 16px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .sheet { --r: 30px; left: 6px; right: 6px; top: auto; bottom: 6px; width: auto; max-height: 92vh; transform: translateY(110%); }
  .sheet.in { transform: translateY(0); }
  .sheet.wide, .sheet.narrow { width: auto; }
  .sheet-f { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .grab { display: block; width: 36px; height: 5px; border-radius: 99px; background: var(--fill-2); margin: 8px auto -10px; }
  .rn-row { grid-template-columns: auto 1fr auto; } .rn-row .when { display: none; }
  .bill { padding: 24px; border-radius: 22px; }
  .bill-from, .bill-no { text-align: left; }
  .s-grid { grid-template-columns: 1fr; }
  .search-box { max-width: none; flex-basis: 100%; }
  .stat-strip, .stat-strip[style] { grid-template-columns: 1fr 1fr !important; }
  .stat-strip .stat:nth-child(odd)::after { display: none; }
  .stat-strip .stat:nth-child(n+3) { border-top: .5px solid var(--sep); }
  .stat-strip .stat:nth-child(3):last-child { grid-column: 1 / -1; }
  .toolbar > .row-flex, .toolbar input[type=date] { max-width: 100%; }
  .toolbar input[type=date].select { flex: 1; min-width: 0; }
  .pay-seg { display: flex; width: 100%; } .pay-seg > button { flex: 1; justify-content: center; padding: 0 8px; font-size: 13px; }
  .head-actions .btn { flex: 1; }
  .page-head .head-actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255,255,255,.92); --glass-strong: #fff; }
  :root[data-mode="dark"] { --glass: rgba(36,36,40,.95); --glass-strong: #2C2C2E; }
}

/* week strip on small phones: day name above the date so 7 days always fit */
@media (max-width: 480px) { .week .d { white-space: normal; height: auto; min-height: 34px; line-height: 1.15; font-size: 11.5px; padding: 3px 0; overflow-wrap: anywhere; } .week, .week-dots { gap: 2px; } }
@media (max-width: 360px) { .stat-strip .stat { padding: 12px 12px; } .stat .v { font-size: 22px; } }

/* ═══════════════ Install as an app ═══════════════ */
.pwa-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--fill); color: var(--ink); font-size: 14px; font-weight: 600; }
.pwa-link:active { transform: scale(.96); }
.pwa-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pwa-card img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 20px -10px rgba(0,0,0,.35); flex: none; }
.pwa-card .grow { flex: 1; min-width: 200px; }
.pwa-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pwa-hero img { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 10px 24px -12px rgba(0,0,0,.4); flex: none; }
.pwa-hero div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pwa-hero b { font-size: 17px; overflow-wrap: anywhere; }
.pwa-hero span { color: var(--ink-2); font-size: 14px; }
.pwa-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pwa-steps li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--fill); font-size: 15px; line-height: 1.4; }
.pwa-n { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--glass-strong); color: var(--accent); box-shadow: var(--glass-shadow); }
.pwa-warn { margin-top: 14px; padding: 10px 12px; border-radius: 14px; background: var(--amber-tint); color: var(--amber-ink); font-size: 13.5px; }
@media (display-mode: standalone) { [data-install] { display: none !important; } }

/* ═══════════════ Branches (Pro Unlimited) ═══════════════ */
.br-pill { cursor: pointer; }
.br-chev { display: inline-grid; place-items: center; margin-left: 2px; color: var(--ink-3); }
.br-chev .i { width: 15px; height: 15px; }
.br-card { display: flex; flex-direction: column; gap: 14px; }
.br-card.mine { box-shadow: 0 0 0 2px var(--accent), var(--glass-shadow); }
.br-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.br-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.br-nums > div { padding: 10px 12px; border-radius: 14px; background: var(--fill); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.br-nums b { font-size: 19px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.br-nums b.red { color: var(--red-ink); }
.br-nums span { font-size: 12px; color: var(--ink-3); }
.br-row.off { opacity: .6; }
@media (max-width: 1180px) { .br-grid .c-4 { grid-column: span 6; } }
@media (max-width: 760px) { .br-grid .c-4 { grid-column: span 12; } }

/* ═══════════════ Leads & reminders (Pro Unlimited) ═══════════════ */
.ld-bar { flex-wrap: wrap; gap: 10px; }
.ld-bar .tabs { max-width: 100%; }
.ld-n:not(:empty) { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--fill-2); font: 700 11px/18px var(--font-round); font-style: normal; color: var(--ink-2); }
.tabs > button.on .ld-n:not(:empty) { background: var(--accent); color: #fff; }
.ld-list { padding: 6px var(--pad) !important; }
.ld-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.ld-row + .ld-row::before { content: ''; position: absolute; top: 0; left: 46px; right: 0; height: .5px; background: var(--sep); }
.ld-row:active { opacity: .7; }
.ld-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ld-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ld-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.ld-fu { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ld-fu .i { width: 13px; height: 13px; }
.ld-fu.now { color: var(--blue-ink); } .ld-fu.late { color: var(--red-ink); }
.ld-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ld-info { margin-bottom: 14px; }
.ld-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: .5px solid var(--sep); font-size: 14.5px; }
.ld-kv span { color: var(--ink-3); flex: none; } .ld-kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.ld-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.ld-log { margin: 6px 0 4px; }
.ld-log .chips { align-items: center; }
.ld-log .chip { height: 32px; font-size: 13px; }
.ld-tl-h { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.ld-tl { display: flex; flex-direction: column; gap: 10px; }
.ld-tl-i { display: flex; gap: 10px; font-size: 14px; }
.ld-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--ink-3); }
.ld-dot.call, .ld-dot.whatsapp { background: var(--green); } .ld-dot.status { background: var(--accent); } .ld-dot.created { background: var(--blue); }
.ld-dash { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ld-dash > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ld-dash .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-bar-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.ld-bar-row .bar { margin: 0; }
.rm-last { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 180px; }
.rm-save { display: flex; justify-content: flex-end; margin: -4px 0 18px; }
@media (max-width: 640px) { .ld-bar-row { grid-template-columns: 1fr auto; } .ld-bar-row .bar, .ld-bar-row .muted { display: none; } .rm-save .btn { width: 100%; } }
.ld-log textarea { width: 100%; min-height: 64px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--fill); font: inherit; line-height: 1.5; resize: vertical; outline: none; }
.ld-log textarea:focus { background: var(--glass-thick); box-shadow: 0 0 0 3px var(--accent); }

/* ═══════════════ Import members ═══════════════ */
.im-steps { display: flex; gap: 8px; margin: -4px 4px 18px; flex-wrap: wrap; }
.im-step { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--fill); color: var(--ink-3); font-size: 14px; }
.im-step span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); font: 700 13px var(--font-round); }
.im-step.on { background: var(--dark); color: var(--on-dark); } .im-step.on span { background: var(--accent); color: #fff; }
.im-step.done { color: var(--green-ink); } .im-step.done span { background: var(--green); color: #fff; } .im-step span .i { width: 14px; height: 14px; }
.im-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 34px 18px; border-radius: 22px; border: 2px dashed var(--sep); cursor: pointer; transition: background .3s var(--ease), border-color .3s; }
.im-drop:hover, .im-drop.over { background: var(--accent-tint); border-color: var(--accent); }
.im-drop.busy { pointer-events: none; opacity: .7; }
.im-drop b { font-size: 18px; }
.im-tips { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 16px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.im-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.im-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.im-row > span { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-left: 4px; }
.im-row > span em { font-style: normal; color: var(--red-ink); font-weight: 500; }
.im-sel { width: 100%; min-width: 0; height: 44px; border: 0; border-radius: 14px; padding: 0 36px 0 14px; background-color: var(--fill); font: inherit; color: var(--ink-3); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; text-overflow: ellipsis; }
.im-row.set .im-sel { background-color: var(--green-tint); color: var(--ink); font-weight: 500; }
.im-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.im-raw { max-height: 280px; overflow: auto; } .im-raw td, .im-raw th { white-space: nowrap; }
.im-create { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.im-create > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.im-create .chip { height: 30px; font-size: 13px; }
.im-det { margin-bottom: 14px; } .im-det summary { cursor: pointer; list-style: none; } .im-det summary::-webkit-details-marker { display: none; }
.im-list { display: flex; flex-direction: column; margin-top: 12px; max-height: 360px; overflow: auto; }
.im-list > div { display: grid; grid-template-columns: 64px minmax(80px, 1fr) 2fr; gap: 10px; padding: 8px 0; border-top: .5px solid var(--sep); font-size: 14px; align-items: baseline; }
.im-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-run { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.im-run .card-t { display: flex; align-items: center; gap: 8px; } .im-run .card-t .i { color: var(--green); }
.im-bar { height: 10px; } .im-bar i { transition: width .5s var(--ease); }
.im-wrap { justify-content: flex-start; }
@media (max-width: 640px) { .im-grid { grid-template-columns: 1fr; } .im-list > div { grid-template-columns: 52px 1fr; } .im-list > div > span:last-child { grid-column: 1 / -1; } .im-foot .btn { flex: 1 1 auto; } }

/* ═══════════════ Privacy & terms ═══════════════ */
.powered { flex-direction: column; align-items: center; gap: 6px; }
.auth-legal { margin-top: 10px; font-size: 12px; text-align: center; color: var(--ink-3); }
.auth-legal a { color: var(--ink-2); text-decoration: underline; }
.pol-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pol-card > div:first-child { flex: 1; min-width: 220px; }
.pol-text { width: 100%; min-height: 320px; padding: 14px; border: 0; border-radius: 16px; background: var(--fill); font: 14px/1.6 var(--font); resize: vertical; outline: none; }
.pol-text:focus { box-shadow: 0 0 0 3px var(--accent); background: var(--glass-thick); }
.policy-page { min-height: 100vh; padding: 24px 16px; }
.policy { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; --pad: 28px; }
.policy-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.policy-top b { flex: 1; min-width: 0; font-size: 16px; }
.policy-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--fill); }
.policy-tabs a { padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.policy-tabs a.on { background: var(--thumb); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(0,0,0,.15); }
.policy h1 { font-size: 32px; letter-spacing: -.03em; margin-bottom: 12px; }
.policy-body { font-size: 15.5px; line-height: 1.65; color: var(--ink); }
.policy-body h2 { font-size: 18px; margin: 22px 0 6px; }
.policy-body p { margin: 0 0 10px; color: var(--ink-2); }
.policy-body ul { margin: 0 0 10px; padding-left: 20px; color: var(--ink-2); }
.policy-body li { margin: 4px 0; }
@media (max-width: 640px) { .policy { --pad: 20px; } .policy h1 { font-size: 26px; } }
@media print { .policy-tabs, .powered, .bg-orbs { display: none !important; } }

/* ═══════════════ Install sheet v2 (app-store look) ═══════════════ */
.pwa-sheet { overflow: hidden; background: var(--bg) !important; }
.pwa-sheet .sheet-b { padding-top: 26px; }
.pwa-x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.pwa-store { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-right: 30px; }
.pwa-store img { width: 88px; height: 88px; border-radius: 22px; flex: none; box-shadow: 0 14px 30px -14px rgba(0,0,0,.45), 0 0 0 .5px rgba(0,0,0,.08); }
.pwa-store-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pwa-store-t b { font-size: 20px; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.pwa-store-t > span { color: var(--ink-2); font-size: 14px; }
.pwa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pwa-store-t .pwa-sub { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.pwa-chips span { padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.pwa-act { margin-bottom: 18px; }
.pwa-act:empty { display: none; }
.pwa-act .btn svg { margin-right: 4px; }
.pwa-act .btn[disabled] { opacity: .8; }
.pwa-tip { font-size: 14px; color: var(--ink-2); text-align: center; }
.pwa-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pwa-feats li { display: flex; align-items: center; gap: 12px; }
.pwa-feats li div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pwa-feats b { font-size: 15px; } .pwa-feats li div span { color: var(--ink-2); font-size: 13.5px; }
.pwa-steps li { animation: rise .5s var(--ease) both; }
.pwa-steps small { color: var(--ink-3); }
.pwa-k { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: 0 2px; border-radius: 8px; vertical-align: middle; background: var(--glass-strong); color: #0A84FF; box-shadow: var(--glass-shadow); }
.pwa-k svg { width: 16px; height: 16px; }
.pwa-prog { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.pwa-prog i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent-grad, var(--accent)); }
.pwa-prog-t { margin-top: 8px; display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.pwa-done { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 18px; background: var(--green-tint, rgba(52,199,89,.12)); }
.pwa-done > span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: #34C759; animation: pop .6s var(--spring, ease) both; }
.pwa-done div { display: flex; flex-direction: column; gap: 2px; } .pwa-done b { font-size: 16px; } .pwa-done small { color: var(--ink-2); font-size: 13.5px; }
.pwa-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; vertical-align: -3px; margin-right: 6px; animation: pwa-spin .8s linear infinite; }
@keyframes pwa-spin { to { transform: rotate(360deg); } }
/* bouncing arrow that points at the browser's own Share / menu button */
.pwa-point { position: fixed; z-index: 500; pointer-events: none; width: 44px; height: 44px; display: grid; place-items: center; animation: pwa-fade 9s ease both; }
.pwa-point span { width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 20px solid #0A84FF; filter: drop-shadow(0 4px 8px rgba(10,132,255,.5)); animation: pwa-bob 1s ease-in-out infinite; }
.pwa-point.bottom { left: calc(50% - 22px); bottom: calc(4px + env(safe-area-inset-bottom)); }
.pwa-point.top, .pwa-point.top-right { top: 4px; right: 14px; } .pwa-point.top span, .pwa-point.top-right span { transform: rotate(180deg); animation-name: pwa-bob-up; }
@keyframes pwa-bob { 50% { transform: translateY(8px); } }
@keyframes pwa-bob-up { 0%, 100% { transform: rotate(180deg) translateY(0); } 50% { transform: rotate(180deg) translateY(8px); } }
@keyframes pwa-fade { 0% { opacity: 0; } 5%, 90% { opacity: 1; } 100% { opacity: 0; } }
.pwa-did { margin-top: 14px; }

/* ═══════════════ Layout polish ═══════════════ */
/* soft frosted strip behind the floating top bar, so page titles don't show through it while scrolling */
.topbar::after { content: ''; position: fixed; z-index: -1; left: 0; right: 0; top: 0; height: 86px; pointer-events: none;
  background: linear-gradient(var(--bg) 0%, rgba(0,0,0,0) 100%); background: linear-gradient(var(--bg) 72%, color-mix(in srgb, var(--bg) 0%, transparent));
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
/* settings: every card gets breathing room */
.set-body > * + * { margin-top: 18px; }
.set-body > .pwa-card { margin-bottom: 0; }
.ap-note { margin-top: 16px; }

/* ═══════════════ Workout & diet (Pro Unlimited) ═══════════════ */
.fit-grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.fit-card { display: flex; flex-direction: column; gap: 14px; }
.fit-card-top { display: flex; gap: 12px; align-items: center; }
.fit-card-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fit-card-t b { font-size: 16.5px; line-height: 1.25; overflow-wrap: anywhere; }
.fit-card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.fit-card-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.fit-card-act { display: flex; gap: 8px; margin-top: auto; }
.fit-card-act .round { margin-left: auto; }
.fit-sub { display: flex; align-items: center; gap: 6px; margin: 20px 0 10px; font-weight: 700; font-size: 15px; }
.fit-sub em { font-weight: 400; font-style: normal; color: var(--ink-3); font-size: 13px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fit-group { padding: 14px; border-radius: 18px; background: var(--fill); margin-bottom: 12px; }
.fit-group-h { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.fit-group-h input { flex: 1; min-width: 0; font-weight: 600; }
.fit-group-h .fit-time { flex: 0 0 110px; font-weight: 400; }
.fit-group input { height: 40px; border: 0; border-radius: 12px; padding: 0 12px; background: var(--glass-thick, #fff); color: var(--ink); font: inherit; font-size: 14px; outline: none; min-width: 0; }
.fit-group input:focus { box-shadow: 0 0 0 3px var(--accent-tint, rgba(242,107,42,.25)); }
.fit-dayno { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-grad); color: #fff; font-weight: 700; font-size: 14px; }
.fit-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 64px minmax(0, .9fr) minmax(0, .7fr) minmax(0, 1.4fr) 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.fit-row.food { grid-template-columns: minmax(0, 1fr) 34px; }
.fit-row-h { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; padding: 0 4px; }
.fit-group-f { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.fit-group-f input { flex: 1; }
.fit-group-h [data-gup] .i { transform: rotate(90deg); }
@media (max-width: 760px) {
  .fit-row { grid-template-columns: minmax(0, 1fr) 56px 34px; grid-template-areas: "n s x" "r t t" "o o o"; padding: 8px; border-radius: 14px; background: var(--glass-thick, #fff); margin-bottom: 8px; }
  .fit-row:not(.food) input { background: var(--fill); }
  .fit-row [data-f=name] { grid-area: n; } .fit-row [data-f=sets] { grid-area: s; } .fit-row [data-del] { grid-area: x; }
  .fit-row [data-f=reps] { grid-area: r; } .fit-row [data-f=rest] { grid-area: t; } .fit-row [data-f=note] { grid-area: o; }
  .fit-row.food { grid-template-areas: none; padding: 0; background: none; }
  .fit-row.food input { background: var(--glass-thick, #fff); }
  .fit-row-h { display: none; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
}
.fit-view-head { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fit-notes { padding: 12px 14px; border-radius: 14px; background: var(--amber-tint); color: var(--ink); font-size: 14.5px; line-height: 1.5; margin-bottom: 12px; white-space: pre-line; }
.fit-day { padding: 14px; border-radius: 18px; background: var(--fill); margin-bottom: 10px; }
.fit-day-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.fit-ex { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.fit-ex td { padding: 7px 4px; border-top: 1px solid var(--sep); vertical-align: top; }
.fit-ex tr:first-child td { border-top: 0; }
.fit-ex td.num { white-space: nowrap; font-weight: 600; text-align: right; }
.fit-ex td:last-child { width: 56px; text-align: right; white-space: nowrap; }
.fit-items { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; }
.fit-targets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fit-targets span { padding: 6px 12px; border-radius: 999px; background: var(--green-tint); font-size: 13.5px; color: var(--ink-2); }
.fit-targets b { color: var(--ink); }
.fit-people { display: flex; flex-wrap: wrap; gap: 6px; }
.fit-pick-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fit-pick-bar .search-box { min-width: 0; flex: 1 1 200px; max-width: none; }
.fit-pick-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fit-pick { max-height: 46vh; overflow-y: auto; border-radius: 16px; background: var(--fill); padding: 4px; margin-bottom: 12px; }
.fit-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.fit-pick-row:hover { background: var(--glass-thick, rgba(255,255,255,.6)); }
.fit-pick-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.fit-pick-row span { display: flex; flex-direction: column; min-width: 0; } .fit-pick-row small { font-size: 12.5px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.fit-choose { display: flex; flex-direction: column; gap: 6px; }
.fit-choose-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--fill); text-align: left; width: 100%; color: var(--ink); }
.fit-choose-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; } .fit-choose-row small { font-size: 12.5px; }
.fit-choose-row:hover { background: var(--fill-2, var(--fill)); }
.fit-pcard { display: flex; flex-direction: column; gap: 12px; }
.fit-ph { display: flex; align-items: center; gap: 12px; }
.fit-ph .grow { flex: 1; min-width: 0; }
.fit-pstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fit-pstats > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--fill); min-width: 0; }
.fit-pstats b { font-size: 18px; }
.fit-pstats small { font-size: 12px; color: var(--ink-3); } .fit-pstats small.down { color: var(--green-ink); } .fit-pstats small.up { color: var(--amber-ink); }
@media (max-width: 640px) { .fit-pstats { grid-template-columns: 1fr 1fr; } }
.fit-prow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--sep); }
.fit-prow-t { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.fit-pact { padding-top: 4px; flex-wrap: wrap; }
.fit-chart { width: 100%; height: 180px; display: block; }
.fit-chart .fit-line { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.fit-chart .fit-dot { fill: var(--accent); }
.fit-chart .fit-grid { stroke: var(--sep); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.fit-chart .fit-tick { font-size: 11px; fill: var(--ink-3); }
.fit-chart-empty { padding: 26px; text-align: center; border-radius: 16px; background: var(--fill); }
.fit-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .fit-two { grid-template-columns: 1fr; } }
.fit-pbs { display: flex; flex-direction: column; border-radius: 16px; background: var(--fill); padding: 4px 12px; }
.fit-pbs > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--sep); font-size: 14px; }
.fit-pbs > div:first-child { border-top: 0; }
.fit-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.fit-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--fill); color: var(--ink-3); font-size: 13px; font-weight: 600; filter: grayscale(1); opacity: .7; }
.fit-badge.got { background: var(--amber-tint); color: var(--amber-ink); filter: none; opacity: 1; }


/* people who turned on "Reduce motion" on their phone get no animations (no change for everyone else) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* taps respond instantly: no double-tap-zoom wait on phones (pinch zoom still works) */
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a, button, label, input, select, textarea, [role="button"] { touch-action: manipulation; }

/* logo editor */
.logo-ed { position: relative; width: 100%; max-width: 320px; aspect-ratio: 1; margin: 0 auto; border-radius: 20px; overflow: hidden; touch-action: none; cursor: grab;
  background: repeating-conic-gradient(#e9e9ee 0% 25%, #fff 0% 50%) 50% / 22px 22px; box-shadow: inset 0 0 0 1px var(--sep); }
.logo-ed img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }

/* ═══════════════ Sign-in page: split card on laptops, glass card on phones ═══════════════ */
body.lg-page { padding: 24px 16px; }
.lg-shell { position: relative; z-index: 1; width: min(960px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); border-radius: 34px; overflow: hidden;
  box-shadow: 0 50px 120px -40px rgba(0,0,0,.35), 0 0 0 .5px rgba(0,0,0,.06); background: var(--glass-thick, rgba(255,255,255,.75)); }
.lg-brand { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 48px 44px; color: #fff; background: var(--accent-grad); overflow: hidden; }
.lg-brand::before, .lg-brand::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none; }
.lg-brand::before { width: 340px; height: 340px; right: -120px; top: -120px; }
.lg-brand::after { width: 220px; height: 220px; left: -80px; bottom: -90px; background: rgba(255,255,255,.08); }
.lg-brand > * { position: relative; }
.lg-mark { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: rgba(255,255,255,.95); color: var(--accent); box-shadow: 0 14px 30px -12px rgba(0,0,0,.35); overflow: hidden; }
.lg-mark img { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; }
.lg-mark svg { width: 36px; height: 36px; }
.lg-name { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 8px 0 0; overflow-wrap: anywhere; }
.lg-tag { margin: 0; font-size: 16px; opacity: .9; }
.lg-form { position: relative; padding: 44px 44px 30px; display: flex; flex-direction: column; background: var(--bg) !important; }
.lg-form h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 0 0 22px; }
.lg-sub { color: var(--ink-2); margin: -14px 0 22px; font-size: 15px; line-height: 1.45; }
.lg-form .alert { margin-bottom: 14px; }
.lg-continue { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--green-tint); color: var(--ink); font-size: 14px; }
.lg-continue b { color: var(--green-ink); white-space: nowrap; }
.lg-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.lg-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.lg-input { position: relative; display: flex; align-items: center; height: 52px; border-radius: 14px; background: var(--fill); transition: box-shadow .2s, background .2s; }
.lg-input:focus-within { background: var(--glass-strong, #fff); box-shadow: 0 0 0 3px var(--accent); }
.lg-input > svg { width: 20px; height: 20px; margin: 0 2px 0 14px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-input:focus-within > svg { stroke: var(--accent); }
.lg-input input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); outline: none; box-shadow: none; }
.lg-input input::placeholder { color: var(--ink-3); }
.lg-eye { flex: none; height: 36px; margin-right: 8px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.lg-submit { height: 54px; font-size: 16.5px; gap: 8px; margin-top: 8px; }
.lg-submit svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lg-legal { margin: 18px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }
.lg-legal a { color: var(--ink-2); text-decoration: underline; }
/* phones and small tablets: one see-through glass card (iPhone style) */
@media (max-width: 860px) {
  .lg-shell { grid-template-columns: minmax(0, 1fr); width: min(440px, 100%); border-radius: 34px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow), 0 30px 80px -40px rgba(0,0,0,.25); }
  .lg-brand { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 30px 30px 0; color: var(--ink); background: none; overflow: visible; }
  .lg-brand::before, .lg-brand::after, .lg-tag { display: none; }
  .lg-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-grad); color: #fff; box-shadow: none; }
  .lg-mark img { width: 34px; height: 34px; border-radius: 9px; background: #fff; }
  .lg-mark svg { width: 20px; height: 20px; }
  .lg-name { font-size: 17px; font-weight: 600; letter-spacing: 0; margin: 0; }
  .lg-form { padding: 22px 30px 28px; background: transparent !important; }
  .lg-form h1 { font-size: 30px; margin-bottom: 20px; }
}
@media (max-width: 380px) { .lg-brand { padding: 24px 22px 0; } .lg-form { padding: 20px 22px 24px; } }
.lg-form, .lg-field, .lg-input { min-width: 0; }
@media (max-width: 860px) { .lg-input > svg { display: none; } .lg-input input { padding: 0 16px; } }
.fit-person { gap: 4px; padding-right: 6px; }
.fit-person a { color: var(--ink); }
.fit-person-x { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.fit-person-x:hover { background: var(--red-tint); color: var(--red-ink); }
.fit-rm { color: var(--red-ink) !important; }

/* ═══════════════ Opening animation (once per launch, normal phones) ═══════════════ */
html.splash body::before { content: ''; position: fixed; inset: 0; z-index: 9998; background: var(--bg); pointer-events: none; transition: opacity .35s ease; }
html.splash body::after { content: ''; position: fixed; left: 50%; top: 50%; z-index: 9999; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 22px; pointer-events: none;
  background: var(--splash-img) center / cover no-repeat; box-shadow: 0 18px 40px -18px rgba(0,0,0,.35); animation: splashIn .55s cubic-bezier(.2,.9,.3,1.2) both; transition: opacity .3s ease, transform .35s ease; }
html.splash-out body::before { opacity: 0; }
html.splash-out body::after { opacity: 0; transform: scale(1.08); }
@keyframes splashIn { from { opacity: 0; transform: scale(.82); } }

/* ═══════════════ Low-end phones: same layout, no animation, no live blur ═══════════════ */
.lite *, .lite *::before, .lite *::after { animation: none !important; transition: none !important; }
.lite .bg-orbs, .lite .auth-bg { display: none !important; }
.lite, .lite body { background: var(--bg) !important; }
.lite * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.lite { --glass: rgba(255,255,255,.97); --glass-strong: #fff; --glass-thick: #fff; }
.lite[data-mode="dark"] { --glass: rgba(30,30,32,.98); --glass-strong: #2c2c2e; --glass-thick: #2c2c2e; }
.lite .card, .lite .glass, .lite .sheet, .lite .menu, .lite .m-tabbar, .lite .tabbar, .lite .nav-pill, .lite .lg-shell { box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 .5px var(--sep, rgba(0,0,0,.08)) !important; }
.lite .sheet { background: var(--bg) !important; }

/* BMR calculator (member form) */
.bmr-box { padding: 14px 16px; border-radius: 18px; background: var(--fill); }
.bmr-box .muted .i { vertical-align: -3px; margin-right: 4px; }
.bmr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bmr-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bmr-grid b { font-size: 20px; letter-spacing: -.02em; }
.bmr-grid em { font-style: normal; opacity: .7; }
.bmr-grid .badge { align-self: flex-start; }
.bmr-grid .span-3 { grid-column: span 3; }
@media (max-width: 560px) { .bmr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bmr-grid .span-3 { grid-column: span 1; } }
