@font-face { font-family: "Lato"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 900; font-style: normal; font-display: swap; src: url("fonts/lato-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
html, body { margin: 0; }
td .btn, td.n .btn { font-family: var(--f-ui); }
#e-new { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.newbox { border: 1px dashed var(--accent); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--brand-soft); }
[hidden] { display: none !important; }
/* Layout: indigo brand band, then a single working column (max 1240px) with tabs; summary first, detail tables below. */
:root {
  --bg: #f5f4f9; --surface: #ffffff; --surface-2: #efedf5; --line: #dedae8; --line-strong: #c9c3d8;
  --ink: #1d1a27; --ink-2: #4f4962; --muted: #7d7790;
  --brand: #4b0082; --brand-ink: #ffffff; --brand-soft: #ece4f7; --accent: #4b0082; --link: #2044e0;
  --good: #0a7d36; --good-soft: #e3f4e8; --bad: #c3352b; --bad-soft: #fbe7e4; --warn: #9a6200; --warn-soft: #fbf0d9;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s-neg: #e34948; --s-other: #a8a3b5;
  --grid: #ebe8f1;
  --f-ui: "Lato", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121019; --surface: #1b1824; --surface-2: #24202f; --line: #332e40; --line-strong: #463f57;
    --ink: #eeebf5; --ink-2: #c3bdd2; --muted: #8f889f;
    --brand: #2a1747; --brand-ink: #f1ebfb; --brand-soft: #2e2440; --accent: #b79cf0; --link: #6db3f2;
    --good: #46c776; --good-soft: #17301f; --bad: #f2776b; --bad-soft: #3a1c1a; --warn: #e5ad4f; --warn-soft: #36290f;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s-neg: #e66767; --s-other: #6b6579;
    --grid: #2a2635;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121019; --surface: #1b1824; --surface-2: #24202f; --line: #332e40; --line-strong: #463f57;
  --ink: #eeebf5; --ink-2: #c3bdd2; --muted: #8f889f;
  --brand: #2a1747; --brand-ink: #f1ebfb; --brand-soft: #2e2440; --accent: #b79cf0; --link: #6db3f2;
  --good: #46c776; --good-soft: #17301f; --bad: #f2776b; --bad-soft: #3a1c1a; --warn: #e5ad4f; --warn-soft: #36290f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s-neg: #e66767; --s-other: #6b6579;
  --grid: #2a2635;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 14px; line-height: 1.45; }
.num, td.n, .mono { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
a { color: var(--link); }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* brand band */
.band { background: var(--brand); color: var(--brand-ink); padding-inline: 16px; }
.band-in { max-width: 1240px; margin: 0 auto; padding-block: 14px 0; display: flex; flex-direction: column; gap: 12px; }
.band-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
/* Loka Laboratories brand: Deep Indigo #4B0082, Orbit Blue #2044E0, Vermillion #E34234 (from the logo). */
.brand, .brand:visited { display: flex; align-items: center; gap: 12px; color: var(--brand-ink); text-decoration: none; }
.brand img { height: 44px; width: auto; display: block; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name b { font-size: 20px; font-weight: 900; letter-spacing: 0.01em; }
.brand-name small { font-size: 12.5px; opacity: 0.8; }
.band { border-top: 4px solid #e34234; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.12); font-size: 12px; white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: #c9c3d8; display: inline-block; }
.chip.ok i { background: #6ee7a0; } .chip.warn i { background: #f3c568; } .chip.err i { background: #ff8a80; }
.btn-band { background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.28); color: var(--brand-ink); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.btn-band:hover { background: rgba(255,255,255,0.26); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: transparent; border: 0; color: var(--brand-ink); opacity: 0.72; padding: 9px 14px 11px; font-weight: 700; font-size: 13.5px; cursor: pointer; border-radius: 8px 8px 0 0; white-space: nowrap; }
.tabs button[aria-selected="true"] { opacity: 1; background: var(--bg); color: var(--ink); }
.tabs button:hover { opacity: 1; }

/* page */
main { max-width: 1240px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 48px; display: flex; flex-direction: column; gap: 18px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--ink-2); font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,10,40,0.12); }
select.pick, input.field, select.field, textarea.field { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 10px; min-width: 0; }
select.pick { font-weight: 700; }
.ctl-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.panel h2 { font-size: 15px; font-weight: 900; }
.panel .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; margin-bottom: 12px; }
.headline { font-size: 22px; font-weight: 900; line-height: 1.25; max-width: 60ch; }
.headline em { font-style: normal; color: var(--accent); }
.note { color: var(--ink-2); font-size: 13px; max-width: 75ch; }
#view { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 18px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 178px), 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.kpi .v { font-size: 24px; font-weight: 900; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi .v.neg { color: var(--bad); }
.kpi .d { font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 1px; }
.delta { font-family: var(--f-num); font-size: 11.5px; font-weight: 500; }
.delta.up-good, .delta.down-good { color: var(--good); } .delta.up-bad, .delta.down-bad { color: var(--bad); } .delta.flat { color: var(--muted); }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
td.n, th.n { text-align: right; }
td.n { font-size: 12.5px; }
tr.sec td { background: var(--surface-2); font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
tr.bold td { font-weight: 700; }
tr.bold td.n { font-weight: 500; color: var(--ink); }
tr.em td { background: var(--brand-soft); }
tr.sub td:first-child { padding-left: 24px; color: var(--ink-2); }
tr.pct td.n { color: var(--ink-2); }
td.neg { color: var(--bad); }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 220px; white-space: normal; }
.matrix th:first-child { background: var(--surface-2); z-index: 2; }
.matrix tr.sec td:first-child { background: var(--surface-2); }
.matrix tr.em td:first-child { background: var(--brand-soft); }
.matrix th.cur, .matrix td.cur { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); margin-left: 6px; vertical-align: 1px; text-transform: none; letter-spacing: 0; }

/* alerts */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 9px 12px; border-radius: 6px; font-size: 13px; }
.alert b { font-weight: 700; }
.alert .ico { font-weight: 900; font-size: 11px; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.alert.warn { background: var(--warn-soft); } .alert.warn .ico { background: var(--warn); color: var(--surface); }
.alert.info { background: var(--surface-2); } .alert.info .ico { background: var(--ink-2); color: var(--surface); }
.alert.bad { background: var(--bad-soft); } .alert.bad .ico { background: var(--bad); color: var(--surface); }
.alert .where { color: var(--muted); font-size: 12px; }

/* charts */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--muted); font-family: var(--f-num); font-size: 10.5px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 7px 9px; border-radius: 6px; font-size: 12px; line-height: 1.4; white-space: nowrap; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.tip b { font-weight: 700; } .tip .r { display: flex; justify-content: space-between; gap: 14px; font-family: var(--f-num); }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* break-even */
.be { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-top: 10px; }
.be div { display: flex; flex-direction: column; gap: 2px; }
.be .v { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 12px; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--s1); border-radius: 999px; }

/* forms */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); min-width: 0; }
.form label.wide { grid-column: 1 / -1; }
.form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.btn { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn:disabled { opacity: 0.55; cursor: default; }
.status { font-size: 13px; color: var(--ink-2); }
.status.ok { color: var(--good); } .status.err { color: var(--bad); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* flow diagram */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; margin-top: 12px; }
.flow > div { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.flow b { font-size: 13px; } .flow span { font-size: 12px; color: var(--ink-2); } .flow em { font-style: normal; font-size: 11.5px; color: var(--accent); font-weight: 700; }

.empty { padding: 28px 18px; text-align: left; color: var(--ink-2); display: flex; flex-direction: column; gap: 10px; }
.empty h2 { font-size: 18px; }
.skel { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sh 1.4s infinite linear; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.small { font-size: 12px; color: var(--muted); }
.list { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); font-size: 13px; }
/* ---------- hosted hub additions ---------- */
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; overflow-x: hidden; }
.band-top .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs.areas button { font-size: 14.5px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 0 0; }
.subnav::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.subnav a { color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.subnav a.on { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgba(20,10,40,0.08); }
.subnav a:hover { color: var(--ink); }
.subnav .sep { width: 1px; background: var(--line); margin: 4px 4px; flex: none; }
.chip.sync { cursor: pointer; border: 0; color: var(--brand-ink); font: inherit; font-size: 12px; }
.chip.sync.saving i { background: #f3c568; } .chip.sync.ok i { background: #6ee7a0; } .chip.sync.warn i { background: #ff8a80; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1 1 180px; min-width: 0; }
.toolbar input.field, .toolbar select.field { min-width: 0; }
input.field, select.field, textarea.field { width: 100%; font-size: 15px; }
textarea.field { min-height: 70px; resize: vertical; }
.form .calc { font-family: var(--f-num); font-size: 13px; color: var(--ink); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 6px; padding: 7px 10px; min-height: 34px; white-space: normal; word-break: break-word; }
.form label .req { color: var(--bad); margin-left: 2px; }
.form label .help { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.form label.bad input, .form label.bad select { border-color: var(--bad); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td.chk-bad, span.chk-bad { color: var(--bad); font-weight: 700; }
td.chk-ok { color: var(--good); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.modal { position: fixed; inset: 0; background: rgba(15, 10, 30, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: var(--surface); color: var(--ink); border-radius: 10px; width: min(860px, 100%); padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,0.25); display: flex; flex-direction: column; gap: 10px; }
.modal-box h2 { font-size: 17px; font-weight: 900; }
.modal-box .x { margin-left: auto; }
.modal-head { display: flex; align-items: center; gap: 10px; }
.files { display: flex; flex-direction: column; gap: 6px; }
.files a { word-break: break-all; }
.diff del { color: var(--bad); text-decoration: line-through; } .diff ins { color: var(--good); text-decoration: none; }
.log-row td { white-space: normal; vertical-align: top; }
.log-row td:first-child { white-space: nowrap; }
.center-card { max-width: 460px; margin: 6vh auto 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.kbd { font-family: var(--f-num); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; word-break: break-all; }
.steps { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 13.5px; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 8px; font-size: 13px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.mono { font-family: var(--f-num); }
.cards { display: none; }
@media (max-width: 640px) {
  main { padding-block: 12px 40px; gap: 14px; }
  .headline { font-size: 18px; }
  .kpi .v { font-size: 20px; }
  .panel { padding: 12px; }
  .modal { padding: 0; }
  .modal-box { border-radius: 0; min-height: 100%; width: 100%; }
  .brand-name small { display: none; }
  .brand img { height: 38px; }
  /* entry lists become cards on phones */
  .tbl-wrap.cardable { display: none; }
  .cards { display: flex; flex-direction: column; gap: 8px; }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
  .card .t { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
  .card .m { color: var(--ink-2); font-size: 12.5px; }
}
@media print {
  .band, .toolbar, .actions, .subnav, #modal { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}
