/* Zen master
   Ink on paper. Greys are the same ink, diluted. One vermilion, kept for
   the seal: the mark on the day's teaching, the current page, what is new.
   The teacher speaks in a serif; everything else is small and quiet.
   Nothing on the page moves faster than a breath. */

:root {
  color-scheme: light;
  --ground: #f2efe8;
  --surface: #f8f6f1;
  --ink: #1b1a18;
  --ink-2: #5f5c55;
  --ink-3: #918d83;
  --line: #e2ded4;
  --line-2: #cbc6b9;
  --accent: #3a3832;
  --accent-soft: rgba(27, 26, 24, 0.07);
  --seal: #b23a26;
  --danger: #8f3a2a;
  --corner: 3px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --serif: "Charter", "Iowan Old Style", "Source Serif Pro", "Palatino", "Georgia", serif;
  --ease: cubic-bezier(.45, 0, .25, 1);
  --breath: 12s;
  /* sun: a warm disc and its glow */
  --sky-body: url("/images/sky-sun.webp") center / contain no-repeat;
  --sky-glow: radial-gradient(circle, rgba(246, 184, 82, .42), rgba(246, 184, 82, .16) 45%, rgba(246, 184, 82, 0) 70%);
  --sky-mask: none;
}
/* moon: the whole disc pictured, tonight's phase laid over it as a mask
   (sky.js, set by shell.js). Until the mask is set the moon stays hidden. */
:root[data-sky="night"] {
  --sky-body: url("/images/sky-moon.webp") center / contain no-repeat;
  --sky-glow: radial-gradient(circle, rgba(120, 138, 166, .3), rgba(120, 138, 166, .1) 45%, rgba(120, 138, 166, 0) 70%);
  --sky-mask: var(--moon-mask, linear-gradient(transparent, transparent));
}
/* On a dark ground the moon's glow is paler. Stillness and guided practice
   are always dark, whatever the theme. */
@media (prefers-color-scheme: dark) {
  :root[data-sky="night"]:not([data-theme="light"]) {
    --sky-glow: radial-gradient(circle, rgba(176, 192, 214, .34), rgba(176, 192, 214, .12) 45%, rgba(176, 192, 214, 0) 70%);
  }
}
:root[data-theme="dark"][data-sky="night"],
:root[data-sky="night"] .stillness {
  --sky-glow: radial-gradient(circle, rgba(176, 192, 214, .34), rgba(176, 192, 214, .12) 45%, rgba(176, 192, 214, 0) 70%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #141312;
    --surface: #1c1b19;
    --ink: #e9e5db;
    --ink-2: #a09c91;
    --ink-3: #6a675f;
    --line: #282724;
    --line-2: #3b3a35;
    --accent: #cfcabf;
    --accent-soft: rgba(233, 229, 219, 0.08);
    --seal: #d9644a;
    --danger: #cf9482;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #141312;
  --surface: #1c1b19;
  --ink: #e9e5db;
  --ink-2: #a09c91;
  --ink-3: #6a675f;
  --line: #282724;
  --line-2: #3b3a35;
  --accent: #cfcabf;
  --accent-soft: rgba(233, 229, 219, 0.08);
  --seal: #d9644a;
  --danger: #cf9482;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: auto 1fr;
  padding-inline: clamp(16px, 5vw, 48px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---- top ---- */
.top {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ground);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.01em;
}
.brand span { color: var(--ink-2); transition: color 400ms; }
.brand:hover span { color: var(--ink); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  position: relative;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 6px;
  transition: color 400ms;
}
.nav a:hover { color: var(--ink-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--seal);
  transform: translateX(-50%);
}
.nav a.has-new::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--seal);
  animation: pulse 3s var(--ease) infinite;
}
.quiet {
  color: var(--ink-2);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  transition: background 300ms, color 300ms;
}
.quiet:hover { color: var(--ink); background: var(--accent-soft); }
.still-btn { padding: 5px 10px; }

/* ---- pages ---- */
.page { width: min(100%, 640px); margin: 0 auto; padding-block: 5vh 14vh; }
.page h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4.4vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.lede { color: var(--ink-2); margin: 0 0 36px; font-size: 14.5px; max-width: 52ch; }
.section { padding-block: 26px 10px; border-top: 1px solid var(--line); }
.section h2 { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 0 0 16px; letter-spacing: 0.02em; }
.section p.help { color: var(--ink-3); font-size: 12.5px; margin: -8px 0 14px; }
.blank { color: var(--ink-3); font-family: var(--serif); font-style: italic; font-size: 17px; padding-block: 6vh; text-align: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 2px 5px;
  border: 1px solid transparent;
  border-bottom-color: var(--line-2);
  font-size: 13px;
  color: var(--ink);
  transition: border-color 300ms, opacity 300ms;
}
.pill:hover { border-bottom-color: var(--ink); }
.pill.solid { padding: 7px 16px; border-radius: var(--corner); background: var(--ink); color: var(--ground); border-color: var(--ink); }
.pill.solid:hover { opacity: .88; }
.pill.danger { color: var(--danger); }
.pill[disabled] { opacity: .4; pointer-events: none; }

/* ---- sit (chat) ---- */
/* The body grid's second row already fills what the header leaves, however
   tall the header is (a phone's notch adds to it), so no height is set here:
   a fixed sum would overflow by the notch and scroll the first words under
   the header. */
.sit {
  width: min(100%, 680px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 4vh 2vh;
}
.breath {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  margin-bottom: 42px;
}
/* The breath is a sun by day and a moon by night (data-sky, set in each
   page's head and kept current by shell.js). ::after is the glow, ::before
   the body. */
.breath::before,
.breath::after {
  content: "";
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: breathe var(--breath) var(--ease) infinite;
}
.breath::before { width: 68%; height: 68%; background: var(--sky-body); -webkit-mask: var(--sky-mask) center / 100% 100% no-repeat; mask: var(--sky-mask) center / 100% 100% no-repeat; }
.breath::after { background: var(--sky-glow); }
/* in for 4.8s, rest, out for 6s */
@keyframes breathe {
  0%, 100% { transform: scale(.32); opacity: .45; }
  40%, 50% { transform: scale(1); opacity: 1; }
}
.koan {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3.8vw, 32px);
  line-height: 1.32;
  margin: 0 0 30px;
}
.koan span { color: var(--ink-2); }
.invites { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 540px; }
.invite {
  padding: 6px 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16.5px;
  text-decoration: underline;
  text-decoration-color: var(--ink-3);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: text-decoration-color 500ms;
}
.invite:hover { text-decoration-color: var(--ink); }

.thread { list-style: none; margin: 0; padding: 5vh 0 28px; display: flex; flex-direction: column; gap: 32px; flex: 1; }
.thread:empty { display: none; }
.turn { animation: settle 900ms var(--ease) both; }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } }
.turn.you {
  align-self: flex-end;
  max-width: 85%;
  color: var(--ink-2);
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding-right: 14px;
  border-right: 1px solid var(--line-2);
}
.turn.teacher {
  font-family: var(--serif);
  font-size: clamp(17px, 2.3vw, 19px);
  line-height: 1.75;
  max-width: 62ch;
  overflow-wrap: anywhere;
}
.turn.teacher p { margin: 0 0 .9em; }
.turn.teacher p:last-child { margin-bottom: 0; }
.turn.teacher.waiting::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--seal);
  vertical-align: middle;
  animation: pulse 4s var(--ease) infinite;
}
/* Each word of a reply inks in: a pale wash to full ink, out of nothing. */
.turn.teacher .w { animation: ink 1300ms var(--ease) both; }
@keyframes ink {
  from { opacity: 0; color: var(--ink-3); }
  45% { opacity: .75; }
}
@keyframes pulse { 50% { opacity: .2; transform: scale(.7); } }
.turn.note { align-self: center; color: var(--ink-3); font-size: 12.5px; text-align: center; }
.turn.note button { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }

