/* Anchor's design system: one set of tokens and component classes for the
   client app, the therapist page and the landing page. DESIGN.md is the
   guide; design/index.html shows every part in each of its states.

   It is the only stylesheet: the landing page, the client app and the
   therapist page each load it alone, with an a-page body. Every token is
   named --a-*, every class starts with a-, and nothing outside an .a-page
   is styled.

   State hooks: each :hover and :focus-visible rule also answers to .is-hover
   and .is-focus, so the styleguide can show those states side by side.

   Contrast notes: a rule that sets a text or border colour without its own
   background names the surfaces it sits on, as "on:"; a rule that sets a
   background without a text colour names the text colours it carries, as
   "text:". tests/design.test.js reads these notes and the token values and
   fails any pair under 4.5 to 1 (3 to 1 for large text and for borders). */

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

/* ---- Tokens ---- */

:root {
  /* Colour, by role. */
  --a-cream: #f8f4ec;        /* page ground */
  --a-white: #ffffff;        /* cards, fields, the code frame */
  --a-ink: #1d2523;          /* text, the line of every drawing */
  --a-ink-soft: #55605d;     /* secondary text, hints, dated lines */
  --a-sage: #2d5a4c;         /* the one primary: main actions, Tried It, focus */
  --a-sage-deep: #22463b;    /* primary under the pointer */
  --a-sage-tint: #edf4f1;    /* sage surface: Tried It tile, panels, good notices */
  --a-sage-hover: #e1ece7;   /* sage surface under the pointer */
  --a-sage-line: #c5d9d1;    /* hairline on sage surfaces, decorative only */
  --a-clay: #b85d3b;         /* Not Today's accent: drawings, the attention edge */
  --a-clay-deep: #9a4b2e;    /* clay words, the Not Today edge, clay fills with words */
  --a-clay-hover: #7f3e26;   /* clay-deep fill under the pointer */
  --a-blush: #f6e6df;        /* soft surface: Not Today tile, shared card head, confirm */
  --a-blush-hover: #f2dcd4;  /* blush surface under the pointer */
  --a-blush-line: #e9c6b9;   /* hairline on blush surfaces, decorative only */
  --a-line: #e7e0d4;         /* card and divider hairline, the tab strip */
  --a-line-strong: #857f75;  /* control borders */
  --a-scrim: rgb(29 37 35 / 0.42); /* behind a dialog */

  /* Type. */
  --a-font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --a-font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --a-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --a-size-label: 0.875rem;    /* 14px: dated lines, tags, labels; never a sentence */
  --a-size-body: 1rem;         /* 16px: body text, controls, hints */
  --a-size-reading: 1.125rem;  /* 18px: a note or prompt read as a page */
  --a-size-title-3: 1.25rem;   /* 20px */
  --a-size-title-2: 1.5rem;    /* 24px */
  --a-size-title-1: 2rem;      /* 32px */
  --a-size-display: 3rem;      /* 48px: the show-it-big title, the landing opening */

  --a-leading-tight: 1.2;
  --a-leading-body: 1.55;
  --a-leading-reading: 1.7;

  /* Spacing, on a 4px step. */
  --a-space-1: 4px;
  --a-space-2: 8px;
  --a-space-3: 12px;
  --a-space-4: 16px;
  --a-space-5: 24px;
  --a-space-6: 32px;
  --a-space-7: 48px;
  --a-space-8: 64px;

  /* Radius. */
  --a-radius-xs: 4px;
  --a-radius-s: 10px;
  --a-radius-m: 14px;
  --a-radius-l: 20px;
  --a-radius-xl: 28px;
  --a-radius-phone: 40px;
  --a-radius-pill: 999px;

  /* Shadow. */
  --a-shadow-raised: 0 1px 2px rgb(29 37 35 / 0.08);
  --a-shadow-card: 0 1px 2px rgb(29 37 35 / 0.04), 0 8px 24px rgb(29 37 35 / 0.05);
  --a-shadow-dialog: 0 16px 48px rgb(29 37 35 / 0.18);

  /* Motion: short fades only. */
  --a-fade: 160ms;
  --a-fade-slow: 240ms;
  --a-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Sizes. */
  --a-tap: 44px;               /* smallest tap target */
  --a-control: 48px;           /* buttons and fields */
  --a-width-app: 720px;        /* the client app and the therapist page on a phone */
  --a-width-marketing: 1040px; /* the landing page */
  --a-width-wide: 1280px;      /* the therapist page on a computer */
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --a-fade: 0ms;
    --a-fade-slow: 0ms;
  }
}

/* ---- Ground ---- */

/* The page's ground reaches the edges even on a short page. Without :has()
   the body's own full height covers the window instead. */
html:has(.a-page) {
  background-color: var(--a-cream); /* text: none */
}

.a-page {
  margin: 0;
  min-height: 100vh;
  background-color: var(--a-cream);
  color: var(--a-ink);
  font-family: var(--a-font-sans);
  font-size: var(--a-size-body);
  line-height: var(--a-leading-body);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

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

/* Anything marked hidden stays hidden, whatever component class it has. */
.a-page [hidden],
.a-page .hidden,
.a-hide {
  display: none !important;
}

/* ---- Layout ---- */

.a-shell {
  width: 100%;
  max-width: var(--a-width-app);
  margin-inline: auto;
  padding-inline: var(--a-space-4);
}

.a-shell--wide { max-width: var(--a-width-wide); }
.a-shell--marketing { max-width: var(--a-width-marketing); }

@media (min-width: 640px) {
  .a-shell--wide,
  .a-shell--marketing { padding-inline: var(--a-space-6); }
}

.a-main {
  padding-block: var(--a-space-5) var(--a-space-7);
}

.a-stack {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-4);
}

.a-stack--tight { gap: var(--a-space-2); }
.a-stack--loose { gap: var(--a-space-5); }

.a-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--a-space-3);
}

.a-row--tight { gap: var(--a-space-2); }
.a-row--top { align-items: flex-start; }
.a-row--between { justify-content: space-between; }
.a-row--end { justify-content: flex-end; }

.a-grow { flex: 1 1 12rem; min-width: 0; }

/* Two equal columns from 480px, such as a pair of date fields. */
.a-grid-2 {
  display: grid;
  gap: var(--a-space-3);
}

@media (min-width: 480px) {
  .a-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Two columns from 900px; one column below. */
.a-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--a-space-6);
}

@media (min-width: 900px) {
  .a-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .a-split--center { align-items: center; }
  /* The therapist's working screen: the writing, never narrower than 26rem,
     beside the preview, which is wide enough for the phone and a 320px code
     side by side from 1168px. */
  .a-split--work { grid-template-columns: minmax(26rem, 1fr) minmax(0, 672px); gap: var(--a-space-5); align-items: start; }
}

