/*
 * Styles shared by every page. Rules used by one page only live in pages/<page>.css, scoped to
 * main[data-page='<page id>'].
 *
 * The look, as the parent and his child settled it on 2026-11-14: Zeo's world of simple shapes in
 * soft colours on cream paper, drawn with one ink line. These pages are read by an adult who wants
 * to know how the child is doing, so they stay calm: white cards on paper, ink text, and soft
 * colour only for fields and marks, never for text. Cards, buttons, fields, tags, switches, and
 * tabs carry the ink line; dividers inside a card are quiet. The hard ink shadow straight down
 * (the sticker) is kept for what can be pressed and matters: the main button and the tab or page
 * that is on. Zeo's yellow is the one colour of the main action.
 *
 * Breakpoints: 1150px (narrow desktop: slimmer sidebar), 850px (phone layout: the sidebar becomes
 * a top bar and a tab bar along the bottom), 620px (small phone).
 */

/* ==== Fonts ==== */

@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-latin-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

/* ==== Tokens ==== */

:root {
  /* The ground, the cards, and the ink */
  --paper: #fff6e3;
  --white: #ffffff;
  --ink: #1f1a2e;
  /* Greyed ink, for what is read second: 7.6:1 on white, 7.1:1 on paper, 6.4:1 on sunk. */
  --muted: #575166;
  /* Paper a shade darker: a quiet control, a switch that is off, the tabs' track. */
  --sunk: #faeacb;
  /* Darker paper: the one quiet divider inside a card. */
  --hairline: #eedcb6;

  /* Zeo's yellow: the one colour of the main action */
  --action: #ffe07a;

  /* Soft colours, for fields and marks only. Green is shown and on, sky is practicing and the
     child's voice, coral is what needs a look. The pale ones fill a line while it plays. */
  --green: #8be0ac;
  --green-pale: #dff7e8;
  --sky: #a6e2fa;
  --sky-pale: #e2f5fd;
  --butter-pale: #fff0c0;
  --coral: #ff8c82;
  --coral-pale: #ffe4de;
  --lavender: #d6c4ff;
  --lavender-pale: #f0e9ff;
  --peach: #ffc9a9;
  --peach-pale: #ffece0;

  /* The line and the sticker */
  --line-ink: 2px solid var(--ink);
  --divider: 2px solid var(--hairline);
  --rule: 1px solid var(--hairline);
  --sticker: 0 3px 0 var(--ink);
  --focus: var(--ink);
  --focus-ring: 3px solid var(--focus);

  /* Type. Titles and buttons are set in the display face at its heaviest weight; another face
     can be put in its place here, in one line. */
  --font-text: Manrope, ui-rounded, system-ui, sans-serif;
  --font-display: Manrope, ui-rounded, system-ui, sans-serif;
  --weight-display: 800;

  /* Spacing and sizes */
  --s2: 2px;
  --s4: 4px;
  --s8: 8px;
  --s12: 12px;
  --s16: 16px;
  --s24: 24px;
  --s32: 32px;
  --s40: 40px;
  --s48: 48px;
  --s64: 64px;

  /* Type: font sizes, line heights, and letter spacing for each heading size */
  --text-12: 12px;
  --text-14: 14px;
  --text-16: 16px;
  --text-18: 18px;
  --text-20: 20px;
  --text-24: 24px;
  --text-30: 30px;
  --text-36: 36px;
  --leading-16: 16px;
  --leading-20: 20px;
  --leading-24: 24px;
  --leading-28: 28px;
  --leading-32: 32px;
  --leading-36: 36px;
  --leading-40: 40px;
  --tracking-16: -0.1px;
  --tracking-18: -0.2px;
  --tracking-24: -0.4px;
  --tracking-30: -0.6px;
  --tracking-36: -0.8px;

  /* Shapes: a card's corners, a control's, and a pill */
  --radius-8: 8px;
  --radius-12: 12px;
  --radius-card: 18px;
  --radius-pill: 999px;

  /* Motion */
  --curve: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 300ms;

  /* Sizes */
  --icon-size: 22px;
  --icon-size-small: 18px;
  --tap-target: 44px;

  /* Layout. The tab bar along the bottom of a phone's screen; none on wider screens. */
  --sidebar-width: 248px;
  --tab-bar-height: 0px;
}

