/* Shift — Echo Chart design system (same tokens, fonts, buttons, layout). Dark is the default; html.light for light. */
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations'); 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 Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations'); 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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono Variable'; font-style: normal; font-display: swap; font-weight: 100 800; src: url(/fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2-variations'); 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; }
:root {
  --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif; --font-mono: 'JetBrains Mono Variable', ui-monospace, monospace;
  --h-bg: 200 25% 6%; --h-fg: 180 15% 94%; --h-card: 200 22% 9%; --h-primary: 174 80% 45%; --h-primary-fg: 200 30% 6%;
  --h-secondary: 200 18% 14%; --h-muted-fg: 190 10% 62%; --h-accent: 200 18% 16%; --h-destructive: 0 72% 55%; --h-border: 200 16% 18%;
  --bg: hsl(var(--h-bg)); --card: hsl(var(--h-card)); --text: hsl(var(--h-fg)); --muted: hsl(var(--h-muted-fg)); --line: hsl(var(--h-border));
  --teal: hsl(var(--h-primary)); --teal-ink: hsl(var(--h-primary-fg)); --teal-soft: hsl(var(--h-primary) / .12); --closed: hsl(200 25% 7.5%); --danger: hsl(var(--h-destructive));
  --secondary: hsl(var(--h-secondary)); --accent: hsl(var(--h-accent));
  --glow: 0 0 16px -4px hsl(var(--h-primary) / .5); --glow-lg: 0 0 32px -6px hsl(var(--h-primary) / .55);
  --radius: 12px; --rmd: 10px; --nav-h: 64px; color-scheme: dark;
}
html.light {
  --h-bg: 210 20% 98%; --h-fg: 215 25% 14%; --h-card: 0 0% 100%; --h-primary: 174 80% 32%; --h-primary-fg: 0 0% 100%;
  --h-secondary: 214 20% 94%; --h-muted-fg: 215 12% 40%; --h-accent: 214 20% 92%; --h-destructive: 0 72% 48%; --h-border: 214 16% 87%;
  --closed: hsl(214 20% 95.5%); --glow: 0 1px 6px hsl(215 25% 14% / .1); --glow-lg: 0 2px 14px hsl(215 25% 14% / .12); color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font-sans); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

#app { display: flex; flex-direction: column; height: 100dvh; max-width: 980px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.top h1 { flex: 1; font-size: 20px; }
main { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 18px; -webkit-overflow-scrolling: touch; }
nav.tabs { height: var(--nav-h); display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { flex: 1; background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; position: relative; }
nav.tabs button svg { width: 24px; height: 24px; }
nav.tabs button.on { color: var(--teal); }
nav.tabs button.on svg { filter: drop-shadow(0 0 6px rgba(20,184,166,.7)); }
.badge { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--teal); color: var(--teal-ink); font-size: 10px; font-weight: 700; display: grid; place-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.btn { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; transition: .15s; }
.btn:hover { border-color: var(--teal); box-shadow: var(--glow); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); font-weight: 650; }
.btn.danger { color: var(--danger); } .btn.danger:hover { border-color: var(--danger); box-shadow: none; }
.btn.sm { padding: 6px 10px; font-size: 13px; } .btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
input, select, textarea { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: var(--glow); }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.row { display: flex; gap: 10px; align-items: center; } .row > .grow { flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--teal-soft); font-size: 12px; }
.pill.ok { background: var(--teal); color: var(--teal-ink); font-weight: 650; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 6px 12px; color: var(--muted); }
.seg button.on { background: var(--teal-soft); color: var(--text); box-shadow: var(--glow); font-weight: 600; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--teal); box-shadow: var(--glow); }
.logo svg { width: 18px; height: 18px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* switch */
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 15px; background: var(--line); transition: .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: var(--teal); box-shadow: var(--glow); } .switch input:checked + i::after { left: 25px; }

/* bottom sheet */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 620px; max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 8px 16px 22px; box-shadow: var(--glow); animation: up .18s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); background: var(--teal); color: var(--teal-ink); padding: 10px 18px; border-radius: 14px; box-shadow: var(--glow); z-index: 60; font-weight: 600; }