.say {
  position: sticky;
  bottom: 0;
  padding: 22px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--ground) 28%);
}
.say-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  transition: border-color 700ms;
}
.say:focus-within .say-row { border-bottom-color: var(--ink-3); }
.say textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  background: none;
  outline: none;
  padding: 4px 0;
  max-height: 38vh;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
}
.say textarea::placeholder { color: var(--ink-3); font-style: italic; }
.send {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  transition: color 300ms, border-color 300ms, opacity 300ms;
}
.send:hover { color: var(--ink); border-color: var(--ink-3); }
.send:disabled { opacity: .35; cursor: default; }
.send .i-stop { display: none; }
.send.busy .i-send { display: none; }
.send.busy .i-stop { display: block; }
/* The ripple spreads past the button; clip it to the input area so it can
   never make the page wider than a phone screen. */
.say { overflow-x: clip; }
.send.ripple::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ripple 1.8s var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(3.4); opacity: 0; } }
.say-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; min-height: 22px; font-size: 12px; color: var(--ink-3); }
.say-meta .quiet { font-size: 12px; margin-left: -10px; white-space: nowrap; }
.say-meta a { color: var(--ink-2); }
.kept { margin-left: auto; text-align: right; transition: opacity 1.2s; }

/* ---- past ---- */
.search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: none;
  outline: none;
  padding: 6px 0 10px;
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: 17px;
}
.search::placeholder { color: var(--ink-3); font-style: italic; }
.day-label { font-size: 12px; color: var(--ink-3); margin: 26px 0 6px; }
.sittings { list-style: none; margin: 0; padding: 0; }
.sitting-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); }
.sitting { display: block; padding: 14px 0; text-decoration: none; min-width: 0; }
.s-title { display: block; font-family: var(--serif); font-size: 18px; line-height: 1.35; transition: color 400ms; }
.sitting:hover .s-title { color: var(--seal); }
.s-snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); font-size: 13.5px; margin-top: 3px; }
.s-meta { display: block; color: var(--ink-3); font-size: 12px; margin-top: 5px; }

.let-go { margin-top: 12px; color: var(--ink-3); font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; transition: color 300ms, background 300ms; }
.let-go:hover { color: var(--danger); background: var(--accent-soft); }
.let-go.confirm { color: var(--danger); }

/* ---- remembered ---- */
.memories { list-style: none; margin: 0; padding: 0; }
.memory { padding: 14px 0 12px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.memory textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: none;
  padding: 2px 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  overflow: hidden;
}
.memory textarea:focus { box-shadow: 0 1px 0 var(--accent); }
.memory .let-go { margin-top: 2px; }
.m-meta { grid-column: 1 / -1; color: var(--ink-3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.m-meta a { color: var(--ink-3); text-underline-offset: 3px; }
.m-new { color: var(--seal); }
.add-memory { display: flex; gap: 10px; align-items: flex-end; margin-top: 22px; }
.add-memory input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--line-2); background: none; outline: none; padding: 6px 0; font-family: var(--serif); font-size: 17px; }
.add-memory input::placeholder { color: var(--ink-3); font-style: italic; }
.paused { color: var(--ink-2); font-size: 13px; border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 28px; }
.page-foot { margin-top: 44px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- settings ---- */
.field { display: grid; gap: 6px; margin-bottom: 20px; }
.field label, .row label { font-size: 13.5px; }
.field .hint { color: var(--ink-3); font-size: 12.5px; }
.field .inline { display: flex; gap: 8px; align-items: center; }
.field .inline input { flex: 1; min-width: 0; }
.field .inline .pill { flex: none; }
.field input[type="text"], .field input[type="password"], .field input[type="number"], .field input[type="email"], .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--corner);
  padding: 10px 12px;
  outline: none;
  font-size: 15px;
  line-height: 1.55;
  transition: border-color 400ms;
}
.field textarea { font-family: var(--serif); font-size: 16px; min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea::placeholder, .field input::placeholder { color: var(--ink-3); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; flex-wrap: wrap; }
.row select {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 13px;
}
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg label {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 5px 11px;
  border-radius: var(--corner);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 300ms, color 300ms;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--ink); }
.seg label:has(input:checked) { border-color: var(--line-2); color: var(--ink); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 34px;
  height: 20px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background 400ms;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 400ms var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); }
.status-kept { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); color: var(--ink-2); font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--corner); padding: 5px 14px; opacity: 0; transition: opacity 800ms; pointer-events: none; }
.status-kept.show { opacity: 1; }

/* ---- stillness ---- */
/* Always the same dim water, whatever the theme: easier on eyes in the dark
   and on OLED batteries. */
.stillness {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0e0f0e;
  color: #dfe6e1;
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: dawn 1.6s var(--ease);
  touch-action: none;
}
@keyframes dawn { from { opacity: 0; } }
/* Safari on a phone draws its bars over strips the overlay does not reach,
   and shows the page's own ground there. While Stillness or a practice is
   open, that ground is the same dark water. */