/* ==== Base elements ==== */

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--text-14) / var(--leading-20) var(--font-text);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
  text-wrap: pretty;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  text-wrap: balance;
}
h1 {
  font-size: var(--text-36);
  line-height: var(--leading-40);
  letter-spacing: var(--tracking-36);
}
h2 {
  font-size: var(--text-24);
  line-height: var(--leading-32);
  letter-spacing: var(--tracking-24);
}
h3 {
  font-size: var(--text-18);
  line-height: var(--leading-28);
  letter-spacing: var(--tracking-18);
}
p {
  line-height: var(--leading-24);
}
strong {
  font-weight: 700;
}
small {
  display: block;
  font-size: var(--text-12);
  line-height: var(--leading-16);
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
}
::selection {
  background: var(--action);
}
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}
/* A field that takes typing shows only its caret, never a ring, as the parent asked. */
:is(textarea, input:not([type='checkbox'], [type='radio'], [type='range'])):focus-visible {
  outline: none;
}
[hidden] {
  display: none !important;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
  transition:
    background-color var(--speed) var(--curve),
    opacity var(--speed) var(--curve);
}
button {
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}

label {
  display: block;
  font-size: var(--text-14);
  line-height: var(--leading-20);
  font-weight: 700;
}
input:not([type='checkbox'], [type='radio'], [type='range']),
select,
textarea {
  width: 100%;
  margin-top: var(--s8);
  padding: var(--s12) var(--s16);
  border: var(--line-ink);
  border-radius: var(--radius-12);
  background: var(--white);
  line-height: var(--leading-24);
  font-weight: 400;
}
textarea {
  min-height: 80px;
  resize: vertical;
  field-sizing: content;
}
::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type='checkbox'],
input[type='radio'] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}
input[type='range'] {
  width: 100%;
  margin: var(--s16) 0 0;
  accent-color: var(--ink);
}
fieldset {
  margin: var(--s24) 0;
  padding: 0;
  border: 0;
}
legend {
  margin-bottom: var(--s12);
  padding: 0;
  font-weight: 700;
}
details summary {
  display: flex;
  justify-content: space-between;
  gap: var(--s16);
  font-weight: 700;
  cursor: pointer;
}

/* ==== Utilities ==== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: -80px;
  left: var(--s16);
  z-index: 100;
  padding: var(--s8) var(--s16);
  border: var(--line-ink);
  border-radius: var(--radius-pill);
  background: var(--action);
  font-weight: 700;
}
.skip:focus {
  top: var(--s16);
}
.muted {
  color: var(--muted);
}

/* ==== App layout: sidebar, workspace, and page areas ==== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: var(--s32) var(--s24) var(--s24);
  background: var(--paper);
}
/* Zeo sitting beside its name: the drawing (zeo.svg) and the sticker wordmark (wordmark.png),
   both written by docs/brand/icon/draw.mjs. */
