/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio, geometry.
   Put this @layer first; product CSS outside the layer wins ordinary layout rules.
   Native hidden and closed-dialog states take precedence over component display rules. */
@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }

  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  /* containers */
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  /* stacked information: each piece is its own line — never sibling inline spans */
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  /* media keeps its intrinsic ratio by default; never a distorted or cropped
     cover by accident. height:auto lets the ratio win over an <img height="…">
     attribute. Cropping to a uniform box is an explicit opt-in: set --od-ratio
     AND add .od-media-cover together (per the core rule, only where a crop is
     deliberate — tile thumbs, decorative fills — never on full-frame content). */
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  /* functional inline SVG icons opt into bounded geometry; content SVGs keep their own */
  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }

  /* data text only — authored copy is rewritten to its budget instead */
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }   /* block-level reservation for a shared baseline */
  .od-nowrap  { white-space: nowrap; }           /* 数字+单位 · 价格+起 · 日期+星期 */
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; } /* CJK labels break at spaces / <wbr> first */

  /* screen skeleton (optional): bars take their own space, the middle scrolls — no padding guessed for chrome */
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  /* horizontal rail: the next item peeks at the edge; trailing room survives overflow */
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none; }
/* /OD-LAYOUT-PRIMITIVES v1 */

/* ------------------------------------------------------------ Apple tokens
   Token values follow the Apple design-system contract. Product CSS below
   references these by name only; raw colors stay inside this block. */
:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-warm: #fbfbfd;

  --fg: #1d1d1f;
  --fg-2: #424245;
  --muted: #6e6e73;
  --meta: #86868b;

  --border: #d2d2d7;
  --border-soft: #e8e8ed;

  --accent: #0071e3;
  --accent-on: #ffffff;
  --accent-hover: #0077ed;
  --accent-active: #0066cc;

  --success: #16a34a;
  --warn: #eab308;
  --danger: #dc2626;

  --font-display: "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 17px;
  --text-lg: 21px;
  --text-xl: 28px;
  --text-2xl: 40px;
  --text-3xl: 56px;
  --text-4xl: 80px;

  --leading-body: 1.47;
  --leading-tight: 1.05;

  --tracking-display: -0.015em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  --section-y-desktop: 100px;
  --section-y-tablet: 64px;
  --section-y-phone: 40px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 980px;

  --elev-flat: none;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 12px 32px rgba(0, 0, 0, 0.08);

  --focus-ring: 0 0 0 4px color-mix(in oklab, var(--accent), transparent 65%);

  --motion-fast: 150ms;
  --motion-base: 220ms;
  --ease-standard: cubic-bezier(0.28, 0, 0.22, 1);
}

