/* Betsy console. Same family as the brand sheet: Fraunces set soft for display and for Betsy's own words,
   Figtree for reading. Butter is Betsy's voice, Poppy is the one main button, Cream is the page, Ink is the text,
   Paper is a card. Nothing has a hard corner: pills for anything you press, bubbles for what Betsy says,
   big soft cards for the rest. No pictures. */

:root {
  color-scheme: light;
  --cream: #FBF6EA;
  --paper: #FFFDF8;
  --ink: #2A1E17;
  --soft: #65554A;
  --poppy: #D2351C;
  --butter: #FFE97F;
  --mint: #BFE6D3;
  --periwinkle: #C8D2FF;
  --peach: #FFCB94;
  --edge: #9A8C7A;
  --hair: #E8DEC9;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* type */
.dis, .mark, .big {
  font-family: var(--serif);
  font-weight: 330;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 0;
  letter-spacing: -.016em;
  line-height: 1.03;
}
.dis i, .mark, .it {
  font-style: italic;
  font-weight: 340;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  letter-spacing: -.012em;
}
h1.dis { font-size: clamp(40px, 10.5vw, 60px); }
h2.dis { font-size: 30px; line-height: 1.08; }
h3.dis { font-size: 24px; line-height: 1.12; }
.lead { font-size: 20px; line-height: 1.35; color: var(--soft); }
.lab { font-weight: 600; font-size: 17px; line-height: 1.3; }
.meta { font-size: 17px; line-height: 1.35; color: var(--soft); }
.small { font-size: 16px; line-height: 1.36; color: var(--soft); }
.name { font-family: var(--serif); font-weight: 380; font-size: 25px; line-height: 1.1; font-variation-settings: 'opsz' 36, 'SOFT' 100, 'WONK' 0; }

/* page */
.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(56px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
main { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 18px; }

.top { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.mark { font-size: 40px; text-decoration: none; align-self: flex-start; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 52px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--hair);
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;
  text-decoration: none;
}
.nav a[aria-current='page'] { background: var(--ink); color: var(--cream); box-shadow: none; }
.count {
  position: absolute;
  top: -7px;
  right: 2px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--butter);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--cream);
  font-size: 15px;
  font-weight: 700;
}
.rest {
  padding: 16px 22px;
  border-radius: 26px;
  background: var(--ink);
  color: var(--cream);
  font-size: 18px;
  line-height: 1.35;
}
.rest a { color: var(--butter); font-weight: 600; }

/* cards */
.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 30px 32px;
  border-radius: 30px;
  background: var(--paper);
}
.card.plain { background: transparent; padding: 4px 10px; }
.card.butter { background: var(--butter); }
.pagetitle { padding: 8px 8px 0; }
.pagehead { display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 0; }

/* what you press */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  background: var(--poppy);
  color: #FFF9EC;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn.w { background: var(--cream); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--edge); }
