/* FateTips V3 — UI kit. Every component reads tokens.css; nothing here restates a raw brand
   value. Onboarding-only since the V2 restore (the old kit.html is in archive/). Motion: transform/opacity only, specific properties,
   hover gated to fine pointers, reduced-motion handled at the bottom of the file.

   NO CARDS (L 2026-09-26, DESIGN.md "No cards — content sits on the background"): one background per
   page (base.css .ft-bg); content sits directly on it — type, hairlines, 40px pills, underline inputs,
   hairline-divided lists. Grouping comes from space, not containers. Readability comes from .mist
   (gradient blur glass, no edge). The only boxed thing is .object — a real artefact (命書, share image). */

/* ── Material: mist — gradient blur glass ──────────────────────────────────────
   White-mist backdrop blur + faint paper fill whose mask dissolves to transparent: no edge, no radius,
   no shadow. Use ONLY where text crosses busy painting, behind sticky chrome, and as the material of
   sheets. Transparent host; the material lives on ::before and bleeds --mist-fade past the host so the
   dissolve happens outside the content.
     .mist          dissolves on all four sides (a readable pool behind a block of text)
     .mist--top     for a top-anchored bar: solid at the top edge, dissolves downward
     .mist--bottom  for a bottom-anchored bar (composer): solid at the bottom, dissolves upward
   Never on a fixed full-viewport layer; never the material of a lock (家規 9: locks must not depend on
   backdrop-filter). Solid paper fallback without backdrop-filter or with reduced transparency. */
