/* Atlas docs theme — the Djana/Atlas UI (app.djana.ai/static/atlas.css) applied to internal reports.
   Palette is the product's: oxblood night #140A0C, panels #1E1013, raised #29161A, line #3D2128,
   Atlas Box red #8E1B24 (lit #B3303A), rose #E8A3AA, text #F6ECEC, muted #B89EA3,
   online #4FD18B, attention #F2A541, error #FFB4B8.
   Type: Inter (vendored, variable), SIL OFL 1.1 — docs/style/fonts/InterVariable.woff2. */

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #140A0C;
  --surface: #1E1013;
  --raised: #29161A;
  --line: #3D2128;
  --box: #8E1B24;
  --box-lit: #B3303A;
  --rose: #E8A3AA;
  --text: #F6ECEC;
  --muted: #B89EA3;
  --online: #4FD18B;
  --online-bg: #10291D;
  --attn: #F2A541;
  --attn-bg: #3A2610;
  --error: #FFB4B8;
  --error-bg: #3A1418;
  --error-line: #5A1E24;
  --display: "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: ui-monospace, Menlo, monospace;
}

/* Light mode: the same palette, daylight counterpart. Toggled by [data-theme="light"]
   on <html> (the nav's switch); the default follows the OS prefers-color-scheme. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #FBF7F6;
  --surface: #F3ECEA;
  --raised: #EBE1DF;
  --line: #D8C6C3;
  --box: #A62633;
  --box-lit: #B3303A;
  --rose: #8E1B24;
  --text: #2B1519;
  --muted: #7A5C60;
  --online: #1B8A4E;
  --online-bg: #DFF3E8;
  --attn: #B36A0A;
  --attn-bg: #FBF0DC;
  --error: #A61B28;
  --error-bg: #FCE8EA;
  --error-line: #D8939B;
}
[data-theme="light"] ::selection { background: rgba(166, 38, 51, .18); color: #2B1519; }
[data-theme="light"] ::-webkit-scrollbar-track { background: #F3ECEA; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #D8C6C3, #A62633); border-color: #F3ECEA; }
[data-theme="light"] code { color: #5A2228; }

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #5C0B11 var(--surface); }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--body); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #170D10; border-radius: 6px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #5C0B11, #8E1B24); border-radius: 6px; border: 2px solid #170D10; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #8E1B24, #B3303A); }
::-webkit-scrollbar-corner { background: #170D10; }
::selection { background: rgba(179, 48, 58, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

a { color: var(--rose); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 21px; margin: 44px 0 6px; padding-top: 14px; border-top: 3px solid var(--line); }
h2 .n { color: var(--box-lit); margin-right: 8px; font-variant-numeric: tabular-nums; }
h3 { font-size: 16px; margin: 26px 0 8px; }
p { margin: 8px 0 14px; max-width: 1000px; }
ul { margin: 6px 0 14px; padding-left: 22px; max-width: 980px; }
li { margin: 4px 0; }
.small { font-size: 12.5px; color: var(--muted); }
code { background: var(--raised); border-radius: 4px; padding: 1px 5px; font: 12.5px var(--mono); color: #F0D9DB; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 28px 80px; }

/* Page header: the Space-head treatment (deep oxblood band, rose type) */
header.hero { background: linear-gradient(135deg, #240608 0%, #3A0D12 45%, #5C0B11 100%);
  padding: 48px 28px 40px; border-bottom: 3px solid var(--box-lit); }
header.hero .wrap { padding: 0; max-width: 1180px; }
h1 { margin: 0 0 8px; }
.sub { color: #E8C3C7; font-size: 15.5px; max-width: 940px; }
.meta { margin-top: 14px; font-size: 13px; color: #C9A2A7; }
.tag { display: inline-block; background: rgba(232, 163, 170, .1); border: 1px solid rgba(232, 163, 170, .35);
  border-radius: 999px; padding: 3px 12px; font-size: 12px; margin: 10px 8px 0 0; color: var(--rose); }

/* Panels and grids (atlas .panel/.card: surface, 1px line, 12px radius) */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .cols, .cols3 { grid-template-columns: 1fr; } }
.card h3 { margin-top: 0; }

/* Tables: atlas table rhythm, rose uppercase display headers */
table { border-collapse: collapse; width: 100%; margin: 14px 0 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13.5px; }
th { background: #241418; text-align: left; padding: 9px 12px; font: 600 12px var(--display);
  text-transform: uppercase; letter-spacing: .05em; color: var(--rose); border-bottom: 1px solid var(--line); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #1B0F12; }

/* Status chips: atlas .chip.ok / .chip.attn / .error */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.c-strong { background: var(--online-bg); color: var(--online); }
.c-part { background: var(--attn-bg); color: var(--attn); }
.c-weak { background: #2B1519; color: #E8A3AA; }
.c-none { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-line); }
.c-na { background: var(--raised); color: var(--muted); }
.c-plan { background: rgba(179, 48, 58, .28); color: var(--rose); }

/* Callouts: notice/error tones from atlas.css */
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--box-lit);
  border-radius: 8px; padding: 14px 18px; margin: 16px 0; max-width: 1000px; }
.callout.warn { border-left-color: var(--attn); }
.callout.good { border-left-color: var(--online); }

/* Phase cards: the quiet button's raised surface with an inset Atlas-red spine */
.phase { border-left: 5px solid var(--box); background: var(--surface); border-radius: 0 10px 10px 0;
  padding: 14px 18px; margin: 16px 0; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.phase h3 { margin-top: 2px; }
.phase .when { color: var(--rose); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.phase.gate { border-left-color: var(--online); }

/* KPI row: atlas dash-stats */
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
@media (max-width: 800px) { .kpi { grid-template-columns: 1fr 1fr; } }
.kpi .card { text-align: center; padding: 16px 10px; }
.kpi .num { font-size: 24px; font-weight: 700; color: var(--box-lit); font-family: var(--display); }
.kpi .lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* Contents and legend */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin: 26px 0; columns: 2; column-gap: 44px; }
.toc a { display: block; padding: 3px 0; font-size: 14px; }
.toc a:hover { text-decoration: underline; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 12.5px; color: var(--muted); }

footer { margin-top: 56px; padding-top: 18px; border-top: 2px solid var(--line); color: var(--muted); font-size: 12.5px; }

/* ---- W17: the NDV editor shell (docked columns push, never overlay) ---- */
#editor-root {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 18rem;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
#editor-root.ndv-left-closed { grid-template-columns: 0 minmax(0, 1fr) 18rem; }
#ndv-left { min-width: 0; }
#ndv-right { min-width: 0; }
@media (max-width: 900px) {
  #editor-root,
  #editor-root.ndv-left-closed {
    grid-template-columns: 1fr;
  }
  #ndv-left { display: none; }
}