/* ------------------------------------------------------- liquid glass layer */
:root {
  --haze-sky: rgba(186, 226, 255, 0.58);
  --haze-blue: rgba(41, 151, 255, 0.22);
  --haze-deep: rgba(0, 113, 227, 0.13);
  --haze-warm: rgba(255, 243, 224, 0.62);

  --glass-fill: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-card: rgba(255, 255, 255, 0.82);
  --glass-fill-opaque: rgba(255, 255, 255, 0.94);
  --glass-line: rgba(255, 255, 255, 0.72);
  --glass-line-strong: rgba(255, 255, 255, 0.9);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 18px 50px rgba(24, 60, 110, 0.14);
  --glass-soft: 0 8px 24px rgba(24, 60, 110, 0.10);
  --glass-blur: blur(24px) saturate(180%);

  --thumb: rgba(255, 255, 255, 0.88);
  --scrim: rgba(16, 32, 56, 0.24);
  --grabber: rgba(60, 60, 67, 0.28);
  --toast-bg: rgba(29, 29, 31, 0.78);
  --dot-grid: rgba(29, 29, 31, 0.10);

  --orb-specular: rgba(255, 255, 255, 0.92);
  --orb-reflect: rgba(255, 255, 255, 0.28);
  --orb-line: rgba(255, 255, 255, 0.5);
  --accent-deep: #0059b3;

  --tone-navy-light: #7EA8D8;
  --tone-navy-core: #1D4F96;
  --tone-navy-deep: #0A2B5C;
  --tone-navy-paper: #EAF2FC;
  --tone-navy-ink: #0D2D5A;
  --tone-navy-line: rgba(13, 45, 90, 0.16);

  --tone-red-light: #F08C7E;
  --tone-red-core: #C42A22;
  --tone-red-deep: #74120E;
  --tone-red-paper: #FBEAE7;
  --tone-red-ink: #6E130E;
  --tone-red-line: rgba(110, 19, 14, 0.16);

  --tone-obsidian-light: #747881;
  --tone-obsidian-core: #2A2C31;
  --tone-obsidian-deep: #0B0C0F;
  --tone-obsidian-paper: #16171A;
  --tone-obsidian-ink: #ECEDF1;
  --tone-obsidian-line: rgba(236, 237, 241, 0.16);

  --tone-ivory-light: #FCF5E6;
  --tone-ivory-core: #DCC69D;
  --tone-ivory-deep: #B28F5C;
  --tone-ivory-paper: #FCF7EC;
  --tone-ivory-ink: #3E301A;
  --tone-ivory-line: rgba(62, 48, 26, 0.16);

  --tone-green-light: #86C7AA;
  --tone-green-core: #2E7A5D;
  --tone-green-deep: #0F4635;
  --tone-green-paper: #ECF7F0;
  --tone-green-ink: #0E3A2B;
  --tone-green-line: rgba(14, 58, 43, 0.16);
}

[data-tone="navy"] {
  --tone-light: var(--tone-navy-light);
  --tone-core: var(--tone-navy-core);
  --tone-deep: var(--tone-navy-deep);
  --tone-paper: var(--tone-navy-paper);
  --tone-ink: var(--tone-navy-ink);
  --tone-line: var(--tone-navy-line);
}
[data-tone="red"] {
  --tone-light: var(--tone-red-light);
  --tone-core: var(--tone-red-core);
  --tone-deep: var(--tone-red-deep);
  --tone-paper: var(--tone-red-paper);
  --tone-ink: var(--tone-red-ink);
  --tone-line: var(--tone-red-line);
}
[data-tone="obsidian"] {
  --tone-light: var(--tone-obsidian-light);
  --tone-core: var(--tone-obsidian-core);
  --tone-deep: var(--tone-obsidian-deep);
  --tone-paper: var(--tone-obsidian-paper);
  --tone-ink: var(--tone-obsidian-ink);
  --tone-line: var(--tone-obsidian-line);
}
[data-tone="ivory"] {
  --tone-light: var(--tone-ivory-light);
  --tone-core: var(--tone-ivory-core);
  --tone-deep: var(--tone-ivory-deep);
  --tone-paper: var(--tone-ivory-paper);
  --tone-ink: var(--tone-ivory-ink);
  --tone-line: var(--tone-ivory-line);
}
[data-tone="green"] {
  --tone-light: var(--tone-green-light);
  --tone-core: var(--tone-green-core);
  --tone-deep: var(--tone-green-deep);
  --tone-paper: var(--tone-green-paper);
  --tone-ink: var(--tone-green-ink);
  --tone-line: var(--tone-green-line);
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--surface); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--fg); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow), var(--glass-inner);
}
.glass--strong { background: var(--glass-strong); }
.steps, .tone-chip, .history-pill, .ghost-btn { box-shadow: var(--glass-soft), var(--glass-inner); }

