
  :root {
    color-scheme: light;
    --ground: #dde5dc;
    --ground-2: #cfd9cd;
    --bone: #f7f4ee;
    --bone-2: #eee9df;
    --forest: #1b2820;
    --surface: #24352b;
    --ink: #1b2820;
    --mute: #56645a;
    --terra: #e0a98f;
    --terra-ink: #9e4c2d;
    --red: #c4573c;
    --line: rgba(27, 40, 32, 0.13);
    --top-h: 68px;
    --msg: clamp(28px, 1.9vw + 10px, 44px);
    --hero: clamp(40px, 4.2vw + 10px, 76px);
    --gut-l: max(16px, env(safe-area-inset-left, 0px));
    --gut-r: max(16px, env(safe-area-inset-right, 0px));
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
  }
  html { background: var(--ground); }
  body {
    margin: 0; background: var(--ground); color: var(--ink);
    font-family: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }
  *, *::before, *::after { box-sizing: border-box; }

  /* Header: the chat header of the page itself */
  .top {
    position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--top-h);
    padding: env(safe-area-inset-top, 0px) var(--gut-r) 0 var(--gut-l);
    display: flex; align-items: center; background: var(--ground);
  }
  .top-in { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
  .mark { display: inline-flex; align-items: center; gap: 9px; color: var(--forest); text-decoration: none; }
  .mark svg { width: 38px; height: 26px; }
  .mark b { font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 900; font-size: 25px; letter-spacing: -0.02em; line-height: 1; }
  .status { margin-left: 4px; font-family: "Zen Kaku Gothic New", system-ui, sans-serif; font-size: 14px; color: var(--mute); display: inline-flex; align-items: center; gap: 7px; }
  .status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4f8a64; }
  .status.typing { color: var(--terra-ink); }
  .status.typing::before { background: var(--terra); }

  /* Thread */
  .stage { position: relative; padding: calc(var(--top-h) + 20px) 0 160px; }
  .thread { padding: 0 var(--gut-r) 0 var(--gut-l); }
  .thread > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
  .day { display: flex; justify-content: center; font-family: "Zen Kaku Gothic New", sans-serif; font-size: 13px; color: var(--mute); padding-bottom: 6px; }
  .day span { background: rgba(247, 244, 238, 0.6); border-radius: 99px; padding: 5px 12px; }

  .row { display: flex; align-items: flex-end; gap: 16px; margin-top: 12px; }
  .row.lead { margin-top: 40px; }
  .row.v { justify-content: flex-end; }
  .av {
    flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--forest); color: var(--bone);
    display: grid; place-items: center; visibility: hidden;
  }
  .av svg { width: 30px; height: 20px; }
  .row.lead > .av { visibility: visible; }
  .slot { position: relative; min-width: 0; max-width: calc(84% - 68px); display: flex; flex-direction: column; align-items: flex-start; }
  .bub {
    margin: 0; font-size: var(--msg); line-height: 1.24; letter-spacing: -0.012em; font-weight: 400;
    padding: 0.5em 0.78em 0.56em; border-radius: 0.72em 0.72em 0.72em 0.2em;
    background: var(--bone); color: var(--ink); overflow-wrap: break-word;
    box-shadow: 0 1px 0 rgba(27, 40, 32, 0.06);
    transform-origin: 0% 100%;
  }
  .bub b { font-weight: 700; }
  .row.v .bub {
    max-width: min(62%, 720px); background: var(--forest); color: var(--bone); font-weight: 700;
    border-radius: 0.72em 0.72em 0.2em 0.72em; transform-origin: 100% 100%;
  }
  .bub cite { display: block; margin-top: 0.7em; font-family: "Zen Kaku Gothic New", sans-serif; font-style: normal; font-size: 14px; letter-spacing: 0; color: var(--mute); }

  /* Hero: the single Kaisei Tokumin line */
  .hero .slot { max-width: calc(92% - 68px); }
  .hero .bub { font-family: "Kaisei Tokumin", serif; font-weight: 700; font-size: var(--hero); line-height: 1.12; letter-spacing: -0.02em; padding: 0.42em 0.6em 0.5em; }
  .dream { display: grid; margin-top: 0.32em; color: var(--terra-ink); }
  .dream > span { grid-area: 1 / 1; }
  .dream > span:not(.on) { visibility: hidden; }
  .dream > span u { text-decoration: none; background: linear-gradient(transparent 68%, rgba(224, 169, 143, 0.5) 68%); }

  /* Typing dots */
  .typing {
    position: absolute; left: 0; top: 0; display: none; gap: 9px; align-items: center;
    padding: 24px 28px; border-radius: 30px 30px 30px 9px; background: var(--bone);
  }
  .typing i { width: 12px; height: 12px; border-radius: 50%; background: #8d998f; animation: dot 1.1s infinite ease-in-out; }
  .typing i:nth-child(2) { animation-delay: 0.15s; }
  .typing i:nth-child(3) { animation-delay: 0.3s; }
  @keyframes dot { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-4px); } }

  /* Attachments */
  .att-row .slot { flex: 0 1 660px; max-width: calc(100% - 68px); }
  .att {
    width: 100%; background: var(--bone); border-radius: 26px 26px 26px 8px; padding: 24px;
    font-family: "Zen Kaku Gothic New", sans-serif; font-size: 16px; line-height: 1.4; color: var(--ink);
    box-shadow: 0 1px 0 rgba(27, 40, 32, 0.06);
  }
  .src { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 6px; align-items: baseline; }
  .src .num { font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 900; font-size: 38px; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
  .src p { margin: 0; font-size: 16px; }
  .src cite { grid-column: 1 / -1; font-style: normal; font-size: 13px; color: var(--mute); }

  /* A1 goal */
  .g-from { position: relative; display: inline-block; font-family: "Zen Kaku Gothic New", sans-serif; font-size: 26px; font-weight: 700; color: var(--mute); }
  .g-from .strike { position: absolute; left: -4px; right: -4px; top: 54%; height: 3px; background: var(--red); border-radius: 2px; transform-origin: 0 50%; }
  .g-arrow { display: block; width: 22px; height: 30px; margin: 8px 0 6px 4px; color: var(--mute); }
  .g-to { font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 900; font-size: clamp(28px, 2.4vw + 6px, 40px); line-height: 1.12; letter-spacing: -0.025em; clip-path: inset(0% 0% 0% 0%); }
  .g-to .by { background: linear-gradient(transparent 62%, rgba(224, 169, 143, 0.6) 62%) no-repeat 0 0 / 100% 100%; }

  /* A2 calendar */
  .cal-goal { font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 700; font-size: 20px; }
  .cal-goal b { font-weight: 900; }
  .months { margin-top: 16px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
  .m { height: 46px; border-radius: 8px; background: var(--bone-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--mute); transform-origin: 50% 100%; }
  .m.now { background: var(--forest); color: var(--bone); }
  .phases { margin-top: 6px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; font-size: 13px; color: var(--mute); }
  .phases span { border-top: 2px solid rgba(27, 40, 32, 0.22); padding-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .zoom { display: block; width: 100%; height: 22px; margin: 6px 0 4px; transform-origin: 50% 0; }
  .zoom polygon { fill: rgba(27, 40, 32, 0.08); }
  .lbl { font-size: 13px; font-weight: 700; color: var(--mute); margin-bottom: 6px; }
  .weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .w { border-radius: 8px; background: var(--bone-2); padding: 9px 10px; font-size: 14px; line-height: 1.25; min-height: 56px; }
  .w small { display: block; font-size: 12px; color: var(--mute); margin-bottom: 2px; }
  .w.now { background: var(--forest); color: var(--bone); }
  .w.now small { color: var(--terra); }
  .today { border-radius: 12px; background: var(--forest); color: var(--bone); padding: 14px 16px; font-size: 17px; display: flex; gap: 12px; align-items: baseline; }
  .today b { color: var(--terra); flex: none; }
  .today span { margin-left: auto; flex: none; font-weight: 700; }
  .cal cite { display: block; margin-top: 14px; font-style: normal; font-size: 13px; color: var(--mute); }

  /* A3 if-then */
  .wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .d { position: relative; border-radius: 10px; background: var(--bone-2); height: 74px; padding: 8px; font-size: 13px; font-weight: 700; color: var(--mute); display: flex; flex-direction: column; justify-content: space-between; }
  .d svg { width: 20px; height: 20px; color: var(--forest); }
  .d.bad { background: var(--red); color: var(--bone); }
  .d .fix { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--bone); }
  .d .fix svg { color: var(--bone); width: 16px; height: 16px; }
  .note { margin-top: 8px; font-size: 14px; color: var(--red); font-weight: 700; }
  .rule { margin-top: 14px; border-radius: 16px; background: var(--forest); color: var(--bone); padding: 18px 20px; transform-origin: 36% 0; }
  .rule p { margin: 0; font-family: "Zen Kaku Gothic New", sans-serif; font-size: clamp(22px, 1.4vw + 8px, 30px); line-height: 1.2; letter-spacing: -0.015em; }
  .rule .if { color: var(--terra); font-weight: 700; }
  .rule small { display: block; margin-top: 10px; font-size: 14px; color: #b9c2b5; }

  /* A5 testimonials: forwarded cards */
  .att-row.wide .slot { flex: 1 1 auto; max-width: calc(100% - 68px); }
  .att.tst { background: none; box-shadow: none; padding: 0; border-radius: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .tcard { margin: 0; background: var(--bone); border-radius: 22px 22px 22px 8px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 0 rgba(27, 40, 32, 0.06); }
  .t-head { display: flex; align-items: center; gap: 12px; }
  .t-av { width: 52px; height: 50px; flex: none; overflow: visible; }
  .t-av text { font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 900; font-size: 20px; }
  .t-who { display: grid; line-height: 1.2; }
  .t-who b { font-size: 17px; font-weight: 700; }
  .t-who span { font-size: 13px; color: var(--mute); }
  .t-fwd { width: 18px; height: 18px; margin-left: auto; align-self: flex-start; color: var(--mute); }
  .stars { display: inline-flex; gap: 3px; }
  .stars svg { width: 17px; height: 17px; fill: var(--terra); }
  .tcard blockquote { margin: 0; font-size: 16px; line-height: 1.42; color: var(--ink); flex: 1; }
  .t-tag { font-size: 12px; color: var(--mute); }
  @media (max-width: 860px) {
    .att.tst { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  }

  /* A4 progress */
  .ci { display: grid; gap: 6px; }
  .ci-t { font-size: 13px; color: var(--mute); }
  .ci p { margin: 0; padding: 9px 13px; border-radius: 14px; font-size: 16px; max-width: 86%; }
  .ci-q { background: var(--bone-2); justify-self: start; border-bottom-left-radius: 4px; }
  .ci-a { background: var(--forest); color: var(--bone); justify-self: end; border-bottom-right-radius: 4px; font-weight: 700; }
  .chart { display: block; width: 100%; height: auto; margin-top: 14px; overflow: visible; }
  .chart .base { stroke: rgba(27, 40, 32, 0.18); stroke-width: 1; }
  .chart .goal-l { stroke: rgba(27, 40, 32, 0.25); stroke-width: 1; stroke-dasharray: 3 5; }
  .chart .line { fill: none; stroke: var(--forest); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
  .chart .dot { fill: var(--forest); }
  .chart .dot.miss { fill: var(--bone); stroke: var(--red); stroke-width: 2; }
  .chart .flag rect { fill: var(--terra); }
  .chart .flag line { stroke: var(--forest); stroke-width: 2; }
  .chart text { font-family: "Zen Kaku Gothic New", sans-serif; font-size: 13px; fill: var(--mute); }
  .chart .flag text { fill: var(--ink); font-weight: 700; font-size: 14px; }

  /* Composer: the page's own input, sticky from the start */
  .composer {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    padding: 26px var(--gut-r) calc(18px + env(safe-area-inset-bottom, 0px)) var(--gut-l);
    background: linear-gradient(to top, var(--ground) 72%, rgba(221, 229, 220, 0));
  }
  .pill {
    position: relative; max-width: 1180px; margin: 0 auto; display: flex; align-items: center;
    height: 66px; border-radius: 33px; background: var(--forest); color: var(--bone);
    transition: box-shadow 500ms var(--ease), transform 500ms var(--ease);
  }
  .composer.live .pill { box-shadow: 0 0 0 4px var(--terra), 0 22px 50px rgba(27, 40, 32, 0.28); transform: translateY(-4px); }
  .pill input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--bone);
    font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.01em;
    padding: 0 18px 0 28px; border-radius: 33px;
  }
  .pill:focus-within { box-shadow: 0 0 0 4px var(--terra); }
  .ph {
    position: absolute; left: 28px; right: 80px; top: 50%; transform: translateY(-50%); pointer-events: none;
    font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.01em;
    color: rgba(239, 234, 224, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ph .lead-in { color: rgba(239, 234, 224, 0.82); }
  .ph .caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--terra); animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  .oly { color: #0a6fb5; }
  /* the hero types itself in: hidden letters keep their width, so nothing reflows */
  .typing-in .ch { visibility: hidden; }
  .typing-in .ch.on { visibility: visible; }
  .ch.cur { position: relative; }
  .ch.cur::after { content: ""; position: absolute; left: 100%; top: 0.1em; bottom: 0.12em; width: 0.07em; margin-left: 0.04em; background: var(--terra); visibility: visible; animation: blink 0.9s steps(1) infinite; }
  .typing-in .dream u { background: none; }
  .typing-in .dream u .ch.on { background: linear-gradient(transparent 68%, rgba(224, 169, 143, 0.5) 68%); }
  .composer.has-text .ph, .composer.focus.empty .ph .caret { display: none; }
  .send {
    flex: none; width: 50px; height: 50px; margin-right: 8px; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--terra); color: #3a1f14; display: grid; place-items: center;
    transform: scale(0); opacity: 0; transition: transform 300ms var(--ease), opacity 200ms;
  }
  .send svg { width: 22px; height: 22px; }
  .composer.has-text .send { transform: none; opacity: 1; }
  .send:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }

  .track { display: none; }

  /* Scroll-played conversation (motion only) */
  @media (prefers-reduced-motion: no-preference) {
    html:not(.static) .stage { position: fixed; inset: 0; padding: 0; overflow: hidden;
      -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--top-h) - 4px), #000 calc(var(--top-h) + 56px));
              mask-image: linear-gradient(to bottom, transparent calc(var(--top-h) - 4px), #000 calc(var(--top-h) + 56px)); }
    html:not(.static) .thread { position: absolute; left: 0; right: 0; top: 0; padding-top: calc(var(--top-h) + 20px); will-change: transform; }
    html:not(.static) .later .bub,
    html:not(.static) .later .att,
    html:not(.static) .later > .av { opacity: 0; }
    html:not(.static) .typing { display: inline-flex; opacity: 0; }
    html:not(.static) .track { display: block; height: 1400vh; }
  }
  @media (prefers-reduced-motion: reduce) {
    .typing i, .ph .caret { animation: none; }
    .pill, .send { transition: none; }
  }

  @media (max-width: 640px) {
    :root { --top-h: 58px; --msg: 22px; --hero: 37px; }
    .mark b { font-size: 22px; }
    .mark svg { width: 32px; height: 22px; }
    .row { gap: 0; margin-top: 8px; }
    .row.lead { margin-top: 24px; }
    .row > .av { display: none; }
    .slot, .hero .slot, .att-row .slot, .att-row.wide .slot { max-width: 100%; flex: 1 1 auto; }
    .row.v .bub { max-width: 84%; }
    .bub cite { font-size: 13px; }
    .typing { padding: 16px 20px; border-radius: 22px 22px 22px 7px; }
    .typing i { width: 9px; height: 9px; }
    .att { padding: 16px; border-radius: 20px 20px 20px 6px; }
    .g-from { font-size: 20px; }
    .src { column-gap: 12px; }
    .src .num { font-size: 30px; }
    .src p { font-size: 14.5px; }
    .m { height: 38px; font-size: 11.5px; border-radius: 6px; }
    .phases { font-size: 11px; }
    .w { font-size: 12px; padding: 7px 7px; min-height: 64px; border-radius: 6px; }
    .w small { font-size: 11px; }
    .today { font-size: 15px; padding: 12px; flex-wrap: wrap; row-gap: 2px; }
    .d { height: 58px; padding: 6px; font-size: 11.5px; border-radius: 7px; }
    .d svg { width: 16px; height: 16px; }
    .d .fix { font-size: 10.5px; }
    .rule { padding: 14px 16px; }
    .ci p { font-size: 15px; }
    .tcard { padding: 12px 14px; gap: 6px; border-radius: 18px 18px 18px 6px; }
    .t-head { gap: 10px; }
    .t-av { width: 40px; height: 38px; }
    .t-who b { font-size: 15px; }
    .stars svg { width: 14px; height: 14px; }
    .tcard blockquote { font-size: 14.5px; line-height: 1.36; }
    .chart text { font-size: 22px; }
    .chart .flag text { font-size: 22px; }
    .composer { padding-top: 22px; }
    .pill { height: 58px; border-radius: 29px; }
    .pill input, .ph { font-size: 18px; }
    .pill input { padding-left: 20px; }
    .ph { left: 20px; right: 64px; }
    .send { width: 44px; height: 44px; margin-right: 7px; }
  }

/* A short introduction precedes the preserved customer accounts. */
.testimonial-intro { margin: 0 0 18px; }
.testimonial-intro h2 { margin: 4px 0 0; font: 900 clamp(32px, 4vw, 56px)/1.05 sans-serif; }
.intro-stars { color: #e0a98f; letter-spacing: .14em; font-size: 22px; }
.att.tst > .testimonial-intro { grid-column: 1 / -1; }
.testimonial-result { font-weight: 900; margin: 8px 0; }
.composer.focus .ph .caret { display: none; }
