
/* Layout: slim top bar, then a board of six client cards for the gym TV (each card: timer, coach note, exercises with free text for plan and result), and a phone frame in the second view. Dark only, on purpose: it is a screen in a gym. */
:root {
  --bg: #0e1216;
  --surface: #151b21;
  --surface-2: #1c242c;
  --line: #28323c;
  --fg: #e9eef2;
  --muted: #8e9ba8;
  --accent: #f2b33d;
  --accent-ink: #1a1304;
  --ok: #4cd08a;
  --ok-ink: #05210f;
  --info: #6fb3f2;
  --danger: #ff7a70;
  --font-display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
  font-size: clamp(13px, calc(0.55vw + 5.5px), 17px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.35;
  padding-block: 0.8rem 1rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; margin-bottom: 0.8rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; }
.brand i { width: 0.8rem; height: 0.8rem; background: var(--accent); transform: rotate(45deg); border-radius: 2px; }
.tabs { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.tabs button { padding: 0.4rem 1rem; border-radius: 6px; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.barmeta { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; color: var(--muted); font-size: 0.9rem; }
.barmeta b { color: var(--fg); font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { border: 1px solid var(--line); border-radius: 5px; padding: 0.15rem 0.5rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
button.pill { color: var(--muted); }
button.pill[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

/* ---------- shared widgets (em-based, so they scale with their context) ---------- */
.avatar { width: 2.6em; height: 2.6em; flex: none; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.2em; color: var(--accent); letter-spacing: 0.03em; }
.track { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width 0.25s; }
.tx { display: block; width: 100%; resize: none; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 0.4em 0.55em; font-size: 0.92em; line-height: 1.3; min-height: 3.1em; font-family: var(--font-body); }
.tx::placeholder { color: var(--muted); opacity: 0.7; }
.tx:hover { border-color: #3a4753; }
.tx:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 0.35em 0.75em; font-size: 0.85em; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"][data-s="done"] { background: var(--ok); color: var(--ok-ink); }
.seg button[aria-pressed="true"][data-s="skipped"] { background: color-mix(in srgb, var(--danger) 28%, var(--surface-2)); color: var(--danger); }
.ib { min-width: 1.9em; height: 1.9em; display: inline-flex; align-items: center; justify-content: center; gap: 0.2em; border-radius: 6px; color: var(--muted); font-size: 0.95em; }
.ib:hover { background: var(--surface-2); color: var(--fg); }
.ib[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ib:disabled { opacity: 0.25; cursor: default; background: none; }
.ib .n { font-size: 0.78em; font-weight: 600; font-variant-numeric: tabular-nums; }
.ib .lbl { display: none; font-size: 0.8em; font-weight: 600; }
.ib.armed { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); padding: 0 0.5em; }
.ib.armed .lbl { display: inline; }
.exnum { min-width: 1.9em; height: 1.9em; padding: 0 0.3em; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); font-family: var(--font-display); font-weight: 700; font-size: 1em; color: var(--accent); }
.st-done .exnum { background: var(--ok); color: var(--ok-ink); }
.st-skipped .exnum { background: color-mix(in srgb, var(--danger) 25%, var(--surface-2)); color: var(--danger); }

/* timer */
.timer { display: flex; flex-direction: column; gap: 0.4em; }
.trow { display: flex; align-items: center; gap: 0.5em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.3em 0.35em 0.3em 0.4em; }
.tmodebtn { display: inline-flex; align-items: center; gap: 0.3em; padding: 0.35em 0.55em; border-radius: 7px; font-size: 0.85em; font-weight: 600; color: var(--muted); text-align: left; min-width: 0; }
.tmodebtn:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.tmodebtn svg { flex: none; transition: transform 0.15s; }
.tmodebtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.tdisp { margin-left: auto; display: flex; align-items: baseline; gap: 0.6em; min-width: 0; }
.tphase { font-size: 0.78em; color: var(--muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.tnum { font-family: var(--font-display); font-weight: 700; font-size: 1.9em; line-height: 1; font-variant-numeric: tabular-nums; min-width: 2.7em; text-align: right; }
.tdisp.p-work .tnum, .tdisp.p-work .tphase { color: var(--accent); }
.tdisp.p-rest .tnum, .tdisp.p-rest .tphase { color: var(--info); }
.tdisp.p-done .tnum, .tdisp.p-done .tphase { color: var(--ok); }
.tbtn { width: 2.3em; height: 2.3em; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-size: 1em; }
.tbtn:hover { border-color: var(--accent); }
.tbtn.play { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tconf { display: flex; flex-direction: column; gap: 0.55em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.55em; }
.tmodes, .tgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em 0.6em; }
.chip { padding: 0.3em 0.7em; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-size: 0.85em; font-weight: 500; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tgroup { font-size: 0.88em; }
.tgroup label { display: inline-flex; align-items: center; gap: 0.4em; color: var(--muted); }
.tgroup input { width: 3.6em; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 0.3em 0.2em; color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.tgroup .sep { width: 100%; height: 0; }

/* ---------- TV board ---------- */
.tv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); gap: 0.8rem; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.chead { display: flex; align-items: center; gap: 0.65rem; }
.cname { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1; }
.csub { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.count { margin-left: auto; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cnote { display: flex; flex-direction: column; gap: 0.2rem; }
.lab { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.cbody { display: flex; flex-direction: column; gap: 0.5rem; min-height: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; padding-top: 0.1rem; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.ex { display: flex; flex-direction: column; gap: 0.35rem; }
.ex.solo { padding-top: 0.5rem; border-top: 1px solid var(--line); }
.exrow1 { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.exname { flex: 1 1 8rem; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 0.2rem 0.4rem; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.15; }
.exname:hover { border-color: var(--line); }
.exname:focus { outline: 2px solid var(--accent); background: var(--bg); }
.exname::placeholder { color: var(--muted); font-weight: 500; }
.st-skipped .exname { color: var(--muted); }
.tools { display: flex; align-items: center; }
.exrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.tx.coach { background: var(--surface-2); }
.ssg { display: flex; flex-direction: column; gap: 0.5rem; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 9px; padding: 0.35rem 0.5rem 0.5rem; margin-top: 0.1rem; }
.sslab { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.ssg .ex + .ex { padding-top: 0.5rem; border-top: 1px dashed var(--line); }
.add { display: flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.2rem; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 0.9rem; flex: none; }
.add:hover { color: var(--accent); border-color: var(--accent); }
@media (min-width: 1100px) {
  .tv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) and (min-height: 760px) {
  .tv { grid-auto-rows: calc((100svh - 6.4rem) / 2); }
  .card { height: 100%; }
  .cbody { overflow-y: auto; flex: 1 1 auto; padding-right: 0.2rem; }
}

/* ---------- phone view ---------- */
.mview { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.mpick { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.95rem; }
.mpick select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.7rem; color: var(--fg); }
.phone { font-size: 15px; width: min(400px, 100%); height: min(54rem, calc(100svh - 9rem)); min-height: 32rem; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.m-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1.1em 1em 1.3em; display: flex; flex-direction: column; gap: 0.9em; }
.m-eyebrow { color: var(--muted); font-size: 0.8em; letter-spacing: 0.08em; text-transform: uppercase; }
.m-hero h2 { font-family: var(--font-display); font-weight: 700; font-size: 2.3em; line-height: 1.05; margin-top: 0.1em; }
.m-prog { margin-top: 0.7em; display: flex; flex-direction: column; gap: 0.4em; }
.m-progrow { color: var(--muted); font-size: 0.85em; }
.m-info { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0.8em 0.9em; display: flex; flex-direction: column; gap: 0.3em; }
.m-lab { color: var(--accent); font-size: 0.7em; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.m-ss { display: flex; flex-direction: column; gap: 0.6em; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 18px; padding: 0.55em 0.55em 0.6em; }
.m-sslab { color: var(--accent); font-size: 0.7em; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; padding: 0 0.4em; }
.m-ex { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0.9em; display: flex; flex-direction: column; gap: 0.65em; }
.m-ss .m-ex { background: var(--surface); }
.m-exhead { display: flex; align-items: center; gap: 0.6em; }
.m-exhead h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.55em; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.m-coach { background: var(--surface-2); border-radius: 10px; padding: 0.6em 0.75em; display: flex; flex-direction: column; gap: 0.2em; font-size: 1.02em; }
.m-res label { display: block; margin-bottom: 0.3em; }
.m-res .tx { min-height: 4.6em; font-size: 1em; border-radius: 10px; padding: 0.55em 0.7em; }
.m-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; flex-wrap: wrap; }
.m-hist { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.5em 0.8em; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 0.88em; font-weight: 500; }
.m-actions .seg button { padding: 0.6em 1em; font-size: 0.92em; }
.m-btn { padding: 0.8em 1.1em; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 1em; }
.phone .tnum { font-size: 2.6em; }
.phone .tbtn { width: 2.7em; height: 2.7em; }
.m-tabbar { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: var(--surface); }
.m-tab { display: flex; flex-direction: column; align-items: center; gap: 0.15em; padding: 0.65em 0 0.7em; color: var(--muted); font-size: 0.8em; font-weight: 500; }
.m-tab svg { width: 1.5em; height: 1.5em; }
.m-tab[aria-selected="true"] { color: var(--accent); }
.m-h { font-family: var(--font-display); font-weight: 700; font-size: 1.7em; line-height: 1.1; }
.m-hd { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.m-hd summary { display: flex; justify-content: space-between; align-items: center; gap: 0.6em; padding: 0.8em 0.9em; cursor: pointer; font-weight: 600; list-style: none; }
.m-hd summary::-webkit-details-marker { display: none; }
.m-hd summary span { color: var(--muted); font-weight: 500; font-size: 0.85em; }
.m-hd .hl { padding: 0 0.9em 0.8em; }

/* week view */
.tx:disabled { opacity: 0.55; cursor: not-allowed; }
.m-back { display: inline-flex; align-items: center; gap: 0.3em; align-self: flex-start; color: var(--muted); font-weight: 500; padding: 0.1em 0; }
.m-back:hover { color: var(--fg); }
.m-weekhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6em; }
.m-arrows { display: flex; gap: 0.35em; }
.m-arrow { width: 2.5em; height: 2.5em; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.m-arrow:hover { border-color: var(--accent); }
.m-days { display: flex; flex-direction: column; gap: 0.5em; }
.m-day { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 0.7em; align-items: stretch; }
.m-dd { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-transform: uppercase; font-size: 0.75em; letter-spacing: 0.06em; }
.m-dd b { font-family: var(--font-display); font-size: 2em; line-height: 1; letter-spacing: 0; color: var(--fg); font-weight: 600; }
.m-day.today .m-dd, .m-day.today .m-dd b { color: var(--accent); }
.m-sc { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0.8em 0.9em; }
.m-sc:hover { border-color: #3a4753; }
.m-day.today .m-sc { border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); }
.m-sc h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.45em; line-height: 1.1; }
.m-sc .meta { color: var(--muted); font-size: 0.85em; margin-top: 0.1em; }
.m-chip { flex: none; padding: 0.2em 0.7em; border-radius: 99px; font-size: 0.8em; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.m-chip.ok { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.m-chip.now { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.m-rest { display: flex; align-items: center; min-height: 3em; padding: 0.5em 0.9em; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 0.9em; }

/* lock / edit mode */
.lockbtn, .m-lock { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3em 0.65em; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface-2); }
.lockbtn { font-size: 0.82rem; }
.lockbtn:hover, .m-lock:hover { color: var(--fg); border-color: #3a4753; }
.lockbtn[aria-pressed="true"], .m-lock[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.card.editing { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.exname.ro { display: block; border-color: transparent; cursor: default; overflow-wrap: anywhere; }
.m-toprow { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; }
.m-lock { font-size: 0.85em; padding: 0.45em 0.8em; }
.m-nameinput { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.4em 0.55em; font-family: var(--font-display); font-weight: 700; font-size: 1.3em; line-height: 1.1; }
.m-nameinput:focus { outline: 2px solid var(--accent); border-color: transparent; }
.m-edtools { display: flex; align-items: center; gap: 0.15em; font-size: 1.1em; }
.m-edtools .sp { flex: 1; }
.phone .ib { min-width: 2.3em; height: 2.3em; }
.m-add { display: flex; align-items: center; justify-content: center; gap: 0.4em; padding: 0.9em; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-weight: 500; }
.m-add:hover { color: var(--accent); border-color: var(--accent); }

/* program builder */
#builder { max-width: 112rem; margin-inline: auto; font-size: 1rem; }
.btn { padding: 0.55rem 1.05rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #3a4753; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { color: var(--danger); background: transparent; border-color: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn.armed { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.btn:disabled { opacity: 0.4; cursor: default; }
.b-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 1rem; }
.b-nav { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.b-nav button { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 1rem; border-radius: 6px; color: var(--muted); font-weight: 500; }
.b-nav button[aria-selected="true"] { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.b-nav .cnt { font-size: 0.78rem; padding: 0 0.45rem; border-radius: 99px; background: var(--bg); color: var(--muted); }
.b-clients { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.b-cl { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.9rem 0.25rem 0.3rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-weight: 500; }
.b-cl .avatar { font-size: 0.8rem; border-radius: 99px; }
.b-cl:hover { color: var(--fg); }
.b-cl[aria-pressed="true"] { color: var(--fg); border-color: var(--accent); background: var(--surface-2); }
.b-weekbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.9rem; }
.b-wnav { display: flex; align-items: center; gap: 0.8rem; }
.b-wnav h2, .b-h { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; }
.b-arrow { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.b-arrow:hover { border-color: var(--accent); }
.b-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.b-hint { color: var(--muted); max-width: 60rem; margin-top: 0.3rem; }
.b-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.5rem; margin-bottom: 1.2rem; }
.b-day { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 8.5rem; min-width: 0; }
.b-dh { display: flex; align-items: baseline; gap: 0.4rem; color: var(--muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.08em; }
.b-dh b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--fg); font-weight: 600; letter-spacing: 0; }
.b-dh.today, .b-dh.today b { color: var(--accent); }
.b-sc { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; text-align: left; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 0.6rem 0.65rem; }
.b-sc:hover { border-color: #3a4753; }
.b-sc.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.b-sc h4 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; overflow-wrap: anywhere; }
.b-sc .meta { color: var(--muted); font-size: 0.82rem; }
.b-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.b-tag { font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 99px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); overflow-wrap: anywhere; }
.b-tag.mod { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.b-tag.ok { color: var(--ok); }
.b-addday { display: flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 3rem; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 0.88rem; text-align: center; }
.b-addday:hover { color: var(--accent); border-color: var(--accent); }
.b-empty { color: var(--muted); font-size: 0.85rem; padding: 0.3rem 0.2rem; }
.b-editor { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1rem; }
.b-ehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.8rem; }
.b-ehead.b-tedit { margin-bottom: 0.9rem; }
.b-trow { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; flex: 1; min-width: 0; }
.b-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.b-field.grow { flex: 1; }
.b-title { width: 100%; max-width: 32rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.7rem; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.b-trow .b-title { flex: 1; min-width: 10rem; }
.b-title:focus, .b-in:focus, .b-sel:focus, .b-num:focus { outline: 2px solid var(--accent); border-color: transparent; }
.b-banner { font-size: 0.9rem; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 0.5rem 0.75rem; }
.b-banner.mod { color: var(--accent); }
.b-banner:empty { display: none; }
.b-exlist { display: flex; flex-direction: column; gap: 0.6rem; }
.b-ex { display: grid; grid-template-columns: 2.4rem minmax(10rem, 16rem) minmax(0, 1fr) auto; gap: 0.5rem; align-items: start; }
.b-ex .exnum { margin-top: 0.35rem; }
.b-in { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.b-in.b-vid { font-family: var(--font-body); font-weight: 400; font-size: 0.95rem; }
.b-in:disabled, .b-title:disabled { opacity: 0.55; }
.b-tools { display: flex; align-items: center; margin-top: 0.15rem; }
.b-ss { border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 10px; padding: 0.4rem 0.5rem 0.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.b-sel { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.6rem; color: var(--fg); min-width: 0; }
.b-dow { width: 9rem; flex: none; }
.b-num { width: 4.5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.5rem; text-align: center; color: var(--fg); font-weight: 600; }
.b-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 0.8rem; }
.b-tc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.b-tc h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.b-plist { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.92rem; color: var(--muted); }
.b-plist b { color: var(--fg); display: inline-block; min-width: 2.3rem; }
.b-used { font-size: 0.85rem; color: var(--info); }
.b-lrow { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr) auto; gap: 0.5rem; margin-bottom: 0.4rem; align-items: center; }
.pfoot { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; }
.b-panel { width: min(36rem, 100%); }
.b-clgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.chk-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.chk-row input, .b-radio input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; }
.b-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.b-nrow { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.b-sum { background: var(--surface-2); border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.92rem; }
.b-radio { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.b-radio:has(input:checked) { border-color: var(--accent); }
.b-radio .csub { display: block; margin-top: 0.2rem; }
.m-vid { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 0.35em; padding: 0.4em 0.7em; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 0.85em; font-weight: 500; color: var(--fg); text-decoration: none; }
@media (max-width: 900px) {
  .b-ex { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .b-ex .tx, .b-ex .b-tools { grid-column: 2; }
  .b-lrow { grid-template-columns: minmax(0, 1fr) auto; }
  .b-lrow .b-vid { grid-column: 1 / -1; grid-row: 2; }
  .b-two, .b-clgrid { grid-template-columns: 1fr; }
}

/* history entries + modal */
.hlist { display: flex; flex-direction: column; gap: 0.6em; }
.hent { border-top: 1px solid var(--line); padding-top: 0.6em; display: flex; flex-direction: column; gap: 0.25em; font-size: 0.95em; }
.hent:first-child { border-top: 0; padding-top: 0; }
.hdate { display: flex; align-items: center; gap: 0.6em; color: var(--muted); font-size: 0.85em; font-weight: 600; }
.tag { padding: 0.05em 0.5em; border-radius: 99px; font-size: 0.85em; }
.tag.done { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.tag.skipped { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.hinfo { color: var(--muted); }
.empty { color: var(--muted); }
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem; background: rgba(5, 8, 10, 0.72); }
.panel { width: min(30rem, 100%); max-height: 100%; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; display: flex; flex-direction: column; gap: 0.85rem; }
.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.phead h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1; overflow-wrap: anywhere; }
.xbtn { width: 2.4rem; height: 2.4rem; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.xbtn:hover { background: var(--surface-2); color: var(--fg); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 30; background: var(--fg); color: var(--bg); padding: 0.6rem 1rem; border-radius: 99px; font-weight: 500; font-size: 0.92rem; max-width: calc(100% - 2rem); text-align: center; }

@media (max-width: 520px) {
  .barmeta { margin-left: 0; }
  .phone { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .fill, .tmodebtn svg { transition: none; } }

/* ===== real app additions ===== */
html, body { min-height: 100%; }
.boot { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.auth { display: grid; place-items: center; min-height: 80vh; }
.auth-card { width: min(26rem, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.auth-card .brand { font-size: 2rem; }
.auth-card p { color: var(--muted); }
.auth-card label { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-card input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.85rem; font-size: 1.1rem; }
.auth-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.auth-card .btn { padding: 0.8rem 1.1rem; font-size: 1.05rem; }
.auth-card form { display: flex; flex-direction: column; gap: 0.8rem; }
.err { color: var(--danger); font-size: 0.92rem; }
.live { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.live i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ok); }
.live.saving i { background: var(--accent); }
.live.off i { background: var(--danger); }
.live.off { color: var(--danger); }
.empty-note { color: var(--muted); font-size: 0.95rem; padding: 0.3rem 0; }
.phone.real { width: 100%; max-width: 560px; height: 100svh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; margin-inline: auto; }
body.client-mode { padding: 0; }
body.client-mode .bar { display: none; }
.m-foot { display: flex; flex-direction: column; gap: 0.6em; align-items: flex-start; color: var(--muted); font-size: 0.85em; }
.link-btn { color: var(--muted); text-decoration: underline; padding: 0.3em 0; }
.pick-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 60vh; overflow-y: auto; }
.pick-list .chk-row { cursor: pointer; }
.pick-list .chk-row.dis { opacity: 0.45; }
.clients-table { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.2rem; }
.cl-row { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(10rem, 1fr) auto auto; gap: 0.6rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.7rem; }
.cl-row.off { opacity: 0.6; }
.cl-status { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.cl-status.ok { color: var(--ok); }
.cl-add { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(10rem, 1fr) auto; gap: 0.6rem; align-items: end; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 0.8rem; }
@media (max-width: 900px) {
  .cl-row, .cl-add { grid-template-columns: 1fr; }
}
.phone .tmodebtn { flex: 1 1 auto; }
.phone .tdisp { flex: 0 1 auto; margin-left: auto; flex-direction: column; align-items: flex-end; gap: 0.1em; }
.phone .tnum { font-size: 2.2em; min-width: 0; }
.phone .tphase { font-size: 0.68em; }
