:root {
  /* Chrome UI — Google-like blue / white (demo mockups keep their own seed tokens) */
  --ink: #202124;
  --paper: #ffffff;
  --paper-deep: #f8f9fa;
  --line: #dadce0;
  --muted-ui: #5f6368;
  --spark: #1a73e8;
  --google-blue: #1a73e8;
  --google-blue-hover: #1765cc;
  --surface-ui: #ffffff;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --rail-w: min(340px, 36vw);

  --p0: #ff7800;
  --p1: #1c1917;
  --p2: #fdba74;
  --p3: #fff7ed;
  --p4: #c2410c;
  --p5: #ffedd5;
  --p6: #0c0a09;
  --text-on-p0: #12141a;
  --surface: #fff7ed;
  --border: #fed7aa;
  --muted: #9a3412;
  --header: #0c0a09;
  --on-header: #fff7ed;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
}

.site-frame {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: #fff;
  z-index: 8;
  flex-shrink: 0;
}

.site-logo-link {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.logo-mark {
  white-space: nowrap;
}

.logo-agent {
  color: var(--ink);
}

.logo-stylus {
  color: var(--google-blue);
}

.doc-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 18rem;
}

.doc-name-input {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  min-width: 0;
  width: 100%;
  max-width: 12rem;
  outline: none;
}

.doc-name-input:hover {
  border-color: var(--line);
  background: color-mix(in srgb, #fff 70%, transparent);
}

.doc-name-input:focus {
  border-color: color-mix(in srgb, var(--spark) 55%, var(--line));
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--spark) 18%, transparent);
}

.autosave-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--muted-ui);
  white-space: nowrap;
}

.autosave-status[data-state="saved"] {
  color: var(--google-blue);
}

.autosave-status[data-state="saving"] {
  color: var(--google-blue);
}

.autosave-status[data-state="dirty"] {
  color: var(--muted-ui);
}

.site-nav-main {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 650;
  font-size: 0.86rem;
  color: var(--muted-ui);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.nav-link.is-on {
  color: var(--google-blue);
  background: #e8f0fe;
}

.nav-export {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.header-gallery {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--google-blue);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  flex-shrink: 0;
  background: #fff;
}

.header-gallery:hover {
  border-color: var(--google-blue);
  background: #f8fbff;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.85rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  background: #f8f9fa;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted-ui);
  flex-shrink: 0;
  z-index: 8;
}

.footer-love,
.footer-copy {
  margin: 0;
}

.footer-love {
  color: var(--muted-ui);
}

.footer-copy {
  color: #3c4043;
  font-weight: 500;
}

.view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.view[hidden] {
  display: none !important;
}

.stage-scroll.pad {
  padding: 1.15rem 1.35rem 1.75rem;
}

.tools-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.1rem;
  margin-bottom: 1rem;
}

.tools-bar .field {
  display: grid;
  gap: 0.35rem;
  min-width: 10rem;
  flex: 1;
}

