/* Life Beyond Sugar — program portal
   Fresh mint and berry. Mobile-first, large type, high contrast. Designed for adults 50+. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  --mint: #0fa898;          /* bright brand teal: decoration, rings, highlights */
  --mint-strong: #0b8578;   /* buttons and links: 4.5:1 with white */
  --mint-deep: #08665c;
  --mint-50: #f1faf8;
  --mint-100: #e1f5f1;
  --mint-200: #bfe9e1;
  --berry: #ff4f86;         /* bright accent: decoration */
  --berry-strong: #b5174f;  /* berry text: 6.5:1 */
  --berry-50: #fff0f5;
  --berry-100: #ffe1eb;
  --sun: #ffc93c;
  --sun-50: #fff8e1;
  --sun-ink: #6b4a00;
  --ink: #10302e;
  --ink-soft: #4a6663;      /* 6.2:1 on white */
  --line: #e2ecea;
  --line-strong: #c9dbd8;
  --page: #f6fbfa;
  --white: #ffffff;
  --alert-bg: #fdeceb;
  --alert-ink: #a3241b;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(16, 48, 46, .05), 0 8px 24px rgba(16, 48, 46, .06);
  --shadow-lift: 0 2px 4px rgba(16, 48, 46, .06), 0 14px 32px rgba(16, 48, 46, .1);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }   /* 18px base */
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--page);
  line-height: 1.6; font-size: 1rem; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--mint-strong); text-underline-offset: 3px; text-decoration-thickness: 2px; font-weight: 600; }