.brand {
  display: flex;
  align-items: flex-end;
  gap: var(--s8);
  padding-left: var(--s8);
}
.brand-mark {
  display: block;
  width: 48px;
  height: 36px;
}
.brand-word {
  display: block;
  width: auto;
  height: 28px;
  margin-bottom: 4px;
}
/* The logo and the button that folds the sidebar (core/router.js). The logo gives way while the
   sidebar unfolds, so the button keeps to the sidebar's right edge. */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
}
.sidebar-top .brand {
  min-width: 0;
  overflow: hidden;
}
.sidebar-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-12);
  color: var(--muted);
}
.sidebar-toggle:hover {
  background: var(--sunk);
  color: var(--ink);
}
.sidebar :is(nav, .sidebar-toggle) svg {
  width: var(--s24);
  height: var(--s24);
  stroke-width: 2;
}
/* The links: the open one stands on its sticker, white with the ink line round it, its icon
   filled in (core/router.js); the others are ink on the paper, with a shade under the pointer. */
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
  margin-top: var(--s40);
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: var(--s12);
  min-height: 48px;
  padding: 0 var(--s16);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-16);
  line-height: var(--leading-24);
  font-weight: 700;
}
.sidebar nav a[aria-current] {
  border: var(--line-ink);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  box-shadow: var(--sticker);
}
.sidebar nav a:not([aria-current]):hover {
  background: var(--sunk);
}
.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
}
/* Unseen recommendations signal: 8px coral dot with ink line, no number. */
.nav-dot {
  position: absolute;
  top: -2px;
  right: -3px;
  box-sizing: content-box;
  width: 8px;
  height: 8px;
  border: var(--line-ink);
  border-radius: 50%;
  background: var(--coral);
}
.sidebar-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
  margin-top: auto;
  padding-top: var(--s24);
}
.connection {
  display: flex;
  align-items: center;
  gap: var(--s8);
  font-size: var(--text-12);
  line-height: var(--leading-16);
  font-weight: 700;
}
.connection[hidden] {
  display: none;
}
.connection:before {
  content: '';
  width: 10px;
  height: 10px;
  border: var(--line-ink);
  border-radius: 50%;
  background: var(--coral);
}

.workspace {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  margin-left: var(--sidebar-width);
}
/* Each page has a pinned top area and one scrolling area; the window itself never scrolls. */
main {
  --page-padding-x: var(--s48);
  --page-padding-top: var(--s40);
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  outline: none;
}
.page-top {
  flex: none;
  padding: var(--page-padding-top) var(--page-padding-x) var(--s16);
  transition: box-shadow var(--speed) var(--curve);
}
main.scrolled .page-top {
  box-shadow: 0 2px 0 var(--hairline);
}
.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--page-padding-top) var(--page-padding-x) var(--s48);
}
.page-top + .page-scroll {
  padding-top: var(--s16);
}
.page-inner {
  max-width: 1304px;
  margin: 0 auto;
}
/* Parent settings pages use a narrower, left-aligned column, so the box and the tabs above every
   settings page keep their place from tab to tab. */
main[data-page='goals'] .page-inner,
main[data-page='protections'] .page-inner,
main[data-page='progress'] .page-inner,
main[data-page='how'] .page-inner,
main[data-page='child'] .page-inner,
main[data-page='assistant'] .page-inner,
main[data-page='home'] .page-inner,
main[data-page='budget'] .page-inner {
  max-width: 944px;
  margin: 0;
}
.page-inner > .paper-card + .paper-card {
  margin-top: var(--s16);
}

@media (max-width: 1150px) {
  :root {
    --sidebar-width: 216px;
  }
  .sidebar {
    padding: var(--s32) var(--s16) var(--s24);
  }
  .brand {
    gap: 6px;
  }
  .brand-mark {
    width: 40px;
    height: 30px;
  }
  .brand-word {
    height: 24px;
    margin-bottom: 3px;
  }
  main {
    --page-padding-x: var(--s32);
    --page-padding-top: var(--s32);
  }
}
/* The folded sidebar (core/router.js): a rail of icons, each link's name showing beside it on hover
   or keyboard focus, as does the button's. The connection's warning is its dot, with its words on
   hover. Phones have no folded sidebar; their links are the tab bar below. */
