:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #eef6ff;
  --ink: #0f172a;
  --muted: #475569;
  --soft: #e2e8f0;
  --line: rgba(15, 23, 42, .1);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #14b8a6;
  --warm: #f59e0b;
  --shadow: 0 18px 55px rgba(15, 23, 42, .12);
  --radius: 24px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
p { color: var(--muted); margin: 0; }
h1, h2, h3 { line-height: 1.18; margin: 0 0 16px; letter-spacing: -.03em; }
h1 { font-size: clamp(40px, 5vw, 76px); }
h2 { font-size: clamp(28px, 4vw, 46px); }
h3 { font-size: 21px; }
button, input, select { font: inherit; }

.container { width: min(var(--container), calc(100% - 40px)); margin: 0 auto; }
.section { padding: 40px 0; }
.alt-section { background: linear-gradient(180deg, #fff, #eef6ff); }
.centered { text-align: center; max-width: 780px; }
.centered-actions { justify-content: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; padding: 8px 14px; background: #fff; border-radius: 12px; }
.skip-link:focus { left: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-shell { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.04); }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 12px 30px rgba(37, 99, 235, .28);
  transition: transform .2s ease;
}
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { padding: 9px 12px; border-radius: 999px; color: #334155; font-weight: 700; font-size: 15px; }
.site-nav a:hover, .site-nav a.active { background: #e0f2fe; color: var(--primary-dark); }
.site-nav .nav-cta { background: var(--ink); color: #fff; padding-inline: 18px; }
.site-nav .nav-cta:hover { background: var(--primary); color: #fff; }
.nav-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; color: var(--ink); }

.hero { padding: 40px 0 48px; overflow: hidden; background:
  radial-gradient(circle at 78% 18%, rgba(20, 184, 166, .18), transparent 28%),
  radial-gradient(circle at 12% 14%, rgba(37, 99, 235, .15), transparent 24%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 54px; }
.hero-copy p { font-size: 19px; max-width: 680px; }
.eyebrow { display: inline-flex; color: var(--primary); background: #dbeafe; border: 1px solid #bfdbfe; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px; }
.hero-search { margin: 30px 0 18px; display: flex; max-width: 650px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 14px 16px; color: var(--ink); }
.hero-search button { border: 0; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); padding: 12px 24px; font-weight: 800; cursor: pointer; }
.hero-search button:hover { filter: brightness(.96); transform: translateY(-1px); }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; color: #334155; }
.trust-row span { background: rgba(255, 255, 255, .72); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 700; }
.hero-showcase { position: relative; min-height: 430px; }
.floating-card { position: absolute; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.board-main { inset: 24px 18px auto 0; padding: 18px; }
.palette-card { right: 0; bottom: 74px; display: flex; gap: 10px; padding: 16px; }
.palette-card span, .swatches span { display: inline-block; width: 28px; height: 28px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .65); }
.metric-card { left: 22px; bottom: 8px; padding: 20px 26px; display: grid; gap: 0; }
.metric-card strong { font-size: 34px; }
.metric-card span { color: var(--muted); font-weight: 700; }
.mini-label { display: inline-flex; color: var(--primary-dark); background: #e0f2fe; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; margin-bottom: 10px; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border-radius: 999px; padding: 12px 20px; font-weight: 800; border: 1px solid transparent; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 16px 36px rgba(37, 99, 235, .25); }
.btn.primary:hover { color: #fff; box-shadow: 0 20px 42px rgba(37, 99, 235, .32); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #bfdbfe; background: #eff6ff; color: var(--primary-dark); }
.btn.full { width: 100%; }
.text-link { display: inline-flex; align-items: center; color: var(--primary); font-weight: 800; }
.text-link:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 4px; }

.section-heading { margin-bottom: 36px; }
.split-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 32px; }
.split-heading p { max-width: 680px; }
.split-heading.compact { align-items: center; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.steps-grid article, .rich-card, .panel, .pricing-card, .industry-detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .06);
}
.steps-grid span { display: inline-flex; font-weight: 900; color: var(--primary); margin-bottom: 12px; }

.industry-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.industry-grid.compact { grid-template-columns: repeat(5, 1fr); }
.industry-card a { display: block; height: 100%; padding: 22px; border-radius: 22px; background: #fff; border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.industry-card a:hover { transform: translateY(-5px); border-color: #bfdbfe; box-shadow: var(--shadow); color: inherit; }
.industry-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; color: var(--primary-dark); background: #dbeafe; font-weight: 900; margin-bottom: 14px; }
.industry-icon.huge { width: 94px; height: 94px; font-size: 38px; margin: 0 auto 18px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-row span { color: #334155; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 700; }
.tag-row.large span { font-size: 14px; padding: 8px 12px; }

.template-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.template-card { background: #fff; border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: 0 12px 34px rgba(15, 23, 42, .06); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.template-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #bfdbfe; }
.template-preview { display: block; padding: 14px 14px 0; }
.logo-svg { width: 100%; border-radius: 20px; display: block; }
.template-content { padding: 18px 20px 22px; }
.template-content h3 a:hover { color: var(--primary); }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--primary-dark); font-size: 12px; font-weight: 800; margin-bottom: 10px; }
.card-meta span { background: #dbeafe; border-radius: 999px; padding: 4px 8px; }
.swatches { display: flex; gap: 8px; margin: 14px 0; }
.swatches span { width: 22px; height: 22px; }

.brand-preview { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; background: linear-gradient(135deg, #0f172a, #164e63); color: #fff; border-radius: 34px; padding: 46px; overflow: hidden; }
.brand-preview p { color: #cbd5e1; }
.material-stack { min-height: 330px; position: relative; }
.material-card { position: absolute; border-radius: 26px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .25); padding: 26px; font-weight: 800; }
.card-business { width: 300px; height: 170px; left: 8%; top: 18px; }
.card-avatar { width: 140px; height: 140px; right: 16%; top: 96px; display: grid; place-items: center; font-size: 52px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.card-package { width: 210px; height: 140px; left: 22%; bottom: 4px; background: #fef3c7; }

.faq-preview, .help-layout { display: grid; grid-template-columns: .78fr 1.22fr; gap: 34px; align-items: start; }
.faq-list { display: grid; gap: 12px; }
details { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
summary { cursor: pointer; font-weight: 800; color: var(--ink); }
summary:hover { color: var(--primary); }
details p { margin-top: 12px; }

.page-hero { padding: 72px 0; background: radial-gradient(circle at 80% 10%, rgba(20, 184, 166, .16), transparent 28%), linear-gradient(180deg, #eff6ff, #f8fafc); }
.compact-hero .container > p { max-width: 760px; font-size: 18px; }
.detail-grid { display: grid; grid-template-columns: 1fr .85fr; gap: 38px; align-items: center; }
.template-detail-hero .template-card { max-width: 440px; justify-self: end; }
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.content-grid.three { grid-template-columns: repeat(3, 1fr); }
.check-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; color: var(--muted); }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 900; }

.filter-bar { display: grid; grid-template-columns: 1.3fr .85fr .85fr; gap: 16px; margin-bottom: 28px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: 0 12px 34px rgba(15, 23, 42, .06); }
label { display: grid; gap: 8px; color: var(--ink); font-weight: 800; }
label span { font-size: 14px; }
input, select { width: 100%; border: 1px solid #cbd5e1; background: #fff; color: var(--ink); border-radius: 14px; padding: 12px 14px; outline: none; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.empty-state { text-align: center; padding: 28px; color: var(--muted); }

.generator-layout, .editor-layout, .brand-kit-layout { display: grid; grid-template-columns: 330px 1fr; gap: 28px; align-items: start; }
.stack-form, .editor-tools { display: grid; gap: 16px; }
.panel-note { font-size: 14px; margin-top: 14px; }
.generated-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.generated-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 16px; transition: transform .2s ease, box-shadow .2s ease; }
.generated-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.generated-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 12px; }
.generated-actions a, .generated-actions button { border: 0; background: #eff6ff; color: var(--primary-dark); border-radius: 999px; padding: 8px 12px; font-weight: 800; cursor: pointer; }
.generated-actions a:hover, .generated-actions button:hover { background: #dbeafe; color: var(--primary); }

.editor-tools label { margin-bottom: 0; }
.editor-canvas-wrap { min-width: 0; }
.editor-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; color: var(--muted); }
.editor-canvas { min-height: 500px; display: grid; place-items: center; border-radius: 32px; background: linear-gradient(135deg, #e0f2fe, #f8fafc); border: 1px solid var(--line); padding: 28px; }
.editor-canvas svg { width: min(620px, 100%); border-radius: 28px; box-shadow: var(--shadow); }
.palette-output { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.palette-output div { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 10px; }
.palette-output span { width: 36px; height: 36px; border-radius: 12px; grid-row: span 2; border: 1px solid var(--line); }
.palette-output small { color: var(--muted); }

.brand-kit-layout { grid-template-columns: 300px 1fr; }
.kit-preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.kit-card { min-height: 230px; border-radius: 26px; padding: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(15, 23, 42, .06); overflow: hidden; position: relative; }
.kit-card::after { content: ""; position: absolute; inset: auto -30px -70px auto; width: 170px; height: 170px; border-radius: 50%; background: var(--kit-primary, var(--primary)); opacity: .12; }
.kit-art { min-height: 100px; display: grid; align-content: center; gap: 4px; color: var(--kit-primary, var(--primary)); }
.kit-art strong { font-size: 28px; }
.kit-art small { color: var(--muted); }
.kit-avatar .kit-art { width: 120px; height: 120px; border-radius: 50%; place-content: center; text-align: center; color: #fff; background: linear-gradient(135deg, var(--kit-primary, var(--primary)), var(--kit-accent, var(--accent))); }
.kit-store-sign { background: #0f172a; color: #fff; }
.kit-store-sign p, .kit-store-sign .kit-art small { color: #cbd5e1; }
.kit-store-sign .kit-art { color: #fff; }
.kit-palette .kit-art { display: flex; align-items: center; gap: 12px; }
.kit-palette .kit-art::before, .kit-palette .kit-art::after { content: ""; width: 58px; height: 58px; border-radius: 18px; background: var(--kit-primary, var(--primary)); }
.kit-palette .kit-art::after { background: var(--kit-accent, var(--accent)); }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pricing-card { position: relative; display: flex; flex-direction: column; }
.pricing-card.featured { border-color: #93c5fd; box-shadow: var(--shadow); transform: translateY(-8px); }
.plan-badge { align-self: flex-start; color: var(--primary-dark); background: #dbeafe; border-radius: 999px; padding: 6px 10px; font-weight: 800; font-size: 13px; margin-bottom: 16px; }
.price { display: block; font-size: 42px; line-height: 1; margin-bottom: 16px; }
.pricing-card .btn { margin-top: auto; }
.seo-copy { max-width: 880px; text-align: center; }

.help-toc { position: sticky; top: 96px; display: grid; gap: 8px; }
.help-toc a { color: var(--muted); font-weight: 800; padding: 8px 0; border-bottom: 1px solid var(--line); }
.help-toc a:hover { color: var(--primary); }
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.admin-stats article { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px; text-align: center; }
.admin-stats strong { display: block; font-size: 46px; color: var(--primary); }
.admin-stats span { color: var(--muted); font-weight: 800; }
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.site-footer { padding: 58px 0; background: #0f172a; color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.site-footer p, .site-footer small, .site-footer span { color: #cbd5e1; }
.site-footer h2 { font-size: 16px; margin-bottom: 12px; }
.site-footer a:not(.brand) { display: block; color: #cbd5e1; margin: 8px 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer-note { font-size: 14px; margin-top: 14px; }

@media (max-width: 1080px) {
  .hero-grid, .detail-grid, .brand-preview, .faq-preview, .help-layout, .generator-layout, .editor-layout, .brand-kit-layout { grid-template-columns: 1fr; }
  .hero-showcase { min-height: 390px; }
  .industry-grid, .industry-grid.compact { grid-template-columns: repeat(3, 1fr); }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid, .content-grid.three, .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .container { width: min(100% - 28px, var(--container)); }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 14px; right: 14px; top: 76px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 12px; box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .site-nav.open { display: flex; }
  .site-nav a { text-align: center; }
  .hero { padding-top: 52px; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
  .section { padding: 62px 0; }
  .steps-grid, .filter-bar, .generated-grid, .kit-preview-grid, .pricing-grid, .content-grid, .admin-stats, .admin-grid { grid-template-columns: 1fr; }
  .industry-grid, .industry-grid.compact { grid-template-columns: repeat(2, 1fr); }
  .split-heading { display: grid; align-items: start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  h1 { font-size: 38px; }
  .industry-grid, .template-grid { grid-template-columns: 1fr; }
  .hero-showcase { min-height: auto; }
  .floating-card { position: static; margin-top: 16px; }
  .brand-preview { padding: 28px; }
  .material-stack { min-height: 260px; }
  .card-business { width: 240px; }
  .card-avatar { width: 112px; height: 112px; right: 0; }
  .card-package { width: 180px; }
  .footer-grid { grid-template-columns: 1fr; }
  .editor-toolbar { display: grid; }
}

/* Editor workbench */
.page-editor .site-header,
.page-editor .site-footer { display: none; }
.page-editor { background: #e9edf3; }
.editor-app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 68px 1fr;
  background: #e9edf3;
  color: #172033;
}
.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  background: #ffffff;
  border-bottom: 1px solid #dbe3ef;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  position: sticky;
  top: 0;
  z-index: 20;
}
.editor-top-left,
.editor-top-actions { display: flex; align-items: center; gap: 12px; }
.editor-top-left div { display: grid; line-height: 1.25; }
.editor-top-left span { color: #64748b; font-size: 13px; }
.editor-back { color: #2563eb; font-weight: 800; padding: 8px 10px; border-radius: 12px; }
.editor-back:hover { background: #eff6ff; }
.mini-button {
  border: 1px solid #d7dfeb;
  background: #fff;
  color: #334155;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}
.mini-button:hover,
.mini-button.active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.mini-button.primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, #2563eb, #14b8a6); }
.editor-workbench {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 82px 300px minmax(420px, 1fr) 292px;
  gap: 0;
}
.editor-rail {
  background: #111827;
  border-right: 1px solid #0b1220;
  padding: 14px 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.rail-item {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  border-radius: 18px;
  padding: 10px 6px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}
.rail-item span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
}
.rail-item:hover,
.rail-item.active { color: #fff; background: rgba(37, 99, 235, .28); }
.rail-item.active span { background: linear-gradient(135deg, #2563eb, #14b8a6); }
.editor-sidepanel,
.editor-inspector {
  background: #f8fafc;
  border-right: 1px solid #dbe3ef;
  padding: 18px;
  overflow: auto;
}
.editor-inspector { border-right: 0; border-left: 1px solid #dbe3ef; }
.editor-panel { display: none; }
.editor-panel.active { display: grid; gap: 16px; }
.editor-panel h2,
.inspector-card h2 { font-size: 22px; margin-bottom: 0; }
.editor-panel p,
.inspector-card p { font-size: 14px; }
.quick-shape-grid,
.layout-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-shape-grid button,
.layout-picker button {
  border: 1px solid #d7dfeb;
  background: #fff;
  border-radius: 16px;
  padding: 12px 8px;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}
.quick-shape-grid button:hover,
.layout-picker button:hover,
.layout-picker button.active { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.preset-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preset-colors button {
  height: 48px;
  border: 3px solid #fff;
  outline: 1px solid #d7dfeb;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--a), var(--b));
  cursor: pointer;
}
.preset-colors button:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(15, 23, 42, .14); }
.editor-stage-wrap {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  gap: 16px;
}
.stage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  padding: 12px 14px;
}
.stage-toolbar div:first-child { display: grid; line-height: 1.25; }
.stage-toolbar span { color: #64748b; font-size: 13px; }
.stage-tabs { display: flex; gap: 8px; }
.stage-tabs button {
  border: 1px solid #d7dfeb;
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
}
.stage-tabs button:hover,
.stage-tabs button.active { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.editor-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  border-radius: 22px;
  overflow: hidden;
  background-color: #dfe6ef;
  background-image: linear-gradient(45deg, rgba(255,255,255,.55) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.55) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.55) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.55) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  border: 1px solid #d0d9e8;
}
.editor-stage.bg-dark { background: #111827; }
.editor-stage.bg-white { background: #eef2f7; background-image: none; }
.canvas-rulers { position: absolute; background: rgba(255,255,255,.58); z-index: 1; }
.canvas-rulers.top { top: 0; left: 0; right: 0; height: 28px; border-bottom: 1px solid #d0d9e8; }
.canvas-rulers.left { top: 0; left: 0; bottom: 0; width: 28px; border-right: 1px solid #d0d9e8; }
.editor-stage .editor-canvas {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 68px));
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: scale(var(--editor-zoom, 1));
  transition: transform .18s ease;
}
.editor-stage .editor-canvas svg {
  width: 100%;
  display: block;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}
.editor-stage.bg-dark .editor-canvas svg { box-shadow: 0 24px 70px rgba(0, 0, 0, .42); }
.scene-strip { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 14px; }
.scene-card {
  min-height: 118px;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 20px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  color: #0f172a;
  overflow: hidden;
  position: relative;
}
.scene-card span { color: #64748b; font-size: 13px; font-weight: 800; }
.scene-logo {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--scene-primary, #2563eb), var(--scene-secondary, #14b8a6));
}
.scene-card-business { background: linear-gradient(135deg, #fff, #f8fafc); }
.scene-card-business small { display: block; color: #64748b; }
.scene-sign { background: #111827; color: #fff; }
.scene-sign span { color: #cbd5e1; }
.inspector-card {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
}
.palette-output.compact { grid-template-columns: 1fr; }
.palette-output.compact div { grid-template-columns: 34px 1fr; padding: 12px; }
.compact-list { font-size: 14px; }

@media (max-width: 1220px) {
  .editor-workbench { grid-template-columns: 74px 280px 1fr; }
  .editor-inspector { grid-column: 2 / 4; border-left: 0; border-top: 1px solid #dbe3ef; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .inspector-card { margin-bottom: 0; }
}

@media (max-width: 920px) {
  .editor-topbar { position: static; align-items: flex-start; padding: 12px; flex-direction: column; }
  .editor-workbench { min-height: auto; grid-template-columns: 1fr; }
  .editor-rail { grid-auto-flow: column; grid-auto-columns: 1fr; overflow-x: auto; padding: 10px; }
  .editor-sidepanel, .editor-inspector { border: 0; border-bottom: 1px solid #dbe3ef; }
  .editor-stage-wrap { grid-row: 3; }
  .editor-inspector { grid-column: auto; grid-template-columns: 1fr; }
  .scene-strip { grid-template-columns: 1fr; }
}

.shape-library {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.shape-library button {
  min-height: 46px;
  font-size: 13px;
}
.shape-library button.active-shape {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
  color: #1d4ed8;
}