a:hover { color: var(--mint-deep); }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; border-radius: 8px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--mint-strong); color: #fff; padding: .75rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.header-inner { max-width: 1240px; margin: 0 auto; padding: .7rem 1.1rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; line-height: 1.15; min-width: 0; }
.brand img { width: 40px; height: 40px; flex: 0 0 40px; }
.brand-text { display: flex; flex-direction: column; white-space: nowrap; font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; min-width: 0; }
.brand small { font-weight: 500; font-size: .72rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover { color: var(--ink); }

.nav { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.navbtn {
  display: inline-flex; align-items: center; gap: .45rem; font: inherit; font-size: .84rem; font-weight: 700; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line-strong); padding: .45rem .8rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
  min-height: 44px; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.navbtn .ic { width: 20px; height: 20px; }
.navbtn:hover { background: var(--mint-50); border-color: var(--mint); color: var(--mint-deep); }
.navbtn:active { transform: scale(.97); }
.navbtn[aria-current="page"] { background: var(--mint-strong); border-color: var(--mint-strong); color: #fff; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Phone: main sections move to a bottom tab bar; Help and Sign out stay up top. */
.tabbar { display: none; }
@media (max-width: 1179px) {
  .navbtn.primary, .navbtn.primary-desk { display: none; }
  .nav .navbtn.utility { padding: .4rem .7rem; font-size: .8rem; min-height: 42px; }
  .nav .navbtn.utility .ic { width: 18px; height: 18px; }
  .brand small { display: none; }
  body.has-tabbar { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: .2rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(16, 48, 46, .08);
    padding: .4rem .4rem calc(.4rem + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 60px;
    border-radius: 16px; color: var(--ink-soft); text-decoration: none; font-size: .72rem; font-weight: 700;
  }
  .tabbar a .ic { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { background: var(--mint-100); color: var(--mint-deep); }
  .tabbar a:active { transform: scale(.96); }
}
@media (max-width: 1179px) { .navbtn.signout { display: none; } }
@media (min-width: 1180px) { .signout-card { display: none; } .nav { flex-wrap: nowrap; } }

/* ---------- Layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; }
main.narrow { max-width: 600px; }
h1 { font-size: 1.85rem; line-height: 1.2; margin: .25rem 0 .75rem; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.28rem; line-height: 1.3; margin: 0 0 .7rem; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; margin: 1rem 0 .5rem; font-weight: 800; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.08rem; color: var(--ink-soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 800; color: var(--mint-strong); margin: 0 0 .3rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }

.card {
  background: var(--white); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow);
  margin-bottom: 1.1rem; border: 1px solid var(--line);
}
.card.accent { border-top: 4px solid var(--mint); }
.grid { display: grid; gap: 1.1rem; }
@media (min-width: 720px) {
  html { font-size: 118.75%; }  /* 19px */
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 2.15rem; }
  .card { padding: 1.6rem; }
}

.stat { font-size: 2.1rem; font-weight: 800; color: var(--mint-strong); line-height: 1.1; }
.stat small { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }

/* ---------- Sign-in hero ---------- */
.hero { text-align: center; padding: 1.2rem 0 1.4rem; }
.hero-mark { width: 68px; height: 68px; filter: drop-shadow(0 8px 18px rgba(15, 168, 152, .35)); }
.hero-title { font-size: 2.3rem; margin: .8rem 0 .2rem; }
.hero-sub { color: var(--mint-deep); font-weight: 700; margin: 0 0 .35rem; }
.hero-tag { display: inline-block; color: var(--berry-strong); background: var(--berry-50); border: 1px solid var(--berry-100);
  font-weight: 800; padding: .25rem .9rem; border-radius: 999px; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 800;
  min-height: 54px; padding: .7rem 1.5rem; border-radius: 999px; border: 2px solid var(--mint-strong);
  background: var(--mint-strong); color: #fff; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2;
  box-shadow: 0 6px 16px rgba(11, 133, 120, .25); transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--mint-deep); border-color: var(--mint-deep); color: #fff; box-shadow: 0 8px 20px rgba(11, 133, 120, .32); }
.btn:active { transform: scale(.98); }
.btn.secondary { background: #fff; color: var(--mint-deep); border-color: var(--mint-200); box-shadow: none; }
.btn.secondary:hover { background: var(--mint-50); border-color: var(--mint); color: var(--mint-deep); }
.btn.danger { background: var(--alert-ink); border-color: var(--alert-ink); box-shadow: none; }
.btn.big { width: 100%; font-size: 1.12rem; min-height: 62px; margin-bottom: .5rem; }
.btn.small { min-height: 44px; padding: .4rem 1.05rem; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn .ic { width: 20px; height: 20px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--mint-strong); text-decoration: underline; cursor: pointer; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.2rem; }
label, legend { font-weight: 700; display: block; margin-bottom: .45rem; }
.hint { display: block; font-weight: 500; color: var(--ink-soft); font-size: .9rem; margin-top: .15rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], select, textarea {
  width: 100%; font: inherit; padding: .8rem 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); min-height: 54px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px var(--mint-100); }
input[aria-invalid="true"] { border-color: var(--alert-ink); }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
.choices { display: grid; gap: .6rem; }
.choices.inline { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.choice { position: relative; margin: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; font-weight: 600; min-height: 56px; transition: border-color .15s, background .15s;
}
.choice span:hover { border-color: var(--mint); }
.choice span::before { content: ""; flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; transition: all .15s; }
.choice input:checked + span { border-color: var(--mint); background: var(--mint-50); font-weight: 800; box-shadow: 0 0 0 1px var(--mint) inset; }
.choice input:checked + span::before { border-color: var(--mint-strong); background: var(--mint-strong); box-shadow: inset 0 0 0 4px #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--berry); outline-offset: 2px; }
.checkbox { display: flex; gap: .75rem; align-items: flex-start; font-weight: 600; }
.checkbox input { width: 24px; height: 24px; margin-top: .2rem; flex: 0 0 24px; accent-color: var(--mint-strong); }
.show-pw { margin-top: .5rem; }

/* ---------- Messages ---------- */
.notice { border-radius: var(--radius-sm); padding: 1rem 1.15rem; margin-bottom: 1rem; background: var(--mint-50); border: 1px solid var(--mint-200); color: var(--ink); }
.notice.warn { background: var(--sun-50); border-color: #f3dc8f; color: var(--sun-ink); }
.notice.alert { background: var(--alert-bg); border-color: #f2b8b3; color: var(--alert-ink); }
.notice:empty { display: none; }
.notice h2, .notice h3 { color: inherit; margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

.badge { display: inline-block; padding: .2rem .75rem; border-radius: 999px; font-size: .84rem; font-weight: 800; background: var(--mint-50); color: var(--ink); white-space: nowrap; }
.badge.PROGRESS, .badge.eligible { background: var(--mint-100); color: var(--mint-deep); }
.badge.MAINTAIN, .badge.repeating { background: var(--sun-50); color: var(--sun-ink); }
.badge.REVIEW, .badge.flagged { background: var(--alert-bg); color: var(--alert-ink); }
.badge.missing { background: var(--berry-50); color: var(--berry-strong); }
.pill { display: inline-block; padding: .2rem .75rem; border-radius: 999px; background: var(--mint-100); color: var(--mint-deep); font-weight: 800; font-size: .88rem; }

/* ---------- Participant home ---------- */
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.1rem; }
.hello h1 { margin-bottom: .2rem; }
.hello .lead { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); font-weight: 800; font-size: .85rem; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.chip .ic { width: 18px; height: 18px; }
.chip.points { background: var(--berry-50); border-color: var(--berry-100); color: var(--berry-strong); }
.chip.points .ic { fill: var(--berry); stroke: var(--berry); }
.chip.streak .ic { fill: var(--sun); stroke: #e0a800; }

.today-card { border-top: 0; background: linear-gradient(180deg, var(--mint-50), #fff 140px); }
.today-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.today-head h2 { margin: 0; }
.today-head p { margin: 0; }
.ring { width: 76px; height: 76px; flex: 0 0 76px; }
.ring-bg { fill: none; stroke: var(--mint-100); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--mint); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-text { font: 800 15px var(--font); fill: var(--ink); }

.today-list { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .6rem; }
.today-list li { display: flex; gap: .85rem; align-items: center; padding: .8rem .9rem; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); }
.today-list li.done { background: var(--mint-50); border-color: var(--mint-200); }
.today-list .icon { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-100); color: var(--mint-deep); }
.today-list .icon .ic { width: 22px; height: 22px; }
.today-list .icon.sugar { background: var(--berry-50); color: var(--berry-strong); }
.today-list .icon.strength { background: var(--sun-50); color: var(--sun-ink); }
.today-list .icon.target { background: #eef0ff; color: #3d3f9e; }
.today-list .icon.pause { background: var(--sun-50); color: var(--sun-ink); }
.today-list li.done .icon { background: var(--mint-strong); color: #fff; }
.log-form { border-top: 1px dashed var(--line-strong); padding-top: .5rem; margin-top: .5rem; }
.saved { display: inline-flex; align-items: center; gap: .3rem; color: var(--mint-strong); font-weight: 800; }
.saved .ic { width: 20px; height: 20px; }

.banner {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--mint-strong), #12b3a0 60%, #2cc6a8); color: #fff;
  border-radius: var(--radius); padding: 1.2rem 1.35rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-lift);
}
.banner h2, .banner p { color: #fff; margin: 0; }
.banner .btn { background: #fff; color: var(--mint-deep); border-color: #fff; box-shadow: none; }
.banner .btn:hover { background: var(--berry-50); color: var(--berry-strong); }

.points-big { font-size: 2.5rem; font-weight: 800; color: var(--berry-strong); line-height: 1; margin-bottom: .35rem; letter-spacing: -.02em; }

/* ---------- Plan / progress ---------- */
.plan-target { font-size: 1.35rem; font-weight: 800; color: var(--mint-deep); margin: .25rem 0 .5rem; }
.stage-dots { display: flex; gap: .35rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.stage-dots span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: var(--mint-50); color: var(--ink-soft); border: 1px solid var(--line); }
.stage-dots span.done { background: var(--mint-200); color: var(--mint-deep); border-color: var(--mint-200); }
.stage-dots span.current { background: var(--mint-strong); color: #fff; box-shadow: 0 0 0 3px var(--berry-100); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .6rem 0 .6rem 1.4rem; border-left: 3px solid var(--mint-200); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 1rem; width: 15px; height: 15px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px #fff; }

.week-plan { display: grid; gap: .6rem; }
.week-row { display: grid; grid-template-columns: 4.5rem 1fr; gap: .75rem; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.week-row.current { border-color: var(--mint); background: var(--mint-50); box-shadow: 0 0 0 1px var(--mint) inset; }
.week-row.past { opacity: .65; }
.week-row .wk { font-weight: 800; color: var(--mint-deep); }
.week-row ul { margin: 0; padding-left: 1.1rem; }
.track-option { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: .75rem; background: #fff; }
.track-option.recommended { border-color: var(--mint); background: var(--mint-50); }
.adjust { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.exercise { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: #fff; margin-bottom: .9rem; }
.exercise h3 { margin-top: 0; }
.dose { display: inline-block; font-weight: 800; color: var(--mint-deep); background: var(--mint-50); border-radius: 10px; padding: .15rem .6rem; }
.step-indicator { font-weight: 800; color: var(--mint-strong); margin-bottom: .5rem; }
.checks { display: grid; gap: .5rem; }
.checks label { display: flex; gap: .7rem; align-items: center; font-weight: 600; padding: .65rem .9rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; min-height: 54px; margin: 0; }
.checks label:has(input:checked) { border-color: var(--mint); background: var(--mint-50); }
.checks input { width: 24px; height: 24px; accent-color: var(--mint-strong); }
.autosave { font-size: .85rem; color: var(--ink-soft); min-height: 1.2em; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .head { font-size: .75rem; text-align: center; color: var(--ink-soft); font-weight: 800; }
.cal button, .cal .day {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: .82rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; min-height: 40px; cursor: pointer; color: var(--ink);
}
.cal button:hover { border-color: var(--mint); }
.cal .future { background: var(--page); color: #9ab0ad; cursor: default; border-style: dashed; }
.cal .on_plan { background: var(--mint-100); border-color: var(--mint-200); color: var(--mint-deep); }
.cal .mostly { background: var(--sun-50); border-color: #f3dc8f; color: var(--sun-ink); }
.cal .slipped { background: #f1f3f3; border-color: #dde3e2; }
.cal .today { box-shadow: 0 0 0 3px var(--berry); }
.cal .walk-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint-strong); }
.cal-legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .85rem; color: var(--ink-soft); margin-top: .7rem; }
.cal-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: .3rem; border: 1px solid var(--line-strong); }
.cal-legend i.on_plan { background: var(--mint-100); }
.cal-legend i.mostly { background: var(--sun-50); }
.cal-legend i.slipped { background: #f1f3f3; }
.cal-legend i.walk { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--mint-strong); vertical-align: 1px; }

/* Chart */
.chart-wrap { width: 100%; overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar { fill: var(--mint-200); }
.chart .bar.met { fill: var(--mint); }
.chart .target { stroke: var(--berry); stroke-width: 4; stroke-linecap: round; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--ink-soft); font-size: 13px; font-family: var(--font); }
.chart .val { fill: var(--ink); font-weight: 800; }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .9rem; color: var(--ink-soft); margin-top: .5rem; }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -2px; margin-right: .35rem; }
.legend .l-bar { background: var(--mint); }
.legend .l-target { background: var(--berry); height: 5px; vertical-align: 3px; }

/* Leaderboard + photos */
.lb-row { display: grid; grid-template-columns: 1.6rem 2.8rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .7rem .6rem; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-row > :first-child { font-weight: 800; color: var(--ink-soft); text-align: center; }
.lb-row > :last-child { font-weight: 800; color: var(--berry-strong); }
.lb-row.me { background: var(--mint-50); border-radius: var(--radius-sm); border-bottom-color: transparent; box-shadow: 0 0 0 1px var(--mint-200) inset; }
.avatar { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--mint), #2cc6a8); color: #fff; display: grid; place-items: center; font-weight: 800; }
.photo-slot { display: grid; gap: .5rem; justify-items: start; }
.photo-slot img { width: 160px; height: 200px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow); }
.photo-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* Tour */
.tour { position: fixed; inset: 0; background: rgba(16, 48, 46, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 1rem; }
.tour .card { max-width: 480px; width: 100%; margin: 0; box-shadow: var(--shadow-lift); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .65rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-soft); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; background: var(--mint-50); }
th:first-child { border-top-left-radius: 10px; } th:last-child { border-top-right-radius: 10px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--mint-50); }

/* ---------- Coach ---------- */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.1rem; padding: .35rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; box-shadow: var(--shadow); }
.tabs button { font: inherit; font-weight: 800; font-size: .92rem; border: 0; background: transparent; color: var(--ink-soft); border-radius: 999px; padding: .45rem 1.05rem; min-height: 44px; cursor: pointer; }
.tabs button:hover { background: var(--mint-50); color: var(--mint-deep); }
.tabs button[aria-selected="true"] { background: var(--mint-strong); color: #fff; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.filters button { font: inherit; font-size: .88rem; font-weight: 700; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 999px; padding: .3rem .9rem; min-height: 42px; cursor: pointer; }
.filters button:hover { border-color: var(--mint); }
.filters button[aria-pressed="true"] { border-color: var(--mint-strong); background: var(--mint-strong); color: #fff; }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: .12em; background: var(--berry-50); color: var(--berry-strong); border: 1px dashed var(--berry); padding: .7rem 1.1rem; border-radius: var(--radius-sm); display: inline-block; user-select: all; }
.small-code { font-size: 1rem; padding: .2rem .55rem; }
.json-editor { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; min-height: 340px; }
.stage-table input { min-height: 44px; padding: .4rem .5rem; }
.stage-table td { padding: .35rem .3rem; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { font-weight: 700; color: var(--ink-soft); }
dl.kv dd { margin: 0; }
details summary { cursor: pointer; font-weight: 800; padding: .4rem 0; color: var(--mint-deep); }

/* Call prep summary */
.callprep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.callprep-head h3 { margin-top: 0; }
#callprep h4 { margin: 1rem 0 .4rem; font-size: 1rem; }
#callprep dl.kv { align-content: start; }

/* ---------- Footer ---------- */
.footer { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.1rem 2.5rem; color: var(--ink-soft); font-size: .86rem; border-top: 1px solid var(--line); }
.footer a { color: var(--ink-soft); }

.hidden { display: none !important; }
dl.kv dd, .card p { overflow-wrap: anywhere; }
td { overflow-wrap: break-word; }
main:has(#panel-participants) .table-wrap table { min-width: 680px; }
main:has(#panel-participants) { max-width: 1240px; }

@media print {
  .site-header .nav, .tabbar, .btn, .footer { display: none; }
  body.has-tabbar { padding-bottom: 0; }
  .site-header { position: static; }
  body.print-callprep .site-header, body.print-callprep .footer, body.print-callprep h1,
  body.print-callprep .tabs, body.print-callprep #msg,
  body.print-callprep #panel-participants > :not(#callprep) { display: none !important; }
  body.print-callprep #callprep { box-shadow: none; border: 1px solid #999; }
  body.print-callprep .grid.two { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
body:has(#panel-participants) .footer { max-width: 1240px; }

/* Video walkthrough */
.video-card { text-align: center; }
.video-card h2 { margin-bottom: 1rem; }
video.walkthrough { display: block; margin: 0 auto 1rem; width: auto; height: auto; max-width: 100%; max-height: 70vh; aspect-ratio: 9 / 16;
  border-radius: var(--radius); background: var(--mint-50); box-shadow: var(--shadow-lift); }
.video-steps { text-align: left; padding-left: 1.2rem; }
.video-steps li { margin-bottom: .4rem; }
.video-steps .ts { display: inline-block; min-width: 2.6rem; font-weight: 800; color: var(--mint-strong); font-variant-numeric: tabular-nums; }
.video-card details { text-align: left; }
#video { scroll-margin-top: 90px; }

/* Before / after photo reminders */
.photo-prompt { background: linear-gradient(135deg, var(--berry-50), #fff 60%); border-color: var(--berry-100); }
.photo-prompt-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.photo-prompt-head h2 { margin: 0; }
.photo-prompt-head .icon { flex: 0 0 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--berry-100); color: var(--berry-strong); }
.photo-prompt ul { padding-left: 1.2rem; margin: 0 0 .5rem; }
.now-playing { margin: 0 0 .8rem; color: var(--ink-soft); }
#nextChapter { margin: 0 auto 1rem; }
.chapter-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; text-align: left; }
.chapter-btn { width: 100%; display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: .8rem; font: inherit; font-weight: 700; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: .65rem .9rem; min-height: 58px; cursor: pointer; text-align: left; }
.chapter-btn:hover { border-color: var(--mint); background: var(--mint-50); }
.chapter-btn .num { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--mint-100); color: var(--mint-deep); font-weight: 800; }
.chapter-btn .len { color: var(--ink-soft); font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }
.chapter-btn[aria-pressed="true"] { border-color: var(--mint-strong); background: var(--mint-50); box-shadow: 0 0 0 1px var(--mint-strong) inset; }
.chapter-btn[aria-pressed="true"] .num { background: var(--mint-strong); color: #fff; }

/* Start here: video checklist */
.start-here { background: linear-gradient(135deg, var(--mint-50), #fff 60%); border-color: var(--mint-200); }
.start-here .photo-prompt-head .icon { background: var(--mint-100); color: var(--mint-deep); }
.progress { height: 12px; border-radius: 6px; background: var(--mint-100); overflow: hidden; margin: .2rem 0 1rem; }
.progress .bar { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 6px; }
.video-checklist { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .35rem; }
.video-checklist li { display: flex; align-items: center; gap: .7rem; }
.video-checklist .tick { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 800; background: #fff; border: 1.5px solid var(--line-strong); color: var(--ink-soft); }
.video-checklist .tick .ic { width: 18px; height: 18px; }
.video-checklist li.done .tick { background: var(--mint-strong); border-color: var(--mint-strong); color: #fff; }
.video-checklist li.done a { color: var(--ink-soft); }
.chapter-btn.watched .num { background: var(--mint-200); }
.chapter-btn.watched .len { color: var(--mint-deep); font-weight: 800; }
.watch-first { background: var(--mint-50); border: 1px solid var(--mint-200); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.2rem; text-align: center; }
.watch-title { margin-bottom: .8rem; }
video.small-video { max-height: 60vh; }
