*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#0f1117;--bg2:#1a1d27;--bg3:#242836;
  --text:#e2e4ed;--text2:#9ba1b4;--text3:#6b7194;
  --accent:#6366f1;--accent2:#818cf8;--accent-bg:rgba(99,102,241,.12);
  --green:#34d399;--green-bg:rgba(52,211,153,.12);
  --red:#f87171;--red-bg:rgba(248,113,113,.12);
  --border:#2a2e3d;--radius:10px;--radius-sm:6px;
  --font:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --mono:'SF Mono',Fira Code,Fira Mono,monospace;
}
html{scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.6;min-height:100vh}
a{color:var(--accent2);text-decoration:none}
a:hover{text-decoration:underline}
img,svg{max-width:100%;height:auto}

/* Header */
.site-header{border-bottom:1px solid var(--border);background:var(--bg);position:sticky;top:0;z-index:100;backdrop-filter:blur(8px);background:rgba(15,17,23,.85)}
.header-inner{display:flex;align-items:center;justify-content:space-between;max-width:1200px;margin:0 auto;padding:.75rem 1.5rem}
.logo{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:1.15rem;color:var(--text)}
.logo:hover{text-decoration:none}
.logo svg{flex-shrink:0}
.site-nav{display:flex;gap:1.5rem}
.site-nav a{color:var(--text2);font-size:.9rem;font-weight:500}
.site-nav a:hover{color:var(--text)}

/* Hero */
.hero{max-width:1200px;margin:0 auto;padding:4rem 1.5rem 3rem;display:grid;grid-template-columns:1fr 1fr;gap:3rem;align-items:center}
.hero-tag{display:inline-block;background:var(--accent-bg);color:var(--accent2);font-size:.8rem;font-weight:600;padding:.25rem .75rem;border-radius:99px;margin-bottom:1rem}
.hero h1{font-size:clamp(1.8rem,4vw,2.8rem);line-height:1.2;font-weight:800;margin-bottom:1rem}
.hero-sub{font-size:1.1rem;color:var(--text2);margin-bottom:1.5rem;max-width:500px}
.hero-actions{display:flex;gap:.75rem;flex-wrap:wrap}
.hero-visual{display:flex;justify-content:center;align-items:center}
.mini-chart{display:flex;align-items:flex-end;gap:6px;height:160px;padding:1.5rem;background:var(--bg2);border-radius:var(--radius);border:1px solid var(--border)}
.mc-bar{width:20px;height:var(--h);background:linear-gradient(to top,var(--accent),var(--accent2));border-radius:3px 3px 0 0;opacity:.7;animation:barGrow 1s ease-out both}
.mc-bar:nth-child(2){animation-delay:.1s}.mc-bar:nth-child(3){animation-delay:.2s}.mc-bar:nth-child(4){animation-delay:.15s}.mc-bar:nth-child(5){animation-delay:.25s}.mc-bar:nth-child(6){animation-delay:.05s}.mc-bar:nth-child(7){animation-delay:.3s}.mc-bar:nth-child(8){animation-delay:.12s}.mc-bar:nth-child(9){animation-delay:.22s}.mc-bar:nth-child(10){animation-delay:.18s}
@keyframes barGrow{from{height:0;opacity:0}}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:.4rem;padding:.6rem 1.25rem;border-radius:var(--radius-sm);font-size:.9rem;font-weight:600;cursor:pointer;border:1px solid transparent;transition:all .15s;text-decoration:none}
.btn:hover{text-decoration:none;transform:translateY(-1px)}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:var(--accent2)}
.btn-ghost{background:transparent;color:var(--text2);border-color:var(--border)}
.btn-ghost:hover{color:var(--text);border-color:var(--text3)}
.btn-sm{padding:.4rem .85rem;font-size:.8rem}

/* Simulator */
.sim-section{max-width:1200px;margin:0 auto;padding:2rem 1.5rem 4rem}
.sim-layout{display:grid;grid-template-columns:300px 1fr;gap:2rem;align-items:start}
.sim-controls{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:1.5rem;position:sticky;top:80px;max-height:calc(100vh - 100px);overflow-y:auto}
.sim-controls h2{font-size:1.1rem;margin-bottom:1.25rem;padding-bottom:.75rem;border-bottom:1px solid var(--border)}
.control-group{margin-bottom:1rem}
.control-group label{display:block;font-size:.8rem;font-weight:600;color:var(--text2);margin-bottom:.3rem;text-transform:uppercase;letter-spacing:.04em}
.control-group input,.control-group select{width:100%;padding:.5rem .75rem;background:var(--bg3);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text);font-size:.9rem;font-family:var(--font)}
.control-group input:focus,.control-group select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg)}
.control-actions{display:flex;gap:.5rem;margin-top:1rem;flex-wrap:wrap}
.saved-configs{margin-top:1rem}
.saved-config-item{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:var(--bg3);border-radius:var(--radius-sm);margin-bottom:.4rem;font-size:.8rem}
.saved-config-item button{background:none;border:none;color:var(--text3);cursor:pointer;font-size:.75rem;padding:.2rem .4rem}
.saved-config-item button:hover{color:var(--red)}