/* ---------------------------------------------------------------- ambient */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--surface);
}
.ambient::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(42% 34% at 12% 4%, var(--haze-sky) 0%, transparent 68%),
    radial-gradient(36% 30% at 90% 10%, var(--haze-blue) 0%, transparent 70%),
    radial-gradient(52% 38% at 52% 66%, var(--haze-deep) 0%, transparent 72%),
    radial-gradient(34% 28% at 4% 88%, var(--haze-warm) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.ambient-rings {
  position: absolute;
  top: -140px;
  right: -190px;
  width: 700px;
  height: 700px;
  color: var(--fg);
  opacity: .05;
}

/* ------------------------------------------------------------------- app */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 calc(20px + env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  margin-top: calc(12px + env(safe-area-inset-top));
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 4px 14px rgba(24, 60, 110, .08), 0 0 0 1px rgba(255, 255, 255, .9), var(--glass-inner);
}
.brand-swap {
  display: grid;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
}
.brand {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  animation: swap-lockup 7s ease-in-out infinite;
}
.brand-theme {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: swap-theme 7s ease-in-out infinite;
}
.brand-theme img {
  display: block;
  width: auto;
  height: 28px;
}
.brand-logo { display: block; width: auto; flex: none; }
.brand-logo--bayvis { height: 28px; }
.tedx-lockup { display: flex; align-items: flex-end; gap: 4px; flex: none; }
.tedx-word { display: block; width: auto; height: 20px; }
.tedx-city { display: block; width: auto; height: 15px; }
.brand-x {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------ hero */
.hero { padding-top: 30px; }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 9.4vw, 40px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.h1-line { display: block; }
.h1-orb {
  display: inline-block;
  width: .24em;
  height: .24em;
  margin-left: .08em;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, var(--orb-specular) 0 12%, transparent 42%),
    radial-gradient(circle at 50% 62%, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 1px var(--orb-specular);
  vertical-align: baseline;
  transform: translateY(-.02em);
}
.sub {
  max-width: 32em;
  margin: 14px 0 0;
  font-size: var(--text-base);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.steps {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 22px 0 0;
  padding: 5px;
  border-radius: var(--radius-pill);
  list-style: none;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition: background var(--motion-base) var(--ease-standard), color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}
.step-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--muted);
}
.step[aria-current="step"] {
  background: var(--thumb);
  color: var(--fg);
  box-shadow: 0 1px 5px rgba(24, 60, 110, .10), inset 0 1px 0 var(--glass-line-strong);
}
.step[aria-current="step"] .step-idx { color: var(--accent); }
.step.is-done { color: var(--fg-2); }
.step.is-done .step-idx { color: var(--muted); }

/* --------------------------------------------------------------- section */
.studio { margin-top: 32px; }
.workbench { margin-top: 30px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-heading { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.section-id {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .01em;
  color: var(--accent);
}
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.section-note {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------ tone bubbles */
.tone-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.tone-fieldset:disabled .tone-label { opacity: .5; cursor: default; }
.tone-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.tone-label {
  position: relative;
  flex: 0 0 calc((100% - 16px) / 3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 2px;
  border-radius: 24px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.tone-input:focus-visible { outline: none; }

.tone-orb {
  position: relative;
  width: clamp(84px, 24vw, 100px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 68% 84%, var(--orb-reflect) 0 7%, transparent 30%),
    radial-gradient(circle at 50% 58%, var(--tone-light) 0%, var(--tone-core) 54%, var(--tone-deep) 100%);
  border: 1px solid var(--orb-line);
  box-shadow:
    inset 0 1px 2px var(--orb-specular),
    inset 0 -14px 22px rgba(0, 0, 0, .16),
    0 16px 30px color-mix(in srgb, var(--tone-deep) 26%, transparent);
  transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
  isolation: isolate;
}
.tone-orb::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 6%;
  width: 34%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--orb-specular), transparent 70%);
  filter: blur(1.5px);
  transform: rotate(-20deg);
  transition: transform .3s var(--ease-standard);
  z-index: 2;
  pointer-events: none;
}
.tone-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.tone-photo img {
  display: block;
  width: 88%;
  height: auto;
  filter: blur(.25px) contrast(1.07) saturate(1.08) drop-shadow(0 3px 7px rgba(24, 60, 110, .24));
}
.tone-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .10), inset 0 1px 2px rgba(255, 255, 255, .34);
  pointer-events: none;
}
.tone-check {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-on);
  border: 2px solid var(--bg);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 35%, transparent);
  opacity: 0;
  transform: scale(.7);
  transition: opacity var(--motion-base) var(--ease-standard), transform var(--motion-base) var(--ease-standard);
}
.tone-check .od-icon { --od-icon-size: 13px; }
.tone-input:checked + .tone-orb {
  transform: scale(1.03);
  box-shadow:
    inset 0 1px 2px var(--orb-specular),
    inset 0 -14px 22px rgba(0, 0, 0, .16),
    0 0 0 3px var(--bg),
    0 0 0 5px var(--accent),
    0 16px 30px color-mix(in srgb, var(--tone-deep) 30%, transparent);
}
.tone-input:checked + .tone-orb .tone-check { opacity: 1; transform: scale(1); }
.tone-input:focus-visible + .tone-orb { outline: 3px solid var(--accent); outline-offset: 6px; }
.tone-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.tone-input:checked ~ .tone-name { font-weight: 600; }
.tone-serial {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .06em;
  color: var(--muted);
}
.tone-input:checked ~ .tone-serial { color: var(--fg-2); }
.tone-note {
  margin: 12px 0 0;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--muted);
}
.tone-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--muted);
  white-space: nowrap;
}
.tone-chip.is-set { color: var(--fg); }
.tone-chip .dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--tone-core, var(--border));
  box-shadow: inset 0 1px 1px var(--orb-specular);
}