.mist, .mist--top, .mist--bottom { position: relative; isolation: isolate; background: transparent; }
.mist::before, .mist--top::before, .mist--bottom::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--mist-fade));
  z-index: -1;
  background: var(--mist-fill);
  -webkit-backdrop-filter: var(--mist-blur);
  backdrop-filter: var(--mist-blur);
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 var(--mist-fade), #000 calc(100% - var(--mist-fade)), transparent),
    linear-gradient(transparent, #000 var(--mist-fade), #000 calc(100% - var(--mist-fade)), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 var(--mist-fade), #000 calc(100% - var(--mist-fade)), transparent),
    linear-gradient(transparent, #000 var(--mist-fade), #000 calc(100% - var(--mist-fade)), transparent);
  mask-composite: intersect;
  pointer-events: none;
}
.mist--top::before {
  inset: 0 0 calc(-1 * var(--mist-fade));
  -webkit-mask-image: linear-gradient(#000 calc(100% - var(--mist-fade)), transparent);
  mask-image: linear-gradient(#000 calc(100% - var(--mist-fade)), transparent);
}
.mist--bottom::before {
  inset: calc(-1 * var(--mist-fade)) 0 0;
  -webkit-mask-image: linear-gradient(transparent, #000 var(--mist-fade));
  mask-image: linear-gradient(transparent, #000 var(--mist-fade));
}

/* Legacy bounded glass (onboarding choice pills still wear it). New work: .mist for readability,
   .opt for choices. */
.glass { position: relative; isolation: isolate; background: transparent; }
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  pointer-events: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass::before { background: var(--glass-fill-solid); }
  .mist::before, .mist--top::before, .mist--bottom::before, .topbar::before, .tabbar::before, .sheet::before { background: var(--mist-fill-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass::before { background: var(--glass-fill-solid); }
  .mist::before, .mist--top::before, .mist--bottom::before, .topbar::before, .tabbar::before, .sheet::before {
    background: var(--mist-fill-solid); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

/* ── Buttons: 40px pills, 44px hit area (FateTell measure) ─────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ctl-h);
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-ctl);
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-control) ease, box-shadow var(--dur-control) ease, opacity var(--dur-control) ease;
}
.btn::after { content: ""; position: absolute; inset: calc((var(--ctl-h) - var(--tap)) / 2) 0; }   /* 40px pill → 44px tap */
.btn:active { transform: scale(.97); }
/* Primary = the ink pill. .btn--seal is kept for markup compatibility only: seal red is the brand seal
   mark, never a button (L 2026-09-26) — the decisive action renders as the same ink pill. */
.btn--primary, .btn--seal { background: var(--action); color: var(--on-action); }
.btn--secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn--ghost { color: var(--ink); padding: 0 14px; }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 32px; padding: 0 14px; font-size: 13.5px; }
.btn--sm::after { inset: -6px -2px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .38; pointer-events: none; }
.actions { display: grid; gap: var(--action-gap); }      /* stacked actions: primary, then secondary */
/* button-in-button trailing icon */
.btn__icon {
  display: grid; place-items: center;
  width: 26px; height: 26px; margin-right: -12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  transition: transform var(--dur-control) var(--ease-out);
}
.btn--secondary .btn__icon, .btn--ghost .btn__icon { background: var(--wash); }
.btn__icon svg { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover, .btn--seal:hover { background: var(--action-hover); }
  .btn--secondary:hover, .btn--ghost:hover { background: var(--wash); }
  .btn:hover .btn__icon { transform: translateX(2px); }
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  color: var(--ink);
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-control) ease;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn--soft { background: var(--wash); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--wash); } }

.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--line-strong);
}

/* ── Option pill: one choice per pill, full column width, 14px apart ───────────
   Unselected = faint ink wash, no border · selected = 1px ink outline, no fill. Add .opt__check only
   when the step does not auto-advance. Selected state: .is-on or aria-pressed/-checked/-selected. */
.opts { display: grid; gap: var(--ctl-gap); }
.opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--ctl-h);
  padding: 0 44px;
  border-radius: var(--radius-pill);
  background: var(--wash);
  color: var(--ink);
  font-size: var(--fs-ctl);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  transition: background-color var(--dur-control) ease, box-shadow var(--dur-control) ease, transform var(--dur-micro) var(--ease-out);
}
.opt::after { content: ""; position: absolute; inset: calc((var(--ctl-h) - var(--tap)) / 2) 0; }
.opt:active { transform: scale(.98); }
.opt.is-on, .opt[aria-pressed="true"], .opt[aria-checked="true"], .opt[aria-selected="true"] { background: transparent; box-shadow: inset 0 0 0 1px var(--ink); }
.opt__check {
  position: absolute; right: 18px; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
  opacity: 0; transform: scale(.25); filter: blur(4px);
  transition: opacity 200ms cubic-bezier(.2, 0, 0, 1), transform 200ms cubic-bezier(.2, 0, 0, 1), filter 200ms cubic-bezier(.2, 0, 0, 1);
}
.opt.is-on .opt__check, .opt[aria-pressed="true"] .opt__check, .opt[aria-checked="true"] .opt__check, .opt[aria-selected="true"] .opt__check { opacity: 1; transform: none; filter: none; }
@media (hover: hover) and (pointer: fine) { .opt:not(.is-on):not([aria-pressed="true"]):not([aria-checked="true"]):hover { background: var(--wash-strong); } }

/* ── Chips: compact pills, same language as options ───────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--wash);
  font-size: var(--fs-small);
  line-height: 1.2;
  color: var(--ink);
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-control) ease, box-shadow var(--dur-control) ease;
}
button.chip::after { content: ""; position: absolute; inset: -4px 0; }
button.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: transparent; box-shadow: inset 0 0 0 1px var(--ink); }
.chip svg { width: 15px; height: 15px; }
/* read-only: which instruments an answer drew on (never a picker). Monochrome: no element dots. */
.chip--system {
  min-height: 26px;
  padding: 0 10px;
  gap: 5px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink-2);
  cursor: default;
}
.chip--system i { display: none; }
@media (hover: hover) and (pointer: fine) { button.chip:not([aria-pressed="true"]):hover { background: var(--wash-strong); } }