.harmony-swatches.wide {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

/* Scale / Harmony: shared right-pane split — settings 38% · website demo 62% */
.page-split-view {
  min-height: 0;
}

.page-split {
  display: grid;
  grid-template-rows: minmax(0, 38fr) minmax(0, 62fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.page-split-top {
  min-height: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, #fff 55%, transparent);
}

.page-split-top-scroll {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.85rem 1rem 1rem;
}

.page-split-bottom {
  min-height: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--p3) 40%, #fff);
}

.site-demo-host {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.site-demo-host .demo,
.site-demo-host .demo-hero {
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.site-demo-host .demo-site {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.page-split-top .tools-bar {
  margin-bottom: 0.75rem;
}

.page-split-top .harmony-swatches.wide {
  margin-bottom: 0;
}

.page-split-top .scale-title:first-child {
  margin-top: 0;
}

@media (max-width: 860px) {
  .page-split {
    grid-template-rows: auto minmax(280px, 55vh);
    height: auto;
  }
  .page-split-top-scroll {
    max-height: 42vh;
  }
}

.preset-grid.page {
  margin-top: 0.75rem;
}

.entry-paths {
  display: grid;
  gap: 0.4rem;
}

.entry-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-ui);
}

.entry-option {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.entry-title {
  margin: 0;
  font-family: Figtree, ui-sans-serif, sans-serif;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
  text-transform: none;
}

.entry-or {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.05rem 0;
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-ui);
}

.entry-or::before,
.entry-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.entry-or span {
  flex-shrink: 0;
}

.entry-option-action {
  appearance: none;
  font: inherit;
  cursor: pointer;
  width: 100%;
  align-items: start;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.entry-option-action:hover {
  border-color: color-mix(in srgb, var(--ink) 35%, var(--line));
  background: color-mix(in srgb, var(--paper) 40%, #fff);
}

.entry-action-go {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--spark);
}

.rail-secondary {
  margin-top: 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.import-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}

#import-url {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

#import-url:focus {
  outline: 2px solid color-mix(in srgb, var(--ink) 20%, transparent);
  outline-offset: 1px;
}

#import-url-btn.btn-ghost {
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.import-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.import-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-file-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.import-file:hover .import-file-btn {
  border-color: var(--ink);
}

.import-file-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-note {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  font-weight: 550;
  line-height: 1.35;
  color: var(--muted-ui);
}

.import-note.is-warn {
  color: #9a3412;
}

.hint.tight {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted-ui);
}

.site-nav-main a.nav-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.suggest-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.suggest-swatch {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  text-align: left;
}

.suggest-swatch:hover {
  border-color: var(--ink);
}

.suggest-chip {
  display: block;
  height: 28px;
  border-radius: 6px;
}

.suggest-hex {
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted-ui);
}

body.rail-collapsed .shell {
  grid-template-columns: 1fr;
}

body.rail-collapsed .rail {
  display: none;
}

.grain {
  display: none;
}

/* —— Split shell —— */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  overscroll-behavior: contain;
  z-index: 2;
  min-height: 0;
}

.rail-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0.9rem 1.15rem;
}

.rail-foot {
  flex-shrink: 0;
}

.rail-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.export-menu {
  position: relative;
  flex-shrink: 0;
}

.export-caret {
  font-size: 0.65rem;
  opacity: 0.85;
}

.export-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 12.5rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.export-group-label {
  margin: 0.15rem 0.5rem 0.1rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.5;
  font-weight: 700;
}

.export-dropdown[hidden] {
  display: none !important;
}

.export-dropdown button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}

.export-dropdown button:hover {
  background: color-mix(in srgb, var(--spark) 12%, #fff);
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background:
    radial-gradient(700px 380px at 90% -10%, color-mix(in srgb, var(--p0) 18%, transparent), transparent 55%),
    color-mix(in srgb, #fff 35%, transparent);
}

.stage > .view {
  flex: 1;
  min-height: 0;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.stage-hint {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-ui);
}

.stage-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.15rem 1.5rem;
}

.rail-brand .brand {
  margin: 0;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(120deg, var(--ink) 35%, var(--spark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tag {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-ui);
}

.block {
  display: grid;
  gap: 0.45rem;
}

[hidden] {
  display: none !important;
}

.field-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-ui);
}

.field-label em {
  font-style: normal;
  color: var(--spark);
  margin-left: 0.2rem;
}

.seed-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.seed-tile {
  appearance: none;
  position: relative;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 35%, #fff);
  border-radius: 8px;
  padding: 0.45rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.4rem;
  align-items: center;
  text-align: left;
  font: inherit;
}

.seed-tile:hover {
  border-color: color-mix(in srgb, var(--ink) 28%, var(--line));
}

.seed-tile.is-active {
  border-color: var(--ink);
  background: #fff;
  box-shadow: none;
}

.seed-tile-check {
  position: absolute;
  top: 0.25rem;
  right: 0.3rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--google-blue);
  color: #fff;
  display: none;
  place-items: center;
  line-height: 1;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--google-blue) 35%, transparent);
  z-index: 2;
}

.seed-tile-check svg {
  display: block;
  width: 14px;
  height: 14px;
}

.seed-tile.is-active .seed-tile-check {
  display: grid;
}

.seed-tile-swatch-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  flex-shrink: 0;
}

.seed-tile-swatch {
  display: block;
  width: 100%;
  height: 100%;
}

.seed-picker-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(18, 20, 26, 0.22);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.92;
  transition: background 0.15s ease;
}

.seed-tile-swatch-wrap:hover .seed-picker-btn,
.seed-picker-btn:focus-visible {
  background: rgba(18, 20, 26, 0.4);
}

.seed-tile-swatch-wrap.is-locked {
  cursor: default;
}

.seed-tile-meta {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  padding-right: 1.4rem;
}

.seed-tile-name {
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--ink);
}