/* ----------------------------------------------------------------- canvas */
.glass-tray {
  padding: 8px;
  border-radius: 28px;
}
.canvas-paper {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  aspect-ratio: 1 / 1.06;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}
.canvas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.canvas-stage {
  position: relative;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot-grid) 1px, transparent 1.2px);
  background-size: 18px 18px;
  background-position: center;
  touch-action: none;
}
#sketch {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
#sketch:focus-visible { outline: 3px solid var(--accent); outline-offset: -6px; }
.canvas-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
  transition: opacity var(--motion-base) var(--ease-standard), visibility var(--motion-base) var(--ease-standard);
}
.canvas-hint.is-hidden { opacity: 0; visibility: hidden; }
.hint-orb {
  width: 52px;
  height: 52px;
  margin-bottom: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 24px rgba(24, 60, 110, .10), var(--glass-inner);
  color: var(--muted);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hint-orb .od-icon { --od-icon-size: 22px; }
.hint-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.hint-sub {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--muted);
}

.gen-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.gen-scan {
  position: absolute;
  inset: 0;
  border-top: 1.5px solid var(--accent);
  transform: translateY(-100%);
  animation: scan 2.6s var(--ease-standard) infinite;
  pointer-events: none;
}
.gen-scan::after {
  content: "";
  position: absolute;
  top: -4px;
  right: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
@keyframes scan { to { transform: translateY(100%); } }
.gen-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}
.gen-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .06em;
  color: var(--accent-active);
}
.gen-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.gen-sub {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--muted);
}

/* ------------------------------------------------------------------- dock */
.dock {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 12px auto 0;
  padding: 6px;
  border-radius: var(--radius-pill);
}
.brush-group { display: flex; align-items: center; gap: 4px; }
.dock-btn {
  appearance: none;
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), transform 110ms var(--ease-standard), opacity var(--motion-fast);
}
.dock-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--bg) 50%, transparent); }
.dock-btn:active:not(:disabled) { transform: scale(.92); transition-duration: 80ms; }
.dock-btn[aria-pressed="true"] {
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 2px 7px rgba(24, 60, 110, .12), 0 0 0 .5px rgba(24, 60, 110, .07);
}
.dock-btn:disabled { opacity: .32; cursor: not-allowed; }
.dock-btn.tool { color: var(--fg); }
.dock-btn .od-icon { --od-icon-size: 18px; }
.brush-dot {
  display: block;
  width: var(--d, 4px);
  height: var(--d, 4px);
  border-radius: 50%;
  background: currentColor;
}
.dock-divider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  flex: none;
  background: var(--border);
}
.dock .tool-actions { display: flex; gap: 4px; }