html.dark-room, html.dark-room body { overflow: hidden; background: #0e0f0e; }
.stillness.leaving { opacity: 0; transition: opacity 900ms var(--ease); }
.still-scene, .still-layer { position: absolute; inset: 0; }
.still-layer { opacity: 0; transition: opacity 1.5s var(--ease); background: #0e0f0e center / cover no-repeat; }
.still-layer.on { opacity: 1; }
.still-layer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.8s var(--ease); }
.still-layer video.on { opacity: 1; }
.stillness canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Films sit a little dim, darkest around the circle, so the eye rests there. */
.still-scene:is([data-scene="waterfall"], [data-scene="rain"], [data-scene="sea"], [data-scene="stream"])::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 46%, rgba(6, 10, 8, .5), rgba(6, 10, 8, .22) 40%, rgba(6, 10, 8, 0) 75%),
    linear-gradient(to bottom, rgba(6, 10, 8, .4), rgba(6, 10, 8, .14) 22%, rgba(6, 10, 8, .14) 62%, rgba(6, 10, 8, .72));
}
.still-scene:not([data-scene="water"]):not([data-scene="dark"]) ~ * :is(.still-word, .still-time, .chip, .still-return),
.still-scene:not([data-scene="water"]):not([data-scene="dark"]) ~ .still-hint { text-shadow: 0 1px 10px rgba(0, 0, 0, .7), 0 0 2px rgba(0, 0, 0, .35); }
.still-center { position: relative; text-align: center; pointer-events: none; padding-bottom: 6vh; }
.still-breath {
  width: min(46vw, 200px);
  aspect-ratio: 1;
  max-width: 100%;
  margin: 0 auto 28px;
  border-radius: 50%;
  border: 1px solid rgba(223, 230, 225, .16);
  display: grid;
  place-items: center;
}
.still-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: scale(.35);
  transition-property: transform;
  transition-timing-function: var(--ease);
}
.still-ring::before,
.still-ring::after { content: ""; position: absolute; border-radius: 50%; }
.still-ring::after { inset: 0; background: var(--sky-glow); opacity: .8; }
/* Dimmer than on the page: stillness is a dark room. */
.still-ring::before { inset: 16%; background: var(--sky-body); -webkit-mask: var(--sky-mask) center / 100% 100% no-repeat; mask: var(--sky-mask) center / 100% 100% no-repeat; opacity: .78; z-index: 1; }
.still-word { font-family: var(--serif); font-size: 22px; margin: 0; color: rgba(223, 230, 225, .86); letter-spacing: .02em; min-height: 1.4em; transition: opacity 900ms; }
.still-time { margin: 8px 0 0; font-size: 12px; color: rgba(223, 230, 225, .42); font-variant-numeric: tabular-nums; min-height: 18px; }
.still-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  justify-content: center;
  align-items: center;
  transition: opacity 1.4s var(--ease);
}
.stillness.idle { cursor: none; }
.stillness.idle .still-controls { opacity: 0; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.chip { padding: 5px 11px; border-radius: 999px; font-size: 12.5px; color: rgba(223, 230, 225, .5); border: 1px solid transparent; transition: color 400ms, border-color 400ms; }
.chip:hover { color: rgba(223, 230, 225, .8); }
.chip[aria-pressed="true"] { color: #eef3ef; border-color: rgba(223, 230, 225, .28); }
.still-vol { width: 96px; accent-color: #cfcabf; }
.still-return { color: rgba(223, 230, 225, .72); font-size: 12.5px; padding: 5px 14px; border: 1px solid rgba(223, 230, 225, .22); border-radius: 999px; }
.still-return:hover { color: #fff; border-color: rgba(223, 230, 225, .5); }
.still-hint { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(223, 230, 225, .32); transition: opacity 1.4s; pointer-events: none; }
.stillness.idle .still-hint { opacity: 0; }
@media (max-width: 640px) {
  .still-controls { gap: 6px 10px; padding-top: 12px; }
  .still-controls .chips { gap: 0; }
  .still-controls .chip { padding: 4px 8px; font-size: 12px; }
  .still-center { padding-bottom: 18vh; }
}

@media (max-width: 640px) {
  .top { gap: 6px; height: 56px; }
  .brand span { display: none; }
  .nav { min-width: 0; }
  .nav a { padding: 5px 5px; font-size: 12.5px; }
  .still-btn { flex: none; padding: 4px 9px; font-size: 12px; }
  .say textarea { font-size: 17px; }
  .hint-keys { display: none; }
}
@media (max-width: 360px) {
  .brand { display: none; }
  .nav a { padding: 5px 4px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- header: more menu, stillness icon ---- */
.more { position: relative; }
.more summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  color: var(--ink-3);
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 6px;
  transition: color 400ms;
}
.more summary::-webkit-details-marker { display: none; }
.more summary:hover, .more[open] summary, .more.current summary { color: var(--ink); }
.more.current summary::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--seal);
  transform: translateX(-50%);
}
.more.has-new summary::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--seal);
}
.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  min-width: 190px;
  display: grid;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--corner);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 40px -22px rgba(0,0,0,.3);
  animation: settle 400ms var(--ease);
}
.nav .more-menu a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; }
.nav .more-menu a:hover { color: var(--ink); background: var(--accent-soft); }
.nav .more-menu a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.nav .more-menu a[aria-current="page"]::after { display: none; }
.nav .more-menu a.has-new::before { top: 50%; right: 12px; transform: translateY(-50%); }
.still-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.still-icon { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header: the account button on the right ---- */
.account { flex: none; }
.more.account summary { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); color: var(--ink-2); }
.more.account.signed-in summary { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.more.account.current summary::after { bottom: -7px; }
.account-initial { font-size: 12.5px; font-weight: 600; line-height: 1; text-transform: uppercase; }
.account-menu a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; text-decoration: none; }
.account-menu a:hover, .account-menu a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.account-who { margin: 4px 12px 8px; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.account-legal { margin: 6px 12px 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.account-menu .account-legal a { padding: 0; font-size: 12px; color: var(--ink-3); }
.account-menu .account-legal a:hover, .account-menu .account-legal a[aria-current="page"] { color: var(--ink); background: none; }
.drawer-legal { margin: 10px 0 0; padding: 0 14px; font-size: 12.5px; color: var(--ink-3); }
.drawer-legal a { color: var(--ink-2); text-underline-offset: 3px; }

/* ---- privacy, terms, contact ---- */
.prose.legal .updated { margin: 6px 0 26px; color: var(--ink-3); font-size: 13px; }
.legal h3 { margin: 22px 0 6px; font-size: 15px; font-weight: 600; }
.prose .contact-email { margin: 0 0 30px; font-size: 22px; }

/* ---- for adults: the Sit page's question, the sign-in checkbox ---- */
.turn.age-check .age-terms { color: var(--ink-2); font-size: 14px; }
.age-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.younger { max-width: 46ch; margin: 18px auto 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; text-align: center; }
.younger a { color: var(--ink); text-underline-offset: 3px; }
.invites[hidden] { display: none; }
.adult-check { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 16px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.adult-check input { flex: none; margin: 3px 0 0; accent-color: var(--accent); }
.adult-check a { color: var(--ink); text-underline-offset: 3px; }

/* ---- Zen Master Admin: today's teachings ---- */
.teaching-preview { padding: 24px 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tp-text { margin: 0 0 10px; font-family: var(--serif); font-size: 21px; line-height: 1.5; text-align: center; }
.tp-source { margin: 0 0 8px; color: var(--ink-2); font-size: 13.5px; text-align: center; }
.tp-label { margin: 22px 0 8px; color: var(--ink-3); font-size: 12.5px; text-align: center; }
.tp-plain { margin: 0 0 12px; font-size: 15.5px; line-height: 1.7; }
.tp-carry { margin: 0; font-size: 15px; text-align: center; }
.prose .contact-email a { text-underline-offset: 5px; }
.top [hidden] { display: none !important; }

/* ---- sit: closing line, help ---- */
.gentle-help { margin: 36px 0 0; font-size: 12px; color: var(--ink-3); }
.gentle-help a { color: var(--ink-3); text-underline-offset: 3px; }
.gentle-help a:hover { color: var(--ink-2); }
.turn.closing { border-top: 1px solid var(--line); padding-top: 24px; }
.turn.closing p { margin: 0; font-family: var(--serif); font-size: 19px; }
.turn.closing .add-memory { margin-top: 12px; }
.turn.closing .quiet { margin: 8px 0 0 -10px; font-size: 12.5px; }
.s-line { display: block; font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 15px; margin-top: 3px; }

/* ---- practices ---- */
.group-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 34px 0 0; letter-spacing: .02em; }
.practices { list-style: none; margin: 0; padding: 0; }
.practice { padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.p-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.practice h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.3; margin: 0; }
.p-time { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.p-for { color: var(--accent); font-size: 13px; margin: 3px 0 8px; }
.p-desc { color: var(--ink-2); font-size: 14.5px; margin: 0 0 16px; max-width: 56ch; }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

/* ---- guided practice overlay ---- */
.guide { background: radial-gradient(ellipse at 50% 42%, #1c1d1b, #0e0f0e 72%); }
.guide-progress { position: absolute; top: 0; left: 0; height: 2px; width: 0; background: rgba(223, 230, 225, .5); transition: width 1s linear; }
.guide-center { position: relative; width: min(100%, 680px); padding: 0 24px 12vh; text-align: center; }
.guide-breath { width: min(34vw, 140px); margin-bottom: 30px; }
.guide-step {
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.5;
  color: rgba(223, 230, 225, .9);
  margin: 0 auto;
  max-width: 28ch;
  min-height: 4.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 700ms var(--ease);
}
.guide-step.fading { opacity: 0; }
.guide-end { margin-top: 20px; }
.guide-line { display: flex; gap: 10px; align-items: center; max-width: 440px; margin: 0 auto; }
.guide-line input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(223, 230, 225, .25);
  outline: none;
  padding: 6px 0;
  color: #e9efe9;
  font-family: var(--serif);
  font-size: 17px;
}
.guide-line input:focus { border-bottom-color: rgba(223, 230, 225, .55); }
.guide-line input::placeholder { color: rgba(223, 230, 225, .4); font-style: italic; }
.guide-kept { color: rgba(223, 230, 225, .6); font-size: 13px; margin: 8px 0 0; }
.guide-kept a { color: inherit; }

/* ---- today ---- */
.today { text-align: center; }
.today-date { color: var(--ink-3); font-size: 12.5px; letter-spacing: .03em; margin: 0 0 34px; }
.teaching {
  font-family: var(--serif);
  font-size: clamp(26px, 4.6vw, 40px);
  line-height: 1.4;
  letter-spacing: -0.005em;
  margin: 0 auto 26px;
  max-width: 26ch;
  white-space: pre-line;
  text-wrap: balance;
}
.teaching.long { font-size: clamp(19px, 2.7vw, 23px); line-height: 1.6; letter-spacing: 0; max-width: 40ch; text-align: left; text-wrap: pretty; white-space: normal; }
.teaching .t-line { display: block; }
.teaching .t-line + .t-line { margin-top: .7em; }
.teaching-source { color: var(--ink-2); font-size: 13.5px; margin: 0 0 34px; }
.teaching-carry { max-width: 44ch; margin: 0 auto 28px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 15.5px; }
.teaching-carry span:first-child { display: block; color: var(--ink-3); font-size: 12px; margin-bottom: 6px; }
.today-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.today-actions a.pill { text-decoration: none; }
.line-form { max-width: 460px; margin: 22px auto 0; text-align: left; }
.kept-note { color: var(--ink-2); font-size: 13px; margin: 18px 0 0; }
.day-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; }
.day-nav a { font-size: 12.5px; }
.day-nav a[hidden] + a { margin-left: auto; }
.footnote { color: var(--ink-3); font-size: 12px; margin-top: 26px; }
/* The teaching fills the first screen; its plain reading follows below. */
.teaching-hero { min-height: calc(92vh - 120px); min-height: calc(92svh - 120px); display: flex; flex-direction: column; justify-content: center; align-items: center; padding-bottom: 28px; }
.teaching-hero .today-date { margin-bottom: 28px; }
.teaching-hero .teaching-source { margin-bottom: 0; }
/* The seal: the one red thing on the page, stamped a little off square. */
.teaching-hero .teaching-source:not(:empty)::after {
  content: "禅";
  content: "禅" / "";
  display: block;
  width: 30px;
  height: 30px;
  margin: 30px auto 0;
  border-radius: var(--corner);
  background: var(--seal);
  color: var(--ground);
  font: 500 17px/30px var(--serif);
  text-align: center;
  transform: rotate(-4deg);
}
.teaching-plain { max-width: 58ch; margin: 0 auto 34px; padding-top: 44px; border-top: 1px solid var(--line); text-align: left; }
.teaching-plain h2 { margin: 0 0 14px; text-align: center; color: var(--ink-3); font-size: 12.5px; font-weight: 500; letter-spacing: .02em; }
.teaching-plain p { margin: 0 0 14px; font-size: 16.5px; line-height: 1.72; color: var(--ink); text-wrap: pretty; }
.teaching-plain p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .teaching-hero { min-height: calc(74vh - 60px); min-height: calc(74svh - 60px); padding-bottom: 20px; }
}

/* ---- journal ---- */
.journal-add { margin: -8px 0 8px; }

/* ---- about ---- */
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 23px; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.prose p { margin: 0 0 12px; }
.prose ul { padding-left: 18px; margin: 0 0 12px; }
.prose li { margin-bottom: 8px; }
.prose strong, .prose b { color: var(--ink); font-weight: 500; }
.prose a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose .help { color: var(--ink-3); font-size: 12.5px; }
.prose .lede { margin: 0 0 32px; }
.crisis-note { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 12px !important; }
#safety { scroll-margin-top: 80px; }
.prose .helplines { list-style: none; padding: 0; margin: 8px 0 12px; border-top: 1px solid var(--line); }
.prose .helplines li { display: grid; grid-template-columns: minmax(110px, 32%) 1fr; gap: 4px 14px; padding: 10px 0; margin: 0; border-bottom: 1px solid var(--line); }

@media (max-width: 640px) {
  .more summary { padding: 5px 6px; font-size: 12.5px; }
  .nav .more-menu a { font-size: 14px; padding: 10px 12px; }
  .prose .helplines li { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .still-label { display: none; }
  .still-icon { display: block; }
  .top .still-btn { padding: 7px; }
}
@media (max-width: 360px) {
  .more summary { padding: 5px 4px; font-size: 12px; }
}

/* ---- library ---- */
.turn.teacher .sources { margin-top: 18px; font-family: var(--sans); font-size: 12px; line-height: 1.6; color: var(--ink-3); animation: settle 1200ms var(--ease) both; }
.turn.teacher .sources a { color: var(--ink-2); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.turn.teacher .sources a:hover { color: var(--ink); text-decoration-color: var(--ink-3); }
.library-list { list-style: none; margin: 0; padding: 0; }
.library-list li { border-bottom: 1px solid var(--line); }
.library-list a { display: block; padding: 14px 0; text-decoration: none; }
.l-title { display: block; font-family: var(--serif); font-size: 19px; line-height: 1.35; transition: color 400ms; }
.library-list a:hover .l-title { color: var(--seal); }
.l-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); font-size: 13.5px; margin-top: 3px; }
.l-draft { font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); margin-left: 10px; white-space: nowrap; }
.l-type { color: var(--ink-3); font-size: 12.5px; margin: 0 0 6px; }
.l-type .l-draft { margin-left: 0; }
.l-type .l-draft::before { content: " · "; }
.l-back { margin: 0 0 24px; }
.l-back .quiet { margin-left: -10px; }
.article-body { margin-top: 8px; }
.article-body h2:first-child { margin-top: 18px; }
.l-sources { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; padding-left: 18px; margin: 10px 0 0; }
.l-sources li { margin-bottom: 6px; }

/* ---- Zen Master Admin ---- */
.page.admin { width: min(100%, 1100px); }
.admin-who { color: var(--ink-3); font-size: 12.5px; align-self: center; margin-right: 4px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.admin-head .lede { margin-bottom: 20px; }
.admin-gate { max-width: 380px; }
.admin-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.admin-banner p { margin: 0; color: var(--ink-2); }
.admin-filter { margin: 0 0 6px; }
.admin-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.admin-list li.blank { display: block; }
.a-meta { display: block; color: var(--ink-3); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.badge { display: inline-block; white-space: nowrap; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.badge.ok { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.badge.draft::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--seal); margin-right: 6px; vertical-align: 2px; }
.admin-live { color: var(--ink-2); font-size: 13px; margin: 2px 0 24px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }
.admin-tabs { margin-bottom: 18px; }
.admin-side { position: sticky; top: 76px; }
.admin-side .group-label:first-child { margin-top: 0; }
.check-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.check-list label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; font-size: 13px; color: var(--ink-2); line-height: 1.5; cursor: pointer; }
.check-list input { margin: 3px 0 0; accent-color: var(--accent); }
.check-list input:checked + span { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.check-list a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.check-list a:hover { color: var(--ink); text-decoration-color: var(--ink-3); }
.check-list input:checked + span a { text-decoration-line: line-through underline; }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.admin-side .side-head:first-child .group-label { margin-top: 0; }
.engine-pick select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 2px 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
#review, #teaching-review { margin-top: 10px; }
#review textarea, #teaching-review textarea, .md-editor { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; outline: none; font-size: 14px; line-height: 1.55; resize: vertical; transition: border-color 300ms; }
#review textarea:focus, #teaching-review textarea:focus, .md-editor:focus { border-color: var(--accent); }
.md-editor { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 60vh; margin-bottom: 14px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.admin-hint { color: var(--ink-3); font-size: 12px; }
.admin-error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.admin-error ul { margin: 4px 0 0; padding-left: 18px; }
.history { list-style: none; padding: 0; margin: 8px 0 0; }
.history li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.h-what { display: block; color: var(--ink); }
.h-what.approve { color: var(--accent); }
.h-note { display: block; color: var(--ink-2); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.h-when { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.diff { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.6; border: 1px solid var(--line); border-radius: 10px; padding: 10px 0; overflow-x: auto; background: var(--surface); }
.diff div { padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.d-add { background: var(--accent-soft); color: var(--ink); }
.d-del { color: var(--ink-3); text-decoration: line-through; }
.d-same { color: var(--ink-2); }
@media (max-width: 880px) {
  .admin-grid { grid-template-columns: 1fr; gap: 28px; }
  .admin-side { position: static; }
}
a.pill { text-decoration: none; }

/* ---- article editor (review screen) ---- */
.article-form { display: grid; gap: 2px; }
.admin-narrow { max-width: 760px; }

/* ---- Zen Master Admin: the teacher ---- */
.teacher-form .section:first-child { border-top: 0; padding-top: 0; }
.price-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.inline-check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.t-sample { width: 100%; margin-top: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--ink); }
.t-reply { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 15px; }
.model-warn { color: var(--danger); }

/* ---- Zen Master Admin: checking a model ---- */
.model-check { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.check-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; }
.check-bar .t-sample { width: auto; margin-top: 0; }
.checks { list-style: none; padding: 0; margin: 22px 0 0; }
.check { padding: 18px 0; border-top: 1px solid var(--line); }
.check-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.check-head h3 { margin: 0; font-size: 15px; font-weight: 500; }
.check-standard { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.check-sent { margin: 8px 0 0; font-size: 14px; font-style: italic; }
.check-replies { display: grid; gap: 0 24px; }
.check-replies.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-model { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.check-reply .t-reply { margin-top: 6px; }
.marks { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.marks li { padding: 2px 0 2px 22px; position: relative; color: var(--ink-2); }
.marks li::before { position: absolute; left: 0; }
.marks li.ok::before { content: "✓"; color: var(--ink-2); }
.marks li.no { color: var(--danger); }
.marks li.no::before { content: "✕"; }
.check-sound { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.check-verdict { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.check-verdict p { margin: 0 0 12px; font-size: 14px; }
.check-verdict input[type="text"] { width: 100%; }
@media (max-width: 760px) {
  .check-replies.two { grid-template-columns: 1fr; }
}

/* ---- Sit: where to find help, when the safety check is concerned ---- */
.turn .care { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0; font-family: inherit; font-size: 14px; line-height: 1.55; color: var(--ink); }
.turn .care p { margin: 0 0 6px; }
.turn .care p:last-child { margin: 0; }
.turn .care a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Sign in ---- */
.signin-form { max-width: 420px; }
.signin-help { color: var(--ink-3); font-size: 13px; margin-top: 14px; }
.spam-note { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0; font-size: 14px; color: var(--ink); }
.with-google { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 14px; }
.with-google .or { color: var(--ink-3); font-size: 13px; }
/* Google's own look for its button: white, its G, Roboto-like text. */
.google-button { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid #747775; border-radius: var(--corner); background: #fff; color: #1f1f1f; font: 500 14px/20px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; cursor: pointer; }
.google-button:hover { background: #f8f9fa; }
.signin-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.quiet.inline { padding: 0; margin: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
#account .row span { color: var(--ink-2); }

/* ---- Sit: keeping a sitting, and the nudge to sign in ---- */
.say-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.keep { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; color: var(--ink-3); }
.keep input { margin: 0; accent-color: var(--accent); }
.keep:has(input:not(:checked)) { color: var(--ink-2); }
.nudge { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.nudge a { color: var(--ink-2); }
.nudge .quiet { font-size: 13px; }

/* ---- Settings: your own key, tucked away ---- */
.advanced summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); padding: 6px 0; }
.advanced[open] summary { margin-bottom: 12px; }

/* ---- the check that someone is a person (Turnstile), when one is asked ---- */
.human-check { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; }

/* ---- the first sign-in's questions, and the counts in admin ---- */
.welcome fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.welcome legend { font-size: 13.5px; padding: 0; margin-bottom: 8px; }
.chips { margin-bottom: 10px; }
.counts { list-style: none; padding: 0; margin: 10px 0 0; }
.counts li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.counts li span:last-child { font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---- Settings: erasing, or deleting the account ---- */
.confirm-delete { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--corner); background: var(--surface); }
.confirm-delete p { margin: 0 0 12px; font-size: 14px; color: var(--ink); }
.confirm-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.article-form .field select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 10px; font-size: 14px; }
.article-form .hint { color: var(--ink-3); font-size: 12.5px; margin: 0 0 8px; }
.form-row { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); gap: 20px; }
.field-label { font-size: 13.5px; }
.field-error { color: var(--danger); font-size: 12.5px; }
.form-heading { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 22px 0 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.add-row { justify-self: start; margin: 2px 0 0 -10px; }
.form-note { margin-top: 22px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; background: var(--ground); padding: 12px 0; margin-top: 4px; border-top: 1px solid var(--line); }

.section-edit { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px 14px; margin: 0 0 12px; }
.section-head { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.section-title { flex: 1; min-width: 0; font-family: var(--serif); font-size: 17px; color: var(--ink); border: 0; border-bottom: 1px solid transparent; background: none; outline: none; padding: 2px 0; }
input.section-title:hover { border-bottom-color: var(--line-2); }
input.section-title:focus { border-bottom-color: var(--accent); }
.section-tools { display: inline-flex; align-items: center; gap: 2px; }
.section-tools .let-go { margin-top: 0; }
.section-edit > .hint { margin: 2px 0 0; }
.icon-btn { width: 28px; height: 28px; flex: none; border-radius: 6px; color: var(--ink-3); display: inline-grid; place-items: center; font-size: 15px; }
.icon-btn:hover { color: var(--ink); background: var(--accent-soft); }
.rt-toolbar { display: flex; gap: 2px; margin: 8px 0 6px; }
.rt-toolbar button { min-width: 30px; height: 28px; padding: 0 9px; border-radius: 6px; color: var(--ink-2); font-size: 13px; border: 1px solid transparent; }
.rt-toolbar button:hover { background: var(--accent-soft); color: var(--ink); }
.rt {
  position: relative;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ground);
  outline: none;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  transition: border-color 300ms;
}
.rt:focus { border-color: var(--accent); }
.rt p { margin: 0 0 .7em; }
.rt p:last-child { margin-bottom: 0; }
.rt ul, .rt ol { margin: 0 0 .7em; padding-left: 22px; }
.rt ul:last-child, .rt ol:last-child { margin-bottom: 0; }
.rt li { margin-bottom: 4px; }
.rt.is-empty::before { content: attr(data-placeholder); position: absolute; top: 10px; left: 12px; color: var(--ink-3); font-style: italic; pointer-events: none; }
.rt.is-empty:has(li)::before { left: 34px; }

.source-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.source-rows li { display: flex; gap: 6px; align-items: center; }
.source-rows input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; font-size: 14px; outline: none; transition: border-color 300ms; }
.source-rows input:focus { border-color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: text; transition: border-color 300ms; }
.tags:focus-within { border-color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; max-width: 100%; }
.tag > span { overflow-wrap: anywhere; }
.tag button { width: 20px; height: 20px; flex: none; border-radius: 50%; color: var(--ink-2); line-height: 1; }
.tag button:hover { color: var(--ink); background: var(--line); }
.field .tags input[type="text"], .tags select { flex: 1; min-width: 180px; border: 0; background: none; outline: none; padding: 4px 6px; font-size: 14px; border-radius: 0; }
.tags select { color: var(--ink-2); cursor: pointer; }

/* ---- changes since the approved version ---- */
.changes ins { background: var(--accent-soft); color: var(--ink); text-decoration: none; border-radius: 3px; padding: 0 1px; }
.changes del { color: var(--danger); text-decoration: line-through; }
.c-fields { margin: 8px 0 10px; border-top: 1px solid var(--line); }
.c-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.c-label { color: var(--ink-3); font-size: 12.5px; padding-top: 2px; }
.c-chip { display: inline-block; margin: 0 6px 6px 0; padding: 2px 10px; border-radius: 999px; font-size: 13px; }
del.c-chip { border: 1px solid var(--line-2); }
.c-section { font-family: var(--serif); font-weight: 400; font-size: 19px; margin: 24px 0 8px; }
.c-note { font-family: var(--sans); font-size: 12px; color: var(--ink-3); }
.c-unit { margin: 0 0 8px; font-family: var(--serif); font-size: 16px; line-height: 1.6; }
.c-unit.same { color: var(--ink-3); }
.c-unit.added { background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; }
.c-unit.removed { color: var(--danger); text-decoration: line-through; }
.c-empty { color: var(--ink-3); font-style: italic; }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .c-row { grid-template-columns: 1fr; gap: 4px; }
  .section-head { flex-wrap: wrap; }
}
.article-form #editor { display: grid; gap: 2px; }
.article-form .field-error { display: block; margin-top: 2px; }

/* ---- the menu drawer ---- */
/* The header holds the name, Stillness and the account; the pages are in
   the drawer at every width. Zen Master Admin keeps its links in its header
   until the screen is small. */
/* Installed as an app, the page runs under the status bar and notch. */
.top { box-sizing: content-box; padding-top: env(safe-area-inset-top, 0px); }
.menu-btn {
  display: inline-grid;
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: -10px;
  border-radius: 10px;
  color: var(--ink-2);
  place-items: center;
  transition: background 300ms, color 300ms;
}
.menu-btn:hover { color: var(--ink); background: var(--accent-soft); }
.menu-btn.has-new::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--seal);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 19, 18, .32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 450ms var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 41;
  width: min(84vw, 320px);
  display: flex;
  flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px calc(20px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 48px -16px rgba(0, 0, 0, .35);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-104%);
  visibility: hidden;
  transition: transform 450ms var(--ease), visibility 0s linear 450ms;
}
.drawer.open { transform: none; visibility: visible; transition: transform 450ms var(--ease), visibility 0s; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 2px 0 14px; margin-bottom: 8px; }
.drawer-head .brand span { display: inline; }
.drawer-close { width: 40px; height: 40px; border-radius: 10px; }
.drawer-nav { display: grid; gap: 2px; }
.drawer-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 16px;
  text-decoration: none;
  transition: background 300ms, color 300ms;
}
.drawer-nav a:hover { color: var(--ink); background: var(--accent-soft); }
.drawer-nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.drawer-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--seal);
  transform: translateY(-50%);
}
.drawer-nav a.has-new::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--seal);
}
.drawer-sep { height: 1px; margin: 8px 14px; background: var(--line); }
.drawer-group { margin: 14px 14px 4px; font-size: 12px; color: var(--ink-3); }
.drawer-group:first-child { margin-top: 4px; }
.drawer-link { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; color: var(--ink-2); font-size: 16px; text-align: left; transition: background 300ms, color 300ms; }
.drawer-link:hover { color: var(--ink); background: var(--accent-soft); }
.drawer-account { display: grid; gap: 2px; }
.drawer-sep:has(+ .drawer-account:empty) { display: none; }
.drawer-who { margin: 6px 14px; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.drawer-foot { margin: auto 0 0; padding: 20px 14px 0; color: var(--ink-3); font-size: 12.5px; }
.drawer-foot a { color: var(--ink-2); text-underline-offset: 3px; }
html.drawer-open { overflow: hidden; }

.top:not(.admin-top) .nav { display: none; }
.top { gap: 6px; }
.top .brand { display: inline-flex; }
.top .brand span { display: inline; }
.top .still-btn { margin-left: auto; }
.drawer-nav a[aria-current="page"]::before { width: 5px; height: 5px; left: 3px; border-radius: 1px; }
@media (max-width: 760px) {
  .top .nav { display: none; }
}
@media (min-width: 761px) {
  .admin-top .menu-btn, .admin-top ~ .drawer, .admin-top ~ .drawer-backdrop { display: none; }
}
/* During a sitting the header steps back; it returns under the hand. */
.top > * { transition: opacity 900ms var(--ease); }
body:has(#thread:not(:empty)) .top:not(:hover):not(:focus-within):not(:has([open])) > * { opacity: .38; }

/* ---- the scene on the Sit page ---- */
/* A photograph behind the page, shown as it is. The words sit on soft
   frosted panels instead of under a wash over the whole picture. */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--ground); }
.scene-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 2.4s var(--ease);
}
.scene-img.on { opacity: 1; }
.scene-waterfall { background-position: 38% 45%; }
.scene-stream { background-position: 50% 60%; }
/* Only a gentle shade at the very top and bottom edges. */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(8, 12, 9, .26) 0%, rgba(8, 12, 9, 0) 20%, rgba(8, 12, 9, 0) 70%, rgba(8, 12, 9, .3) 100%);
}

/* Over a photograph the Sit page keeps its own quiet palette: light words
   on dark, softly frosted glass, whatever the light or dark setting. There
   is never a pale veil over the picture. */
body:has(.scene) :is(.top, .sit) {
  --ink: #f3f1ea;
  --ink-2: rgba(243, 241, 234, .82);
  --ink-3: rgba(243, 241, 234, .6);
  --line: rgba(255, 255, 255, .16);
  --line-2: rgba(255, 255, 255, .3);
  --surface: #0f140f;
  --ground: #0b0f0b;
  --accent: #e9e5db;
  --accent-soft: rgba(243, 241, 234, .14);
  --seal: #ec8166;
  color: var(--ink);
}

/* Frosted header strip, pinned to the window so it spans the screen. */
body:has(.scene) .top { background: none; }
body:has(.scene) .top::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--surface) 34%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-width: 0 0 1px;
}
@media (max-width: 640px) {
  body:has(.scene) .top::before { height: calc(56px + env(safe-area-inset-top, 0px)); }
}

