/* Raast simulator by Bridge — LIQUID app-console cadence. Token values copied from legr-design 0.4.2 (bridge-liquid/demo
   vendor/legr-design/web/tokens.css), the system the LIQUID staff and app consoles use; component rules follow its
   AppShell, Button, Badge, Table, Input and the staff pages (components/staff). Geist self-hosted (SIL OFL 1.1). */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  color-scheme: light;
  --rail: #f9f9f9; --canvas: #ffffff; --surface: #ffffff; --surface-2: #f5f5f5; --surface-3: #ececec; --popover: #ffffff;
  --hover: rgb(0 0 0 / 0.05); --press: rgb(0 0 0 / 0.08); --line: rgb(0 0 0 / 0.09); --line-strong: rgb(0 0 0 / 0.16); --overlay: rgb(23 24 26 / 0.32);
  --sheet-edge: rgb(0 0 0 / 0.08);
  --fg: #0d0d0d; --fg-2: #3a3a3a; --muted: #5e5e5e; --faint: #6e6e6e;
  --accent: #2c4695; --accent-hover: #233a7e; --accent-fg: #ffffff; --accent-soft: #e8ecf7; --accent-line: #bcc7e8;
  --positive: #2b7a4b; --positive-soft: #e3f1e8; --caution: #94600a; --caution-soft: #f8eed8; --negative: #b03a30; --negative-soft: #f9e6e3; --negative-fg: #ffffff; --info: #3d5a99; --info-soft: #e7ecf7;
  --shadow-2: 0 18px 48px -14px rgb(0 0 0 / 0.22), 0 4px 12px -4px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(0 0 0 / 0.07);
  --radius: 16px; --radius-md: 8px; --radius-lg: 11px; --radius-tile: 10px; --radius-sheet: 16px;
  --control-xs: 28px; --control-sm: 32px; --control-md: 36px; --control-radius: 9999px; --row-y: 12px; --panel-x: 20px;
  --text-meta: 12px; --lh-meta: 17px; --text-dense: 13px; --lh-dense: 19px; --text-body: 14px; --lh-body: 21px;
  --text-section: 16px; --lh-section: 23px; --text-page: 24px; --lh-page: 31px; --text-kpi: 26px; --lh-kpi: 33px;
  --w-medium: 470; --w-semibold: 530; --tracking-heading: -0.015em;
  --dur-instant: 110ms; --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* terminal: the LIQUID demo terminal palette (demo app/globals.css) */
  --t-bg: #0b0c0d; --t-fg: #d7dad6; --t-dim: #8a8f89; --t-line: #1c1f21;
  --t-a: #6cb6ff; --t-b: #c39bff; --t-c: #e6e1cf; --t-d: #56d4dd; --t-raast: #57d18c; --t-prism: #ffb454; --t-bad: #f47067;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --rail: #000000; --canvas: #0f0f0f; --surface: #171717; --surface-2: #1f1f1f; --surface-3: #2a2a2a; --popover: #212121;
  --hover: rgb(255 255 255 / 0.07); --press: rgb(255 255 255 / 0.11); --line: rgb(255 255 255 / 0.09); --line-strong: rgb(255 255 255 / 0.15); --overlay: rgb(0 0 0 / 0.55);
  --sheet-edge: rgb(255 255 255 / 0.08);
  --fg: #f4f4f4; --fg-2: #d4d4d4; --muted: #adadad; --faint: #949494;
  --accent: #93a9ee; --accent-hover: #aebff3; --accent-fg: #0c1330; --accent-soft: #1b2340; --accent-line: #2c3a6b;
  --positive: #63c08a; --positive-soft: #16291e; --caution: #e0ad52; --caution-soft: #2d2412; --negative: #ef8378; --negative-soft: #331b18; --negative-fg: #0f0f0f; --info: #93abe6; --info-soft: #1b2338;
  --shadow-2: 0 20px 56px -12px rgb(0 0 0 / 0.75), 0 4px 14px -4px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.09);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--rail); color: var(--fg); font: var(--text-body)/var(--lh-body) var(--font-sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }
h1, h2, h3 { margin: 0; font-weight: var(--w-semibold); letter-spacing: var(--tracking-heading); color: var(--fg); }
h1 { font-size: var(--text-page); line-height: var(--lh-page); }
h2 { font-size: var(--text-body); line-height: var(--lh-body); }
h3 { font-size: var(--text-dense); line-height: var(--lh-dense); }
strong { font-weight: var(--w-semibold); }
.boot { padding: 48px; color: var(--muted); }

.sim-banner { position: sticky; top: 0; z-index: 30; background: var(--caution-soft); color: var(--caution); padding: 6px 16px; font-size: var(--text-meta); line-height: var(--lh-meta); text-align: center; }
.sim-banner strong { font-weight: var(--w-semibold); }