/* Stays in view while the column beside it scrolls. */
.a-sticky {
  position: sticky;
  inset-block-start: var(--a-space-5);
}

.a-rule {
  height: 1px;
  margin: 0;
  border: 0;
  background-color: var(--a-line); /* text: none */
}

/* ---- Type ---- */

.a-display,
.a-title-1,
.a-title-2,
.a-title-3 {
  margin: 0;
  font-family: var(--a-font-serif);
  font-weight: 500;
  line-height: var(--a-leading-tight);
  color: var(--a-ink); /* on: --a-cream --a-white --a-sage-tint --a-blush */
}

.a-display { font-size: var(--a-size-display); letter-spacing: -0.01em; }
.a-title-1 { font-size: var(--a-size-title-1); }
.a-title-2 { font-size: var(--a-size-title-2); }
.a-title-3 { font-size: var(--a-size-title-3); }

.a-eyebrow {
  margin: 0;
  font-family: var(--a-font-sans);
  font-size: var(--a-size-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a-ink-soft); /* on: --a-cream --a-white --a-sage-tint --a-blush */
}

.a-text {
  margin: 0;
  font-size: var(--a-size-body);
  line-height: var(--a-leading-body);
}

.a-lede {
  margin: 0;
  font-size: var(--a-size-reading);
  line-height: var(--a-leading-body);
  color: var(--a-ink-soft); /* on: --a-cream --a-white --a-sage-tint */
}

/* What the client reads or writes as a page: the serif at reading size. */
.a-reading {
  margin: 0;
  font-family: var(--a-font-serif);
  font-size: var(--a-size-reading);
  line-height: var(--a-leading-reading);
  color: var(--a-ink); /* on: --a-cream --a-white --a-sage-tint --a-blush */
}

/* A date or a short fact beside a title: label size, never a sentence. */
.a-meta {
  margin: 0;
  font-size: var(--a-size-label);
  color: var(--a-ink-soft); /* on: --a-cream --a-white --a-sage-tint --a-blush */
}

.a-muted { color: var(--a-ink-soft); /* on: --a-cream --a-white --a-sage-tint --a-blush */ }
.a-strong { font-weight: 700; color: var(--a-ink); /* on: --a-cream --a-white --a-sage-tint --a-blush */ }
.a-mono { font-family: var(--a-font-mono); }

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

/* ---- Focus: one visible ring on every control. A field shows it whenever
   focus is inside it, including a date field's own picker button. ---- */

.a-btn:focus-visible, .a-btn.is-focus,
.a-tile:focus-visible, .a-tile.is-focus,
.a-chip:focus-visible, .a-chip.is-focus,
.a-tag--choice:focus-visible, .a-tag--choice.is-focus,
.a-scale__cell:focus-visible, .a-scale__cell.is-focus,
.a-tab:focus-visible, .a-tab.is-focus,
.a-item--choice:focus-visible, .a-item--choice.is-focus,
.a-disclosure__toggle:focus-visible, .a-disclosure__toggle.is-focus,
.a-input:focus-within, .a-input.is-focus,
.a-textarea:focus-within, .a-textarea.is-focus,
.a-select:focus-within, .a-select.is-focus,
.a-link:focus-visible, .a-link.is-focus,
.a-brand[href]:focus-visible, .a-brand.is-focus,
.a-note__body:focus-visible, .a-note__body.is-focus,
.a-file:has(:focus-visible), .a-file.is-focus,
.a-switch:has(.a-switch__input:focus-visible), .a-switch.is-focus {
  outline: 3px solid var(--a-sage); /* on: --a-white --a-cream --a-sage-tint --a-blush */
  outline-offset: 2px;
}

/* A heading that takes focus from a script (a note page, an exercise from a
   link, the settings) shows no ring: it is not a control. */
.a-page [tabindex="-1"]:focus,
.a-page [tabindex="-1"]:focus-visible {
  outline: none;
}

/* ---- Header ---- */

.a-bar {
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  border-block-end: 1px solid var(--a-line);
}

.a-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-3);
  min-height: 64px;
  padding-block: var(--a-space-2);
}

.a-brand {
  display: flex;
  align-items: center;
  gap: var(--a-space-2);
}

/* On the client app and the therapist page the mark and the name go to the
   landing page; the client app takes the address away while a check-in
   holds anything unsaved. */
.a-brand[href] {
  min-height: var(--a-tap);
  border-radius: var(--a-radius-xs);
  color: inherit;
  text-decoration: none;
}

.a-brand__mark {
  display: block;
  width: 32px;
  height: 32px;
}

.a-brand__name {
  font-family: var(--a-font-serif);
  font-size: var(--a-size-title-3);
  font-weight: 600;
  color: var(--a-ink); /* on: --a-white */
}

.a-brand__sub {
  margin: 0;
  font-size: var(--a-size-body);
  color: var(--a-ink-soft); /* on: --a-white */
}

/* One header on every page: the same mark, the same name and the same
   height, with or without a line under the name. It scrolls with the page
   everywhere. On a phone it is one compact row with no line under the name,
   so it never holds a quarter of the screen. */
.a-bar .a-brand__name,
.a-bar .a-brand__sub {
  display: block;
  line-height: var(--a-leading-tight);
}

@media (max-width: 639px) {
  .a-bar .a-brand__sub { display: none; }
  .a-bar .a-bar__inner { min-height: calc(var(--a-tap) + 2 * var(--a-space-2)); padding-block: var(--a-space-1); gap: var(--a-space-2); }
}

/* The client app's header: the brand row, the tabs, then the plan and the
   save state. On a wider screen those two sit at the end of the brand row;
   on a phone they sit under the tabs, so the brand row is the same height
   as on every other page. */
.a-bar__layout {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-2);
}

.a-bar__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--a-space-2);
}

@media (max-width: 639px) {
  .a-bar__status { padding-block-end: var(--a-space-2); }
}

@media (min-width: 640px) {
  .a-bar__layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--a-space-3); }
  .a-bar__layout > .a-bar__status { grid-row: 1; grid-column: 2; }
  .a-bar__layout > nav { grid-column: 1 / -1; }
}

/* ---- Pills ---- */

/* A small status: saved on device, paid feature, the licence line. */
.a-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--a-space-2);
  padding: var(--a-space-1) var(--a-space-3);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-pill);
  background-color: var(--a-white);
  font-size: var(--a-size-label);
  font-weight: 600;
  line-height: 1.4;
  color: var(--a-ink-soft);
}

.a-pill--sage {
  border-color: var(--a-sage-line);
  background-color: var(--a-sage-tint);
  color: var(--a-sage);
}

.a-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--a-sage); /* text: none */
}

.a-pill__dot--attention { background-color: var(--a-clay); /* text: none */ }

/* ---- Buttons ---- */

