/* PT With Rachel: app styles. Same brand tokens and primitives as the marketing site
   (rm-pt-website/site/styles.css), plus the components the account and admin pages need.
   Charcoal + warm white lead, plum is the signature, copper is a small accent, never small text. */

:root {
  --charcoal: #171719;
  --warm-white: #F6F2EC;
  --plum: #4B2E3D;
  --plum-deep: #3A2330;
  --copper: #C76A4B;
  --stone: #A39D96;
  --stone-light: #DDD7CF;
  --paper: #FFFDF9;
  --ink-soft: #4A4648;
  --on-dark-soft: #D9D1C8;
  --ok: #2F5D3A;
  --ok-bg: #E3EDE3;
  --warn: #7A4F10;
  --warn-bg: #F5E9D2;
  --bad: #8A2A1B;
  --bad-bg: #F3DEDA;

  --font-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-1: 0.5rem; --space-2: 1rem; --space-3: 1.5rem; --space-4: 2rem; --space-5: 3rem; --space-6: 4rem;
  --measure: 65ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 2px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--warm-white); color: var(--charcoal);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
}
img { max-width: 100%; display: block; }
video { max-width: 100%; display: block; background: var(--charcoal); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; line-height: 1.05; letter-spacing: 0.005em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.75rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: 1.0625rem; line-height: 1.2; }
p { margin: 0; max-width: var(--measure); }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--copper); }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--stone-light); margin: var(--space-4) 0; }

