:root {
  /* Mobius-Lab · "drafting table at night": blueprint navy over the looping video, one hi-vis survey-orange accent,
     grotesk for the interface, a narrow mono for every number, serif italic for the display moments */
  --font-ui: "Schibsted Grotesk", "Segoe UI Variable", "Helvetica Neue", sans-serif;
  --font-num: "Martian Mono", "Cascadia Mono", "Consolas", monospace;
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --bg: #04122c; --canvas: rgba(3, 13, 34, .52); --panel: rgba(6, 22, 52, .82); --panel2: rgba(12, 34, 74, .76); --solid: #0a1d42;
  --line: rgba(130, 170, 255, .12); --line2: rgba(130, 170, 255, .24); --text: #eaf0ff; --muted: #8fa0c4;
  --accent: #ff7a2e; --accent2: #ff9a5c; --on-accent: #1b0a00; --ink: #6fb2ff;
  --green: #2fe0a0; --red: #ff6170; --amber: #ffc24a; --hover: rgba(130, 170, 255, .11);
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 14px 36px rgba(0,6,24,.6);
  --radius: 12px; --radius-sm: 8px; --radius-pill: 7px; --h-header: 62px; --h-tape: 0px; --w-right: 330px; --w-left: 320px;
  --grid-line: rgba(160,190,255,.07); --open: #4fb3ff; --box: #ff6170; --pipe: #b38cff;
  --bp-minor: rgba(120, 165, 255, .045); --bp-major: rgba(120, 165, 255, .09);
  --overlay: radial-gradient(120% 90% at 50% 0%, rgba(4, 20, 52, .55) 0%, rgba(2, 9, 26, .9) 100%);
  --brand: #e8f0ff; --blur: blur(12px);
}
body.light {
  /* drafting paper: warm sheet, blue ink, the same orange as the marker */
  --bg: #f4f1e8; --canvas: rgba(255, 253, 246, .62); --panel: rgba(255, 253, 247, .88); --panel2: rgba(241, 237, 226, .9); --solid: #fffdf7;
  --line: rgba(20, 44, 96, .10); --line2: rgba(20, 44, 96, .2); --text: #0e2147; --muted: #5d6680; --hover: rgba(20, 60, 160, .07);
  --accent: #e0560f; --accent2: #c4470a; --on-accent: #fff; --ink: #1d4fb8;
  --green: #0a8f5a; --red: #d43d45; --amber: #b26a00;
  --shadow: 0 1px 2px rgba(40,30,10,.06), 0 10px 30px rgba(40,30,10,.08); --grid-line: rgba(20,44,96,.07); --open: #1d63e0; --box: #d43d45; --pipe: #7c4dff;
  --bp-minor: rgba(29, 79, 184, .05); --bp-major: rgba(29, 79, 184, .1);
  --overlay: radial-gradient(120% 90% at 50% 0%, rgba(250, 248, 240, .82) 0%, rgba(240, 236, 224, .94) 100%); --brand: #0e2a66;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased; letter-spacing: -0.05px; overflow: hidden; }
.bgvid { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bgvid video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* blueprint sheet: 24 px minor grid, 120 px major grid, over the video and under the vignette */
.bgvid::after { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--bp-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, var(--bp-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(var(--bp-minor) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--bp-minor) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--overlay); }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.pos { color: var(--green); } .neg { color: var(--red); } .amb { color: var(--amber); } .muted { color: var(--muted); }
.mono { font-family: var(--font-num); font-stretch: 80%; font-variant-numeric: tabular-nums; }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* one orchestrated entrance: header drops in, then the page's blocks rise in sequence (also on every page switch) */
@keyframes ml-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ml-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes ml-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
header { animation: ml-drop .5s cubic-bezier(.2, .7, .2, 1) both; }
.view.active .chart-top, .view.active .ind-bar, .view.active .work, .view.active .split-h, .view.active .bottom,
.view.active .hero > *, .view.active .cards > *, .view.active .two > *, .view.active .folders > *, .view.active .rise { animation: ml-rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.view.active .ind-bar { animation-delay: .06s; } .view.active .work { animation-delay: .12s; } .view.active .split-h, .view.active .bottom { animation-delay: .18s; }
.view.active .hero > :nth-child(2) { animation-delay: .07s; } .view.active .hero > :nth-child(3) { animation-delay: .14s; }
.view.active .cards > :nth-child(1) { animation-delay: .2s; } .view.active .cards > :nth-child(2) { animation-delay: .27s; } .view.active .cards > :nth-child(3) { animation-delay: .34s; }
.view.active .two > :nth-child(1) { animation-delay: .4s; } .view.active .two > :nth-child(2) { animation-delay: .46s; }
.view.active .folders > :nth-child(2) { animation-delay: .06s; } .view.active .folders > :nth-child(3) { animation-delay: .12s; } .view.active .folders > :nth-child(4) { animation-delay: .18s; } .view.active .folders > :nth-child(n+5) { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* header */
header { height: var(--h-header); display: flex; align-items: center; gap: 18px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); position: relative; z-index: 50; }
.logo { display: flex; align-items: center; gap: 10px; user-select: none; cursor: pointer; white-space: nowrap; }
.logo .mark { position: relative; display: inline-flex; }
.logo img { height: 36px; width: auto; opacity: 0; transition: opacity .2s; }
.logo-anim { position: absolute; pointer-events: none; z-index: 60; }
.logo img.cut { opacity: 1; filter: drop-shadow(0 0 10px rgba(61, 139, 255, .35)); }
.wordmark { font-family: "Michroma", "Eurostile", "Segoe UI", sans-serif; font-size: 17px; letter-spacing: 1.5px; color: var(--brand); font-weight: 400; }
.wordmark .dash { color: var(--accent); }
.proj { position: relative; }
.projbtn { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius-pill); color: var(--text); padding: 8px 14px; font-size: 13px; font-weight: 600; }
.projbtn:hover { border-color: var(--accent); }
.projbtn #projLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projbtn .cnt { font-family: var(--font-num); font-stretch: 80%; font-size: 10px; font-weight: 600; color: var(--muted); background: var(--hover); border-radius: var(--radius-pill); padding: 1px 7px; }
.projbtn svg { flex: none; opacity: .7; }
.proj-dd { position: absolute; top: calc(100% + 8px); left: 0; width: 360px; max-height: calc(100vh - 110px); overflow-y: auto; max-width: calc(100vw - 32px); background: var(--solid); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: none; z-index: 300; }
.proj-dd.open { display: block; }
.dd-title { font-family: var(--font-num); font-stretch: 85%; font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 6px 8px 8px; }
.dd-row { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm); }
.dd-row:hover, .dd-row.on { background: var(--hover); }
.dd-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text); padding: 9px 10px; font-size: 13px; text-align: left; }
.dd-pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dd-pick small { color: var(--muted); font-size: 11px; }
.dd-row.on .dd-pick svg { color: var(--accent); }
.dd-ic { background: none; border: 0; color: var(--muted); padding: 6px 8px; border-radius: 8px; font-size: 12px; }
.dd-ic:hover { color: var(--text); background: var(--hover); }
.dd-runs { display: grid; gap: 1px; margin: 0 0 6px 30px; padding-left: 8px; border-left: 1px solid var(--line); }
.dd-run { display: flex; align-items: center; gap: 8px; min-width: 0; background: none; border: 0; color: var(--text); padding: 6px 8px; border-radius: 8px; font-size: 12px; text-align: left; }
.dd-run:hover { background: var(--hover); }
.dd-run i { flex: none; font-style: normal; font-family: var(--font-num); font-stretch: 80%; font-size: 9.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); min-width: 58px; }
.dd-run span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-run small { flex: none; color: var(--muted); font-family: var(--font-num); font-stretch: 80%; font-size: 10px; }
.dd-run.more span { color: var(--accent); }
.dd-new { display: flex; gap: 6px; padding: 10px 6px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.dd-new .hint { margin: 0; }
nav { display: flex; gap: 4px; }
nav a { position: relative; padding: 8px 14px; border-radius: var(--radius-pill); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; cursor: pointer; transition: color .12s, background .12s; white-space: nowrap; }
nav a:hover, nav a.active { color: var(--text); background: var(--hover); }
nav a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); transform-origin: left; animation: ml-draw .35s cubic-bezier(.2, .7, .2, 1) both; }
.spacer { flex: 1; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 11px; border-radius: var(--radius-pill); background: var(--panel2); border: 0; color: var(--muted); }
.iconbtn:hover { color: var(--text); }
.auth { position: relative; display: flex; align-items: center; gap: 8px; }
.authbtn { display: inline-flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius-pill); color: var(--text); padding: 7px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.authbtn:hover { background: var(--hover); }
.authbtn:focus-visible, .dd-out:focus-visible { outline: 2px solid var(--line2); outline-offset: 2px; }
.authbtn.me { padding: 4px 12px 4px 4px; }
.authbtn.me img, .authbtn.me .initial { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.authbtn.me .initial { display: inline-flex; align-items: center; justify-content: center; background: var(--hover); font-size: 12px; }
.auth-err { position: absolute; top: calc(100% + 8px); right: 0; width: 280px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 10px; font-size: 11.5px; color: var(--red); z-index: 300; }
.auth-dd { position: absolute; top: calc(100% + 8px); right: 0; width: 240px; max-width: calc(100vw - 32px); background: var(--solid); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; z-index: 300; }
.auth-dd .who { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.auth-dd .who b { font-size: 13px; } .auth-dd .who small { color: var(--muted); font-size: 11.5px; }
.dd-out { width: 100%; margin-top: 6px; text-align: left; background: none; border: 0; color: var(--text); padding: 8px; border-radius: 8px; font-size: 13px; }
.dd-out:hover { background: var(--hover); }

/* project folders page */
.folders { display: grid; gap: 14px; }
.folder { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.folder.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.folder-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.fname { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.fname .slot { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--hover); border-radius: var(--radius-pill); padding: 2px 8px; }
.fact { display: flex; gap: 6px; flex-wrap: wrap; }
.folder.empty .folder-head { border-bottom: 0; }
.folder.empty .fname { color: var(--muted); font-weight: 600; }
.folder-new { display: flex; gap: 8px; padding: 0 18px 16px; max-width: 460px; }

/* layout */
.view { display: none; } .view.active { display: block; }
.grid { height: calc(100vh - var(--h-header) - var(--h-tape)); display: grid; grid-template-columns: 1fr var(--w-right); }
.grid.solo { grid-template-columns: 1fr; }
.center { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.right { border-left: 1px solid var(--line); background: var(--panel2); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.sec-title { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 500; padding: 18px 18px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chart-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.sym-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sym-head .s { font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
.sym-head .n { color: var(--muted); font-size: 12px; }
.sym-head .p { font-size: 26px; font-weight: 600; margin-left: 6px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.sym-head .c { font-size: 13px; font-weight: 600; }
.ohlc { display: flex; gap: 14px; color: var(--muted); font-size: 11px; flex-wrap: wrap; } .ohlc b { color: var(--text); font-weight: 600; }
.ind-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 7px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ind-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-right: 2px; }
.chip { background: var(--panel2); border: 1px solid var(--line); color: var(--muted); border-radius: var(--radius-pill); padding: 4px 12px; font-size: 11px; font-weight: 600; transition: .12s; }
.chip:hover { color: var(--text); border-color: var(--line2); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn { background: var(--text); color: var(--bg); border: 0; border-radius: var(--radius-pill); padding: 9px 18px; font-weight: 600; font-size: 12.5px; transition: opacity .12s, transform .06s; white-space: nowrap; }
.btn:hover { opacity: .88; } .btn:active { transform: scale(.98); }
.btn.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); } .btn.ghost:hover { background: var(--hover); opacity: 1; }
.btn.sm { padding: 5px 12px; font-size: 11px; }
.btn.accent { background: var(--accent); color: #fff; }
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--w-left) 1fr; }
.inputs { border-right: 1px solid var(--line); overflow-y: auto; padding: 4px 16px 24px; background: var(--panel); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.canvas { position: relative; min-height: 0; min-width: 0; overflow: hidden; background: var(--canvas); }
.canvas > svg { width: 100%; height: 100%; display: block; }
.canvas .empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; text-align: center; padding: 24px; }
.canvas .legend { position: absolute; left: 14px; top: 12px; display: flex; gap: 12px; font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 5px 12px; border-radius: var(--radius-pill); }
.canvas .legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.bottom { height: 260px; flex: none; border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.bottom .tabs { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.bottom .tbl-wrap { flex: 1; overflow: auto; }
.split-h { flex: none; height: 9px; margin: -4px 0 -5px; position: relative; z-index: 5; cursor: row-resize; touch-action: none; display: flex; align-items: center; justify-content: center; }
.split-h i { width: 44px; height: 4px; border-radius: 3px; background: var(--line2); transition: background .15s, width .15s; }
.split-h:hover i, .split-h:focus-visible i, .split-h.drag i { background: var(--accent); width: 64px; }
.split-h:focus-visible { outline: none; }
body.resizing, body.resizing * { cursor: row-resize !important; user-select: none !important; }

/* forms */
.fgroup { margin-top: 14px; }
.fgroup > h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.frow { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; color: var(--muted); }
.frow.wide { grid-template-columns: 1fr; }
.frow label { line-height: 1.25; }
.frow small { display: block; font-size: 10px; opacity: .8; }
input.f, select.f, textarea.f { width: 100%; background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; color: var(--text); padding: 6px 9px; font-size: 12px; outline: none; font-variant-numeric: tabular-nums; }
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--accent); }
select.f option { background: #0b1f45; color: #eef3ff; } body.light select.f option { background: #fff; color: #0b1b3d; }
.drop { border: 1.5px dashed var(--line2); border-radius: var(--radius-sm); padding: 16px 12px; text-align: center; font-size: 12px; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--hover); color: var(--text); }
.drop b { color: var(--text); }
.station-out { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 4px; padding: 8px 10px; border-radius: 9px; background: var(--hover); font-size: 12px; }
.station-out span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.station-out b { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 6px 0; }
.err-box { background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; white-space: pre-wrap; margin: 10px 0; }

/* tables */
table.t { width: 100%; border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; }
table.t th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 10px; letter-spacing: .4px; text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; z-index: 1; }
table.t td { padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.t th:first-child, table.t td:first-child, table.t .l { text-align: left; }
table.t tr:hover td { background: var(--hover); }
table.t td.wrap { white-space: normal; min-width: 260px; text-align: left; color: var(--muted); }
table.edit td { padding: 2px 4px; } table.edit input.f, table.edit select.f { padding: 4px 6px; border-radius: 6px; min-width: 56px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 700; letter-spacing: .3px; }
.tag.ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tag.bad { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.tag.adv { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.tag.idle { background: var(--hover); color: var(--muted); }

/* right rail */
.kpi { padding: 4px 18px 14px; }
.kpi .big { font-size: 46px; font-weight: 600; letter-spacing: -1.6px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { border-radius: var(--radius-pill); padding: 4px 12px; font-size: 11px; font-weight: 700; }
.pill.ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.pill.bad { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.pill.adv { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.pill.idle { background: var(--hover); color: var(--muted); }
.kpi .sub { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.kv { padding: 0 18px; }
.kv .r { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kv .r span:first-child { color: var(--muted); } .kv .r b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.flags { padding: 0 12px 18px; display: flex; flex-direction: column; gap: 6px; }
.flag { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 11.5px; line-height: 1.45; }
.flag b { font-weight: 700; margin-right: 6px; }
.flag.w { border-left: 3px solid var(--amber); } .flag.e { border-left: 3px solid var(--red); } .flag.i { border-left: 3px solid var(--accent); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 46px; margin: 10px 0 2px; }
.spark i { flex: 1; background: var(--green); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.spark i.n { background: var(--red); }

/* overview */
.home { height: calc(100vh - var(--h-header) - var(--h-tape)); overflow-y: auto; }
.home-in { max-width: 1180px; margin: 0 auto; padding: 34px 24px 60px; }
.hero h1 { font-size: 40px; letter-spacing: -1.4px; line-height: 1.1; margin: 0 0 10px; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero p { color: var(--muted); max-width: 640px; margin: 0 0 22px; font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; cursor: pointer; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.card:hover { border-color: var(--line2); transform: translateY(-2px); }
.card .code { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.card h3 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.card .glyph { height: 70px; border-radius: 12px; background: var(--panel2); overflow: hidden; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.panel .sec-title { padding: 16px 18px 8px; }
.steps { padding: 0 18px 16px; margin: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 8px 0 8px 34px; position: relative; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--panel2); color: var(--text); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps li b { color: var(--text); }
.empty-row { padding: 18px; color: var(--muted); font-size: 12.5px; }

/* toast */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600; opacity: 0; transition: .2s; z-index: 500; pointer-events: none; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* svg chart text */
.ax { stroke: var(--line2); } .gridl { stroke: var(--grid-line); }
.axt { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.lbl { fill: var(--text); font-family: inherit; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.lbl.m { fill: var(--muted); }

/* ---------------------------------------------------------------- design layer: type, accent and drafting details */
/* kicker labels, column heads and readouts: the narrow mono */
.sec-title, .ind-lbl, .fgroup > h4, .card .code, .fname .slot, .station-out span, .ohlc, table.t th, .tag, .pill, .canvas .legend, .kv .r b, .split-h + .bottom .ind-lbl {
  font-family: var(--font-num); font-stretch: 82%; }
.sec-title, .ind-lbl, .fgroup > h4 { font-size: 9.5px; font-weight: 600; letter-spacing: .9px; }
.fgroup > h4 { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.fgroup > h4::before { content: ""; width: 10px; height: 2px; border-radius: 1px; background: var(--accent); flex: none; }
.ohlc { font-size: 10.5px; gap: 6px 16px; letter-spacing: .2px; } .ohlc b { font-weight: 600; color: var(--text); }
.ohlc span { white-space: nowrap; }
/* page titles read like a drawing's sheet code */
.sym-head .s { font-family: var(--font-num); font-stretch: 90%; font-size: 16px; font-weight: 700; letter-spacing: .4px; }
.sym-head .n { font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--muted); letter-spacing: 0; }
/* primary action in survey orange, secondary stays quiet */
.btn { background: var(--accent); color: var(--on-accent); font-weight: 700; letter-spacing: .1px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 6px 18px -8px var(--accent); }
.btn:hover { opacity: 1; background: var(--accent2); }
.btn.ghost { box-shadow: none; font-weight: 600; }
.btn.ghost:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.chip { font-weight: 600; letter-spacing: .1px; }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.projbtn:hover, .authbtn:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
/* inputs: numbers in the mono so columns of values line up */
input.f[type="number"], .station-out b, table.t td, .kv .r b { font-family: var(--font-num); font-stretch: 78%; }
input.f[type="number"] { font-size: 11.5px; }
input.f, select.f, textarea.f { border-radius: 7px; }
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
select.f option { background: var(--solid); color: var(--text); }
.station-out { border-left: 2px solid var(--accent); border-radius: 0 7px 7px 0; }
/* schedules: instrument readout */
table.t { font-size: 11px; }
table.t th { font-size: 9px; font-weight: 600; letter-spacing: .7px; background: var(--solid); }
table.t td.wrap, table.t td.l, table.t td.muted, table.t td:first-child { font-family: var(--font-ui); font-stretch: normal; font-size: 11.5px; }
table.t tr:hover td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tag, .pill { font-size: 9.5px; font-weight: 600; letter-spacing: .5px; border-radius: 4px; }
/* drawing labels on the plans and sections */
.lbl, .axt { font-family: var(--font-num); font-stretch: 75%; }
.canvas .legend { font-size: 10px; letter-spacing: .2px; }
/* overview */
.hero h1 { font-size: 54px; font-weight: 800; letter-spacing: -2px; line-height: 1.02; max-width: 900px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 15.5px; text-wrap: pretty; }
.card { position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.card:hover::before { transform: scaleX(1); }
.card:hover { border-color: var(--line2); }
.card .code { font-size: 9.5px; font-weight: 600; letter-spacing: 1px; color: var(--accent); }
.card h3 { font-family: var(--font-display); font-weight: 400; font-size: 28px; letter-spacing: -.2px; line-height: 1.05; }
.steps li::before { background: var(--accent); color: var(--on-accent); font-family: var(--font-num); font-stretch: 85%; font-size: 10px; border-radius: 5px; }
/* projects */
.fname { font-family: var(--font-display); font-weight: 400; font-size: 24px; letter-spacing: -.2px; }
.fname .slot { font-size: 9px; letter-spacing: .9px; border-radius: 4px; }
.folder.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.toast { font-weight: 600; border-radius: 8px; }
.toast::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); margin-right: 9px; vertical-align: 1px; }

/* terms of use: "I agree" dialog and the copyright line */
.terms-ov { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 8, 22, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: ml-rise .25s ease both; }
.terms-box { width: 100%; max-width: 460px; background: var(--solid); border: 1px solid var(--line2); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.terms-box h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.2px; }
.terms-box p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.terms-box a { color: var(--accent); }
.terms-ck { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--hover); }
.terms-ck input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.terms-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.terms-act .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.legal { margin: 34px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 6px 14px; flex-wrap: wrap; }
.legal a { color: var(--muted); } .legal a:hover { color: var(--accent); }

/* sewer Pipes table: designer's gradient / IL adjustments */
table.t th.ovr-h { color: var(--accent); }
table.t.keepcase th { text-transform: none; letter-spacing: .2px; }
.btn.ghost.dirty { border-color: var(--accent); color: var(--accent); }
table.t td.ovr-cell { padding: 2px 4px; background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.t td.ovr-cell.set { background: color-mix(in srgb, var(--accent) 14%, transparent); }
select.f.ovr { width: 128px; padding: 3px 4px; font-size: 11px; border-radius: 5px; }
select.f.ovr.dia { width: 60px; padding: 3px 2px; }
input.f.ovr[data-ovr="X"] { width: 52px; padding: 3px 4px; }
input.f.ovr[data-ovr="il_us"] { width: 66px; padding: 3px 3px; }
select.f.ovr.dflt { color: var(--muted); }
select.f.ovr option { color: var(--text); }
input.f.ovr { width: 82px; padding: 3px 6px; font-size: 11px; text-align: right; border-radius: 5px; }
input.f.ovr::placeholder { color: var(--muted); opacity: .55; }
table.t td.adjv { color: var(--accent); font-weight: 600; }
.ovr-bar { position: sticky; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 12px; font-size: 11.5px; color: var(--accent); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 7%, var(--solid)); }

@media (max-width: 1100px) {
  :root { --w-right: 290px; --w-left: 290px; }
  .projbtn { max-width: 200px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  header { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  nav { order: 3; width: 100%; overflow-x: auto; }
  .authbtn > span:last-child { display: none; } .authbtn { padding: 8px 10px; } .authbtn.me { padding: 3px; }
  header .spacer { display: none; } .proj { flex: 1; min-width: 0; } .projbtn { max-width: 100%; } .wordmark { font-size: 14px; } .proj-dd { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
  .grid, .home { height: auto; display: block; }
  .work { display: block; }
  .inputs { border-right: 0; border-bottom: 1px solid var(--line); }
  .canvas { height: 380px; }
  .split-h { display: none; } .bottom { height: auto !important; }
  .right { border-left: 0; border-top: 1px solid var(--line); }
  .cards, .two { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .home-in { padding: 24px 16px 40px; }
}

@media (max-width: 480px) {
  .wordmark { display: none; }
  .hero h1 { font-size: 34px; letter-spacing: -1.2px; }
}

@media print {
  body { overflow: visible; background: #fff; color: #000; }
  header, .bgvid, .no-print { display: none !important; }
}
table.t tr.sel td { background: color-mix(in srgb, var(--accent, var(--pipe)) 12%, transparent); }
