/* VFit Coach + client agenda. Same look as vtothefit.com. */

:root {
  --ink: #101112;
  --text: #2c2f33;
  --white: #ffffff;
  --surface: #ffffff;
  --soft: #f3f4f4;
  --soft-2: #e9ebeb;
  --muted: #64676b;
  --faint: #a4a7ab;
  --line: #e5e7e8;
  --ok: #1d7a46;
  --ok-soft: #e6f4ec;
  --warn: #8a5a12;
  --warn-soft: #fbf1e1;
  --error: #c8372d;
  --danger-soft: #fbe9e7;
  --line-strong: #cfd2d4;
  --on-ink: #ffffff;
  --on-ink-muted: rgb(255 255 255 / .65);
  --glass: rgb(255 255 255 / .92);
  --page-coach: #f3f4f4;
  --page-client: #ffffff;
  --btn-bg: #101112;
  --btn-fg: #ffffff;
  /* VFit yellow, from the onboarding document */
  --accent: #ffb000;
  --accent-ink: #101112;
  --accent-soft: #fff3d6;
  --note-bg: #101112;
  --note-fg: #ffffff;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23101112' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  color-scheme: light;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 14px 34px -18px rgb(0 0 0 / .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dark mode: follows the phone's setting, unless the person picked one with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f4f2; --text: #d6d7d8; --surface: #17181a; --soft: #202124; --soft-2: #2b2d30;
    --muted: #9a9da1; --faint: #6d7074; --line: #2c2e31; --line-strong: #46494d;
    --ok: #46c483; --ok-soft: #12291c; --warn: #f2b84b; --warn-soft: #2e230d; --error: #ff6f61; --danger-soft: #371614;
    --on-ink: #101112; --on-ink-muted: rgb(16 17 18 / .6); --glass: rgb(11 11 12 / .9);
    --page-coach: #0b0b0c; --page-client: #0b0b0c; --btn-bg: #ffb000; --btn-fg: #101112; --accent-soft: #2e2306; --note-bg: #202124; --note-fg: #f4f4f2; --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23f4f4f2' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 34px -18px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f4f4f2; --text: #d6d7d8; --surface: #17181a; --soft: #202124; --soft-2: #2b2d30;
  --muted: #9a9da1; --faint: #6d7074; --line: #2c2e31; --line-strong: #46494d;
  --ok: #46c483; --ok-soft: #12291c; --warn: #f2b84b; --warn-soft: #2e230d; --error: #ff6f61; --danger-soft: #371614;
  --on-ink: #101112; --on-ink-muted: rgb(16 17 18 / .6); --glass: rgb(11 11 12 / .9);
  --page-coach: #0b0b0c; --page-client: #0b0b0c; --btn-bg: #ffb000; --btn-fg: #101112; --accent-soft: #2e2306; --note-bg: #202124; --note-fg: #f4f4f2; --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23f4f4f2' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 34px -18px rgb(0 0 0 / .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--font); color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
body.coach { background: var(--page-coach); }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 600; letter-spacing: -.03em; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.wrap-narrow { width: min(640px, 100% - 32px); margin-inline: auto; }
.loading { padding: 48px 16px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.sm { font-size: 14px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.stack { display: grid; gap: 16px; }
.warn-text { color: var(--warn); }
.error-text, .danger-text { color: var(--error); }

/* Icons */
.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 15px; height: 15px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--btn-bg); color: var(--btn-fg); font: 600 15px/1 var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; min-height: 54px; font-size: 16px; }
.btn.danger { background: var(--error); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; list-style: none;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--soft-2); }
.icon-btn[disabled] { opacity: .3; cursor: default; background: none; }

.link-btn { border: 0; background: none; padding: 4px 0; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; }
.link-btn:hover { color: var(--ink); }

/* Form fields */
.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 400 16px/1.4 var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 64px; }
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) var(--arrow) right 10px center / 18px no-repeat; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(16 17 18 / .08); }
.input::placeholder { color: var(--faint); }
.input.strong { font-weight: 600; }
.field { display: grid; gap: 6px; align-content: start; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; }
.form-error { color: var(--error); font-size: 14px; min-height: 1px; }

/* Chips, avatars, rows */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.muted { color: var(--muted); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.avatar.square { border-radius: 12px; background: var(--soft-2); color: var(--ink); }
.dot { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--soft-2); color: var(--muted); }
.dot.ok { background: var(--ok); color: var(--on-ink); }

.list { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); text-decoration: none; transition: box-shadow .2s, transform .2s var(--ease); }
a.row:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.row.top { align-items: flex-start; }
.row strong { font-weight: 600; }
.row .chev { color: var(--faint); }
.list.flat { gap: 0; }
.list.flat .row { padding: 12px 0; border-radius: 0; border-top: 1px solid var(--line); }
.list.flat .row:first-child { border-top: 0; }
.quote { margin-top: 6px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--text); font-size: 15px; white-space: pre-line; }

