/* ==========================================================================
   Short-drama feature pages — "production dossier" visual system
   Shared by the hub and every mode page. No external fonts, images or JS
   dependencies: all proof panels are CSS/SVG.
   ========================================================================== */

@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: url('script-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: url('script-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --sd-bg: #171917;
  --sd-bg-deep: #121413;
  --sd-panel: #202421;
  --sd-panel-2: #272c28;
  --sd-panel-3: #2e342f;
  --sd-ink: #f5f6ef;
  --sd-muted: #a8b1a8;
  --sd-dim: #77817a;
  --sd-line: rgba(247, 247, 239, 0.12);
  --sd-line-strong: rgba(247, 247, 239, 0.2);
  --sd-lime: #c8ff71;
  --sd-lime-ink: #14180f;
  --sd-lime-soft: rgba(200, 255, 113, 0.12);
  --sd-sand: #e7d6ae;
  --sd-sand-soft: rgba(231, 214, 174, 0.1);
  --sd-radius: 18px;
  --sd-radius-lg: 24px;
  --sd-sans: 'HarmonyOS Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --sd-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --sd-max: 1240px;
  --sd-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

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

html {
  background: var(--sd-bg);
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

.sd-page {
  margin: 0;
  min-height: 100vh;
  color: var(--sd-ink);
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(200, 255, 113, 0.07), transparent 62%),
    radial-gradient(700px 500px at 2% 18%, rgba(231, 214, 174, 0.03), transparent 60%),
    linear-gradient(180deg, #191c1a 0%, var(--sd-bg) 34%, #151715 100%);
  font-family: var(--sd-sans);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.sd-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(to right, rgba(247, 247, 239, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(247, 247, 239, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.sd-page > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--sd-lime); color: var(--sd-lime-ink); }

.sd-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--sd-lime);
  color: var(--sd-lime-ink);
  font-weight: 700;
}
.sd-skip:focus { top: 16px; }

.sd-shell {
  width: min(var(--sd-max), calc(100% - 48px));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.sd-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--sd-line);
  background: rgba(23, 25, 23, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sd-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.sd-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sd-brand img { width: 17px; height: auto; }
.sd-brand:hover { color: var(--sd-lime); }

.sd-topnav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--sd-muted);
  font-size: 13px;
}
.sd-topnav a { transition: color 0.18s ease; }
.sd-topnav a:hover { color: var(--sd-ink); }
.sd-topnav a[aria-current='page'] { color: var(--sd-lime); }

.sd-top-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--sd-lime);
  color: var(--sd-lime-ink);
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.sd-top-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(200, 255, 113, 0.18);
}
.sd-top-cta span { font-size: 15px; line-height: 1; }

.sd-protobar {
  padding: 7px 16px;
  background: var(--sd-sand);
  color: #1b1a13;
  text-align: center;
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sd-protobar b { font-weight: 700; }

/* --------------------------------------------------------------------------
   Frame, rail, breadcrumb
   -------------------------------------------------------------------------- */

.sd-layout {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 36px;
  padding-top: 28px;
}

.sd-rail {
  position: sticky;
  top: 96px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 6px;
}

.sd-rail-word {
  writing-mode: vertical-rl;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.sd-rail-list { display: grid; gap: 4px; }
.sd-rail-link {
  display: grid;
  place-items: center;
  width: 64px;
  min-height: 58px;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.sd-rail-number { color: var(--sd-dim); font-family: var(--sd-mono); font-size: 9px; line-height: 1; }
.sd-rail-label { color: var(--sd-muted); font-family: var(--sd-sans); font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; white-space: nowrap; }
.sd-rail-link:hover { color: var(--sd-ink); border-color: var(--sd-line-strong); }
.sd-rail-link[aria-current='page'] {
  color: var(--sd-lime-ink);
  background: var(--sd-lime);
  border-color: var(--sd-lime);
  font-weight: 700;
}
.sd-rail-link[aria-current='page'] .sd-rail-number,
.sd-rail-link[aria-current='page'] .sd-rail-label { color: var(--sd-lime-ink); }

.sd-main { min-width: 0; }

.sd-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 18px 0 0;
  color: var(--sd-dim);
  font-size: 12px;
}
.sd-breadcrumb a { color: var(--sd-muted); }
.sd-breadcrumb a:hover { color: var(--sd-lime); }
.sd-breadcrumb i { font-style: normal; color: var(--sd-dim); }
.sd-breadcrumb [aria-current='page'] { color: var(--sd-ink); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.sd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  align-items: start;
  gap: 44px;
  padding: 46px 0 0;
}

.sd-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sd-kicker::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--sd-lime);
}

.sd-h1 {
  margin-top: 18px;
  font-size: clamp(40px, 4.6vw, 66px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.sd-h1 .accent {
  display: block;
  color: var(--sd-lime);
}

.sd-lede {
  max-width: 600px;
  margin-top: 24px;
  color: var(--sd-muted);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.8;
}

.sd-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.sd-btn-primary {
  background: var(--sd-lime);
  color: var(--sd-lime-ink);
}
.sd-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(200, 255, 113, 0.18);
}
.sd-btn-ghost {
  border-color: var(--sd-line-strong);
  color: var(--sd-ink);
  background: rgba(247, 247, 239, 0.03);
}
.sd-btn-ghost:hover { border-color: var(--sd-lime); color: var(--sd-lime); }
.sd-btn span { font-size: 16px; line-height: 1; }

.sd-hero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--sd-muted);
  font-family: var(--sd-sans);
  font-size: 12px;
  letter-spacing: 0;
}
.sd-hero-note::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sd-lime);
  box-shadow: 0 0 0 3px rgba(200, 255, 113, 0.12);
}

/* --------------------------------------------------------------------------
   Mode plate (CSS production diagram)
   -------------------------------------------------------------------------- */

.sd-plate {
  position: relative;
  min-height: 470px;
  padding: 12px;
  border: 1px solid var(--sd-line-strong);
  border-radius: var(--sd-radius-lg);
  background:
    radial-gradient(500px 300px at 78% 8%, rgba(200, 255, 113, 0.09), transparent 68%),
    linear-gradient(155deg, #242925, #191c1a 64%);
  box-shadow: var(--sd-shadow);
  isolation: isolate;
}

.sd-plate::before,
.sd-plate::after,
.sd-plate-inner::before,
.sd-plate-inner::after {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  color: rgba(200, 255, 113, 0.5);
  background:
    linear-gradient(currentColor, currentColor) center / 13px 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 13px no-repeat;
  pointer-events: none;
}
.sd-plate::before { left: -7px; top: -7px; }
.sd-plate::after { right: -7px; top: -7px; }
.sd-plate-inner::before { left: -7px; bottom: -7px; }
.sd-plate-inner::after { right: -7px; bottom: -7px; }

.sd-plate-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 444px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(247, 247, 239, 0.035), transparent 24%),
    #151815;
}

.sd-plate-top,
.sd-plate-foot {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sd-plate-top { border-bottom: 1px solid var(--sd-line); }
.sd-plate-foot { border-top: 1px solid var(--sd-line); color: var(--sd-muted); }
.sd-plate-top b { color: var(--sd-lime); font-weight: 700; }

.sd-plate-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 360px;
  padding: 22px;
}

