/* Layout: the marketing page IS the app. A slim top bar carries the invite CTA over a live chato
   window (sidebar + channel pane). Phones get the app's own list/detail flow and floating tab bar.
   Tokens mirror app/lib/core/theme/tokens.dart (the "D" look, KD-24). */
:root {
  --page: #F4F6F9;
  --canvas: #FFFFFF;
  --subtle: #F4F6F9;
  --elevated: #EEF1F6;
  --line: #E2E5EE;
  --line-strong: #CFD4E2;
  --ink: #232730;
  --ink-2: #566078;
  --ink-3: #636B83;
  --lime: #C8FF00;
  --on-lime: #232730;
  /* Logo (Gabriel, 30 Oct 2026): the cat with the word is as drawn on light and
     a cat in the text colour with slate eyes on dark; the cat alone is always
     the slate cat as drawn, in a lime circle on dark. */
  --brand-cat: #141720;
  --brand-cat-eye: #FFFFFF;
  --brand-solo-bg: transparent;
  --brand-solo-pad: 0px;
  /* Round only where the lime badge is: iPhone browsers clip the cat to
     the corner even when nothing shows, cutting its ear tips (S61). */
  --brand-solo-radius: 0;
  --lime-border: #96C400;
  --lime-bg: rgba(200, 255, 0, 0.22);
  --lime-surface: #F2FBD0;
  --blue: #1E5EFF;
  --on-blue: #FFFFFF;
  --blue-text: #113DB0;
  --blue-bg: rgba(30, 94, 255, 0.10);
  --blue-pill: rgba(30, 94, 255, 0.12);
  --danger: #E6194B;
  --carbon: #232730;
  --on-carbon: #FFFFFF;
  --shadow: rgba(35, 39, 48, 0.08);
  --glass: rgba(255, 255, 255, 0.92);
  /* The "what the server sees" box keeps one terminal look in both themes. */
  --term-bg: #16181D;
  --term-text: #E6E9F0;
  --term-ink: #C8FF00;
  --hl-bg: #C8FF00;
  --hl-ink: #232730;

  --font-ui: "Plus Jakarta Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-card: 22px;
  --r-pill: 999px;
  --r-composer: 26px;
  --r-quote: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-cat: #ECEEF4;
    --brand-cat-eye: #141720;
    --brand-solo-bg: #C8FF00;
    /* The cat 58% of the badge wide and 2% of it low (KD-86). */
    --brand-solo-pad: 7.8px 7.15px 6.45px;
    --brand-solo-radius: 50%;
    --page: #0B0C0F;
    --canvas: #121317;
    --subtle: #1A1C22;
    --elevated: #242730;
    --line: #2C2F3A;
    --line-strong: #3C404E;
    --ink: #ECEEF4;
    --ink-2: #B4BACB;
    --ink-3: #8A90A3;
    --lime-border: #C8FF00;
    --lime-bg: rgba(200, 255, 0, 0.14);
    --lime-surface: #232B12;
    --blue-text: #96B7FF;
    --blue-bg: rgba(30, 94, 255, 0.18);
    --blue-pill: rgba(30, 94, 255, 0.24);
    --danger: #FF4D73;
    --carbon: #ECEEF4;
    --on-carbon: #121317;
    --shadow: rgba(0, 0, 0, 0.5);
    --glass: rgba(18, 19, 23, 0.92);
    --hl-bg: transparent;
    --hl-ink: #C8FF00;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-cat: #ECEEF4;
  --brand-cat-eye: #141720;
  --brand-solo-bg: #C8FF00;
  /* The cat 58% of the badge wide and 2% of it low (KD-86). */
  --brand-solo-pad: 7.8px 7.15px 6.45px;
  --brand-solo-radius: 50%;
  --page: #0B0C0F;
  --canvas: #121317;
  --subtle: #1A1C22;
  --elevated: #242730;
  --line: #2C2F3A;
  --line-strong: #3C404E;
  --ink: #ECEEF4;
  --ink-2: #B4BACB;
  --ink-3: #8A90A3;
  --lime-border: #C8FF00;
  --lime-bg: rgba(200, 255, 0, 0.14);
  --lime-surface: #232B12;
  --blue-text: #96B7FF;
  --blue-bg: rgba(30, 94, 255, 0.18);
  --blue-pill: rgba(30, 94, 255, 0.24);
  --danger: #FF4D73;
  --carbon: #ECEEF4;
  --on-carbon: #121317;
  --shadow: rgba(0, 0, 0, 0.5);
  --glass: rgba(18, 19, 23, 0.92);
  --hl-bg: transparent;
  --hl-ink: #C8FF00;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; box-sizing: border-box; }
body {
  height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page frame ---------- */
.page {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 16px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 12px 0;
  min-width: 0;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }

/* The incident line (status.json, RUNBOOK → Status line): hidden unless switched on. */
.status-line {
  margin: 10px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--lime-border);
  border-radius: 12px;
  background: var(--lime-surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.mark { width: 26px; height: 26px; flex: none; display: block; }
.mark { --mark-ink: #141720; --mark-eye: #FFFFFF; --mark-pupil: #141720; } /* the cat alone: as drawn */
/* The header logo: the cat and "HelloChato" (word in the text colour); the
   cat alone on phones, where the whole logo would push the button off. */
.brand-logo { width: 190px; height: 26px; flex: none; display: block; }
.brand .mark {
  display: none; box-sizing: border-box; width: 34px; height: 34px;
  padding: var(--brand-solo-pad); border-radius: var(--brand-solo-radius); background: var(--brand-solo-bg);
}
.brand .brand-logo { --mark-ink: var(--brand-cat); --mark-eye: var(--brand-cat-eye); --mark-pupil: var(--brand-cat); }
.logo-word { fill: currentColor; }
@media (max-width: 680px) {
  .brand .brand-logo { display: none; }
  .brand .mark { display: block; }
}

.beta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: var(--r-pill);
  background: var(--lime-bg);
  border: 1px solid var(--lime-border);
  color: var(--ink);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.01em;
  white-space: nowrap; flex: none;
}
.beta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-border); box-shadow: 0 0 0 3px var(--lime-bg); }
.tagline { color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .spacer { flex: 1; }

.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--elevated); flex: none; }
.seg button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--canvas); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }

.link-quiet { color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; flex: none; }
.link-quiet:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-pill);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-lime { background: var(--lime); color: var(--on-lime); box-shadow: 0 6px 18px rgba(150, 196, 0, 0.35), inset 0 0 0 1px var(--lime-border); }
.btn-lime:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(150, 196, 0, 0.42), inset 0 0 0 1px var(--lime-border); }
.btn-lime:active { transform: translateY(0); }
.btn-carbon { background: var(--carbon); color: var(--on-carbon); }
.btn-soft { background: var(--elevated); color: var(--ink); }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-md { padding: 9px 16px; font-size: 14px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- app window ---------- */
.window {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 24px 60px -24px var(--shadow), 0 2px 6px var(--shadow);
  overflow: hidden;
}

/* sidebar */
.sidebar {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--canvas);
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px; }
.team-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px; border-radius: var(--r-pill); background: var(--subtle);
  font-weight: 700; font-size: 15.5px; min-width: 0;
}
.team-pill .chev { color: var(--ink-3); width: 14px; height: 14px; }
.chats-title { display: none; }
.side-tools { display: none; }
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
}
.filters { display: none; }
.nav { list-style: none; margin: 0; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.nav-item {
  width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 6px 10px 6px 8px; border: 0; border-radius: 16px; background: transparent; text-align: left;
  color: var(--ink-2);
}
.nav-item:hover { background: var(--subtle); }
.nav-item[aria-current="page"] { background: var(--subtle); color: var(--ink); }
.nav-item .ico {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 16px; color: var(--ink-2); background: transparent;
}
.nav-item.unread .ico { background: var(--blue); color: var(--on-blue); }
.nav-item .ico svg { width: 17px; height: 17px; }
.nav-item .name { display: flex; flex-direction: column; min-width: 0; }
.nav-item .name b { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.unread .name b { font-weight: 800; color: var(--ink); }
.nav-item .name small { display: none; }
.nav-item .end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.nav-item .end time { display: none; }
.badge {
  min-width: 22px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--lime); color: var(--on-lime); font-size: 12px; font-weight: 800; text-align: center;
}
.tag-example {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--elevated); color: var(--ink-3); font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.side-sep { height: 1px; background: var(--line); margin: 10px 16px; }
.side-foot {
  margin-top: auto; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px;
}
.side-foot nav { display: flex; gap: 12px; flex-wrap: wrap; }
.side-foot a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.side-foot a:hover { color: var(--ink); text-decoration: underline; }

/* pane */
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--canvas); }
.pane-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px 10px; border-bottom: 1px solid var(--line); min-height: 64px;
}
.back {
  display: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; place-items: center; flex: none;
}
.back svg { width: 22px; height: 22px; }
.pane-title { min-width: 0; flex: 1; }
.pane-title h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-title p { margin: 0; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.faces { display: flex; flex: none; }
.faces .av { width: 30px; height: 30px; font-size: 11px; margin-left: -8px; box-shadow: 0 0 0 2px var(--canvas); }

.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 12px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { .scroll { scroll-behavior: auto; } }

/* start of a channel */
.chstart { padding: 22px 20px 4px; display: grid; justify-items: start; gap: 6px; }
.chstart .big { width: 56px; height: 56px; border-radius: 18px; background: var(--lime); display: grid; place-items: center; }
/* The cat 2% of the tile low, so it looks centred (KD-86). */
.chstart .big .mark { width: 34px; height: 34px; translate: 0 1.12px; }
.chstart h2 { margin: 6px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.chstart p { margin: 0; color: var(--ink-2); }

.day { display: flex; justify-content: center; margin: 14px 0 4px; }
.day span { padding: 3px 12px; border-radius: var(--r-pill); background: var(--subtle); color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.example-note {
  margin: 10px 20px 2px; padding: 10px 14px; border-radius: 16px; background: var(--subtle);
  color: var(--ink-2); font-size: 13.5px; display: flex; gap: 8px; align-items: center;
}
.example-note svg { width: 16px; height: 16px; flex: none; }

/* messages */
.msg { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 6px 20px; margin-top: 8px; }
.msg.grouped { margin-top: 0; padding-top: 2px; }
.msg.grouped .gutter, .msg.grouped .meta { display: none; }
.msg.grouped .main { grid-column: 2; }
.msg.active { background: var(--subtle); }
.msg.flash { animation: flash 1.6s ease; }
@keyframes flash { from { background: var(--lime-bg); } to { background: transparent; } }
.av {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em;
}
.av.lime { background: var(--lime); color: var(--on-lime); }
.av.blue { background: var(--blue); color: var(--on-blue); }
/* The cat alone in a circle (KD-86): 58% of the circle wide and 2% of it
   low (3.45% of the cat's own square), at every circle size, so the ears
   have room and it looks centred. The lime circle is the team (sidebar);
   chato as an author is the cat as drawn on grey, the white cat on dark. */
.av.logo { background: var(--lime); }
.av.chato { background: var(--elevated); }
.av.logo .mark, .av.chato .mark { width: 58%; height: 58%; translate: 0 3.45%; }
.av.chato .mark { --mark-ink: var(--brand-cat); --mark-eye: var(--brand-cat-eye); --mark-pupil: var(--brand-cat); }
.main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.meta .who { font-weight: 800; font-size: 15px; }
.meta time { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.text { margin: 0; overflow-wrap: anywhere; white-space: pre-line; max-width: 68ch; }
.text strong { font-weight: 700; }
.edited { color: var(--ink-3); font-size: 12.5px; }
.mention {
  display: inline; padding: 0 5px; border-radius: 6px; background: var(--blue-pill); color: var(--blue-text);
  font-weight: 700; border: 0; font-size: inherit; line-height: inherit;
}
button.mention:hover { text-decoration: underline; }
.quote {
  display: flex; gap: 6px; align-items: flex-start; padding: 6px 12px; border-radius: 12px;
  background: var(--subtle); color: var(--ink-2); font-size: 13.5px; max-width: 68ch;
}
.msg.active .quote { background: var(--elevated); }
.quote svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.ship {
  align-self: flex-start; max-width: min(560px, 100%);
  padding: 12px 16px 14px; border-radius: 20px; border: 1px solid var(--lime-border); background: var(--lime-surface);
  display: flex; flex-direction: column; gap: 8px;
}
.ship-pill {
  align-self: flex-start; display: inline-flex; gap: 6px; align-items: center;
  padding: 3px 11px; border-radius: var(--r-pill); background: var(--lime); color: var(--on-lime);
  font-size: 13px; font-weight: 800;
}
.file {
  align-self: flex-start; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px;
  border-radius: 20px; background: var(--subtle); min-width: 0; max-width: 100%;
}
.msg.active .file { background: var(--elevated); }
.file .fi { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--canvas); flex: none; }
.file .fi svg { width: 18px; height: 18px; color: var(--blue); }
.file b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { color: var(--ink-3); font-size: 12px; }
.file .dl { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--canvas); display: grid; place-items: center; flex: none; }
.file .dl svg { width: 18px; height: 18px; }

.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.react {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: var(--r-pill);
  border: 0; background: var(--subtle); font-size: 13.5px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.msg.active .react:not(.mine):not(.add) { background: var(--elevated); }
.react.mine { background: var(--lime); color: var(--on-lime); }
.react.add { padding: 3px 8px; color: var(--ink-2); background: transparent; }
.react.add svg { width: 18px; height: 18px; }

.tools {
  position: absolute; right: 16px; top: -14px; display: flex; gap: 2px; padding: 3px; opacity: 0; pointer-events: none;
  border-radius: var(--r-pill); background: var(--canvas); border: 1px solid var(--line); box-shadow: 0 6px 16px var(--shadow);
}
.msg.active .tools, .tools:focus-within { opacity: 1; pointer-events: auto; }
@media (hover: hover) {
  .msg:hover { background: var(--subtle); }
  .msg:hover .quote, .msg:hover .file, .msg:hover .thread-sum, .msg:hover .react:not(.mine):not(.add) { background: var(--elevated); }
  .msg:hover .tools { opacity: 1; pointer-events: auto; }
}

.tools button {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2);
}
.tools button:hover { background: var(--subtle); color: var(--ink); }
.tools svg { width: 17px; height: 17px; }

.lockline-msg {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  color: var(--blue-text); font-size: 12.5px; font-weight: 700; padding: 2px 0;
}
.lockline-msg svg { width: 13px; height: 13px; }
.lockline-msg:hover { text-decoration: underline; }
.cipher {
  max-width: 68ch; padding: 12px 14px; border-radius: 16px; background: var(--term-bg); color: var(--term-text);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px;
}
.cipher code {
  font: 500 12.5px/1.55 var(--font-mono); color: var(--term-ink); overflow-wrap: anywhere; word-break: break-all;
}
.cipher p { margin: 0; font-size: 12.5px; opacity: 0.8; }
.cipher .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; opacity: 0.9; }
.cipher .row button { border: 0; background: transparent; color: inherit; font-weight: 700; font-size: 12px; text-decoration: underline; padding: 0; }

/* cards inside messages */
.card {
  align-self: stretch; max-width: 600px; padding: 16px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--canvas); box-shadow: 0 8px 22px -12px var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card h3 { margin: 0; font-size: 16px; font-weight: 800; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan { padding: 14px; border-radius: 16px; background: var(--subtle); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plan.pick { background: var(--lime-surface); box-shadow: inset 0 0 0 1px var(--lime-border); }
.plan .pname { font-weight: 800; font-size: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.plan .price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 14px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.plan .alt { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.plan ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--ink-2); }
.plan li::before { content: "✓ "; color: var(--lime-border); font-weight: 800; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--canvas); border-radius: 14px;
  padding: 10px 12px; font-size: 15px; min-width: 0;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
.field .err { color: var(--danger); font-size: 13px; font-weight: 600; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.form .submit-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.form .hint { color: var(--ink-3); font-size: 12.5px; flex: 1; min-width: 200px; }
.form > p.full, .form .check.full, .form .err.full { grid-column: 1 / -1; margin: 0; }
.form .check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.form .check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--blue); }
.form .check a { color: var(--blue); }
.form .err { color: var(--danger); font-size: 13px; font-weight: 600; }
.form button[disabled] { opacity: .6; cursor: progress; }
.form .fine { color: var(--ink-3); font-size: 12px; }
.form .fine a { color: inherit; }
/* Hidden: the form shows reCAPTCHA's notice instead, as Google allows. */
.grecaptcha-badge { visibility: hidden; }
/* The field only bots see (an off-screen trap; never display:none, which some bots skip). */
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.addr {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--subtle);
}
.addr code { font: 500 14px var(--font-mono); user-select: all; overflow-wrap: anywhere; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* The waitlist form after sending (S19). */
.sent-head { display: flex; align-items: center; gap: 12px; }
.sent-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--lime-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--lime-border);
}
.sent-icon svg { width: 20px; height: 20px; }
.card.sent b { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.card.sent .sent-help { color: var(--ink-3); font-size: 13px; }

/* tasks channel */
.tasks-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px 8px; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--subtle); min-width: 0; flex: 1 1 200px; max-width: 280px;
}
.search svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.search input { border: 0; background: transparent; width: 100%; min-width: 0; font-size: 14.5px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--blue); }
.tasks-bar .lbl { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.fchip {
  border: 0; padding: 6px 12px; border-radius: var(--r-pill); background: var(--subtle); font-size: 13px; font-weight: 600; color: var(--ink);
}
.fchip[aria-pressed="true"] { background: var(--carbon); color: var(--on-carbon); }
.newtask {
  margin: 4px 20px 6px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px;
  border-radius: var(--r-composer); border: 1px solid var(--line); box-shadow: 0 6px 18px -10px var(--shadow);
}
.newtask .plus { width: 36px; height: 36px; border-radius: 50%; background: var(--subtle); display: grid; place-items: center; flex: none; }
.newtask .plus svg { width: 18px; height: 18px; }
.newtask input { flex: 1; border: 0; background: transparent; font-size: 15px; min-width: 0; padding: 6px 4px; }
.newtask input:focus { outline: none; }
.newtask:focus-within { outline: 2px solid var(--blue); }
.round-send {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--elevated); color: var(--ink-2); display: grid; place-items: center; flex: none;
}
.round-send.go { background: var(--lime); color: var(--on-lime); }
.round-send svg { width: 20px; height: 20px; }
.task-list { list-style: none; margin: 0; padding: 0 20px; }
.task { padding: 11px 4px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.task b { font-weight: 600; font-size: 15px; }
.task .tags { display: grid; grid-template-columns: 130px 110px; gap: 8px; font-size: 13px; color: var(--ink-3); }
.task .tags .st { color: var(--ink); font-weight: 700; }
.task .tags .st.doing { color: var(--blue-text); }
.task.done b { text-decoration: line-through; color: var(--ink-3); font-weight: 500; }
.task.mine b::after { content: attr(data-mine); margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 1px 7px; border-radius: var(--r-pill); background: var(--elevated); vertical-align: 1px; }
.empty { padding: 20px; color: var(--ink-3); font-size: 14px; }

/* ship log */
.shiplog { padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.shiplog .who-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-weight: 800; }
.shiplog .who-row small { color: var(--ink-3); font-weight: 600; }
.shiplog .ship { max-width: 640px; }

/* composer */
.composer-wrap { padding: 8px 16px 14px; }
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: var(--r-composer);
  background: var(--glass); border: 1px solid var(--line); box-shadow: 0 6px 24px var(--shadow);
}
.composer:focus-within { border-color: var(--line-strong); }
.composer.shipmode { border-color: var(--lime-border); box-shadow: 0 0 0 3px var(--lime-bg), 0 6px 24px var(--shadow); }
.composer .plus { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--subtle); display: grid; place-items: center; flex: none; }
.composer .plus svg { width: 20px; height: 20px; }
.composer .field-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.composer textarea {
  border: 0; background: transparent; resize: none; font-size: 15.5px; line-height: 1.45; padding: 5px 4px; max-height: 140px; min-height: 30px; width: 100%;
}
.composer textarea:focus { outline: none; }
.ship-tag {
  align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; padding: 2px 6px 2px 10px; border-radius: var(--r-pill);
  background: var(--lime); color: var(--on-lime); font-size: 12.5px; font-weight: 800;
}
.ship-tag button { border: 0; background: transparent; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: inherit; padding: 0; }
.ship-tag svg { width: 12px; height: 12px; }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; background: var(--elevated); color: var(--ink-3); transition: background 0.15s; }
.send.go { background: var(--lime); color: var(--on-lime); }
.send svg { width: 20px; height: 20px; }
.composer-note { display: flex; justify-content: center; gap: 6px; color: var(--ink-3); font-size: 12px; margin-top: 8px; }
.composer-note svg { width: 12px; height: 12px; margin-top: 2px; }