.card { background: var(--surface); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 26px); }
.card-title { font-size: 17px; margin-bottom: 14px; }
.empty-state { padding: 48px 20px; text-align: center; background: var(--surface); border-radius: var(--radius-lg); display: grid; gap: 10px; justify-items: center; }
.empty-state p { max-width: 30em; }
.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 15px; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(420px, 100% - 32px); pointer-events: none; }
.coach .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 761px) { .coach .toasts { bottom: 24px; } }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-size: 15px; box-shadow: var(--shadow); animation: toastIn .25s var(--ease); transition: opacity .3s; }
.toast.error { background: var(--error); }
.toast.out { opacity: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* Dialogs */
.dialog { width: min(480px, 100% - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .35); }
.dialog.wide { width: min(620px, 100% - 24px); }
.dialog::backdrop { background: rgb(16 17 18 / .45); }
.dialog-in { padding: 22px; display: grid; gap: 16px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px -8px 0 0; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dialog-foot > .muted { margin-right: auto; }

/* Dropdown menu */
.menu { position: relative; }
.menu summary { cursor: pointer; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px; background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--line), var(--shadow); display: grid; }
.menu-list a, .menu-list button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 15px; text-decoration: none; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--soft); }
.menu-list .danger { color: var(--error); }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 28px; height: 28px; }
.logo-word { width: 48px; height: 15px; }
.logo-tag { padding: 3px 8px; border-radius: 6px; background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 600; letter-spacing: .02em; }

/* ---------- Coach: shell ---------- */

.topbar { position: sticky; top: 0; z-index: 40; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabs a:hover { color: var(--ink); background: var(--soft); }
.tabs a.active { color: var(--ink); background: var(--soft); }
.tabs .icon { width: 18px; height: 18px; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.save-status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.save-status[data-kind="error"] { color: var(--error); font-weight: 600; }

.main { padding-block: 28px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.main > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }

@media (max-width: 760px) {
  /* A blur on the header would pin the fixed tab bar inside it, so use a solid header here */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .topbar-in { height: 56px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--glass);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .tabs a { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11px; }
  .tabs a.active { background: none; }
  .tabs .icon { width: 22px; height: 22px; }
  .main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); padding-top: 20px; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; gap: 8px; }
.section { display: grid; gap: 12px; margin-top: 10px; }
.section-title { font-size: 17px; }
.archived summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 8px 0; }
.toolbar { display: flex; gap: 10px; }
.toolbar .input { max-width: 360px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; justify-self: start; margin-left: -4px; }
.back:hover { color: var(--ink); }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--soft); }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; padding: 32px 26px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: center; }
.login-card .muted { margin-top: -6px; margin-bottom: 6px; }
.login-mark { width: 44px; height: 44px; justify-self: center; margin-bottom: 4px; }

/* Onboarding */
.steps { display: grid; gap: 10px; }
.step { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--surface); border-radius: var(--radius-lg); flex-wrap: wrap; }
.step p { margin-top: 2px; }
.step-n { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 600; }

