@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #eceff4;
  --surface: #ffffff;
  --sunk: #f3f5f8;
  --ink: #18202e;
  --muted: #5a6474;
  --line: #d6dce5;
  --line-strong: #b9c2cf;
  --cobalt: #2f4bff;
  --cobalt-deep: #2238d6;
  --on-cobalt: #ffffff;
  --ok: #0f7d56;
  --bad: #b8410c;
  --warn-bg: #fff3e2;
  --warn-ink: #7a3d07;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 0 rgba(24, 32, 46, .04), 0 12px 32px -18px rgba(24, 32, 46, .25);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0e121a;
  --surface: #161c27;
  --sunk: #1c2331;
  --ink: #e6eaf2;
  --muted: #98a2b4;
  --line: #29313f;
  --line-strong: #3a4456;
  --cobalt: #5468ff;
  --cobalt-deep: #3f52f0;
  --ok: #3fcf98;
  --bad: #ff9b5c;
  --warn-bg: #2b2113;
  --warn-ink: #ffcf96;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 16px 40px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e121a;
    --surface: #161c27;
    --sunk: #1c2331;
    --ink: #e6eaf2;
    --muted: #98a2b4;
    --line: #29313f;
    --line-strong: #3a4456;
    --cobalt: #5468ff;
    --cobalt-deep: #3f52f0;
    --ok: #3fcf98;
    --bad: #ff9b5c;
    --warn-bg: #2b2113;
    --warn-ink: #ffcf96;
    --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 16px 40px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
svg { display: block; }

.wrap { width: min(1320px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--cobalt); color: var(--on-cobalt); padding: 10px 14px; border-radius: var(--r-sm); z-index: 50; text-decoration: none; }
.skip:focus { top: 12px; }

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 21px; letter-spacing: -.03em; }
.brand svg { width: 26px; height: 26px; fill: var(--cobalt); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.intro { padding: 64px 0 72px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); gap: 40px 72px; align-items: center; }
.intro-text { display: grid; gap: 26px; justify-items: start; }
.intro h1 { font-size: clamp(40px, 6.2vw, 84px); font-weight: 650; letter-spacing: -.05em; line-height: .95; max-width: 12ch; }
.lead { font-size: 18px; color: var(--muted); max-width: 52ch; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 500; }

.studio {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) minmax(320px, 400px);
  grid-template-areas: "types editor preview";
  gap: 20px;
  align-items: start;
  padding-bottom: 72px;
}
.types { grid-area: types; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.type-group { display: flex; flex-direction: column; gap: 2px; }
.group-label { font-size: 13px; color: var(--muted); padding: 0 12px 4px; font-weight: 500; }
.types button {
  display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; text-align: left;
  padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer;
  font-weight: 500; color: var(--muted);
}
.types button:hover { background: var(--surface); color: var(--ink); }
.types button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.types svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.editor { grid-area: editor; display: grid; gap: 20px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); }
.panel-head { margin-bottom: 20px; }
.panel-head h2 { font-size: 26px; letter-spacing: -.025em; }
.panel-head p { margin-top: 6px; max-width: 60ch; }
.panel-head.row { display: flex; align-items: center; justify-content: space-between; }

.fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 14px; }
.fields > * { grid-column: span 6; }
.fields > .half { grid-column: span 3; }
.fields > .third { grid-column: span 2; }
.fields > .twothird { grid-column: span 4; }
.field { display: grid; gap: 6px; align-content: start; }
.lbl { font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.lbl output { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.help { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--bad); font-weight: 500; }

input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="datetime-local"], select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--sunk);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  min-height: 46px;
  transition: border-color .15s, background-color .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 22%, transparent); }
