:root {
  color-scheme: dark;
  --ink: #f5f7f8;
  --muted: #9aa4aa;
  --line: #253137;
  --panel: #101719;
  --panel-2: #151e21;
  --ground: #081012;
  --acid: #c5f55b;
  --cyan: #56d9e8;
  --warn: #f2bb66;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 80% 10%, #18302d 0, transparent 30rem), var(--ground); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 20; padding: .7rem 1rem; color: #061012; background: var(--acid); border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.preview-banner { padding: .55rem 1rem; color: #162000; background: var(--acid); text-align: center; font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 2.4rem; border-bottom: 1px solid var(--line); background: rgba(8,16,18,.88); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
.brand-lockup { display: flex; align-items: center; gap: .9rem; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; color: #071011; background: var(--acid); border-radius: 12px; font-weight: 900; letter-spacing: -.05em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.18rem; }
h2 { margin-bottom: .65rem; font-size: clamp(1.15rem, 2vw, 1.6rem); letter-spacing: -.02em; }
.eyebrow { margin-bottom: .3rem; color: var(--cyan); font-size: .7rem; font-weight: 800; letter-spacing: .14em; }
.environment-chip, .status-pill, .locked { display: inline-flex; align-items: center; gap: .45rem; padding: .46rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.environment-chip span { width: 8px; height: 8px; background: var(--warn); border-radius: 50%; box-shadow: 0 0 16px var(--warn); }
.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
.sidebar { padding: 2rem 1.2rem; border-right: 1px solid var(--line); min-height: calc(100vh - 112px); }
.nav-label { padding: 0 .7rem; color: #5f6d72; font-size: .66rem; font-weight: 800; letter-spacing: .14em; }
.sidebar nav { display: grid; gap: .35rem; }
.sidebar nav button { width: 100%; display: flex; align-items: center; gap: .8rem; padding: .75rem; border: 0; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.sidebar nav button:hover { color: var(--ink); background: var(--panel-2); }
.sidebar nav span { color: var(--cyan); font: 700 .68rem ui-monospace, monospace; }
.sidebar-note { margin-top: 2rem; padding: 1rem; border: 1px solid #33402b; border-radius: 12px; color: var(--acid); background: #121b13; }
.sidebar-note p { margin: .4rem 0 0; color: #acb99d; font-size: .78rem; line-height: 1.55; }
main { min-width: 0; padding: 2rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(21,30,33,.94), rgba(12,18,20,.96)); box-shadow: 0 18px 60px rgba(0,0,0,.18); }
.hero { display: flex; justify-content: space-between; gap: 2rem; padding: clamp(1.5rem, 4vw, 3rem); overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; width: 250px; height: 250px; right: -100px; bottom: -150px; border: 1px solid var(--cyan); border-radius: 50%; opacity: .22; }
.hero > div:first-child { max-width: 760px; }
.hero .lead { color: var(--muted); line-height: 1.7; margin-bottom: 0; }
.hero-metric { min-width: 170px; display: flex; flex-direction: column; justify-content: center; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.hero-metric span, .hero-metric small { color: var(--muted); font-size: .68rem; letter-spacing: .12em; }
.hero-metric strong { margin: .3rem 0; color: var(--warn); font-size: 1.8rem; }
.workflow-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin: 1rem 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.workflow-strip > div { display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; padding: 1rem; background: #0d1517; }
.workflow-strip span { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #3b4a4f; border-radius: 50%; color: var(--muted); font-size: .72rem; }
.workflow-strip strong { font-size: .82rem; }
.workflow-strip small { color: var(--muted); font-size: .68rem; }
.workflow-strip [data-active="true"] { background: #1a271e; }
.workflow-strip [data-active="true"] span { color: #0b1112; background: var(--acid); border-color: var(--acid); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr); gap: 1rem; }
.primary-card, .status-card { padding: 1.5rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.primary-card > p, .stage-card p { color: var(--muted); line-height: 1.65; }
.status-pill { color: var(--acid); border-color: #3a4a2d; }
.dropzone { display: grid; place-items: center; gap: .35rem; min-height: 190px; margin: 1.2rem 0; padding: 1.5rem; border: 1px dashed #536267; border-radius: 14px; color: var(--muted); cursor: pointer; text-align: center; background: rgba(4,10,11,.45); }
.dropzone:hover { border-color: var(--cyan); background: rgba(86,217,232,.04); }
.dropzone strong { color: var(--ink); }
.dropzone > span:last-of-type { font-size: .78rem; }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--acid); border: 1px solid #4e6230; border-radius: 50%; font-size: 1.3rem; }
.dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.file-meta, .runtime-list { margin: 0; }
.file-meta { display: grid; grid-template-columns: 2fr 1fr; gap: 1px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.file-meta div, .runtime-list div { padding: .8rem; background: #0d1416; }
.scope-field { grid-column: 1 / -1; }
.scope-field input { width: 100%; margin-top: .2rem; padding: .65rem .7rem; color: var(--ink); background: #111a1d; border: 1px solid #35444a; border-radius: 8px; }
.scope-field small { display: block; margin-top: .35rem; color: var(--muted); font-size: .7rem; }
dt { color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: .3rem 0 0; overflow-wrap: anywhere; font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.button { padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 750; }
.button.primary { color: #111800; background: var(--acid); border-color: var(--acid); }
.button.secondary { color: var(--ink); background: transparent; }
.button:disabled { color: #647075; background: #192124; border-color: #2b3539; cursor: not-allowed; }
.status-card { position: relative; overflow: hidden; }
.runtime-orbit { display: grid; place-items: center; height: 120px; }
.runtime-orbit::before, .runtime-orbit::after, .runtime-orbit span { content: ""; position: absolute; border-radius: 50%; }
.runtime-orbit::before { width: 88px; height: 88px; border: 1px solid #334449; }
.runtime-orbit::after { width: 60px; height: 60px; border: 1px dashed var(--cyan); }
.runtime-orbit span { width: 14px; height: 14px; background: var(--warn); box-shadow: 0 0 25px var(--warn); }
.runtime-list div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.runtime-list dd { margin: 0; font: .76rem ui-monospace, monospace; text-align: right; }
.offline { color: var(--warn); }
.online { color: var(--acid); }
.notice { margin-top: 1rem; padding: 1rem; border-left: 3px solid var(--cyan); background: #0b1719; }
.notice[data-kind="warning"] { border-color: var(--warn); background: #1b1710; }
.notice p { margin: .35rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.stage-card { display: grid; grid-template-columns: 70px 1fr auto; gap: 1.2rem; align-items: center; margin-top: 1rem; padding: 1.5rem; scroll-margin-top: 120px; }
.stage-index { color: #4e5b60; font: 700 1.8rem ui-monospace, monospace; }
.stage-card h2 { font-size: 1.05rem; }
.stage-card p { margin-bottom: .7rem; font-size: .87rem; }
.locked { align-self: start; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 2rem; color: #6f7b7f; border-top: 1px solid var(--line); font-size: .72rem; }
.stage-card-wide { align-items: start; }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin: 1rem 0; }
.editor-toolbar label, .editor-grid label, .approval-comment { display: grid; gap: .4rem; color: var(--muted); font-size: .72rem; font-weight: 700; }
.editor-toolbar select, .editor-grid select, .editor-fields input, .editor-fields textarea, .approval-comment input {
  width: 100%; padding: .68rem .75rem; color: var(--ink); background: #0b1315; border: 1px solid #35444a; border-radius: 8px;
}
.editor-toolbar select { min-width: 220px; }
.editor-grid { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 1.8fr); gap: 1rem; }
.editor-grid > label select { min-height: 20rem; }
.editor-fields { display: grid; gap: .8rem; }
.editor-fields textarea { min-height: 13rem; resize: vertical; font: .78rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.button.danger { color: #ffd9d2; border-color: #8c453b; background: #301713; }
.button.danger:disabled { color: #647075; background: #192124; border-color: #2b3539; }
.validation-summary { display: grid; grid-template-columns: minmax(180px, .5fr) minmax(0, 1.5fr); gap: 1px; margin: 1rem 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.validation-summary div { padding: .75rem; background: #0d1416; }
.validation-summary dd { white-space: pre-wrap; }
.approval-comment { max-width: 720px; margin-top: .8rem; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; padding: .8rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-note, .nav-label { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .workflow-strip { grid-template-columns: 1fr; }
  .workflow-strip > div { grid-template-columns: auto 1fr auto; }
  .editor-grid { grid-template-columns: 1fr; }
  .workflow-strip small { align-self: center; }
}
@media (max-width: 620px) {
  .topbar { padding: .8rem 1rem; }
  .environment-chip { display: none; }
  main { padding: 1rem; }
  .hero { flex-direction: column; }
  .hero-metric { padding: 1rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .stage-card { grid-template-columns: 45px 1fr; }
  .stage-card .locked { grid-column: 2; justify-self: start; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }