:root {
  --bg: #08101b;
  --bg-deep: #060c15;
  --bg-soft: #0d1726;
  --surface: rgba(11, 19, 31, 0.78);
  --surface-strong: rgba(11, 18, 30, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-band: rgba(10, 18, 30, 0.68);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(103, 232, 249, 0.26);
  --text: #edf4ff;
  --muted: #a8b8d5;
  --muted-2: #7f90ae;
  --accent: #75e4ff;
  --accent-2: #8b7fff;
  --accent-3: #54d7b0;
  --danger: #fb7185;
  --warning: #facc15;
  --success: #34d399;
  --radius: 26px;
  --radius-sm: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.18);
  --shell: 1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -12%, rgba(117, 228, 255, 0.10), transparent 34%),
    radial-gradient(circle at 92% 2%, rgba(139, 127, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #06101a 0%, #08101b 22%, #09111b 56%, #070d16 100%);
  position: relative;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
code, pre { font-family: 'SFMono-Regular', ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace; }
code {
  background: rgba(255,255,255,0.08);
  padding: .16rem .42rem;
  border-radius: .5rem;
}
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.site-backdrop__orb,
.site-backdrop__glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(96px);
  opacity: .55;
}
.site-backdrop__orb--a {
  width: 30rem;
  height: 30rem;
  background: rgba(36, 211, 238, .08);
  top: -10rem;
  left: -8rem;
}
.site-backdrop__orb--b {
  width: 26rem;
  height: 26rem;
  background: rgba(139, 92, 246, .08);
  top: 0;
  right: -8rem;
}
.site-backdrop__glow {
  width: 42rem;
  height: 42rem;
  left: 50%;
  transform: translateX(-50%);
  top: -18rem;
  background: rgba(61, 193, 255, 0.08);
}
.site-backdrop__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.38), rgba(0,0,0,0));
}

.site-shell {
  width: min(var(--shell), calc(100% - 3rem));
  margin: 0 auto;
}
.page-shell,
.auth-shell,
.viewer-page,
.editor-page-shell {
  padding: 2.2rem 0 4rem;
  position: relative;
}
.home-page {
  padding-bottom: 4.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 11, 19, 0.68);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-width: max-content;
}
.brand-mark {
  width: 3.2rem;
  height: 3.2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 1.05rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #08111d;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 16px 34px rgba(56, 189, 248, 0.22);
}
.brand strong {
  display: block;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.08rem;
}
.brand small {
  display: block;
  color: var(--muted);
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}
.site-nav a,
.site-nav .nav-pill,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: .84rem 1.08rem;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.site-nav a {
  color: #d4e2fb;
}
.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,.055);
  border-color: var(--line);
  color: #fff;
  transform: translateY(-1px);
}
.site-nav .nav-pill {
  background: rgba(117, 228, 255, 0.08);
  border-color: rgba(117, 228, 255, 0.18);
  color: #effbff;
}
.site-nav .nav-pill--credits {
  gap: .5rem;
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.24);
  color: #ecfdf5;
}
.site-nav .nav-pill--credits strong {
  font-size: 1rem;
}
.site-nav .nav-pill--credits span {
  color: rgba(236, 253, 245, 0.78);
  font-size: .82rem;
}

.flash-wrap { padding-top: 1rem; }
.flash {
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow-soft);
}
.flash-success { background: rgba(34, 197, 94, .12); color: #d1fae5; }
.flash-error { background: rgba(239, 68, 68, .14); color: #fee2e2; }

.btn {
  cursor: pointer;
  font-weight: 600;
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.18);
}
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(148, 163, 184, 0.28);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  color: #07111d;
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(34, 211, 238, 0.18);
}
.btn-primary:hover {
  box-shadow: 0 18px 40px rgba(34, 211, 238, 0.24);
}
.btn-secondary {
  background: rgba(255,255,255,.05);
}
.btn-ghost {
  background: transparent;
}
.btn-danger {
  background: rgba(239,68,68,.12);
  color: #fee2e2;
  border-color: rgba(239,68,68,.28);
}
.btn-sm {
  padding: .72rem .96rem;
  font-size: .95rem;
}

