/* littlewins
   Brand: deep plum backgrounds, gold for actions and wins, ivory surfaces.
   Cormorant Garamond for headlines (italic gold accents), Montserrat for text.
   Variable names are kept from the first theme: --pine is the plum primary,
   --marigold is gold. Sky marks pauses, rose marks extensions. */

:root {
  --ink: #2a1231;
  --ink-2: #4b3352;
  --muted: #7b6a80;
  --bg: #f8f4ef;
  --surface: #ffffff;
  --surface-2: #fbf7f2;
  --line: #ece2d8;
  --line-strong: #d9c9ba;

  --pine: #3b1747;
  --pine-strong: #2a0f33;
  --pine-soft: #f3eaf2;
  --sage: #e8d3a0;
  --marigold: #c9a24e;
  --marigold-soft: #f8eed6;
  --gold-text: #8a6420;
  --sky: #5b8fb9;
  --sky-soft: #e3eef7;
  --plum: #b8648a;
  --plum-soft: #f7e7ef;
  --danger: #b23a48;
  --danger-soft: #f9e6e8;
  --ok: #2c7a59;
  --cream: #f3e9df;

  --gold-grad: linear-gradient(135deg, #e4c77e 0%, #c9a24e 52%, #b0883a 100%);
  --plum-grad: linear-gradient(165deg, #2a0f33 0%, #3b1747 55%, #4c1e5a 100%);

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Montserrat', 'Segoe UI', system-ui, sans-serif;

  --r-card: 16px;
  --r-ctl: 12px;
  --r-tile: 4px;
  --shadow: 0 1px 2px rgba(42, 15, 51, 0.05), 0 8px 24px -14px rgba(42, 15, 51, 0.22);
  --shadow-lift: 0 2px 6px rgba(42, 15, 51, 0.06), 0 18px 34px -16px rgba(42, 15, 51, 0.32);
  --fast: 160ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --sidebar-w: 256px;
  --tabbar-h: 64px;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--pine); text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--pine); color: #fff; padding: 10px 14px; border-radius: var(--r-ctl);
}
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------ wordmark */

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  color: var(--pine);
  text-decoration: none;
  margin: 0;
}
.wordmark--small { font-size: 1.25rem; }

/* ------------------------------------------------------------ boot + auth */

