:root {
  color-scheme: light;
  --ink: #17213c;
  --muted: #5d6880;
  --line: #dfe5f1;
  --panel: #ffffff;
  --soft: #f4f7fc;
  --accent: #2856d7;
  --accent-dark: #183caa;
  --focus: #ffbf47;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); line-height: 1.5; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { color: #fff; background: linear-gradient(135deg, #172d70, #2856d7); padding: 56px 0 48px; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; opacity: .82; }
h1 { max-width: 820px; margin: 0; font-size: clamp(2.1rem, 5vw, 4rem); line-height: 1.05; }
.lead { max-width: 760px; margin: 20px 0 14px; font-size: 1.15rem; }
.privacy { display: inline-block; margin: 0; padding: 8px 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; font-size: .9rem; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: -24px 0 24px; position: relative; }
.summary div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 8px 24px rgba(30,50,100,.08); }
.summary strong, .summary span { display: block; }
.summary strong { font-size: 1.75rem; }
.summary span { color: var(--muted); font-size: .86rem; }
.controls { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #bfc9db; border-radius: 9px; padding: 9px 10px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
button, .ddscore-link { border: 0; border-radius: 9px; background: var(--accent); color: #fff; padding: 11px 16px; font-weight: 800; cursor: pointer; text-decoration: none; }
button:hover, .ddscore-link:hover { background: var(--accent-dark); }
button.secondary { color: var(--accent-dark); background: #e9efff; }
.status { grid-column: 1 / -1; min-height: 1.5em; margin: 0; color: var(--muted); }
.gate-list { display: grid; gap: 16px; margin: 24px 0; }
.gate-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 5px 16px rgba(30,50,100,.05); }
.gate-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.gate-meta span { border-radius: 999px; padding: 4px 9px; background: #edf2ff; color: #2447aa; font-size: .75rem; font-weight: 800; }
.gate-card h2 { margin: 13px 0 17px; font-size: 1.15rem; line-height: 1.35; }
.editor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.editor-grid .wide { grid-column: span 2; }
.gate-footnote { margin: 14px 0 0; color: var(--muted); font-size: .78rem; }
.boundary { margin: 32px 0 48px; padding: 24px; border-radius: 16px; background: #17213c; color: #fff; }
.boundary h2 { margin-top: 0; }
.boundary p { max-width: 850px; }
.maker { font-weight: 800; }
.ddscore-link { display: inline-block; margin-top: 6px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #bfc9db; border-radius: 14px; }

@media (max-width: 820px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .controls, .editor-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1120px); }
  .hero { padding: 38px 0 34px; }
  .summary { gap: 8px; }
  .summary div { padding: 13px; }
  .controls, .editor-grid { grid-template-columns: 1fr; }
  .editor-grid .wide { grid-column: auto; }
  .gate-card, .controls, .boundary { padding: 16px; }
  .actions button { width: 100%; }
}