.seed-tile-hex {
  font-size: 0.62rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seed-tile-oklch {
  font-size: 0.58rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-ui);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seed-tile:not(.is-active) .seed-tile-oklch {
  display: none;
}

/* Custom color picker dialog */
.cpicker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(18, 20, 26, 0.45);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.cpicker-backdrop[hidden] {
  display: none !important;
}

.cpicker {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cpicker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.cpicker-head h2 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.cpicker-close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted-ui);
  padding: 0.15rem 0.35rem;
}

.cpicker-body {
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.cpicker-preview-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.cpicker-preview {
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.cpicker-visual {
  display: grid;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-ui);
}

.cpicker-visual input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.cpicker-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-ui);
}

.cpicker-field input {
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.cpicker-oklch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.cpicker-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--line);
}

.cpicker-foot .btn-primary {
  appearance: none;
  border: 1.5px solid #16a34a;
  background: #16a34a;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
}

.cpicker-foot .btn-primary:hover {
  background: #15803d;
  border-color: #15803d;
}

#seed {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
}

#seed::-webkit-color-swatch-wrapper {
  padding: 0;
}
#seed::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

#seed-hex,
#harmony,
#count {
  font: inherit;
  font-weight: 600;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  color: var(--ink);
}

#seed-hex {
  flex: 1;
  padding: 0.65rem 0.75rem;
  font-variant-numeric: tabular-nums;
}

#harmony {
  width: 100%;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
}

#count {
  width: 100%;
  accent-color: var(--spark);
}

.oklch-line {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-ui);
  word-break: break-all;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mode-tab,
.theme-btn,
.mode-btn,
.preview-tab,
.domain-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mode-tab.is-on,
.theme-btn.is-on,
.mode-btn.is-on,
.preview-tab.is-on,
.domain-chip.is-on {
  background: var(--google-blue);
  border-color: var(--google-blue);
  color: #fff;
}

.export-menu .nav-export[aria-expanded="true"] {
  color: var(--google-blue);
  background: #e8f0fe;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted-ui);
  line-height: 1.4;
}

.btn-spark {
  appearance: none;
  border: none;
  margin-top: 0.55rem;
  background: var(--spark);
  color: #fff8f5;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
}

.btn-ghost:hover,
.btn-spark:hover {
  filter: brightness(1.04);
}

.harmony-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.swatch {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font: inherit;
}

.swatch .chip {
  height: 44px;
}
.swatch .meta {
  padding: 0.4rem 0.5rem 0.5rem;
}
.swatch .role {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-ui);
}
.swatch .hex {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.presets-block {
  max-height: 280px;
  overflow: auto;
}

.domain-bar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.filter-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-right: 0.2rem;
  min-width: 2.6rem;
}

.preset-grid {
  display: grid;
  gap: 0.4rem;
}

.preset {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: grid;
  gap: 0.3rem;
}

.preset:hover {
  box-shadow: var(--shadow);
}

.preset-name {
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
}

.preset-domain {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-ui);
}

.preset-stripes {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
}
.preset-stripes span {
  flex: 1;
}

/* Scales pane */
.scale-title {
  margin: 0 0 0.55rem;
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.scale-title:not(:first-child) {
  margin-top: 1.25rem;
}

.status-scales .scale-title {
  margin-top: 1.25rem;
}

.variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.variant-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.variant-chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.variant-score {
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
  font-size: 0.72rem;
}

.site-main.has-system-gradient {
  background-size: cover;
  background-position: center;
  position: relative;
}

.site-main.has-system-gradient::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-scrim, transparent);
  pointer-events: none;
  z-index: 0;
}

.site-main.has-system-gradient > * {
  position: relative;
  z-index: 1;
}

.site-hero.has-system-gradient {
  background: transparent;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 0.35rem;
}

.scale-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.35rem;
}

.scale-head-row .scale-title {
  margin-bottom: 0.15rem;
}

.pin-field {
  min-width: 7.5rem;
}

.pin-field select {
  font: inherit;
  font-weight: 650;
  font-size: 0.85rem;
  padding: 0.4rem 0.55rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.role-seeds {
  margin: 0.85rem 0 0.35rem;
}

.role-seed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.role-seed-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted-ui);
}