/* Client page */
.client-head { display: flex; align-items: center; gap: 14px; }
.title-input { flex: 1; min-width: 0; padding: 4px 8px; margin-left: -8px; border: 1px solid transparent; border-radius: 10px; background: transparent; font: 600 clamp(26px, 4vw, 34px)/1.2 var(--font); letter-spacing: -.03em; color: var(--ink); }
.title-input:hover { border-color: var(--line); }
.title-input:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions select.input { width: auto; min-width: 220px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
.settings-grid + .hint { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
@media (max-width: 820px) { .settings-grid { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Plan editor ---------- */

.planner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.planner-head { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.planner > .btn { justify-self: start; }
.week { background: var(--surface); border-radius: var(--radius-lg); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .week-head { flex-wrap: wrap; } .week-head .grow { order: 5; flex-basis: 100%; } }
.week-head { display: flex; align-items: center; gap: 4px; padding-left: 6px; }
.week-head h3 { margin-right: 10px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 760px) {
  .days { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(96px, 1fr); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; }
  .days::-webkit-scrollbar { display: none; }
  .day { scroll-snap-align: start; }
}
.day {
  position: relative; display: grid; align-content: start; gap: 2px; min-height: 92px; padding: 10px; text-align: left;
  border: 0; border-radius: 12px; background: var(--soft); cursor: pointer; transition: background .15s, box-shadow .15s;
}
.day:hover { background: var(--soft-2); }
.day.work { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.day.work:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.day[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.day-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.day-name em { font-style: normal; text-transform: none; letter-spacing: 0; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--on-ink); }
.day[aria-pressed="true"] .day-name { color: var(--on-ink-muted); }
.day[aria-pressed="true"] .day-name em { background: var(--surface); color: var(--ink); }
.day-date { font-size: 13px; color: var(--muted); }
.day[aria-pressed="true"] .day-date { color: var(--on-ink-muted); }
.day-title { margin-top: 4px; font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.day:not(.work) .day-title { font-weight: 500; color: var(--faint); }
.day[aria-pressed="true"]:not(.work) .day-title { color: var(--on-ink-muted); }
.day-done, .day-part { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--ok); color: var(--on-ink); font-size: 11px; font-weight: 700; padding: 0 5px; }
.day-part { background: var(--soft-2); color: var(--ink); }

.day-editor { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--soft); }
.day-editor > .btn { justify-self: start; }
.de-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.de-head h4 { font-size: 16px; font-weight: 600; }
.de-tools { display: flex; gap: 6px; flex-wrap: wrap; }

.items { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; }
.item { padding: 12px; background: var(--surface); border-radius: 12px; display: grid; gap: 10px; }
.item-head { display: flex; align-items: center; gap: 10px; }
.num { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--soft); font-size: 13px; font-weight: 700; }
.item-name { flex: 1; min-width: 0; border: 0; background: none; padding: 4px 0; text-align: left; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: underline transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.item-name:hover { text-decoration-color: currentColor; }
.item-tools { display: flex; }
.item-tools .icon-btn { width: 34px; height: 34px; }
.item-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 2fr; gap: 8px; }
@media (max-width: 860px) { .item-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } .mini.wide { grid-column: 1 / -1; } }
@media (max-width: 480px) { .item-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini { display: grid; gap: 3px; }
.mini span { font-size: 12px; font-weight: 600; color: var(--muted); }
.mini .input { min-height: 38px; padding: 7px 10px; font-size: 15px; }

.thumb { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden; background: var(--soft-2); color: var(--muted); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb.has { background: var(--ink); color: var(--on-ink); }
.thumb .icon { width: 18px; height: 18px; }

/* Exercise picker */
.pick-list { display: grid; gap: 4px; max-height: min(52dvh, 460px); overflow-y: auto; margin-inline: -6px; padding-inline: 6px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; }
.pick:hover { background: var(--soft); }
.pick strong { display: block; font-weight: 600; }
.pick .muted { display: block; }
.pick.new .thumb { background: var(--ink); color: var(--on-ink); }

/* Exercise library */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ex-grid > .empty-state, .ex-grid > p { grid-column: 1 / -1; }
.ex-card { display: grid; padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; text-align: left; cursor: pointer; transition: box-shadow .2s, transform .2s var(--ease); }
.ex-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.ex-card .thumb { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
.ex-card .thumb .icon { width: 28px; height: 28px; }
.ex-card-body { display: grid; gap: 2px; padding: 12px 14px 14px; }
.ex-card-body strong { font-weight: 600; }

.preview:empty { display: none; }
.preview > div { display: grid; gap: 6px; }
.video-inputs { display: flex; align-items: center; gap: 10px; }
.video-inputs .input { flex: 1; }
.or { flex: none; }
@media (max-width: 520px) { .video-inputs { flex-wrap: wrap; } .video-inputs .input { flex-basis: 100%; } .or { display: none; } .video-inputs .btn { width: 100%; } }

.progress { height: 6px; border-radius: 999px; background: var(--soft-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width .4s var(--ease); }

/* ---------- Video player ---------- */

.player { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.player.vertical { aspect-ratio: 9 / 16; width: min(100%, 420px, calc(78dvh * 9 / 16)); margin-inline: auto; }
.player iframe, .player video, .player img { width: 100%; height: 100%; border: 0; object-fit: cover; }
.player video { object-fit: contain; }
.player.poster { cursor: pointer; }
.player.poster img { transition: transform .5s var(--ease), opacity .3s; opacity: .9; }
.player.poster:hover img { transform: scale(1.03); opacity: 1; }
.poster-blank { position: absolute; inset: 0; background: linear-gradient(135deg, #1d1f21, #3a3d40); }
.play { position: absolute; inset: 0; margin: auto; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgb(255 255 255 / .94); color: var(--ink); box-shadow: 0 8px 24px rgb(0 0 0 / .3); transition: transform .2s var(--ease); }
.play .icon { width: 26px; height: 26px; margin-left: 3px; }
.player.poster:hover .play { transform: scale(1.06); }
.player-link { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--soft); font-weight: 600; text-decoration: none; }
.player-link:hover { background: var(--soft-2); }
.player-link .icon.sm { margin-left: auto; color: var(--muted); }

/* ---------- Client agenda ---------- */

body.client { background: var(--page-client); }
.client main { padding-block: 16px calc(48px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.c-top { position: sticky; top: 0; z-index: 20; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-top: env(safe-area-inset-top); }
.c-top-in { display: flex; align-items: center; justify-content: space-between; height: 56px; font-size: 15px; font-weight: 600; }
.client .center { padding-top: 18vh; display: grid; gap: 12px; justify-items: center; }
.big-mark { width: 52px; height: 52px; }

.banner { padding: 14px 16px; border-radius: var(--radius); background: var(--soft); font-size: 15px; }
.banner.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.coach-note { padding: 16px 18px; border-radius: var(--radius); background: var(--ink); color: var(--on-ink); }
.coach-note .label { color: var(--on-ink-muted); }
.coach-note p { margin-top: 4px; white-space: pre-line; }
.tip { display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 16px; border-radius: var(--radius); background: var(--soft); font-size: 14px; color: var(--text); }
.tip p { flex: 1; }

.week-nav { display: grid; gap: 10px; }
.week-row { display: flex; align-items: center; justify-content: space-between; }
.week-label { font-size: 15px; }
.week-label strong { font-weight: 600; }
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pill { display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; border: 0; border-radius: 14px; background: none; cursor: pointer; transition: background .15s; }
.pill:hover { background: var(--soft); }
.pill-wd { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pill-d { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; font-weight: 600; }
.pill.is-today .pill-d { box-shadow: inset 0 0 0 2px var(--ink); }
.pill.sel { background: var(--ink); color: var(--on-ink); }
.pill.sel .pill-wd { color: var(--on-ink-muted); }
.pill.sel.is-today .pill-d { box-shadow: inset 0 0 0 2px var(--surface); }
.pill-mark { display: grid; place-items: center; height: 14px; }
.pill.work .pill-mark::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.done .pill-mark::before { content: none; }
.pill.done .pill-mark { color: var(--ok); }
.pill.sel.done .pill-mark { color: #7ee2a8; }
.today-btn { justify-self: center; }

.day-view { display: grid; gap: 16px; margin-top: 4px; }
.day-head { display: grid; gap: 6px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); }
.day-notes { color: var(--text); white-space: pre-line; }
.rest { display: grid; justify-items: center; gap: 12px; padding: 40px 20px; border-radius: var(--radius-lg); background: var(--soft); text-align: center; color: var(--text); }
.rest .icon { width: 32px; height: 32px; color: var(--muted); }

.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress { flex: 1; }
.ex-list { display: grid; gap: 12px; }
.ex { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--soft); transition: background .25s; }
.ex.done { background: var(--ok-soft); }
.ex-top { display: flex; align-items: flex-start; gap: 12px; }
.ex-num { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--surface); font-size: 14px; font-weight: 700; margin-top: 1px; }
.ex h2 { font-size: 18px; line-height: 1.3; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ex .chip { background: var(--surface); font-size: 14px; }
.ex-notes { color: var(--text); font-size: 15px; white-space: pre-line; }
.tick { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: transparent; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease); }
.tick:hover:not([disabled]) { border-color: var(--ink); color: var(--line-strong); }
.tick[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: var(--on-ink); transform: scale(1.04); }
.tick[disabled] { opacity: .4; cursor: default; }
.tick .icon { width: 24px; height: 24px; }
.cues summary { cursor: pointer; font-size: 15px; font-weight: 600; padding: 2px 0; }
.cues ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text); font-size: 15px; }

.finish { display: grid; gap: 14px; margin-top: 4px; }
.finish.done { padding: 18px; border-radius: var(--radius-lg); background: var(--ok-soft); }
.finish-head { display: flex; align-items: center; gap: 12px; }
.finish-head strong { font-weight: 600; }
.finish-head .dot { width: 36px; height: 36px; }
.finish-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Badges, chips, sub-tabs ---------- */

.tab-ico { position: relative; display: inline-grid; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--error); color: var(--on-ink); font-size: 11px; font-weight: 700; line-height: 1; }
.tab-ico .badge { position: absolute; top: -6px; right: -9px; box-shadow: 0 0 0 2px var(--surface); }
.chip.danger { background: var(--danger-soft); color: var(--error); }
.chip.dark { background: var(--ink); color: var(--on-ink); }
.chips-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row.unread strong { font-weight: 700; }
.row.unread .ellipsis { color: var(--ink); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-top { margin-top: 16px; }
.two-col.tight { gap: 12px; }
@media (max-width: 520px) { .row .chips-row { max-width: 45%; } }

.subtabs { display: flex; gap: 4px; padding: 4px; background: var(--soft-2); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtab { display: flex; align-items: center; gap: 7px; flex: 1 0 auto; justify-content: center; padding: 10px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.subtab .icon { width: 18px; height: 18px; }
.subtab:hover { color: var(--ink); }
.subtab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.client-head .chip { flex: none; }
@media (max-width: 560px) { .client-head { flex-wrap: wrap; } .client-head .title-input { flex-basis: calc(100% - 56px); } .subtab { padding: 9px 10px; font-size: 14px; } }

/* ---------- Chat ---------- */

.chat { display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.chat-card { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.chat-card .chat-list { height: min(60dvh, 560px); }
.chat-list { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chat-empty { margin: auto; max-width: 300px; text-align: center; color: var(--muted); font-size: 15px; }
.chat-day { align-self: center; margin: 10px 0 4px; padding: 3px 10px; border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 600; color: var(--muted); }
.bubble { max-width: min(78%, 480px); padding: 9px 13px 6px; border-radius: 18px; font-size: 15px; line-height: 1.45; }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble a { text-decoration: underline; }
.bubble time { display: block; margin-top: 2px; font-size: 11px; opacity: .6; text-align: right; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--on-ink); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 6px; }
.bubble.pending { opacity: .6; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
textarea.chat-input { min-height: 44px; max-height: 160px; resize: none; border-radius: 22px; padding: 11px 16px; }
.chat-send { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; flex: none; }

/* ---------- Coach: membership + meals ---------- */

.ms-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ms-status .chip { font-size: 14px; padding: 6px 12px; }
.files { display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; }
.file-row .input { flex: 1; min-width: 0; }
.weekday-pills { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 10px; }
.wd { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border: 0; border-radius: 12px; background: var(--soft); cursor: pointer; font-weight: 600; font-size: 14px; }
.wd em { font-style: normal; font-size: 12px; color: var(--muted); }
.wd.has { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.wd.sel { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.wd.sel em { color: var(--on-ink-muted); }
.item-head .input.strong { flex: 1; min-width: 0; }

/* ---------- Client: bottom tabs and new sections ---------- */

body.client main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.client .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
.c-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  padding: 6px max(6px, calc((100% - 640px) / 2)) calc(6px + env(safe-area-inset-bottom));
  background: var(--glass); border-top: 1px solid var(--line);
}
.c-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.c-tabs a.active { color: var(--ink); }
.c-tabs .icon { width: 24px; height: 24px; }

a.banner { display: flex; align-items: center; gap: 8px; text-decoration: none; }
a.banner span { flex: 1; }
.banner.danger { background: var(--danger-soft); color: var(--error); }
.banner.danger strong { font-weight: 700; }
.banner.danger span { flex: 1; text-align: right; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.dot.warn { background: var(--warn); color: var(--on-ink); }
.dot.danger { background: var(--error); color: var(--on-ink); }
.ms-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius-lg); }
.ms-card .dot { width: 40px; height: 40px; }
.ms-card strong { font-size: 18px; font-weight: 600; }
.ms-card.ok { background: var(--ok-soft); }
.ms-card.warn { background: var(--warn-soft); }
.ms-card.danger { background: var(--danger-soft); }
.info-list { display: grid; border-radius: var(--radius); background: var(--soft); }
.info-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--surface); }
.info-list > div:first-child { border-top: 0; }
.info-list strong { font-weight: 600; text-align: right; }

.meals-today { display: grid; gap: 10px; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.meal-list { display: grid; gap: 8px; }
.meal { padding: 14px 16px; border-radius: var(--radius); background: var(--soft); }
.meal strong { font-weight: 600; }
.meal p { margin-top: 2px; color: var(--text); white-space: pre-line; }
.target { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--ink); color: var(--on-ink); }
.target .label { color: var(--on-ink-muted); }
.target strong { font-size: 17px; font-weight: 600; }
.file-list { display: grid; gap: 8px; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--soft); text-decoration: none; }
.file-card strong { display: block; font-weight: 600; }
.file-card .muted { display: block; }
.file-card.img { flex-wrap: wrap; }
.file-card.img img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; }
.tab-meals .strip { margin-top: 4px; }
.tab-meals .pill-wd { font-size: 13px; }

.chat-page { display: grid; gap: 12px; }
.tab-chat .chat { border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.tab-chat .chat-list { height: max(260px, calc(100dvh - 300px - env(safe-area-inset-bottom))); }

/* ---------- Archive and journeys ---------- */

.avatar.muted-avatar { background: var(--soft-2); color: var(--muted); }
.archived .hint { margin: 0 0 4px; }
.jstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jstats > div { display: grid; padding: 14px; border-radius: var(--radius); background: var(--soft); }
.jstats strong { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.jgrid { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.jw { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; }
.jdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.jd { display: inline-block; height: 18px; border-radius: 5px; background: transparent; }
.jd.jd-done { background: var(--ok); }
.jd.jd-part { background: #8fd0a9; }
.jd.jd-missed { background: #f1c9c4; }
.jd.jd-rest { background: var(--soft-2); }
.jlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.jlegend .lg { display: inline-flex; align-items: center; gap: 6px; }
.jlegend .jd { width: 14px; height: 14px; }

/* ---------- Create with AI ---------- */

.ai-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--surface), var(--soft)); box-shadow: inset 0 0 0 1px var(--line); }
.ai-card strong { font-weight: 600; }
.ai-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--ink); color: var(--on-ink); }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; text-align: left; cursor: pointer; color: var(--text); }
.chip-btn:hover { border-color: var(--ink); color: var(--ink); }
.ai-working { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--radius); background: var(--soft); }
.ai-working strong { font-weight: 600; }
.spinner { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 3px solid var(--soft-2); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: spin 2.5s linear infinite !important; } }
.ai-summary { padding: 12px 14px; border-radius: var(--radius); background: var(--soft); font-size: 15px; }
.ai-phase { display: grid; gap: 8px; }
.ai-phase-head { display: flex; align-items: baseline; gap: 10px; }
.ai-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; max-height: 46dvh; overflow-y: auto; }
.ai-day { display: grid; align-content: start; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.ai-day.rest { background: var(--soft); box-shadow: none; }
.ai-day strong { font-weight: 600; }
.ai-day ul { margin: 2px 0 0; padding-left: 16px; display: grid; gap: 3px; }
.chip.tiny { padding: 1px 6px; font-size: 11px; margin-left: 4px; }
.sticky-foot { position: sticky; bottom: 0; z-index: 2; margin: 0 -22px -22px; padding: 14px 22px 22px; background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
.inline-field { grid-template-columns: auto 180px 1fr; align-items: center; gap: 10px 14px; }
@media (max-width: 560px) { .inline-field { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .sticky-foot { gap: 8px; padding-top: 10px; }
  .sticky-foot .grow { display: none; }
  .sticky-foot .btn { flex: 1 1 40%; min-height: 42px; padding: 0 10px; font-size: 14px; white-space: normal; }
  .sticky-foot .btn.ghost:first-child { flex-basis: 100%; min-height: 36px; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); order: 3; }
}

/* ---------- Client day view: calmer layout ---------- */

.day-head h1 { font-size: clamp(28px, 7vw, 34px); }
.day-meta { color: var(--muted); font-size: 15px; font-weight: 500; }

.session { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.session h2 { font-size: 15px; font-weight: 600; color: var(--muted); }
.session-intro, .session-text { color: var(--text); font-size: 15px; white-space: pre-line; }
.session-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.session-parts { display: grid; }
.session-part { border-top: 1px solid var(--line); }
.session-part:first-child { border-top: 0; }
.session-part summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; list-style: none; font-weight: 600; }
.session-part summary::-webkit-details-marker { display: none; }
.session-part summary .muted { font-weight: 500; font-size: 14px; }
.session-part summary .icon { margin-left: auto; color: var(--faint); transition: transform .2s var(--ease); }
.session-part[open] summary .icon { transform: rotate(180deg); }
.session-part p { padding: 0 0 12px; color: var(--text); font-size: 15px; }
.rest-notes { max-width: 30em; white-space: pre-line; }

.ex-list { gap: 8px; }
.ex { display: block; padding: 0; gap: 0; overflow: hidden; }
.ex-row { display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 0; }
.ex-open { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius-lg); }
.ex-open[disabled] { cursor: default; }
.ex-num { width: 28px; height: 28px; font-size: 13px; margin-top: 0; }
.ex-text { display: grid; gap: 2px; min-width: 0; }
.ex-name { font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.ex-main { font-size: 15px; font-weight: 600; color: var(--text); }
.ex-extra { font-size: 14px; color: var(--muted); }
.ex-more { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ex-more .chev { transition: transform .2s var(--ease); }
.ex.open .ex-more .chev { transform: rotate(180deg); }
.ex .tick { width: 44px; height: 44px; }
.ex-details { display: grid; gap: 12px; padding: 0 16px 16px; animation: panelIn .25s var(--ease) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ex-details .label { display: block; margin-bottom: 2px; }
.ex-target, .ex-how, .ex-alt { font-size: 15px; color: var(--text); white-space: pre-line; }
.ex-alt { padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.ex-cues { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; color: var(--text); }
.ex.done .ex-name { text-decoration: line-through; text-decoration-color: rgb(29 122 70 / .5); }

/* Home screen tip: a small link at the bottom */
.tip { margin-top: 8px; padding: 4px 4px 4px 0; background: none; border-top: 1px solid var(--line); border-radius: 0; }
.tip-open { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 0; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: left; }
.tip-open:hover { color: var(--ink); }
.tip-open span { flex: 1; }

/* Pop-up sheet (slides up from the bottom on phones) */
.sheet { width: min(440px, 100% - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .35); }
.sheet::backdrop { background: rgb(16 17 18 / .45); }
.sheet-in { display: grid; gap: 16px; padding: 20px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-right: -8px; }
.sheet-head h2 { font-size: 19px; }
.sheet-body { display: grid; gap: 16px; }
@media (max-width: 560px) {
  .sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheetUp .3s var(--ease) both; }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.seg { display: flex; padding: 4px; border-radius: 12px; background: var(--soft-2); }
.seg button { flex: 1; padding: 8px; border: 0; border-radius: 9px; background: none; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.how-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.5; }
.how-steps .step-n { width: 28px; height: 28px; font-size: 13px; }
.key { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 7px; background: var(--soft); font-weight: 600; vertical-align: 1px; }
.key .icon { width: 15px; height: 15px; }

/* Easy reading: short points, glossary */
.points { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text); font-size: 15px; line-height: 1.5; }
.points li::marker { color: var(--faint); }
.session-part .points { padding-bottom: 12px; }
.session-text.clamp:is(ul) { display: grid; max-height: 7.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.glossary-link { justify-self: center; font-size: 14px; }
.glossary { margin: 0; display: grid; gap: 4px; }
.glossary dt { font-weight: 600; margin-top: 10px; }
.glossary dt:first-child { margin-top: 0; }
.glossary dd { margin: 0; color: var(--text); font-size: 15px; }
.sheet { overflow-y: auto; }

/* Daily greeting */
.hello { display: grid; gap: 4px; padding: 6px 0 4px; }
.hello-title { font-size: clamp(30px, 8.5vw, 40px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.hello-title span { white-space: nowrap; }
.hello-line { font-size: 17px; color: var(--text); }
.tab-today .day-head h1 { font-size: clamp(24px, 6.5vw, 28px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }
.notice.soft { font-size: 14px; }


/* ---------- VFit yellow: small highlights, like the onboarding document ---------- */

.progress span { background: var(--accent); }
.pill.is-today .pill-d, .pill.sel.is-today .pill-d { box-shadow: inset 0 0 0 2px var(--accent); }
.pill.work .pill-mark::before { background: var(--accent); }
.logo-tag { background: var(--accent); color: var(--accent-ink); }
.ai-mark { background: var(--accent); color: var(--accent-ink); }
.step-n, .how-steps .step-n { background: var(--accent); color: var(--accent-ink); }
.chip.dark { background: var(--accent); color: var(--accent-ink); }
.coach-note, .target { background: var(--note-bg); color: var(--note-fg); }
.coach-note .label, .target .label { color: var(--accent); }
.hello-title span { background: linear-gradient(transparent 64%, var(--accent) 64%, var(--accent) 90%, transparent 90%); padding: 0 2px; }
:root[data-theme="dark"] .hello-title span { background: none; color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hello-title span { background: none; color: var(--accent); } }
.tabs a.active { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 10px 10px 4px 4px; }
@media (max-width: 760px) { .tabs a.active { box-shadow: none; } .tabs a.active .tab-ico::after, .c-tabs a.active .tab-ico::after { content: ""; position: absolute; left: 50%; top: -9px; width: 18px; height: 3px; border-radius: 3px; background: var(--accent); transform: translateX(-50%); } }
.c-tabs a.active .tab-ico::after { content: ""; position: absolute; left: 50%; top: -9px; width: 18px; height: 3px; border-radius: 3px; background: var(--accent); transform: translateX(-50%); }
.subtab.active { box-shadow: 0 1px 3px rgb(0 0 0 / .08), inset 0 -2px 0 var(--accent); }
.ms-card.ok .dot.ok, .finish-head .dot.ok { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Theme and language switches */
.toggles { display: flex; align-items: center; gap: 2px; }
.lang-btn { min-width: 38px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: none; font: 600 13px/1 var(--font); color: var(--muted); cursor: pointer; }
.lang-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.c-top-in .hi { margin-right: 6px; font-size: 15px; }

/* Header: bigger name, visible toggles */
.c-top-in .hi { margin-right: 10px; font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.toggles { gap: 6px; }
.toggles .theme-btn { width: 38px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); }
.toggles .theme-btn:hover { border-color: var(--line-strong); background: none; }
.toggles .theme-btn .icon { width: 18px; height: 18px; }
.lang-btn { color: var(--ink); }

/* Exercise picture in the row, with the number on top */
.ex-pic { position: relative; flex: none; }
.ex-pic .thumb { width: 52px; height: 52px; border-radius: 12px; }
.ex-pic .ex-num { position: absolute; left: -6px; top: -6px; width: 22px; height: 22px; font-size: 11px; box-shadow: 0 0 0 2px var(--soft); }
.ex.done .ex-pic .ex-num { box-shadow: 0 0 0 2px var(--ok-soft); }
.preparing { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
.plain-toggle { margin-top: 12px; align-items: flex-start; font-size: 14px; }
.plain-toggle input { margin-top: 2px; }

/* Avatars with photos */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.thumb .thumb-fallback { position: absolute; width: 20px; height: 20px; color: var(--faint); }
.thumb img, .thumb video { position: relative; z-index: 1; }
.avatar-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; }
.avatar-btn .cam { position: absolute; right: -2px; bottom: -2px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--page-coach); }
.avatar-btn .cam .icon { width: 13px; height: 13px; }
.client-head .avatar-btn .avatar { width: 52px; height: 52px; font-size: 17px; }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.c-top .avatar-btn .cam { width: 16px; height: 16px; box-shadow: 0 0 0 2px var(--page-client); }
.c-top .avatar-btn .cam .icon { width: 10px; height: 10px; }
.photo-preview { display: grid; justify-items: center; gap: 12px; }
.photo-preview .avatar { width: 120px; height: 120px; font-size: 36px; }
.photo-actions { display: grid; gap: 8px; }
.coach-note .note-head { display: flex; align-items: center; gap: 10px; }
.coach-note .avatar.sm { width: 30px; height: 30px; background: var(--accent); color: var(--accent-ink); }
.chat-page h1 { display: flex; align-items: center; gap: 12px; }
.chat-page h1 .avatar { width: 40px; height: 40px; background: var(--accent); color: var(--accent-ink); }
.photo-note { text-align: center; }

/* Bigger photos */
.client-head { gap: 20px; }
.client-head .avatar-btn .avatar { width: 96px; height: 96px; font-size: 30px; }
.client-head .avatar-btn .cam { width: 30px; height: 30px; right: 0; bottom: 0; box-shadow: 0 0 0 3px var(--page-coach); }
.client-head .avatar-btn .cam .icon { width: 16px; height: 16px; }
@media (max-width: 560px) { .client-head .avatar-btn .avatar { width: 80px; height: 80px; font-size: 26px; } .client-head .title-input { flex-basis: calc(100% - 100px); } }
.row .avatar { width: 48px; height: 48px; font-size: 15px; }
.c-top .avatar.sm { width: 40px; height: 40px; font-size: 14px; }

/* Moving workouts */
.move-btn { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: none; font: 600 14px/1 var(--font); color: var(--ink); cursor: pointer; }
.move-btn:hover { border-color: var(--line-strong); }
.moved-note { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.move-list { display: grid; gap: 6px; }
.move-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--soft); text-align: left; cursor: pointer; color: var(--ink); }
.move-opt strong { display: block; font-weight: 600; }
.move-opt .muted { display: block; }
.move-opt:hover:not([disabled]) { background: var(--soft-2); }
.move-opt[disabled] { opacity: .5; cursor: default; }
.rest .move-btn { justify-self: center; margin-top: 4px; background: var(--surface); }

/* Exercise icons */
.thumb.icon-thumb { background: var(--accent-soft); color: var(--ink); }
.thumb.icon-thumb .icon { width: 60%; height: 60%; }
.ex-card .thumb.icon-thumb .icon { width: 64px; height: 64px; }
.thumb .thumb-fallback { width: 55%; height: 55%; }
.type-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.type-chips::-webkit-scrollbar { display: none; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 14px/1 var(--font); color: var(--ink); cursor: pointer; }
.type-chip .icon { width: 18px; height: 18px; }
.type-chip .muted { font-weight: 500; }
.type-chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.type-chip.on .muted { color: var(--on-ink-muted); }
.icon-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.icon-pick button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.icon-pick button .icon { width: 28px; height: 28px; }
.icon-pick button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* Logging sets */
.sets { display: grid; gap: 6px; padding: 0 14px 14px; }
.set-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 6px; align-items: center; }
.set-head span { font-size: 12px; font-weight: 600; color: var(--muted); }
.set-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); font-size: 12px; font-weight: 700; }
.set-row.filled .set-n { background: var(--accent); color: var(--accent-ink); }
.set-row .input { min-height: 42px; padding: 8px 10px; }
.set-row select.input { padding-right: 28px; background-position: right 6px center; font-size: 15px; }
.sets-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 2px; }

/* Coach: workouts as the client did them */
details.wo > summary { list-style: none; cursor: pointer; }
details.wo > summary::-webkit-details-marker { display: none; }
details.wo .chev { color: var(--faint); transition: transform .2s var(--ease); flex: none; }
details.wo[open] .chev { transform: rotate(180deg); }
.list.flat details.wo { border-top: 1px solid var(--line); }
.list.flat details.wo:first-child { border-top: 0; }
.list.flat details.wo > summary.row { border-top: 0; }
.wo-detail { display: grid; gap: 8px; padding: 0 0 14px 40px; }
.card-row { background: var(--surface); border-radius: var(--radius); }
.card-row .wo-detail { padding: 0 16px 16px; }
.wo-ex { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 12px; background: var(--soft); }
.wo-ex .thumb { width: 36px; height: 36px; }
.wo-ex strong { font-weight: 600; }
.wo-ex .dot { width: 22px; height: 22px; }
.wo-sets { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 14px; color: var(--text); }
@media (max-width: 560px) { .wo-detail { padding-left: 0; } }

/* AI: files for context */
.ai-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--soft); font-size: 14px; }
.file-chip .ellipsis { max-width: 220px; }
.file-chip .icon-btn { width: 28px; height: 28px; }