.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--a-space-2);
  min-height: var(--a-control);
  min-width: var(--a-tap);
  margin: 0;
  padding: var(--a-space-3) var(--a-space-5);
  border: 1.5px solid transparent;
  border-radius: var(--a-radius-m);
  font-family: var(--a-font-sans);
  font-size: var(--a-size-body);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--a-fade) var(--a-ease), border-color var(--a-fade) var(--a-ease);
}

.a-btn--primary { background-color: var(--a-sage); color: var(--a-white); }
.a-btn--primary:hover, .a-btn--primary.is-hover { background-color: var(--a-sage-deep); /* text: --a-white */ }

.a-btn--secondary { background-color: var(--a-white); border-color: var(--a-line-strong); color: var(--a-ink); /* on: --a-white --a-cream --a-blush --a-sage-tint */ }
.a-btn--secondary:hover, .a-btn--secondary.is-hover { background-color: var(--a-cream); /* text: --a-ink */ }

.a-btn--quiet { background-color: transparent; color: var(--a-sage); padding-inline: var(--a-space-3); /* on: --a-white --a-cream --a-blush --a-sage-tint */ }
.a-btn--quiet:hover, .a-btn--quiet.is-hover { background-color: var(--a-sage-tint); /* text: --a-sage */ }

/* The one action that erases something, after an inline confirm. */
.a-btn--erase { background-color: var(--a-clay-deep); color: var(--a-white); }
.a-btn--erase:hover, .a-btn--erase.is-hover { background-color: var(--a-clay-hover); /* text: --a-white */ }

/* Close and Dismiss: a quiet button at the smallest tap size. */
.a-btn--compact {
  min-height: var(--a-tap);
  padding: var(--a-space-2) var(--a-space-3);
}

.a-btn--block { display: flex; width: 100%; }

/* A tall button with a second line, such as the two paths on the welcome screen. */
.a-btn--tall {
  flex-direction: column;
  gap: 0;
  min-height: 64px;
  font-size: var(--a-size-reading);
}

.a-btn__sub {
  font-size: var(--a-size-body);
  font-weight: 500;
}

.a-btn--secondary .a-btn__sub { color: var(--a-ink-soft); /* on: --a-white */ }

.a-btn:disabled,
.a-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* A link, at least as tall as a tap. */
.a-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--a-tap);
  border-radius: var(--a-radius-xs);
  font-weight: 600;
  color: var(--a-sage); /* on: --a-white --a-cream --a-blush --a-sage-tint */
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- The pair of equal tiles: Tried It and Not Today ----
   No icons: the two words carry the same weight, and their pressed states
   mirror each other. */

.a-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--a-space-3);
}

.a-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  margin: 0;
  padding: var(--a-space-3);
  border: 2px solid;
  border-radius: var(--a-radius-l);
  font-family: var(--a-font-sans);
  font-size: var(--a-size-reading);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--a-fade) var(--a-ease), color var(--a-fade) var(--a-ease);
}

.a-tile--tried { background-color: var(--a-sage-tint); border-color: var(--a-sage); color: var(--a-sage); /* on: --a-white */ }
.a-tile--tried:hover, .a-tile--tried.is-hover { background-color: var(--a-sage-hover); /* text: --a-sage */ }
.a-tile--tried[aria-pressed="true"] { background-color: var(--a-sage); color: var(--a-white); /* on: --a-white */ }

.a-tile--not-today { background-color: var(--a-blush); border-color: var(--a-clay-deep); color: var(--a-clay-deep); /* on: --a-white */ }
.a-tile--not-today:hover, .a-tile--not-today.is-hover { background-color: var(--a-blush-hover); /* text: --a-clay-deep */ }
.a-tile--not-today[aria-pressed="true"] { background-color: var(--a-clay-deep); color: var(--a-white); /* on: --a-white */ }

.a-tile:disabled { opacity: 0.5; cursor: not-allowed; }

/* Inside the phone preview the tiles are a picture, not controls. */
.a-tile--still { cursor: default; }

/* ---- Cards and panels: one raised card per region; panels are flat ---- */

.a-card {
  padding: var(--a-space-5);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-xl);
  box-shadow: var(--a-shadow-card);
}

/* A card that arrived and waits for a choice, such as a linked exercise. */
.a-card--accent { border-color: var(--a-sage-line); }

.a-panel {
  padding: var(--a-space-5);
  border-radius: var(--a-radius-xl);
  background-color: var(--a-sage-tint); /* text: --a-ink --a-ink-soft --a-sage */
}

.a-panel--plain { background-color: var(--a-cream); /* text: --a-ink --a-ink-soft */ }

/* The one-thing card: it opens a home screen with the one exercise to do. */
.a-onething {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-4);
  padding: var(--a-space-5);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-xl);
  box-shadow: var(--a-shadow-card);
}

.a-onething__head {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-1);
}

.a-onething__from {
  margin: 0;
  font-size: var(--a-size-body);
  color: var(--a-ink-soft); /* on: --a-white */
}

.a-onething__guide {
  margin: 0;
  padding-block-start: var(--a-space-3);
  border-block-start: 1px solid var(--a-line);
  font-size: var(--a-size-body);
  color: var(--a-ink-soft); /* on: --a-white */
}

/* ---- A note set as a page ---- */

.a-note {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-3);
  padding: var(--a-space-6) var(--a-space-5);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  border-radius: var(--a-radius-xl);
  box-shadow: var(--a-shadow-card);
}

.a-note__date {
  margin: 0;
  font-size: var(--a-size-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a-ink-soft); /* on: --a-white */
}

.a-note__title {
  margin: 0;
  font-family: var(--a-font-serif);
  font-size: var(--a-size-title-1);
  font-weight: 500;
  line-height: var(--a-leading-tight);
  color: var(--a-ink); /* on: --a-white */
}

.a-note__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--a-space-2);
}

/* Borderless writing at reading size, on a textarea or a paragraph. The
   inline padding, taken back by a margin, keeps the focus ring off the text. */
.a-note__body {
  display: block;
  width: calc(100% + 2 * var(--a-space-2));
  min-height: 6em;
  margin: 0;
  margin-inline: calc(-1 * var(--a-space-2));
  padding: var(--a-space-2);
  border: 0;
  border-radius: var(--a-radius-s);
  background: transparent;
  font-family: var(--a-font-serif);
  font-size: var(--a-size-reading);
  line-height: var(--a-leading-reading);
  color: var(--a-ink); /* on: --a-white */
  resize: none;
  field-sizing: content;
}

p.a-note__body { min-height: 0; }

.a-note__body::placeholder { color: var(--a-ink-soft); opacity: 1; /* on: --a-white */ }

/* ---- Tags ---- */