.role-seed-inputs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.role-seed-inputs input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.role-seed-inputs input[type="text"] {
  width: 5.6rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scale-cell.is-pinned {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.scale-cell.is-pinned .scale-step {
  font-weight: 800;
}

@media (max-width: 1100px) {
  .scale-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.scale-cell {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.12s ease;
}
.scale-cell:hover {
  transform: translateY(-2px);
}
.scale-chip {
  display: block;
  height: 56px;
}
.scale-step,
.scale-hex {
  display: block;
  padding: 0.25rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
}
.scale-hex {
  font-variant-numeric: tabular-nums;
  color: var(--muted-ui);
  padding-top: 0;
  padding-bottom: 0.4rem;
}
.scale-cell.slim .scale-chip {
  height: 40px;
}

.scale-foot {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted-ui);
}


/* Demos — agreed ratios: website 58% · bottom 42%; card 1.9 · tee 0.9 · book/social 1.1 */
.stage-scroll#pane-feel {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.4rem 0.4rem;
  overflow: hidden;
}

.demo-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.9fr 0.9fr 1.1fr 1.1fr;
  grid-template-rows: minmax(0, 58fr) minmax(0, 42fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.demo {
  position: relative;
  background: var(--p3);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}

.demo-site {
  grid-column: 1 / -1;
  grid-row: 1;
  border-bottom: 1px solid var(--line);
}

.demo-card {
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid var(--line);
}

.demo-tee {
  grid-column: 2;
  grid-row: 2;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--p1) 8%, var(--p3));
}

.demo-book {
  grid-column: 3;
  grid-row: 2;
  border-right: 1px solid var(--line);
}

.demo-social {
  grid-column: 4;
  grid-row: 2;
}

.demo-tag {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  left: auto;
  z-index: 4;
  margin: 0;
  padding: 0.1rem 0.35rem;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-p0);
  background: var(--p0);
  border-radius: 4px;
  pointer-events: none;
}

/* —— Website fills 58% band —— */
.site {
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: var(--p3);
  color: var(--p1);
  display: flex;
  flex-direction: column;
}

.site-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  background: var(--p0);
  color: var(--text-on-p0);
  flex-shrink: 0;
}

.site-logo {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.9;
  margin-left: auto;
}

.site-pill {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, #fff 25%, transparent);
}

.site-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--p2) 28%, transparent), transparent 55%),
    var(--p3);
  align-items: start;
}