/* ── Groups, not cards ─────────────────────────────────────────────────────────
   .card and its variants paint nothing: no fill, no shadow, no radius, no inner gutter — a group of
   content on the background, set off from the next group by space and one hairline. Class names stay
   so existing markup keeps working. .card--ink's dark slab is retired too: its ink tokens are re-scoped
   to ink-on-paper in base.css (.surface-ink, .card--ink). */
.card { position: relative; padding: var(--space-4) 0; background: none; border-radius: 0; box-shadow: none; }
.card + .card { box-shadow: inset 0 1px 0 var(--line); }
.card--glass, .card--well, .card--ink { background: none; }
/* The rare real artefact (命書 receipt, a share image): the one boxed surface. Justify each use. */
.object {
  position: relative;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--paper-bright);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -28px rgba(21, 23, 19, .38);
}
.divider { height: 1px; border: 0; background: var(--line); }
.divider--ink { height: 2px; background: linear-gradient(90deg, transparent, var(--line-strong) 12%, var(--line-strong) 88%, transparent); border-radius: 2px; }

/* Lists: rows on the background, divided by hairlines; press = ink fade, not a grey box */
.list { position: relative; }
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 0;
  text-align: left;
  transition: opacity var(--dur-micro) ease;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); }
.row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row__title { display: block; font-size: var(--fs-body); font-weight: 400; line-height: 1.35; }
.row__sub { display: block; font-size: var(--fs-sub); color: var(--ink-2); line-height: 1.4; }
.row__end { color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.row__end svg { width: 18px; height: 18px; }
a.row:active, button.row:active { opacity: .6; }
@media (hover: hover) and (pointer: fine) { a.row:hover, button.row:hover { opacity: .78; } }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--wash);
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  flex-shrink: 0;
}
.avatar--lg { width: 56px; height: 56px; font-size: 22.4px; }

.stat { display: grid; gap: 2px; }
.stat__num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22.4px; font-weight: 300; letter-spacing: -.02em; line-height: 1.1; }
.stat__label { font-size: var(--fs-caption); color: var(--ink-2); }

/* Horizontal scroll row: bleed + align + edge fade (≤4 items: use a grid instead) */
.hrow {
  display: flex; gap: 10px; overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);         /* first item snaps to the gutter, not the bleed edge */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
}
.hrow > * { flex: 0 0 auto; scroll-snap-align: start; }