.a-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--a-space-1);
  margin: 0;
  padding: var(--a-space-1) var(--a-space-3);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-pill);
  background-color: var(--a-cream);
  font-family: var(--a-font-sans);
  font-size: var(--a-size-label);
  font-weight: 600;
  line-height: 1.4;
  color: var(--a-ink-soft);
}

.a-tag--sage { background-color: var(--a-sage-tint); border-color: var(--a-sage-line); color: var(--a-sage); }
.a-tag--clay { background-color: var(--a-blush); border-color: var(--a-blush-line); color: var(--a-clay-deep); }

/* The small check inside a chosen tag. */
.a-tag__check {
  display: block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* A soft tag the client can choose, such as what got in the way. Each one
   holds a sentence, so it is at body size. */
.a-tag--choice {
  min-height: var(--a-tap);
  padding: var(--a-space-2) var(--a-space-3);
  font-size: var(--a-size-body);
  border-color: var(--a-line-strong);
  background-color: var(--a-white);
  font-weight: 500;
  color: var(--a-ink); /* on: --a-white */
  cursor: pointer;
  transition: background-color var(--a-fade) var(--a-ease);
}

.a-tag--choice .a-tag__check { display: none; }
.a-tag--choice:hover, .a-tag--choice.is-hover { background-color: var(--a-blush); /* text: --a-ink */ }
.a-tag--choice[aria-pressed="true"] { background-color: var(--a-blush); border-color: var(--a-clay-deep); color: var(--a-clay-deep); /* on: --a-white */ }
.a-tag--choice[aria-pressed="true"] .a-tag__check { display: block; }
.a-tag--choice:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Chips: a choice among starting points, such as templates ---- */

.a-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--a-tap);
  margin: 0;
  padding: var(--a-space-2) var(--a-space-4);
  border: 1.5px solid var(--a-line-strong);
  border-radius: var(--a-radius-m);
  background-color: var(--a-white);
  font-family: var(--a-font-sans);
  font-size: var(--a-size-body);
  font-weight: 600;
  line-height: 1.25;
  color: var(--a-ink); /* on: --a-white --a-cream */
  text-align: start;
  cursor: pointer;
  transition: background-color var(--a-fade) var(--a-ease);
}

.a-chip--compact {
  padding: var(--a-space-2) var(--a-space-3);
  font-size: var(--a-size-label);
}

.a-chip:hover, .a-chip.is-hover { background-color: var(--a-sage-tint); /* text: --a-ink */ }
.a-chip[aria-pressed="true"] { background-color: var(--a-sage); border-color: var(--a-sage); color: var(--a-white); /* on: --a-white */ }
.a-chip:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- The 0 to 10 scale: eleven equal cells in one row ---- */

.a-scale-field {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-2);
  container-type: inline-size;
}

.a-scale__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--a-space-1) var(--a-space-3);
}

.a-scale__state { font-weight: 600; color: var(--a-ink-soft); /* on: --a-white --a-cream */ }
.a-scale__state--set { color: var(--a-sage); /* on: --a-white --a-cream */ }

.a-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  overflow: hidden;
  border: 1.5px solid var(--a-line-strong);
  border-radius: var(--a-radius-m);
  background-color: var(--a-white); /* text: --a-ink */
}

.a-scale__cell {
  min-width: 0;
  min-height: var(--a-tap);
  margin: 0;
  padding: 0;
  border: 0;
  border-inline-start: 1px solid var(--a-line-strong);
  background-color: var(--a-white);
  font-family: var(--a-font-sans);
  font-size: var(--a-size-body);
  font-weight: 600;
  color: var(--a-ink);
  cursor: pointer;
  transition: background-color var(--a-fade) var(--a-ease);
}

.a-scale__cell:first-child { border-inline-start: 0; }
.a-scale__cell:hover, .a-scale__cell.is-hover { background-color: var(--a-sage-tint); /* text: --a-ink */ }
.a-scale__cell[aria-pressed="true"] { background-color: var(--a-sage); color: var(--a-white); }
.a-scale__cell.is-focus,
.a-scale__cell:focus-visible { outline-offset: -3px; }

/* Where one row would make a cell narrower than 26px (inside a padded card
   on a small phone), the scale takes two rows: 0 to 5, then 6 to 10. */
@container (max-width: 287px) {
  .a-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .a-scale__cell:nth-child(7) { border-inline-start: 0; }
  .a-scale__cell:nth-child(n + 7) { border-block-start: 1px solid var(--a-line-strong); /* on: --a-white */ }
  /* The empty place after 10 is closed off from 5 above it and 10 beside it. */
  .a-scale__cell:nth-child(6) { border-block-end: 1px solid var(--a-line-strong); /* on: --a-white */ }
  .a-scale__cell:last-child { border-inline-end: 1px solid var(--a-line-strong); /* on: --a-white */ }
}

/* A scale cell drawn as a picture, in the phone preview on the therapist's
   daily log page: no taps, and no change under the pointer. */
.a-scale__cell--still {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.a-scale__cell--still:hover { background-color: var(--a-white); /* text: --a-ink */ }

/* ---- The line a daily log draws (site/log/): one dot for each day with a
   number, joined only where one day follows the next. A day with no number
   is a gap. Drawn on the shared card, so on white. ---- */

.a-chart { min-width: 0; }
.a-chart__svg { display: block; max-width: 100%; height: auto; }
.a-chart__grid { stroke: var(--a-line); stroke-width: 1; }
.a-chart__line { fill: none; stroke: var(--a-sage); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.a-chart__dot { fill: var(--a-sage); }
.a-chart__label { fill: var(--a-ink-soft); /* on: --a-white */ font-family: var(--a-font-sans); font-size: var(--a-size-label); }

/* ---- The shared card: the one page a client brings to session ---- */

.a-shared {
  overflow: hidden;
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  border: 1px solid var(--a-blush-line);
  border-radius: var(--a-radius-xl);
  box-shadow: var(--a-shadow-card);
}

.a-shared__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-2);
  padding: var(--a-space-3) var(--a-space-5);
  background-color: var(--a-blush);
  color: var(--a-clay-deep);
}

.a-shared__body {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-3);
  padding: var(--a-space-5);
}

.a-shared__private {
  margin: 0;
  font-size: var(--a-size-body);
  color: var(--a-ink-soft); /* on: --a-white */
}

.a-shared__foot {
  margin: 0;
  padding: var(--a-space-4) var(--a-space-5);
  border-block-start: 1px solid var(--a-line);
  font-size: var(--a-size-body);
  color: var(--a-ink-soft); /* on: --a-white */
}

/* ---- Opt-in switches: off until the client turns one on ----
   Markup: label.a-switch > span.a-switch__text (a-switch__label, then
   a-switch__off and a-switch__on, or a-switch__state for the reason a
   switch is shut) + input.a-switch__input (checkbox, role switch) +
   span.a-switch__track. The input covers the whole row, so the row is the
   tap target, and the word for the state follows the box, never colour alone. */