.invalid input, .invalid textarea { border-color: var(--bad); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; user-select: none; padding: 4px 0; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; margin: 0; flex: none; cursor: pointer; transition: background-color .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--cobalt); }
.switch input:checked::after { transform: translateX(16px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.btn.primary:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.text { border: 0; background: none; padding: 0 4px; min-height: 32px; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn.text:hover { color: var(--ink); }

.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.presets button { border: 1px solid var(--line); background: var(--sunk); border-radius: var(--r-md); padding: 10px 8px 8px; cursor: pointer; display: grid; gap: 6px; justify-items: center; font-size: 13px; font-weight: 500; }
.presets button:hover { border-color: var(--line-strong); }
.presets button[aria-pressed="true"] { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.presets .pv { width: 100%; max-width: 64px; aspect-ratio: 1; display: grid; place-items: center; }
.presets .pv svg { width: 100%; height: 100%; }

.group { border-top: 1px solid var(--line); }
.group summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.group[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.group-body { display: grid; gap: 16px; padding-bottom: 22px; }
.sub { display: grid; gap: 14px; padding: 14px 16px; background: var(--sunk); border-radius: var(--r-md); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.color { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--sunk); border-radius: var(--r-sm); padding: 5px; min-height: 46px; }
.color:focus-within { border-color: var(--cobalt); }
.color input[type="color"] { appearance: none; -webkit-appearance: none; width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; }
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-strong); border-radius: 7px; }
.color input[type="color"]::-moz-color-swatch { border: 1px solid var(--line-strong); border-radius: 7px; }
.color input[type="text"] { border: 0; background: none; min-height: 34px; padding: 0 4px; font-family: var(--mono); font-size: 14px; text-transform: lowercase; box-shadow: none; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg button { flex: 1 1 0; min-height: 38px; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); padding: 0 10px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); }
.seg.shapes button { min-height: 50px; display: grid; place-items: center; }
.seg.shapes svg { width: 26px; height: 26px; fill: currentColor; }
.seg.ecl button { display: grid; line-height: 1.1; padding: 7px 0; }
.seg.ecl small { font-weight: 500; font-size: 12px; opacity: .75; }

input[type="range"] { width: 100%; accent-color: var(--cobalt); height: 28px; margin: 0; }

.drop { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); transition: border-color .15s, background-color .15s; }
.drop.over { border-color: var(--cobalt); background: color-mix(in srgb, var(--cobalt) 8%, transparent); }
.drop > div { flex: 1; display: grid; gap: 4px; }
.drop img { width: 56px; height: 56px; object-fit: contain; border-radius: var(--r-sm); background: var(--sunk); padding: 4px; }

.preview { grid-area: preview; display: grid; gap: 14px; }
@media (min-height: 860px) and (min-width: 761px) { .preview { position: sticky; top: 84px; } }
.stage {
  position: relative;
  background: var(--cobalt);
  border-radius: 28px;
  padding: 36px;
  display: grid; place-items: center;
}
.corner { position: absolute; width: 26px; height: 26px; border: 3px solid rgba(255, 255, 255, .85); }
.corner.tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner.tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner.bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner.br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.sheet {
  width: 100%;
  border-radius: 14px;
  background:
    repeating-conic-gradient(#e7eaf0 0 25%, #ffffff 0 50%) 0 0 / 16px 16px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 30, .55);
  overflow: hidden;
  display: grid; place-items: center;
}
.sheet svg { width: 100%; height: auto; }
.sheet.is-empty { aspect-ratio: 1; background: rgba(255, 255, 255, .1); box-shadow: none; border: 2px dashed rgba(255, 255, 255, .45); }
.empty { display: grid; justify-items: center; gap: 16px; padding: 24px; text-align: center; color: #fff; max-width: 260px; }
.empty svg { width: 64px; height: 64px; fill: rgba(255, 255, 255, .55); }
.empty p { font-weight: 500; }

.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; font-size: 15px; padding: 2px 4px; }
.check .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--line-strong); flex: none; }
.check[data-state="pending"] .dot { background: var(--muted); animation: pulse 1s infinite alternate; }
.check[data-state="ok"] { color: var(--ok); }
.check[data-state="ok"] .dot { background: var(--ok); }
.check[data-state="bad"] { color: var(--bad); font-weight: 500; }
.check[data-state="bad"] .dot { background: var(--bad); }
.check[data-state="idle"] { color: var(--muted); }
@keyframes pulse { to { opacity: .3; } }