/* popovers */
.pop {
  position: fixed; z-index: 40; padding: 6px; border-radius: 18px; background: var(--canvas); border: 1px solid var(--line);
  box-shadow: 0 16px 40px var(--shadow); display: flex; gap: 2px;
}
.pop.menu { flex-direction: column; min-width: 200px; }
.pop button { border: 0; background: transparent; border-radius: 12px; padding: 8px 10px; font-size: 20px; line-height: 1; }
.pop.menu button { font-size: 14.5px; font-weight: 600; text-align: left; display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.pop button:hover, .pop button:focus-visible { background: var(--subtle); }
.pop .soon { color: var(--ink-3); font-size: 12px; font-weight: 600; margin-left: auto; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  padding: 10px 16px; border-radius: var(--r-pill); background: var(--carbon); color: var(--on-carbon);
  font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px var(--shadow); max-width: calc(100% - 32px); text-align: center;
}

/* ---------- intro stage ---------- */
.page { position: relative; z-index: 1; }
.stage { position: relative; flex: 1; min-height: 0; display: flex; }
.stage > .window { flex: 1; transform-origin: 50% 0%; will-change: transform; }
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.stage-fade {
  position: fixed; left: 0; right: 0; bottom: 0; height: 52vh; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--page) 78%);
}
.hero {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px;
  padding-block: clamp(20px, 7vh, 76px) 0; will-change: transform, opacity, filter;
}
.hero h1 { margin: 0; font-size: clamp(38px, 10.5vw, 96px); line-height: 1; font-weight: 800; letter-spacing: -0.045em; }
.hero h1 span { display: block; }
.hero h1 mark { display: inline-block; position: relative; z-index: 0; background: none; color: var(--hl-ink); padding: 0 0.04em; }
.hero h1 mark::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0.08em; height: 0.34em;
  background: var(--hl-bg); border-radius: 0.1em; transform-origin: left center;
  animation: swipe 0.9s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