.a-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-4);
  min-height: 64px;
  padding: var(--a-space-3) var(--a-space-4);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-m);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  cursor: pointer;
}

.a-switch__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.a-switch__label { font-weight: 600; color: var(--a-ink); /* on: --a-white --a-sage-tint */ }
.a-switch__off,
.a-switch__state { color: var(--a-ink-soft); /* on: --a-white --a-sage-tint --a-cream */ }
.a-switch__on { display: none; font-weight: 600; color: var(--a-sage); /* on: --a-sage-tint */ }

.a-switch:has(.a-switch__input:checked) .a-switch__off { display: none; }
.a-switch:has(.a-switch__input:checked) .a-switch__on { display: inline; }

.a-switch__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.a-switch__track {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 32px;
  border: 2px solid var(--a-line-strong);
  border-radius: var(--a-radius-pill);
  background-color: var(--a-white); /* text: none */
  transition: background-color var(--a-fade) var(--a-ease), border-color var(--a-fade) var(--a-ease);
}

.a-switch__track::after {
  content: "";
  position: absolute;
  inset-block-start: var(--a-space-1);
  inset-inline-start: var(--a-space-1);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--a-line-strong); /* text: none */
  transition: inset-inline-start var(--a-fade) var(--a-ease), background-color var(--a-fade) var(--a-ease);
}

.a-switch:has(.a-switch__input:checked) {
  border-color: var(--a-sage);
  background-color: var(--a-sage-tint); /* text: --a-ink --a-ink-soft --a-sage */
}

.a-switch__input:checked ~ .a-switch__track {
  border-color: var(--a-sage);
  background-color: var(--a-sage); /* text: none on: --a-sage-tint */
}

.a-switch__input:checked ~ .a-switch__track::after {
  inset-inline-start: 24px;
  background-color: var(--a-white); /* text: none */
}

.a-switch:has(.a-switch__input:disabled) {
  background-color: var(--a-cream);
  cursor: not-allowed;
  opacity: 0.6;
}

.a-switch__input:disabled { cursor: not-allowed; }

/* Several switches as one group: one border around them and a hairline
   between, each row still a 48px tap target. */
.a-switches {
  overflow: hidden;
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-m);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
}

.a-switches .a-switch {
  min-height: var(--a-control);
  padding-block: var(--a-space-2);
  border-width: 0;
  border-radius: 0;
}

.a-switches .a-switch + .a-switch { border-block-start: 1px solid var(--a-line); }

/* Inside the group the focus ring is drawn within the row, so the group's
   edge does not clip it. */
.a-switches .a-switch:has(.a-switch__input:focus-visible),
.a-switches .a-switch.is-focus { outline-offset: -3px; }

/* ---- Notices, by tone: calm, good, attention ---- */

.a-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-2) var(--a-space-4);
  padding: var(--a-space-3) var(--a-space-4);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-m);
  background-color: var(--a-white);
  font-size: var(--a-size-body);
  color: var(--a-ink);
}

/* Calm: an update is ready, a page opened from this computer, no licence yet. */
.a-banner--calm { background-color: var(--a-white); /* text: --a-ink --a-ink-soft */ }

/* Good: saved on device, an exercise added, a licence that is valid. */
.a-banner--good { background-color: var(--a-sage-tint); border-color: var(--a-sage-line); /* text: --a-ink --a-ink-soft --a-sage */ }

/* Attention: could not save, an old link, the Demo Sandbox, a plan set aside, a licence that expired. */
.a-banner--attention { background-color: var(--a-blush); border-color: var(--a-clay); /* text: --a-ink --a-ink-soft on: --a-cream --a-white */ }
.a-banner--attention .a-strong { color: var(--a-clay-deep); /* on: --a-blush */ }

/* Runs the page width under the header, with no rounded corners. */
.a-banner--edge {
  border-width: 0;
  border-block-end-width: 1px;
  border-radius: 0;
  justify-content: center;
  text-align: center;
}

.a-fade-in { animation: a-fade-in var(--a-fade-slow) var(--a-ease) both; }

@keyframes a-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Toasts: a short line after an action, at the foot of the screen ---- */

.a-toasts {
  position: fixed;
  inset-inline: var(--a-space-4);
  inset-block-end: var(--a-space-4);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--a-space-2);
  pointer-events: none;
}

@media (min-width: 640px) {
  .a-toasts { inset-inline-start: auto; width: 24rem; }
}

/* At the top of the screen instead, where a toast at the foot would cover
   a code (the therapist page moves them while one would). */
.a-toasts--top {
  inset-block-start: var(--a-space-4);
  inset-block-end: auto;
}

.a-toast {
  padding: var(--a-space-3) var(--a-space-4);
  border-radius: var(--a-radius-m);
  background-color: var(--a-ink);
  box-shadow: var(--a-shadow-dialog);
  font-size: var(--a-size-body);
  font-weight: 600;
  color: var(--a-white);
  pointer-events: auto;
  transition: opacity var(--a-fade-slow) var(--a-ease);
}

.a-toast--attention { background-color: var(--a-clay-deep); /* text: --a-white */ }

/* After 3.2 seconds a toast fades out, then leaves the page. */
.a-toast--leaving { opacity: 0; }

/* ---- Fields ---- */

.a-field {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-2);
}

.a-label {
  font-size: var(--a-size-body);
  font-weight: 600;
  color: var(--a-ink); /* on: --a-white --a-cream --a-sage-tint */
}

.a-hint {
  margin: 0;
  font-size: var(--a-size-body);
  color: var(--a-ink-soft); /* on: --a-white --a-cream --a-sage-tint --a-blush */
}

.a-input,
.a-textarea,
.a-select {
  display: block;
  width: 100%;
  min-height: var(--a-control);
  margin: 0;
  padding: var(--a-space-3) var(--a-space-4);
  border: 1.5px solid var(--a-line-strong);
  border-radius: var(--a-radius-m);
  background-color: var(--a-white);
  font-family: var(--a-font-sans);
  font-size: var(--a-size-body);
  line-height: var(--a-leading-body);
  color: var(--a-ink); /* on: --a-white --a-cream --a-sage-tint */
}

.a-textarea { resize: vertical; }

/* A value to read exactly, such as the client link. */
.a-input--mono { font-family: var(--a-font-mono); font-size: var(--a-size-label); }

.a-input::placeholder,
.a-textarea::placeholder { color: var(--a-ink-soft); opacity: 1; /* on: --a-white */ }

.a-input:focus-within, .a-input.is-focus,
.a-textarea:focus-within, .a-textarea.is-focus,
.a-select:focus-within, .a-select.is-focus { border-color: var(--a-sage); /* on: --a-white --a-cream */ }