/* ---------------------------------------------------------------- actions */
.actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 14px;
}
.cta {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-on);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.012em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 40, 90, .18);
  transition: background var(--motion-fast) var(--ease-standard), transform 120ms var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
}
.cta:hover:not(:disabled) { background: var(--accent-hover); }
.cta:active:not(:disabled) {
  background: var(--accent-active);
  transform: scale(.972);
  transition-duration: 90ms;
}
.cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
}
.cta:disabled {
  background: color-mix(in srgb, var(--fg) 7%, var(--bg));
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}
.cta .od-icon { --od-icon-size: 16px; }
.cta:disabled .od-icon { color: var(--meta); }
.cta--small { flex: none; height: 48px; padding: 0 26px; font-size: 15px; }
.cta--sheet { flex: 1 1 auto; height: 48px; padding: 0 12px; font-size: 15px; }

.history-pill {
  appearance: none;
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  color: var(--accent-active);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.012em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--border), var(--glass-inner);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  transition: background var(--motion-fast) var(--ease-standard), transform 120ms var(--ease-standard), opacity var(--motion-fast);
}
.history-pill:hover:not(:disabled) { background: color-mix(in srgb, var(--bg) 86%, transparent); }
.history-pill:active:not(:disabled) { transform: scale(.96); transition-duration: 90ms; }
.history-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--border), 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
}
.history-pill:disabled { opacity: .45; cursor: not-allowed; }
.history-pill .od-icon { --od-icon-size: 16px; color: var(--accent); }
.count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent-active);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.count.is-empty {
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  color: var(--muted);
}
.ghost-btn {
  appearance: none;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  color: var(--accent-active);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.012em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--border), var(--glass-inner);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  transition: background var(--motion-fast) var(--ease-standard), transform 120ms var(--ease-standard);
}
.ghost-btn:hover { background: color-mix(in srgb, var(--bg) 86%, transparent); }
.ghost-btn:active { transform: scale(.96); transition-duration: 90ms; }
.ghost-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--border), 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* --------------------------------------------------------------- closing */
.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.closing-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  flex: none;
  margin-left: auto;
  padding-bottom: 2px;
}
.closing-brand .tedx-lockup { gap: 3px; }
.closing-brand .tedx-word { height: 18px; }
.closing-brand .tedx-city { height: 13px; }
.closing-brand .closing-bayvis { display: block; width: auto; height: 21px; }
.closing-title {
  flex: none;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 8.6vw, 36px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
}

/* ---------------------------------------------------------------- sheets */
.sheet {
  width: 100%;
  max-width: 430px;
  max-height: 92svh;
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  background: var(--glass-strong);
  color: var(--fg);
  border: 1px solid var(--glass-line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px rgba(24, 60, 110, .18), var(--glass-inner);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  animation: sheet-in .34s var(--ease-standard);
}
.sheet::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: scrim-in .3s var(--ease-standard);
}
.grabber {
  width: 36px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: var(--radius-pill);
  background: var(--grabber);
}
.sheet-inner { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 16px;
}
.sheet-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.sheet-head-right { display: flex; align-items: center; gap: 8px; }
.sheet-count {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}
.sheet-close {
  appearance: none;
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--glass-fill);
  border: 1px solid var(--glass-line);
  color: var(--fg);
  box-shadow: var(--glass-inner);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), transform 110ms var(--ease-standard);
}
.sheet-close:hover { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.sheet-close:active { transform: scale(.92); transition-duration: 80ms; }
.sheet-close:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.sheet-close .od-icon { --od-icon-size: 16px; }

.poster {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--tone-paper);
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 30px rgba(24, 60, 110, .12);
}
.poster-art { background: var(--tone-paper); }
.poster-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--tone-paper);
}
.poster-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--tone-line);
  background: var(--tone-paper);
  color: var(--tone-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .04em;
}
.poster-meta span:last-child { white-space: nowrap; }
.result-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.sheet-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 0;
}
.sheet-link {
  appearance: none;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--accent-active);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity var(--motion-fast) var(--ease-standard);
}
.sheet-link:active { opacity: .6; }
.sheet-link.is-danger { color: var(--muted); }
.sheet-link:disabled { opacity: .45; cursor: not-allowed; }
.sheet-link-sep { color: var(--meta); font-size: 12px; line-height: 1; }
.sheet-links.is-local .sheet-link-sep { display: none; }