/* Output */
.output-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;flex-wrap:wrap;gap:.75rem}
.output-header h2{font-size:1.1rem}
.output-stats{display:flex;gap:1.25rem;font-size:.85rem}
.stat{display:flex;align-items:center;gap:.35rem}
.stat-dot{width:8px;height:8px;border-radius:50%}
.stat.allowed .stat-dot{background:var(--green)}
.stat.rejected .stat-dot{background:var(--red)}
.timeline{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);min-height:300px;padding:1.5rem;position:relative;overflow:hidden}
.timeline-empty{display:flex;align-items:center;justify-content:center;height:250px;color:var(--text3);font-size:.9rem}
.timeline-row{display:flex;align-items:center;gap:4px;margin-bottom:6px;flex-wrap:wrap}
.tl-dot{width:14px;height:14px;border-radius:50%;cursor:pointer;transition:transform .1s;flex-shrink:0}
.tl-dot:hover{transform:scale(1.4)}
.tl-dot.allowed{background:var(--green);box-shadow:0 0 6px rgba(52,211,153,.4)}
.tl-dot.rejected{background:var(--red);box-shadow:0 0 6px rgba(248,113,113,.4)}
.tl-dot.window-boundary{width:2px;height:20px;border-radius:0;background:var(--text3);opacity:.4}
.tooltip{position:fixed;background:var(--bg3);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.5rem .75rem;font-size:.8rem;pointer-events:none;z-index:200;max-width:260px;box-shadow:0 8px 24px rgba(0,0,0,.3);display:none}
.tooltip.visible{display:block}
.output-legend{display:flex;gap:1.25rem;margin-top:.75rem;font-size:.8rem;color:var(--text2)}
.legend-item{display:flex;align-items:center;gap:.35rem}
.legend-dot{width:10px;height:10px;border-radius:50%}
.legend-dot.allowed{background:var(--green)}
.legend-dot.rejected{background:var(--red)}
.legend-line{width:16px;height:2px;background:var(--text3);opacity:.5}

/* Scenarios */
.scenarios-section{max-width:1200px;margin:0 auto;padding:2rem 1.5rem 4rem}
.scenarios-section h2{font-size:1.5rem;margin-bottom:.5rem}
.section-sub{color:var(--text2);margin-bottom:2rem}
.scenario-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1.25rem}
.scenario-card{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:1.25rem;display:flex;flex-direction:column;gap:.75rem}
.scenario-card h3{font-size:1rem;color:var(--text)}
.scenario-card p{font-size:.85rem;color:var(--text2);flex-grow:1}

/* Reference */
.reference-section{max-width:1200px;margin:0 auto;padding:2rem 1.5rem 4rem}
.reference-section h2{font-size:1.5rem;margin-bottom:1.5rem}
.ref-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.25rem;margin-bottom:2.5rem}
.ref-block{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:1.25rem}
.ref-block h3{font-size:.95rem;margin-bottom:.5rem;color:var(--accent2)}
.ref-block p{font-size:.85rem;color:var(--text2)}
.ref-table-wrap{overflow-x:auto}
.ref-table-wrap h3{font-size:1.1rem;margin-bottom:.75rem}
.ref-table{width:100%;border-collapse:collapse;font-size:.85rem}
.ref-table th,.ref-table td{padding:.65rem 1rem;text-align:left;border-bottom:1px solid var(--border)}
.ref-table th{background:var(--bg2);color:var(--text2);font-weight:600;font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}
.ref-table td{color:var(--text2)}
.ref-table tr:last-child td{border-bottom:none}
.ref-table tr:hover td{background:var(--bg2)}

/* Footer */
.site-footer{border-top:1px solid var(--border);margin-top:2rem}
.footer-inner{max-width:1200px;margin:0 auto;padding:2rem 1.5rem;text-align:center;font-size:.8rem;color:var(--text3)}
.footer-inner p{margin-bottom:.4rem}
.footer-meta{margin-top:.75rem;font-size:.75rem}

/* Responsive */
@media(max-width:900px){
  .hero{grid-template-columns:1fr;padding:2.5rem 1.25rem 2rem}
  .hero-visual{order:-1}
  .mini-chart{height:100px}
  .sim-layout{grid-template-columns:1fr}
  .sim-controls{position:static;max-height:none}
}
@media(max-width:600px){
  .header-inner{flex-direction:column;gap:.75rem;padding:.75rem 1rem}
  .site-nav{gap:1rem;flex-wrap:wrap;justify-content:center}
  .hero h1{font-size:1.5rem}
  .hero-sub{font-size:.95rem}
  .output-stats{flex-wrap:wrap;gap:.75rem}
  .scenario-grid,.ref-grid{grid-template-columns:1fr}
}

/* Scrollbar */
::-webkit-scrollbar{width:6px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}

/* Focus */
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:2px}

/* Selection */
::selection{background:var(--accent);color:#fff}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