@media (min-width: 851px) {
  html.sidebar-collapsed {
    --sidebar-width: 84px;
  }
  html.sidebar-collapsed .sidebar {
    padding-inline: var(--s12);
  }
  html.sidebar-collapsed .sidebar-top {
    justify-content: center;
  }
  html.sidebar-collapsed .brand {
    display: none;
  }
  .sidebar nav a {
    overflow: hidden;
    white-space: nowrap;
  }
  html.sidebar-collapsed .sidebar nav a {
    position: relative;
    justify-content: center;
    padding: 0;
    overflow: visible;
  }
  .sidebar-toggle .nav-label,
  html.sidebar-collapsed .sidebar nav .nav-label {
    position: absolute;
    top: 50%;
    left: calc(100% + var(--s12));
    padding: var(--s4) var(--s8);
    border-radius: var(--radius-8);
    background: var(--ink);
    color: var(--white);
    font-family: var(--font-text);
    font-size: var(--text-12);
    line-height: var(--leading-16);
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    translate: 0 -50%;
    transition: opacity 150ms var(--curve);
  }
  .sidebar-toggle:is(:hover, :focus-visible) .nav-label,
  html.sidebar-collapsed .sidebar nav a:is(:hover, :focus-visible) .nav-label {
    opacity: 1;
  }
  html.sidebar-collapsed .sidebar-status {
    justify-content: center;
  }
  html.sidebar-collapsed .connection {
    gap: 0;
    font-size: 0;
  }
  html.sidebar-animated .sidebar {
    transition:
      width var(--speed) var(--curve),
      padding var(--speed) var(--curve);
  }
  html.sidebar-animated .workspace {
    transition: margin-left var(--speed) var(--curve);
  }
}
/* The sidebar's links become a tab bar along the bottom of the screen, as in a phone's own apps
   (Apple's tab bar, Material's navigation bar): always in reach of the thumb, and never scrolled
   away. Wider than a phone, each icon sits beside its name, as both do in landscape. The logo is
   not shown, since the tab bar says where the parent is; the parent found it "just taking space"
   on 2026-11-11. Only the connection's warning is left at the top, when there is one. */