/* Before a sitting: the circle, the words and the invitations on one panel. */
.empty-card { display: flex; flex-direction: column; align-items: center; max-width: 100%; }
body:has(.scene) .empty-card {
  padding: clamp(28px, 5vw, 44px) clamp(20px, 5vw, 48px);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 38%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, .4);
}
body:has(.scene) .empty .breath { border-color: color-mix(in srgb, var(--ink) 20%, transparent); }
body:has(.scene) .koan { text-shadow: 0 1px 18px rgba(0, 0, 0, .25); }
/* On a phone the card stays small so the photograph has room. */
@media (max-width: 640px) {
  body:has(.scene) .empty .breath { width: 76px; height: 76px; margin-bottom: 22px; }
  body:has(.scene) .empty-card { padding: 24px 18px; }
  body:has(.scene) .koan { font-size: 1.35rem; margin-bottom: 20px; }
  body:has(.scene) .invite { padding: 5px 4px; font-size: 1rem; }
}

/* During a sitting: the conversation on a panel, the photo still visible
   around it. */
body:has(.scene) .thread {
  flex: 0 0 auto;
  margin: 3vh 0 auto;
  padding: clamp(20px, 4vw, 32px);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 56%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, .4);
}

/* The input as a frosted bar. */
body:has(.scene) .say { background: none; z-index: 2; overflow-clip-margin: 40px; }
body:has(.scene) .say-row {
  padding: 8px 8px 8px 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 48%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, .45);
}
body:has(.scene) .say:focus-within .say-row { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
body:has(.scene) .say-meta { padding: 0 10px; color: var(--ink-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }

@media (prefers-reduced-motion: reduce) {
  .scene-img { transition: none; }
}

/* Zen Master Admin, Usage (admin-usage.js). Three fixed colours for who was
   counted, checked for colour-blind separation on paper and on night; the
   legend and a table carry the same, so colour is never the only cue. */
.admin {
  --who-signed: #2a78d6;
  --who-account: #eb6834;
  --who-guest: #1baf7a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .admin { --who-signed: #3987e5; --who-account: #d95926; --who-guest: #199e70; }
}
:root[data-theme="dark"] .admin { --who-signed: #3987e5; --who-account: #d95926; --who-guest: #199e70; }
/* body is a grid: without this, a wide table or chart would widen the page. */
main.admin { min-width: 0; }
.sw-signed-in { background: var(--who-signed); }
.sw-account { background: var(--who-account); }
.sw-guest { background: var(--who-guest); }

.u-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 30px; }
.u-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.u-tile-label { color: var(--ink-2); font-size: 12px; }
.u-tile-value { font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }

.u-chart { padding-block: 22px 8px; border-top: 1px solid var(--line); }
.u-chart-head h2 { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 0 0 4px; letter-spacing: 0.02em; }
.u-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 12px; padding: 0; font-size: 12px; color: var(--ink-2); }
.u-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.u-legend span { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 2px; }
.u-plot { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 180px auto; }
.u-grid { grid-row: 1; grid-column: 1 / -1; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.u-grid span { display: block; font-size: 11px; color: var(--ink-3); line-height: 0; border-bottom: 1px solid var(--line); padding-left: 0; width: 100%; font-variant-numeric: tabular-nums; }
.u-grid span:last-child { border-bottom-color: var(--line-2); }
.u-cols { grid-row: 1; grid-column: 2; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 2px; align-items: end; height: 100%; }
.u-cols.dense { gap: 1px; }
.u-col { height: 100%; display: flex; align-items: flex-end; cursor: default; border-radius: 4px 4px 0 0; }
.u-col:hover, .u-col:focus-visible { background: var(--accent-soft); }
.u-stack { width: 100%; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.u-stack i { display: block; min-height: 2px; }
.u-axis { grid-row: 2; grid-column: 2; position: relative; height: 22px; font-size: 11px; color: var(--ink-3); }
.u-axis span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
/* the last date ends at the chart's edge, never past it */
.u-axis span:last-child { left: auto !important; right: 0; transform: none; }
.u-tip { position: absolute; top: -8px; transform: translate(-50%, -100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--ink); white-space: nowrap; pointer-events: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .08); z-index: 2; }
.u-table { margin-top: 10px; font-size: 12.5px; }
.u-table summary { color: var(--ink-3); cursor: pointer; font-size: 12px; }
.u-table table, .u-who, .u-people { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.u-table th, .u-table td, .u-who th, .u-who td, .u-people th, .u-people td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.u-table th:first-child, .u-table td:first-child, .u-who th:first-child, .u-who td:first-child, .u-people th:first-child, .u-people td:first-child { text-align: left; padding-left: 0; }
.u-table th, .u-who th, .u-people th { font-weight: 500; color: var(--ink-2); font-size: 12px; }
.u-table table { max-width: 520px; margin-top: 8px; }
.u-scroll { overflow-x: auto; }
.u-people td:first-child .admin-hint { display: block; }
.u-people td:nth-child(7) { text-align: left; max-width: 240px; }
.u-people tr.flagged td:nth-child(7) { color: var(--danger); }
.u-people .pill { padding: 3px 12px; font-size: 12px; }
.admin code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.u-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 44px; }
.u-two > .section { min-width: 0; }
.u-two h3.group-label { margin-top: 18px; }
.u-two > div > h3.group-label:first-child { margin-top: 0; }
.u-bars { list-style: none; margin: 0 0 8px; padding: 0; }
.u-bars li { display: grid; grid-template-columns: minmax(0, 11em) minmax(40px, 1fr) auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 12.5px; }
.u-bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-bar { height: 8px; }
.u-bar i { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: 0 4px 4px 0; }
.u-bar-n { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

@media (max-width: 760px) {
  .u-two { grid-template-columns: minmax(0, 1fr); }
  .u-plot { grid-template-rows: 150px auto; grid-template-columns: 36px minmax(0, 1fr); }
  .u-tile-value { font-size: 20px; }
  .u-bars li { grid-template-columns: minmax(0, 9em) minmax(30px, 1fr) auto; }
}

/* The plan (plan.js): free beside paid, the paid card marked in ink. The
   cards share their rows, so each line sits opposite its counterpart; the
   terms and the button come after both. */
.plan-interval { margin: 0 0 18px; }
.plan-interval em { font-style: normal; color: var(--accent); margin-left: 4px; }
.plan-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin: 0 0 14px; }
.plan-card { display: grid; grid-row: span 7; grid-template-rows: subgrid; border: 1px solid var(--line); border-radius: var(--corner); padding: 20px 22px 18px; background: var(--surface); min-width: 0; }
.plan-card { position: relative; cursor: pointer; transition: border-color 300ms; }
.plan-card:hover { border-color: var(--line-2); }
.plan-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.plan-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-card h2 label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.plan-card h2 label::after { content: ""; position: absolute; inset: 0; border-radius: var(--corner); z-index: 1; }
.plan-card h2 input { margin: 0; accent-color: var(--accent); }
.plan-card h2 { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0 0 6px; letter-spacing: .02em; }
.plan-price { font-family: var(--serif); font-size: 30px; margin: 0 0 14px; color: var(--ink); }
.plan-per { font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.plan-card ul { display: grid; grid-row: span 5; grid-template-rows: subgrid; list-style: none; padding: 0; margin: 0; }
.plan-card li { position: relative; padding: 5px 0 5px 18px; font-size: 14px; color: var(--ink-2); }
.plan-card li small { display: block; font-size: 12.5px; color: var(--ink-2); opacity: .85; }
.plan-card li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.plan-card.paid li::before { background: var(--accent); }
.plan-form { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; border: 1px solid var(--line); border-radius: var(--corner); padding: 16px 22px; margin: 0 0 18px; }
.plan-form[hidden] { display: none; }
.plan-terms p:last-child { margin: 0; }
.plan-terms p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.plan-terms .adult-check { margin: 0; }
.plan-form .pill { flex: none; }
.plan-have { max-width: 560px; margin: 0 0 24px; }
@media (max-width: 640px) {
  .plan-cards { grid-template-columns: minmax(0, 1fr); }
  .plan-card + .plan-card { margin-top: 14px; }
  .plan-form { flex-direction: column; align-items: flex-start; }
}
.u-gift { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 6px; }
.u-gift input { flex: 1 1 200px; min-width: 0; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.u-gift select { border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }

/* Your path (path.js) and what the teacher leaves to carry (chat.js). */
.carry-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--seal); border-radius: var(--corner); padding: 16px 20px; }
.carry-card h2 { font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--ink-2); margin: 0 0 8px; }
.carry-card p, .turn.closing .carry-card p { margin: 0; font-family: var(--sans); font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.carry-card .carry-with, .turn.closing .carry-card .carry-with { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.carry-do { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.carry-do .let-go { margin: 0 0 0 auto; }
.carry-keep { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.carry-keep input { flex: none; margin: 3px 0 0; accent-color: var(--accent); }

/* Sit: the teacher asks after what was carried. */
.opening { display: flex; flex-direction: column; align-items: center; gap: 24px; width: min(100%, 560px); }
.opening[hidden] { display: none; }
.opening-says { font-family: var(--serif); font-size: clamp(21px, 3.2vw, 27px); line-height: 1.36; margin: 0; text-wrap: pretty; }
.opening .invite.other { color: var(--ink-3); }
.opening .carry-card { width: 100%; box-sizing: border-box; }
.closing-words { margin-bottom: 18px; }
.turn.closing .closing-words p + p { margin-top: .6em; }
.turn.closing .carry-card { margin-bottom: 22px; }

.page.path { width: min(100%, 920px); }
.page.path h2 { font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--ink-2); margin: 0 0 12px; }
.path-head { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px 34px; align-items: center; margin: 0 0 48px; }
.path-enso { width: 132px; height: 132px; }
.path-enso .rest { stroke: var(--line-2); }
.path-enso .done { stroke: var(--accent); }
.path-head h1 { margin: 0 0 6px; }
.path-where { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 56ch; }
.path-steps { grid-column: 1 / -1; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 14px 0 0; padding: 0; }
.path-steps li { position: relative; padding: 16px 12px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); border-top: 2px solid var(--line-2); }
.path-steps li::before { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ground); border: 2px solid var(--line-2); box-sizing: border-box; }
.path-steps small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.path-steps .past { border-top-color: var(--accent); }
.path-steps .past::before { background: var(--accent); border-color: var(--accent); }
.path-steps .now { color: var(--ink); font-weight: 500; }
.path-steps .now small { font-weight: 400; color: var(--ink-2); }
.path-steps .now::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.path-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.path-aside { display: grid; gap: 14px; }
.path-aside:empty { display: none; }
.path-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--corner); padding: 18px 20px; }
.path-noticed { list-style: none; margin: 0; padding: 0; }
.path-noticed li { font-family: var(--serif); font-size: 16px; line-height: 1.5; padding: 10px 0; border-top: 1px solid var(--line); }
.path-noticed li:first-child { border-top: 0; padding-top: 0; }
.path-noticed li:last-child { padding-bottom: 0; }
.path-day { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.path-day:first-child { border-top: 0; padding-top: 0; }
.path-day time { font-size: 13px; color: var(--ink-2); padding-top: 2px; }
.path-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.path-day li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 14.5px; line-height: 1.5; }
.path-day li svg { color: var(--accent); margin-top: 3px; }
.path-day li a { text-underline-offset: 3px; }
.path-day li small { display: block; font-size: 13px; color: var(--ink-2); }
.path-day li q { font-family: var(--serif); font-size: 15.5px; quotes: "“" "”"; }
.path-blank { color: var(--ink-2); font-size: 14.5px; margin: 0 0 8px; }
.path-blank a, .path-more a { color: var(--ink); text-underline-offset: 3px; }
.path-more { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.path-more a.has-new::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 4px; border-radius: 50%; background: var(--seal); vertical-align: middle; }
@media (max-width: 760px) {
  .path-head { grid-template-columns: 72px minmax(0, 1fr); gap: 16px 18px; align-items: start; }
  .path-enso { width: 72px; height: 72px; }
  .path-steps { grid-template-columns: minmax(0, 1fr); margin: 6px 0 0 5px; }
  .path-steps li { border-top: 0; border-left: 2px solid var(--line-2); padding: 0 0 16px 18px; }
  .path-steps li:last-child { padding-bottom: 0; }
  .path-steps li::before { top: 3px; left: -6px; }
  .path-steps .past { border-left-color: var(--accent); }
  .path-cols { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .path-aside { order: -1; }
  .path-day { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* Settings (settings.js): a list of rows, each opening its section alone. */
.set-list { border: 1px solid var(--line); border-radius: var(--corner); background: var(--surface); margin: 0 0 18px; overflow: hidden; }
.set-home h1 { margin-bottom: 26px; }
.set-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 18px; font-size: 15px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); transition: background 300ms; }
.set-list a:first-child { border-top: 0; }
.set-list a:hover { background: var(--accent-soft); }
.set-list a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.set-list svg { flex: none; color: var(--ink-3); }
.set-value { margin-left: auto; min-width: 0; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-back { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px -2px; padding: 4px 2px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.set-back:hover { color: var(--ink); }
.set-back[hidden], .set-home[hidden] { display: none; }
.set-form .section { display: none; border-top: 0; padding-top: 0; scroll-margin-top: 200px; } /* a link straight to a section still shows the way back */
.set-form .section.open { display: block; }
.set-form .section h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 4vw, 32px); line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 26px; }