/* calendar grids */
.calbar { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; flex-wrap: wrap; }
.calbar .title { flex: 1; font-weight: 650; font-size: 17px; min-width: 140px; }
.tgrid { max-height: calc(100dvh - 235px); display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; position: relative; }
.tgrid .hd { position: sticky; top: 0; z-index: 4; background: var(--card); border-bottom: 1px solid var(--line); text-align: center; padding: 6px 2px; font-size: 12px; color: var(--muted); }
.tgrid .hd b { display: block; color: var(--text); font-size: 15px; } .tgrid .hd.today b { color: var(--teal); }
.gut { position: relative; border-right: 1px solid var(--line); }
.gut span { position: absolute; right: 6px; font-size: 10.5px; color: var(--muted); transform: translateY(-50%); }
.dcol { position: relative; border-right: 1px solid var(--line); background: var(--closed); cursor: cell; }
.dcol:last-child { border-right: 0; }
.dcol .band { position: absolute; left: 0; right: 0; background: var(--card); }
.dcol .lines { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px); opacity: .9; }
.appt { position: absolute; left: 3px; right: 3px; border-radius: 10px; padding: 4px 7px; font-size: 12px; overflow: hidden; color: #04201d; border-left: 4px solid rgba(0,0,0,.28); box-shadow: 0 1px 5px rgba(0,0,0,.2); cursor: pointer; z-index: 2; }
.appt:hover { box-shadow: var(--glow); }
.appt.arrived::after { content: '✓'; position: absolute; top: 3px; right: 7px; font-weight: 800; }
.appt .sub { opacity: .8; font-size: 11px; }
.blk { position: absolute; left: 3px; right: 3px; border-radius: 8px; z-index: 1; background: repeating-linear-gradient(45deg, rgba(120,140,140,.35) 0 6px, rgba(120,140,140,.15) 6px 12px); font-size: 11px; padding: 3px 6px; color: var(--muted); cursor: pointer; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--teal); box-shadow: 0 0 8px var(--teal); z-index: 3; pointer-events: none; }

.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.month .dow { background: var(--card); text-align: center; font-size: 11px; color: var(--muted); padding: 6px 0; }
.month .cell { background: var(--card); min-height: 62px; padding: 5px; border: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.month .cell.out { background: var(--closed); color: var(--muted); }
.month .cell.today .n { background: var(--teal); color: var(--teal-ink); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-weight: 700; }
.month .cell.sel { box-shadow: inset 0 0 0 2px var(--teal); }
.month .dots { display: flex; gap: 3px; flex-wrap: wrap; } .month .dots i { width: 7px; height: 7px; border-radius: 50%; }
.month .more { font-size: 10px; color: var(--muted); }

/* availability painter */
.avgrid { display: grid; grid-template-columns: 44px repeat(7, 1fr); user-select: none; -webkit-user-select: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.avgrid.paint { touch-action: none; }
.avgrid .h { text-align: center; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 2; }
.avgrid .t { font-size: 10px; color: var(--muted); text-align: right; padding-right: 5px; height: 24px; border-right: 1px solid var(--line); transform: translateY(-7px); }
.acell { height: 24px; border-right: 1px solid var(--line); border-bottom: 1px dashed var(--line); background: var(--card); }
.acell.hr { border-top: 1px solid var(--line); }
.acell.on { background: var(--teal); box-shadow: inset 0 0 8px rgba(255,255,255,.25); }

/* booking slots */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.chip { flex: none; text-align: left; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); min-width: 130px; }
.chip.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: var(--glow); }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 10px; }
.day { flex: none; width: 54px; padding: 8px 0; text-align: center; border-radius: 14px; border: 1px solid var(--line); background: var(--card); position: relative; }
.day b { display: block; font-size: 17px; } .day small { color: var(--muted); }
.day.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: var(--glow); }
.day.none { opacity: .45; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 640px) { .slots { grid-template-columns: repeat(6, 1fr); } }
.slot { padding: 11px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: center; }
.slot.ok:hover, .slot.sel { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); box-shadow: var(--glow); }
.slot:disabled { color: var(--muted); background: repeating-linear-gradient(45deg, transparent 0 6px, var(--line) 6px 8px); cursor: not-allowed; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 260px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 2px; max-height: 320px; }
.chat.full .msgs { max-height: none; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--teal); color: var(--teal-ink); border-color: var(--teal); }
.msg small { display: block; opacity: .65; font-size: 10px; margin-top: 2px; }
.composer { display: flex; gap: 8px; margin-top: 8px; } .composer input { flex: 1; }
.list .item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.list .item:hover { border-color: var(--teal); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--teal-soft); display: grid; place-items: center; font-weight: 700; color: var(--teal); flex: none; }
.dotbadge { background: var(--teal); color: var(--teal-ink); border-radius: 10px; min-width: 20px; height: 20px; display: grid; place-items: center; font-size: 11px; font-weight: 700; padding: 0 5px; }
.login { max-width: 420px; margin: 8vh auto 0; padding: 0 18px; text-align: center; }
.login .big { font-size: 32px; font-weight: 750; margin: 10px 0 4px; }