@media (max-width: 850px) {
  :root {
    --tab-bar-height: calc(68px + env(safe-area-inset-bottom));
  }
  body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }
  .sidebar {
    position: static;
    display: block;
    flex: none;
    width: auto;
    padding: 0;
    border: 0;
    background: var(--paper);
  }
  .sidebar-top {
    display: none;
  }
  .connection {
    padding: var(--s12) var(--s24) 0;
  }
  .sidebar nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9;
    flex-direction: row;
    justify-content: center;
    gap: var(--s8);
    height: var(--tab-bar-height);
    margin: 0;
    padding: var(--s8) var(--s16) env(safe-area-inset-bottom);
    border-top: var(--line-ink);
    background: var(--paper);
  }
  .sidebar nav a {
    gap: var(--s8);
    min-height: 0;
    height: 46px;
    padding: 0 var(--s16) 0 var(--s12);
    white-space: nowrap;
  }
  .sidebar-status {
    margin: 0;
    padding: 0;
  }
  .workspace {
    flex: 1;
    min-height: 0;
    height: auto;
    margin: 0;
    padding-bottom: var(--tab-bar-height);
  }
  main {
    --page-padding-x: var(--s24);
    --page-padding-top: var(--s24);
  }
  /* The connection's warning scrolls away, and the settings tabs stay in reach. The first pixels
     a page scrolls (--scrolled-away, set in core/router.js, at most the height of the top bar)
     pull the top bar up past the top edge. The scroll area grows by as much and gets the pixels
     back as padding, so its content moves with the finger and its scroll length stays the same. */
  .sidebar {
    margin-top: calc(-1 * var(--scrolled-away, 0px));
  }
  .page-scroll {
    padding-top: calc(var(--page-padding-top) + var(--scrolled-away, 0px));
  }
  .page-top + .page-scroll {
    padding-top: calc(var(--s16) + var(--scrolled-away, 0px));
  }
}
@media (max-width: 620px) {
  h1 {
    font-size: var(--text-30);
    line-height: var(--leading-36);
    letter-spacing: var(--tracking-30);
  }
  .connection {
    padding: var(--s12) var(--s16) 0;
  }
  /* On a phone the tabs are icons alone, as the parent asked on 2026-11-11, sharing the bar's
     width; each whole quarter of the bar opens its tab, and the open one stands on its sticker as
     everywhere else. The names stay for screen readers. */
  .sidebar nav {
    gap: var(--s8);
    padding: var(--s8) var(--s12) env(safe-area-inset-bottom);
  }
  .sidebar nav a {
    flex: 1;
    justify-content: center;
    min-width: 0;
    padding: 0;
  }
  .sidebar nav a:not([aria-current]):hover {
    background: none;
  }
  .sidebar nav a > span:not(.nav-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  main {
    --page-padding-x: var(--s16);
    --page-padding-top: var(--s16);
  }
}

/* ==== Buttons ==== */

/* Every button is a pill with the ink line. The main one is Zeo's yellow and stands on its
   sticker, which it is pressed down onto; the others are white and flat. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s8);
  min-height: var(--tap-target);
  padding: var(--s8) var(--s16);
  border: var(--line-ink);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-family: var(--font-display);
  font-size: var(--text-16);
  line-height: var(--leading-24);
  font-weight: var(--weight-display);
  white-space: nowrap;
  transition:
    background-color var(--speed) var(--curve),
    transform 80ms ease-out,
    box-shadow 80ms ease-out;
}
.button:hover:not(:disabled) {
  background: var(--sunk);
}
.button.primary {
  background: var(--action);
  box-shadow: var(--sticker);
}
.button.primary:hover:not(:disabled) {
  background: var(--action);
}
.button.primary:active:not(:disabled) {
  box-shadow: 0 0 0 var(--ink);
  transform: translateY(3px);
}
.button.primary:disabled {
  background: var(--sunk);
  box-shadow: none;
  color: var(--muted);
  opacity: 1;
}
.button.large {
  padding: var(--s8) var(--s24);
}
/* A quiet action that reads as a link: ink, underlined. */
.text-button {
  display: inline-flex;
  align-items: center;
  gap: var(--s8);
  width: fit-content;
  padding: 0;
  font-size: var(--text-14);
  line-height: var(--leading-20);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: var(--s4);
}
.text-button:hover {
  text-decoration-color: var(--muted);
}
/* A link to another tab, on Progress and How Zeo works. The arrow follows the last word, so a long
   link wraps as text. */
.step-link {
  font-size: var(--text-14);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: var(--s4);
}
/* The arrow is not underlined: as an inline block it takes no decoration from the link. */
.step-link span {
  display: inline-block;
  margin-left: var(--s4);
}
.step-link:hover {
  text-decoration-color: var(--muted);
}
/* A small round button with only an icon: quiet where it passes or forgets, with a shade under
   the pointer; the pencils and bins on cards take the ink line (pages/guide.css). */
.icon-button {
  display: inline-grid;
  place-items: center;
  width: var(--s32);
  height: var(--s32);
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
}
.icon-button:hover:not(:disabled) {
  background: var(--sunk);
}

@media (max-width: 620px) {
  .button.large {
    min-height: var(--s48);
  }
}

/* ==== Parent pages' header: the page's name or the settings tabs, and the shared Save and Discard ==== */

.page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s16);
  min-height: var(--s48);
}
/* On a settings page the tabs sit under the box (core/router.js) and stay at the top of the
   scroll area once it has scrolled away, edge to edge so nothing shows beside them. A sticky
   element stops inside its scroll area's padding, so `top` takes that padding back. */
.settings-bar {
  position: sticky;
  top: calc(-1 * var(--page-padding-top));
  z-index: 3;
  margin: var(--s16) calc(-1 * var(--page-padding-x)) 0;
  padding: var(--s16) var(--page-padding-x);
  background: var(--paper);
  transition: box-shadow var(--speed) var(--curve);
}
.settings-bar.stuck {
  box-shadow: 0 2px 0 var(--hairline);
}
/* There the scroll area's padding also holds the pixels the logo row has scrolled away. */
@media (max-width: 850px) {
  .settings-bar {
    top: calc(-1 * (var(--page-padding-top) + var(--scrolled-away, 0px)));
  }
}
.settings-bar + .page-inner {
  padding-top: var(--s8);
}
.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s12);
  min-width: 0;
}
.page-title {
  font-size: var(--text-30);
  line-height: var(--leading-36);
  letter-spacing: var(--tracking-30);
}
/* A page's short note beside its name, such as when Progress was last written. */
.page-note {
  color: var(--muted);
  font-size: var(--text-14);
  line-height: var(--leading-20);
}
/* The tabs between the settings pages: a borderless sunk track, in which only the open tab keeps
   the ink line and stands up on its sticker. The track's foot leaves room for the sticker. */
