/* HA Personal Training: shared look. Colours from Holly's website (sage #93cc83, slate #44484f, blush #efd3cf). */
:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #2b2d31;
  --slate: #44484f;
  --muted: #6b6f76;
  --faint: #9a9da3;
  --line: #ebe6e0;
  --line-2: #f3efea;
  --sage: #93cc83;
  --sage-deep: #457a3a;
  --sage-ink: #335c2b;
  --sage-soft: #eaf4e5;
  --sage-mist: #f4f9f2;
  --blush: #efd3cf;
  --blush-soft: #fbf1ef;
  --pink: #ffe0e9;
  --amber: #a8700e;
  --amber-soft: #fcf2dd;
  --rose: #a8463b;
  --rose-soft: #f9e6e2;
  --blue: #3f6f95;
  --blue-soft: #e5eef6;
  /* extra colour: one per coach and a few accents */
  --coral: #e07b6f;
  --coral-soft: #fdebe8;
  --teal: #3f9a90;
  --teal-soft: #e0f2ef;
  --sky: #5b9bd5;
  --sky-soft: #e6f0fb;
  --butter: #e3ac2f;
  --butter-soft: #fdf3d8;
  --lavender: #8b7fd0;
  --lavender-soft: #eeebfb;
  --shadow: 0 1px 2px rgba(40, 36, 30, .04), 0 4px 16px rgba(40, 36, 30, .06);
  --shadow-lg: 0 12px 40px rgba(40, 36, 30, .16);
  --r: 16px;
  --r-sm: 10px;
  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito Sans', 'Avenir Next', Avenir, 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html.big-text { font-size: 19px; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; color: var(--ink); }
h1 { font-family: var(--serif); font-weight: 400; font-size: 1.85rem; letter-spacing: .005em; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; }
h3 { font-size: 1.02rem; font-weight: 800; }
h4 { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
p { margin: 0 0 .8em; }
a { color: var(--sage-deep); }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(69, 122, 58, .45); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.lead { font-size: 1.06rem; color: var(--slate); }
.strong { font-weight: 800; }
.serif { font-family: var(--serif); font-weight: 400; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* layout helpers */
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.gap-s { gap: 6px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.stack-l > * + * { margin-top: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }
.mb { margin-bottom: 16px; } .mb-s { margin-bottom: 8px; } .mb-0 { margin-bottom: 0; }

/* cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--line-2); }
.card.flat { box-shadow: none; border-color: var(--line); }
.card.tint { background: var(--sage-mist); border-color: #e1eedb; box-shadow: none; }
.card.blush { background: var(--blush-soft); border-color: #f4e2de; box-shadow: none; }
.card.tap { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; text-align: left; width: 100%; }
.card.tap:hover { box-shadow: 0 2px 4px rgba(40, 36, 30, .05), 0 10px 24px rgba(40, 36, 30, .09); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3, .card-head h2 { margin: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-title h2, .section-title h3 { margin: 0; }
.link-btn { background: none; border: 0; color: var(--sage-deep); font-weight: 800; cursor: pointer; padding: 4px 2px; font-size: .9rem; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

/* buttons: big enough for anyone to tap (min 44px) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 0; background: var(--sage-deep); color: #fff; font-weight: 800; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s; letter-spacing: .01em; }
.btn:hover { background: var(--sage-ink); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--slate); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--line-2); }
.btn.soft { background: var(--sage-soft); color: var(--sage-ink); }
.btn.soft:hover { background: #dcecd5; }
.btn.blush { background: var(--blush); color: var(--ink); }
.btn.dark { background: var(--slate); }
.btn.dark:hover { background: var(--ink); }
.btn.danger { background: var(--rose-soft); color: var(--rose); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--slate); position: relative; flex: none; }
.icon-btn:hover { background: var(--line-2); }
.icon-btn .ic { width: 22px; height: 22px; }
.ic { width: 20px; height: 20px; flex: none; }
.badge-dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rose); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--line-2); color: var(--slate); white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }
.chip.sage { background: var(--sage-soft); color: var(--sage-ink); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.rose { background: var(--rose-soft); color: var(--rose); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.blush { background: var(--blush-soft); color: #8a5047; }
.chip.dark { background: var(--slate); color: #fff; }
.chip.coach-holly { background: var(--sage-soft); color: var(--sage-ink); }
.chip.coach-sophie { background: var(--coral-soft); color: #a3443a; }
.chip.coach-antonia { background: var(--teal-soft); color: #23675f; }
.tdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 800; color: var(--muted); cursor: pointer; min-height: 38px; font-size: .9rem; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .84rem; font-weight: 800; color: var(--slate); margin-bottom: 6px; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s; }
.field textarea { min-height: 90px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 3px rgba(147, 204, 131, .25); }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 42px; }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; }
.scale button.on { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.toggle { position: relative; width: 52px; height: 30px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 15px; background: #d9d5cf; transition: background .2s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle input:checked + span { background: var(--sage-deep); }
.toggle input:checked + span::after { transform: translateX(22px); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
button.list-item { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-2); text-align: left; cursor: pointer; }
button.list-item:hover { background: var(--sage-mist); }

/* avatars */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--slate); flex: none; }

/* progress */
.bar-track { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--sage); border-radius: 4px; transition: width .4s ease; }
.bar-fill.over { background: #e3a65a; }
.ring-track { stroke: var(--line-2); }
.ring-val { stroke: var(--sage); transition: stroke-dasharray .5s ease; }
.ring-val.over { stroke: #e3a65a; }
.ring.blush .ring-val { stroke: #e0a9a1; }
.ring.slate .ring-val { stroke: var(--slate); }
.ring.blue .ring-val { stroke: #7aa6c8; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-family: var(--sans); }
.chart .line { fill: none; stroke: var(--sage-deep); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--sage); opacity: .14; }
.chart .dot { fill: #fff; stroke: var(--sage-deep); stroke-width: 2; }
.chart .val { fill: var(--sage-ink); font-size: 12px; font-weight: 800; font-family: var(--sans); }
.chart .goal { stroke: #d39b92; stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .goal-t { fill: #b77168; }
.chart .bar { fill: var(--sage); }
.chart .bar.dim { fill: #d7e9d0; }
.chart .bar.blush { fill: #e6bab3; }
.chart .bar.slate { fill: var(--slate); }

/* sheet / dialog */
body.sheet-open { overflow: hidden; }
.sheet-bg { position: fixed; inset: 0; background: rgba(30, 28, 25, .42); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .24s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
.sheet.wide { max-width: 760px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 4px 22px; }
.sheet-head h2 { margin: 0; font-size: 1.3rem; }
.sheet-body { padding: 8px 22px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-lg); animation: up .2s ease; transition: opacity .3s; font-size: .95rem; text-align: center; }
.toast.out { opacity: 0; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--sage-mist); }

/* empty state */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: var(--sage); margin: 0 auto 8px; }

/* demo banner */
.demo-flag { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a5047; background: var(--blush-soft); padding: 3px 10px; border-radius: 999px; }

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