.site-hero {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.site-hero h3 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: clamp(1.25rem, 2.6vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  max-width: 16ch;
  color: var(--p1);
}

.site-hero p {
  margin: 0;
  font-size: clamp(0.8rem, 1.3vw, 0.95rem);
  color: color-mix(in srgb, var(--p1) 72%, #777);
  max-width: 42ch;
  line-height: 1.4;
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.site-btn {
  border-radius: 9px;
  padding: 0.55rem 1rem;
  font-size: clamp(0.78rem, 1.2vw, 0.9rem);
  font-weight: 700;
}
.site-btn.solid {
  background: var(--p0);
  color: var(--text-on-p0);
}
.site-btn.ghost {
  border: 1.5px solid var(--p4);
  color: var(--p1);
}

.site-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-field {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.site-input {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--surface-2, #fff);
  border: 1px solid color-mix(in srgb, var(--p4) 45%, transparent);
  color: var(--p1);
  font-weight: 600;
  font-size: clamp(0.8rem, 1.2vw, 0.95rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-toggle {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--p0);
  position: relative;
  flex-shrink: 0;
}
.site-toggle i {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}

.site-progress {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--p1) 12%, transparent);
  overflow: hidden;
  flex-shrink: 0;
}
.site-progress i {
  display: block;
  height: 100%;
  background: var(--p0);
  border-radius: inherit;
}

.site-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}
.site-chips span {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--p0) 18%, #fff);
  color: var(--p1);
}

.site-table {
  margin-top: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid color-mix(in srgb, var(--p4) 35%, transparent);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2, #fff);
  font-size: clamp(0.72rem, 1.15vw, 0.85rem);
  color: var(--p1);
}
.site-tr {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.7fr;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--p4) 28%, transparent);
  font-weight: 600;
}
.site-tr:last-child { border-bottom: 0; }
.site-tr.head {
  background: color-mix(in srgb, var(--p0) 14%, var(--surface-2, #fff));
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 1;
}
.site-tr .ok { color: #16a34a; font-weight: 700; }
.site-tr .warn { color: #d97706; font-weight: 700; }
.site-tr .info { color: var(--p0); font-weight: 700; }

.site-toasts {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.4rem;
  min-width: 0;
  max-width: 220px;
  width: 100%;
  margin-left: auto;
  height: auto;
  align-self: start;
}

.toast-item {
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: var(--surface-2, #fff);
  border-left: 3px solid;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  display: grid;
  gap: 0.1rem;
  flex: 0 0 auto;
  min-height: 0;
  color: var(--p1);
}
.toast-item b {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.toast-item span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  opacity: 1;
  line-height: 1.25;
}
.toast-item.ok { border-color: #16a34a; }
.toast-item.ok b { color: #16a34a; }
.toast-item.warn { border-color: #d97706; }
.toast-item.warn b { color: #d97706; }
.toast-item.err { border-color: #dc2626; }
.toast-item.err b { color: #dc2626; }
.toast-item.info { border-color: var(--p0); }
.toast-item.info b { color: var(--p0); }

.site-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0.45rem 0.65rem 0.55rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--p1) 6%, var(--p3));
  border-top: 1px solid color-mix(in srgb, var(--p4) 40%, transparent);
}

.site-token {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--p4) 40%, transparent);
  background: var(--surface-2, #fff);
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: grid;
  grid-template-columns: 14px 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.4rem;
  row-gap: 0.08rem;
  align-items: center;
  color: var(--p1);
  transition: transform 0.1s ease;
}
.site-token:hover {
  transform: translateY(-1px);
  border-color: var(--p0);
}
.site-token .sw {
  grid-row: 1 / -1;
  width: 14px;
  height: 100%;
  min-height: 28px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--p1) 15%, transparent);
}
.site-token .k {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-token .hex {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--p1);
}

/* —— Card fills cell —— */
.vcard {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 10px 1fr;
  background: var(--p3);
  color: var(--p1);
  border: 0;
  border-radius: 0;
}
.vcard-stripe {
  background: linear-gradient(180deg, var(--p0), var(--p4));
}
.vcard-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0.55rem 0.6rem 0.5rem;
}
.vcard-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.vcard-face {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
}
.vcard-name {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.vcard-role {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.7;
  margin-top: 0.1rem;
}
.vcard-mono {
  display: grid;
  place-items: center;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.06em;
  color: color-mix(in srgb, var(--p0) 35%, transparent);
  user-select: none;
}
.vcard-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed color-mix(in srgb, var(--p4) 45%, transparent);
}
.vcard-meta {
  display: grid;
  gap: 0.12rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--p0);
  min-width: 0;
}
.vcard-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vcard-qr {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  color: var(--p1);
  background: #fff;
  padding: 3px;
  border-radius: 5px;
}

/* —— Tee fills skinny column —— */
.tee {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.tee-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* —— Book / Social fill —— */
.book {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.16), transparent 8%),
    linear-gradient(145deg, var(--p0), var(--p4));
  color: var(--text-on-p0);
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.book::after {
  content: "";
  position: absolute;
  right: -20%;
  bottom: -25%;
  width: 65%;
  height: 48%;
  background: var(--p2);
  opacity: 0.35;
  border-radius: 50%;
}
.book-title {
  position: relative;
  z-index: 1;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.8vw, 1.35rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.book-sub {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.85;
}

.social {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--p0) 16%, transparent), var(--p3) 60%);
}
.avatar {
  width: min(58%, 110px);
  aspect-ratio: 1;
  border-radius: 22%;
  background: linear-gradient(145deg, var(--p0), var(--p2) 55%, var(--p4));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}
.avatar::before {
  content: "";
  position: absolute;
  width: 36%;
  height: 36%;
  border-radius: 22%;
  background: color-mix(in srgb, #fff 88%, var(--p3));
  transform: rotate(18deg);
}
.avatar-letter {
  position: relative;
  z-index: 1;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--p1);
}
.social-handle {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--p1);
}
.social-dots {
  display: flex;
  gap: 0.28rem;
}
.social-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.stage-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--spark);
}
.stage-link:hover { color: var(--spark); }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .site-nav { display: none; }
  .demo-stage {
    grid-template-columns: 1.7fr 0.85fr 1fr 1fr;
  }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .site-frame {
    height: auto;
    min-height: 100%;
  }
  .site-header {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .doc-title {
    order: 2;
    flex: 1 1 auto;
    max-width: none;
  }
  .site-nav-main {
    order: 3;
    flex: 1 1 100%;
    margin-left: 0;
    overflow-x: auto;
  }
  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .rail {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stage {
    height: auto;
    min-height: 75vh;
  }
  .stage > .view {
    height: auto;
    min-height: 75vh;
  }
  .stage-scroll#pane-feel {
    overflow: auto;
    height: auto;
  }
  .demo-stage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(280px, auto) minmax(180px, auto) minmax(180px, auto);
    height: auto;
  }
  .demo-site {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 280px;
  }
  .demo-card { grid-column: 1; grid-row: 2; }
  .demo-tee { grid-column: 2; grid-row: 2; }
  .demo-book {
    grid-column: 1;
    grid-row: 3;
    border-top: 1px solid var(--line);
  }
  .demo-social {
    grid-column: 2;
    grid-row: 3;
    border-top: 1px solid var(--line);
  }
  .site-main { grid-template-columns: 1fr; }
  .site-metrics { grid-template-columns: 1fr 1fr; }
  .site-table { display: none; }
}