.parent-tabs {
  display: flex;
  gap: var(--s4);
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: var(--s4) var(--s4) calc(var(--s4) + 3px);
  border-radius: var(--radius-pill);
  background: var(--sunk);
  overflow-x: auto;
  scrollbar-width: none;
}
.parent-tabs::-webkit-scrollbar {
  display: none;
}
.parent-tabs a {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--s8);
  min-height: 40px;
  padding: 0 var(--s16) 0 var(--s12);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-14);
  line-height: var(--leading-20);
  font-weight: 700;
  white-space: nowrap;
}
.parent-tabs a:not([aria-current]):hover {
  color: var(--ink);
}
.parent-tabs svg {
  flex: none;
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.parent-tabs a[aria-current] {
  border: var(--line-ink);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  box-shadow: var(--sticker);
}
.settings-bar-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--s8);
}
/* Away-state pill in sticky .settings-bar on desktop: white with ink line, or butter-pale when
   an unapplied draft waits at the top. Hidden until scrolled past .ask, and not used on phones. */
.ask-return-pill {
  display: none;
  align-items: center;
  gap: var(--s8);
  min-height: 40px;
  padding: var(--s4) var(--s16);
  border: var(--line-ink);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-14);
  line-height: var(--leading-20);
  font-weight: var(--weight-display);
  white-space: nowrap;
}
.ask-return-pill:hover {
  background: var(--sunk);
}
.ask-return-pill[data-has-draft='true'] {
  background: var(--butter-pale);
}
.ask-return-pill[data-has-draft='true']:hover {
  background: var(--action);
}
.settings-bar.ask-away .ask-return-pill {
  display: inline-flex;
}
.save-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--s8);
}
/* Just after a save, Save reads as a quiet "Saved" label for `client.saved_ms`. It then fades
   away, keeping its place so the header does not shift. */
.button[data-save]:disabled {
  border-color: transparent;
  background: none;
  box-shadow: none;
  color: var(--muted);
  opacity: 1;
}
.save-actions[data-state='idle'] [data-save] {
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.4s ease,
    visibility 0s 0.4s;
}
@media (max-width: 850px) {
  .settings-bar.ask-away .ask-return-pill {
    display: none;
  }
  /* Below desktop width, Save and Discard move to a fixed bar above the bottom tab bar only while
     dirty so the hidden Save button never steals width from the Settings tabs. */
  .settings-bar-actions {
    display: contents;
  }
  .page-bar .save-actions {
    position: fixed;
    right: 0;
    bottom: var(--tab-bar-height);
    left: 0;
    z-index: 10;
    justify-content: flex-end;
    padding: var(--s12) var(--s16) calc(var(--s12) + 3px);
    border-top: var(--line-ink);
    background: var(--white);
  }
  .page-bar .save-actions:is([data-state='saved'], [data-state='idle']) {
    display: none;
  }
  main:has(.save-actions:is([data-state='unsaved'], [data-state='saving'])) {
    padding-bottom: 73px;
  }
  body:has(.save-actions:is([data-state='unsaved'], [data-state='saving'])) #notice {
    bottom: calc(73px + var(--s16) + var(--tab-bar-height));
  }
}
@media (max-width: 720px) {
  /* Hide tab icons on narrower tablets so all six tab names fit without clipping. */
  .parent-tabs svg {
    display: none;
  }
  .parent-tabs a {
    padding: 0 var(--s12);
  }
}