.sd-ghost {
  position: absolute;
  right: 2px;
  bottom: -34px;
  z-index: 0;
  color: transparent;
  font-family: var(--sd-sans);
  font-size: 200px;
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.08em;
  -webkit-text-stroke: 1px rgba(200, 255, 113, 0.16);
  pointer-events: none;
  user-select: none;
}

/* Shared diagram primitives */
.dv { position: relative; z-index: 2; height: 100%; min-height: 316px; }
.dv .mono {
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dv span, .dv b, .dv i { font-style: normal; }

/* 01 script */
.dv-script {
  display: grid;
  grid-template-columns: 0.8fr 24px 1.2fr;
  align-items: center;
  gap: 10px;
}
.dv-doc {
  position: relative;
  padding: 16px 14px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 10px;
  background: #1d211d;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}
.dv-doc::before {
  content: '';
  position: absolute;
  right: -5px;
  top: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sd-lime);
  box-shadow: 0 0 16px rgba(200, 255, 113, 0.4);
}
.dv-doc i {
  display: block;
  height: 4px;
  margin-bottom: 7px;
  border-radius: 999px;
  background: rgba(247, 247, 239, 0.16);
}
.dv-doc i:nth-child(2) { width: 72%; }
.dv-doc i:nth-child(3) { width: 88%; }
.dv-doc i:nth-child(4) { width: 52%; }
.dv-doc b {
  display: block;
  margin-top: 12px;
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.dv-arrow {
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 15px;
  text-align: center;
}
.dv-eps { display: grid; gap: 8px; }
.dv-ep {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
  background: #1b1f1b;
  color: var(--sd-muted);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.dv-ep.on { border-color: rgba(200, 255, 113, 0.55); color: var(--sd-lime); background: rgba(200, 255, 113, 0.07); }
.dv-ep i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.dv-rowlabel {
  margin-top: 6px;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dv-assets { display: flex; gap: 6px; margin-top: 3px; }
.dv-assets i {
  flex: 1;
  height: 25px;
  border: 1px solid var(--sd-line);
  border-radius: 6px;
  background: linear-gradient(140deg, #263027, #1a1e1a);
}
.dv-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 3px;
}
.dv-shots i {
  height: 27px;
  border: 1px solid rgba(200, 255, 113, 0.18);
  border-radius: 5px;
  background: linear-gradient(140deg, rgba(200, 255, 113, 0.1), rgba(247, 247, 239, 0.03));
}

/* 02 studio */
.dv-studio { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
.dv-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 7px;
  border: 1px solid var(--sd-line);
  border-radius: 9px;
  background: #1a1e1a;
}
.dv-side b {
  margin-bottom: 5px;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}
.dv-side span {
  display: grid;
  place-items: center;
  height: 28px;
  border-radius: 6px;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 9px;
}
.dv-side span.on { background: var(--sd-lime); color: var(--sd-lime-ink); font-weight: 700; }
.dv-studio-main { display: flex; flex-direction: column; gap: 9px; }
.dv-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.dv-tabs span {
  padding: 4px 7px;
  border: 1px solid var(--sd-line);
  border-radius: 5px;
  color: var(--sd-dim);
  font-size: 9px;
}
.dv-tabs span.on { border-color: var(--sd-lime); color: var(--sd-lime); background: rgba(200, 255, 113, 0.08); }
.dv-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex: 1;
  min-height: 150px;
}
.dv-strip i {
  display: block;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 52%, rgba(23, 25, 23, 0.6) 52%),
    linear-gradient(145deg, #33402f, #1d2a25 60%, #6a5844);
}
.dv-strip i:nth-child(2) { background: linear-gradient(145deg, #3c4736, #4e3d31 62%, #b18c5e); }
.dv-strip i:nth-child(3) { background: linear-gradient(145deg, #2c3b3a, #6a5b46 55%, #232a24); }
.dv-timeline {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--sd-line);
  border-radius: 7px;
  background: #191d19;
}
.dv-timeline i { height: 5px; border-radius: 2px; background: rgba(247, 247, 239, 0.2); }
.dv-timeline i:nth-child(1) { width: 34%; background: var(--sd-lime); }
.dv-timeline i:nth-child(2) { width: 22%; }
.dv-timeline i:nth-child(3) { width: 18%; }
.dv-timeline i:nth-child(4) { width: 16%; }

/* 03 flex */
.dv-flex { min-height: 316px; }
.dv-block {
  position: absolute;
  display: grid;
  gap: 4px;
  width: 45%;
  padding: 11px 12px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 9px;
  background: #1c211c;
  color: var(--sd-ink);
  font-size: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}
.dv-block b { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 8px; letter-spacing: 0.08em; }
.dv-block small { color: var(--sd-dim); font-size: 9px; }
.dv-block.b1 { left: 0; top: 6%; }
.dv-block.b2 { right: 0; top: 22%; }
.dv-block.b3 { left: 8%; top: 44%; }
.dv-block.b4 { right: 4%; top: 58%; }
.dv-block.b5 { left: 0; bottom: 2%; border-color: rgba(200, 255, 113, 0.4); }
.dv-flex .dv-plus {
  position: absolute;
  right: 6%;
  bottom: 8%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px dashed var(--sd-line-strong);
  border-radius: 50%;
  color: var(--sd-lime);
  font-size: 16px;
}
.dv-flex .dv-dash {
  position: absolute;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--sd-line-strong) 0 4px, transparent 4px 8px);
  transform-origin: left center;
}
.dv-flex .d1 { left: 38%; top: 18%; width: 22%; transform: rotate(14deg); }
.dv-flex .d2 { left: 30%; top: 47%; width: 30%; transform: rotate(-10deg); }
.dv-flex .d3 { left: 44%; top: 72%; width: 18%; transform: rotate(10deg); }

/* 04 canvas */
.dv-canvas { min-height: 316px; overflow: hidden; }
.dv-canvas svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(200, 255, 113, 0.4);
}
.dv-canvas .dv-node {
  position: absolute;
  display: grid;
  gap: 4px;
  width: 42%;
  padding: 10px 11px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 8px;
  background: rgba(26, 31, 26, 0.94);
  font-size: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}
.dv-canvas .dv-node b { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 8px; letter-spacing: 0.08em; }
.dv-canvas .dv-node small { color: var(--sd-dim); font-size: 9px; }
.dv-canvas .n1 { left: 0; top: 6%; }
.dv-canvas .n2 { right: 0; top: 24%; }
.dv-canvas .n3 { left: 6%; bottom: 18%; }
.dv-canvas .n4 { right: 2%; bottom: 4%; border-color: rgba(200, 255, 113, 0.45); }
.dv-canvas .dv-agent {
  position: absolute;
  left: 50%;
  top: 4%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border: 1px solid rgba(200, 255, 113, 0.4);
  border-radius: 999px;
  color: var(--sd-lime);
  background: rgba(23, 25, 23, 0.9);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

/* 05 remake */
.dv-remake { display: flex; flex-direction: column; gap: 10px; }
.dv-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; min-height: 196px; }
.dv-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 9px;
  background: linear-gradient(145deg, #34423a, #8e6e52 58%, #1c2622);
}
.dv-frame.remake { border-color: rgba(200, 255, 113, 0.45); background: linear-gradient(145deg, #263a31, #c2a06a 56%, #2c3a2c); }
.dv-frame span {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(13, 16, 13, 0.8);
  color: var(--sd-ink);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.dv-frame::after {
  content: '';
  position: absolute;
  inset: 58% -12% -14% 16%;
  border-radius: 50%;
  background: rgba(18, 26, 22, 0.5);
  transform: rotate(-8deg);
}
.dv-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px dashed rgba(200, 255, 113, 0.3);
  border-radius: 6px;
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.dv-sync i {
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--sd-lime) 0 6px, transparent 6px 11px);
  opacity: 0.65;
}
.dv-langs { display: flex; flex-wrap: wrap; gap: 4px; }
.dv-langs span {
  padding: 3px 7px;
  border: 1px solid var(--sd-line);
  border-radius: 999px;
  color: var(--sd-muted);
  font-family: var(--sd-mono);
  font-size: 8px;
}

/* --------------------------------------------------------------------------
   Facts strip
   -------------------------------------------------------------------------- */

.sd-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 16px;
  background: rgba(32, 36, 33, 0.72);
}
.sd-fact {
  min-height: 108px;
  padding: 18px 20px;
  border-right: 1px solid var(--sd-line);
}
.sd-fact:last-child { border-right: 0; }
.sd-fact-label {
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sd-fact-value {
  margin-top: 10px;
  color: var(--sd-ink);
  font-size: clamp(19px, 1.9vw, 25px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.sd-fact-value em { color: var(--sd-lime); font-style: normal; }
.sd-fact-note { margin-top: 6px; color: var(--sd-dim); font-size: 11px; line-height: 1.5; }

/* --------------------------------------------------------------------------
   Answer slab
   -------------------------------------------------------------------------- */

.sd-answer {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 26px;
  margin-top: 42px;
  padding: 26px 30px;
  border: 1px solid var(--sd-line);
  border-left: 2px solid var(--sd-lime);
  border-radius: 0 16px 16px 0;
  background:
    linear-gradient(90deg, rgba(200, 255, 113, 0.06), transparent 38%),
    rgba(32, 36, 33, 0.55);
}
.sd-answer-label {
  padding-top: 4px;
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sd-answer-label b { display: block; margin-bottom: 5px; color: var(--sd-ink); font-weight: 700; }
.sd-answer p {
  max-width: 840px;
  font-size: clamp(17px, 1.65vw, 21px);
  line-height: 1.75;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.sd-section { margin-top: 92px; }
.sd-section-head {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}
.sd-section-index {
  padding-top: 9px;
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sd-section-title {
  font-size: clamp(27px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.sd-section-intro {
  max-width: 680px;
  margin-top: 13px;
  color: var(--sd-muted);
  font-size: 14px;
  line-height: 1.8;
}

/* Position */
.sd-position {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 20px;
  background: var(--sd-line);
}
.sd-position-lead {
  padding: 30px;
  background: var(--sd-panel);
}
.sd-position-lead .big {
  max-width: 560px;
  font-size: clamp(21px, 2.2vw, 29px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
}
.sd-position-lead .big em { color: var(--sd-lime); font-style: normal; }
.sd-solves { display: grid; gap: 1px; background: var(--sd-line); }
.sd-solve {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 26px;
  background: var(--sd-panel);
}
.sd-solve-num { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 10px; letter-spacing: 0.08em; }
.sd-solve h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.sd-solve p { margin-top: 6px; color: var(--sd-muted); font-size: 13px; line-height: 1.7; }

.sd-fit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.sd-fit-card {
  padding: 22px 24px;
  border: 1px solid var(--sd-line);
  border-radius: 16px;
  background: rgba(32, 36, 33, 0.6);
}
.sd-fit-card.no { border-color: rgba(231, 214, 174, 0.2); background: rgba(231, 214, 174, 0.03); }
.sd-fit-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sd-fit-card.no h3 { color: var(--sd-sand); }
.sd-fit-card h3::before { content: '+'; font-size: 13px; }
.sd-fit-card.no h3::before { content: '–'; }
.sd-fit-card ul { display: grid; gap: 9px; margin-top: 14px; }
.sd-fit-card li {
  position: relative;
  padding-left: 14px;
  color: var(--sd-muted);
  font-size: 13px;
  line-height: 1.65;
}
.sd-fit-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sd-line-strong);
}

/* Path */
.sd-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(196px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.sd-track::-webkit-scrollbar { height: 6px; }
.sd-track::-webkit-scrollbar-thumb { background: var(--sd-panel-3); border-radius: 99px; }

.sd-stage {
  display: flex;
  flex-direction: column;
  min-height: 276px;
  padding: 20px;
  border: 1px solid var(--sd-line);
  border-top: 2px solid var(--sd-line-strong);
  border-radius: 0 0 16px 16px;
  background: rgba(32, 36, 33, 0.66);
  scroll-snap-align: start;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.sd-stage:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 255, 113, 0.35);
  border-top-color: var(--sd-lime);
  background: rgba(38, 43, 39, 0.8);
}
.sd-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sd-stage-num { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 10px; letter-spacing: 0.08em; }
.sd-stage-artifact {
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-align: right;
}
.sd-stage h3 { margin-top: 18px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.sd-stage p { margin-top: 8px; color: var(--sd-muted); font-size: 12.5px; line-height: 1.7; }
.sd-stage-gate {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--sd-line);
}
.sd-stage-gate b {
  display: block;
  margin-bottom: 4px;
  color: var(--sd-sand);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.sd-stage-gate span { display: block; color: var(--sd-dim); font-size: 11px; line-height: 1.6; }

/* Control table */
.sd-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--sd-line);
  border-radius: 16px;
  background: rgba(32, 36, 33, 0.6);
}
.sd-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.sd-table th {
  padding: 13px 18px;
  border-bottom: 1px solid var(--sd-line);
  background: var(--sd-panel-2);
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.sd-table td {
  padding: 16px 18px;
  border-top: 1px solid var(--sd-line);
  color: var(--sd-muted);
  font-size: 13px;
  line-height: 1.65;
  vertical-align: top;
}
.sd-table tr:first-child td { border-top: 0; }
.sd-table td:first-child {
  width: 128px;
  color: var(--sd-ink);
  font-weight: 700;
  white-space: nowrap;
}
.sd-table td:last-child { color: var(--sd-dim); }
.sd-table tbody tr:hover td { background: rgba(247, 247, 239, 0.025); }
.sd-table tr.current td { background: rgba(200, 255, 113, 0.06); }
.sd-table tr.current td:first-child { color: var(--sd-lime); }
.sd-table td a { color: var(--sd-ink); text-decoration: underline; text-decoration-color: rgba(200, 255, 113, 0.4); text-underline-offset: 3px; }
.sd-table td a:hover { color: var(--sd-lime); }

/* Boundaries */
.sd-boundary {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 30px;
  padding: 30px;
  border: 1px solid rgba(231, 214, 174, 0.28);
  border-radius: 20px;
  background:
    radial-gradient(420px 220px at 12% 0%, rgba(231, 214, 174, 0.08), transparent 70%),
    rgba(32, 36, 33, 0.55);
}
.sd-boundary-label {
  color: var(--sd-sand);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sd-boundary-label b { display: block; margin-top: 10px; color: var(--sd-ink); font-family: var(--sd-sans); font-size: 20px; line-height: 1.4; letter-spacing: -0.02em; }
.sd-boundary ul { display: grid; gap: 11px; }
.sd-boundary li {
  position: relative;
  padding-left: 20px;
  color: var(--sd-muted);
  font-size: 13px;
  line-height: 1.7;
}
.sd-boundary li::before {
  content: '×';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--sd-sand);
  font-family: var(--sd-mono);
  font-size: 12px;
}
.sd-availability {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(231, 214, 174, 0.22);
  color: var(--sd-dim);
  font-size: 11.5px;
  line-height: 1.7;
}
.sd-availability b { color: var(--sd-sand); font-weight: 700; }

/* FAQ */
.sd-faq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 18px;
  background: var(--sd-line);
}
.sd-faq details {
  padding: 20px 22px;
  background: rgba(32, 36, 33, 0.78);
}
.sd-faq details:hover { background: rgba(38, 43, 39, 0.9); }
.sd-faq summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  color: var(--sd-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  list-style: none;
}
.sd-faq summary::-webkit-details-marker { display: none; }
.sd-faq summary::after {
  content: '+';
  flex: 0 0 auto;
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 15px;
  line-height: 1.3;
}
.sd-faq details[open] summary::after { content: '–'; }
.sd-faq p { margin-top: 10px; color: var(--sd-muted); font-size: 13px; line-height: 1.75; }

/* Related */
.sd-related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sd-related-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  border: 1px solid var(--sd-line);
  border-radius: 16px;
  background: rgba(32, 36, 33, 0.6);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.sd-related-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 255, 113, 0.4);
  background: rgba(38, 43, 39, 0.82);
}
.sd-related-card .mono { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 9px; letter-spacing: 0.1em; }
.sd-related-card h3 { font-size: 16px; font-weight: 700; }
.sd-related-card p { color: var(--sd-muted); font-size: 12.5px; line-height: 1.65; }
.sd-related-card .arrow { margin-top: auto; color: var(--sd-lime); font-family: var(--sd-mono); font-size: 11px; }

/* CTA */
.sd-cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-top: 92px;
  padding: 40px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--sd-lime);
  color: var(--sd-lime-ink);
}
.sd-cta::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -80px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(20, 24, 15, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(20, 24, 15, 0.05), 0 0 0 90px rgba(20, 24, 15, 0.035);
  pointer-events: none;
}
.sd-cta-eyebrow {
  color: rgba(20, 24, 15, 0.6);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sd-cta h2 {
  max-width: 820px;
  margin-top: 12px;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.sd-cta p {
  max-width: 620px;
  margin-top: 14px;
  color: rgba(20, 24, 15, 0.72);
  font-size: 13px;
  line-height: 1.7;
}
.sd-cta-actions { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.sd-cta .sd-btn-dark {
  background: #171a16;
  color: var(--sd-ink);
  white-space: nowrap;
}
.sd-cta .sd-btn-dark:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(20, 24, 15, 0.22); }
.sd-cta .sd-cta-note {
  max-width: 250px;
  color: rgba(20, 24, 15, 0.62);
  font-size: 11px;
  line-height: 1.6;
  text-align: right;
}

/* Footer */
.sd-footer {
  margin-top: 66px;
  padding: 34px 0 54px;
  border-top: 1px solid var(--sd-line);
  color: var(--sd-dim);
  font-size: 12px;
}
.sd-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 36px;
}
.sd-footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--sd-ink); font-weight: 700; }
.sd-footer-brand img { width: 15px; }
.sd-footer p { margin-top: 10px; max-width: 360px; line-height: 1.7; }
.sd-footer h3 {
  margin-bottom: 10px;
  color: var(--sd-ink);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sd-footer ul { display: grid; gap: 6px; }
.sd-footer a:hover { color: var(--sd-lime); }
.sd-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--sd-line);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Hub mode grid */
.sd-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sd-mode-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 18px;
  background: rgba(32, 36, 33, 0.62);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.sd-mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 255, 113, 0.42);
  background: rgba(38, 43, 39, 0.86);
}
.sd-mode-card:first-child { grid-column: 1 / -1; }
.sd-mode-card:first-child > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  column-gap: 34px;
  align-items: start;
}
.sd-mode-card:first-child > div > h3,
.sd-mode-card:first-child > div > p { grid-column: 1; }
.sd-mode-card:first-child .sd-mode-meta {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  align-content: start;
  gap: 10px;
  margin-top: 2px;
}
.sd-mode-card:first-child .sd-mode-meta span { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.sd-mode-card:first-child .sd-mode-meta b { margin: 0; }
.sd-mode-num {
  color: transparent;
  font-family: var(--sd-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  -webkit-text-stroke: 1px rgba(200, 255, 113, 0.55);
}
.sd-mode-card:hover .sd-mode-num { -webkit-text-stroke-color: var(--sd-lime); }
.sd-mode-card h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.sd-mode-card .en { margin-left: 8px; color: var(--sd-dim); font-family: var(--sd-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.sd-mode-card p { margin-top: 7px; color: var(--sd-muted); font-size: 13px; line-height: 1.65; }
.sd-mode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  color: var(--sd-dim);
  font-size: 11px;
}
.sd-mode-meta b { display: block; margin-bottom: 2px; color: var(--sd-ink); font-family: var(--sd-mono); font-size: 8px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.sd-mode-arrow { position: absolute; right: 20px; bottom: 18px; color: var(--sd-lime); font-family: var(--sd-mono); font-size: 13px; }

/* Hub chooser */
.sd-chooser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 20px;
  background: var(--sd-line);
}
.sd-chooser-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 24px 26px;
  background: var(--sd-panel);
}
.sd-chooser-step .n { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 10px; }
.sd-chooser-step h3 { font-size: 16px; font-weight: 700; }
.sd-chooser-step p { margin-top: 6px; color: var(--sd-muted); font-size: 13px; line-height: 1.65; }
.sd-chooser-step a { display: inline-flex; gap: 6px; margin-top: 10px; color: var(--sd-lime); font-size: 12px; font-weight: 700; }
.sd-chooser-step a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sd-chooser-note { grid-column: 1 / -1; padding: 16px 26px; background: var(--sd-panel-2); color: var(--sd-dim); font-size: 11.5px; }

/* Hub base */
.sd-base {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.sd-base-item {
  padding: 20px;
  border: 1px solid var(--sd-line);
  border-radius: 14px;
  background: rgba(32, 36, 33, 0.6);
}
.sd-base-item .mono { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 9px; letter-spacing: 0.1em; }
.sd-base-item h3 { margin-top: 14px; font-size: 15px; font-weight: 700; }
.sd-base-item p { margin-top: 6px; color: var(--sd-muted); font-size: 12px; line-height: 1.65; }

/* Utility */
.sd-mono { font-family: var(--sd-mono); }
.sd-nowrap { white-space: nowrap; }
.sd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1120px) {
  .sd-layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .sd-rail {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
    padding: 16px 0 4px;
    scrollbar-width: none;
  }
  .sd-rail::-webkit-scrollbar { display: none; }
  .sd-rail-word { writing-mode: horizontal-tb; white-space: nowrap; }
  .sd-rail-list { display: flex; gap: 5px; }
  .sd-rail-link { width: 42px; }
  .sd-breadcrumb { padding-top: 10px; }
  .sd-hero { padding-top: 34px; }
}

@media (max-width: 980px) {
  .sd-hero { grid-template-columns: 1fr; gap: 34px; }
  .sd-plate { min-height: 420px; }
  .sd-plate-inner { min-height: 394px; }
  .sd-plate-stage { min-height: 310px; }
  .sd-ghost { font-size: 160px; bottom: -22px; }
  .sd-position { grid-template-columns: 1fr; }
  .sd-boundary { grid-template-columns: 1fr; gap: 18px; }
  .sd-faq { grid-template-columns: 1fr; }
  .sd-related { grid-template-columns: 1fr 1fr; }
  .sd-cta { grid-template-columns: 1fr; align-items: start; padding: 32px; }
  .sd-cta-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sd-cta .sd-cta-note { text-align: left; }
  .sd-modes { grid-template-columns: 1fr; }
  .sd-mode-card:first-child { grid-column: auto; }
  .sd-mode-card:first-child > div { display: block; }
  .sd-mode-card:first-child .sd-mode-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 14px;
  }
  .sd-mode-card:first-child .sd-mode-meta span { display: block; }
  .sd-base { grid-template-columns: 1fr 1fr; }
  .sd-chooser { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sd-shell { width: min(var(--sd-max), calc(100% - 32px)); }
  .sd-topbar-inner { height: 60px; }
  .sd-topnav { display: none; }
  .sd-rail-word { display: none; }
  .sd-h1 { font-size: clamp(36px, 11vw, 54px); }
  .sd-lede { margin-top: 18px; }
  .sd-facts { grid-template-columns: 1fr 1fr; }
  .sd-fact { min-height: 96px; padding: 15px 16px; }
  .sd-fact:nth-child(2) { border-right: 0; }
  .sd-fact:nth-child(-n + 2) { border-bottom: 1px solid var(--sd-line); }
  .sd-answer { grid-template-columns: 1fr; gap: 10px; padding: 22px; }
  .sd-answer-label b { display: inline; margin-right: 8px; }
  .sd-section { margin-top: 70px; }
  .sd-section-head { grid-template-columns: 1fr; gap: 8px; margin-bottom: 20px; }
  .sd-section-index { padding-top: 0; }
  .sd-fit { grid-template-columns: 1fr; }
  .sd-track { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
  .sd-stage { min-height: 0; border-radius: 14px; }
  .sd-stage-gate { margin-top: 16px; }
  .sd-table-wrap { overflow: visible; border: 0; background: transparent; }
  .sd-table { display: block; min-width: 0; }
  .sd-table thead { display: none; }
  .sd-table tbody { display: grid; gap: 10px; }
  .sd-table tr {
    display: block;
    padding: 16px 18px;
    border: 1px solid var(--sd-line);
    border-radius: 14px;
    background: rgba(32, 36, 33, 0.7);
  }
  .sd-table tr.current { border-color: rgba(200, 255, 113, 0.36); background: rgba(200, 255, 113, 0.05); }
  .sd-table td { display: block; width: auto; border: 0; padding: 4px 0; }
  .sd-table td:first-child { width: auto; margin-bottom: 4px; font-size: 15px; }
  .sd-table td:first-child::before { display: none; }
  .sd-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--sd-dim);
    font-family: var(--sd-mono);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .sd-table td[data-label='']::before, .sd-table td:not([data-label])::before { display: none; }
  .sd-related { grid-template-columns: 1fr; }
  .sd-footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .sd-cta { margin-top: 70px; padding: 26px; }
  .sd-cta::after { width: 220px; height: 220px; right: -70px; top: -60px; }
  .sd-base { grid-template-columns: 1fr; }
  .sd-mode-card { grid-template-columns: 42px minmax(0, 1fr); padding: 20px; }
  .sd-mode-num { font-size: 27px; }
  .sd-chooser-step { padding: 20px; }
}

@media (max-width: 520px) {
  .sd-shell { width: calc(100% - 28px); }
  .sd-h1 { font-size: clamp(34px, 10vw, 40px); }
  .sd-top-cta { padding: 9px 13px; font-size: 12px; }
  .sd-topbar-inner { gap: 12px; }
  .sd-brand { font-size: 15px; }
  .sd-hero { padding-top: 26px; }
  .sd-plate { min-height: 380px; padding: 9px; }
  .sd-plate-inner { min-height: 356px; }
  .sd-plate-stage { min-height: 272px; padding: 14px; }
  .sd-plate-top, .sd-plate-foot { padding: 10px 12px; font-size: 8px; }
  .sd-ghost { font-size: 120px; }
  .dv { min-height: 260px; }
  .dv-script { grid-template-columns: 1fr; }
  .dv-arrow { display: none; }
  .dv-doc { display: none; }
  .dv-studio { grid-template-columns: 48px minmax(0, 1fr); }
  .dv-strip { min-height: 110px; }
  .dv-compare { min-height: 150px; }
  .sd-facts { grid-template-columns: 1fr 1fr; }
  .sd-fact-value { font-size: 17px; }
  .sd-cta h2 { font-size: clamp(26px, 9vw, 38px); }
  .sd-footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  .sd-hero-copy > * { animation: sd-rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
  .sd-hero-copy > *:nth-child(2) { animation-delay: 0.04s; }
  .sd-hero-copy > *:nth-child(3) { animation-delay: 0.08s; }
  .sd-hero-copy > *:nth-child(4) { animation-delay: 0.12s; }
  .sd-plate { animation: sd-fade 0.8s 0.08s ease both; }
  @keyframes sd-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes sd-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* Reading progress (progressive enhancement; invisible without JS) */
.sd-progress {
  position: fixed;
  left: 0;
  right: 0;
  top: 68px;
  z-index: 41;
  height: 1px;
  background: transparent;
  pointer-events: none;
}
.sd-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sd-lime);
  box-shadow: 0 0 10px rgba(200, 255, 113, 0.5);
}
@media (max-width: 760px) {
  .sd-progress { top: 60px; }
}

/* Script-workspace objects: the shared shell stays dark, while each feature
   gets a different object that explains its starting material. */
:root {
  --sw-paper: #f5f0e6;
  --sw-paper-strong: #fffaf0;
  --sw-ink: #1e2622;
  --sw-ink-muted: #68736b;
  --sw-object: rgba(22, 27, 24, 0.92);
  --sw-object-soft: rgba(38, 46, 40, 0.72);
  --sw-object-line: rgba(184, 255, 65, 0.3);
  --sw-orange: #e8895a;
  --sw-blue: #9cb5ff;
}

.sw-object {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--sw-object-line);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(28, 34, 30, 0.98), var(--sw-object));
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.24);
}
.sw-object::after {
  position: absolute;
  right: -36px;
  bottom: -56px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(200, 218, 192, 0.15);
  border-radius: 50%;
  content: '';
}
.sw-object-head,
.sw-object-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  color: var(--sd-muted);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sw-object-head { border-bottom: 1px solid var(--sd-line); }
.sw-object-foot { position: absolute; right: 0; bottom: 0; left: 0; border-top: 1px solid var(--sd-line); }
.sw-object-head b { color: var(--sd-lime); }
.sw-object-body { position: relative; z-index: 1; padding: 22px; }
.sw-object-caption { max-width: 34ch; color: var(--sd-muted); font-size: 12px; line-height: 1.65; }
.sw-object-label { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 10px; letter-spacing: 0.08em; }

