/* leo.css - TrueGround Geospatial brand skin for the inlined LEO collision /
 * toy-lattice engine. Rebrand of the former engine demo.css:
 *   - every selector SCOPED under .leo-engine so it never restyles the shared
 *     Trueground chrome (header / footer / main / h1-h2 / .grid / .note / .card),
 *     which is the "first page to combine two stylesheets" trap.
 *   - fonts switched to the Trueground SYSTEM stack (Georgia serif head, system
 *     sans body, system mono) - NO Google Fonts, NO web-font CDN. script-src/
 *     style-src 'self' clean: this file is self-hosted, loaded as a stylesheet.
 *   - palette moved to Trueground tokens: copper #B46A2E / action #8A4D18 on
 *     slate/stone paper. The 16-band spectrum is kept verbatim: it is the demo's
 *     own content (the Dilithium cube palette the lattice points are coloured by),
 *     not chrome.
 * Contrast pairings for text-bearing colour are kept from the audited original.
 */

.leo-engine {
  /* ground - Trueground stone/sand paper + slate ink */
  --bg:#ffffff;            /* canvas + inputs stay white for 3D legibility */
  --panel:#E7EAEC;         /* stone-2 panels */
  --drop:#F2F4F5;          /* stone page */
  --rule:#C9D0D4;          /* sand hairline */
  --ink:#1A222B;
  --soft:#51606B;          /* muted */
  --faint:#6E7C87;         /* muted-2 */
  --navy:#16202A;          /* Trueground ink navy - active tab, range accent */
  --copper:#B46A2E;        /* verification accent */
  --copper-dark:#8A4D18;   /* action */

  /* the 16-band spectrum (demo content, verbatim from the Dilithium cube) */
  --s0:#FF0000; --s1:#FF4500; --s2:#FF6600; --s3:#FFD700;
  --s4:#FFFF00; --s5:#ADFF2F; --s6:#7FFF00; --s7:#00FF00;
  --s8:#00FF7F; --s9:#00FFFF; --s10:#00BFFF; --s11:#0000FF;
  --s12:#9400D3; --s13:#FF00FF; --s14:#FF1493; --s15:#FF69B4;

  /* text-safe variants (contrast-audited on paper) */
  --t-hazard:#C62828;   /* 5.9:1 */
  --t-ok:#1B6B3A;       /* 5.6:1 */
  --t-blue:#8A4D18;     /* copper action, used for focus/links */
  --t-violet:#9400D3;
  --t-magenta:#C2185B;
  --t-amber:#8A6D1F;

  --font-head: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* the instrument card itself */
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.56;
  border: 1px solid var(--rule);
  border-radius: var(--radius, 4px);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(18,39,63,.06), 0 8px 28px rgba(18,39,63,.08);
}

.leo-engine code,
.leo-engine .mono,
.leo-engine input,
.leo-engine .val { font-family: var(--font-mono); }

/* ---------- head ---------- */
.leo-engine .leo-head { border-bottom:1px solid var(--rule); background:var(--drop); padding:16px 22px 13px; }
.leo-engine .leo-title { font-family:var(--font-head); font-weight:600; font-size:21px;
  color:var(--navy); margin:0 0 3px; letter-spacing:-0.005em; line-height:1.18; }
.leo-engine .leo-sub { color:var(--soft); font-size:12.8px; margin:0; }
.leo-engine .leo-src { color:var(--faint); font-size:11.5px; margin:9px 0 0; max-width:94ch; }
.leo-engine .leo-src code { color:var(--soft); }

/* the spectrum rule - the demo's signature mark (content, kept verbatim) */
.leo-engine .spectrum { display:flex; height:3px; margin:12px 0 0; border-radius:2px; overflow:hidden; }
.leo-engine .spectrum i { flex:1; }

.leo-engine .tabs { display:flex; gap:7px; margin:13px 0 0; flex-wrap:wrap; }
.leo-engine .tabs button { font-family:var(--font-mono); font-size:11.4px; letter-spacing:0.05em;
  text-transform:uppercase; padding:7px 14px; cursor:pointer; background:var(--bg);
  color:var(--soft); border:1px solid var(--rule); border-radius:2px; }