[hidden] { display: none !important; }
.visually-hidden { position: absolute; 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: var(--gutter); top: -4rem; z-index: 100; background: var(--charcoal); color: var(--warm-white); padding: var(--space-1) var(--space-2); font-weight: 700; }
.skip-link:focus { top: var(--space-1); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.main { flex: 1; padding-block: var(--space-4) var(--space-6); }
.page { display: grid; gap: var(--space-3); }
.page--narrow { max-width: 34rem; }
.page--reading { max-width: 44rem; }
.page-head { display: grid; gap: var(--space-1); margin-bottom: var(--space-2); }
.page-head .actions { margin-top: var(--space-1); }
.lede { font-size: 1.125rem; color: var(--ink-soft); }
.eyebrow { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9375rem; }
.stack { display: grid; gap: var(--space-2); }
.stack--tight { gap: var(--space-1); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); align-items: center; }
.cluster--between { justify-content: space-between; }
.push-top { margin-top: var(--space-2); }
.input--mini { width: 6rem; min-height: 2.5rem; padding: 0.25rem 0.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.grid-2 { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid-3 { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

/* Header */
.site-header { background: var(--warm-white); border-bottom: 1px solid var(--stone-light); position: relative; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 4rem; }
.wordmark { display: grid; text-decoration: none; font-family: var(--font-display); line-height: 1; }
.wordmark__name { font-size: 0.9375rem; letter-spacing: 0.06em; }
.wordmark__sub { font-size: 0.6875rem; letter-spacing: 0.3em; color: var(--ink-soft); }
.nav { display: flex; align-items: center; gap: var(--space-2); }
.nav__list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; align-items: center; }
.nav__list a { text-decoration: none; font-weight: 500; padding: 0.5rem 0; display: inline-block; }
.nav__list a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--copper); text-decoration-thickness: 2px; }
.nav-toggle { display: none; min-height: 2.75rem; padding: 0.5rem 0.875rem; border: 2px solid var(--charcoal); background: transparent; font: 700 0.9375rem var(--font-body); border-radius: var(--radius); cursor: pointer; }
.inline-form { display: inline; }
.linklike { background: none; border: 0; padding: 0.5rem 0; font: 500 1rem var(--font-body); color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 2.75rem; }
.linklike:hover { text-decoration-color: var(--copper); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0.75rem 1.5rem; border: 2px solid var(--charcoal); border-radius: var(--radius); background: var(--charcoal); color: var(--warm-white); font: 700 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.btn:hover { background: var(--plum); border-color: var(--plum); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--ghost { background: transparent; color: var(--charcoal); }
.btn--ghost:hover { background: var(--charcoal); color: var(--warm-white); border-color: var(--charcoal); }
.btn--light { background: var(--warm-white); color: var(--charcoal); border-color: var(--warm-white); }
.btn--light:hover { background: transparent; color: var(--warm-white); border-color: var(--warm-white); }
.btn--danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: var(--warm-white); border-color: var(--bad); }
.btn--small { min-height: 2.75rem; padding: 0.5rem 1rem; font-size: 0.9375rem; }
.btn--block { width: 100%; }

/* Cards and notices */
.card { background: var(--paper); border: 1px solid var(--stone-light); border-radius: var(--radius); padding: var(--space-3); display: grid; gap: var(--space-2); align-content: start; }
.card--plum { background: var(--plum); color: var(--warm-white); border-color: var(--plum); }
.card--plum .muted, .card--plum .eyebrow { color: var(--on-dark-soft); }
.card--charcoal { background: var(--charcoal); color: var(--warm-white); border-color: var(--charcoal); }
.card--charcoal .muted, .card--charcoal .eyebrow { color: var(--on-dark-soft); }
.card__title { display: flex; justify-content: space-between; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
.notice { padding: var(--space-2) var(--space-3); border-left: 4px solid var(--stone); background: var(--paper); border-radius: var(--radius); }
.notice--success, .notice--ok { border-color: var(--ok); background: var(--ok-bg); }
.notice--error, .notice--bad { border-color: var(--bad); background: var(--bad-bg); }
.notice--warn, .notice--warning { border-color: var(--warn); background: var(--warn-bg); }
.notice--info { border-color: var(--plum); }
.flash-list { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.key-facts { border: 2px solid var(--charcoal); padding: var(--space-3); display: grid; gap: var(--space-1); background: var(--paper); }
.key-facts h2 { font-size: 1rem; }
.key-facts dl { margin: 0; display: grid; gap: 0.25rem; }
.key-facts dt { font-weight: 700; }
.key-facts dd { margin: 0 0 0.5rem; }

/* Badges */
.badge { display: inline-block; padding: 0.125rem 0.5rem; border-radius: var(--radius); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.5; white-space: nowrap; background: var(--stone-light); color: var(--charcoal); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badge--muted { background: var(--stone-light); color: var(--ink-soft); }
.badge--plum { background: var(--plum); color: var(--warm-white); }

/* Checklist (onboarding) */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); counter-reset: step; }
.checklist li { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: var(--space-2); align-items: center; padding: var(--space-2); background: var(--paper); border: 1px solid var(--stone-light); border-radius: var(--radius); }
.checklist li::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--font-display); font-size: 1.25rem; color: var(--copper); }
.checklist li.is-done::before { content: "✓"; color: var(--ok); }
.checklist .detail { font-size: 0.9375rem; color: var(--ink-soft); }
@media (max-width: 480px) { .checklist li { grid-template-columns: 2.5rem 1fr; } .checklist li .btn { grid-column: 2; justify-self: start; } }

/* Forms */
.form { display: grid; gap: var(--space-3); max-width: 36rem; }
.form--wide { max-width: none; }
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); min-width: 0; }
.fieldset > legend { font-family: var(--font-display); text-transform: uppercase; font-size: 1.0625rem; padding: 0; margin-bottom: var(--space-1); }
/* Settings sections: each group reads as its own card, like the panels above the form.
   The float keeps the legend inside the card instead of notched into the border. */