.sw-asset-map { display: grid; gap: 15px; padding-top: 16px; }
.sw-asset-map-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; align-items: center; }
.sw-asset-node { position: relative; min-height: 65px; padding: 10px 8px; border: 1px solid var(--sd-line-strong); background: rgba(10, 14, 12, 0.45); }
.sw-asset-node::after { position: absolute; top: 50%; right: -8px; width: 8px; border-top: 1px solid var(--sd-lime); content: ''; }
.sw-asset-node:last-child::after { display: none; }
.sw-asset-node small { display: block; color: var(--sd-dim); font-family: var(--sd-mono); font-size: 8px; }
.sw-asset-node strong { display: block; margin-top: 8px; color: var(--sd-ink); font-size: 12px; }
.sw-asset-node.is-active { border-color: var(--sd-lime); background: rgba(184, 255, 65, 0.1); }
.sw-asset-note { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sw-asset-note div { padding: 12px; border-left: 2px solid var(--sd-lime); background: rgba(255, 255, 255, 0.04); }
.sw-asset-note b { display: block; color: var(--sd-ink); font-size: 12px; }
.sw-asset-note span { display: block; margin-top: 4px; color: var(--sd-muted); font-size: 11px; line-height: 1.5; }

.sw-chapter-index { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding-top: 8px; }
.sw-chapter-tabs { display: grid; align-content: start; gap: 5px; }
.sw-chapter-tab { padding: 9px 8px; border-left: 2px solid transparent; color: var(--sd-muted); font-family: var(--sd-mono); font-size: 9px; }
.sw-chapter-tab.is-active { border-color: var(--sd-lime); color: var(--sd-ink); background: rgba(184, 255, 65, 0.08); }
.sw-chapter-sheet { min-height: 230px; padding: 18px; background: var(--sw-paper); color: var(--sw-ink); transform: rotate(1deg); box-shadow: 9px 10px 0 rgba(184, 255, 65, 0.12); }
.sw-chapter-sheet h3 { margin: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.sw-chapter-sheet p { margin: 10px 0 0; color: var(--sw-ink-muted); font-size: 11px; line-height: 1.65; }
.sw-chapter-lines { display: grid; gap: 7px; margin-top: 18px; }
.sw-chapter-line { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px dashed rgba(30, 38, 34, 0.26); color: var(--sw-ink-muted); font-size: 10px; }
.sw-chapter-line b { color: var(--sw-ink); }

.sw-blueprint-stack { position: relative; min-height: 260px; padding: 28px 24px; }
.sw-blueprint-page { position: absolute; width: 72%; min-height: 190px; padding: 18px; border: 1px solid rgba(184, 255, 65, 0.32); background: var(--sw-paper); color: var(--sw-ink); box-shadow: 10px 12px 0 rgba(184, 255, 65, 0.1); }
.sw-blueprint-page:nth-child(1) { top: 18px; left: 10%; transform: rotate(-4deg); opacity: 0.58; }
.sw-blueprint-page:nth-child(2) { top: 34px; left: 16%; transform: rotate(2deg); opacity: 0.8; }
.sw-blueprint-page:nth-child(3) { top: 48px; left: 22%; transform: rotate(-1deg); }
.sw-blueprint-page small { color: var(--sw-ink-muted); font-family: var(--sd-mono); font-size: 8px; letter-spacing: 0.1em; }
.sw-blueprint-page h3 { margin: 12px 0 10px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.sw-blueprint-page p { max-width: 28ch; color: var(--sw-ink-muted); font-size: 10px; line-height: 1.55; }
.sw-blueprint-sequence { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; color: var(--sd-muted); font-family: var(--sd-mono); font-size: 8px; }
.sw-blueprint-sequence b { color: var(--sd-lime); }

.sw-review-paper { display: grid; grid-template-columns: 0.76fr 1.24fr; gap: 20px; padding: 24px; background: linear-gradient(135deg, rgba(245, 240, 230, 0.96), rgba(255, 250, 240, 0.98)); color: var(--sw-ink); }
.sw-review-paper h3 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.sw-review-paper p { color: var(--sw-ink-muted); font-size: 11px; line-height: 1.6; }
.sw-review-summary { padding: 16px; border: 1px solid rgba(30, 38, 34, 0.16); background: rgba(255, 255, 255, 0.45); }
.sw-review-summary b { display: block; font-family: var(--sd-mono); font-size: 9px; letter-spacing: 0.12em; }
.sw-review-summary strong { display: block; margin-top: 20px; color: var(--sw-orange); font-family: Georgia, serif; font-size: 36px; font-weight: 500; }
.sw-review-summary span { color: var(--sw-ink-muted); font-size: 10px; }
.sw-review-list { display: grid; gap: 8px; }
.sw-review-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border-bottom: 1px solid rgba(30, 38, 34, 0.14); }
.sw-review-row b { font-size: 12px; font-weight: 600; }
.sw-review-row span { color: var(--sw-ink-muted); font-family: var(--sd-mono); font-size: 9px; }
.sw-review-evidence { display: inline-flex; align-items: center; gap: 4px; color: #315c45; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.sw-review-note { grid-column: 1 / -1; margin: 0; padding-top: 10px; border-top: 1px solid rgba(30, 38, 34, 0.14); color: var(--sw-ink-muted); font-size: 10px; }

.sw-film-strip { display: grid; gap: 18px; padding: 22px; }
.sw-film-frames { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.sw-film-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid rgba(184, 255, 65, 0.38); background: linear-gradient(145deg, #465449, #202b24); }
.sw-film-frame::before,
.sw-film-frame::after { position: absolute; right: 5px; left: 5px; height: 4px; border-top: 1px dashed rgba(245, 240, 230, 0.55); border-bottom: 1px dashed rgba(245, 240, 230, 0.55); content: ''; }
.sw-film-frame::before { top: 5px; }
.sw-film-frame::after { bottom: 5px; }
.sw-film-frame span { position: absolute; right: 7px; bottom: 13px; left: 7px; color: rgba(245, 240, 230, 0.82); font-family: var(--sd-mono); font-size: 8px; }
.sw-film-arrow { display: flex; align-items: center; justify-content: center; color: var(--sd-lime); font-family: var(--sd-mono); font-size: 10px; letter-spacing: 0.12em; }
.sw-manuscript-index { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.sw-manuscript-index a { padding: 12px; border: 1px solid var(--sd-line-strong); color: var(--sd-muted); font-size: 11px; }
.sw-manuscript-index a:hover { border-color: var(--sd-lime); color: var(--sd-ink); }
.sd-chooser-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.sd-chooser-filters .sd-btn { padding: 9px 12px; font-size: 11px; }
.sd-chooser-filters .sd-btn.is-active { border-color: var(--sd-lime); color: var(--sd-lime-ink); background: var(--sd-lime); }
.sd-base-boundary { margin-top: 18px; }
.sw-series-banner .sd-related-card { display: block; max-width: 640px; margin-top: 18px; }

[data-script-chooser] { cursor: pointer; }
[data-script-chooser].is-filtered { opacity: 0.35; transform: scale(0.98); }
[data-evidence-link] { scroll-margin-top: 80px; }
[data-evidence-link].is-highlighted { outline: 2px solid var(--sd-lime); outline-offset: 5px; }

@media (max-width: 760px) {
  .sw-object { min-height: 0; }
  .sw-object-head, .sw-object-foot { font-size: 8px; }
  .sw-object-body { padding: 16px; }
  .sw-asset-map-row { grid-template-columns: 1fr; gap: 6px; }
  .sw-asset-node::after { top: auto; right: auto; bottom: -7px; left: 50%; width: 0; height: 7px; border-top: 0; border-left: 1px solid var(--sd-lime); }
  .sw-asset-node:last-child::after { display: none; }
  .sw-asset-note { grid-template-columns: 1fr; }
  .sw-chapter-index { grid-template-columns: 1fr; }
  .sw-chapter-tabs { grid-template-columns: repeat(3, 1fr); }
  .sw-chapter-tab { border-left: 0; border-bottom: 2px solid transparent; text-align: center; }
  .sw-chapter-tab.is-active { border-bottom-color: var(--sd-lime); }
  .sw-blueprint-stack { min-height: 290px; padding: 18px 8px; }
  .sw-blueprint-page { width: 82%; }
  .sw-review-paper { grid-template-columns: 1fr; padding: 16px; }
  .sw-film-frames { grid-template-columns: repeat(3, 1fr); }
  .sw-manuscript-index { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  [data-script-chooser].is-filtered { transform: none; }
}

/* 00 hub mode map */
.dv-hub {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-height: 316px;
}
.dv-hub-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 0 11px 7px;
  border-bottom: 1px solid var(--sd-line);
  margin-bottom: 2px;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dv-hub-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
  background: rgba(27, 31, 27, 0.9);
}
.dv-hub-row.on {
  border-color: rgba(200, 255, 113, 0.5);
  background: rgba(200, 255, 113, 0.07);
}
.dv-hub-row .num {
  color: var(--sd-lime);
  font-family: var(--sd-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.dv-hub-row .name { font-size: 12px; font-weight: 700; }
.dv-hub-row .unit {
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Script feature prototype additions
   -------------------------------------------------------------------------- */

.sd-mode-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 9px;
  padding: 3px 8px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 999px;
  color: var(--sd-dim);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sd-mode-tag.aux { border-color: rgba(231, 214, 174, 0.28); color: var(--sd-sand); }

.dv-flow {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 300px;
}
.dv-flow-row { display: flex; align-items: stretch; gap: 7px; }
.dv-flow-node {
  flex: 1;
  min-width: 0;
  padding: 13px 9px;
  border: 1px solid var(--sd-line);
  border-radius: 10px;
  background: rgba(247, 247, 239, 0.025);
  color: var(--sd-muted);
  font-family: var(--sd-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}
.dv-flow-node b {
  display: block;
  margin-bottom: 4px;
  color: var(--sd-ink);
  font-family: var(--sd-sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.dv-flow-node.accent { border-color: rgba(200, 255, 113, 0.5); background: var(--sd-lime-soft); }
.dv-flow-node.accent b { color: var(--sd-lime); }
.dv-flow-node.sand { border-color: rgba(231, 214, 174, 0.28); background: var(--sd-sand-soft); }
.dv-flow-node.sand b { color: var(--sd-sand); }
.dv-flow-arrow { align-self: center; color: var(--sd-lime); font-family: var(--sd-mono); font-size: 12px; }
.dv-flow-label { color: var(--sd-dim); font-family: var(--sd-mono); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; }
.dv-flow-note { margin-top: 8px; color: var(--sd-dim); font-size: 10px; line-height: 1.6; text-align: center; }

.sd-report { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
.sd-report-frame {
  padding: 24px;
  border: 1px solid rgba(20, 24, 15, 0.12);
  border-radius: 18px;
  background: #f5f1e8;
  color: #1b1d18;
  box-shadow: var(--sd-shadow);
}
.sd-report-frame-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(20, 24, 15, 0.14); }
.sd-report-frame-head b { font-size: 13px; }
.sd-report-frame-head span { color: #697164; font-family: var(--sd-mono); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.sd-report-score { display: flex; align-items: baseline; gap: 10px; padding: 18px 0 10px; }
.sd-report-score strong { font-family: var(--sd-mono); font-size: 34px; letter-spacing: -0.06em; }
.sd-report-score small { color: #697164; font-size: 10px; }
.sd-report-bar { display: grid; grid-template-columns: 100px minmax(0, 1fr) 28px; align-items: center; gap: 8px; margin: 7px 0; font-size: 10px; }
.sd-report-bar i { height: 5px; border-radius: 999px; background: rgba(20, 24, 15, 0.12); overflow: hidden; }
.sd-report-bar i::after { content: ''; display: block; width: var(--w, 45%); height: 100%; background: #4f6b2b; }
.sd-report-bar span { color: #697164; font-family: var(--sd-mono); font-size: 8px; text-align: right; }
.sd-report-frame-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(20, 24, 15, 0.14); color: #697164; font-size: 10px; line-height: 1.6; }
.sd-report-dims { display: grid; gap: 10px; align-content: start; }
.sd-report-dim { padding: 16px 18px; border: 1px solid var(--sd-line); border-radius: 12px; background: var(--sd-panel); }
.sd-report-dim h3 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.sd-report-dim h3 span { color: var(--sd-lime); font-family: var(--sd-mono); font-size: 8px; font-weight: 400; letter-spacing: 0.06em; }
.sd-report-dim p { margin-top: 6px; color: var(--sd-muted); font-size: 12px; line-height: 1.65; }

.sd-rights { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 26px; padding: 26px; border: 1px solid rgba(231, 214, 174, 0.24); border-radius: var(--sd-radius); background: var(--sd-sand-soft); }
.sd-rights-label { color: var(--sd-sand); font-family: var(--sd-mono); font-size: 9px; letter-spacing: 0.12em; line-height: 1.7; text-transform: uppercase; }
.sd-rights-label b { display: block; margin-top: 6px; color: var(--sd-ink); font-family: var(--sd-sans); font-size: 16px; letter-spacing: 0; text-transform: none; }
.sd-rights ul { display: grid; gap: 8px; color: var(--sd-muted); font-size: 13px; line-height: 1.7; }
.sd-rights li { position: relative; padding-left: 14px; }
.sd-rights li::before { content: '·'; position: absolute; left: 0; color: var(--sd-sand); }
.sd-rights-note { margin-top: 12px; color: var(--sd-dim); font-size: 11px; line-height: 1.65; }

.sd-output { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--sd-line); border-radius: var(--sd-radius); background: var(--sd-line); }
.sd-output-col { padding: 24px 26px; background: var(--sd-panel); }
.sd-output-col h3 { margin-bottom: 10px; font-size: 15px; }
.sd-output-col h3 span { margin-left: 8px; color: var(--sd-dim); font-family: var(--sd-mono); font-size: 8px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.sd-output-col ul { display: grid; gap: 7px; color: var(--sd-muted); font-size: 12px; line-height: 1.65; }
.sd-output-col li { padding-left: 13px; position: relative; }
.sd-output-col li::before { content: '+'; position: absolute; left: 0; color: var(--sd-lime); font-family: var(--sd-mono); }
.sd-output-col.no li::before { content: '−'; color: var(--sd-sand); }

@media (max-width: 980px) {
  .sd-report { grid-template-columns: 1fr; }
  .sd-rights { grid-template-columns: 1fr; gap: 14px; }
  .sd-output { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dv-flow { min-height: 250px; }
  .dv-flow-row { flex-wrap: wrap; }
  .dv-flow-node { min-width: 92px; }
  .sd-report-frame { padding: 18px; }
  .sd-report-bar { grid-template-columns: 84px minmax(0, 1fr) 24px; }
  .sd-rights { padding: 20px; }
}

.sd-report-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(20, 24, 15, 0.1); color: #3c4436; font-size: 10px; }
.sd-report-line em { color: #697164; font-family: var(--sd-mono); font-size: 8px; font-style: normal; }

/* Script hub: four entry cards, not the five-mode shortdrama grid. */
.sd-modes-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sd-modes-four .sd-mode-card:first-child { grid-column: auto; }
.sd-modes-four .sd-mode-card:first-child > div { display: block; }
.sd-modes-four .sd-mode-card:first-child .sd-mode-meta { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 16px; }
.sd-modes-four .sd-mode-card:first-child .sd-mode-meta span { display: flex; gap: 8px; }
@media (max-width: 760px) {
  .sd-modes-four { grid-template-columns: 1fr; }
  .sd-modes-four .sd-mode-card:first-child .sd-mode-meta { display: block; }
}

/* Five-entry script hub: one card anatomy, three columns on wide screens. */
.sd-modes-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sd-modes-five .sd-mode-card { min-height: 270px; }
.sd-modes-five .sd-mode-card:first-child { grid-column: auto; }
.sd-modes-five .sd-mode-card:first-child > div { display: block; }
.sd-modes-five .sd-mode-card:first-child .sd-mode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
}
.sd-modes-five .sd-mode-card:first-child .sd-mode-meta span { display: block; }

/* The chooser is a compact filter bar, never a tall grid cell. */
.sd-chooser-filters {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 12px 16px;
  margin: 0;
  background: var(--sd-panel-2);
  scrollbar-width: none;
}
.sd-chooser-filters::-webkit-scrollbar { display: none; }
.sd-chooser-filters .sd-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
}

@media (max-width: 1200px) {
  .sd-modes-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-modes-five .sd-mode-card:nth-child(5) { grid-column: 1 / -1; max-width: calc(50% - 6px); }
}
@media (max-width: 760px) {
  .sd-modes-five { grid-template-columns: 1fr; }
  .sd-modes-five .sd-mode-card:nth-child(5) { grid-column: auto; max-width: none; }
}

/* --------------------------------------------------------------------------
   4 + 1 write-script IA: four script-producing paths, one diagnostic tool.
   -------------------------------------------------------------------------- */
.sw-asset-map-row.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sw-asset-map-row.is-four .sw-asset-node:nth-child(4)::after { display: none; }

.sd-mode-tag.reverse {
  border-color: rgba(231, 214, 174, 0.34);
  color: var(--sd-sand);
}

.sd-rail-rule {
  justify-self: center;
  width: 18px;
  height: 1px;
  margin: 4px 0;
  background: var(--sd-line-strong);
}

.sw-diagnose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  padding: 22px 26px;
  border: 1px solid rgba(231, 214, 174, 0.24);
  border-radius: var(--sd-radius);
  background:
    linear-gradient(100deg, rgba(231, 214, 174, 0.08), rgba(231, 214, 174, 0.02)),
    var(--sd-panel);
}
.sw-diagnose-kicker {
  display: block;
  color: var(--sd-sand);
  font-family: var(--sd-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sw-diagnose h2 {
  margin-top: 6px;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: -0.03em;
}
.sw-diagnose p {
  max-width: 58ch;
  margin-top: 6px;
  color: var(--sd-muted);
  font-size: 12px;
  line-height: 1.7;
}
.sw-diagnose-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 999px;
  color: var(--sd-sand);
  font-size: 12px;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.sw-diagnose-link:hover { border-color: var(--sd-sand); background: rgba(231, 214, 174, 0.08); }

.sw-scope-note {
  margin-top: 16px;
  padding: 14px 18px;
  border-left: 2px solid var(--sd-sand);
  color: var(--sd-muted);
  font-size: 12px;
  line-height: 1.7;
}
.sw-scope-note b { color: var(--sd-ink); }

.sd-chooser-diag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--sd-sand);
  font-size: 12px;
  font-weight: 700;
}
.sd-chooser-diag:hover { color: var(--sd-ink); }

.sd-compare-note {
  margin-top: 14px;
  color: var(--sd-muted);
  font-size: 12px;
  line-height: 1.7;
}
.sd-compare-note a { color: var(--sd-sand); border-bottom: 1px solid rgba(231, 214, 174, 0.4); }

@media (max-width: 980px) {
  .sw-diagnose { grid-template-columns: 1fr; gap: 16px; }
  .sw-diagnose-link { justify-self: start; }
}
@media (max-width: 760px) {
  .sw-asset-map-row.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sw-asset-map-row.is-four .sw-asset-node:nth-child(2)::after { display: none; }
  .sd-rail-rule { width: 1px; height: 28px; margin: 0 2px; }
}

/* Review fixes: keep headlines on semantic boundaries and make filtering real. */
.sd-h1 {
  font-size: clamp(40px, 4vw, 56px);
  text-wrap: pretty;
}
.sd-mode-card.is-filtered { display: none; }
.sw-manuscript-index span {
  display: block;
  padding: 12px;
  border: 1px solid var(--sd-line-strong);
  color: var(--sd-muted);
  font-size: 11px;
}
@media (max-width: 760px) {
  .sd-h1 { font-size: clamp(30px, 8vw, 34px); }
}

/* Decorative report preview: no visual link affordance inside aria-hidden object. */
.sw-review-evidence { text-decoration: none; color: var(--sw-ink-muted); }

/* Chooser bottom: note and diagnostic link share one balanced footer row. */
.sd-chooser-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 26px;
  border-top: 1px solid var(--sd-line);
  background: var(--sd-panel-2);
}
.sd-chooser-foot .sd-chooser-note {
  grid-column: auto;
  margin: 0;
  padding: 0;
  background: transparent;
}
.sd-chooser-foot .sd-chooser-diag {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .sd-chooser-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 20px;
  }
}