/* Sticky top bar: transparent shell, mist on ::before (anchored top, dissolves downward, no rule line) */
.topbar {
  position: sticky;
  top: var(--frame-top);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: calc(52px + var(--status-h));
  margin: calc(-1 * var(--sat) - 8px) calc(-1 * var(--gutter)) 8px;
  padding: var(--status-h) 12px 0;
  isolation: isolate;
}
.topbar::before {
  content: "";
  position: absolute; inset: 0 0 calc(-1 * var(--mist-fade)); z-index: -1;
  background: var(--mist-fill);
  -webkit-backdrop-filter: var(--mist-blur);
  backdrop-filter: var(--mist-blur);
  -webkit-mask-image: linear-gradient(#000 calc(100% - var(--mist-fade)), transparent);
  mask-image: linear-gradient(#000 calc(100% - var(--mist-fade)), transparent);
  pointer-events: none;
}
.topbar__title { flex: 1 1 auto; text-align: center; font-size: var(--fs-title); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__side { width: var(--tap); flex: 0 0 var(--tap); }

/* ── Form: underline inputs (no box) ─────────────────────────────────────────
   1px --line-strong rule, ink on focus, 17px text (≥16px: no iOS zoom). Search fields too.
   .field--line = the same underline on any bare input/button, without the .input class. */
.field { display: grid; gap: 6px; }
.field__label { font-size: var(--fs-label); font-weight: 400; color: var(--ink-2); }
.field__help { font-size: var(--fs-caption); color: var(--ink-2); }
.input, .field-btn, .field--line {
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 -1px 0 var(--line-strong);
  font-size: 17px;
  color: var(--ink);
  transition: box-shadow var(--dur-control) ease;
}
.input::placeholder, .field--line::placeholder { color: var(--ink-2); opacity: 1; }
.input:focus, .input:focus-visible, .field--line:focus, .field--line:focus-visible { outline: none; box-shadow: inset 0 -1.5px 0 var(--ink); }
.field-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.field-btn:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--jade); }
.field-btn__value { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.field-btn[data-empty="true"] .field-btn__value { color: var(--ink-2); }
.field-btn svg { width: 18px; height: 18px; color: var(--ink-3); }
.field-btn:active { box-shadow: inset 0 -1.5px 0 var(--ink); }
/* Invalid: a seal-red rule + message under the field. Semantic error state, not decoration
   (seal on paper 5.39:1, AA). */
.input[aria-invalid="true"], .field-btn[aria-invalid="true"], .field--line[aria-invalid="true"] { box-shadow: inset 0 -1.5px 0 var(--seal); }
.field__error { font-size: var(--fs-sub); line-height: 1.45; color: var(--seal); }

/* Segmented: faint wash track, the chosen segment is an ink outline */
.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--wash);
}
.seg__btn {
  position: relative;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--ink-2);
  transition: background-color var(--dur-control) ease, color var(--dur-control) ease, box-shadow var(--dur-control) ease;
}
.seg__btn::after { content: ""; position: absolute; inset: -4px 0; }
.seg__btn[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg--block { display: flex; }
.seg--block .seg__btn { flex: 1 1 0; }

.switch {
  position: relative;
  width: 48px; height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(21, 23, 19, .16);
  transition: background-color var(--dur-control) ease;
  flex-shrink: 0;
}
.switch::before {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper-bright);
  box-shadow: 0 1px 3px rgba(21, 23, 19, .22);
  transition: transform var(--dur-control) var(--ease-out);
}
.switch::after { content: ""; position: absolute; inset: -8px -4px; }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::before { transform: translateX(20px); }

/* ── Bottom nav: transparent fixed shell in the column, mist on ::before ────────
   Floats --sab above the viewport edge (never an edge-attached backdrop layer — Safari 26 sampling,
   家規 10); the mist dissolves upward over the content and fades out again at its foot, so it has no
   edge. The chosen tab reads by ink tone, not by a white pill. */
.tabbar {
  position: fixed;
  z-index: var(--z-nav);
  left: 0;
  right: 0;
  bottom: var(--sab);
  margin-inline: auto;
  width: min(100%, var(--col));
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 16px;
  background: transparent;
  isolation: isolate;
}
.tabbar::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--mist-fade)) 0 0;
  z-index: -1;
  background: var(--mist-fill);
  -webkit-backdrop-filter: var(--mist-blur);
  backdrop-filter: var(--mist-blur);
  -webkit-mask-image: linear-gradient(transparent, #000 var(--mist-fade), #000 calc(100% - 8px), transparent);
  mask-image: linear-gradient(transparent, #000 var(--mist-fade), #000 calc(100% - 8px), transparent);
  pointer-events: none;
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: var(--tap);
  color: var(--ink-2);
  font-size: var(--fs-micro);
  font-weight: 400;
  letter-spacing: .08em;
  line-height: 1.2;
  transition: color var(--dur-control) ease;
}
.tab svg { width: 25px; height: 25px; transition: transform var(--dur-micro) var(--ease-out); }
.tab .ink-wash { opacity: .1; transition: opacity var(--dur-control) ease; }
.tab:active svg { transform: scale(.9); }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .ink-wash { opacity: .28; }
:lang(en) .tab { letter-spacing: .02em; font-size: 11px; }

/* ── DEV bar: top-right, lives in the status band, always the top layer ────── */
.devbar {
  position: fixed;
  z-index: var(--z-dev);
  top: calc(var(--frame-top) + 4px);
  left: 0;
  right: 0;
  width: min(100%, var(--col));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 10px;
  pointer-events: none;
  font-family: var(--font-mono);
}
@media (min-width: 600px) { .devbar { top: calc(var(--frame-top) + 11px); padding: 0 22px; } }
.devbar > * { pointer-events: auto; }
.devbar__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(21, 23, 19, .8);
  color: var(--paper-bright);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 4px 12px -6px rgba(21, 23, 19, .5);
}
.devbar__pill::after { content: ""; position: absolute; inset: -10px -6px; }
.devbar__pill b { font-weight: 500; color: #E7B9B3; }
.devbar__panel {
  margin-top: 8px;
  width: 256px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--ink-surface);
  color: var(--on-ink);
  box-shadow: 0 24px 48px -20px rgba(21, 23, 19, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  font-family: var(--font-ui);
  transform-origin: top right;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.devbar__panel[hidden] { display: block !important; opacity: 0; transform: scale(.96) translateY(-4px); pointer-events: none; visibility: hidden; }
.devbar__label { display: block; margin: 0 0 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--on-ink-2); }
.devbar__group + .devbar__group { margin-top: 12px; }
.devbar .seg { display: flex; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--on-ink-line); }
.devbar .seg__btn { flex: 1 1 0; color: var(--on-ink-2); min-height: 34px; padding: 0 8px; font-size: 13px; }
.devbar .seg__btn[aria-pressed="true"] { background: var(--paper-bright); color: var(--ink); box-shadow: none; }
.devbar__reset { width: 100%; min-height: 38px; margin-top: 14px; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--on-ink-line); color: #E7B9B3; font-size: 13px; }
.devbar__note { margin-top: 10px; font-size: 11px; line-height: 1.45; color: var(--on-ink-2); }