/* AppShell: rail-coloured frame, the page as a sheet */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 29px); background: var(--rail); }
.rail { padding: 12px 10px; display: flex; flex-direction: column; gap: 1px; position: sticky; top: 29px; height: calc(100vh - 29px); overflow: auto; }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 14px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.wordmark { font-size: var(--text-section); line-height: var(--lh-section); font-weight: var(--w-semibold); letter-spacing: 0.06em; color: var(--fg); }
.brand-name { font-size: var(--text-dense); line-height: var(--lh-dense); font-weight: var(--w-medium); color: var(--fg-2); }
.brand-name small { display: block; color: var(--muted); font-weight: 400; font-size: var(--text-meta); line-height: var(--lh-meta); }
.tenant-pick { margin: 0 4px 8px; }
.tenant-pick select { width: 100%; }
.nav-label { font-size: var(--text-meta); line-height: var(--lh-meta); color: var(--muted); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: var(--control-sm); padding: 0 10px; border-radius: var(--radius-tile); color: var(--fg-2); font-size: var(--text-dense); line-height: var(--lh-dense); transition: background-color var(--dur-instant) var(--ease-out), color var(--dur-instant) var(--ease-out); }
.nav a:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--press); color: var(--fg); font-weight: var(--w-medium); }
.rail-foot { margin-top: auto; padding: 10px 10px 0; font-size: var(--text-meta); line-height: var(--lh-meta); color: var(--muted); display: grid; gap: 6px; }

.main { min-width: 0; padding: 28px 32px 64px; background: var(--canvas); border-top-left-radius: var(--radius-sheet); box-shadow: 0 0 0 0.5px var(--sheet-edge); min-height: calc(100vh - 29px); }
.main > * { max-width: 1152px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; font-size: var(--text-body); line-height: var(--lh-body); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* KPI strip: 1px gaps on the line colour, as on the staff pages */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; margin-bottom: 24px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpis > .card { border: 0; border-radius: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px var(--panel-x); min-width: 0; }
.card h2 { margin-bottom: 12px; }
.kpi { padding: 20px var(--panel-x); }
.kpi .v { margin-top: 6px; font-size: var(--text-kpi); line-height: var(--lh-kpi); font-weight: var(--w-semibold); letter-spacing: var(--tracking-heading); }
.kpi .l { color: var(--muted); font-size: var(--text-dense); line-height: var(--lh-dense); }
.kpi .small { margin-top: 4px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: var(--text-meta); line-height: var(--lh-meta); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: var(--text-dense); line-height: var(--lh-dense); color: var(--fg); }
th { text-align: left; font-weight: var(--w-medium); color: var(--muted); font-size: var(--text-meta); line-height: var(--lh-meta); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: var(--row-y) 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--hover); }
.table-wrap { overflow-x: auto; margin: 0 -8px; }

/* Badge */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--control-radius); border: 1px solid var(--line); font-size: var(--text-meta); line-height: var(--lh-meta); font-weight: var(--w-medium); white-space: nowrap; background: var(--surface-2); color: var(--fg-2); }
.pill.ok { background: var(--positive-soft); color: var(--positive); border-color: transparent; }
.pill.bad { background: var(--negative-soft); color: var(--negative); border-color: transparent; }
.pill.warn { background: var(--caution-soft); color: var(--caution); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* Button: pill, secondary by default, primary = ink */
button, .btn { font: inherit; font-size: var(--text-dense); line-height: 1; font-weight: var(--w-medium); height: var(--control-sm); padding: 0 12px; border-radius: var(--control-radius); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; background: transparent; color: var(--fg); border: 1px solid var(--line-strong); transition: background-color var(--dur-instant) var(--ease-out), opacity var(--dur-instant) var(--ease-out), transform var(--dur-instant) var(--ease-out); }
button:hover, .btn:hover { background: var(--hover); text-decoration: none; }
button:active, .btn:active { transform: scale(0.97); }
button.primary, .btn.primary { background: var(--fg); color: var(--canvas); border-color: transparent; }
button.primary:hover, .btn.primary:hover { background: var(--fg); opacity: 0.85; }
button.danger { background: var(--negative); color: var(--negative-fg); border-color: transparent; }
button.danger:hover { background: var(--negative); opacity: 0.9; }
button.ghost { border-color: transparent; color: var(--fg-2); }
button.ghost:hover { background: var(--hover); color: var(--fg); }
button:disabled { opacity: 0.45; pointer-events: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Input / Field */
input, select, textarea { font: inherit; font-size: var(--text-body); color: var(--fg); background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius-tile); height: var(--control-md); padding: 0 12px; min-width: 0; }
select { background: var(--surface); }
textarea { height: auto; padding: 8px 12px; }
label.f { display: grid; gap: 6px; font-size: var(--text-dense); line-height: var(--lh-dense); color: var(--fg-2); font-weight: var(--w-medium); }
form.stack { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 80px; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--fg-2); }
.bar.low > span { background: var(--caution); }
.bar.crit > span { background: var(--negative); }