.boot {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-content: center; gap: 14px; justify-items: center;
}
.boot__bar {
  width: 140px; height: 6px; border-radius: 99px; background: var(--pine-soft);
  overflow: hidden; position: relative;
}
.boot__bar::after {
  content: ''; position: absolute; inset: 0; width: 40%;
  background: var(--pine); border-radius: inherit;
  animation: boot-slide 1s var(--ease) infinite;
}
@keyframes boot-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.auth-screen {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 110% -10%, var(--pine-soft), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lift);
}
.auth-title {
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  font-weight: 800;
  margin: 20px 0 10px;
  letter-spacing: -0.03em;
}
.auth-lede { color: var(--ink-2); }
.auth-track {
  list-style: none; padding: 0; margin: 22px 0 26px;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px;
}
.auth-track li {
  height: 22px; border-radius: var(--r-tile); background: var(--pine);
  opacity: 0; animation: tile-in 420ms var(--ease) forwards;
  animation-delay: calc(var(--i) * 45ms);
}
.auth-track li:nth-child(n + 8) { background: var(--line); }
.auth-track li:nth-child(8) { background: var(--marigold); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.noscript { padding: 24px; text-align: center; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px;
  font: 600 0.95rem/1.2 var(--font-body);
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl);
  cursor: pointer; text-decoration: none;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.btn:hover { border-color: var(--pine); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn--primary:hover { background: var(--pine-strong); border-color: var(--pine-strong); }
.btn--danger { color: var(--danger); border-color: #e3b8be; }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--pine-soft); border-color: transparent; }
.btn--small { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn--icon { min-height: 36px; min-width: 36px; padding: 6px; }
.btn--google { width: 100%; min-height: 52px; font-size: 1rem; margin-bottom: 14px; }
.btn--google .icon { width: 20px; height: 20px; }
.btn.is-busy::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; background: transparent; color: var(--ink);
  border-radius: var(--r-ctl); cursor: pointer; font-size: 1.6rem; line-height: 1;
}
.icon-btn:hover { background: var(--pine-soft); }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ shell */

.shell { min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(237, 242, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__client { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.topbar__who { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-switch select { max-width: 52vw; min-height: 40px; }

.sidebar { display: none; }

.main {
  padding: 18px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  max-width: 1180px;
  outline: none;
}

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 25;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); width: 100%;
  border: 0; background: transparent; color: var(--muted);
  font: 600 0.72rem/1.1 var(--font-body); text-decoration: none; cursor: pointer;
  position: relative;
}
.tab[aria-current='page'] { color: var(--pine); }
.tab[aria-current='page']::before {
  content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px;
  background: var(--marigold); border-radius: 0 0 3px 3px;
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-ctl);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
  transition: background var(--fast), color var(--fast);
}
.nav-link:hover { background: var(--pine-soft); color: var(--ink); }
.nav-link[aria-current='page'] { background: var(--pine); color: #fff; }
.nav-link[aria-current='page'] .icon { stroke: var(--marigold); }

.sidebar__role { margin: 4px 0 18px; color: var(--muted); font-size: 0.875rem; }
.sidebar__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar__email { font-size: 0.8rem; color: var(--muted); word-break: break-all; margin-bottom: 8px; }

.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(24, 51, 47, 0.4); animation: fade-in 160ms ease; }
.drawer__panel {
  position: absolute; inset: 0 0 0 auto; width: min(320px, 86vw);
  background: var(--surface); padding: 14px 14px max(18px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; overflow-y: auto;
  animation: drawer-in 220ms var(--ease);
}
.drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-left: 8px; }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .topbar { grid-column: 2; padding-left: 28px; }
  .topbar .wordmark, .topbar__menu, .tabbar { display: none; }
  .topbar__client { justify-content: flex-start; }
  .client-switch select { max-width: 320px; }
  .sidebar {
    display: flex; flex-direction: column;
    grid-column: 1; grid-row: 1 / span 2;
    position: sticky; top: 0; height: 100vh;
    padding: 22px 14px; background: var(--surface);
    border-right: 1px solid var(--line); overflow-y: auto;
  }
  .sidebar .wordmark { padding-left: 12px; }
  .sidebar__role { padding-left: 12px; }
  .main { grid-column: 2; padding: 26px 28px 48px; }
}

/* ------------------------------------------------------------ page */

.page--enter { animation: page-in 260ms var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.page-title {
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.03em; outline: none;
}
.page-intro { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--plan { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .span-2 { grid-column: span 2; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast);
}
.card:hover { border-color: var(--line-strong); }
.card--link { cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; display: block; }
.card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
@media (min-width: 760px) { .card { padding: 22px; } }

.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .card-title { margin: 0; }
.section-gap { margin-top: 16px; }

/* ------------------------------------------------------------ pills */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--active { background: var(--pine-soft); color: var(--pine); }
.pill--paused { background: var(--sky-soft); color: #33648c; }
.pill--completed { background: var(--marigold-soft); color: #8a5a07; }
.pill--expired { background: var(--danger-soft); color: var(--danger); }
.pill--upcoming { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill--neutral { background: var(--surface-2); color: var(--ink-2); }
.pill--neutral::before { display: none; }

/* ------------------------------------------------------------ plan card + week track */

.plan-card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plan-card__head .card-title { margin: 0; }
.plan-card__week { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 12px; }
.big-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 8vw, 3rem); letter-spacing: -0.04em; line-height: 1; }
.big-label { color: var(--muted); font-weight: 600; }

.week-track {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); gap: 5px;
}
.week {
  aspect-ratio: 1 / 1.35; border-radius: var(--r-tile);
  background: var(--line);
  animation: tile-in 360ms var(--ease) both;
  animation-delay: calc(var(--i) * 22ms);
}
.week--done { background: var(--pine); }
.week--current { background: var(--marigold); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--marigold); }
.week--ext { box-shadow: inset 0 0 0 2px var(--plum); }
.week--done.week--ext { background: var(--plum); }
.week--paused {
  background: repeating-linear-gradient(135deg, var(--sky) 0 4px, var(--sky-soft) 4px 8px);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sky);
}
@keyframes tile-in { from { opacity: 0; transform: scaleY(0.4); } to { opacity: 1; transform: none; } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--muted); margin: 0 0 12px; padding: 0; list-style: none; }
.legend i { display: inline-block; width: 10px; height: 13px; border-radius: 2px; margin-right: 6px; vertical-align: -2px; }

.progress {
  height: 10px; border-radius: 99px; background: var(--pine-soft); overflow: hidden; margin-bottom: 8px;
}
.progress > span {
  display: block; height: 100%; width: var(--p); max-width: 100%;
  background: var(--pine); border-radius: inherit;
  animation: grow 700ms var(--ease) both;
}
.progress--marigold > span { background: var(--marigold); }
.progress--over > span { background: var(--danger); }
@keyframes grow { from { width: 0; } }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 16px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 0.8rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 700; }
@media (min-width: 760px) { .facts--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.facts--4 { margin: 0 0 18px; }

/* ------------------------------------------------------------ timeline */

.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline__item { position: relative; padding: 0 0 16px; display: grid; gap: 1px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ''; position: absolute; left: -19px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--pine);
}
.timeline__item--pause::before { border-color: var(--sky); background: var(--sky-soft); }
.timeline__item--extension::before { border-color: var(--plum); }
.timeline__item--original-end::before { border-color: var(--line-strong); }
.timeline__item--end::before { background: var(--marigold); border-color: var(--marigold); }
.timeline__item--completed::before { background: var(--pine); }
.timeline__date { font-size: 0.8rem; color: var(--muted); }
.timeline__title { font-weight: 700; }
.timeline__detail { font-size: 0.9rem; color: var(--ink-2); overflow-wrap: anywhere; }
.timeline__item--original-end .timeline__title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ------------------------------------------------------------ forms */

.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form-grid--wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > .label, fieldset > legend { font-weight: 600; font-size: 0.9rem; }
.field .hint { font-size: 0.8rem; color: var(--muted); margin: 0; }
.req { color: var(--danger); }

input, select, textarea {
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  font: 400 1rem/1.3 var(--font-body);
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl);
  transition: border-color var(--fast), box-shadow var(--fast);
}
textarea { min-height: 90px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-soft); }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--danger); }
input[type='radio'], input[type='checkbox'] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--pine); margin: 0; }