/* ── Sheets: a paper-haze scrim, the sheet rises as mist (its top edge dissolves) ──
   Overlay inset:0 (家規 4), content capped at the column, spring in. The sheet shell is transparent;
   the mist lives on ::before, which also reaches 80px below as the skirt under the spring overshoot.
   Scrim is paper haze, not dark ink: the page recedes instead of going dark. */
.sheet-ov { position: fixed; inset: 0; z-index: var(--z-sheet); }
.sheet-ov__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur-panel) var(--ease-out);
}
.sheet-ov.is-open .sheet-ov__scrim { opacity: 1; }
.sheet-ov.is-closing .sheet-ov__scrim { opacity: 0; transition-duration: 280ms; }
.sheet-ov__frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
}
@media (min-width: 600px) {
  .sheet-ov__frame { top: var(--frame-top); bottom: var(--frame-bottom); left: 0; right: 0; width: var(--col); margin-inline: auto; border-radius: 48px; }
}
.sheet {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--col);
  max-height: calc(100% - var(--status-h) - 12px);
  background: transparent;
  pointer-events: auto;
  transform: translateY(100%);
  transition: transform var(--dur-panel) var(--ease-spring);
  will-change: transform;
}
.sheet::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--mist-fade)) 0 -80px;   /* the dissolve sits above the sheet: grip + title on solid mist */
  z-index: -1;
  background: var(--mist-fill-strong);
  -webkit-backdrop-filter: var(--mist-blur);
  backdrop-filter: var(--mist-blur);
  -webkit-mask-image: linear-gradient(transparent, #000 var(--mist-fade));
  mask-image: linear-gradient(transparent, #000 var(--mist-fade));
  pointer-events: none;
}
.sheet-ov.is-open .sheet { transform: translateY(0); }
.sheet-ov.is-closing .sheet { transform: translateY(100%); transition: transform 300ms var(--ease-drawer); }
.sheet-ov.is-dragging .sheet { transition: none; }
.sheet--tall { height: min(760px, 86%); }
.sheet--full { height: calc(100% - 10px); max-height: none; }
.sheet:focus-visible { outline: none; }   /* the panel takes focus on open; its controls show focus */
/* .sheet--ink: legacy tone flag — sheets are mist now, the class renders the default sheet. */

.sheet__grip {
  position: relative;
  display: block;
  height: 24px;
  width: 100%;
  flex: 0 0 auto;
  cursor: grab;
  touch-action: none;
}
.sheet__grip::before { content: ""; position: absolute; left: 50%; top: 12px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
.sheet__grip:active { cursor: grabbing; }
.sheet__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 4px var(--gutter);
  min-height: 48px;
  flex: 0 0 auto;
  touch-action: none;
}
.sheet__title { flex: 1 1 auto; font-family: var(--font-display); font-size: 21px; font-weight: 300; line-height: 1.25; }
.sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px var(--gutter) 20px;
}
.sheet__actions {
  display: flex;
  gap: 12px;
  padding: 10px var(--gutter) 22px;
  flex: 0 0 auto;
}
.sheet__actions .btn { flex: 1 1 0; }