.history-body { margin-top: 2px; }
.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1px 1px 4px;
}
.history-item {
  appearance: none;
  display: flex;
  flex-direction: column;
  padding: 4px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--glass-card);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-inner);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}
.history-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
}
.history-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 6px 5px;
}
.history-serial {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .04em;
  color: var(--muted);
}
.history-tone {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
  white-space: nowrap;
}
.history-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 8px 16px;
  text-align: center;
}
.empty-orb {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, var(--orb-specular) 0 10%, transparent 42%),
    radial-gradient(circle at 50% 60%, var(--haze-sky) 0%, var(--accent) 100%);
  border: 1px solid var(--orb-line);
  box-shadow: inset 0 1px 2px var(--orb-specular), inset 0 -12px 20px rgba(0, 0, 0, .12), 0 16px 30px rgba(0, 113, 227, .18);
  color: var(--orb-line);
  overflow: hidden;
}
.empty-orb svg { width: 72%; height: 72%; }
.empty-title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.empty-copy {
  max-width: 22em;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.sheet-note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--muted);
}

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 4px 6px 4px 16px;
  border-radius: var(--radius-pill);
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: var(--accent-on);
  font-size: var(--text-sm);
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(16, 32, 56, .24);
  animation: toast-in .24s var(--ease-standard);
}
.toast button {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--accent-on);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.toast button:focus-visible { outline-color: var(--accent-on); }

/* ----------------------------------------------- crisp glass (no blur) */
/* iOS rasterises children of a backdrop-filter layer at 1x, which softens
   type and logos. Content panels keep the translucent look without it. */
