:root {
  color-scheme: light;
  --bg: #FBF7F5;
  --bg-sunk: #F5EEEB;
  --surface: #FFFFFF;
  --ink: #2A2028;
  --ink-2: #5A4F58;
  --ink-3: #7D7178;
  --line: #EDE3DF;
  --line-2: #DFD0CC;
  --accent: #D6336C;
  --accent-ink: #A61E4D;
  --accent-tint: #FDEEF3;
  --amber: #FFB43D;
  --coral: #FF7A6B;
  --sky: #4DABF7;
  --mint: #12B886;
  --r-card: 16px;
  --r-ctl: 10px;
  --topbar-h: 69px;
  --wb-top: 12px;
  --dock-h: 58px;
  --rail-w: 64px;
  --sh-1: 0 1px 2px rgba(42, 32, 40, .06);
  --sh-2: 0 1px 2px rgba(42, 32, 40, .05), 0 14px 30px -20px rgba(42, 32, 40, .35);
  --peg: radial-gradient(circle at 50% 50%, rgba(42, 32, 40, .07) 1.6px, transparent 1.9px);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
#main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
img, canvas { display: block; max-width: 100%; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--surface); padding: 10px 16px; border-radius: 0 0 var(--r-ctl) 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(251, 247, 245, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
}
.brand-beads {
  width: 21px; height: 21px; flex: 0 0 auto;
}
.brand-logo {
  height: var(--brand-h, 34px); width: auto;
  flex: 0 0 auto;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; flex: 0 1 auto; min-width: 0; }
.topbar-actions > * { flex: 0 0 auto; }
.topbar-actions > .acct { flex: 0 1 auto; min-width: 0; }
.btn-fb { gap: 5px; }
.btn-fb .fb-ico { font-size: 15px; line-height: 1; }
.btn-abbr { display: none; }
@media (max-width: 560px) {
  .btn-fb .fb-ico { display: none; }
  .btn-fb { padding: 9px 11px; }
}
@media (max-width: 520px) {
  .btn-full { display: none; }
  .btn-abbr { display: inline; }
}

.code-bar {
  flex: 0 0 auto; min-width: 0; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 0 2px; border-top: 1px solid var(--line);
}
.sb-kinds {
  flex: 0 0 auto; display: flex; align-items: baseline; gap: 4px;
  color: var(--ink-3); font-size: 12.5px; white-space: nowrap;
}
.sb-kinds b {
  font-size: 17px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.sb-chips {
  flex: 1 1 auto; min-width: 0;
  height: 42px;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 0;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  overscroll-behavior-x: contain;
}
.sb-chips::-webkit-scrollbar { height: 8px; }
.sb-chips::-webkit-scrollbar-track { background: transparent; }
.sb-chips::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 999px;
  border: 2px solid transparent; background-clip: padding-box;
}
.sb-chips::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; }
.sb-chips.is-dragging { cursor: grabbing; user-select: none; }
.sb-chips.is-dragging .sb-chip { pointer-events: none; }
.sb-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 9px 0 7px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.sb-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.sb-chip .sb-bead {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55), inset 0 0 0 4px rgba(42, 32, 40, .07);
  border: 1px solid rgba(42, 32, 40, .12);
}
.sb-chip .sb-code { font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sb-chip .sb-num { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sb-chip.is-picked,
.sb-chip.is-picked:hover {
  background: var(--accent-tint); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 620;
}
.sb-chip.is-picked .sb-num { color: var(--accent-ink); }

.dl-menu { position: relative; }
.dl-sum { list-style: none; cursor: pointer; }
.dl-sum::-webkit-details-marker { display: none; }
.dl-sum::after {
  content: ""; width: 0; height: 0; margin-left: 2px;
  border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px);
}
.dl-menu[open] > .dl-sum { border-color: var(--ink-3); color: var(--ink); }
.dl-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-ctl); box-shadow: var(--sh-2);
  display: flex; flex-direction: column; gap: 2px;
}
.dl-item {
  border: 0; background: transparent; border-radius: 8px;
  padding: 8px 10px; text-align: left; font-size: 14px; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
}
.dl-item:hover { background: var(--bg-sunk); color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  padding: 9px 16px; background: transparent;
  font-weight: 560; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--sh-1); }
.btn-primary:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--line-2); color: #fff; cursor: not-allowed; transform: none; }
.btn-ghost { border-color: var(--line-2); background: var(--surface); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-soft {
  background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent);
}
.btn-soft:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-1px); }
.btn-soft:disabled { background: var(--bg-sunk); color: var(--ink-3); border-color: var(--line-2); cursor: not-allowed; transform: none; }
.btn-mini { padding: 5px 10px; font-size: 13px; border-color: var(--line-2); background: var(--surface); color: var(--ink-2); }
.btn-mini:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-block { width: 100%; padding: 13px 16px; font-size: 16px; }
.link-like { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.hero {
  max-width: 1080px; margin: 0 auto; padding: clamp(28px, 6vh, 64px) 20px 48px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(28px, 4vw, 56px); align-items: center;
  flex: 1 1 auto; width: 100%; align-content: center;
}
.hero-copy { min-width: 0; }
.hero-act { min-width: 0; text-align: center; }
.hero-title { font-size: clamp(30px, 3.4vw, 46px); font-weight: 720; letter-spacing: -.03em; }
.hero-kicker {
  display: block; width: fit-content; margin-bottom: 14px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink); font-size: 13.5px; font-weight: 600;
  letter-spacing: .06em;
}
.hero-sub { margin: 16px 0 20px; max-width: 46ch; color: var(--ink-2); font-size: 16.5px; }

.notice-mask { padding: 24px; }
.notice-card {
  width: min(480px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh-2); overflow: hidden;
}
.notice-top {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line);
}
.notice-head {
  flex: 1 1 auto; min-width: 0;
  font-size: 18px; font-weight: 660; letter-spacing: -.01em;
}
.notice-x {
  flex: none; width: 32px; height: 32px; padding: 0;
  background: none; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 21px; line-height: 1; cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.notice-x:hover { background: var(--bg-sunk); color: var(--ink); }
.notice-main { padding: 20px 22px; overflow-y: auto; }
.notice-text {
  white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--ink-2); font-size: 15px; line-height: 1.75;
}
.notice-text:empty { display: none; }
.notice-foot {
  flex: none; display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--line);
}
.notice-ok { min-width: 104px; }
@media (max-width: 480px) {
  .notice-top { padding: 12px 12px 12px 18px; }
  .notice-head { font-size: 17px; }
  .notice-main { padding: 18px; }
  .notice-foot { padding: 12px 18px 16px; }
  .notice-foot .btn { flex: 1 1 0; min-width: 0; }
}