.warnings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.warnings:empty { display: none; }
.warnings li { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r-sm); padding: 9px 12px; font-size: 14px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.warnings .btn { flex: none; min-height: 32px; padding: 0 12px; font-size: 13px; background: transparent; border-color: currentColor; color: inherit; }

.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.meta:empty { display: none; }
.meta div { padding: 10px 12px; border-left: 1px solid var(--line); }
.meta div:first-child { border-left: 0; }
.meta dt { font-size: 12px; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-family: var(--mono); font-size: 14px; white-space: nowrap; }

.raw summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); padding: 4px; }
.raw pre { margin: 8px 0 0; font-family: var(--mono); font-size: 13px; line-height: 1.6; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; }

.export { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.dl { display: flex; flex-wrap: wrap; gap: 8px; }
.export .dl .btn { flex: 1 1 calc(33.33% - 6px); padding: 0 10px; }
.export .dl .btn.wide, .export .dl #print-open { flex-basis: 100%; }
.export-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.export > .btn.text { justify-self: start; }

.block { padding: 88px 0; border-top: 1px solid var(--line); }
.block-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px 56px; margin-bottom: 32px; align-items: end; }
.block-head h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -.035em; }
.block-head p { max-width: 58ch; }

.scan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.scan-box { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); background: var(--ink); overflow: hidden; display: grid; place-items: center; outline: 2px dashed transparent; outline-offset: -10px; transition: outline-color .15s; }
.scan-box.over { outline-color: var(--cobalt); }
.scan-box video, .scan-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-box img { inset: 16px 16px 76px; width: calc(100% - 32px); height: calc(100% - 92px); object-fit: contain; background: transparent; }
.scan-idle { display: grid; justify-items: center; gap: 14px; color: color-mix(in srgb, var(--paper) 70%, transparent); text-align: center; padding: 24px 24px 90px; }
.scan-idle svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.scan-box.live::after { content: ""; position: absolute; inset: 18% 24%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }
.scan-actions { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; z-index: 2; }
.scan-actions .btn:not(.primary) { background: rgba(255, 255, 255, .92); color: #18202e; border-color: transparent; }
.scan-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.scan-result .kind { font-size: 14px; font-weight: 600; color: var(--muted); }
.scan-result .host { font-size: clamp(24px, 3vw, 34px); font-weight: 650; letter-spacing: -.03em; line-height: 1.1; word-break: break-all; margin-top: -10px; }
.scan-fail { color: var(--bad); font-weight: 500; }
.verdict { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.verdict li { padding: 10px 14px; border-radius: var(--r-sm); font-size: 15px; }
.verdict .warn { background: var(--warn-bg); color: var(--warn-ink); }
.verdict .good { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); font-weight: 500; }
.rows { margin: 0; display: grid; gap: 10px; }
.rows div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rows dt { color: var(--muted); font-size: 14px; }
.rows dd { margin: 0; font-family: var(--mono); font-size: 14px; word-break: break-word; }

.batch { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; }
.batch textarea { font-family: var(--mono); font-size: 14px; min-height: 230px; }
.batch-side { display: grid; gap: 18px; align-content: start; }

.facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.facts-grid h3 { font-size: 20px; margin-bottom: 10px; padding-top: 18px; border-top: 3px solid var(--ink); letter-spacing: -.015em; }
.facts-grid p { color: var(--muted); max-width: 46ch; }

.faq { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; font-size: 19px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq p { padding: 0 0 22px; color: var(--muted); max-width: 68ch; }

.foot { border-top: 1px solid var(--line); padding: 44px 0 48px; color: var(--muted); font-size: 14px; background: var(--surface); }
.foot-in { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: start; }
.foot-brand { display: grid; gap: 10px; }
.foot-brand .brand { color: var(--ink); }
.foot .copy { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); }
.foot nav { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

.sheet-dialog { border: 0; padding: 26px; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); width: min(560px, calc(100% - 24px)); max-height: min(720px, calc(100% - 48px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.sheet-dialog::backdrop { background: rgba(10, 14, 24, .5); backdrop-filter: blur(3px); }
.sheet-dialog[open] { display: grid; gap: 14px; align-content: start; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { font-size: 24px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history .none { color: var(--muted); padding: 18px 0; }
.history button { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--sunk); border-radius: var(--r-md); padding: 10px; cursor: pointer; }
.history button:hover { border-color: var(--line-strong); }
.history .pv { width: 56px; height: 56px; flex: none; background: #fff; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.history .pv svg { width: 100%; height: 100%; }
.history .txt { display: grid; min-width: 0; }
.history .txt span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history small { color: var(--muted); font-size: 12px; }
.sheet-dialog > .btn.text { justify-self: start; }

.toast { visibility: hidden; position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--r-md); font-weight: 500; font-size: 15px; max-width: calc(100% - 32px); transition: transform .25s cubic-bezier(.2, .9, .3, 1.2); z-index: 60; box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .5); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

.legal { padding: 56px 0 80px; }
.legal article { max-width: 760px; }
.legal h1 { font-size: clamp(34px, 4.6vw, 54px); letter-spacing: -.04em; margin-bottom: 28px; }
.legal h2 { font-size: 22px; margin: 36px 0 10px; }
.legal h3 { font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--muted); }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 20px; }
.legal address { font-style: normal; color: var(--ink); line-height: 1.7; }
.legal a { color: var(--cobalt); }

.btn.big { min-height: 52px; padding: 0 24px; font-size: 17px; border-radius: 12px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.demo { display: grid; gap: 18px; justify-items: center; }
.demo-card { position: relative; width: min(100%, 420px); aspect-ratio: 1; background: var(--cobalt); border-radius: 32px; display: grid; place-items: center; padding: 54px; box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--cobalt) 70%, transparent); overflow: hidden; }
.demo-sheet { width: 100%; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 20px 40px -18px rgba(0, 0, 30, .6); }
.demo-sheet svg { width: 100%; height: auto; }
.demo-card .corner { width: 30px; height: 30px; }
.demo-card .corner.tl, .demo-card .corner.tr { top: 20px; }
.demo-card .corner.bl, .demo-card .corner.br { bottom: 20px; }
.demo-card .corner.tl, .demo-card .corner.bl { left: 20px; }
.demo-card .corner.tr, .demo-card .corner.br { right: 20px; }
.scanline { position: absolute; left: 30px; right: 30px; top: 0; height: 3px; border-radius: 3px; background: #fff; box-shadow: 0 0 24px 6px rgba(255, 255, 255, .7); opacity: 0; pointer-events: none; }
.intro-scan .scanline { animation: sweep 1.6s .35s cubic-bezier(.45, 0, .2, 1) both; }
.intro-scan .demo-sheet { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.swap .demo-sheet { animation: flip .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sweep { 0% { top: 12%; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: 88%; opacity: 0; } }
@keyframes rise { from { transform: translateY(18px) scale(.96); opacity: 0; } }
@keyframes flip { from { transform: scale(.92); opacity: 0; } }
.demo-cap { display: grid; justify-items: center; gap: 2px; text-align: center; }
.demo-cap strong { font-size: 18px; }
.demo-cap span { color: var(--muted); }

.head-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.tabs { display: flex; gap: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 0 0 10px; margin-bottom: -1px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.presets .pv { border-radius: 8px; overflow: hidden; }
.mine-item { position: relative; display: grid; }
.mine-item .del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 15px; line-height: 1; padding: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.mine-item:hover .del, .mine-item .del:focus-visible { opacity: 1; }
@media (hover: none) { .mine-item .del { opacity: 1; } }
.presets .add { border-style: dashed; background: transparent; color: var(--muted); }
.presets .pv.plus { font-size: 30px; font-weight: 300; border: 1.5px dashed var(--line-strong); border-radius: 10px; max-width: 52px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; padding: 2px; background: none; cursor: pointer; }
.swatches span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.swatches button[aria-pressed="true"] { border-color: var(--ink); }
.btn.text.start, .btn.start { justify-self: start; }
.group-body.tight { padding-bottom: 0; gap: 14px; }
.seg.shapes button { flex: 1 0 44px; }
.seg.fonts button[data-v="serif"] { font-family: Georgia, serif; }
.seg.fonts button[data-v="mono"] { font-family: "Courier New", monospace; }
.seg.fonts button[data-v="round"] { font-family: "Trebuchet MS", sans-serif; }
.frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.frames button { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunk); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); }
.frames button[aria-pressed="true"] { border-color: var(--cobalt); color: var(--ink); box-shadow: inset 0 0 0 1px var(--cobalt); }
.frames .fi { width: 44px; height: 52px; display: grid; place-items: center; }
.frames .fi svg { max-width: 44px; max-height: 52px; width: auto; height: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.icons button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); padding: 8px; cursor: pointer; }
.icons button[aria-pressed="true"] { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.icons img { width: 100%; height: 100%; display: block; }
.lbl .count { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.fab { position: fixed; right: 14px; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); cursor: pointer; }
.fab #fab-pv { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: #fff; display: grid; place-items: center; padding: 4px; }
.fab #fab-pv svg { width: 100%; height: 100%; }

.band { background: #121826; color: #e6eaf2; --surface: #1a2131; --sunk: #202838; --line: #2c3547; --line-strong: #3b4558; --ink: #e6eaf2; --muted: #9aa5b8; --warn-bg: #2b2113; --warn-ink: #ffcf96; --ok: #3fcf98; --bad: #ff9b5c; }
.band .block { border-top: 0; }
.band .scan-box { background: #0a0e17; border: 1px solid #2c3547; }

.compare { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.c-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); }
.c-row > span { padding: 16px 22px; border-top: 1px solid var(--line); }
.c-row > span + span { border-left: 1px solid var(--line); }
.c-head > span { border-top: 0; font-weight: 600; font-size: 15px; background: var(--sunk); }
.c-head > span:nth-child(2) { color: var(--cobalt); }
.c-row [role="rowheader"] { font-weight: 600; }
.c-row .yes, .c-row .no, .c-row .mid { display: flex; align-items: center; gap: 10px; }
.c-row .yes::before, .c-row .no::before, .c-row .mid::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.c-row .yes::before { background: var(--ok); }
.c-row .no::before { background: var(--bad); }
.c-row .mid::before { background: var(--line-strong); }
.c-row .no, .c-row .mid { color: var(--muted); }

.batch-main { display: grid; gap: 16px; align-content: start; }
.seq { border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 16px; }
.seq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.seq-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding-bottom: 16px; }
.seq-body .wide { grid-column: 1 / -1; }
.progress { height: 6px; background: var(--sunk); border-radius: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--cobalt); transition: width .15s; }

.sheet-dialog.wide { width: min(980px, calc(100% - 24px)); }
.print-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.print-opts { display: grid; gap: 18px; }
.paper-wrap { background: var(--sunk); border-radius: var(--r-md); padding: 20px; display: grid; place-items: center; }
.paper { width: 100%; max-width: 380px; aspect-ratio: 210 / 297; background: #fff; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .35); container-type: inline-size; position: relative; }
.page { position: relative; width: 100%; height: 100%; color: #000; }
.page .cell { position: absolute; display: grid; justify-items: center; }
.page .cell img { width: 100%; display: block; }
.page .cell span { font-family: Arial, sans-serif; font-size: 1.25cqw; line-height: 1.2; margin-top: .9cqw; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page .marks { position: absolute; inset: 0; width: 100%; height: 100%; }
.print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing { background: #fff; }
  body.printing .print-sheet { display: block; }
  .print-sheet .page { width: 210mm; height: 297mm; container-type: inline-size; page-break-after: always; break-after: page; overflow: hidden; }
}

@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); grid-template-areas: "types types" "editor preview"; }
  .types { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: thin; }
  .types button { flex: none; background: var(--surface); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; }
  .types button[aria-pressed="true"] { border-color: var(--ink); }
  .type-group { flex-direction: row; gap: 6px; flex: none; }
  .group-label { display: none; }
  .types { gap: 6px; }
  .intro { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 32px; }
  .presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  .nav { display: none; }
  .icon-btn#theme { margin-left: auto; }
  .intro { padding: 32px 0 40px; grid-template-columns: 1fr; }
  .demo { order: -1; }
  .demo-card { width: min(78vw, 300px); padding: 38px; border-radius: 26px; }
  .demo-card .corner { width: 22px; height: 22px; }
  .btn.big { min-height: 48px; font-size: 16px; padding: 0 18px; }
  .cta { width: 100%; }
  .cta .btn { flex: 1 1 auto; }
  .frames { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .frames .fi { width: 34px; height: 42px; }
  .compare { border-radius: 16px; }
  .c-row { grid-template-columns: 1fr 1fr; }
  .c-row > [role="rowheader"] { grid-column: 1 / -1; background: var(--sunk); padding: 10px 16px; }
  .c-row > span { padding: 12px 16px; font-size: 15px; }
  .c-row > span + span { border-left: 0; }
  .c-row > span:nth-child(3) { border-left: 1px solid var(--line); }
  .c-head > span:first-child { display: none; }
  .c-head > span:nth-child(3) { border-left: 1px solid var(--line); }
  .seq-body { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seq-body .btn { grid-column: 1 / -1; }
  .print-grid { grid-template-columns: 1fr; }
  .paper-wrap { order: -1; padding: 12px; }
  .paper { max-width: 220px; }
  .foot-in { grid-template-columns: 1fr; }
  .presets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .presets button { padding: 8px 4px 6px; font-size: 12px; }
  .lead { font-size: 16.5px; }
  .studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "types" "content" "preview" "design"; gap: 14px; padding-bottom: 48px; }
  .editor { display: contents; }
  .content { grid-area: content; }
  .design { grid-area: design; }
  .types { margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; }
  .types::-webkit-scrollbar { display: none; }
  .preview { position: static; }
  .stage { padding: 30px; border-radius: 22px; }
  .stage .sheet { max-width: 320px; }
  .corner { width: 20px; height: 20px; }
  .corner.tl, .corner.tr { top: 11px; }
  .corner.bl, .corner.br { bottom: 11px; }
  .corner.tl, .corner.bl { left: 11px; }
  .corner.tr, .corner.br { right: 11px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta div:nth-child(3) { border-left: 0; }
  .meta div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .panel { padding: 20px 18px; border-radius: 18px; }
  .panel-head h2 { font-size: 23px; }
  .fields > .half, .fields > .third, .fields > .twothird { grid-column: span 6; }
  .seg.shapes button { min-height: 46px; padding: 0 4px; }
  .block { padding: 52px 0; }
  .block-head { grid-template-columns: 1fr; }
  .scan, .batch, .facts-grid { grid-template-columns: 1fr; }
  .facts-grid { gap: 28px; }
  .scan-box { aspect-ratio: 1; }
  .rows div { grid-template-columns: 1fr; gap: 2px; }
  .faq summary { font-size: 17px; }
}