.hero-actions,
.file-actions,
.inline-form-row,
.topbar-actions,
.stack-actions,
.cta-row,
.copy-bar,
.copy-group,
.help-links,
.pill-row {
  display: flex;
  gap: .72rem;
  flex-wrap: wrap;
}
.stack-actions {
  display: grid;
}

.panel,
.hero-card,
.auth-card,
.metric-card,
.reference-card,
.example-card,
.footer-card,
.route-card {
  background: linear-gradient(180deg, rgba(12, 20, 33, .86), rgba(10, 16, 28, .84));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  position: relative;
}
.panel::before,
.hero-card::before,
.auth-card::before,
.metric-card::before,
.reference-card::before,
.example-card::before,
.route-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(117,228,255,.34), rgba(139,127,255,.04), rgba(84,215,176,.24));
}
.panel,
.hero-card,
.auth-card,
.metric-card,
.reference-card,
.example-card,
.route-card {
  padding: 1.45rem;
}
.panel-hero {
  padding: clamp(1.6rem, 2.4vw, 2.4rem);
}
.panel-quiet {
  background: linear-gradient(180deg, rgba(11, 19, 31, .82), rgba(10, 16, 27, .76));
}
.panel-soft,
.mini-summary-card,
.callout,
.panel-note,
.mini-card,
.section-band,
.data-point,
.inline-stat {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: var(--radius-sm);
}
.mini-summary-card,
.callout,
.panel-note,
.mini-card,
.section-band,
.data-point,
.inline-stat {
  padding: 1rem 1.05rem;
}

.home-stage {
  padding: 3.4rem 0 1.5rem;
}
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, .82fr);
  gap: 1.35rem;
  align-items: stretch;
}
.hero-main,
.hero-side {
  min-height: 100%;
}
.hero-main {
  display: grid;
  align-content: space-between;
  gap: 1.3rem;
}
.hero-copy-wrap {
  max-width: 54rem;
}
.hero-side {
  display: grid;
  gap: 1rem;
}
.hero-summary-card h2,
.hero-main h1,
.page-heading h1,
.viewer-meta-bar h1,
.editor-topbar h1,
.auth-card h1,
.section-heading h1,
.section-heading h2,
.footer-brand-block h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  line-height: 1.02;
  letter-spacing: -.035em;
  margin: 0 0 .9rem;
}
.hero-main h1 {
  font-size: clamp(2.7rem, 5vw, 4.9rem);
  max-width: 11.5ch;
}
.page-heading h1,
.viewer-meta-bar h1,
.editor-topbar h1,
.auth-card h1,
.section-heading h1,
.section-heading h2,
.footer-brand-block h2 {
  font-size: clamp(2rem, 3vw, 3rem);
}
.hero-copy,
.page-intro,
.lead,
.section-heading p,
.hero-card p,
.footer-brand-block p {
  color: #d4e1f9;
  font-size: 1.04rem;
  line-height: 1.7;
  max-width: 72ch;
}

.eyebrow,
.page-kicker,
.gallery-live-kicker,
.chip,
.route-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .78rem;
  border-radius: 999px;
  background: rgba(117,228,255,.1);
  border: 1px solid rgba(117,228,255,.14);
  color: #a6f0ff;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.page-kicker { margin-bottom: 1rem; }
.hero-actions--compact { align-items: center; }
.inline-stat-row {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
}
.inline-stat-row--hero {
  margin-top: .2rem;
}
.inline-stat {
  min-width: 168px;
  display: grid;
  gap: .15rem;
}
.inline-stat strong {
  font-size: 1.08rem;
}
.inline-stat span,
.metric-label,
.route-card p,
.muted,
.muted-2 {
  color: var(--muted);
}
.feature-list,
.list-clean,
.doc-bullets {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: .7rem;
  color: #dbe8ff;
}
.feature-list--tight { gap: .58rem; }
.footer-links-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .65rem;
}

.home-rail,
.process-section,
.knowledge-section {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}
.section-heading {
  display: grid;
  gap: .7rem;
}
.section-heading--split,
.page-heading,
.editor-topbar,
.viewer-meta-bar,