/* ── Wheel picker: scroll-snap columns, 44px rows, fade mask, drum tilt ─────────
   No card and no frame on the chosen row (L:「就不用框著這個選項了」): the chosen row reads by ink tone
   and size alone; a jade ring appears only for keyboard focus. Column labels (optional) 13px --ink-2. */
.wheel {
  position: relative;
  display: flex;
  gap: 2px;
  height: 220px;
  margin: 4px 0 8px;
  user-select: none;
  -webkit-user-select: none;
}
.wheel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 44px;
  margin-top: -22px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1.5px var(--jade);
  opacity: 0;
  pointer-events: none;
}
.wheel:has(.wheel__col:focus-visible)::before { opacity: 1; }
.wheel__labels { display: flex; gap: 2px; margin-top: 2px; }
.wheel__labels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: var(--fs-label); color: var(--ink-2); }
.wheel__labels span.is-narrow { flex: .8 1 0; }
.wheel__col {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  padding: 88px 0;
  perspective: 500px;
  -webkit-mask-image: linear-gradient(transparent, rgba(0, 0, 0, .35) 18%, #000 40%, #000 60%, rgba(0, 0, 0, .35) 82%, transparent);
  mask-image: linear-gradient(transparent, rgba(0, 0, 0, .35) 18%, #000 40%, #000 60%, rgba(0, 0, 0, .35) 82%, transparent);
  outline: none;
  cursor: grab;
}
.wheel__col.is-dragging { scroll-snap-type: none; cursor: grabbing; }   /* mouse drag; snaps on release */
.wheel__col--narrow { flex: .8 1 0; }
.wheel__item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-2);
  transition: color 120ms ease;
}
.wheel__item.is-sel { color: var(--ink); font-size: 20px; }
@supports (animation-timeline: view()) {
  .wheel__item { animation: ft-drum linear both; animation-timeline: view(); }
  @keyframes ft-drum {
    0% { transform: rotateX(-58deg) scale(.92); }
    50% { transform: none; }
    100% { transform: rotateX(58deg) scale(.92); }
  }
}
.picker__readout { margin: 2px 0 6px; text-align: center; font-size: var(--fs-sub); color: var(--ink-2); min-height: 1.5em; font-variant-numeric: tabular-nums; }