.gut span:first-child { transform: none; top: 3px !important; }
.tgrid .appt b { white-space: nowrap; } .tgrid .appt { min-width: 0; }

/* ---------- v0.2 additions ---------- */

/* clinic / session filter chips */
.fchips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.fchip i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.fchip.on { border-color: var(--c, var(--teal)); box-shadow: 0 0 0 1px var(--c, var(--teal)) inset, 0 4px 16px color-mix(in srgb, var(--c, var(--teal)) 30%, transparent); }
.fchip.off { opacity: .45; }
.fchip.off i { background: transparent !important; box-shadow: 0 0 0 2px var(--c, var(--muted)) inset; }

/* week strip (phone) */
.wstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 10px; }
.wday { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 7px 0 6px; text-align: center; min-width: 0; }
.wday small { color: var(--muted); display: block; font-size: 11px; } .wday b { display: block; font-size: 17px; }
.wday .wd { display: flex; justify-content: center; gap: 3px; min-height: 8px; margin-top: 3px; flex-wrap: wrap; padding: 0 4px; }
.wday .wd i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.wday.today b { color: var(--teal); } .wday.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: var(--glow); }
.wday .cnt { font-size: 10px; color: var(--muted); }

/* colour picking & brush */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.sw.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--card) inset; }
.brush { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; }
.acell.on { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0; } .meter i { display: block; height: 100%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.meter.hot i { background: #f59e0b; box-shadow: 0 0 10px #f59e0b; }
.loc { display: inline-flex; align-items: center; gap: 6px; } .loc i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.slot small { display: block; font-size: 10px; opacity: .7; }
.slot .d { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.appt .vtag { font-size: 10px; opacity: .85; }

/* ===== v0.3: appointment boxes — dark grey body, light outline, clinic colour on the left, bold label on the right ===== */
.appt { background: #2a2f37 !important; color: #eef2f4 !important; border: 1px solid #6b7480; border-left: 5px solid var(--cc, #14b8a6) !important; padding-right: 34px; box-shadow: 0 1px 6px rgba(0,0,0,.28); }
.appt .sub { opacity: .72; }
.appt .lab { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 17px; letter-spacing: .3px; color: #fff; text-shadow: 0 0 10px color-mix(in srgb, var(--cc, #14b8a6) 60%, transparent); }
.appt.arrived::after { right: auto; left: auto; top: 2px; right: 8px; font-size: 11px; color: var(--cc, #14b8a6); }
.appt.arrived .lab { opacity: .6; }
.appt .vtag { display: none; }
.tgrid .appt.narrowcol { padding-right: 24px; } .tgrid .appt.narrowcol .lab { font-size: 13px; right: 5px; }

/* Hours: softer cells, and Echo-style shake while editing */
.avgrid { border-radius: 18px; }
.acell { border-right: 1px solid color-mix(in srgb, var(--line) 55%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent); }
.acell.on { border-radius: 5px; margin: 1px; border: 0; }
@keyframes shake { 0%, 100% { transform: rotate(0) translateX(0); } 20% { transform: rotate(-.7deg) translateX(-.6px); } 40% { transform: rotate(.7deg) translateX(.6px); } 60% { transform: rotate(-.5deg) translateX(-.4px); } 80% { transform: rotate(.5deg) translateX(.4px); } }
.editing .acell.on { animation: shake .34s infinite; } .editing .acell.on:nth-child(odd) { animation-delay: -.12s; } .editing .acell.on:nth-child(3n) { animation-delay: -.2s; }
.editing .acell:not(.on) { background: color-mix(in srgb, var(--card) 88%, var(--teal)); }
.avgrid:not(.editing) .acell { cursor: default; }

/* Stats */
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sbox { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-width: 0; }
.sbox.wide { grid-column: 1 / -1; }
.sbox .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.sbox .v { font-size: 28px; font-weight: 800; margin-top: 2px; } .sbox .v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.sbox .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sbox .x { position: absolute; top: -7px; left: -7px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #ef4444; color: #fff; font-weight: 800; display: none; cursor: pointer; z-index: 2; }
.sbox.add .x { background: var(--teal); color: #04201d; }
.sfilter .sbox { animation: shake .34s infinite; } .sfilter .sbox:nth-child(even) { animation-delay: -.15s; } .sfilter .sbox .x { display: grid; place-items: center; }
.sfilter .sbox.hid { opacity: .45; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 8px; }
.bars div { flex: 1; text-align: center; font-size: 10px; color: var(--muted); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars i { display: block; background: var(--teal); border-radius: 6px 6px 3px 3px; min-height: 2px; margin-bottom: 3px; } .bars .top i { box-shadow: var(--glow); }
.brk { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; } .brk i { width: 10px; height: 10px; border-radius: 50%; flex: none; } .brk .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rng { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; } .rng button { flex: none; }
.plans { display: grid; gap: 10px; margin: 12px 0; }
.plans .opt { border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; background: var(--card); text-align: left; cursor: pointer; color: var(--text); }
.plans .opt.on { border-color: var(--teal); box-shadow: var(--glow); } .plans .opt b { font-size: 20px; } .plans .opt .save { float: right; }
.vlog .ver { padding: 8px 0; border-bottom: 1px solid var(--line); } .vlog li { font-size: 13px; margin: 3px 0 0 16px; }



/* ================= Echo Chart skin ================= */
.mono { font-family: var(--font-mono); }
h1, h2, h3 { letter-spacing: -.01em; font-weight: 700; }
.top h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

/* buttons — shadcn: outline default, primary, secondary, destructive */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; height: 36px; padding: 0 16px; border-radius: var(--rmd); font-size: 14px; font-weight: 500; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: background-color .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--accent); border-color: var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.btn:focus-visible, input:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--teal); }
.btn.primary { background: var(--teal); border-color: transparent; color: var(--teal-ink); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.btn.primary:hover { background: hsl(var(--h-primary) / .9); }
.btn.danger { color: var(--danger); border-color: hsl(var(--h-destructive) / .4); } .btn.danger:hover { background: hsl(var(--h-destructive) / .08); border-color: hsl(var(--h-destructive) / .4); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; font-weight: 700; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary.sm { font-weight: 800; }

/* inputs — h-9, transparent, rounded-md */
input, select, textarea { background: transparent; border: 1px solid var(--line); border-radius: var(--rmd); padding: 0 12px; height: 36px; font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.12); transition: border-color .15s; }
textarea { height: auto; padding: 8px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
select { background: var(--card); } select option { background: var(--card); color: var(--text); }
input[type=checkbox], input[type=radio] { height: auto; width: auto; box-shadow: none; accent-color: hsl(var(--h-primary)); }
label { font-size: 12px; font-weight: 500; color: var(--muted); }

/* cards */
.card { border-radius: 12px; padding: 18px; background: var(--card); }
.card > h3:first-child, .sec { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }
.pill { background: hsl(var(--h-primary) / .1); color: var(--teal); border: 1px solid hsl(var(--h-primary) / .2); font-weight: 600; }
.pill.ok { background: var(--teal); color: var(--teal-ink); border-color: transparent; }
.seg { border-radius: var(--rmd); background: var(--secondary); border: 0; }
.seg button { border-radius: 8px; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--card); color: var(--teal); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.logo { border-radius: 8px; background: var(--teal); box-shadow: var(--glow); }

/* switch — h-5 w-9 */
.switch { width: 36px; height: 20px; }
.switch i { border-radius: 10px; background: var(--line); }
.switch i::after { width: 16px; height: 16px; top: 2px; left: 2px; background: var(--text); }
.switch input:checked + i { background: var(--teal); box-shadow: none; } .switch input:checked + i::after { left: 18px; background: var(--teal-ink); }

/* sheets, toast */
.sheet { border-radius: 16px 16px 0 0; background: var(--card); border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -8px 40px rgba(0,0,0,.4); }
.toast { background: var(--card); color: var(--text); border: 1px solid hsl(var(--h-primary) / .4); box-shadow: var(--glow); font-weight: 600; border-radius: var(--rmd); }
.badge, .dotbadge { background: var(--teal); color: var(--teal-ink); }
.msg.me { background: var(--teal); }
.tgrid, .avgrid, .month { border-radius: 12px; }
.avgrid { border-radius: 12px; }

/* ---- layout: Echo Chart AppLayout ---- */
#app { max-width: none; margin: 0; }
.tile { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--teal); box-shadow: var(--glow); flex: none; }
.tile svg { width: 18px; height: 18px; }
.wm { font-weight: 900; letter-spacing: -.025em; font-size: 14px; white-space: nowrap; }
.wm i { font-style: normal; color: var(--teal); }
.side { display: contents; }
.sbrand, .sfoot, .top .bv { display: none; }
.mhead { order: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: hsl(var(--h-card) / .98); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.mhead .tile { width: 28px; height: 28px; } .mhead .tile svg { width: 16px; height: 16px; }
.mhead .l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mhead .wm { text-transform: none; }
.mhead .r { font-size: 14px; font-weight: 900; text-transform: uppercase; color: hsl(var(--h-muted-fg) / .8); white-space: nowrap; }
.top { order: 1; } main { order: 2; } nav.tabs { order: 3; }
nav.tabs { background: hsl(var(--h-card) / .98); backdrop-filter: blur(16px); border-top: 1px solid var(--line); height: auto; min-height: var(--nav-h); }
nav.tabs button { gap: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 8px 0; }
nav.tabs button svg { width: 20px; height: 20px; stroke-width: 2; }
nav.tabs button.on { color: var(--teal); } nav.tabs button.on svg { filter: none; }
nav.tabs button .dot { display: none; }

@media (min-width: 768px) {
  #app { padding-left: 288px; }
  .side { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 288px; background: var(--card); border-right: 1px solid var(--line); z-index: 20; }
  .sbrand { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-bottom: 1px solid var(--line); text-transform: uppercase; }
  .sbrand .wm { font-size: 14px; }
  .mhead { display: none; }
  nav.tabs { order: 0; flex: 1; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 16px 12px; background: none; backdrop-filter: none; border: 0; overflow-y: auto; }
  nav.tabs button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); }
  nav.tabs button svg { width: 16px; height: 16px; }
  nav.tabs button:hover { background: var(--secondary); }
  nav.tabs button.on { background: hsl(var(--h-primary) / .1); color: var(--teal); border-color: hsl(var(--h-primary) / .2); }
  nav.tabs button .dot { display: block; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); opacity: 0; } nav.tabs button.on .dot { opacity: 1; }
  nav.tabs button .badge { position: static; margin-left: 6px; }
  .sfoot { display: block; padding: 16px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: hsl(var(--h-muted-fg) / .5); }
  .top { padding: 20px 28px 8px; }
  .top .bv { display: inline-block; order: 9; font-size: 14px; font-weight: 900; text-transform: uppercase; color: hsl(var(--h-muted-fg) / .8); }
  main { padding: 4px 28px 24px; }
  .toast { bottom: 24px; }
}

/* ---- Stats boxes: Echo Usage cards + filter shake ---- */
.sbox { border-radius: 12px; padding: 10px; min-height: 5.5rem; background: var(--card); }
.sbox .k { text-transform: none; letter-spacing: 0; font-size: 11px; }
.sbox .v { font-size: 16px; font-weight: 600; margin-top: 4px; } .sbox .v small { font-size: 11px; }
.sbox .s { font-size: 11px; }
@keyframes stat-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-.9deg); } 75% { transform: rotate(.9deg); } }
.sfilter .sbox { animation: stat-shake .28s ease-in-out infinite; }
.sfilter .sbox:nth-child(4n+1) { animation-delay: 0s; } .sfilter .sbox:nth-child(4n+2) { animation-delay: -.07s; } .sfilter .sbox:nth-child(4n+3) { animation-delay: -.14s; } .sfilter .sbox:nth-child(4n) { animation-delay: -.21s; }
.sfilter .sbox.hid { opacity: .7; filter: brightness(.45); }
.fchip, .chip, .day, .slot, .wday { border-radius: var(--rmd); }
.fchip { border-radius: 999px; }

/* ---- Splash: Echo Chart ---- */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .45s ease, visibility .45s; }
#splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
#splash .glow { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: hsl(var(--h-primary) / .1); filter: blur(64px); }
#splash .col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; }
#splash .mark { width: 128px; height: 128px; animation: splash-in .5s ease-out both, splash-glow 1.3s ease-in-out .5s infinite alternate; }
#splash .bar { width: 176px; height: 6px; border-radius: 999px; background: var(--secondary); overflow: hidden; position: relative; }
#splash .bar i { display: block; height: 100%; border-radius: 999px; background: var(--teal); box-shadow: 0 0 12px hsl(var(--h-primary) / .8); animation: splash-bar 1.8s ease-out forwards; position: relative; overflow: hidden; }
#splash .bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: splash-shine 1.1s linear infinite; }
#splash .word { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .3em; color: var(--muted); }
@keyframes splash-in { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@keyframes splash-glow { from { filter: drop-shadow(0 0 5px hsl(var(--h-primary) / .35)); } to { filter: drop-shadow(0 0 22px hsl(var(--h-primary) / .95)); } }
@keyframes splash-bar { from { width: 0; } to { width: 100%; } }
@keyframes splash-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