.input-unit { position: relative; }
.input-unit input { padding-right: 48px; }
.input-unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.9rem; pointer-events: none; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.choice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl);
  cursor: pointer; font-weight: 600; flex: 1 1 140px;
}
.choice:has(input:checked) { border-color: var(--pine); background: var(--pine-soft); }

.field-error { color: var(--danger); font-size: 0.85rem; font-weight: 600; margin: 0; }
.form-error {
  color: var(--danger); background: var(--danger-soft);
  padding: 10px 12px; border-radius: var(--r-ctl); font-weight: 600; margin: 0 0 12px;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.preview-line { font-size: 0.9rem; color: var(--ink-2); background: var(--surface-2); padding: 8px 12px; border-radius: var(--r-ctl); margin: 0; }

details.disclosure { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; }
details.disclosure > summary { cursor: pointer; font-weight: 600; color: var(--pine); padding: 6px 0; }
details.disclosure[open] > summary { margin-bottom: 12px; }

.callout { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); border-left: 4px solid var(--pine); margin: 0 0 14px; }
.callout--sky { border-left-color: var(--sky); background: var(--sky-soft); }
.callout--warn { border-left-color: var(--marigold); background: var(--marigold-soft); }

/* ------------------------------------------------------------ tables */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; border-radius: 8px; }
.table-scroll:focus-visible { outline-offset: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--fast); }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; width: 1%; }
.group-row td { background: var(--surface-2); font-weight: 700; color: var(--ink-2); font-size: 0.85rem; }

/* ------------------------------------------------------------ misc components */

.empty { text-align: center; padding: 18px 8px; display: grid; gap: 6px; justify-items: center; }
.empty__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: 0; }
.empty__body { color: var(--muted); max-width: 46ch; margin: 0 0 8px; }
.empty-inline { color: var(--muted); margin: 0; padding: 12px 0; }

.chip-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; min-height: 40px; font: 600 0.9rem var(--font-body); cursor: pointer;
}
.chip:hover { border-color: var(--pine); background: var(--pine-soft); }
.chip[aria-pressed='true'] { background: var(--pine); color: #fff; border-color: var(--pine); }
.chip__swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; box-shadow: 0 0 0 2px var(--surface); }
.chip[aria-pressed='false'] .chip__swatch { opacity: 0.35; }

.stat { display: grid; gap: 2px; }
.stat__value { font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; line-height: 1.1; }
.stat__label { color: var(--muted); font-size: 0.85rem; }
.delta-down { color: var(--ok); font-weight: 700; }
.delta-up { color: var(--ink-2); font-weight: 700; }

.macro-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.macro-row__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.macro-row__name { font-weight: 700; }
.macro-row__nums { font-size: 0.9rem; color: var(--ink-2); }
.macro-row__diff { font-size: 0.85rem; font-weight: 700; }
.macro-row__diff.over { color: var(--danger); }
.macro-row__diff.under { color: var(--pine); }