.a-input:disabled,
.a-textarea:disabled,
.a-select:disabled { background-color: var(--a-cream); opacity: 0.6; cursor: not-allowed; }

.a-field--error .a-input,
.a-field--error .a-textarea { border-color: var(--a-clay-deep); /* on: --a-white --a-cream */ }

.a-error {
  margin: 0;
  font-size: var(--a-size-body);
  font-weight: 600;
  color: var(--a-clay-deep); /* on: --a-white --a-cream */
}

/* A file picker that looks like a secondary button: the input stays in the
   page, so the keyboard reaches it. Markup: label.a-file > span + input. */
.a-file {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--a-space-2);
  min-height: var(--a-tap);
  padding: var(--a-space-2) var(--a-space-4);
  border: 1.5px solid var(--a-line-strong);
  border-radius: var(--a-radius-m);
  background-color: var(--a-white);
  font-weight: 600;
  color: var(--a-ink); /* on: --a-white --a-cream */
  cursor: pointer;
}

.a-file:hover, .a-file.is-hover { background-color: var(--a-cream); /* text: --a-ink */ }

.a-file__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* An attached photo, shown small with its own remove action below. */
.a-photo {
  display: block;
  max-width: 100%;
  max-height: 10rem;
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-m);
  background-color: var(--a-cream); /* text: none */
  object-fit: contain;
}

/* ---- Inline confirm: asks in place before anything is erased ---- */

.a-confirm {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-3);
  padding: var(--a-space-4);
  border: 1px solid var(--a-blush-line);
  border-radius: var(--a-radius-m);
  background-color: var(--a-blush); /* text: --a-ink --a-ink-soft */
}

.a-confirm__ask { margin: 0; font-weight: 700; color: var(--a-ink); /* on: --a-blush */ }
.a-confirm__note { margin: 0; color: var(--a-ink-soft); /* on: --a-blush */ }

/* ---- Dialog: scrolls when it is taller than the screen ---- */

.a-dialog-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: var(--a-space-4);
  background-color: var(--a-scrim);
}

.a-dialog {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-4);
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: var(--a-space-5);
  border-radius: var(--a-radius-xl);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  box-shadow: var(--a-shadow-dialog);
}

/* The in-session display: the shared card, full size. */
.a-dialog--wide { max-width: 640px; background-color: var(--a-cream); /* text: --a-ink --a-ink-soft */ }

/* Show it big: a dialog that fills the screen on the page's own ground, its
   content laid out by the shell and the split inside it. */
.a-dialog-scrim--full { padding: 0; background-color: var(--a-cream); /* text: --a-ink --a-ink-soft */ }

.a-dialog--full {
  justify-content: center;
  max-width: none;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background-color: var(--a-cream); /* text: --a-ink --a-ink-soft */
  box-shadow: none;
}

/* ---- Tabs ---- */

.a-tabs {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--a-space-1);
  padding: var(--a-space-1);
  border-radius: var(--a-radius-m);
  background-color: var(--a-line); /* text: --a-ink --a-ink-soft */
}

.a-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--a-space-1);
  min-height: var(--a-tap);
  margin: 0;
  padding: var(--a-space-2) var(--a-space-1);
  border: 0;
  border-radius: var(--a-radius-s);
  background: transparent;
  font-family: var(--a-font-sans);
  font-size: var(--a-size-label);
  font-weight: 600;
  line-height: 1.2;
  color: var(--a-ink-soft); /* on: --a-line */
  overflow-wrap: normal; /* a tab's words break between words, never inside one */
  cursor: pointer;
}

.a-tab:hover, .a-tab.is-hover { color: var(--a-ink); /* on: --a-line */ }
.a-tab[aria-selected="true"],
.a-tab[aria-current="page"] { background-color: var(--a-white); color: var(--a-sage); box-shadow: var(--a-shadow-raised); }
.a-tab:disabled { opacity: 0.5; cursor: not-allowed; }

@media (min-width: 640px) {
  .a-tab { font-size: var(--a-size-body); }
}

/* ---- Empty state ---- */

.a-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--a-space-3);
  padding: var(--a-space-6) var(--a-space-5);
  border: 1.5px dashed var(--a-line);
  border-radius: var(--a-radius-xl);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  text-align: center;
}

.a-empty__picture {
  display: block;
  width: 140px;
  height: auto;
}

.a-empty__text {
  max-width: 34ch;
  margin: 0;
  color: var(--a-ink-soft); /* on: --a-white */
}

/* ---- The practice window strip, with its date editor below ---- */

.a-strip {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-3);
  padding: var(--a-space-4);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-l);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
}

.a-strip__editor {
  padding-block-start: var(--a-space-4);
  border-block-start: 1px solid var(--a-line);
}

/* ---- Lists: rows with a title, a meta line and trailing actions ---- */

.a-list {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-2) var(--a-space-3);
  padding: var(--a-space-3) var(--a-space-4);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-m);
  background-color: var(--a-cream); /* text: --a-ink --a-ink-soft */
}

.a-item__main {
  display: flex;
  flex: 1 1 12rem;
  flex-direction: column;
  gap: var(--a-space-1);
  min-width: 0;
}

.a-item__title { margin: 0; font-weight: 600; color: var(--a-ink); /* on: --a-cream --a-sage-tint --a-white */ }
.a-item__actions { display: flex; flex-wrap: wrap; gap: var(--a-space-2); }

/* A row that is itself one choice, such as an entry for the takeaway. */
.a-item--choice {
  width: 100%;
  margin: 0;
  font: inherit;
  color: var(--a-ink); /* on: --a-cream */
  text-align: start;
  cursor: pointer;
  transition: background-color var(--a-fade) var(--a-ease);
}

.a-item--choice:hover, .a-item--choice.is-hover { background-color: var(--a-white); /* text: --a-ink --a-ink-soft */ }
.a-item--choice[aria-pressed="true"] { border-color: var(--a-sage); background-color: var(--a-sage-tint); /* text: --a-ink --a-ink-soft on: --a-white */ }

/* The word at the end of a choice row: Select, then Selected. */
.a-item__state {
  flex-shrink: 0;
  padding: var(--a-space-1) var(--a-space-3);
  border: 1.5px solid var(--a-line-strong);
  border-radius: var(--a-radius-s);
  background-color: var(--a-white);
  font-size: var(--a-size-label);
  font-weight: 600;
  color: var(--a-ink); /* on: --a-cream */
}

.a-item--choice[aria-pressed="true"] .a-item__state { border-color: var(--a-sage); background-color: var(--a-sage); color: var(--a-white); /* on: --a-sage-tint */ }

/* ---- Details: a short list of labelled values ---- */

.a-details {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-3);
  margin: 0;
}