.dropzone {
  position: relative; border: 1.5px dashed var(--line-2); border-radius: 20px;
  background: var(--surface) var(--peg); background-size: 14px 14px;
  padding: 38px 24px; cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.dropzone.is-over {
  border-color: var(--accent); background-color: var(--accent-tint);
  background-image: radial-gradient(circle at 50% 50%, rgba(214, 51, 108, .28) 2.6px, transparent 3px);
}
.dropzone-main { font-size: 19px; font-weight: 620; }
.dropzone-sub { margin-top: 6px; color: var(--ink-2); }
.dropzone-formats { margin-top: 14px; color: var(--ink-3); font-size: 13px; }
.dropzone-lock {
  margin: 12px auto 0; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #FFF8E6;
  color: #8A6410; font-size: 13px; width: max-content; max-width: 100%;
}

.peg-preview {
  width: 84px; height: 84px; margin: 0 auto 18px;
  background:
    radial-gradient(circle at 50% 50%, var(--amber) 5.2px, transparent 5.6px) 0 0/14px 14px,
    radial-gradient(circle at 50% 50%, rgba(42, 32, 40, .1) 2px, transparent 2.4px) 7px 7px/14px 14px;
  -webkit-mask: radial-gradient(circle at 50% 46%, #000 44%, transparent 46%);
  mask: radial-gradient(circle at 50% 46%, #000 44%, transparent 46%);
}
.peg-preview-sm { width: 56px; height: 56px; margin-bottom: 12px; opacity: .8; }

.hero-error { margin-top: 14px; color: #B4342A; font-size: 14px; }
.hero-points {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  color: var(--ink-2); font-size: 14px;
}
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, .85); }
.dot-rose { background: var(--accent); }
.dot-amber { background: var(--amber); }
.dot-sky { background: var(--sky); }
.hero-note { margin-top: 14px; color: var(--ink-3); font-size: 13px; }
.workbench {
  margin-inline: auto;
  padding: var(--wb-top);
  flex: 1 1 auto; width: 100%;
}
.wb-grid {
  display: grid; gap: 12px;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: stretch;
}
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh-1);
  padding: 16px;
}
.rail {
  grid-column: 1; grid-row: 1; align-self: stretch;
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh-1); padding: 8px 6px;
}
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%;
  border: 0; background: transparent; color: var(--ink-2);
  border-radius: var(--r-ctl); padding: 12px 2px;
  font-size: 11.5px; text-align: center; cursor: pointer;
  transition: background-color .14s ease, color .14s ease;
}
.rail-btn:hover { background: var(--bg-sunk); color: var(--ink); }
.rail-ico { flex: none; width: 20px; text-align: center; font-size: 17px; line-height: 1; }
.rail-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-group {
  padding: 8px 0 4px; margin: 0; text-align: center;
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: var(--ink-3); text-transform: none;
}
.rail-group + .rail-btn { margin-top: 0; }
.rail-btn + .rail-group {
  margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line);
}
.rail-opt {
  display: none;
}
.rail-divider { margin: 8px 6px; border-top: 1px solid var(--line); }
.rail-btn[aria-current="true"],
.rail-btn[aria-expanded="true"] {
  background: var(--accent-tint); color: var(--accent-ink); font-weight: 620;
}
.rail-btn[aria-current="true"] .rail-opt { background: rgba(255, 255, 255, .75); color: var(--accent-ink); }
.rail-go {
  margin: 5px 0; background: var(--accent); color: #fff; font-weight: 640;
  box-shadow: var(--sh-1);
}
.rail-go:hover { background: var(--accent-ink); color: #fff; }
.rail-go:disabled { background: var(--line-2); color: #fff; cursor: not-allowed; }

.wb-main {
  grid-column: 2; grid-row: 1; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 12px;
  height: calc(100vh - var(--topbar-h) - var(--wb-top) * 2);
  height: calc(100dvh - var(--topbar-h) - var(--wb-top) * 2); min-height: 0;
}
.wb-main.is-focused { grid-template-columns: minmax(0, 1fr); }
.work-sidebar {
  grid-column: 2; grid-row: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.mod-wrap {
  flex: 0 0 auto; min-height: 0; min-width: 0;
}
.panel-result {
  grid-column: 1; grid-row: 1; min-height: 0; min-width: 0;
  padding: 0 10px;
  display: flex; flex-direction: column;
}
.panel-result .stage { flex: 1 1 auto; height: auto; min-height: 0; }
.canvas-toolbar {
  display: flex; align-items: center; gap: 10px; flex: none; min-height: 52px;
  padding: 8px 2px;
}
.canvas-heading { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; }
.canvas-heading h2 { font-size: 13px; font-weight: 650; white-space: nowrap; }
.canvas-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.canvas-toolbar .zoom { gap: 3px; flex: none; order: 0; }
.canvas-toolbar .btn { padding: 5px 8px; white-space: nowrap; font-size: 12px; }
.canvas-toolbar .zoom-val { min-width: 40px; }
.canvas-status {
  min-height: 32px; flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px 3px; font-size: 11px; color: var(--ink-3);
}
#canvasMeta { white-space: nowrap; font-variant-numeric: tabular-nums; }
#canvasHint { text-align: right; }
.is-working #lpHome, .is-working .site-foot { display: none; }
#outCanvas.is-selecting { cursor: crosshair; }
#outCanvas.is-picking { cursor: cell; }
.dock, .sheet-scrim { display: none; }
.dock[hidden], .sheet-scrim[hidden] { display: none; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.head-tools { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.panel-note {
  margin: 0; margin-right: auto; font-size: 12px; line-height: 1.5;
  color: var(--ink-3); font-weight: 400; white-space: nowrap;
}
.panel-mod { display: flex; flex-direction: column; gap: 12px; }
.mod-src { flex: none; }
.mod-src:empty { display: none; }
.mod-main { min-width: 0; }
.mod-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.mod-step { min-width: 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.mod-next { flex: none; white-space: nowrap; }
.mod-next::after { content: "→"; font-size: 14px; line-height: 1; }
.panel-x {
  display: none;
  flex: none; width: 30px; height: 30px; padding: 0;
  background: none; border: 0; border-radius: 50%;
  align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.panel-x:hover { background: var(--bg-sunk); color: var(--ink); }
.stage-src {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: stretch; padding: 6px; background: #FDFAF8;
}
.stage-src .crop-stage { width: 100%; height: 100%; aspect-ratio: auto; }
.panel-title { font-size: 15px; font-weight: 650; letter-spacing: .02em; color: var(--ink-2); }
.tag-opt {
  display: inline-block; margin-left: 7px; vertical-align: 2px;
  padding: 1px 7px; border-radius: 999px;
  background: var(--bg-sunk); color: var(--ink-3);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.panel-source .panel-title, .panel-params .panel-title { text-transform: none; }
.hint { color: var(--ink-3); font-size: 12.5px; margin-top: 8px; }
.hint-do {
  margin-top: 0; padding: 7px 10px; border-radius: var(--r-ctl);
  border-left: 3px solid var(--accent); background: var(--bg-sunk);
  color: var(--ink-2); line-height: 1.6;
}
.hint.is-bad { color: #B23A2E; font-weight: 600; }

.field { margin-top: 18px; }
.field:first-of-type { margin-top: 0; }
.field-label {
  display: block; margin-bottom: 8px;
  font-size: 12.5px; font-weight: 620; color: var(--ink-2); letter-spacing: .02em;
}
.field-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.field-head .field-label { margin-bottom: 0; }
.field-note {
  margin-right: auto; font-size: 12px; color: var(--ink-3); letter-spacing: 0;
}
.field-fold {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  transition: border-color .14s ease, color .14s ease;
}
.field-fold:hover { border-color: var(--ink-3); color: var(--ink); }
.field-fold::after {
  content: ""; width: 5px; height: 5px; border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg) translateY(-1px);
}
.field-fold[aria-expanded="false"]::after { transform: rotate(-135deg) translateY(-1px); }
.field.is-folded .field-body { display: none; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.pill:hover { border-color: var(--ink-3); color: var(--ink); }
.pill.is-on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 560; }
.crop-stage {
  position: relative; border-radius: 12px; overflow: hidden;
  background: var(--bg-sunk) var(--peg); background-size: 12px 12px;
  aspect-ratio: 1 / 1; display: grid; place-items: center;
}
#cropCanvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; width: 100%; height: 100%; }
.ratio-custom { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ratio-custom input { width: 58px; }

input[type="number"], select, input[type="color"] {
  border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 7px 9px; background: var(--surface); width: 100%;
}
input[type="color"] { padding: 3px; height: 34px; cursor: pointer; }
select { cursor: pointer; }
input:disabled { background: var(--bg-sunk); color: var(--ink-3); cursor: not-allowed; }
.inline-num { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.inline-num input { width: 86px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.adv { border-top: 1px solid var(--line); padding-top: 14px; }
.adv > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 620; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before {
  content: ""; width: 0; height: 0; transition: transform .15s ease;
  border: 4.5px solid transparent; border-left-color: var(--ink-3);
}
.adv[open] > summary::before { transform: rotate(90deg) translateX(1px); }
.adv > .field, .adv > .check { margin-top: 14px; }
.adv > .hint { margin-top: 4px; margin-left: 21px; }

.stage {
  position: relative; border-radius: 12px; overflow: hidden;
  background: #FDFAF8;
  border: 1px solid var(--line);
  height: clamp(300px, 52vh, 620px);
  display: grid; place-items: center;
}
#outCanvas { position: absolute; inset: 0; touch-action: none; cursor: grab; width: 100%; height: 100%; }
#outCanvas.is-panning { cursor: grabbing; }
.stage-empty, .stage-busy {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  color: var(--ink-3); font-size: 14px; text-align: center; padding: 24px;
  background: #FDFAF8;
}
.stage-busy { z-index: 6; background: rgba(253, 250, 248, .90); color: var(--ink-2); }
.stage-error {
  position: absolute; inset: auto 12px 12px; z-index: 5;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(178, 58, 46, .95); color: #fff;
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .55);
}

.bead-tip {
  position: absolute; z-index: 4; pointer-events: none;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 10px;
  background: rgba(38, 28, 36, .94); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
  font-size: 12.5px; line-height: 1.45; white-space: nowrap;
}
.bead-tip[hidden] { display: none; }
.bead-tip-sw {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .5), 0 0 0 1px rgba(255, 255, 255, .35);
}
.bead-tip-text { display: flex; flex-direction: column; }
.bead-tip-text b { font-size: 13.5px; font-weight: 680; letter-spacing: .01em; }
.bead-tip-text i { font-style: normal; color: rgba(255, 255, 255, .88); }
.bead-tip-text u { text-decoration: none; color: rgba(255, 255, 255, .6); font-size: 11.5px; }
.sr-live {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.busy-beads { display: flex; gap: 7px; margin-bottom: 14px; }
.stage-busy.is-long .busy-beads { display: none; }
.busy-beads i {
  width: 11px; height: 11px; border-radius: 50%; background: var(--line-2);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9);
  animation: bead-fill 1.05s infinite ease-in-out;
}
.busy-beads i:nth-child(2) { animation-delay: .12s; }
.busy-beads i:nth-child(3) { animation-delay: .24s; }
.busy-beads i:nth-child(4) { animation-delay: .36s; }
.busy-beads i:nth-child(5) { animation-delay: .48s; }
@keyframes bead-fill {
  0%, 100% { background: var(--line-2); transform: translateY(0); }
  40% { background: var(--accent); transform: translateY(-3px); }
}
.busy-long { max-width: 320px; margin-top: 12px; text-align: center; }
.busy-long-text { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin: 0; }
.busy-thread { position: relative; width: 148px; height: 22px; margin: 15px auto 9px; }
.busy-thread::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  border-radius: 1px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px);
}
.busy-thread i {
  position: absolute; top: 50%; left: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%; background: var(--c, var(--accent));
  box-shadow: inset 0 0 0 3.6px rgba(255, 255, 255, .92);
  transform: translateX(var(--x));
  animation: bead-thread 2s infinite cubic-bezier(.42, .04, .3, 1) both;
}
.busy-thread i:nth-child(1) { --c: var(--accent); --x: 18px; }
.busy-thread i:nth-child(2) { --c: var(--amber); --x: 47px; animation-delay: .17s; }
.busy-thread i:nth-child(3) { --c: var(--coral); --x: 76px; animation-delay: .34s; }
.busy-thread i:nth-child(4) { --c: var(--sky); --x: 105px; animation-delay: .51s; }
.busy-thread i:nth-child(5) { --c: var(--mint); --x: 134px; animation-delay: .68s; }
@keyframes bead-thread {
  0% { transform: translateX(-1px) scale(.62); opacity: 0; }
  16% { opacity: 1; }
  52% { transform: translateX(var(--x)) scale(1.18); opacity: 1; }
  66%, 100% { transform: translateX(var(--x)) scale(1); opacity: 1; }
}
.busy-long-tick { font-size: 12px; color: var(--ink-3, var(--ink-2)); margin: 0; }
.field-ai .ai-opts + .btn-ai { margin-top: 12px; }

.btn-ai {
  margin-top: 12px; padding: 11px 16px; font-size: 15px;
  border-color: var(--accent); background: var(--surface); color: var(--accent-ink);
}
.btn-ai:hover:not(:disabled) { background: var(--accent); color: #fff; transform: translateY(-1px); }
.btn-ai:disabled { border-color: var(--line-2); color: var(--ink-3); cursor: not-allowed; }

.ai-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ai-opt-wide { grid-column: 1 / -1; }
.ai-opt {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px;
  align-content: start; align-items: center;
  padding: 9px 10px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface); cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.ai-opt:hover { border-color: var(--accent); }
.ai-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.ai-opt input { grid-row: 1 / span 2; accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.ai-opt-t { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); font-weight: 560; }
.ai-opt-rec {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-style: normal; font-size: 10.5px; font-weight: 620; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent-tint); border: 1px solid var(--accent);
}
.ai-opt-d { grid-column: 2; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }

.ai-custom { margin-top: 8px; }
.ai-custom textarea {
  width: 100%; resize: vertical; min-height: 52px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 8px 9px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1.6;
}
.ai-custom textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ai-custom-foot {
  display: flex; justify-content: flex-end; margin-top: 4px;
  font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  max-width: min(420px, 92vw);
  padding: 11px 16px; border-radius: 999px;
  background: rgba(42, 32, 40, .93); color: #fff;
  font-size: 13.5px; line-height: 1.55; text-align: center;
  box-shadow: 0 10px 28px rgba(42, 32, 40, .28);
  pointer-events: none;
}
.toast[hidden] { display: none; }
.toast.is-in { animation: toast-in .22s ease; }
@keyframes toast-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px; flex-wrap: wrap;
}
.stage-toggles { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.inline-sel {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2);
}
.inline-sel select { width: auto; padding: 3px 22px 3px 8px; font-size: 12.5px; }
.inline-sel input { width: 60px; padding: 3px 6px; font-size: 12.5px; }
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom-val { font-size: 12.5px; color: var(--ink-3); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

.size-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.size-card, .mode-card {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px;
  padding: 9px 11px; cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, transform .14s ease;
}
.size-card { padding: 6px 6px 5px; align-items: center; text-align: center; gap: 0; }
.size-card:hover, .mode-card:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.size-card.is-on, .mode-card.is-on { border-color: var(--accent); background: var(--accent-tint); }
.size-card b, .mode-card b { font-size: 13.5px; font-weight: 620; font-variant-numeric: tabular-nums; }
.size-card b {
  display: flex; align-items: baseline; justify-content: center; gap: 1px;
  font-size: 17px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2;
}
.size-card b em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.size-card.is-on b em { color: var(--accent-ink); }
.size-card i, .mode-card i { font-style: normal; font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.size-card i { font-size: 10.5px; white-space: nowrap; }

.size-custom { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.size-custom-label { flex: none; font-size: 12.5px; color: var(--ink-3); }
.size-num { flex: 0 1 108px; min-width: 0; display: block; }
.size-num input[type="number"] { width: 100%; text-align: center; font-variant-numeric: tabular-nums; }
.size-x { flex: none; font-size: 13px; color: var(--ink-3); }
.size-ratio { margin-top: 8px; }
.mode-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pills-wrap { row-gap: 6px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px; background: var(--bg-sunk); border: 1px solid var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px;
  border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: var(--sh-1);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--bg-sunk); border: 1px solid var(--line); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; }
.range-ends {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.adv { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.adv > summary {
  cursor: pointer; font-size: 13px; font-weight: 620; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before {
  content: ""; width: 6px; height: 6px; border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3); transform: rotate(-45deg); transition: transform .18s ease;
}
.adv[open] > summary::before { transform: rotate(45deg); }

.tune-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.tune-sw {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 5px 9px 5px 5px; font-size: 12px; cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}
.tune-sw i {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(42, 32, 40, .16);
}
.tune-sw b {
  font-weight: 600; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tune-sw:hover { border-color: var(--ink-3); color: var(--ink); }
.tune-sw.is-on {
  border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink);
  font-weight: 620; box-shadow: inset 0 0 0 1px var(--accent);
}
.tune-sw[disabled] { opacity: .45; cursor: not-allowed; }
.tune-swatches-all {
  max-height: 208px; overflow-y: auto; overscroll-behavior: contain;
  margin-top: 8px; padding: 6px; background: var(--bg-sunk); border-radius: var(--r-ctl);
}
.tune-count { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.tune-count b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
#tuneTolPills { margin-top: 6px; }
#tuneBlankBody > .check { margin-top: 10px; }
.tune-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.tune-more > summary {
  cursor: pointer; font-size: 13px; font-weight: 620; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.tune-more > summary::-webkit-details-marker { display: none; }
.tune-more > summary::before {
  content: ""; width: 6px; height: 6px; border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3); transform: rotate(-45deg); transition: transform .18s ease;
}
.tune-more[open] > summary::before { transform: rotate(45deg); }
.tune-search { display: block; margin-top: 8px; }
.tune-more > .hint { margin-top: 8px; }
.tune-search input[type="search"] {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 7px 9px; background: var(--surface); font-size: 13px; font-family: inherit;
}
.panel-tune .btn-block { margin-top: 12px; }

.panel-inspect { flex: none; }
.panel-inspect .panel-body { display: flex; flex-direction: column; }
.panel-inspect .stage-bar { order: -1; margin: 0; padding: 0; overflow: visible; }
.panel-inspect .stage-toggles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; width: 100%;
}
.panel-inspect .inline-sel { grid-column: 1 / -1; flex-wrap: wrap; }
.panel-inspect .check { font-size: 13px; }
.panel-inspect .code-bar {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  margin-top: 16px; padding: 14px 0 0;
}
.panel-inspect .sb-kinds { gap: 5px; }
.panel-inspect .sb-kinds::after { content: "点击色号定位"; margin-left: auto; font-size: 11px; }
.panel-inspect .sb-chips {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start;
  gap: 6px; height: auto; max-height: 224px; overflow-x: hidden; overflow-y: auto; padding: 2px;
  overscroll-behavior: contain;
}
.panel-inspect .sb-chip { min-width: 0; height: 34px; padding: 0 7px; border-radius: 8px; font-size: 12px; }
.panel-inspect .sb-bead { flex: none; }
.panel-inspect .sb-num { margin-left: auto; font-size: 11px; }
.panel-inspect .sb-chips::-webkit-scrollbar { width: 6px; }

.generate-bar { margin-top: 18px; }
.gen-row { display: flex; align-items: center; gap: 8px; }
.gen-row .btn-block { flex: 1 1 auto; }
.btn-dl { flex: 0 0 auto; white-space: nowrap; }
.site-foot {
  border-top: 1px solid var(--line); padding: 20px clamp(16px, 4vw, 40px) 32px;
  color: var(--ink-3); font-size: 12.5px;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px 20px; flex-wrap: wrap;
}

@media (max-width: 1023px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    max-width: 640px; gap: 24px;
    padding: clamp(24px, 5vh, 48px) 20px 40px;
  }
  .hero-sub { max-width: none; }
}
@media (min-width: 1024px) and (max-width: 1439px) {
  .wb-main { grid-template-columns: minmax(0, 1fr) 304px; }
}
@media (min-width: 1024px) {
  .rail {
    max-height: calc(100vh - var(--topbar-h) - var(--wb-top) * 2);
    max-height: calc(100dvh - var(--topbar-h) - var(--wb-top) * 2);
    overflow-y: auto; scrollbar-width: thin;
  }
  .rail > * { flex: none; }
  .work-sidebar { overflow: hidden; }
  .work-sidebar .mod-wrap {
    flex: 1 1 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  }
  .work-sidebar .mod-wrap > .panel { min-height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .work-sidebar .panel-inspect { min-height: 0; max-height: 48%; flex: 0 1 auto; overflow: hidden; }
  .panel-inspect .mod-main { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
  .panel-inspect .panel-head, .panel-inspect .stage-bar { flex: none; }
  .panel-inspect .panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .panel-inspect .code-bar { flex: 1 1 auto; min-height: 120px; }
  .panel-inspect .sb-chips { min-height: 68px; flex: 1 1 auto; }
  .rail-btn[data-inspect] { background: transparent; color: var(--ink-2); font-weight: 400; }
  .rail-btn[data-inspect]:hover { background: var(--bg-sunk); color: var(--ink); }
  .work-sidebar .panel-head { flex-wrap: wrap; gap: 8px; }
  .work-sidebar .panel-note { flex-basis: 100%; order: 2; white-space: normal; }
  .work-sidebar .head-tools { gap: 4px; }
  .work-sidebar .head-tools .btn { padding: 5px 7px; font-size: 11px; }
  .work-sidebar .field-head { flex-wrap: wrap; }
  .work-sidebar .field-note { white-space: normal; }
  .work-sidebar .field-fold { margin-left: auto; }
  .panel-tune .panel-body > .field { min-width: 0; }
  .panel-tune .tune-swatches { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
  .panel-tune .tune-swatches-all { max-height: 208px; }
  .panel-tune .panel-head { margin-bottom: 10px; }
  .panel-tune .mod-foot { margin-top: 10px; padding-top: 8px; }
  .work-sidebar .mod-step { font-size: 11px; }
  .work-sidebar .mod-next { padding: 7px 10px; font-size: 12px; }
  .wb-main.is-focused { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .wb-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rail { display: none; }
  .wb-main, .work-sidebar, .mod-wrap { display: contents; }
  .panel-x { display: flex; }
  .panel-mod {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: var(--dock-h);
    min-height: min(62vh, 520px);
    max-height: calc(100vh - var(--topbar-h) - var(--dock-h) - 8px);
    min-height: min(62dvh, 520px);
    max-height: calc(100dvh - var(--topbar-h) - var(--dock-h) - 8px);
    overflow: hidden; overscroll-behavior: contain;
    border-radius: 18px 18px 0 0; border-bottom: 0;
    box-shadow: 0 -12px 30px rgba(42, 32, 40, .18);
    animation: sheet-up .2s ease;
  }
  @keyframes sheet-up {
    from { transform: translateY(14px); opacity: .4; }
    to { transform: none; opacity: 1; }
  }
  .panel-mod .mod-src { flex: 1 1 auto; min-height: 0; }
  .panel-mod .mod-main { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .panel-mod .panel-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    margin: 0 -14px; padding: 0 14px;
  }
  .panel-mod .panel-head, .panel-mod .generate-bar, .panel-mod .mod-foot { flex: none; }
  .panel-mod .generate-bar { margin-top: 12px; }
  .panel-mod .mod-foot { margin-top: 10px; }
  .mod-src .crop-stage { aspect-ratio: auto; height: 100%; min-height: 140px; }
  .panel-result {
    order: 1; grid-column: auto; grid-row: auto; flex: none;
    position: static; display: flex; flex-direction: column;
    height: calc(100vh - var(--topbar-h) - var(--dock-h) - 16px); min-height: 0;
    height: calc(100dvh - var(--topbar-h) - var(--dock-h) - 16px);
    padding: 0 8px;
  }
  .panel-result .stage { flex: 1 1 auto; height: auto; min-height: 0; }
  .sidebar-toggle { display: none; }
  .gesture-desktop { display: none; }
  .canvas-toolbar { min-height: 48px; gap: 6px; }
  .canvas-status { min-height: 32px; font-size: 10px; gap: 4px; }
  .workbench {
    padding: 8px 8px calc(var(--dock-h) + 8px);
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
  .panel-mod { padding: 14px; }
  .crop-stage { aspect-ratio: 4 / 3; }
  .site-foot { padding-bottom: calc(var(--dock-h) + 24px); }
  .code-bar { gap: 8px; }
  .generate-bar .hint { margin-top: 6px; text-align: center; }
  .dock {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: #FFFFFF;
    border-top: 1px solid var(--line);
    padding: 6px clamp(6px, 2vw, 14px) max(6px, env(safe-area-inset-bottom));
  }
  .dock-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: transparent; color: var(--ink-2);
    font-size: 11.5px; padding: 7px 2px; border-radius: 12px; cursor: pointer;
  }
  .dock-label { white-space: nowrap; }
  .dock-ico { font-size: 17px; line-height: 1; }
  .dock-btn[aria-expanded="true"] { background: var(--accent-tint); color: var(--accent-ink); font-weight: 620; }
  .dock-btn[aria-current="true"] { color: var(--accent-ink); font-weight: 620; }
  .sheet-scrim { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(42, 32, 40, .34); }
  .sheet-scrim[hidden] { display: none; }
  .toast { bottom: calc(var(--dock-h) + 14px); }
}
@media (max-width: 520px) {
  .mode-cards { grid-template-columns: 1fr; }
  .hero { padding: 24px 16px 36px; gap: 20px; }
  .hero-title { font-size: clamp(27px, 8vw, 34px); }
  .hero-kicker { margin-bottom: 10px; font-size: 12.5px; }
  .hero-sub { margin: 12px 0 16px; font-size: 15.5px; }
  .hero-points { gap: 8px 18px; font-size: 13.5px; }
  .dropzone { padding: 28px 16px; }
  .dropzone .peg-preview { width: 64px; height: 64px; margin-bottom: 12px; }
  .dropzone-main { font-size: 17.5px; }
  .topbar { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; height: var(--topbar-h); }
  .topbar .btn { padding: 8px 11px; font-size: 14px; }
  .topbar .brand-beads { display: block; width: 18px; height: 18px; }
  .topbar-actions { gap: 6px; }
  .acct { gap: 6px; }
  .acct-menu { min-width: 0; }
  .brand-logo { height: 26px; }
  .brand { gap: 6px; }
  .size-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .size-card { padding: 6px 5px 5px; }
  .size-card b { font-size: 17px; }
  .stage-bar {
    gap: 10px; flex-direction: row; flex-wrap: nowrap; align-items: center;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .stage-bar::-webkit-scrollbar { display: none; }
  .panel-head { flex-wrap: wrap; gap: 8px; }
  .stage-toggles { gap: 12px; flex-wrap: nowrap; flex: 0 0 auto; }
  .stage-toggles .check { flex: 0 0 auto; white-space: nowrap; }
  .stage-toggles .inline-sel { flex: 0 0 auto; white-space: nowrap; }
  .zoom { margin-left: 0; flex: 0 0 auto; order: -1; }
  .code-bar { gap: 8px; }
  .sb-kinds { font-size: 12px; }
  .sb-kinds b { font-size: 15.5px; }
  .bead-tip { max-width: calc(100% - 16px); white-space: normal; }
  .bead-tip-text b, .bead-tip-text i, .bead-tip-text u { word-break: break-word; }
  input[type="number"], input[type="color"], select,
  input[type="text"], input[type="search"], input[type="password"],
  input:not([type]), textarea { font-size: 16px; }
  .panel-note { white-space: normal; }
}
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 620px) {
  .workbench {
    padding-top: 10px; padding-bottom: 10px;
    padding-right: max(calc(var(--rail-w) + 10px),
                       calc(var(--rail-w) + env(safe-area-inset-right)));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .wb-grid { gap: 10px; }
  .topbar { flex-wrap: nowrap; height: var(--topbar-h); min-height: 0; padding: 8px 12px; }
  .panel-result {
    height: calc(100vh - var(--topbar-h) - 20px);
    height: calc(100dvh - var(--topbar-h) - 20px);
    min-height: 0; padding: 0 8px;
  }
  .panel-result .stage { min-height: 0; }
  .code-bar { gap: 8px; }
  .dock {
    grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
    top: var(--topbar-h); bottom: 0; left: auto; right: 0;
    width: max(var(--rail-w), calc(var(--rail-w) + env(safe-area-inset-right)));
    padding: 8px 4px max(8px, env(safe-area-inset-bottom));
    padding-right: max(4px, env(safe-area-inset-right));
    border-top: 0; border-left: 1px solid var(--line);
  }
  .dock-btn { max-height: 76px; }
  .panel-mod {
    top: var(--topbar-h); bottom: 0; left: auto;
    right: max(var(--rail-w), calc(var(--rail-w) + env(safe-area-inset-right)));
    width: min(64vw, 420px); min-height: 0; max-height: none;
    border-radius: 18px 0 0 18px; border-bottom: 1px solid var(--line);
    box-shadow: -12px 0 30px rgba(42, 32, 40, .18);
    animation: sheet-in .2s ease;
  }
  @keyframes sheet-in {
    from { transform: translateX(14px); opacity: .4; }
    to { transform: none; opacity: 1; }
  }
  .mod-src .crop-stage { min-height: 120px; max-height: 46dvh; }
  .crop-stage { aspect-ratio: 3 / 2; }
  .size-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stage-bar { gap: 8px; }
  .toast {
    bottom: 12px; left: calc(50% - var(--rail-w) / 2);
    max-width: min(420px, calc(100vw - var(--rail-w) - 24px));
  }
}

@media (max-width: 1023px) and (max-height: 740px) {
  .panel-mod .pill { padding: 6px 12px; }
  .panel-mod .pills { gap: 5px; }
  .panel-mod .field { margin-top: 12px; }
  .panel-mod .mod-foot { margin-top: 6px; padding-top: 8px; }
  .panel-mod .generate-bar { margin-top: 8px; }
  .panel-mod .mod-src .crop-stage { min-height: 92px; }
  .panel-mod .panel-head { margin-bottom: 6px; }
  .panel-mod .panel-note { font-size: 11.5px; }
  .panel-mod .field-label { margin-bottom: 6px; }
  .panel-mod .hint { margin-top: 6px; }
}

@media (pointer: coarse) {
  .btn-mini { padding: 8px 12px; font-size: 13.5px; }
  .pill { padding: 9px 14px; }
  .check { padding: 3px 0; }
  .check input { width: 18px; height: 18px; }
  .sb-chip { height: 30px; padding: 0 11px 0 8px; }
  .tune-sw { padding: 7px 11px 7px 6px; font-size: 12.5px; }
  .tune-sw i { width: 18px; height: 18px; }
  .tune-swatches { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
  .field-fold { padding: 7px 12px; font-size: 13px; }
  .dl-item { padding: 10px 12px; }
  .size-card:hover, .mode-card:hover, .btn-primary:hover, .dropzone:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .btn:hover, .size-card:hover, .mode-card:hover, .dropzone:hover { transform: none; }
}
@media print {
  .topbar, .rail, .work-sidebar, .mod-wrap, .stage-src, .dock, .sheet-scrim,
  .canvas-toolbar, .canvas-status,
  .site-foot, .generate-bar, .stage-bar, .code-bar, .auth-mask, .toast { display: none; }
  .wb-grid { grid-template-columns: minmax(0, 1fr); }
  .wb-main { display: contents; }
  .workbench { padding: 0; }
  .panel-result { grid-column: 1; grid-row: 1; position: static; height: auto; min-height: 0; }
  .panel-result .stage { height: 15cm; flex: none; }
}

.acct { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.acct-menu { min-width: 0; }
.acct-menu > .dl-sum {
  max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.acct-menu > .dl-sum > .acct-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-menu > .dl-sum::after { flex: 0 0 auto; }
.acct-menu > .dl-sum.is-mch { max-width: 22ch; }
.acct-pop { min-width: 208px; }
.acct-quota {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  color: var(--ink-2); font-size: 12.5px; line-height: 1.75;
  font-variant-numeric: tabular-nums; white-space: pre-line;
}

.auth-mask {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(42, 32, 40, .38); backdrop-filter: blur(2px);
}
.auth-card {
  display: flex; flex-direction: column;
  width: min(400px, 100%); max-height: calc(100vh - 40px); overflow: hidden;
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--sh-2);
  animation: auth-in .18s ease;
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.auth-top {
  flex: none; display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 14px 14px 20px; border-bottom: 1px solid var(--line);
}
.auth-heads { flex: 1 1 auto; min-width: 0; }
.auth-title { font-size: 20px; font-weight: 680; letter-spacing: -.01em; }
.auth-lead { margin-top: 5px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.auth-body {
  flex: 1 1 auto; overflow-y: auto; padding: 16px 20px 18px;
  display: grid; grid-template-columns: minmax(0, 1fr);
  align-content: start; row-gap: 14px; column-gap: 14px;
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  background: var(--bg-sunk); border-radius: var(--r-ctl);
}
.auth-tab {
  padding: 7px 0; background: none; border: 0; border-radius: 7px;
  color: var(--ink-3); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background-color .16s ease, color .16s ease;
}
.auth-tab:hover { color: var(--ink-2); }
.auth-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.auth-tab.is-on:hover { color: var(--ink); }
.auth-link {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.auth-link:hover { color: var(--accent); }
.auth-back { display: block; }
.auth-field { display: grid; gap: 4px; }
.auth-field > span { color: var(--ink-2); font-size: 13px; }
.auth-lab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.auth-code-row { display: flex; gap: 8px; align-items: center; }
.auth-code-row input { flex: 1 1 auto; min-width: 0; }
.auth-code-row .btn { flex: 0 0 auto; white-space: nowrap; }
.auth-field input {
  border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--r-ctl); padding: 8px 12px; width: 100%;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.auth-field input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.auth-msg {
  color: #B4372B; background: #FDECEA;
  border: 1px solid #F6C9C2; border-radius: var(--r-ctl);
  padding: 8px 12px; font-size: 13.5px;
}
.auth-alt { text-align: center; }
.auth-note {
  flex: none; padding: 11px 20px 13px;
  background: var(--bg-sunk); border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 12.5px; line-height: 1.55;
}
.auth-card.is-tight .auth-body { row-gap: 11px; padding-bottom: 16px; }
@media (min-width: 561px) {
  .auth-card.is-reg { width: min(516px, 100%); }
  .auth-card.is-reg .auth-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px;
  }
  .auth-card.is-reg .auth-tabs,
  .auth-card.is-reg .auth-back,
  .auth-card.is-reg .auth-msg,
  .auth-card.is-reg .btn-block,
  .auth-card.is-reg .auth-alt { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .auth-card.is-tight .auth-field {
    grid-template-columns: 98px minmax(0, 1fr); align-items: center; column-gap: 8px;
  }
  .auth-card.is-tight .auth-lab { justify-content: flex-start; }
  .auth-card.is-tight .auth-field > span { line-height: 1.35; }
}
@media (max-width: 480px) {
  .auth-mask { padding: 8px; }
  .auth-card { max-height: calc(100vh - 16px); }
  .auth-top { padding: 13px 10px 11px 16px; }
  .auth-title { font-size: 18px; }
  .auth-lead { margin-top: 3px; font-size: 13px; line-height: 1.45; }
  .auth-body { padding: 13px 16px 15px; row-gap: 12px; }
  .auth-note { padding: 9px 16px 11px; font-size: 12px; }
  .auth-card.is-tight .auth-body { row-gap: 9px; padding-top: 12px; padding-bottom: 13px; }
  .auth-card.is-tight .auth-field { grid-template-columns: 92px minmax(0, 1fr); }
  .auth-card.is-tight .auth-field input { padding: 7px 10px; line-height: 1.35; }
  .auth-card.is-tight .auth-tab { padding: 6px 0; }
  .auth-card.is-tight .btn-block { padding: 11px 16px; }
}
@media (max-width: 760px) {
  .auth-field input { font-size: 16px; }
}

.refer-lead { color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.refer-row { display: flex; gap: 8px; margin-top: 14px; }
.refer-link {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--line-2); background: var(--bg-sunk);
  border-radius: var(--r-ctl); padding: 9px 12px;
  font-size: 13px; color: var(--ink-2);
  text-overflow: ellipsis; user-select: all;
}
.refer-link:focus { border-color: var(--accent); outline: none; }
.refer-copy { flex: none; }
.refer-code {
  margin-top: 12px; color: var(--ink-3); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.refer-code b {
  margin-left: 4px; padding: 2px 8px; border-radius: 8px;
  background: var(--accent-tint); color: var(--accent-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .1em; user-select: all;
}
.refer-facts { margin: 14px 0 0; padding: 0; display: grid; gap: 6px; list-style: none; }
.refer-facts li {
  position: relative; padding-left: 16px;
  color: var(--ink-2); font-size: 13.5px; line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
.refer-facts li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.refer-facts:empty { display: none; }
.refer-msg { margin-top: 12px; color: var(--accent-ink); font-size: 13px; }
@media (max-width: 480px) {
  .refer-row { flex-direction: column; }
  .refer-link { font-size: 16px; }
}

.lucky-lead { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }
.lucky-note {
  margin-top: 10px; padding: 10px 12px;
  border-radius: var(--r-ctl); background: var(--bg-sunk);
  color: var(--ink-3); font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.lucky-prizes { margin: 14px 0 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.lucky-prizes:empty { display: none; }
.lucky-prizes li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); font-size: 13.5px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.lucky-prizes b { color: var(--accent-ink); font-size: 15px; }
.lucky-prizes .lucky-grade { color: var(--ink); font-weight: 600; }
.lucky-prizes .lucky-worth { color: var(--ink-3); font-size: 12.5px; }
.lucky-facts { margin-top: 12px; }
.lucky-result {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--bg-sunk);
}
.lucky-result.is-win { border-color: var(--accent); background: var(--accent-tint); }
.lucky-result-head { font-size: 16px; font-weight: 700; color: var(--ink); }
.lucky-result.is-win .lucky-result-head { color: var(--accent-ink); }
.lucky-result-sub { margin-top: 6px; color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.lucky-result-sub:empty { display: none; }
@media (max-width: 480px) {
  .lucky-prizes li { flex-direction: column; gap: 2px; }
}

.save-img {
  display: block; width: 100%; max-height: 46vh;
  object-fit: contain; object-position: center;
  background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--r-ctl);
}
.save-tip { margin-top: 14px; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.save-warn {
  margin-top: 14px; padding: 10px 12px;
  color: var(--ink); font-size: 14px; line-height: 1.7;
  background: var(--bg-sunk); border-left: 3px solid var(--accent);
  border-radius: var(--r-ctl);
}

.fb-img {
  display: block; width: 100%; max-height: 46vh; margin-top: 14px;
  object-fit: contain; object-position: center;
  background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--r-ctl);
}
.notice-img { max-height: 38vh; }

.maint {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg) var(--peg); background-size: 22px 22px;
}
.maint-card {
  width: min(520px, 100%); text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh-2); padding: 40px 32px 32px;
}
.maint-beads {
  width: 37px; height: 37px; display: block; margin: 0 auto 18px;
}
.maint-title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.maint-text {
  margin-top: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--ink-2); font-size: 15px; line-height: 1.8;
}
.maint-text:empty { display: none; }
.maint-foot { margin-top: 24px; color: var(--ink-3); font-size: 12.5px; }
body.is-maint { overflow: hidden; }
body.is-maint .topbar,
body.is-maint #main,
body.is-maint .dock,
body.is-maint .sheet-scrim,
body.is-maint .toast,
body.is-maint .site-foot,
body.is-maint .skip { display: none; }
@media (max-width: 480px) {
  .maint-card { padding: 32px 22px 24px; }
  .maint-title { font-size: 21px; }
}

#viewHome[hidden] ~ .lp { display: none; }
.lp {
  flex: none; width: 100%; max-width: 1080px; margin: 0 auto;
  padding: 0 20px 8px;
  display: flex; flex-direction: column; gap: clamp(40px, 6vw, 72px);
}
.lp-hd { border-top: 1px solid var(--line); padding-top: clamp(36px, 5vw, 60px); }
.lp-eyebrow {
  display: block; width: fit-content; margin-bottom: 12px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-ink);
  font-size: 13px; font-weight: 600; letter-spacing: .06em;
}
.lp-lead { font-size: clamp(22px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.02em; }
.lp-lead-sub { margin-top: 12px; max-width: 62ch; color: var(--ink-2); font-size: 16px; line-height: 1.8; }

.lp-sec-hd { margin-bottom: clamp(18px, 2.4vw, 26px); }
.lp-title { font-size: clamp(19px, 2.1vw, 25px); font-weight: 690; letter-spacing: -.015em; }
.lp-desc { margin-top: 10px; max-width: 62ch; color: var(--ink-2); font-size: 15.5px; line-height: 1.8; }
.lp-desc b { color: var(--ink); font-weight: 650; }
#lpPriceGift b { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-foot-note { margin-top: 16px; color: var(--ink-3); font-size: 13.5px; line-height: 1.7; }

.lp-cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.lp-card {
  padding: 20px 18px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--sh-1);
  transition: border-color .18s ease, transform .18s ease;
}
.lp-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.lp-card-ico {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px;
  background: var(--accent-tint); color: var(--accent-ink); font-size: 17px; line-height: 1;
}
.lp-card h3 { font-size: 16px; font-weight: 660; }
.lp-card p { margin-top: 8px; color: var(--ink-2); font-size: 14px; line-height: 1.75; }

.lp-flow {
  list-style: none; counter-reset: lpstep; margin: 0; padding: 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.lp-flow li {
  counter-increment: lpstep;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); font-size: 14.5px; font-weight: 560;
}
.lp-flow li::before {
  content: counter(lpstep);
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-sunk); color: var(--ink-3);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.lp-flow-tag {
  padding: 1px 7px; border-radius: 999px;
  background: var(--bg-sunk); color: var(--ink-3);
  font-size: 11px; font-weight: 600;
}
.lp-flow-back { background: var(--accent-tint); color: var(--accent-ink); }

.lp-sec-split {
  display: grid; gap: clamp(20px, 3vw, 40px);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: start;
}
.lp-col { min-width: 0; }
.lp-list { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.lp-list li {
  position: relative; padding-left: 18px;
  color: var(--ink-2); font-size: 15px; line-height: 1.7;
}
.lp-list li::before {
  content: ""; position: absolute; left: 2px; top: .62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
}
.lp-list-tick li::before { background: var(--mint); }
.lp-badge-line { margin-top: 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }
.lp-badge {
  display: inline-block; margin-right: 8px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.lp-out {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-ctl);
  background: var(--bg-sunk); color: var(--ink-2); font-size: 14.5px; line-height: 1.7;
}
.lp-out b { color: var(--ink); font-weight: 660; }
.lp-aside {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--bg-sunk);
}
.lp-aside-title { font-size: 17px; font-weight: 670; letter-spacing: -.01em; }
.lp-aside .lp-desc { font-size: 14.5px; }

.lp-price { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.lp-plan {
  margin-top: clamp(20px, 2.6vw, 28px);
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--sh-1);
}
.lp-plan-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px 18px; flex-wrap: wrap; margin-bottom: 16px;
}
.lp-plan-title { font-size: 17px; font-weight: 680; letter-spacing: -.01em; }
.lp-plan-rule { color: var(--ink-2); font-size: 14px; }
.lp-plan-rule b { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-sep { margin: 0 8px; color: var(--line-2); }
.lp-tiers {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}
.lp-tier {
  padding: 16px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--bg); text-align: center;
}
.lp-tier-pay {
  font-size: 24px; font-weight: 720; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.lp-tier-get {
  margin-top: 2px; color: var(--accent-ink); font-size: 14px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.lp-tier-use {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line);
  display: grid; gap: 6px;
}
.lp-tier-use > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lp-tier-use dt { color: var(--ink-3); font-size: 12.5px; }
.lp-tier-use dd { margin: 0; color: var(--ink); font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }

.lp-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.lp-table {
  width: 100%; min-width: 660px; border-collapse: collapse;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.lp-table th, .lp-table td {
  padding: 10px 12px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.lp-table thead th {
  text-align: right; color: var(--ink-3); font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--line-2);
}
.lp-table thead th:first-child, .lp-table tbody th { text-align: left; }
.lp-table tbody th { color: var(--ink); font-size: 15px; font-weight: 700; }
.lp-table td { color: var(--ink-2); }
.lp-table td:nth-child(2), .lp-table td:nth-child(5) { color: var(--ink); font-weight: 620; }
.lp-table td.lp-off { color: var(--accent-ink); font-size: 13px; font-weight: 620; }
.lp-table tbody tr:last-child th, .lp-table tbody tr:last-child td { border-bottom: 0; }
.lp-table tbody tr:hover th, .lp-table tbody tr:hover td { background: var(--bg-sunk); }
.lp-star { color: var(--accent); }
.lp-note { margin-top: 14px; color: var(--ink-3); font-size: 13px; line-height: 1.8; }
.lp-note b { color: var(--ink); font-weight: 660; font-variant-numeric: tabular-nums; }

.faq-list {
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--sh-1); overflow: hidden;
}
.faq-item { border-top: 1px solid var(--line); }
.faq-item:first-child { border-top: 0; }
.faq-item > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; gap: 10px;
  padding: 15px clamp(14px, 3vw, 20px);
  color: var(--ink); font-size: 15.5px; font-weight: 660; line-height: 1.55;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-top: 6px;
  border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .16s ease;
}
.faq-item[open] > summary::before { transform: rotate(45deg); }
.faq-item[open] > summary { color: var(--accent-ink); }
.faq-item > summary:hover { background: var(--bg-sunk); }
.faq-item > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-a {
  margin: 0; padding: 0 clamp(14px, 3vw, 20px) 17px 36px;
  color: var(--ink-2); font-size: 14px; line-height: 1.85;
}
@media (prefers-reduced-motion: reduce) {
  .faq-item > summary::before { transition: none; }
}

.show-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.show-cell { min-width: 0; }
.show-btn {
  display: block; width: 100%; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--sh-1);
  cursor: pointer; text-align: left;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.show-btn:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--sh-2); }
.show-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.show-thumb {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: calc(var(--r-card) - 8px);
  background-color: var(--bg-sunk); background-image: var(--peg); background-size: 10px 10px;
}
.show-cell-cap {
  display: block; margin: 8px 2px 2px; color: var(--ink-2);
  font-size: 13px; line-height: 1.5; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.show-view {
  width: min(92vw, 760px); max-height: 88vh; display: flex; flex-direction: column;
  border-radius: var(--r-card); background: var(--surface); box-shadow: var(--sh-2);
  overflow: hidden;
}
.show-view-top {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line);
}
.show-cap {
  flex: 1 1 auto; min-width: 0; color: var(--ink); font-size: 15px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.show-view-main {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px;
  background-color: var(--bg-sunk); background-image: var(--peg); background-size: 12px 12px;
}
.show-big {
  display: block; max-width: 100%; max-height: calc(88vh - 120px);
  margin: 0 auto; border-radius: var(--r-ctl); background: var(--surface);
}
.show-msg { margin-top: 10px; color: var(--ink-3); font-size: 13px; text-align: center; }

.hero-price-link {
  display: inline-block; margin-left: 6px;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px;
}
.hero-gift { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
.hero-gift b { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-refer { margin-top: 8px; color: var(--ink-3); font-size: 12.5px; }
.hero-refer b { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-refer-go {
  margin-left: 4px; padding: 0; border: 0; background: none;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.hero-refer-go::after {
  content: "\2197"; margin-left: 3px;
  color: var(--accent); font-weight: 700; text-decoration: none;
}
.hero-refer-go:hover { color: var(--accent); }
.hero-show { margin-top: 12px; }
.hero-show-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); box-shadow: var(--sh-1);
  color: var(--ink); font-size: 13.5px; font-weight: 620; text-decoration: none;
}
.hero-show-link:hover { border-color: var(--accent); color: var(--accent-ink); }
.hero-show-ico { color: var(--accent); font-weight: 700; }
.lp-plan-gift { flex: 0 0 100%; color: var(--ink-2); font-size: 13.5px; }
.lp-plan-gift b { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 1023px) {
  .lp { max-width: 640px; gap: 40px; }
  .lp-sec-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .lp { padding: 0 16px 8px; gap: 34px; }
  .lp-hd { padding-top: 30px; }
  .lp-lead-sub, .lp-desc { font-size: 15px; }
  .lp-plan { padding: 16px 14px; }
  .lp-plan-hd { margin-bottom: 14px; }
  .lp-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .show-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .show-btn { padding: 6px; }
  .show-view-main { padding: 10px; }
  .show-big { max-height: calc(88vh - 100px); }
  .lp-tier { padding: 14px 10px; }
  .lp-tier-pay { font-size: 21px; }
  .lp-tier-use dt { font-size: 12px; }
}
@media print {
  .lp { display: none; }
}