.fieldset--card { background: var(--paper); border: 1px solid var(--stone-light); border-radius: var(--radius); padding: var(--space-3); }
.fieldset--card > legend { float: left; width: 100%; margin-bottom: 0; }
.fieldset--cols { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); align-items: start; }
.fieldset--cols > legend, .fieldset--cols > .field--wide { grid-column: 1 / -1; }
.field { display: grid; gap: 0.375rem; }
.field label { font-weight: 700; font-size: 0.9375rem; }
.field .optional { font-weight: 400; color: var(--ink-soft); }
.field .hint { font-size: 0.875rem; color: var(--ink-soft); }
.field input, .field select, .field textarea { width: 100%; min-height: 3rem; padding: 0.75rem 0.875rem; font: 400 1rem var(--font-body); color: var(--charcoal); background: var(--paper); border: 1.5px solid var(--ink-soft); border-radius: var(--radius); }
.field textarea { min-height: 6rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--copper); outline-offset: 1px; border-color: var(--charcoal); }
.field [aria-invalid="true"] { border-color: var(--bad); border-width: 2px; }
.field__error { color: var(--bad); font-weight: 700; font-size: 0.9375rem; }
.field--error label { color: var(--bad); }
.field--check label { display: grid; grid-template-columns: 1.75rem 1fr; gap: var(--space-1); align-items: start; font-weight: 500; cursor: pointer; min-height: 3rem; }
.field--check input { width: 1.5rem; height: 1.5rem; margin: 0.1rem 0 0; accent-color: var(--plum); min-height: 0; }
.choice-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0.75rem; border: 2px solid var(--ink-soft); border-radius: var(--radius); background: var(--paper); font-weight: 700; cursor: pointer; }
.choice input:checked + span { background: var(--charcoal); color: var(--warm-white); border-color: var(--charcoal); }
.choice input:focus-visible + span { outline: 3px solid var(--copper); outline-offset: 2px; }
.question { display: grid; gap: var(--space-1); padding-block: var(--space-2); border-bottom: 1px solid var(--stone-light); }
.question p { font-weight: 500; }
/* Attention queue (admin Today): one card, a fixed label rail, a thin urgency tick.
   Severity lives in the tick and tag colour only — no pill backgrounds competing. */
.queue { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--stone-light); border-radius: var(--radius); }
.queue__row { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 0.25rem var(--space-2); align-items: baseline; padding: 0.75rem var(--space-2); border-bottom: 1px solid var(--stone-light); border-left: 3px solid transparent; }
.queue__row:last-child { border-bottom: 0; }
.queue__tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--plum); align-self: first baseline; }
.queue__row--warn { border-left-color: var(--warn); }
.queue__row--warn .queue__tag { color: var(--warn); }
.queue__row--bad { border-left-color: var(--bad); }
.queue__row--bad .queue__tag { color: var(--bad); }
.queue__meta { font-size: 0.875rem; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .queue__row { grid-template-columns: 1fr auto; }
  .queue__tag { grid-column: 1 / -1; }
}

.day-note { border-left: 3px solid var(--plum); padding: 0.375rem var(--space-2); background: var(--paper); color: var(--ink-soft); font-size: 0.9375rem; }
.day-note__label { display: block; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--plum); }
.exercise { display: grid; gap: var(--space-1); padding-block: var(--space-2); border-bottom: 1px solid var(--stone-light); }
.exercise:last-child { border-bottom: 0; padding-bottom: 0; }
.exercise__name { font-weight: 700; }

/* Exercise guide ("How to do it") and the click-to-load YouTube tile */
.guide { display: grid; gap: var(--space-1); font-size: 0.9375rem; }
.guide summary { cursor: pointer; width: max-content; font-weight: 700; color: var(--plum); text-decoration: underline; text-underline-offset: 3px; }
.guide summary:hover { text-decoration-color: var(--copper); }
.guide ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.125rem; }
.guide__label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--plum); }
.guide__safety { border-left: 3px solid var(--copper); padding: 0.375rem var(--space-2); background: var(--paper); }
.guide__media, .yt { width: 100%; max-width: 40rem; border-radius: var(--radius); }
.yt { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--plum); color: var(--warm-white); overflow: hidden; }
.yt__play { display: grid; justify-items: center; gap: var(--space-1); padding: var(--space-2); text-align: center; font-weight: 700; color: inherit; }
.yt__play::before { content: "\25B6"; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--copper); color: var(--warm-white); font-size: 1.25rem; padding-left: 0.2rem; }
.yt__play:hover::before { background: var(--warm-white); color: var(--plum); }
.yt iframe, video.guide__media { border: 0; background: var(--charcoal); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: 16 / 9; }
video.guide__media, img.guide__media { height: auto; } /* own clips keep their ratio: portrait phone video is not forced to 16:9 */
.form .btn { justify-self: start; }
@media (max-width: 480px) { .form .btn { width: 100%; } }