.gallery-live-actions {
  align-items: center;
}
.gallery-viewer-stage {
  position: relative;
  opacity: 0;
  transition: opacity .26s ease;
}
.gallery-viewer-stage.is-visible {
  opacity: 1;
}
.gallery-viewer-stage.is-fading {
  opacity: .05;
}
.gallery-nav-btn,
.gallery-side-arrow {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(8, 15, 28, .78);
  color: #f8fbff;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
  box-shadow: var(--shadow-soft);
}
.gallery-nav-btn:hover,
.gallery-side-arrow:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, .34);
  background: rgba(15, 23, 42, .94);
}
.gallery-nav-btn:disabled,
.gallery-side-arrow:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.gallery-nav-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  font-size: 1.15rem;
  line-height: 1;
}
.gallery-side-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
}
.gallery-side-arrow:hover {
  transform: translateY(-50%) scale(1.03);
}
.gallery-side-arrow--left {
  left: 1rem;
}
.gallery-side-arrow--right {
  right: 1rem;
}
.gallery-live-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-heading--simple {
  margin-bottom: .1rem;
}
.section-heading--soft {
  margin-bottom: .2rem;
}
.launchpad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.route-card {
  display: grid;
  gap: .75rem;
  align-content: start;
  min-height: 100%;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.route-card strong,
.knowledge-card h3,
.process-step h3 {
  font-size: 1.22rem;
  letter-spacing: -.02em;
}
.route-card:hover,
.gallery-card:hover,
.example-card:hover,
.file-card:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.22);
  box-shadow: var(--shadow);
}

.process-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  background: linear-gradient(180deg, rgba(12, 19, 31, .78), rgba(9, 16, 28, .78));
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.process-step {
  padding: 1.5rem;
  min-height: 100%;
  position: relative;
}
.process-step + .process-step {
  border-left: 1px solid rgba(148, 163, 184, .12);
}
.process-step__number {
  display: inline-flex;
  margin-bottom: .9rem;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: #9de8ff;
}
.process-step p,
.knowledge-card p,
.route-card p,
.footer-link-group p,
.data-point,
.panel p,
.doc-section p,
.reference-card p {
  line-height: 1.7;
}
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.knowledge-card {
  display: grid;
  gap: .9rem;
}

.metric-grid,
.section-grid,
.docs-grid,
.reference-grid,
.example-grid,
.file-grid {
  display: grid;
  gap: 1rem;
}
.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.metric-card {
  padding: 1.25rem;
}
.metric-value {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: .3rem;
}
.section-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.info-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1rem;
}
.docs-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .84fr);
}
.reference-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.example-grid,
.file-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stack-col,
.auth-form,
.editor-sidebar,
.doc-section,
.reference-table {
  display: grid;
  gap: 1rem;
}