.a-details__label { margin: 0; font-weight: 600; color: var(--a-ink); /* on: --a-white --a-cream */ }
.a-details__value { margin: 0; color: var(--a-ink); /* on: --a-white --a-cream */ }

/* The link contents: each value exactly as the link carries it. */
.a-details--mono {
  gap: var(--a-space-2);
  padding: var(--a-space-3) var(--a-space-4);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-m);
  background-color: var(--a-cream); /* text: --a-ink --a-ink-soft */
}

.a-details--mono .a-details__value { font-family: var(--a-font-mono); font-size: var(--a-size-label); }

/* ---- Disclosure: one quiet row that opens a part of the page ----
   Markup: div.a-disclosure > button.a-disclosure__toggle (aria-expanded,
   aria-controls) + div.a-disclosure__body. */

.a-disclosure {
  border-block: 1px solid var(--a-line);
}

.a-disclosure__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-3);
  width: 100%;
  min-height: var(--a-tap);
  margin: 0;
  padding: var(--a-space-2) 0;
  border: 0;
  border-radius: var(--a-radius-xs);
  background: transparent;
  font-family: var(--a-font-sans);
  font-size: var(--a-size-body);
  font-weight: 600;
  color: var(--a-ink); /* on: --a-white --a-cream */
  text-align: start;
  cursor: pointer;
}

.a-disclosure__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--a-sage); /* on: --a-white --a-cream */
  transition: transform var(--a-fade) var(--a-ease);
}

.a-disclosure__toggle[aria-expanded="true"] .a-disclosure__chevron { transform: rotate(180deg); }

.a-disclosure__body {
  padding-block: var(--a-space-1) var(--a-space-4);
}

/* One line that stays in view under the row, open or closed, such as the
   sentence that says what a code holds. */
.a-disclosure__summary {
  margin: 0;
  padding-block-end: var(--a-space-3);
}

/* ---- Welcome screen ---- */

.a-welcome {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-5);
  max-width: 620px;
  margin-inline: auto;
}

.a-welcome__picture {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

/* ---- Therapist page: the client's phone and the code ---- */

.a-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--a-space-4);
}

.a-preview > * { min-width: 0; max-width: 100%; }

/* The code comes first in the markup, so on a narrow screen it sits above
   the phone. Where the two fit side by side (the working screen from
   1168px), the phone moves to the start. */
@media (min-width: 1168px) {
  .a-preview > :not(.a-code) { order: -1; }
}

/* A phone outline that shows what the client sees, drawn a little smaller
   with the client home card's own markup. It is a picture: nothing inside
   takes a tap. Its smallest words stay at 13px. */
.a-phone {
  width: 280px;
  max-width: 100%;
  flex-shrink: 0;
  padding: var(--a-space-2);
  border-radius: var(--a-radius-phone);
  background-color: var(--a-ink); /* text: none */
}

.a-phone__screen {
  min-height: 560px;
  padding: var(--a-space-5) var(--a-space-3);
  border-radius: calc(var(--a-radius-phone) - var(--a-space-2));
  background-color: var(--a-cream); /* text: --a-ink --a-ink-soft */
  overflow: hidden;
  zoom: 0.93;
}

.a-phone__screen .a-onething { padding: var(--a-space-4); }
.a-phone__screen .a-tile { min-height: var(--a-control); font-size: var(--a-size-body); }

/* The code in a white frame: at least 320px beside the phone, and filling
   the calm screen that Show it big opens. */
.a-code {
  display: flex;
  flex: 1 1 320px;
  flex-direction: column;
  align-items: center;
  gap: var(--a-space-3);
  min-width: 0;
  margin: 0;
}

.a-code__frame {
  width: min(100%, 320px);
  padding: var(--a-space-3);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-l);
  background-color: var(--a-white); /* text: none */
}

.a-code__frame img,
.a-code__frame svg {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
  image-rendering: pixelated;
}

/* The link field under the code's buttons, the full width of the column. */
.a-code__link {
  align-self: stretch;
}

.a-code__caption {
  margin: 0;
  max-width: 40ch;
  font-size: var(--a-size-body);
  color: var(--a-ink-soft); /* on: --a-sage-tint --a-white --a-cream */
  text-align: center;
}

.a-code--big .a-code__frame {
  width: min(100%, 560px, 70vh);
  padding: var(--a-space-6);
  border-radius: var(--a-radius-xl);
  box-shadow: var(--a-shadow-card);
}

/* On a phone the code is as wide as it can be, with no padding inside the
   frame: the code carries its own quiet zone, four modules of white on
   every side. On the working screen the frame runs to the edges of the
   panel it sits in (the panel's padding is --a-space-5); in Show it big it
   runs the full width of the screen, under the words. */
@media (max-width: 639px) {
  .a-code__frame {
    align-self: stretch;
    width: auto;
    margin-inline: calc(-1 * var(--a-space-5));
    padding: 0;
    border-inline-width: 0;
    border-radius: 0;
  }

  .a-code--big .a-code__frame {
    width: auto;
    margin-inline: calc(-1 * var(--a-space-4));
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

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

.a-hero {
  display: grid;
  gap: var(--a-space-6);
  align-items: center;
  padding-block: var(--a-space-7) var(--a-space-8);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
}

.a-hero__picture {
  display: block;
  width: min(100%, 360px);
  height: auto;
}

@media (min-width: 880px) {
  .a-hero__inner { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--a-space-6); align-items: center; }
}

.a-band {
  padding-block: var(--a-space-7);
  border-block-start: 1px solid var(--a-line);
}

@media (min-width: 640px) {
  .a-band { padding-block: var(--a-space-8); }
}

.a-band--white { background-color: var(--a-white); /* text: --a-ink --a-ink-soft --a-sage */ }
.a-band--tint { background-color: var(--a-sage-tint); /* text: --a-ink --a-ink-soft --a-sage */ }

/* A real sequence, so the steps are numbered. */
.a-steps {
  display: grid;
  gap: var(--a-space-6);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: a-step;
}

@media (min-width: 880px) {
  .a-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.a-step {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-2);
  counter-increment: a-step;
}

.a-step__picture {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin-block-end: var(--a-space-3);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-l);
  background-color: var(--a-white); /* text: none */
}

.a-step__title::before {
  content: counter(a-step) ". ";
  color: var(--a-sage); /* on: --a-cream --a-white */
}

/* A walk through real screens, one step under the other: each picture is
   one whole part of the running pages at its own size, with the words right
   beside it from 880px, so a narrow picture leaves no gap. */
.a-steps--walk .a-step__picture {
  width: auto;
  max-width: 100%;
}

@media (min-width: 880px) {
  .a-steps--walk { grid-template-columns: minmax(0, 1fr); }
  .a-steps--walk .a-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--a-space-6);
    align-items: center;
  }
}