/* Tables (stack on phones) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; background: var(--paper); }
.table th, .table td { text-align: left; padding: 0.75rem 0.75rem; border-bottom: 1px solid var(--stone-light); vertical-align: top; }
.table th { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.9375rem; margin: 0; }
.email-preview { width: 100%; height: 34rem; border: 1px solid var(--stone-light); background: var(--warm-white); }
[data-tag-insert] { cursor: pointer; }
@media (max-width: 600px) {
  .table--stack thead { display: none; }
  .table--stack tr { display: grid; gap: 0.25rem; padding: var(--space-2) 0; border-bottom: 1px solid var(--stone-light); }
  .table--stack td { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-1); padding: 0; border: 0; }
  .table--stack td::before { content: attr(data-label); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
  .table--stack td.num { text-align: left; }
}

/* Slot picker */
.date-strip { display: flex; gap: var(--space-1); overflow-x: auto; padding-bottom: var(--space-1); scrollbar-width: thin; }
.date-strip a { flex: 0 0 auto; min-width: 4.5rem; min-height: 3.5rem; display: grid; place-items: center; text-decoration: none; border: 2px solid var(--stone-light); border-radius: var(--radius); padding: 0.5rem; font-weight: 700; background: var(--paper); font-size: 0.9375rem; line-height: 1.2; text-align: center; }
.date-strip a[aria-current="date"] { border-color: var(--charcoal); background: var(--charcoal); color: var(--warm-white); }
.date-strip a.is-empty { color: var(--stone); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: var(--space-1); }
.slot-grid form { display: contents; }
.slot-grid .btn { min-height: 3.25rem; padding: 0.5rem; }

/* Calendar (admin week) */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-1); }
.day { background: var(--paper); border: 1px solid var(--stone-light); padding: var(--space-1); display: grid; gap: 0.375rem; align-content: start; min-height: 8rem; }
.day__head { font-weight: 700; font-size: 0.875rem; }
.day.is-today .day__head { color: var(--copper); }
.slot-card { display: block; border-left: 4px solid var(--plum); background: var(--warm-white); padding: 0.375rem 0.5rem; font-size: 0.875rem; text-decoration: none; line-height: 1.35; }
.slot-card.is-cancelled { border-color: var(--stone); color: var(--ink-soft); text-decoration: line-through; }
.slot-card.is-completed { border-color: var(--ok); }
@media (max-width: 820px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } }

/* Definition lists for records */
.record { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0.375rem var(--space-2); margin: 0; }
.record dt { font-weight: 700; font-size: 0.9375rem; color: var(--ink-soft); }
.record dd { margin: 0; }
@media (max-width: 480px) { .record { grid-template-columns: 1fr; } .record dd { margin-bottom: 0.5rem; } }

/* Prose (markdown documents) */
.prose { display: grid; gap: var(--space-2); }
.prose h2 { font-size: 1.125rem; margin-top: var(--space-2); }
.prose h3 { font-size: 1rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.prose table { border-collapse: collapse; font-size: 0.9375rem; width: 100%; }
.prose th, .prose td { border: 1px solid var(--stone-light); padding: 0.5rem; text-align: left; vertical-align: top; }
.prose blockquote { margin: 0; padding-left: var(--space-2); border-left: 3px solid var(--copper); color: var(--ink-soft); }
.document .sign-box { margin-top: var(--space-4); padding: var(--space-3); border: 2px solid var(--charcoal); background: var(--paper); display: grid; gap: var(--space-2); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-2); }
.stat { background: var(--paper); border: 1px solid var(--stone-light); padding: var(--space-2); display: grid; gap: 0.25rem; }
.stat__value { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; }
.stat__label { font-size: 0.875rem; color: var(--ink-soft); }

/* Footer */
.site-footer { background: var(--charcoal); color: var(--on-dark-soft); padding-block: var(--space-4); font-size: 0.9375rem; }
.footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; margin: 0; padding: 0; }

/* Responsive nav */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav__list { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; align-items: stretch; background: var(--warm-white); border-bottom: 1px solid var(--stone-light); padding: var(--space-1) var(--gutter) var(--space-2); }
  .nav__list.is-open, .nav__list--open { display: flex; }
  .nav__list--open { position: static; flex-direction: row; border: 0; padding: 0; gap: var(--space-2); }
  .nav__list:not(.nav__list--open) a, .nav__list:not(.nav__list--open) .linklike { display: block; width: 100%; text-align: left; padding-block: 0.875rem; border-bottom: 1px solid var(--stone-light); }
  .nav__list .inline-form { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