.page-heading,
.editor-topbar,
.viewer-meta-bar {
  margin-bottom: 1.35rem;
  padding: 1.5rem 1.6rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(148, 163, 184, .12);
  background: linear-gradient(180deg, rgba(12, 19, 31, .72), rgba(10, 16, 27, .64));
  box-shadow: var(--shadow-soft);
}
.auth-grid {
  display: grid;
  grid-template-columns: minmax(320px, .92fr) minmax(0, 1.08fr);
  gap: 1rem;
  align-items: stretch;
}
.auth-card {
  display: grid;
  gap: 1rem;
}
.auth-card--intro {
  align-content: space-between;
}
label {
  display: grid;
  gap: .45rem;
  color: #d8e5ff;
}
.password-field {
  position: relative;
  display: block;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(2, 6, 23, .48);
  color: #f8fbff;
  padding: .95rem 1rem;
}
.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 3.4rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: .55rem;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b9c8e6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(255,255,255,.08);
  color: #ffffff;
  outline: none;
}
.password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}
.form-error {
  background: rgba(239,68,68,.12);
  color: #fee2e2;
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 1rem;
  padding: .9rem 1rem;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: #9fb2d6;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, .4), rgba(148, 163, 184, 0));
}
.btn-provider-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  width: 100%;
  min-height: 3.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(241,245,249,.92));
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
}
.btn-provider-google:hover,
.btn-provider-google:focus-visible {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(255,255,255,.3);
  color: #020617;
  transform: translateY(-1px);
}
.btn-provider-google__mark {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(from 220deg, #4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75% 100%);
  color: #fff;
  font-weight: 900;
  font-size: .92rem;
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
}

.editor-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.editor-sidebar.panel {
  padding: 1.35rem;
}
.panel-fill {
  padding: 0;
  overflow: hidden;
}
.editor-frame {
  width: 100%;
  height: calc(100vh - 8rem);
  min-height: 1420px;
  border: 0;
  background: #0b1120;
  display: block;
}
.gallery-viewer-frame {
  width: 100%;
  height: min(62.4vh, 784px);
  min-height: 576px;
  border: 0;
  background: #0b1120;
  display: block;
}
.viewer-frame-wrap {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto 2rem;
}
.gallery-live-frame-wrap {
  width: min(1152px, calc(100% - 2rem));
  margin: 0 auto;
}
.gallery-live-frame-wrap,
.viewer-frame-wrap {
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, .68);
  box-shadow: var(--shadow);
}
.viewer-copy-panel {
  display: grid;
  grid-template-columns: 1fr .82fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.viewer-stage-card {
  padding: 0;
  overflow: hidden;
}
.viewer-stage-card .editor-frame {
  min-height: 960px;
  height: min(86vh, 1120px);
}
.gallery-live-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.file-card,
.gallery-card,
.example-card {
  display: grid;
  gap: .95rem;
  align-content: start;
}
.file-card-head,
.example-card-head {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}
.gallery-card {
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.gallery-card.is-selected {
  border-color: rgba(56, 189, 248, .45);
  box-shadow: 0 20px 52px rgba(14, 165, 233, .12);
}
.gallery-card.is-selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .24);
  pointer-events: none;
}
.status-pill {
  border-radius: 999px;
  padding: .38rem .72rem;
  font-size: .85rem;
  border: 1px solid transparent;
}
.status-pill.published {
  background: rgba(34, 197, 94, .14);
  color: #d1fae5;
  border-color: rgba(34, 197, 94, .18);
}
.status-pill.draft {
  background: rgba(250, 204, 21, .12);
  color: #fde68a;
  border-color: rgba(250, 204, 21, .18);
}
.code-preview,
.example-code {
  margin: 0;
  padding: 1rem 1.05rem;
  min-height: 9rem;
  background: rgba(2,6,23,.52);
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 1rem;
  color: #e1edff;
  overflow: auto;
}
.code-preview { min-height: 8rem; }
.example-code { max-height: 26rem; }
.reference-card h2,
.example-card h2,
.file-card h2,
.doc-section h2,
.hero-card h2,
.panel h2,
.viewer-copy-panel h2 {
  margin: 0 0 .55rem;
}
.reference-table {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 1rem;
  overflow: hidden;
}
.reference-row {
  display: grid;
  grid-template-columns: minmax(180px, .88fr) 1.12fr;
  gap: 1rem;
  padding: .96rem 1rem;
  border-top: 1px solid rgba(148,163,184,.12);
}
.reference-row:first-child {
  border-top: 0;
}
.example-meta {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.example-tag {
  padding: .28rem .62rem;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  color: #cfe0ff;
  font-size: .82rem;
}
.note-block {
  border-left: 3px solid rgba(97,218,251,.5);
  padding-left: 1rem;
  color: #cfe0ff;
}
.section-band {
  margin-top: 1.25rem;
}
.data-points {
  display: grid;
  gap: .75rem;
}
.empty-panel {
  min-height: 14rem;
  display: grid;
  place-content: center;
  text-align: center;
}
.kbd {
  display: inline-flex;
  padding: .15rem .45rem;
  border-radius: .42rem;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
  font-size: .9em;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(5, 10, 17, 0.56);
  backdrop-filter: blur(14px);
}
.footer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 2rem;
  padding: 2.1rem 0 2.3rem;
}
.footer-brand-block {
  display: grid;
  gap: .75rem;
  max-width: 52rem;
}
.footer-link-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-content: start;
}
.footer-link-group {
  display: grid;
  gap: .68rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.footer-link-group strong {
  color: #f5fbff;
}
.footer-link-group a {
  color: var(--muted);
}
.footer-link-group a:hover {
  color: #fff;
}
.footer-link-group--note p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1240px) {
  .home-hero-grid,
  .docs-grid,
  .viewer-copy-panel,
  .auth-grid,
  .editor-layout,
  .info-grid,
  .footer-shell {
    grid-template-columns: 1fr;
  }
  .footer-link-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .launchpad-grid,
  .metric-grid,
  .knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-grid,
  .process-band {
    grid-template-columns: 1fr;
  }
  .process-step + .process-step {
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, .12);
  }
  .reference-grid,
  .example-grid,
  .file-grid,
  .footer-link-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .site-shell {
    width: min(var(--shell), calc(100% - 1.4rem));
  }
  .header-shell {
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav {
    justify-content: center;
  }
  .gallery-live-head,
  .page-heading,
  .editor-topbar,
  .viewer-meta-bar,
  .section-heading--split {
    display: grid;
    justify-content: stretch;
  }
  .hero-main h1 {
    max-width: none;
  }
  .gallery-viewer-frame {
    min-height: 560px;
    height: 65vh;
  }
  .editor-frame {
    min-height: 1280px;
  }
}