.btn.ink { background: var(--ink); color: var(--cream); }
.btn.butter { background: var(--butter); color: var(--ink); }
.btn.block { width: 100%; }
.btn.xl { min-height: 68px; font-size: 22px; }
.btn.slim { min-height: 48px; padding: 0 22px; font-size: 17px; }
.btn[disabled] { opacity: .7; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions form { display: contents; }
.actions .btn { flex: 1 1 200px; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 2px 14px 3px;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1.5px var(--hair);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}
.chip.butter { background: var(--butter); box-shadow: none; }
.chip.mint { background: var(--mint); box-shadow: none; }
.chip.periwinkle { background: var(--periwinkle); box-shadow: none; }
.chip.peach { background: var(--peach); box-shadow: none; }
.chip.ink { background: var(--ink); color: var(--cream); box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* messages */
.note { padding: 16px 22px; border-radius: 24px; background: var(--butter); color: var(--ink); font-size: 18px; line-height: 1.35; }
.note.alert { background: var(--peach); }
.note a { font-weight: 600; }

/* forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.hint { font-size: 16px; line-height: 1.35; color: var(--soft); }
input[type='text'], input[type='tel'], input[type='password'], textarea {
  width: 100%;
  min-height: 62px;
  padding: 0 24px;
  border: 1.5px solid var(--edge);
  border-radius: 999px;
  background: var(--cream);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 132px; padding: 16px 22px; border-radius: 26px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #7A6B5D; opacity: 1; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.choice { display: flex; flex-direction: column; gap: 8px; border: 0; min-width: 0; }
.choice legend { padding: 0 0 8px; }
.choice label { position: relative; display: block; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 8px 24px;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1.5px var(--edge);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
}
.choice span::before {
  content: '';
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px currentColor;
}
.choice input:checked + span { background: var(--ink); color: var(--cream); box-shadow: none; }
.choice input:checked + span::before { background: radial-gradient(circle, var(--butter) 0 38%, transparent 42%); }
.choice input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 26px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1.5px var(--edge);
  cursor: pointer;
}
.check input {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.check input::after {
  content: '';
  width: 9px;
  height: 17px;
  margin-top: -3px;
  border: solid var(--cream);
  border-width: 0 4px 4px 0;
  border-radius: 2px;
  transform: rotate(45deg);
  opacity: 0;
}
.check input:checked { background: var(--ink); }
.check input:checked::after { opacity: 1; }
.check span { font-weight: 600; font-size: 20px; line-height: 1.3; padding-top: 2px; }

/* the call box: Margaret hides what only matters for themselves, and shows her card */
.callbox:has(input[value='margaret']:checked) .only-self { display: none; }
.brief { display: none; }
.brief.show, .callbox:has(input[value='margaret']:checked) ~ .brief { display: flex; }
.opening, .bubble {
  padding: .6em 1em .68em;
  border-radius: 1.25em;
  font-size: 19px;
  line-height: 1.38;
}
.opening, .betsy .bubble {
  background: var(--butter);
  border-bottom-left-radius: .45em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  font-variation-settings: 'opsz' 36, 'SOFT' 100, 'WONK' 1;
}
.opening { display: block; align-self: flex-start; max-width: 100%; }
.give .number { font-size: clamp(36px, 10vw, 52px); }

/* the call once it's ringing */
.live { gap: 10px; }
.live .big { font-size: clamp(46px, 13vw, 76px); }
.live .timer { font-size: clamp(36px, 10vw, 56px); font-variant-numeric: tabular-nums; }
.live[data-stage='calling'] [data-live='words'] { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .live [data-live='words'] { animation: none !important; } }

/* lists */
.rows { display: flex; flex-direction: column; gap: 12px; }
a.row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border-radius: 28px;
  background: var(--paper);
  text-decoration: none;
}
a.row:active { background: #FFF6DD; }
.card a.row { background: var(--cream); }
.card a.row:active { background: #F6EED9; }
.r1 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.more { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.lab + .facts, .lab + .plainlist { margin-top: 8px; }
.small a, .meta a { display: inline-block; padding: 10px 2px; }
.faded-top { padding-top: 18px; border-top: 1.5px solid var(--hair); }
.facts li, .plainlist li { padding: 10px 0; border-top: 1.5px solid var(--hair); }
.facts li:first-child, .plainlist li:first-child { border-top: 0; padding-top: 0; }
.facts li:last-child, .plainlist li:last-child { padding-bottom: 0; }
.faded { color: var(--soft); }

details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 19px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '+'; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--cream); font-size: 22px; line-height: 1; }
details[open] > summary::after { content: '–'; }
details > :not(summary) { margin-top: 12px; }
details + details { padding-top: 8px; border-top: 1.5px solid var(--hair); }
.cardbody { white-space: pre-wrap; font-size: 17px; line-height: 1.45; color: var(--soft); }

/* a conversation: Betsy in butter bubbles, italic; them in mint, roman */
.chat { display: flex; flex-direction: column; gap: 12px; }
.turn { display: flex; flex-direction: column; gap: 4px; max-width: 92%; }
.turn.betsy { align-self: flex-start; }
.turn.them { align-self: flex-end; align-items: flex-end; }
.them .bubble, .bubble.them { background: var(--mint); border-bottom-right-radius: .45em; }
.turn .meta { padding: 0 10px; font-size: 16px; }
.turn:target .bubble { box-shadow: 0 0 0 3px var(--ink); }

.player audio { display: block; width: 100%; height: 56px; border-radius: 999px; }
audio::-webkit-media-controls-enclosure { border-radius: 999px; background-color: var(--cream); }
audio::-webkit-media-controls-panel { background-color: var(--cream); }
.player .problem { margin-top: 10px; }

.timing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; font-size: 16px; line-height: 1.35; color: var(--soft); }
.timing div { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); gap: 4px 14px; }
.timing div > :last-child { text-align: right; }
.timing b { font-weight: 600; color: var(--ink); }

.flag .r1 { align-items: flex-start; }
.sms {
  padding: 22px 26px 26px;
  border-radius: 30px 30px 8px 30px;
  background: var(--butter);
  font-size: 22px;
  line-height: 1.3;
}
.sms small { display: block; margin-bottom: 6px; font-size: 16px; font-weight: 600; }

/* switches */
.switch .state { font-size: 34px; }
.rest-card .state { font-size: clamp(40px, 11vw, 60px); }
.rest-card.resting { background: var(--ink); color: var(--cream); }
.rest-card.resting .meta { color: #E9DFCB; }
.pick { display: flex; flex-direction: column; gap: 10px; }
.pick label { position: relative; display: block; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pick .opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 22px;
  border-radius: 26px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1.5px var(--edge);
}
.pick .opt b { font-weight: 600; font-size: 19px; }
.said { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.38; font-variation-settings: 'opsz' 36, 'SOFT' 100, 'WONK' 1; }
.pick input:checked + .opt { background: var(--ink); color: var(--cream); box-shadow: none; }
.pick input:checked + .opt .meta, .pick input:checked + .opt .said { color: var(--cream); }
.pick input:focus-visible + .opt { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (max-width: 760px) {
  .card { padding: 22px 20px; border-radius: 26px; }
  .card.plain { padding: 4px 8px; }
}
@media (min-width: 761px) {
  body { font-size: 20px; }
  .wrap { padding-top: 28px; gap: 22px; }
  main { gap: 22px; }
  .nav a { min-height: 56px; }
}