.roster { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.roster .card--link { padding: 16px; }
.roster__name { font-weight: 700; font-size: 1.05rem; margin: 0 0 6px; }
.roster__meta { font-size: 0.85rem; color: var(--muted); margin: 8px 0 0; }
.roster .week-track { grid-template-columns: repeat(auto-fill, minmax(8px, 1fr)); gap: 3px; margin: 10px 0 0; }
.roster .week { animation: none; }

.day-group + .day-group { margin-top: 18px; }
.day-group__title { font-size: 1rem; font-weight: 700; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ skeletons */

.skeleton-block { display: grid; gap: 10px; }
.skeleton {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton:first-child { height: 20px; width: 40% !important; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------ toasts */

.toasts {
  position: fixed; z-index: 80;
  left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
@media (min-width: 960px) { .toasts { left: auto; right: 24px; bottom: 24px; justify-items: end; } }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  width: min(420px, 100%);
  background: var(--ink); color: #fff;
  border-radius: 12px; padding: 10px 8px 10px 12px;
  box-shadow: var(--shadow-lift);
  animation: toast-in 220ms var(--ease);
}
.toast--leaving { animation: toast-out 180ms ease forwards; }
.toast__icon {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 0.85rem;
  background: var(--sage); color: var(--ink);
}
.toast--error .toast__icon { background: #ffb3bc; color: #5c0f19; }
.toast--info .toast__icon { background: var(--sky-soft); color: #33648c; }
.toast__msg { flex: 1; margin: 0; font-size: 0.92rem; }
.toast__close { flex: none; width: 36px; height: 36px; border: 0; background: transparent; color: #fff; font-size: 1.3rem; border-radius: 8px; cursor: pointer; }
.toast__close:hover { background: rgba(255, 255, 255, 0.12); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------ charts */

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__tick { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart__line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 900ms var(--ease) forwards; }
.chart__dot { stroke: var(--surface); stroke-width: 2; }
.chart__bar { transform-box: fill-box; transform-origin: bottom; animation: bar-in 500ms var(--ease) both; }
.chart__target { stroke: var(--marigold); stroke-width: 2; stroke-dasharray: 6 5; }
.chart__target-label { fill: #8a5a07; font-size: 11px; font-weight: 700; font-family: var(--font-body); }
.chart__cursor { stroke: var(--line-strong); stroke-width: 1; }
.chart__hit { cursor: crosshair; }
.chart__tip {
  position: absolute; top: 0; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 8px; padding: 6px 10px;
  font-size: 0.8rem; display: grid; gap: 2px; pointer-events: none; white-space: nowrap; z-index: 2;
}
.chart__tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.chart-data { margin-top: 10px; }
.chart-data summary { cursor: pointer; color: var(--pine); font-weight: 600; font-size: 0.9rem; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes bar-in { from { transform: scaleY(0); } }

/* ------------------------------------------------------------ print */

#print-root { display: none; }

@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  body > :not(#print-root) { display: none !important; }
  #print-root { display: block !important; color: #000; font-size: 11pt; }
  #print-root h1 { font-family: var(--font-display); font-size: 20pt; margin-bottom: 2mm; }
  #print-root .print-meta { color: #444; margin-bottom: 6mm; }
  #print-root h2 { font-size: 12pt; margin: 6mm 0 2mm; }
  #print-root table { font-size: 10pt; page-break-inside: auto; }
  #print-root tr { page-break-inside: avoid; }
  #print-root th, #print-root td { padding: 4px 6px; border-bottom: 0.5pt solid #bbb; }
  #print-root .print-brand { font-family: var(--font-display); font-weight: 800; color: #1f5c4e; }
}

/* ------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton, .boot__bar::after { animation: none !important; }
  .card--link:hover { transform: none; }
}

/* ------------------------------------------------------------ meal plan builder */

.mp-weekbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.mp-weekbar .field { flex: 1 1 240px; }
.mp-weekbar__actions { flex: 0 0 auto; }

.mp-copy { display: flex; gap: 8px; }
.mp-copy select { flex: 1; min-width: 0; }

.mp-section { margin-top: 20px; }
.mp-section__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 12px; background: var(--surface-2); border-radius: var(--r-ctl);
  border-left: 4px solid var(--pine);
}
.mp-section__title { font-size: 1.05rem; font-weight: 700; }
.mp-section__sub { font-weight: 700; color: var(--ink-2); font-size: 0.9rem; }
.mp-add { margin-top: 6px; color: var(--pine); }

.mp-rows { list-style: none; margin: 0; padding: 0; }
.mp-row {
  display: grid; gap: 8px 10px; align-items: center;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'food food' 'qty actions' 'macros macros' 'error error';
  padding: 12px 4px; border-bottom: 1px solid var(--line);
  transition: background var(--fast);
}
.mp-row__food { grid-area: food; min-width: 0; }
.mp-row__qty { grid-area: qty; display: flex; gap: 6px; min-width: 0; }
.mp-row__qty input { width: 96px; flex: none; text-align: right; }
.mp-row__qty select { width: auto; min-width: 70px; max-width: 150px; }
.mp-row__macros {
  grid-area: macros; margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  font-size: 0.85rem;
}
.mp-row__macros div { min-width: 0; }
.mp-row__macros dt { color: var(--muted); font-size: 0.72rem; }
.mp-row__macros dd { margin: 0; font-weight: 600; white-space: nowrap; }
.mp-row__macros div:first-child dd { color: var(--pine); font-weight: 800; }
.mp-row__actions { grid-area: actions; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.mp-row__error { grid-area: error; margin: 0; color: var(--danger); font-weight: 600; font-size: 0.85rem; }
.mp-row--new { background: linear-gradient(90deg, var(--marigold-soft), transparent 60%); }
.mp-row--edited { background: linear-gradient(90deg, var(--pine-soft), transparent 60%); }
.mp-row--removed { opacity: 0.6; }
.mp-row--removed .mp-row__macros dd { text-decoration: line-through; }

@media (min-width: 860px) {
  .mp-row {
    grid-template-columns: minmax(180px, 1.6fr) auto minmax(260px, 1.4fr) 104px;
    grid-template-areas: 'food qty macros actions' 'error error error error';
    padding: 8px 4px;
  }
  .mp-row__macros dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mp-row__macros dd { text-align: right; }
}

.tag { font-size: 0.7rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; }
.tag--new { background: var(--marigold-soft); color: #8a5a07; }
.tag--edited { background: var(--pine-soft); color: var(--pine); }
.tag--removed { background: var(--danger-soft); color: var(--danger); }
.icon-btn--small { width: 36px; height: 36px; font-size: 1.4rem; color: var(--muted); }
.icon-btn--small:hover { color: var(--danger); background: var(--danger-soft); }

.mp-totals {
  position: sticky; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)); z-index: 5;
  margin: 20px -6px 0; padding: 12px 14px;
  background: var(--ink); color: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lift);
}
.mp-totals--static { position: static; margin: 16px 0 0; }
@media (min-width: 960px) { .mp-totals { bottom: 16px; } }
.mp-totals__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mp-total { display: grid; gap: 3px; min-width: 0; }
.mp-total__label { font-size: 0.75rem; color: #bcd3cb; }
.mp-total__value { font-family: var(--font-display); font-weight: 800; font-size: clamp(0.98rem, 4vw, 1.6rem); letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.mp-total__unit { color: #8fb3a6; }
.mp-wide { display: none; }
@media (min-width: 560px) { .mp-wide { display: inline; } }
.mp-total__value small { font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; color: #bcd3cb; }
.mp-total .progress { height: 6px; margin: 2px 0 0; background: rgba(255, 255, 255, 0.16); }
.mp-total__diff { font-size: 0.72rem; color: #bcd3cb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-total__diff.over { color: #ffb3bc; font-weight: 700; }
.mp-totals__week { margin: 10px 0 0; font-size: 0.75rem; color: #bcd3cb; }
@media (max-width: 559px) { .mp-totals:not(.mp-totals--static) .mp-totals__week { display: none; } }

.mp-savebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.mp-status { margin: 0; color: var(--muted); font-size: 0.9rem; }
.mp-status--dirty { color: #8a5a07; font-weight: 600; }
.mp-savebar .form-error { flex-basis: 100%; }

/* =====================================================================
   Brand layer: plum + gold, serif headlines (after the base rules so it
   takes precedence at equal specificity)
   ===================================================================== */

body { font-size: 0.95rem; letter-spacing: 0.005em; }

h1, h2, h3,
.page-title, .auth-title, .card-title, .big-num, .stat__value, .empty__title {
  font-family: var(--font-display);
  letter-spacing: 0;
}
.mp-section__title, .day-group__title, .macro-row__name, .roster__name, .timeline__title,
.mp-row__macros dd, .mp-total__value { font-family: var(--font-body); }

.page-eyebrow, .eyebrow {
  margin: 0 0 6px;
  font: 600 0.7rem/1.4 var(--font-body);
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold-text);
}
.page-eyebrow .dot { color: var(--marigold); margin: 0 0.6em; }
.page-title { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 600; line-height: 1.05; }
.page-title em, .auth-title em, .card-title em { font-style: italic; color: var(--marigold); }
.card-title { font-size: 1.45rem; font-weight: 600; line-height: 1.15; }
.page-intro { font-size: 0.95rem; }

/* Wordmark */
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-style: italic;
  font-size: 1.9rem; letter-spacing: 0.01em;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark--small { font-size: 1.5rem; }

/* Buttons: pills, gold primary like the site's "Book a Consultation" */
.btn { border-radius: 999px; border-color: var(--pine); color: var(--pine); font-weight: 600; letter-spacing: 0.01em; padding: 10px 20px; }
.btn:hover { background: var(--pine-soft); border-color: var(--pine); }
.btn--primary {
  background: var(--gold-grad); border-color: transparent; color: var(--pine-strong);
  box-shadow: 0 8px 20px -10px rgba(176, 136, 58, 0.8);
}
.btn--primary:hover { background: var(--gold-grad); filter: brightness(1.06); border-color: transparent; box-shadow: 0 10px 24px -10px rgba(176, 136, 58, 0.95); }
.btn--ghost { border-color: transparent; color: var(--pine); }
.btn--danger { color: var(--danger); border-color: #e3b8be; }
.btn--small { padding: 6px 14px; }
.btn--google { background: var(--gold-grad); border-color: transparent; color: var(--pine-strong); box-shadow: 0 10px 26px -12px rgba(228, 199, 126, 0.9); }
.btn--google:hover { filter: brightness(1.06); background: var(--gold-grad); }
.btn--google .icon { background: #fff; border-radius: 50%; padding: 2px; width: 22px; height: 22px; }
.chip { border-radius: 999px; }
.chip[aria-pressed='true'] { background: var(--pine); border-color: var(--pine); }

/* Dark plum frame: top bar and sidebar */
.topbar { background: var(--pine-strong); border-bottom: 1px solid rgba(201, 162, 78, 0.25); color: var(--cream); backdrop-filter: none; }
.topbar .icon-btn { color: var(--cream); }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.topbar__who { color: var(--cream); }
.client-switch select {
  background: rgba(255, 255, 255, 0.06); color: var(--cream);
  border: 1px solid rgba(201, 162, 78, 0.45); border-radius: 999px; padding: 8px 36px 8px 16px;
}
.client-switch select option { color: var(--ink); background: #fff; }

@media (min-width: 960px) {
  .sidebar { background: var(--plum-grad); border-right: 1px solid rgba(201, 162, 78, 0.22); color: var(--cream); }
}
.sidebar__role { color: var(--marigold); letter-spacing: 0.26em; text-transform: uppercase; font-size: 0.68rem; font-weight: 600; }
.sidebar .nav-link { color: #e6d9e8; border: 1px solid transparent; border-radius: 999px; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar .nav-link[aria-current='page'] { background: rgba(255, 255, 255, 0.08); border-color: rgba(201, 162, 78, 0.55); color: #fff; }
.sidebar .nav-link[aria-current='page'] .icon, .sidebar .nav-link:hover .icon { stroke: var(--marigold); }
.sidebar__foot { border-top-color: rgba(255, 255, 255, 0.12); }
.sidebar__email { color: #bfa9c4; }
.sidebar .btn--ghost { color: var(--marigold); }
.sidebar .btn--ghost:hover { background: rgba(255, 255, 255, 0.06); }

.drawer__panel { background: var(--plum-grad); color: var(--cream); }
.drawer .nav-link { color: #e6d9e8; border-radius: 999px; border: 1px solid transparent; }
.drawer .nav-link[aria-current='page'] { background: rgba(255, 255, 255, 0.08); border-color: rgba(201, 162, 78, 0.55); color: #fff; }
.drawer .nav-link[aria-current='page'] .icon { stroke: var(--marigold); }
.drawer .icon-btn { color: var(--cream); }
.drawer .sidebar__foot { border-top-color: rgba(255, 255, 255, 0.12); }
.drawer .btn--ghost { color: var(--marigold); }

.tab[aria-current='page'] { color: var(--pine); }
.tab[aria-current='page']::before { background: var(--gold-grad); }

/* Cards */
.card { border-color: #efe6dc; }
.card--link:hover { border-color: rgba(201, 162, 78, 0.6); }

/* Programme card: the plum hero panel */
.plan-card {
  background: var(--plum-grad); color: var(--cream); border-color: rgba(201, 162, 78, 0.35);
  position: relative; overflow: hidden;
}
.plan-card::after {
  content: ''; position: absolute; inset: auto -30% -60% auto; width: 80%; height: 120%;
  border: 1px solid rgba(201, 162, 78, 0.18); border-radius: 50%; pointer-events: none;
}
.plan-card .card-title { color: #fff; }
.plan-card .big-num { color: #fff; font-weight: 600; font-size: clamp(2.6rem, 9vw, 3.4rem); }
.plan-card .big-label { color: var(--marigold); font-family: var(--font-display); font-style: italic; font-size: 1.4rem; font-weight: 500; }
.plan-card .muted { color: #cdbcd1; }
.plan-card .facts dt { color: #bfa9c4; letter-spacing: 0.04em; }
.plan-card .facts dd { color: #fff; }
.plan-card .progress { background: rgba(255, 255, 255, 0.14); }
.plan-card .progress > span { background: var(--gold-grad); }
.plan-card .legend { color: #cdbcd1; margin-top: 4px; }
.plan-card .pill--active { background: rgba(201, 162, 78, 0.18); color: #f1d999; }
.plan-card .pill--upcoming { background: rgba(255, 255, 255, 0.08); color: var(--cream); border-color: rgba(255, 255, 255, 0.2); }

/* Week track: gold for completed weeks (each one is a little win) */
.week--done { background: var(--gold-grad); }
.week--current { background: var(--pine); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--marigold); }
.week--ext { box-shadow: inset 0 0 0 2px var(--plum); }
.week--done.week--ext { background: var(--plum); }
.plan-card .week { background: rgba(255, 255, 255, 0.14); }
.plan-card .week--done { background: var(--gold-grad); }
.plan-card .week--done.week--ext { background: var(--plum); }
.plan-card .week--current { background: var(--cream); box-shadow: 0 0 0 2px var(--pine-strong), 0 0 0 4px var(--marigold); }
.plan-card .week--ext:not(.week--done):not(.week--current) { background: transparent; box-shadow: inset 0 0 0 2px var(--plum); }
.plan-card .week--paused { background: repeating-linear-gradient(135deg, var(--sky) 0 4px, var(--sky-soft) 4px 8px); }

/* Progress bars elsewhere */
.progress > span { background: var(--pine); }
.progress--marigold > span { background: var(--gold-grad); }

/* Pills */
.pill--active { background: var(--pine-soft); color: var(--pine); }
.pill--completed { background: var(--marigold-soft); color: var(--gold-text); }

/* Section heads */
.mp-section__head { border-left-color: var(--marigold); }
.day-group__title, .mp-section__title { color: var(--pine); }

/* Totals bar */
.mp-totals { background: var(--plum-grad); border: 1px solid rgba(201, 162, 78, 0.35); }
.mp-total__label, .mp-totals__week, .mp-total__diff { color: #d8c6dc; }
.mp-total__unit { color: #b9a3bf; }
.mp-total .progress > span { background: var(--gold-grad); }

/* Stats */
.stat__value { font-weight: 600; font-size: 2.3rem; color: var(--pine); }
.delta-down { color: var(--ok); }

/* Toasts */
.toast { background: var(--pine-strong); border: 1px solid rgba(201, 162, 78, 0.35); }
.toast__icon { background: var(--gold-grad); color: var(--pine-strong); }

/* Timeline */
.timeline__item::before { border-color: var(--pine); }
.timeline__item--end::before { background: var(--marigold); border-color: var(--marigold); }

/* Tables */
th { letter-spacing: 0.04em; }
.group-row td { background: var(--surface-2); color: var(--pine); }

/* Boot */
.boot { background: var(--plum-grad); }
.boot__bar { background: rgba(255, 255, 255, 0.12); }
.boot__bar::after { background: var(--gold-grad); }

/* Sign-in: hero like the site's landing section */
.auth-screen {
  background:
    radial-gradient(900px 500px at 85% 15%, rgba(201, 162, 78, 0.12), transparent 60%),
    radial-gradient(700px 600px at 0% 100%, rgba(184, 100, 138, 0.14), transparent 60%),
    var(--plum-grad);
  color: var(--cream);
  place-items: center start;
  padding: 32px clamp(20px, 7vw, 96px);
  position: relative; overflow: hidden;
}
.auth-screen::before {
  content: ''; position: absolute; width: 140vmax; height: 70vmax; left: -20vmax; top: 30%;
  border-top: 1px solid rgba(201, 162, 78, 0.22); border-radius: 50%; transform: rotate(-8deg); pointer-events: none;
}
.auth-card { background: transparent; box-shadow: none; padding: 0; width: min(560px, 100%); position: relative; }
.auth-card .wordmark { font-size: 2.4rem; }
.auth-title { font-size: clamp(2.8rem, 9vw, 4.4rem); font-weight: 500; line-height: 1.04; color: var(--cream); margin: 26px 0 18px; }
.auth-title span { display: block; }
.auth-title em { font-weight: 600; }
.auth-lede { color: #dccbdf; font-size: 1.05rem; max-width: 42ch; }
.auth-card .muted { color: #bfa9c4; }
.auth-card .form-error { background: rgba(255, 179, 188, 0.12); color: #ffd1d7; }
.auth-card p strong { color: #fff; }
.auth-card .btn { width: auto; }
.auth-card .btn:not(.btn--primary):not(.btn--google) { color: var(--cream); border-color: var(--marigold); }
.auth-card .btn:not(.btn--primary):not(.btn--google):hover { background: rgba(255, 255, 255, 0.06); }
.auth-track li { background: var(--gold-grad); }
.auth-track li:nth-child(n + 8) { background: rgba(255, 255, 255, 0.14); }
.auth-track li:nth-child(8) { background: var(--cream); }
.auth-pillars {
  list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-left: 1px solid rgba(201, 162, 78, 0.5);
}
.auth-pillars li { padding: 2px 14px; border-right: 1px solid rgba(255, 255, 255, 0.12); }
.auth-pillars li:last-child { border-right: 0; }
.auth-pillars b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; color: #fff; }
.auth-pillars span { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--marigold); }

/* Print stays black on white */
@media print { #print-root .print-brand { color: #3b1747; font-style: italic; } }

/* Reuse plan for next week */
.mp-repeat {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; margin: 0 0 16px; border-radius: var(--r-ctl);
  background: var(--marigold-soft); border: 1px solid rgba(201, 162, 78, 0.45);
}
.mp-repeat p { margin: 0; }

/* Dialog (version viewer) */
.dialog {
  width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  border: 1px solid rgba(201, 162, 78, 0.45); border-radius: 18px; padding: 20px;
  color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lift);
}
.dialog::backdrop { background: rgba(42, 15, 51, 0.55); }
.dialog[open] { animation: page-in 200ms var(--ease); }
.dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.dialog__head .card-title { margin: 0 0 4px; }

/* Weekly reviews */
.review-next__date { font-size: clamp(2.2rem, 7vw, 3rem); font-weight: 600; color: #fff; margin: 4px 0 6px; }
.review-next__when { color: var(--cream); font-size: 1rem; margin-bottom: 16px; }
.review-next__count { color: var(--marigold); font-family: var(--font-display); font-style: italic; font-size: 1.2rem; }
.plan-card .eyebrow { color: var(--marigold); }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.review { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color var(--fast); }
.review[open] { border-color: rgba(201, 162, 78, 0.6); }
.review__summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 12px 16px; cursor: pointer; list-style: none; border-radius: 14px;
}
.review__summary::-webkit-details-marker { display: none; }
.review__summary::after { content: '+'; margin-left: auto; font-size: 1.3rem; color: var(--marigold); line-height: 1; }
.review[open] .review__summary::after { content: '–'; }
.review__date { font-weight: 600; min-width: 112px; }
.review__body { padding: 0 16px 16px; }
.review-note { background: var(--surface-2); border-radius: var(--r-ctl); padding: 12px 14px; border-left: 3px solid var(--marigold); }
.review-note--client { border-left-color: var(--plum); }
.review-note__label { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; color: var(--gold-text); margin: 0 0 4px; }
.review-note__text { white-space: pre-wrap; margin: 0 0 10px; }
.review-form textarea { min-height: 80px; }
.tag--next { background: var(--pine); color: #fff; }
.dash-review { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.dash-review__when { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--pine); line-height: 1.1; }
.review__body .grid { align-items: start; }
.review-later > summary { color: var(--pine); }
.review-later[open] > summary { margin-bottom: 10px; }

/* Sign-in: brighter label and an illustrated preview where the site has its photo carousel */
.auth-card .eyebrow, .auth-preview .eyebrow { color: var(--marigold); }
.auth-screen { grid-template-columns: minmax(0, 1fr); }
.auth-preview { display: none; }
@media (min-width: 1080px) {
  .auth-screen { grid-template-columns: minmax(0, 560px) minmax(0, 400px); justify-content: space-between; column-gap: 6vw; }
  .auth-preview {
    display: block; position: relative;
    padding: 28px; border-radius: 22px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(201, 162, 78, 0.55);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: rotate(-2deg);
  }
  .auth-preview__week { font-family: var(--font-display); font-size: 3rem; color: #fff; margin: 4px 0 14px; line-height: 1; }
  .auth-preview__week em { color: var(--marigold); font-size: 1.6rem; }
  .auth-preview__track { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
  .auth-preview__track li { height: 28px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); }
  .auth-preview__track li.done { background: var(--gold-grad); }
  .auth-preview__track li.now { background: var(--cream); box-shadow: 0 0 0 2px var(--pine-strong), 0 0 0 4px var(--marigold); }
  .auth-preview__rows { margin: 0; display: grid; gap: 0; }
  .auth-preview__rows div { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); }
  .auth-preview__rows dt { color: #cdbcd1; font-size: 0.85rem; }
  .auth-preview__rows dd { margin: 0; color: #fff; font-weight: 600; }
  .auth-preview__quote { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; color: var(--sage); margin: 18px 0 0; }
}

/* Weekly check-in */
.review__cols { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .review__cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.tag--due { background: var(--marigold-soft); color: var(--gold-text); }
.checkin { background: var(--surface-2); border-radius: var(--r-ctl); padding: 14px 16px; border-left: 3px solid var(--plum); }
.checkin--missing { border-left-color: var(--marigold); }
.checkin__numbers { margin: 6px 0 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.checkin__numbers div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.checkin__numbers dt { font-size: 0.72rem; color: var(--muted); }
.checkin__numbers dd { margin: 2px 0 0; font: 600 1.6rem/1.1 var(--font-display); color: var(--pine); white-space: nowrap; }
.checkin__numbers dd small { font: 600 0.75rem var(--font-body); color: var(--muted); }
.checkin__diff { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.checkin__text { margin: 0; display: grid; gap: 8px; }
.checkin__text div { padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.checkin__text dt { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; }
.checkin__text dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.checkin__text .none dd { color: var(--muted); }
.checkin__text .flag { border-color: rgba(178, 58, 72, 0.35); background: #fff7f8; }
.checkin__text .flag dt { color: var(--danger); }
.checkin-form { background: var(--surface-2); border-radius: var(--r-ctl); padding: 14px 16px; }
.input-unit--wide input { padding-right: 112px; }
.input-unit--wide span { font-size: 0.8rem; }
@media (max-width: 420px) { .checkin__numbers { grid-template-columns: 1fr 1fr; } }

/* WhatsApp */
.btn--whatsapp { background: #1f8f5f; border-color: #1f8f5f; color: #fff; }
.btn--whatsapp:hover { background: #18774e; border-color: #18774e; }
.btn--whatsapp .icon { width: 18px; height: 18px; }
.btn--on-dark { border-color: var(--marigold); color: var(--cream); }
.btn--on-dark:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--marigold); }
.plan-card .btn--whatsapp { border-color: #1f8f5f; }
.chip--small { min-height: 32px; padding: 4px 12px; font-size: 0.8rem; }
.wa-chips { justify-content: flex-start; margin: 0 0 4px; }
.wa-grid { display: grid; gap: 18px; }
@media (min-width: 900px) { .wa-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.wa-preview {
  background: #efe7dd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1.2' fill='%23d8ccbf'/%3E%3C/svg%3E");
  border-radius: 14px; padding: 14px; border: 1px solid var(--line);
}
.wa-bubble {
  position: relative; max-width: 420px; margin-left: auto;
  background: #dcf8c6; color: #111b21; border-radius: 10px 0 10px 10px; padding: 10px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; font: 400 0.92rem/1.45 'Segoe UI', system-ui, sans-serif;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}
.wa-bubble::after { content: ''; position: absolute; top: 0; right: -8px; border: 8px solid transparent; border-top-color: #dcf8c6; border-left-color: #dcf8c6; border-right: 0; }

/* Dashboard: check-ins due */
.due-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.due-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.due-list__name { font-weight: 600; min-width: 140px; }
.due-list__when { color: var(--muted); font-size: 0.85rem; flex: 1; min-width: 150px; }