@media (max-width: 480px) {
  .demo-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .demo-site,
  .demo-card,
  .demo-tee,
  .demo-book,
  .demo-social {
    grid-column: 1;
    grid-row: auto;
    border-right: 0;
    border-top: 1px solid var(--line);
    min-height: 200px;
  }
  .demo-site { border-top: 0; min-height: 320px; }
  .site-metrics { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.scale-cell.is-patched {
  border-color: var(--ink);
  border-style: dashed;
}

/* Stop editor (Scale per-stop HSL / OKLCH) */
.stop-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 14, 18, 0.45);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.stop-editor-backdrop[hidden] {
  display: none !important;
}
.stop-editor {
  width: min(420px, 100%);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.stop-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.stop-editor-head h2 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
}
.stop-editor-close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  color: var(--muted-ui);
}
.stop-editor-body {
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}
.stop-editor-preview {
  height: 56px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
}
.stop-editor-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted-ui);
}
.stop-editor-field input[type="text"] {
  font: inherit;
  font-weight: 650;
  padding: 0.45rem 0.55rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
}
.stop-editor-sub {
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-ui);
}
.stop-editor-sliders {
  display: grid;
  gap: 0.4rem;
}
.stop-editor-sliders label {
  display: grid;
  grid-template-columns: 1.2rem 1fr 2.8rem;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 650;
}
.stop-editor-sliders em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--muted-ui);
}
.stop-editor-mode {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem 0.65rem;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.stop-editor-mode legend {
  padding: 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stop-editor-mode label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.stop-editor-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted-ui);
  word-break: break-all;
}
.stop-editor-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--line);
}

/* Extra gallery examples (docs / form / pricing) */
.ex-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ex-lead {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.ex-docs {
  display: grid;
  grid-template-columns: 0.9fr 1.6fr;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  color: var(--p1);
}
.ex-docs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.85rem;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 650;
}
.ex-docs-brand {
  font-family: Syne, sans-serif;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--p0);
}
.ex-docs-nav span {
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  color: var(--muted);
}
.ex-docs-nav span.is-on {
  background: var(--p5);
  color: var(--p1);
}
.ex-docs-main {
  padding: 1.1rem 1.25rem;
  overflow: auto;
}
.ex-docs-main h3 {
  margin: 0 0 0.45rem;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.ex-code {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  overflow: auto;
}
.ex-docs-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ex-form {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--surface);
}
.ex-form-card {
  width: min(360px, 100%);
  display: grid;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--p1);
}
.ex-form-card h3 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.ex-pricing {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 1rem;
  background: var(--surface);
  align-content: center;
}
.ex-price-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--p1);
  min-height: 0;
}
.ex-price-card.is-featured {
  background: var(--p0);
  color: var(--text-on-p0);
  border-color: var(--p0);
}
.ex-price-card.is-featured .ex-kicker,
.ex-price-card.is-featured p {
  color: color-mix(in srgb, var(--text-on-p0) 80%, transparent);
}
.ex-price {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
}
.ex-price-card p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.palette-panel {
  display: grid;
  gap: 0.55rem;
}
.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.palette-row input[type="text"] {
  flex: 1;
  min-width: 8rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.palette-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 9rem;
  overflow: auto;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.palette-item-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.palette-item-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-item button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-ui);
  cursor: pointer;
  padding: 0.15rem 0.25rem;
}
.palette-item button:hover {
  color: var(--ink);
}