@media (max-width: 620px) {
  /* On phones drop the pill track: a calm text row with a 3px ink underline on the active tab,
     falling back to horizontal scroll with an edge fade only for unusually long child names. */
  .settings-bar {
    padding-top: var(--s8);
    padding-bottom: var(--s8);
  }
  .parent-tabs {
    justify-content: space-between;
    gap: var(--s8);
    width: 100%;
    padding: 0;
    border-radius: 0;
    border-bottom: var(--rule);
    background: none;
  }
  .parent-tabs a {
    flex: 0 0 auto;
    justify-content: center;
    min-height: 36px;
    padding: var(--s4) 2px var(--s8);
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-size: 13px;
  }
  .parent-tabs a[aria-current] {
    border: 0;
    border-bottom: 3px solid var(--ink);
    background: none;
    box-shadow: none;
  }
  .parent-tabs svg {
    display: none;
  }
}

/* ==== Tags and a goal's result ==== */

/* A goal's result in one chat, as a word in a tag of its colour (pages/conversation-detail.js),
   on the Progress tab and in Conversations: green when shown, sky while practicing, and no tag
   when it did not come up. The Progress tab's square per chat uses the same colours. */
.status-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  padding: 2px var(--s8);
  border-radius: var(--radius-pill);
  background: var(--sunk);
  font-size: var(--text-12);
  line-height: var(--leading-16);
  font-weight: 700;
  white-space: nowrap;
}
.status-label.not_observed {
  padding: 0;
  border-color: transparent;
  background: none;
  color: var(--muted);
}
.status-label.practicing {
  background: var(--sky);
}
.status-label.observed {
  background: var(--green);
}
.status-label .dot {
  display: none;
}

.paper-card {
  min-width: 0;
  padding: var(--s24);
  border: var(--line-ink);
  border-radius: var(--radius-card);
  background: var(--white);
}
/* Nothing here yet: a dashed edge, since nothing is set up. */
.empty-state {
  padding: var(--s48) var(--s24);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-card);
  text-align: center;
}
.empty-state p {
  max-width: 520px;
  margin: var(--s16) auto var(--s24);
  color: var(--muted);
}

@media (max-width: 620px) {
  .paper-card {
    padding: var(--s24) var(--s16);
  }
}

/* ==== Form rows ==== */

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: var(--s24);
  margin-bottom: var(--s24);
}
.paper-card .field-row:last-child {
  margin-bottom: 0;
}
.field-help {
  margin: var(--s12) 0 var(--s24);
  color: var(--muted);
  font-size: var(--text-12);
  line-height: var(--leading-20);
}
.field-row .field-help {
  margin: var(--s8) 0 0;
}

/* Sensitivity slider for a check on the Goals tab (core/components.js). */
.sensitivity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s16);
}
.sensitivity output {
  font-weight: 700;
}
.sensitivity-range {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'low slider high';
  align-items: center;
  gap: var(--s16);
  min-height: var(--tap-target);
  margin-top: var(--s8);
}
.sensitivity-range input {
  grid-area: slider;
  margin: 0;
}
.sensitivity-scale {
  display: contents;
  color: var(--muted);
  font-size: var(--text-12);
  line-height: var(--leading-20);
}
.sensitivity-scale span:first-child {
  grid-area: low;
}
.sensitivity-scale span:last-child {
  grid-area: high;
}

@media (max-width: 620px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ==== On/off switch ==== */

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  margin: 0;
  color: var(--muted);
  font-size: var(--text-12);
  line-height: var(--leading-20);
  font-weight: 700;
  cursor: pointer;
}
.switch-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: var(--s4);
  vertical-align: middle;
  cursor: pointer;
}
/* The real checkbox stays focusable but invisible; the track and knob draw the switch: a pill
   with the ink line, sunk when off and green when on, and a white knob with its own line. The
   checkbox lies above the track, so that a click aimed at the checkbox itself reaches it. */