.leo-engine .tabs button.on { background:var(--navy); color:#fff; border-color:var(--navy); }
.leo-engine .tabs button:hover:not(.on) { border-color:var(--copper-dark); color:var(--copper-dark); }

/* ---------- layout ---------- */
.leo-engine .leo-main { display:grid; grid-template-columns:minmax(0,1fr) 392px; align-items:start; }
@media (max-width:1040px){ .leo-engine .leo-main{ grid-template-columns:1fr; } }

.leo-engine .stage { padding:18px 20px; min-width:0; }
.leo-engine .canvaswrap { background:var(--bg); border:1px solid var(--rule); border-radius:3px;
  overflow:hidden; position:relative; }
.leo-engine canvas { display:block; width:100%; height:min(66vh,620px); touch-action:none; }
@media (max-width:1040px){ .leo-engine canvas{ height:min(56vh,440px); } }

.leo-engine .viewbar { display:flex; gap:6px; flex-wrap:wrap; margin:9px 0 0; align-items:center; }
.leo-engine .viewbar button { font-family:var(--font-mono); font-size:10.8px; padding:5px 11px;
  cursor:pointer; background:var(--bg); color:var(--ink); border:1px solid var(--rule); border-radius:2px; }
.leo-engine .viewbar button:hover { border-color:var(--copper-dark); }
.leo-engine .viewbar .hint { color:var(--faint); font-size:11.2px; margin-left:4px; }
.leo-engine .viewbar label { font-size:11.4px; color:var(--soft); display:flex; align-items:center; gap:5px; }

.leo-engine .side { border-left:1px solid var(--rule); background:var(--panel); padding:18px 20px; }
@media (max-width:1040px){ .leo-engine .side{ border-left:0; border-top:1px solid var(--rule); } }

.leo-engine h2 { font-family:var(--font-mono); font-size:10.6px; font-weight:600; letter-spacing:0.13em;
  text-transform:uppercase; color:var(--soft); margin:0 0 9px; padding-bottom:5px;
  border-bottom:1px solid var(--rule); }
.leo-engine h2.mt { margin-top:21px; }

.leo-engine .grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin:0 0 11px; }
.leo-engine .grid.two { grid-template-columns:repeat(2,1fr); }
.leo-engine .grid label { display:block; font-size:10.2px; color:var(--soft); margin:0 0 2px; }
.leo-engine input[type=number],
.leo-engine input[type=text] { width:100%; padding:5px 7px; font-size:12.2px;
  background:var(--bg); color:var(--ink); border:1px solid var(--rule); border-radius:2px; }
.leo-engine input[type=number]:focus { outline:none; border-color:var(--copper); }
.leo-engine input[type=range] { width:100%; accent-color:var(--copper-dark); }

.leo-engine .row { display:flex; justify-content:space-between; gap:10px; padding:3px 0; font-size:12px; }
.leo-engine .row span:first-child { color:var(--soft); flex:0 0 auto; }
.leo-engine .row .val { color:var(--ink); text-align:right; word-break:break-word; }

.leo-engine .decision { font-family:var(--font-mono); font-size:11.6px; font-weight:500;
  letter-spacing:0.03em; padding:9px 11px; border-radius:2px; margin:9px 0 4px; border:1px solid; }
.leo-engine .decision.bad { background:rgba(198,40,40,0.07); color:var(--t-hazard); border-color:rgba(198,40,40,0.34); }
.leo-engine .decision.good { background:rgba(27,107,58,0.07); color:var(--t-ok); border-color:rgba(27,107,58,0.3); }

.leo-engine .btns { display:flex; gap:6px; flex-wrap:wrap; margin:9px 0 13px; }
.leo-engine .btns button { font-family:var(--font-mono); font-size:10.8px; letter-spacing:0.03em;
  padding:6px 11px; cursor:pointer; background:var(--bg); color:var(--ink);
  border:1px solid var(--rule); border-radius:2px; }
.leo-engine .btns button:hover { border-color:var(--copper-dark); }

.leo-engine .note { font-size:11.6px; color:var(--soft); background:var(--drop);
  border-left:2px solid var(--copper); padding:9px 11px; margin:11px 0; line-height:1.48; }
.leo-engine .note b { color:var(--ink); }
.leo-engine .note.key { border-left-color:var(--copper-dark); }

.leo-engine .warn { display:none; }
.leo-engine .warn.show { display:block; font-size:11.6px; color:var(--t-hazard); line-height:1.48;
  background:rgba(198,40,40,0.06); border-left:2px solid var(--s0); padding:9px 11px; margin:9px 0; }

.leo-engine .hide { display:none !important; }

.leo-engine .leo-foot { border-top:1px solid var(--rule); padding:14px 22px; color:var(--faint);
  font-size:11.2px; background:var(--drop); }
.leo-engine .leo-foot code { color:var(--soft); }