.steps, .tone-chip, .glass-tray, .dock, .sheet, .hint-orb,
.history-pill, .ghost-btn, .sheet-close, .toast {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.sheet { background: color-mix(in srgb, var(--bg) 96%, transparent); }
.sheet::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
.toast { background: color-mix(in srgb, var(--fg) 94%, transparent); }
.glass-tray, .dock { background: color-mix(in srgb, var(--bg) 90%, transparent); }

/* --------------------------------------------------- liquid glass lighting */
.cta, .history-pill, .ghost-btn, .dock-btn, .sheet-close {
  position: relative;
  isolation: isolate;
}
.cta::after, .history-pill::after, .ghost-btn::after, .dock-btn::after, .sheet-close::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%),
    rgba(255, 255, 255, .58) 0%,
    rgba(255, 255, 255, .2) 40%,
    rgba(255, 255, 255, 0) 72%);
  opacity: 0;
  transition: opacity 300ms var(--ease-standard);
  pointer-events: none;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .08) 36%, rgba(255, 255, 255, 0) 64%),
    radial-gradient(140% 110% at 50% -30%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 62%);
  pointer-events: none;
}
.cta:disabled::before { display: none; }
.cta::after {
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%),
    rgba(255, 255, 255, .5) 0%,
    rgba(255, 255, 255, .16) 44%,
    rgba(255, 255, 255, 0) 72%);
}
.cta.is-lit::after,
.history-pill.is-lit::after,
.ghost-btn.is-lit::after,
.dock-btn.is-lit::after,
.sheet-close.is-lit::after {
  opacity: 1;
  transition-duration: 80ms;
}
.history-pill, .ghost-btn {
  box-shadow:
    0 0 0 1px var(--border),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -10px 16px rgba(24, 60, 110, .05);
}
.dock-btn[aria-pressed="true"] {
  box-shadow:
    0 2px 7px rgba(24, 60, 110, .12),
    0 0 0 .5px rgba(24, 60, 110, .07),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* ---------------------------------------------------------------- motion */
.reveal { animation: rise .5s var(--ease-standard) both; }
.hero .reveal:nth-child(2) { animation-delay: .04s; }
.hero .reveal:nth-child(3) { animation-delay: .08s; }
.hero .reveal:nth-child(4) { animation-delay: .12s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px) scale(.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes swap-lockup {
  0%, 44%   { opacity: 1; }
  47%       { opacity: 0; }
  94%       { opacity: 0; }
  97%, 100% { opacity: 1; }
}
@keyframes swap-theme {
  0%, 46%   { opacity: 0; }
  49%, 92%  { opacity: 1; }
  95%, 100% { opacity: 0; }
}

@media (hover: hover) {
  .tone-label:hover .tone-orb { transform: scale(1.02); }
  .tone-label:hover .tone-orb::before { transform: rotate(-20deg) translate(4px, -2px); }
  .tone-input:checked + .tone-orb { transform: scale(1.03); }
  .history-item:hover { transform: translateY(-1px); border-color: var(--glass-line-strong); }
}
@media (hover: none) {
  .cta:hover:not(:disabled) { background: var(--accent); }
  .history-pill:hover:not(:disabled) { background: color-mix(in srgb, var(--bg) 58%, transparent); }
  .ghost-btn:hover { background: color-mix(in srgb, var(--bg) 58%, transparent); }
  .dock-btn:hover:not(:disabled) { background: transparent; }
  .sheet-close:hover { background: var(--glass-fill); }
}
.tone-label:active .tone-orb { transform: scale(.98); }
.tone-input:checked + .tone-orb { transform: scale(1.03); }

/* small screens: lighter frost so type and line art stay crisp */
@media (max-width: 640px) {
  :root {
    --glass-blur: blur(16px) saturate(155%);
    --glass-fill: rgba(255, 255, 255, 0.72);
    --glass-strong: rgba(255, 255, 255, 0.86);
  }
  .steps, .tone-chip, .sheet-close, .history-pill, .ghost-btn {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* --------------------------------------------------------------- fallback */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-tray, .topbar, .dock, .history-pill, .tone-chip, .steps, .sheet, .sheet-close {
    background: var(--glass-fill-opaque);
  }
  .sheet { background: var(--bg); }
  .toast { background: var(--fg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .gen-scan { display: none; }
  .brand, .brand-theme { animation: none !important; }
  .brand-theme { opacity: 0; }
  .cta::after, .history-pill::after, .ghost-btn::after,
  .dock-btn::after, .sheet-close::after { display: none; }
}

/* ===== 本地化覆盖：宽幅票根（1875×688 ≈ 2.725:1）展示 ===== */
/* 结果弹层里的成稿是超宽票根，去掉导出稿默认的 1:1 方块约束 */
.poster-art img {
  aspect-ratio: auto !important;
  height: auto !important;
  background: #0a0a0a;
}
/* 历史缩略图同样是宽幅票根 */
.history-item img {
  aspect-ratio: auto;
  height: auto;
}

/* 配额 / 状态行（后端下发 maxGen / 免费额度） */
.status {
  margin: 10px 6px 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.status.limit { color: var(--danger); font-weight: 600; }
.status:empty { display: none; }
.status b { color: var(--fg-2); font-weight: 600; }

/* 生成中遮罩里的文字 */
.gen-copy { color: var(--fg-2); }
.gen-kicker { font-family: var(--font-mono); letter-spacing: .12em; font-size: 11px; color: var(--accent); }
.gen-title { font-size: 17px; font-weight: 600; color: var(--fg); margin: 2px 0; }
.gen-sub { font-size: 13px; color: var(--muted); }

/* 修复作画区高度塌陷：原 .canvas-paper 的 aspect-ratio + grid 1fr 链在无显式约束时会循环塌成 0 */
.canvas-paper { grid-template-rows: minmax(300px, 1fr); }
.canvas-stage { min-height: 300px; }