.switch-toggle input {
  position: absolute;
  z-index: 1;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.switch-track {
  position: relative;
  display: block;
  width: 48px;
  height: 28px;
  border: var(--line-ink);
  border-radius: var(--radius-pill);
  background: var(--sunk);
  transition: background-color var(--speed) var(--curve);
}
.switch-track:after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border: var(--line-ink);
  border-radius: 50%;
  background: var(--white);
  box-sizing: border-box;
  transition: transform var(--speed) var(--curve);
}
.switch-toggle input:checked + .switch-track {
  background: var(--green);
}
.switch-toggle input:checked + .switch-track:after {
  transform: translateX(20px);
}
.switch-toggle input:focus-visible + .switch-track {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

/* ==== Notice toast ==== */

#notice {
  position: fixed;
  right: var(--s24);
  bottom: calc(var(--s24) + var(--tab-bar-height));
  z-index: 100;
  max-width: 480px;
  padding: var(--s12) var(--s16);
  border: var(--line-ink);
  border-radius: var(--radius-card);
  background: var(--ink);
  color: var(--white);
  font-size: var(--text-14);
  line-height: var(--leading-24);
  font-weight: 700;
}
#notice.error {
  background: var(--coral);
  color: var(--ink);
}

@media (max-width: 620px) {
  #notice {
    right: var(--s16);
    bottom: calc(var(--s16) + var(--tab-bar-height));
    left: var(--s16);
  }
}

/* ==== Loading placeholder and the 404 page ==== */

.loading-placeholder {
  height: 500px;
  border-radius: var(--radius-card);
  background: var(--sunk);
  opacity: 0.7;
}
.loading-placeholder:after {
  content: '';
  display: block;
  width: 60%;
  height: var(--s24);
  margin: var(--s48);
  border-radius: var(--radius-8);
  background: var(--hairline);
}
.not-found {
  max-width: 600px;
  margin: 80px auto;
  padding: 0 var(--s16);
  text-align: center;
}
.not-found h1 {
  margin-top: var(--s24);
}
.not-found p {
  margin: var(--s24) 0;
}

/* ==== Jumping to a control (core/router.js) ==== */

/* The part of a page a data-jump link lands on glows for a moment. */
.jumped-to {
  border-radius: var(--radius-8);
  animation: jumped-to 2s ease-out;
}
@keyframes jumped-to {
  from {
    background-color: var(--butter-pale);
    box-shadow: 0 0 0 var(--s8) var(--butter-pale);
  }
}

/* ==== Multi-child colors & shared parent switcher (core/children.js) ==== */

[data-child-color='butter'] {
  --child-fill: var(--action);
  --child-pale: var(--butter-pale);
}
[data-child-color='sky'] {
  --child-fill: var(--sky);
  --child-pale: var(--sky-pale);
}
[data-child-color='green'],
[data-child-color='mint'] {
  --child-fill: var(--green);
  --child-pale: var(--green-pale);
}
[data-child-color='coral'] {
  --child-fill: var(--coral);
  --child-pale: var(--coral-pale);
}
[data-child-color='lavender'],
[data-child-color='purple'] {
  --child-fill: var(--lavender);
  --child-pale: var(--lavender-pale);
}
[data-child-color='peach'],
[data-child-color='orange'] {
  --child-fill: var(--peach);
  --child-pale: var(--peach-pale);
}
[data-child-color='together'] {
  --child-fill: var(--white);
  --child-pale: var(--sunk);
}

/* Compact child-switcher pill row at the top of child-scoped parent views. */
.child-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s8);
  margin-bottom: var(--s16);
}
.child-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s8);
  min-height: 40px;
  padding: 4px var(--s16) 4px 6px;
  border: var(--line-ink);
  border-radius: var(--radius-pill);
  background: var(--sunk);
  color: var(--muted);
  font-size: var(--text-14);
  line-height: var(--leading-20);
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color var(--speed) var(--curve),
    transform 80ms ease-out,
    box-shadow 80ms ease-out;
}
.child-pill:hover:not([aria-pressed='true']) {
  background: var(--white);
  color: var(--ink);
}
.child-pill[aria-pressed='true'] {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  box-shadow: var(--sticker);
}
.child-pill-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: var(--line-ink);
  border-radius: 50%;
  background: var(--child-fill, var(--action));
  color: var(--ink);
}
.child-pill-badge svg {
  width: 16px;
  height: 16px;
}

/* ==== Reduced motion ==== */

@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
