:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, "Noto Sans CJK JP", sans-serif;
  color: #23372b;
  background: #f4f6f1;
  --ink: #23372b;
  --muted: #55695d;
  --line: #d7e0d6;
  --forest: #2c4c37;
  --surface: #fff;
  --focus: #38754e;
  --disabled: #e8ece7;
  --disabled-ink: #526157;
  --radius: .7rem;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body, figure, h1, h2, p, fieldset, dl, dd { margin: 0; }
body { min-block-size: 100svh; display: flex; flex-direction: column; line-height: 1.55; }
button, input { font: inherit; color: inherit; }
button { appearance: none; cursor: pointer; background: var(--surface); border: 1px solid var(--line); }
button:disabled { cursor: default; opacity: 1; -webkit-text-fill-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button, label, input { touch-action: manipulation; }
button, input, fieldset, .deck > *, .field, .story, .account, .hero { min-inline-size: 0; }
fieldset { border: 0; padding: 0; }
h1, h2, p, label, button, dd, summary { overflow-wrap: anywhere; line-break: strict; }
.page { flex: none; width: min(100%, 71rem); margin: auto; padding: clamp(.4rem, 1.8svh, 1.25rem) 1.5rem; }
.account-card {
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
  border: 1px solid #d8e1d6;
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: 0 16px 50px #27392b0b;
}
.hero {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1rem, 3.6svh, 2rem);
  container-type: inline-size;
  padding: clamp(1.75rem, 3.6vw, 3rem);
  border-radius: 1.43rem 0 0 1.43rem;
  background: #e9efe3;
}
.wordmark { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.4rem; letter-spacing: -.055em; font-weight: 760; line-height: 1; }
.monogram { display: grid; place-items: center; width: 2.12rem; aspect-ratio: 1; border-radius: .62rem; background: #304a36; color: white; font: 750 1.62rem/1 Georgia, serif; }
.story { align-self: center; }
.eyebrow, .masthead { font-size: .66rem; font-weight: 720; letter-spacing: .13em; }
.eyebrow { color: #536a55; text-transform: uppercase; margin-block-end: 1rem; }
.story h2 { font-size: 2rem; font-size: clamp(1.45rem, 7.8cqi, 2.65rem); line-height: 1.5; letter-spacing: -.055em; }
.story h2 span { display: block; }
.story-note { margin-block-start: 1.1rem; font-size: .88rem; line-height: 1.9; color: #536653; }
.friends { align-self: end; width: 100%; }
.friends svg { display: block; width: 100%; height: auto; }
.smile { stroke: #2e382e; stroke-width: 2; stroke-linecap: round; fill: none; }
.eyes { transform: translate(var(--eye-x, 0px), var(--eye-y, 0px)); transition: transform .16s ease-out; }
.account { padding: 1.75rem clamp(1.35rem, 3.35vw, 3rem) .55rem; }
.masthead, .account-footer, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; flex-wrap: wrap; }
.masthead { color: var(--muted); }
.edition { font-size: .69rem; letter-spacing: .04em; border-radius: 1rem; padding: .18rem .65rem; background: #edf3e9; color: #436347; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; background: #f0f3ee; border: 1px solid #e1e7df; border-radius: .82rem; padding: .23rem; margin-block: .8rem 1rem; }
.tabs button { min-height: 2.75rem; border-radius: .57rem; background: #f0f3ee; border: 1px solid #f0f3ee; font-size: .84rem; font-weight: 700; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; border-color: #d7dfd5; color: #233c2a; box-shadow: 0 1px 3px #23372b0a; }
.tabs button:enabled:hover { border-color: #aabcae; }
.tabs button:disabled { background: #e8ece7; border-color: #e8ece7; color: var(--disabled-ink); box-shadow: none; }
.tabs button:disabled[aria-selected="true"] { background: #d9e1d9; border-color: #b7c5b8; color: #3d5042; }
.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.step { color: var(--muted); font-size: .68rem; line-height: 1.65; }
.step i { display: block; height: .23rem; margin-block-end: .3rem; border-radius: .3rem; background: #e3e8e0; }
.step.is-current { color: #33553d; font-weight: 730; }
.deck { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.deck > [data-views], .intro-lines > .feedback { grid-area: 1 / 1; }
.intro-lines:has(.feedback:not(:empty)) > [data-views] { visibility: hidden; }
[data-views][inert] { visibility: hidden; pointer-events: none; }
.auth-body, .footer-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-body > *, .footer-actions > button { grid-area: 1 / 1; min-inline-size: 0; }
.auth-body > form[inert], .footer-actions > button[inert] { visibility: hidden; }
#success-message { align-self: center; padding-block: 1rem; text-align: center; }
#redirect-notice[aria-hidden="true"] { visibility: hidden; opacity: 0; }
.titles { margin-block: 1rem .9rem; }
.titles h1, #success-title { font-size: clamp(1.42rem, 2.4vw, 1.9rem); letter-spacing: -.045em; line-height: 1.48; }
.intro-lines, #redirect-notice { margin-block-start: .22rem; }
.intro-lines p, #redirect-notice { font-size: .79rem; line-height: 1.65; color: var(--muted); }
.field, .field-group { display: grid; align-content: start; }
.field { gap: .28rem; }
.field-group { gap: .72rem; }
.field label { font-size: .78rem; font-weight: 690; line-height: 1.6; color: #3e5143; }
.field label small { margin-inline-start: .5rem; color: var(--muted); font-size: .7rem; font-weight: 420; }
input:not([type="checkbox"]) { width: 100%; border: 1px solid #829282; border-radius: var(--radius); background: #fcfdfa; font-size: 1rem; line-height: 1.4; padding: .6rem .78rem; min-height: 2.8rem; }
input::placeholder { color: #657366; opacity: 1; }
input[readonly], input:disabled { background: #f0f3ee; color: #4a5b4d; opacity: 1; -webkit-text-fill-color: currentColor; }
.email-field { margin-block-end: .72rem; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid #829282; border-radius: var(--radius); background: #fcfdfa; }
.password-field input { border: 0; border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px); min-height: 2.7rem; }
.password-field:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.password-field input:focus-visible { outline: 0; }
.reveal { border: 0; border-inline-start: 1px solid #e2e8de; border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; padding-inline: .8rem; min-width: 3.2rem; min-height: 2.75rem; background: #f0f4ec; color: #47624d; font-size: .74rem; font-weight: 650; }
.reveal:enabled:hover { background: #e5eddf; }
.receipt { border: 1px solid #dae5d6; border-radius: var(--radius); background: #f3f7ef; padding: .7rem .85rem; color: #42604a; }
.receipt strong { font-size: .79rem; }
.receipt p { font-size: .75rem; color: var(--muted); }
.verification { gap: .45rem; }
.field input.code { font-variant-numeric: tabular-nums; letter-spacing: .35em; }
.secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.secondary-actions button { font-variant-numeric: tabular-nums; border-radius: .45rem; padding-inline: .45rem; }
.quiet, .text-button { min-height: 2.75rem; padding: .3rem .2rem; font-size: .75rem; color: #46644e; background: #fff; border: 0; text-decoration: underline; text-underline-offset: .2em; }
.quiet:disabled { background: #f0f3ee; color: #566558; text-decoration: none; border-radius: .45rem; padding-inline: .45rem; }
.receipt p { margin-block-start: .45rem; }
.consent { margin-block: .6rem .5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 .55rem; border-block-start: 1px solid #e3e9e0; padding-block-start: .25rem; }
.consent label { display: inline-flex; align-items: center; gap: .52rem; min-height: 2.75rem; cursor: pointer; font-size: .79rem; }
.consent label:has(input:disabled) { cursor: default; }
input[type="checkbox"] { margin: 0; inline-size: 1.05rem; block-size: 1.05rem; flex: none; accent-color: var(--forest); }
.primary, .dialog-primary { border-radius: var(--radius); background: var(--forest); border: 1px solid var(--forest); color: #fff; font-size: .88rem; font-weight: 680; padding: .65rem .9rem; min-height: 2.9rem; width: 100%; }
.primary { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) 1.5rem; align-items: center; }
.action-label { grid-column: 2; }
.action-glyph { grid-column: 3; font-size: 1.2rem; line-height: 1; }
.primary:enabled:hover, .dialog-primary:enabled:hover { background: #355e42; }
.primary:disabled, .dialog-primary:disabled, .reveal:disabled, .text-button:disabled { background: var(--disabled); border-color: #c6d1c5; color: var(--disabled-ink); }
.intro-lines .feedback { color: #8d382c; }
.feedback[data-kind="notice"] { color: #3e6548; }
[aria-invalid="true"]:not(.password-field input) { outline: 2px solid #a54737; outline-offset: 1px; }
.password-field:has(input[aria-invalid="true"]) { border-color: #a54737; }
.account-footer { margin-block-start: .7rem; border-block-start: 1px solid #e0e7dd; color: var(--muted); font-size: .7rem; }
.account-footer button { font-size: .72rem; }
.footer-info { min-inline-size: 0; flex: 1 1 8rem; }
.demo-note { display: flex; align-items: center; gap: .35rem; color: #566757; font-size: .69rem; }
.status-dot { display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: #699272; flex: none; }
dialog { color: var(--ink); background: var(--surface); width: min(30rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 1.45rem; border: 1px solid #c4d0c1; border-radius: 1rem; overflow-y: auto; }
dialog::backdrop { background: #27352b73; }
.dialog-head { flex-wrap: nowrap; margin-block-end: .75rem; }
.dialog-head h2 { font-size: 1.25rem; line-height: 1.45; }
.close { flex: none; width: 2.75rem; height: 2.75rem; border-radius: .6rem; background: #f1f5ed; font-size: 1.4rem; line-height: 1; }
dialog p { font-size: .87rem; line-height: 1.8; margin-block: .75rem; }
.dialog-primary { margin-block-start: .8rem; }
dialog details { margin-block-start: 1rem; font-size: .8rem; }
details summary { cursor: pointer; padding-block: .4rem; }
.settings-hint, .settings-error { font-size: .75rem; }
.settings-error { color: #8d382c; }
[hidden] { display: none !important; }

@media (max-width: 51.99rem) {
  .page { max-width: 38rem; padding: .8rem .8rem 1rem; }
  .account-card { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 30%); grid-template-rows: auto auto; grid-template-areas: "brand art" "story art"; align-items: center; gap: .8rem 1rem; padding: 1.25rem 1.5rem; border-radius: 1.43rem 1.43rem 0 0; }
  .wordmark { grid-area: brand; font-size: 1.15rem; }
  .monogram { width: 1.72rem; font-size: 1.35rem; }
  .story { grid-area: story; }
  .story h2 { font-size: 1.3rem; }
  .friends { grid-area: art; align-self: end; }
  .eyebrow, .story-note { display: none; }
  .account { padding: 1.25rem 1.5rem .35rem; }
}
@media (max-width: 28rem) {
  .page { padding: .5rem .5rem .8rem; }
  .account-card { border-radius: 1.1rem; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 6.5rem); grid-template-areas: "brand art" "story story"; gap: .4rem .6rem; padding: .8rem 1.1rem .92rem; border-radius: 1.04rem 1.04rem 0 0; }
  .story h2 { font-size: 1.13rem; line-height: 1.5; }
  .account { padding: 1rem 1.1rem .25rem; }
  .tabs { margin-block: .6rem .8rem; }
  .titles { margin-block: 1rem .8rem; }
}
/* Use the available height without trapping scrolling on short or zoomed screens. */
@media (max-height: 48rem) {
  .page { padding-block: .45rem; }
  .account { padding-block: .8rem .22rem; }
  .tabs { margin-block: .42rem .55rem; }
  .titles { margin-block: .7rem .58rem; }
  .titles h1, #success-title { font-size: clamp(1.4rem, 2.1vw, 1.7rem); line-height: 1.32; }
  .field-group { gap: .5rem; }
  .email-field { margin-block-end: .5rem; }
  .consent { margin-block: .25rem; padding-block-start: .12rem; }
  .account-footer { margin-block-start: .35rem; }
}
@media (min-width: 52rem) and (max-height: 48rem) {
  .hero { padding-block: 1.5rem; row-gap: 1rem; }
  .friends { max-width: min(100%, 63svh); justify-self: center; }
  .eyebrow { margin-block-end: .6rem; }
  .story-note { margin-block-start: .6rem; }
}
@media (max-width: 51.99rem) and (max-height: 53rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 24%);
    grid-template-areas: "brand art" "story art";
    gap: .3rem .6rem;
    padding-block: .65rem;
  }
  .hero .monogram { width: 1.5rem; }
  .story h2 { font-size: clamp(1rem, 3.6vw, 1.23rem); line-height: 1.4; }
}
/* At phone/laptop heights the labels share their input row. */
@media (max-height: 43.75rem) {
  .page { padding-block: .3rem; }
  .account { padding-block: .55rem .16rem; }
  #account-panel .field { grid-template-columns: minmax(0, 6.3rem) minmax(0, 1fr); align-items: center; gap: .5rem; }
  #account-panel .field label { line-height: 1.45; }
  #account-panel .field label small { display: block; margin: 0; }
  .field-group, .verification { gap: .4rem; }
  .email-field { margin-block-end: .4rem; }
}
@media (max-width: 51.99rem) and (max-height: 38rem) {
  .account-header { display: grid; grid-template-columns: minmax(0, 4.55rem) minmax(0, 1fr); gap: .35rem .5rem; align-items: center; }
  .masthead { display: grid; justify-items: start; gap: .1rem; font-size: .57rem; letter-spacing: .06em; }
  .tabs { margin: 0; }
  .tabs button { padding-inline: .17rem; }
  .progress { grid-column: 1 / -1; }
  .hero { padding-block: .45rem; gap: .2rem .5rem; }
  .titles { margin-block: .4rem; }
  .consent { margin-block: 0; padding-block-start: 0; }
  .account-footer { margin-block-start: .15rem; }
}

/* A landscape phone has useful horizontal space even when its height is small. */
@media (min-width: 40rem) and (max-height: 30rem) {
  .page { width: min(100%, 68rem); max-width: none; padding: .3rem .6rem; }
  .account-card { grid-template-columns: minmax(0, .55fr) minmax(0, 1.45fr); }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "brand" "story" "art";
    padding: .9rem; gap: .55rem; border-radius: 1.43rem 0 0 1.43rem;
  }
  .wordmark { grid-area: brand; font-size: 1.05rem; }
  .hero .monogram { width: 1.55rem; }
  .story { grid-area: story; }
  .story h2 { font-size: clamp(1rem, 8cqi, 1.4rem); line-height: 1.4; }
  .friends { grid-area: art; }
  .eyebrow, .story-note { display: none; }
  .account { padding: .4rem 1rem .15rem; }
  .account-header {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "meta tabs" "steps tabs"; align-items: center; gap: .2rem .7rem;
  }
  .masthead { grid-area: meta; display: flex; justify-content: space-between; }
  .tabs { grid-area: tabs; margin: 0; }
  .progress { grid-area: steps; }
  .titles { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: .6rem; margin-block: .4rem; }
  .intro-lines { margin: 0; }
  .titles h1, #success-title { font-size: 1.35rem; }
  .field-group { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; column-gap: .65rem; }
  #account-panel .field-group .field { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  #account-panel .verification .field label small { display: inline; margin-inline-start: .3rem; }
  #account-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(7.5rem, 1fr); align-items: center; gap: .3rem .65rem; }
  #account-panel { grid-column: 1 / -1; }
  .consent { margin: 0; border: 0; padding: 0; }
  .account-footer { margin-block-start: .2rem; }
}

@keyframes copy-in {
  from { opacity: 0; transform: translateY(.24rem); }
  to { opacity: 1; transform: none; }
}
@keyframes panel-in {
  from { transform: translateY(.22rem); }
  to { transform: none; }
}
.step i::before {
  content: "";
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #739779;
  transform: scaleX(0);
  transform-origin: left;
}
.step.is-current i::before, .step.is-done i::before { transform: scaleX(1); }
@media (prefers-reduced-motion: no-preference) {
  .headings > :not([inert]), .intro-lines > [data-views]:not([inert]), #success-message:not([hidden]) {
    animation: copy-in 180ms cubic-bezier(.2,.7,.2,1);
  }
  .confirm-field:not([inert]), .verification:not([inert]), dialog[open] {
    animation: panel-in 190ms cubic-bezier(.2,.75,.25,1);
  }
  .tabs button, .primary { transition: background-color 155ms ease-out, border-color 155ms ease-out, color 155ms ease-out; }
  .step i::before { transition: transform 220ms cubic-bezier(.2,.75,.25,1); }
  #redirect-notice { transition: opacity 140ms ease-out, visibility 140ms; }
}
@media (prefers-reduced-motion: reduce) {
  .eyes { transition: none; transform: none; }
}
@media (forced-colors: active) {
  .step i { border: 1px solid GrayText; }
  .step.is-current i, .step.is-done i { border-color: Highlight; }
  .tabs [aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -3px; }
}