@media (max-width: 720px) {
  .launchpad-grid,
  .metric-grid,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions,
  .file-actions,
  .inline-form-row,
  .topbar-actions,
  .copy-bar,
  .copy-group,
  .help-links {
    display: grid;
  }
  .site-nav a,
  .site-nav .nav-pill,
  .btn {
    width: 100%;
  }
}


.editor-integrated-page .editor-layout { align-items: stretch; }
.editor-stage .editor-inline-shell { width: 100%; }
.editor-stage .viewer-card,
.editor-stage .input-card,
.editor-stage .output-card { box-shadow: none; }
@media (max-width: 1040px) {
  .editor-stage .editor-inline-shell { min-width: 0; }
}


.editor-integrated-page .site-shell {
  width: min(1760px, calc(100vw - 2rem));
}

.editor-integrated-page .editor-page-shell {
  padding-bottom: 1.5rem;
}

.editor-topbar--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem 1.25rem;
  padding: 1.1rem 1.2rem;
}

.editor-topbar__main {
  display: grid;
  gap: .35rem;
}

.editor-topbar--compact h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.3vw, 2.45rem);
}

.editor-topbar--compact .page-intro {
  margin: 0;
  max-width: 64rem;
  color: #b9cae5;
}

.editor-topbar__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .65rem;
}

.editor-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 .85rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(255,255,255,.035);
  color: #dcebff;
  font-size: .87rem;
  font-weight: 600;
}

.editor-layout--refined {
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.editor-sidebar.panel {
  position: sticky;
  top: 5.6rem;
  align-self: start;
  display: grid;
  gap: .8rem;
  padding: .9rem;
}

.sidebar-section {
  display: grid;
  gap: .8rem;
  padding: .95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, .12);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
}

.sidebar-section--accent {
  border-color: rgba(59, 130, 246, .22);
  background: linear-gradient(180deg, rgba(59,130,246,.08), rgba(255,255,255,.02));
}

.sidebar-kicker,
.sidebar-caption,
.sidebar-status-label {
  color: #8facd2;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sidebar-section__head {
  display: grid;
  gap: .18rem;
}

.sidebar-section__head h2,
.sidebar-section--file h2 {
  margin: 0;
}

.stack-actions--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

.stack-actions--grid .btn {
  width: 100%;
  justify-content: center;
}

.stack-actions__wide {
  grid-column: 1 / -1;
}

.sidebar-status-grid {
  display: grid;
  gap: .65rem;
}

.sidebar-status-item {
  display: grid;
  gap: .28rem;
  padding: .75rem .8rem;
  border-radius: .9rem;
  border: 1px solid rgba(148,163,184,.1);
  background: rgba(2, 6, 23, .35);
}

.sidebar-status-item strong {
  color: #f2f7ff;
  font-size: .95rem;
}

.help-links--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.help-links--grid .btn {
  width: 100%;
  justify-content: center;
}

.editor-stage.panel-fill {
  border-radius: calc(var(--radius) + 2px);
}

