/* Hospital Duty Roster – mobile-first styles. No build step. */
[hidden] { display: none !important; }
:root {
  --bg: #F3F5F4;
  --bg-2: #E9EDEB;
  --card: #FFFFFF;
  --line: #DDE3E0;
  --line-2: #EEF1EF;
  --text: #14211D;
  --text-2: #3D4A46;
  --muted: #55625E;
  --primary: #0E6B5F;
  --primary-2: #0A5249;
  --primary-soft: #E1F1EE;
  --primary-ink: #CFE8E3;
  --accent: #C2410C;
  --ok: #1E6B35; --ok-bg: #E2F3E6;
  --warn: #8A5300; --warn-bg: #FFF4DE; --warn-line: #F2B66D;
  --bad: #A3261E; --bad-bg: #F9E5E2; --bad-line: #E3B4AD;
  --info: #1D4F86; --info-bg: #E3EEF9;
  --heart: #E11D48;
  --shadow: 0 1px 2px rgba(20, 33, 29, .06), 0 4px 16px rgba(20, 33, 29, .06);
  --shadow-lg: 0 10px 40px rgba(20, 33, 29, .18);
  --radius: 16px;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1513; --bg-2: #0A100E; --card: #16201D; --line: #26332F; --line-2: #1D2825;
    --text: #E6EEEB; --text-2: #C1CDC9; --muted: #93A39E; --primary: #2BA594; --primary-2: #4CC1AF;
    --primary-soft: #133631; --primary-ink: #A9DCD3; --ok: #6FD08C; --ok-bg: #12301D;
    --warn: #F3C063; --warn-bg: #33270F; --warn-line: #6B4E16; --bad: #F39187; --bad-bg: #3A1714; --bad-line: #6E2A24;
    --info: #8DBDF2; --info-bg: #132A42; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1513; --bg-2: #0A100E; --card: #16201D; --line: #26332F; --line-2: #1D2825;
  --text: #E6EEEB; --text-2: #C1CDC9; --muted: #93A39E; --primary: #2BA594; --primary-2: #4CC1AF;
  --primary-soft: #133631; --primary-ink: #A9DCD3; --ok: #6FD08C; --ok-bg: #12301D;
  --warn: #F3C063; --warn-bg: #33270F; --warn-line: #6B4E16; --bad: #F39187; --bad-bg: #3A1714; --bad-line: #6E2A24;
  --info: #8DBDF2; --info-bg: #132A42; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.b { font-weight: 700; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }

/* ------------------------------------------------------------------ splash + loaders */
.splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--primary); color: #fff; transition: opacity .45s ease, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash .cross { width: 76px; height: 76px; border-radius: 22px; background: rgba(255,255,255,.14); display: grid; place-items: center; animation: beat 1.2s ease-in-out infinite; }
.splash .cross svg { width: 42px; height: 42px; fill: #fff; }
.splash .title { font-weight: 800; font-size: 22px; letter-spacing: -.01em; }
.splash .sub { opacity: .8; font-size: 14px; margin-top: -14px; }
.ecg { width: min(320px, 80vw); height: 60px; }
.ecg path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 520; stroke-dashoffset: 520; animation: ecg 1.6s linear infinite; }
.ecg .glow { stroke-width: 7; opacity: .18; filter: blur(2px); }
@keyframes ecg { 0% { stroke-dashoffset: 520; } 70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -520; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(.98); } 45% { transform: scale(1.06); } 60% { transform: scale(1); } }

.loading-block { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; color: var(--primary); }
.loading-block .ecg { width: 200px; height: 44px; }
.loading-block p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; animation: fadeCycle 1.6s ease-in-out infinite; }
@keyframes fadeCycle { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.pulse-dots { display: inline-flex; gap: 4px; align-items: center; }
.pulse-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dot 1s ease-in-out infinite; }
.pulse-dots i:nth-child(2) { animation-delay: .15s; } .pulse-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }

.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--line-2) 25%, var(--bg-2) 37%, var(--line-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.top-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 900; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s; }
.top-progress.on { opacity: 1; }
.top-progress::before { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--primary), var(--heart), transparent); animation: slide 1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ------------------------------------------------------------------ layout */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--primary); display: grid; place-items: center; flex: none; position: relative; overflow: hidden; }
.brand-mark svg { width: 22px; height: 22px; fill: #fff; }
.brand-mark::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(14,107,95,.5); animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.45) inset; } 70%, 100% { box-shadow: 0 0 0 14px rgba(255,255,255,0) inset; } }
.brand-mark.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--line, rgba(0,0,0,.08)); }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; display: block; }
.logo-preview { width: 72px; height: 72px; border-radius: 18px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; box-shadow: inset 0 0 0 1px var(--line, rgba(0,0,0,.1)); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.logo-preview svg { width: 34px; height: 34px; fill: var(--primary); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: inline-grid; place-items: center; cursor: pointer; position: relative; flex: none; transition: transform .12s, background .2s; }
.icon-btn:active { transform: scale(.94); }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }
.badge { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--card); animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px calc(var(--nav-h) + 28px + var(--safe-b)); }
.view { display: flex; flex-direction: column; gap: 18px; animation: viewIn .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise .42s cubic-bezier(.2, .8, .2, 1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; } .stagger > *:nth-child(2) { animation-delay: .06s; } .stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .14s; } .stagger > *:nth-child(5) { animation-delay: .18s; } .stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(n+7) { animation-delay: .26s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; gap: 12px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; flex: 1; }
.page-head .sub { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.back-btn { margin-left: -6px; }

/* bottom navigation */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); box-shadow: 0 -4px 20px rgba(20,33,29,.05); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; position: relative; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.nav a .ico { position: relative; display: grid; place-items: center; width: 54px; height: 30px; border-radius: 15px; transition: background .25s, color .25s; }
.nav a.on { color: var(--primary); }
.nav a.on .ico { background: var(--primary-soft); }
.nav a.on .ico svg { animation: navBounce .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes navBounce { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
.nav a .badge { position: absolute; top: -6px; right: 4px; }

/* desktop sidebar */
.side { display: none; }
@media (min-width: 980px) {
  .app { flex-direction: row; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; width: 260px; flex: none; padding: 18px 14px; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; }
  .side .brand { padding: 4px 6px 16px; flex: none; }
  .side a.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 14px; position: relative; }
  .side a.item:hover { background: var(--bg); }
  .side a.item.on { background: var(--primary-soft); color: var(--primary); }
  .side a.item .badge { margin-left: auto; border-color: transparent; }
  .side .sep { height: 1px; background: var(--line); margin: 8px 6px; }
  .side .group { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
  .col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .nav { display: none; }
  .topbar .brand { visibility: hidden; }
  .main { padding-bottom: 40px; max-width: 980px; }
}

/* ------------------------------------------------------------------ cards + sections */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.flat { padding: 4px 16px; gap: 0; }
.card.click { cursor: pointer; transition: transform .12s, border-color .2s, box-shadow .2s; text-decoration: none; color: inherit; }
.card.click:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: var(--shadow); }
.card.click:active { transform: scale(.985); }
.card.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.card.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec-title { font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sec-head a, .link-btn { font-size: 14px; font-weight: 700; color: var(--primary); text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.row { display: flex; align-items: center; gap: 12px; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); min-height: 56px; }
.list-row:last-child { border-bottom: 0; }
.list-row.past { opacity: .55; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-box { width: 48px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.date-box small { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.date-box b { font-size: 22px; font-weight: 800; }
.date-box span { font-size: 11px; color: var(--muted); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .tiles.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tiles.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.tile b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile.alert b { color: var(--accent); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px; color: var(--muted); }
.empty svg.art { width: 92px; height: 92px; color: var(--primary); opacity: .9; }
.empty b { color: var(--text); font-size: 16px; }
.empty p { margin: 0; max-width: 300px; font-size: 14px; }

/* hero (today's duty) */
.hero { position: relative; overflow: hidden; background: var(--primary); color: #fff; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 28px rgba(14,107,95,.28); }
.hero .ecg-bg { position: absolute; left: -10px; right: -10px; bottom: 6px; height: 54px; color: rgba(255,255,255,.18); pointer-events: none; }
.hero .ecg-bg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 900; stroke-dashoffset: 900; animation: ecgOnce 2.8s ease-out .3s forwards, ecgLoop 5s linear 3.1s infinite; }
@keyframes ecgOnce { to { stroke-dashoffset: 0; } }
@keyframes ecgLoop { 0% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1800; } }
.hero .label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-ink); }
.hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.hero .time { font-family: var(--mono); font-size: 15px; color: #E3F1EE; }
.hero .with { font-size: 14px; color: #E3F1EE; position: relative; }
.hero .chip-light { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; background: #FFE7B8; color: #6B3D00; white-space: nowrap; }
.hero .chip-live { background: #FDE2E7; color: #9F1239; display: inline-flex; align-items: center; gap: 6px; }
.hero.off { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.hero.off .label { color: var(--muted); }
.hero.off .with, .hero.off .time { color: var(--muted); }
.hero.off .ecg-bg { color: color-mix(in srgb, var(--primary) 18%, transparent); }
.progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; position: relative; }
.progress i { position: absolute; inset: 0 auto 0 0; background: #fff; border-radius: inherit; transition: width .6s ease; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--heart); position: relative; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--heart); animation: liveRing 1.6s ease-out infinite; }
@keyframes liveRing { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

/* tags + chips */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.2; }
.tag .sw { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.gray { background: var(--line-2); color: var(--text-2); }
.pill.primary { background: var(--primary-soft); color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; cursor: pointer; transition: transform .12s, border-color .2s, background .2s; }
.chip.noav { padding-left: 12px; }
.chip:active { transform: scale(.96); }
.chip.me { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.leave { border-style: dashed; border-color: var(--warn-line); }
.chip .x { font-size: 11px; font-weight: 800; color: var(--warn); }
.chip.me .x { color: #FFE7B8; }
.chip.add { border-style: dashed; color: var(--primary); padding-left: 10px; background: transparent; }
.filter-chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.filter-chip.on { background: var(--text); color: var(--card); border-color: var(--text); }
.hscroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.hscroll::-webkit-scrollbar { display: none; }

/* avatars */
.av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; overflow: hidden; background: var(--primary); position: relative; text-transform: uppercase; letter-spacing: .02em; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.s36 { width: 36px; height: 36px; font-size: 13px; }
.av.s44 { width: 44px; height: 44px; font-size: 15px; }
.av.s56 { width: 56px; height: 56px; font-size: 19px; }
.av.s88 { width: 88px; height: 88px; font-size: 30px; }
.av.s112 { width: 112px; height: 112px; font-size: 38px; }
.av-stack { display: flex; }
.av-stack .av { border: 2px solid var(--card); margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }
.av-wrap { position: relative; display: inline-block; }
.av-wrap .on-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid var(--card); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; position: relative; overflow: hidden; transition: transform .12s, background .2s, box-shadow .2s, opacity .2s; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(14,107,95,.25); }
.btn-primary:hover { background: var(--primary-2); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-danger { background: var(--card); color: var(--bad); border-color: var(--bad-line); }
.btn-danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn .ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .25; transform: scale(0); animation: ripple .55s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + var(--safe-b)); z-index: 55; height: 56px; padding: 0 20px 0 16px; border-radius: 18px; border: 0; background: var(--primary); color: #fff; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 10px 24px rgba(14,107,95,.35); cursor: pointer; animation: fabIn .5s cubic-bezier(.3, 1.5, .5, 1) .2s both; text-decoration: none; }
@keyframes fabIn { from { transform: scale(.4) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 980px) { .fab { bottom: 28px; right: 32px; } }
.qa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qa { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 700; font-size: 14px; min-height: 88px; transition: transform .12s, border-color .2s; }
.qa svg { color: var(--primary); }
.qa:active { transform: scale(.96); }
.qa:hover { border-color: var(--primary); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 0 14px; font-size: 16px; color: var(--text); transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.field textarea { padding: 12px 14px; min-height: 90px; resize: vertical; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2355625E' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.field.err input, .field.err select { border-color: var(--bad); }
.field .err-msg { color: var(--bad); font-size: 13px; font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 3px; top: 2px; border: 0; background: transparent; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 48px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .25s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
.switch .txt b { display: block; font-size: 15px; }
.switch .txt small { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .full { grid-column: 1 / -1; } }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px !important; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--line) inset; }
.swatch.on { border-color: var(--card); box-shadow: 0 0 0 2px var(--text); }

/* segmented control */
.seg { display: flex; background: var(--bg-2); border-radius: 12px; padding: 4px; gap: 4px; position: relative; }
.seg button, .seg label { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 14px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative; z-index: 1; transition: color .2s; }
.seg button.on, .seg label:has(input:checked) { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(20,33,29,.12); }
.seg label input { position: absolute; opacity: 0; }
.seg label small { color: var(--muted); font-weight: 600; font-size: 11px; }
.seg .badge { border-color: transparent; }

/* week strip */
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-nav .mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.week-nav h2 { font-size: 19px; font-weight: 800; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { min-height: 64px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; position: relative; padding: 0; color: var(--text); transition: transform .12s, background .2s, color .2s; }
.day:active { transform: scale(.94); }
.day small { font-size: 11px; font-weight: 800; color: var(--muted); }
.day b { font-size: 18px; font-weight: 800; }
.day.today { border-color: var(--primary); }
.day.on { background: var(--text); border-color: var(--text); color: var(--card); }
.day.on small { color: color-mix(in srgb, var(--card) 70%, transparent); }
.day i.me { position: absolute; bottom: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.day.on i.me { background: #7FD3C4; }
.day.nodata { opacity: .55; }
.shift-card { border-left-width: 1px; position: relative; overflow: hidden; }
.shift-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc, var(--primary)); }
.shift-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shift-head b { font-size: 16px; font-weight: 800; }
.loc { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.wk-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.wk-row:last-child { border-bottom: 0; }
.wk-row.today .date-box b { color: var(--primary); }
.wk-line { display: flex; gap: 8px; align-items: flex-start; }
.wk-line .tag { width: 76px; justify-content: center; overflow: hidden; text-overflow: ellipsis; }
.wk-names { flex: 1; display: flex; flex-wrap: wrap; column-gap: 6px; row-gap: 2px; font-size: 14px; font-weight: 600; padding-top: 2px; }
.wk-names .me { color: var(--primary); font-weight: 800; }
/* full roster table (Excel layout) */
.seg.seg-sm { padding: 3px; }
.seg.seg-sm button { min-height: 32px; font-size: 13px; padding: 0 14px; }
.rg-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overscroll-behavior-x: contain; }
.rgrid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.rgrid td { min-width: 92px; word-break: break-word; }
.rgrid th, .rgrid td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 8px 7px; vertical-align: top; text-align: left; }
.rgrid tr > :last-child { border-right: 0; }
.rgrid tbody tr:last-child > * { border-bottom: 0; }
.rgrid thead th { position: sticky; top: 0; z-index: 2; background: var(--card); font-size: 12px; min-width: 92px; max-width: 170px; border-bottom: 2px solid var(--line); box-shadow: inset 0 3px 0 var(--sc, transparent); }
.rgrid thead th b { display: block; font-weight: 800; font-size: 13px; color: var(--text); }
.rgrid thead th span { display: block; color: var(--muted); font-size: 10px; font-weight: 600; margin-top: 2px; }
.rgrid .rg-date { position: sticky; left: 0; z-index: 1; background: var(--card); width: 54px; min-width: 54px; text-align: center; padding: 8px 4px; border-right: 1px solid var(--line); line-height: 1.1; }
.rgrid thead .rg-date { z-index: 3; vertical-align: bottom; font-size: 11px; color: var(--muted); }
.rg-date small { display: block; font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.rg-date b { display: block; font-size: 19px; font-weight: 800; }
.rg-date span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.rgrid tr.sun > * { background: color-mix(in srgb, var(--bg-2) 55%, var(--card)); }
.rgrid tr.today > * { background: var(--primary-soft); }
.rgrid tr.today .rg-date b { color: var(--primary); }
.rgrid tr.dim > td { opacity: .35; }
.rg-name { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 3px 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; line-height: 1.3; border-radius: 6px; }
.rg-name + .rg-name { border-top: 1px dashed var(--line-2); }
.rg-name.me { color: var(--primary); font-weight: 800; }
.rg-name.hit { background: var(--warn-bg); color: var(--warn); padding-left: 4px; }
.rg-name.leave { text-decoration: line-through; text-decoration-color: var(--bad); }
.rg-name small { display: inline-block; margin-left: 4px; font-size: 10px; font-weight: 800; color: var(--bad); text-transform: uppercase; text-decoration: none; }
.rg-empty { color: var(--muted); font-size: 12px; }
.rg-none { color: var(--muted); font-size: 12px; font-style: italic; vertical-align: middle !important; }
.rg-add { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-top: 4px; border: 1px dashed var(--line); border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
@media (min-width: 900px) { .rgrid { font-size: 14px; } .rgrid thead th { min-width: 150px; max-width: none; } }
@media print {
  .rg-wrap { overflow: visible; border: 1px solid #999; box-shadow: none; }
  .rgrid { min-width: 0; font-size: 11px; }
  .rgrid th, .rgrid td { border-color: #bbb; padding: 4px 6px; }
  .rgrid .rg-date, .rgrid thead th { position: static; }
  .rg-add { display: none; }
}

.banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; background: var(--line-2); color: var(--text-2); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.draft { background: repeating-linear-gradient(-45deg, var(--warn-bg), var(--warn-bg) 10px, color-mix(in srgb, var(--warn-bg) 60%, var(--card)) 10px, color-mix(in srgb, var(--warn-bg) 60%, var(--card)) 20px); color: var(--warn); border: 1px dashed var(--warn-line); }

/* swap visuals */
.swap-vis { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); align-items: center; gap: 6px; }
.swap-side { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.swap-side .who { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; min-width: 0; }
.swap-side .what { font-size: 13px; color: var(--text-2); }
.swap-arrow { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.swap-arrow svg { animation: swapSpin 2.6s ease-in-out infinite; }
@keyframes swapSpin { 0%, 70% { transform: rotate(0); } 85%, 100% { transform: rotate(180deg); } }
.swap-vis.done .swap-side:first-child { animation: swapL .7s cubic-bezier(.5, 0, .3, 1); }
.swap-vis.done .swap-side:last-child { animation: swapR .7s cubic-bezier(.5, 0, .3, 1); }
@keyframes swapL { 50% { transform: translateX(60%) scale(.92); opacity: .6; } }
@keyframes swapR { 50% { transform: translateX(-60%) scale(.92); opacity: .6; } }
.checks-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin: 0; padding: 0; list-style: none; }
.checks-list li { display: flex; gap: 8px; align-items: flex-start; }
.checks-list .ok { color: var(--ok); font-weight: 600; }
.checks-list .warn { color: var(--warn); font-weight: 700; }
.checks-list .bad { color: var(--bad); font-weight: 700; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .3s; }
.steps i.on { background: var(--primary); }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; text-align: left; width: 100%; transition: border-color .2s, background .2s, transform .12s; color: var(--text); }
.pick:active { transform: scale(.985); }
.pick.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.pick[disabled] { opacity: .5; cursor: not-allowed; }
.pick .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: border-color .2s; }
.pick.on .radio { border-color: var(--primary); }
.pick.on .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); animation: pop .25s; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }

/* sheets / modals */
.backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(10, 20, 17, .45); opacity: 0; transition: opacity .25s; }
.backdrop.in { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 201; max-height: 92dvh; display: flex; flex-direction: column; background: var(--card); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .25, 1); padding-bottom: var(--safe-b); }
.sheet.in { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; }
.sheet-head h2 { flex: 1; font-size: 19px; font-weight: 800; }
.sheet-body { overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 680px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; max-height: 86dvh; border-radius: 22px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .28s cubic-bezier(.2, .9, .25, 1), opacity .2s; }
  .sheet.in { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
}

/* toast */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 980px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; max-width: 480px; width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #14211D; color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .35s cubic-bezier(.2, 1.3, .4, 1); }
.toast.out { animation: toastOut .25s ease forwards; }
.toast.err { background: #8A2A1F; }
.toast.ok svg { color: #7FD3C4; }
@keyframes toastIn { from { transform: translateY(20px) scale(.95); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

/* success animation */
.success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 8px 8px; position: relative; }
.check-anim svg { width: 84px; height: 84px; }
.check-anim circle { fill: none; stroke: var(--primary); stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .6s ease-out forwards; }
.check-anim path { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .35s ease-out .5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.burst { position: absolute; left: 50%; top: 60px; pointer-events: none; }
.burst i { position: absolute; width: 12px; height: 12px; margin: -6px; color: var(--c, var(--primary)); animation: burst .9s cubic-bezier(.1, .8, .3, 1) forwards; }
.burst i::before, .burst i::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; }
.burst i::before { left: 4px; top: 0; width: 4px; height: 12px; }
.burst i::after { left: 0; top: 4px; width: 12px; height: 4px; }
@keyframes burst { 0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(1) rotate(160deg); opacity: 0; } }

/* login */
.login { min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-top { position: relative; background: var(--primary); color: #fff; padding: calc(44px + var(--safe-t)) 24px 64px; overflow: hidden; }
.login-top h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; position: relative; }
.login-top p { margin: 6px 0 0; color: var(--primary-ink); font-weight: 600; position: relative; }
.login-top .brand-mark { width: 60px; height: 60px; border-radius: 18px; background: rgba(255,255,255,.15); margin-bottom: 22px; animation: beat 2.4s ease-in-out infinite; }
.login-top .brand-mark.has-logo { width: 84px; height: 84px; border-radius: 22px; background: #fff; }
.login-top .brand-mark svg { width: 32px; height: 32px; }
.login-top .ecg-run { position: absolute; left: 0; right: 0; bottom: 18px; height: 60px; color: rgba(255,255,255,.35); }
.login-top .ecg-run path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: ecgRun 3.2s linear infinite; }
@keyframes ecgRun { to { stroke-dashoffset: -1200; } }
.floaties { position: absolute; inset: 0; pointer-events: none; }
.floaties svg { position: absolute; color: rgba(255,255,255,.13); animation: float 9s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(12deg); } }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: -6px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.join-code { font-size: 28px; font-weight: 800; letter-spacing: .4em; text-align: center; text-transform: uppercase; }
.code-big { font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: .3em; color: var(--primary); }
.login-card { position: relative; margin: -36px 16px 24px; background: var(--card); border-radius: 22px; padding: 22px 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; animation: rise .5s cubic-bezier(.2, .8, .2, 1) .1s both; }
@media (min-width: 560px) { .login-card { max-width: 440px; margin-left: auto; margin-right: auto; width: 100%; } .login-top { text-align: center; } .login-top .brand-mark { margin-left: auto; margin-right: auto; } }
.login-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 24px 24px; margin-top: auto; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.alert-error { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* profile */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px 0; }
.profile-head h2 { font-size: 22px; font-weight: 800; }
.photo-edit { position: relative; cursor: pointer; border: 0; padding: 0; background: none; border-radius: 50%; }
.photo-edit .cam { position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; border: 3px solid var(--card); }
.photo-edit .ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--primary) 50%, transparent); animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.menu-list { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--text); font-weight: 600; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; font-size: 15px; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi { width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.menu-item .chev { margin-left: auto; color: var(--muted); }
.menu-item small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.more-tile { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--text); min-height: 110px; position: relative; transition: transform .12s, border-color .2s; }
.more-tile:active { transform: scale(.97); }
.more-tile:hover { border-color: var(--primary); }
.more-tile .mi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.more-tile b { font-size: 15px; }
.more-tile small { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: -6px; }
.more-tile .badge { position: absolute; top: 12px; right: 12px; border-color: transparent; }

/* tables + bars */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
table.t th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 54px; gap: 10px; align-items: center; font-size: 14px; }
.bar { height: 12px; border-radius: 6px; background: var(--line-2); overflow: hidden; display: flex; }
.bar i { height: 100%; transform-origin: left; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* notifications */
.notif { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; }
.notif:last-child { border-bottom: 0; }
.notif .ni { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--text-2); }
.notif.unread .ni { background: var(--primary-soft); color: var(--primary); }
.notif.unread b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; }
.notif p { margin: 2px 0 0; font-size: 14px; color: var(--text-2); }

/* notices */
.notice { border-left: 4px solid var(--primary); }
.notice.urgent { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.notice h3 { font-size: 16px; font-weight: 800; }
.notice .body { font-size: 14px; color: var(--text-2); white-space: pre-wrap; }

/* drop zone */
.drop { border: 2px dashed var(--line); border-radius: 18px; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer; background: var(--card); transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop svg.art { width: 64px; height: 64px; color: var(--primary); animation: float 3s ease-in-out infinite; }
.map-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.map-row:last-child { border-bottom: 0; }
@media (min-width: 560px) { .map-row { grid-template-columns: 1fr 1fr; align-items: center; } }
details.acc { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
details.acc summary { padding: 14px 16px; font-weight: 700; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
details.acc[open] summary::after { transform: rotate(-135deg); }
details.acc .acc-body { padding: 0 16px 14px; }

/* pull to refresh */
.ptr { height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--primary); transition: height .2s; }
.ptr .ecg { width: 140px; height: 36px; }
.ptr.ready .ecg path { animation-duration: .9s; }

/* offline */
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 950; background: var(--warn); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: calc(4px + var(--safe-t)) 8px 4px; transform: translateY(-100%); transition: transform .3s; }
.offline-bar.on { transform: none; }

/* install page */
.install-page { background: var(--bg); }
.install { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.install-head { display: flex; align-items: center; gap: 14px; }
.install-head h1 { font-size: 24px; font-weight: 800; }
.install-head p { margin: 2px 0 0; color: var(--muted); font-weight: 600; }
.install .ecg-line { width: 100%; height: 40px; color: var(--primary); }
.install .ecg-line path { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 800; stroke-dashoffset: 800; animation: ecgRun 4s linear infinite; }
.install h2 { font-size: 18px; font-weight: 800; }
.install .card p { margin: 0; }
.install .note { background: var(--info-bg); color: var(--info); padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.install .note.warn { background: var(--warn-bg); color: var(--warn); }
.install-form { display: flex; flex-direction: column; gap: 16px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checks li small { display: block; color: var(--muted); }
.checks .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: none; }
.checks .ok .dot { background: #22C55E; } .checks .warn .dot { background: #F59E0B; } .checks .bad .dot { background: #DC2626; }
.install-done { align-items: center; text-align: center; }

/* print */
@media print {
  .nav, .side, .topbar, .fab, .no-print, .toasts, .ptr { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .main { padding: 0; max-width: none; }
  .card { border: 1px solid #999; break-inside: avoid; box-shadow: none; }
  .print-only { display: block !important; }
  .chip { border: 1px solid #999; background: #fff !important; color: #000 !important; }
  .view { animation: none; }
}
.print-only { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* --- forms in sheets, wrapping button rows, small icon buttons --- */
.form-col { display: flex; flex-direction: column; gap: 14px; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-row.wrap > .btn { flex: 1 1 auto; }
.icon-btn.sm { width: 40px; height: 40px; border-radius: 10px; }
.board-card { border-color: var(--warn-line); }
.av.s28 { width: 28px; height: 28px; font-size: 11px; }
.list-row.top { align-items: flex-start; }
.av.s48 { width: 48px; height: 48px; font-size: 16px; }
.swatch.ic { display: inline-grid; place-items: center; background: var(--card); color: var(--text-2); border-radius: 12px; width: 44px; height: 44px; }
.swatch.ic.on { color: var(--primary); background: var(--primary-soft); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.dept-card { border-top: 4px solid var(--dc, var(--primary)); }
.hero-pub.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.rise { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.icon-btn.call { background: var(--primary); color: #fff; border-color: var(--primary); }
.seg .live-dot { margin-right: 4px; }