:lang(ja) .hero h1 { font-size: clamp(34px, 9.4vw, 88px); letter-spacing: -0.02em; line-height: 1.12; }
:lang(ja) .hero .sub, :lang(ja) .text { word-break: auto-phrase; }
.hero .sub { margin: 0; font-size: clamp(17px, 1.7vw, 21px); color: var(--ink-2); max-width: 36ch; text-wrap: balance; }
.hero .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }
.btn-ghost { background: var(--canvas); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.ring { width: 18px; height: 18px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2.4; }
.ring .track { stroke: var(--line-strong); }
.ring .prog { stroke: var(--ink); stroke-dasharray: 50.3; stroke-dashoffset: 50.3; stroke-linecap: round; }
.counting .ring .prog { animation: count var(--auto-ms, 6500ms) linear forwards; }
.hero > * { animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero > :nth-child(2) { animation-delay: 0.1s; }
.hero > :nth-child(3) { animation-delay: 0.2s; }
.hero > :nth-child(4) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }
@keyframes swipe { from { transform: scaleX(0); } }
@keyframes count { to { stroke-dashoffset: 0; } }
.is-intro .window { pointer-events: none; }
.tabbar { transition: opacity 0.5s ease, transform 0.5s ease; }
.is-intro .tabbar { opacity: 0; transform: translateY(24px); pointer-events: none; }
.pre { opacity: 0; }
.arrive { animation: arrive 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
#nav > li.arrive { animation-name: slidein; }
@keyframes slidein { from { opacity: 0; transform: translateX(-14px); } }
.scr { color: var(--ink-3); font-family: var(--font-mono); font-size: 0.9em; letter-spacing: -0.02em; }
@media (prefers-reduced-motion: reduce) {
  .hero > *, .arrive, #nav > li.arrive, .hero h1 mark::after { animation: none !important; }
}

/* threads */
.thread-sum {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: 2px;
  padding: 5px 12px 5px 5px; border: 0; border-radius: var(--r-pill); background: var(--subtle); font-size: 13.5px; text-align: left;
}
.thread-sum .stack { display: flex; }
.thread-sum .av { width: 22px; height: 22px; font-size: 8.5px; letter-spacing: 0; box-shadow: 0 0 0 2px var(--subtle); margin-left: -6px; }
.thread-sum .av:first-child { margin-left: 0; }
.thread-sum b { color: var(--blue-text); font-weight: 800; }
.thread-sum .last { color: var(--ink-3); }
.msg.active .thread-sum { background: var(--elevated); }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--canvas); }
.thread .close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--subtle); display: grid; place-items: center; flex: none; }
.thread .close svg { width: 15px; height: 15px; }
.thread .composer .field-wrap { padding-left: 10px; }
.replies-div { display: flex; align-items: center; gap: 10px; margin: 10px 20px 2px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.replies-div::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.window.has-thread { grid-template-columns: 284px minmax(0, 1fr) minmax(320px, 380px); }
@media (min-width: 901px) and (max-width: 1099px) {
  .window.has-thread { grid-template-columns: 284px minmax(0, 1fr); }
  .window.has-thread .pane { display: none; }
}

/* tab bar (phones only) */
.tabbar { display: none; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; width: 100%; height: 100%; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) { .tagline { display: none; } }
@media (max-width: 900px) {
  .page { gap: 10px; padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .topbar { gap: 8px; padding-top: 10px; }
  .topbar .seg, .topbar .link-quiet { display: none; }
  .brand-logo { width: 161px; height: 22px; }
  .beta { font-size: 11.5px; padding: 4px 9px 4px 8px; }
  .topbar .btn-lg { padding: 9px 14px; font-size: 13.5px; }
  .window { grid-template-columns: minmax(0, 1fr); }
  .window[data-mobile="pane"] .sidebar { display: none; }
  .window[data-mobile="list"] .pane { display: none; }
  .window.has-thread { grid-template-columns: minmax(0, 1fr); }
  .window[data-mobile="thread"] .sidebar, .window[data-mobile="thread"] .pane { display: none; }
  .thread { border-left: 0; }
  .thread .close { display: none; }
  .sidebar { border-right: 0; }
  .side-head { padding: 14px 16px 4px; justify-content: space-between; }
  .side-tools { display: flex; }
  .chats-title { display: block; margin: 6px 16px 10px; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
  .side-label { display: none; }
  .filters { display: flex; gap: 8px; padding: 0 16px 10px; }
  .nav { padding: 0 6px; gap: 0; }
  .nav-item { grid-template-columns: 52px minmax(0, 1fr) auto; padding: 8px 10px; gap: 12px; border-radius: 18px; }
  .nav-item .ico { width: 52px; height: 52px; font-size: 22px; background: var(--subtle); }
  .nav-item.unread .ico { background: var(--blue); }
  .nav-item[aria-current="page"] { background: transparent; }
  .nav-item .name b { font-size: 17px; color: var(--ink); font-weight: 600; }
  .nav-item .name small { display: block; color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-item.unread .name small { color: var(--blue-text); font-weight: 600; }
  .nav-item .end time { display: block; color: var(--ink-3); font-size: 13px; }
  .side-sep { margin: 8px 16px; }
  .back { display: grid; }
  .pane-head { padding: 8px 12px 8px 6px; min-height: 60px; }
  .faces { display: none; }
  .msg { padding: 6px 16px; }
  .tools { right: 10px; }
  .chstart { padding: 18px 16px 4px; }
  .composer-wrap { padding: 6px 10px 10px; }
  .composer-note { display: none; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .tasks-bar, .task-list { padding-left: 16px; padding-right: 16px; }
  .newtask { margin: 4px 16px 6px; }
  .task .tags { grid-template-columns: 110px 100px; }
  .side-foot { padding: 12px 16px 14px; }
  .hero { gap: 14px; padding-block: 4vh 0; }
  .hero .actions { width: 100%; max-width: 360px; }
  .hero .actions .btn { flex: 1 1 auto; }
  .tabbar {
    display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; justify-content: center;
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    pointer-events: none;
  }
  .tabbar .bar {
    pointer-events: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; max-width: 440px;
    padding: 6px; border-radius: 30px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 10px 30px var(--shadow);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .tabbar button {
    border: 0; background: transparent; border-radius: 22px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--ink-2); font-size: 12px; font-weight: 700;
  }
  .tabbar button .ti { width: 48px; height: 30px; border-radius: var(--r-pill); display: grid; place-items: center; }
  .tabbar button svg { width: 20px; height: 20px; }
  .tabbar button[aria-current="page"] { color: var(--ink); }
  .tabbar button[aria-current="page"] .ti { background: var(--lime); color: var(--on-lime); }
  .tabbar button.invite .ti { background: var(--carbon); color: var(--on-carbon); }
  .tabbar button.invite[aria-current="page"] .ti { background: var(--lime); color: var(--on-lime); }
}
@media (max-width: 420px) {
  .beta .long { display: none; }
  .topbar .btn-lg .long { display: none; }
}
@media (min-width: 421px) { .short { display: none; } }

/* ---------- was inline (the site's CSP has no 'unsafe-inline') ---------- */
.sprites { position: absolute; }
.mark-ink { fill: var(--mark-ink, #C8FF00); }
.mark-eye { fill: var(--mark-eye, #FFFFFF); }
.mark-pupil { fill: var(--mark-pupil, #141720); }
.av.av-32 { width: 32px; height: 32px; }
.card.mt-8 { margin-top: 8px; }
.noscript {
  position: fixed; inset: 0; background: var(--canvas); padding: 32px 20px;
  font: 16px/1.5 sans-serif; color: var(--ink);
}
.noscript h1 { margin: 0 0 8px; }

/* ---------- standalone pages (the /confirm/ page, S19): same header, card and buttons ---------- */
body.solo { height: auto; min-height: 100%; overflow: auto; }
.solo-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 24px;
  max-width: 1080px; margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
}
.solo-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding-block: 8px 24px; }
.solo-card { align-self: center; width: 100%; max-width: 460px; padding: 32px 28px 28px; gap: 14px; border-radius: var(--r-card); box-shadow: 0 24px 60px -24px var(--shadow), 0 2px 6px var(--shadow); }
.solo-card h1:focus { outline: none; }
.solo-card h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.solo-card p { font-size: 15.5px; line-height: 1.55; }
.solo-card .btn-row { margin-top: 6px; }
.solo-card .btn-row .btn { flex: 1 1 auto; }
.solo-card button[disabled] { opacity: .6; cursor: progress; transform: none; }
.solo-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--lime-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--lime-border);
}
.solo-icon svg { width: 26px; height: 26px; }
.solo-card[data-state="done"] .solo-icon { background: var(--lime); color: var(--on-lime); }
.solo-card[data-state="bad-link"] .solo-icon { background: var(--elevated); color: var(--ink-2); box-shadow: none; }
.solo-card .solo-msg {
  padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 600;
  color: var(--danger); background: var(--subtle); box-shadow: inset 3px 0 0 var(--danger);
}
.solo-fine { margin: 0; max-width: 460px; text-align: center; color: var(--ink-3); font-size: 12px; }
.solo-fine a { color: inherit; }
.solo-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.solo-foot a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.solo-foot a:hover { color: var(--ink); text-decoration: underline; }
/* Phones hide the home page's language switch in the top bar (its sidebar has one); this page has only the top bar. */
.solo-page .topbar .seg { display: inline-flex; }
@media (max-width: 420px) {
  .solo-card { padding: 24px 20px 20px; }
  .solo-card h1 { font-size: 23px; }
  .solo-page .topbar .seg button { padding: 5px 9px; }
}

/* ---------- the /delete-account/ page (S59): the confirm page's frame, a reading layout ---------- */
.doc { justify-content: flex-start; }
.doc-card { max-width: 680px; text-align: left; }
.doc-card h2 { margin: 14px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 800; }
.doc-card ol, .doc-card ul { margin: 0; padding-left: 22px; font-size: 15.5px; line-height: 1.55; }
.doc-card li { margin: 4px 0; }
.doc-card a { color: var(--blue-text, var(--blue)); }
.doc-card .doc-lead { color: var(--ink-2); }
.doc-card .doc-note { padding: 10px 14px; border-radius: 14px; background: var(--subtle); }
.doc-card .doc-fine { color: var(--ink-2); font-size: 14px; }
.doc-card .dev { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.doc-card + .doc-card { margin-top: 8px; }
/* Without JavaScript both languages show: keep the pairs apart. */
span[data-l="en"]:not([hidden]) + span[data-l="ja"]:not([hidden])::before { content: " / "; }