@media (max-width: 1360px) {
  .editor-integrated-page .site-shell {
    width: min(100vw - 1.5rem, 100%);
  }

  .editor-layout--refined {
    grid-template-columns: 270px minmax(0, 1fr);
  }
}

@media (max-width: 1240px) {
  .editor-topbar--compact,
  .editor-layout--refined {
    grid-template-columns: 1fr;
  }

  .editor-topbar__meta {
    justify-content: flex-start;
  }

  .editor-sidebar.panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .stack-actions--grid,
  .help-links--grid {
    grid-template-columns: 1fr;
  }
}

/* Editor refinement: reclaim width and reduce rail dominance */
.editor-integrated-page .site-shell {
  width: min(1840px, calc(100vw - 1.2rem));
}

.editor-layout--refined {
  grid-template-columns: 258px minmax(0, 1fr);
  gap: .85rem;
}

.editor-topbar--compact {
  padding: .95rem 1.05rem;
}

.editor-topbar__meta {
  gap: .5rem;
}

.editor-sidebar.panel {
  padding: .8rem;
  gap: .65rem;
}

@media (max-width: 1360px) {
  .editor-integrated-page .site-shell {
    width: min(calc(100vw - 1rem), 100%);
  }
}


/* Editor page: give the inline workspace more width relative to the project rail */
.editor-layout--refined {
  grid-template-columns: 238px minmax(0, 1fr);
}

@media (max-width: 1360px) {
  .editor-layout--refined {
    grid-template-columns: 224px minmax(0, 1fr);
  }
}


.site-nav .site-tour-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 999px;
  padding: .84rem 1.08rem;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.site-tour-launch {
  appearance: none;
  cursor: pointer;
  background: rgba(117, 228, 255, 0.08);
  color: #effbff;
  border: 1px solid rgba(117, 228, 255, 0.18);
}
.site-tour-launch:hover {
  background: rgba(117, 228, 255, 0.14);
  border-color: rgba(117, 228, 255, 0.3);
}

.gallery-viewer-stage {
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
  transform-origin: center center;
}
.gallery-viewer-stage.is-hovered {
  transform: scale(1.018);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.28);
  border-color: rgba(117, 228, 255, 0.26);
}
.gallery-viewer-stage.is-hovered .gallery-viewer-frame {
  filter: saturate(1.04) brightness(1.03);
}