/* A plain list of facts, divided by hairlines. */
.a-facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-facts > li {
  padding-block: var(--a-space-3);
  border-block-start: 1px solid var(--a-line);
}

.a-facts > li:last-child { border-block-end: 1px solid var(--a-line); }

/* The same list as a real sequence, such as the steps to add a licence key. */
.a-facts--numbered { counter-reset: a-fact; }
.a-facts--numbered > li { counter-increment: a-fact; }
.a-facts--numbered > li::before { content: counter(a-fact) ". "; font-weight: 600; color: var(--a-sage); /* on: --a-cream --a-white */ }

/* The link picture: the part the host receives and the part it never does. */
.a-linkpic {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  margin: 0;
}

.a-linkpic__code {
  display: block;
  padding: var(--a-space-3);
  overflow: hidden;
  border: 1px solid var(--a-line);
  border-start-start-radius: var(--a-radius-m);
  border-end-start-radius: var(--a-radius-m);
  background-color: var(--a-cream);
  font-family: var(--a-font-mono);
  color: var(--a-ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.a-linkpic__label {
  margin: 0;
  margin-block-start: var(--a-space-2);
  padding-block-start: var(--a-space-2);
  padding-inline-end: var(--a-space-3);
  border-block-start: 2px solid var(--a-line);
  color: var(--a-ink-soft); /* on: --a-white */
}

.a-linkpic__part--private .a-linkpic__code {
  border-inline-start-width: 0;
  border-color: var(--a-sage-line);
  border-radius: 0;
  border-start-end-radius: var(--a-radius-m);
  border-end-end-radius: var(--a-radius-m);
  background-color: var(--a-sage-tint);
  color: var(--a-sage);
}

.a-linkpic__part--private .a-linkpic__label {
  margin-inline-start: var(--a-space-2);
  border-block-start-color: var(--a-sage);
  font-weight: 600;
  color: var(--a-sage); /* on: --a-white */
}

.a-plans {
  display: grid;
  gap: var(--a-space-4);
}

@media (min-width: 640px) {
  .a-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.a-plan {
  display: flex;
  flex-direction: column;
  gap: var(--a-space-2);
  padding: var(--a-space-5);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-l);
  background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
}

.a-plan--founding { border-color: var(--a-sage-line); background-color: var(--a-sage-tint); /* text: --a-ink --a-ink-soft */ }

.a-plan__name { margin: 0; font-size: var(--a-size-reading); font-weight: 600; color: var(--a-ink); /* on: --a-white --a-sage-tint --a-cream */ }
.a-plan__price { margin: 0; font-family: var(--a-font-serif); font-size: var(--a-size-title-1); line-height: var(--a-leading-tight); color: var(--a-ink); /* on: --a-white --a-sage-tint */ }

/* Further plans as rows: the name, then what it costs. */
.a-plan-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-plan-list > li {
  display: grid;
  gap: var(--a-space-1);
  padding-block: var(--a-space-3);
  border-block-start: 1px solid var(--a-line);
}

.a-plan-list > li:last-child { border-block-end: 1px solid var(--a-line); }

@media (min-width: 640px) {
  .a-plan-list > li { grid-template-columns: 220px minmax(0, 1fr); gap: var(--a-space-5); align-items: baseline; }
}

/* A plan's "Buy a licence" link sits under what the plan costs, at its own
   width; in the two cards it sits at the foot, so the two links line up. */
.a-plan > .a-btn { align-self: flex-start; margin-block-start: auto; }
.a-plan-list > li > .a-btn { justify-self: start; }

@media (min-width: 640px) {
  .a-plan-list > li > .a-btn { grid-column: 2; }
}

/* An action that is not open yet, such as a checkout before licences are on sale. */
.a-shut {
  display: inline-flex;
  align-items: center;
  min-height: var(--a-control);
  padding: var(--a-space-3) var(--a-space-5);
  border: 1.5px dashed var(--a-ink-soft);
  border-radius: var(--a-radius-m);
  font-weight: 600;
  color: var(--a-ink-soft); /* on: --a-cream --a-white */
}

.a-questions {
  max-width: 720px;
  margin: 0;
}

.a-questions__ask { margin-block-start: var(--a-space-5); font-weight: 600; color: var(--a-ink); /* on: --a-white --a-cream */ }
.a-questions__answer { margin: 0; margin-block-start: var(--a-space-1); color: var(--a-ink-soft); /* on: --a-white --a-cream */ }

.a-footer {
  padding-block: var(--a-space-6) var(--a-space-7);
  border-block-start: 1px solid var(--a-line);
  color: var(--a-ink-soft); /* on: --a-cream */
}

/* ---- Print: only the shared card, on one page ----
   The client app prints the copy of the shared card in its a-print-mount.
   The therapist page prints what Show it big shows: its full dialog carries
   a-print-keep, which print shows in place of the rest of the page even
   while it is closed on screen. */

.a-print-mount { display: none; }

@media print {
  @page {
    margin: 14mm;
  }

  html:has(.a-page),
  .a-page {
    background-color: var(--a-white);
  }

  .a-page > :not(.a-print-mount),
  .a-no-print,
  .a-btn,
  .a-toasts {
    display: none !important;
  }

  .a-print-mount { display: block; }

  .a-page > .a-print-keep {
    display: block !important;
    position: static;
    overflow: visible;
    background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  }

  .a-print-keep .a-dialog--full {
    min-height: 0;
    background-color: var(--a-white); /* text: --a-ink --a-ink-soft */
  }

  .a-print-keep .a-main { padding: 0; }

  .a-print-keep .a-code--big .a-code__frame {
    width: 80mm;
    padding: 4mm;
    box-shadow: none;
  }

  /* The code fills its frame on paper, whatever size it was fitted to on screen. */
  .a-print-keep .a-code__frame svg {
    width: 100% !important;
    transform: none !important;
  }

  .a-print-keep .a-split { grid-template-columns: minmax(0, 1fr); }

  .a-print-keep,
  .a-shared {
    box-shadow: none;
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ---- Forced colours: chosen and on states keep a visible mark ---- */

@media (forced-colors: active) {
  .a-switch__track::after { forced-color-adjust: none; background-color: ButtonText; }
  .a-switch__input:checked ~ .a-switch__track { forced-color-adjust: none; border-color: Highlight; background-color: Highlight; }
  .a-switch__input:checked ~ .a-switch__track::after { background-color: HighlightText; }

  .a-tile[aria-pressed="true"],
  .a-chip[aria-pressed="true"],
  .a-tag--choice[aria-pressed="true"],
  .a-scale__cell[aria-pressed="true"],
  .a-item--choice[aria-pressed="true"],
  .a-tab[aria-selected="true"],
  .a-tab[aria-current="page"] {
    outline: 3px solid Highlight;
    outline-offset: -3px;
  }
}