.xml { background: var(--surface-2); border-radius: var(--radius-lg); padding: 12px 14px; overflow: auto; max-height: 520px; white-space: pre; font-size: 12px; line-height: 1.55; color: var(--fg-2); margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.split.msgs { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
table.nowrap td { white-space: nowrap; }
.sticky { position: sticky; top: 52px; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: var(--text-body); }
.card .empty { border: 0; }
.notice { background: var(--info-soft); color: var(--info); padding: 10px 14px; border-radius: var(--radius-lg); font-size: var(--text-dense); line-height: var(--lh-dense); }
.notice.warn { background: var(--caution-soft); color: var(--caution); }
.notice.bad { background: var(--negative-soft); color: var(--negative); }
.trail { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: var(--text-dense); }
.trail li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: var(--text-dense); line-height: var(--lh-dense); }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* terminal (same look as the LIQUID demo terminal) */
.term { background: var(--t-bg); color: var(--t-fg); border-radius: var(--radius); font-family: var(--font-mono); font-size: 12.5px; display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 420px; overflow: hidden; }
.term header, .term footer { display: flex; gap: 12px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--t-line); color: var(--t-dim); flex-wrap: wrap; font-size: 12px; }
.term footer { border-top: 1px solid var(--t-line); border-bottom: 0; font-size: 11.5px; }
.term header strong { color: var(--t-fg); font-weight: 600; }
.term header input { background: #000; border-color: var(--t-line); color: var(--t-fg); font-family: var(--font-mono); font-size: 12px; height: 28px; padding: 0 8px; border-radius: 6px; }
.term header button { background: #16191b; color: var(--t-fg); border-color: var(--t-line); height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.term .log { flex: 1; overflow: auto; padding: 8px 16px; }
.term .ln { display: grid; grid-template-columns: 74px 96px 20px 96px 1fr; gap: 8px; padding: 1px 0; white-space: nowrap; }
.term .ln > span:last-child { white-space: normal; overflow-wrap: anywhere; }
.term .ln .t { color: var(--t-dim); }
.term .ln.ev { color: var(--t-dim); }
.term .live { width: 8px; height: 8px; border-radius: 50%; background: var(--t-raast); display: inline-block; }
.term .live.off { background: var(--t-bad); }
.term pre { margin: 2px 0 6px 290px; background: rgb(0 0 0 / 0.4); border: 1px solid var(--t-line); border-radius: 6px; padding: 8px; color: #c9d1d9; font-size: 11.5px; max-height: 360px; overflow: auto; white-space: pre; }
.term .more { color: var(--t-dim); text-decoration: underline; cursor: pointer; background: none; border: 0; height: auto; padding: 0; font-size: 12px; border-radius: 0; }
.c-SIMAPKKA { color: var(--t-a); } .c-SIMBPKKA { color: var(--t-b); } .c-SIMCPKKA { color: var(--t-c); } .c-SIMDPKKA { color: var(--t-d); }
.c-RAAST { color: var(--t-raast); } .c-PRISM { color: var(--t-prism); } .c-bad { color: var(--t-bad); } .c-ok { color: var(--t-raast); }

/* modal (legr-card) */
.modal-bg { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade 160ms var(--ease-out); }
.modal { background: var(--popover); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 20px 24px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; animation: rise 200ms var(--ease-out); }
.modal h2 { margin-bottom: 12px; font-size: var(--text-section); line-height: var(--lh-section); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
@media (prefers-reduced-motion: reduce) { .modal-bg, .modal { animation: none; } button, .btn { transition: none; } }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--popover); color: var(--fg); box-shadow: var(--shadow-2); border-radius: var(--radius-lg); padding: 10px 16px; z-index: 60; font-size: var(--text-dense); }

/* signed-out page: app-console cadence (a quiet centred panel, not a marketing hero) */
.landing { grid-column: 1 / -1; width: 100%; max-width: 640px; margin: 0 auto; padding: 72px 24px; background: transparent; }
.landing h1 { font-size: var(--text-page); line-height: var(--lh-page); margin: 20px 0 8px; }
.landing .lead { font-size: var(--text-body); line-height: var(--lh-body); color: var(--muted); max-width: 60ch; margin: 0 0 16px; }
.landing .features { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.landing .features .card { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 14px var(--panel-x); }
.landing .features .card:last-child { border-bottom: 0; }
.landing .features .card h2 { margin: 0; }
.landing .features .card p { margin: 2px 0 0; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rail .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav-label { display: none; }
  .rail-foot { margin: 0; padding: 0 10px; }
  .main { padding: 16px; border-radius: 0; }
  .split, .g2, .g3 { grid-template-columns: 1fr; }
  .term .ln { grid-template-columns: 64px 84px 16px 84px 1fr; }
  .term pre { margin-left: 0; }
}