.site-tour {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}
.site-tour[hidden] {
  display: none !important;
}
.site-tour__veil {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 16, 0.58);
  backdrop-filter: blur(3px);
}
.site-tour__panel {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(30rem, calc(100vw - 2rem));
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: 1.3rem;
  border: 1px solid rgba(117, 228, 255, 0.22);
  background: rgba(8, 15, 26, 0.94);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
}
.site-tour__eyebrow {
  display: inline-flex;
  margin-bottom: .4rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.site-tour__title {
  margin: 0;
  font-size: 1.35rem;
}
.site-tour__text {
  margin: .6rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.site-tour__meta {
  margin-top: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  color: var(--muted-2);
  font-size: .92rem;
}
.site-tour__controls {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}
.site-tour__progress {
  height: .42rem;
  margin-top: 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.site-tour__progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width .24s ease;
}
.tour-target {
  position: relative;
  z-index: 121 !important;
  box-shadow: 0 0 0 1px rgba(117, 228, 255, 0.22), 0 0 0 9999px rgba(2, 8, 16, 0.28);
}
.tour-target,
.tour-target.panel,
.tour-target .panel {
  transition: box-shadow .25s ease, transform .25s ease;
}
.site-tour--paused .site-tour__panel {
  border-color: rgba(250, 204, 21, 0.3);
}
@media (max-width: 760px) {
  .site-tour__panel {
    right: .75rem;
    left: .75rem;
    width: auto;
    bottom: .75rem;
  }
}


.archetype-library {
  display: grid;
  gap: 1rem;
}
.archetype-library__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 1rem;
  align-items: start;
}
.archetype-library__conventions {
  padding: 1.1rem 1.2rem;
}
.archetype-library__conventions h3,
.archetype-card h3 {
  margin: 0 0 .55rem;
}
.archetype-category {
  display: grid;
  gap: 1rem;
}
.archetype-category__head {
  display: grid;
  gap: .55rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.archetype-category__head p,
.archetype-card__head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.archetype-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.archetype-card {
  display: grid;
  gap: .9rem;
  padding: 1.15rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(255, 255, 255, .03);
}
.archetype-meta {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.archetype-card__block {
  display: grid;
  gap: .55rem;
}
.archetype-uses {
  margin: 0;
}
.archetype-code {
  max-height: 28rem;
}
@media (max-width: 1240px) {
  .archetype-library__intro,
  .archetype-grid {
    grid-template-columns: 1fr;
  }
}


.writer-page {
  display: grid;
  gap: 1.2rem;
}
.writer-summary h2 {
  margin-top: 0;
}
.writer-controls {
  padding: 1.15rem;
}
.writer-controls__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}
.writer-controls__grid label {
  display: grid;
  gap: .45rem;
  font-weight: 600;
  color: var(--text);
}
.writer-controls__actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.writer-note {
  margin: .9rem 0 0;
  color: var(--muted);
}
.writer-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.writer-card {
  display: grid;
  gap: .9rem;
  padding: 1.1rem;
}
.writer-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}
.writer-card__head h3 {
  margin: .15rem 0 .35rem;
}
.writer-card__head p {
  margin: 0;
  color: var(--muted);
}
.writer-card__actions {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.writer-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.writer-code {
  max-height: 30rem;
  margin: 0;
}
@media (max-width: 1180px) {
  .writer-controls__grid,
  .writer-results-grid {
    grid-template-columns: 1fr;
  }
  .writer-card__head {
    flex-direction: column;
  }
  .writer-card__actions {
    justify-content: flex-start;
  }
}

.writer-card__validation {
  display: grid;
  gap: 0.35rem;
  margin: 0.85rem 0 0.25rem;
}

.writer-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.writer-status--valid {
  color: #b9ffd3;
  background: rgba(26, 91, 54, 0.42);
  border-color: rgba(112, 255, 176, 0.34);
}

.writer-status--invalid,
.writer-status--halted {
  color: #ffd0d0;
  background: rgba(115, 39, 48, 0.36);
  border-color: rgba(255, 131, 131, 0.32);
}

.writer-status--retrying,
.writer-status--checking {
  color: #d9e6ff;
  background: rgba(43, 66, 108, 0.34);
  border-color: rgba(138, 173, 255, 0.28);
}

.writer-validation-message,
.writer-validation-detail {
  margin: 0;
}

.writer-validation-message {
  color: var(--ink-1);
  font-size: 0.94rem;
}

.writer-validation-detail {
  color: var(--ink-3);
  font-size: 0.82rem;
}

.writer-card__actions .is-disabled {
  opacity: 0.5;
  pointer-events: none;
}


.intelligent-writer-page {
  display: grid;
  gap: 1.2rem;
}
.intelligent-writer-controls {
  display: grid;
  gap: 1rem;
}
.intelligent-writer-prompt {
  display: grid;
  gap: .55rem;
}
.intelligent-writer-prompt label {
  font-weight: 700;
  color: var(--text);
}
.intelligent-writer-textarea {
  min-height: 12rem;
  resize: vertical;
}
.intelligent-writer-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, .9fr) auto;
}
.writer-prompt-echo {
  margin: .55rem 0 0;
  color: var(--ink-2);
  max-width: 58ch;
}
.writer-ai-summary {
  margin: 0;
  color: var(--ink-2);
}
.writer-research {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10, 18, 32, 0.26);
}
.writer-research p {
  margin: 0;
  color: var(--ink-2);
}
.writer-research-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-1);
}
.writer-research-list code {
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.example-tag--part {
  border-color: rgba(130, 181, 255, 0.26);
  background: rgba(53, 76, 124, 0.22);
}
.writer-status--queued,
.writer-status--generating,
.writer-status--api-error {
  color: #f7e6ba;
  background: rgba(115, 82, 24, 0.30);
  border-color: rgba(255, 210, 116, 0.30);
}
@media (max-width: 1180px) {
  .intelligent-writer-grid {
    grid-template-columns: 1fr;
  }
}