/* ── Place search ─────────────────────────────────────────────────────────── */
.place { display: flex; flex-direction: column; min-height: 100%; }
.place__bar { position: sticky; top: -4px; z-index: 1; padding: 4px 0 14px; background: linear-gradient(var(--mist-fill-solid) 72%, transparent); }
.place__input-wrap { position: relative; }
.place__input-wrap svg { position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--ink-3); pointer-events: none; }
.place__input { padding-left: 28px; }
.place__list { list-style: none; padding: 0; margin: 0; }
.place__opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 0;
  cursor: pointer;
  transition: opacity 120ms ease;
}
.place__opt + .place__opt::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); }
.place__opt.is-active { box-shadow: inset 2px 0 0 var(--ink); padding-left: 12px; }
.place__opt:active { opacity: .6; }
.place__name { font-size: 16px; font-weight: 400; line-height: 1.3; }
.place__sub { font-size: var(--fs-caption); color: var(--ink-2); line-height: 1.35; }
.place__main { flex: 1 1 auto; min-width: 0; }
.place__tz { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.place__check { width: 18px; height: 18px; color: var(--ink); }
.place__hl { background: none; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
@media (hover: hover) and (pointer: fine) { .place__opt:hover { opacity: .78; } }

/* ── Empty / skeleton ─────────────────────────────────────────────────────── */
.empty { display: grid; justify-items: center; gap: 10px; padding: 36px 0; text-align: center; }
.empty svg { width: 56px; height: 56px; color: var(--ink-3); }
.empty__title { font-family: var(--font-display); font-size: 20px; font-weight: 300; }
.empty__body { font-size: var(--fs-small); color: var(--ink-2); max-width: 30ch; }
.skel {
  display: block;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--wash) 30%, rgba(21, 23, 19, .015) 50%, var(--wash) 70%);
  background-size: 250% 100%;
  animation: ft-shimmer 1.5s linear infinite;
}
.skel--line { height: 12px; margin: 8px 0; }
.skel--title { height: 22px; width: 60%; margin: 6px 0 12px; }
@keyframes ft-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ── Toast: the ink pill, transient ───────────────────────────────────────── */
.toast {
  position: fixed;
  z-index: var(--z-toast);
  left: 0;
  right: 0;
  bottom: calc(var(--sab) + 24px);
  width: max-content;
  max-width: min(calc(100% - 2 * var(--gutter)), calc(var(--col) - 2 * var(--gutter)));
  margin-inline: auto;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(21, 23, 19, .9);
  color: var(--paper-bright);
  font-size: var(--fs-small);
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity 220ms var(--ease-out), transform 320ms var(--ease-out);
}
body[data-tab] .toast { bottom: calc(var(--nav-h) + var(--sab) + 14px); }
.toast.is-on { opacity: 1; transform: none; }

/* ── Reduced motion: keep fades, drop movement ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-ov.is-open .sheet, .sheet-ov.is-closing .sheet { transform: none; transition: opacity 200ms ease; }
  .sheet { opacity: 0; }
  .sheet-ov.is-open .sheet { opacity: 1; }
  .sheet-ov.is-closing .sheet { opacity: 0; }
  .wheel__item { animation: none !important; }
  .toast, .toast.is-on { transform: none; }
  .btn:active, .icon-btn:active, .chip:active, .opt:active, .tab:active svg { transform: none; }
  .opt__check { transform: none; filter: none; }
  .skel { animation: none; }
  .devbar__panel[hidden] { transform: none; }
}

/* ── Brand seal (知命) — the mark; never recoloured, stretched or rotated ────── */
.seal {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 7px;
  background: var(--seal);
  color: var(--paper-bright);
  font-family: var(--font-glyph);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  box-shadow: inset 0 0 0 1.5px rgba(248, 246, 239, .5), inset 0 0 0 3px var(--seal);
  flex-shrink: 0;
}
.seal--sm { width: 30px; height: 30px; font-size: 11px; border-radius: 5px; padding: 2px; }

/* ── Button arrows: bare brush chevron at the far right (L-confirmed 2026-09-26 — KEEP) ─────────────
   L:「按鈕所有箭頭都不要有外圈和背景色, 箭頭放在最右方不要擠在一起」+「箭頭都用我們上一版的 毛筆風格箭頭」.
   Every .btn__icon is the V2 ink-stroke chevron (assets/icons/ink-chevron.svg, drawn in currentColor), no ring,
   no fill, pinned to the button's right edge so the label stays centred on its own. */
.btn:has(> .btn__icon) { position: relative; padding-inline: 48px; }
.btn__icon,
.btn--secondary .btn__icon, .btn--ghost .btn__icon {
  position: absolute; right: 20px; top: 50%;
  width: 12px; height: 14px; margin: -7px 0 0;
  border-radius: 0;
  background: currentColor;
  opacity: .9;
  -webkit-mask: url("../assets/icons/ink-chevron.svg") center / contain no-repeat;
  mask: url("../assets/icons/ink-chevron.svg") center / contain no-repeat;
}
.btn__icon svg { display: none; }
