/* AI server UI. US brand (EDN-01, 2026-11-27): Command Navy #182736, Brand Slate #2F3D46, Signal Steel links and focus;
   Unassailable Red #753531 only for small marks, never a fill. No JavaScript anywhere. */
:root {
  /* PCRM guided-UI tokens (UI-GUIDE section 15.1), the same values as PCRM Settings > Theme Style > Brand */
  --brand-slate: #2F3D46;
  --brand-600: #182736;
  --brand-700: #2c3b4b;
  --brand-50: #e6edf4;
  --primary: var(--brand-600);
  --primary-hover: var(--brand-700);
  --accent-2: #236c8a;
  --mark: #753531;
  --on-band: #76bcdd;
  --slate: var(--brand-slate);
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-muted: #f3f4f6;
  --text: #374151;
  --heading: var(--brand-slate);
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #868d98;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #8a5a00;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --radius: .23em;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --surface: #1f2937;
    --surface-muted: #182231;
    --text: #e5e7eb;
    --heading: #f3f4f6;
    --muted: #9ca3af;
    --line: #374151;
    --line-strong: #6b7280;
    --ok: #86efac;
    --ok-soft: #12261b;
    --warn: #e0b45c;
    --bad: #fca5a5;
    --bad-soft: #2a1717;
    --brand-600: #447098;
    --brand-700: #5582ab;
    --brand-50: #16212c;
    --accent-2: #76bcdd;
    --mark: #cf7156;
  }
  .docpreview { color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; text-decoration-color: var(--accent-2); text-underline-offset: 2px; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; }
pre { background: var(--surface); border: 1px solid var(--line); padding: 12px; overflow: auto; max-height: 480px; border-radius: var(--radius); }

.topbar {
  background: var(--slate); color: #fff; display: flex; align-items: center; gap: 24px;
  padding: 10px 24px; flex-wrap: wrap;
}
.brand img { display: block; height: 44px; width: auto; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.mainnav a, .who a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: var(--radius); }
.mainnav a:hover, .who a:hover { background: rgba(255,255,255,.1); }
.mainnav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--on-band); }
.who { display: flex; align-items: center; gap: 8px; }
.who form { margin: 0; }
button.link { background: none; border: 0; color: #fff; padding: 6px 10px; cursor: pointer; font: inherit; text-decoration: underline; }

main { flex: 1; width: 100%; margin: 0 auto; padding: 32px 16px; }
main.narrow { max-width: 480px; }
main.wide { max-width: 1200px; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 16px; }

h1 { font-size: 1.6rem; margin: 0 0 12px; color: var(--heading); }
h2 { font-size: 1.15rem; margin: 28px 0 10px; color: var(--heading); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.hero { text-align: center; padding-top: 6vh; }
.hero h1 { font-size: 2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .95rem; }
input, select, textarea {
  font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-weight: 400;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
button, .button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--primary); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 18px;
}
button:hover, .button:hover { background: var(--primary-hover); }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.secondary:hover { border-color: var(--primary); }
form.inline { margin-top: 12px; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }

.alert { border-left: 4px solid var(--bad); background: var(--surface); padding: 10px 12px; color: var(--bad); }
.notice { border-left: 4px solid var(--ok); background: var(--surface); padding: 10px 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.tile .n { font-size: 1.8rem; font-weight: 700; }
.tile.bad .n { color: var(--bad); }

table.grid { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.grid th, .grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.grid td code { word-break: break-all; }
td.bad { color: var(--bad); }

.badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius); font-size: .8rem; font-weight: 600; border: 1px solid currentColor; }
.badge.succeeded, .badge.ok { color: var(--ok); }
.badge.queued, .badge.running, .badge.degraded { color: var(--warn); }
.badge.failed, .badge.cancelled, .badge.down { color: var(--bad); }

@media (max-width: 700px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .brand img { height: 36px; }
  main { padding: 20px 16px; }
  table.grid { display: block; overflow-x: auto; }
}

/* Agents, Company profile and documents */
textarea { width: 100%; resize: vertical; line-height: 1.45; }
.help { font-weight: 400; font-size: .85rem; color: var(--muted); }
.warnbox { border-left: 4px solid var(--warn); background: var(--surface); padding: 10px 12px; }
.warnbox ul { margin: 6px 0 0; }
.flag { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--warn); border: 1px solid currentColor; border-radius: var(--radius); padding: 0 6px; margin-left: 6px; }
td.pre { white-space: pre-wrap; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small { padding: 5px 10px; font-size: .85rem; }

.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.agentcard { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.agentcard.off { border-left-color: var(--line); opacity: .7; }
.agentcard h3 { margin: 0 0 6px; font-size: 1.05rem; }
.agentcard p { margin: 0 0 8px; }
.agentcard .toggle { margin-top: auto; }

form.steps { max-width: 820px; }
fieldset.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0; }
fieldset.step legend { font-weight: 700; padding: 0 6px; }
.num { display: inline-block; min-width: 1.6em; text-align: center; background: var(--slate); color: #fff; border-radius: var(--radius); margin-right: 4px; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; flex-wrap: wrap; }
fieldset.plain legend { font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
details.advanced { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; margin-top: 16px; }
details.advanced summary { cursor: pointer; font-weight: 600; }
details.advanced[open] summary { margin-bottom: 12px; }

.docpreview { background: #fff; color: #1d262c; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; max-width: 900px; }
.docpreview h1 { color: #182736; }
.docpreview h2 { color: #2F3D46; border-bottom: 2px solid #753531; padding-bottom: 3px; }
.docpreview h3, .docpreview h4 { color: #2F3D46; }
.docpreview table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; }
.docpreview th { background: #2F3D46; color: #fff; text-align: left; }
.docpreview th, .docpreview td { border: 1px solid #c9cfd3; padding: 4px 8px; vertical-align: top; }
.docpreview blockquote { margin: 8px 0; padding: 6px 10px; border-left: 3px solid #2F3D46; background: #f5f5f3; }
.docpreview li.check { list-style: none; }
mark.gap { background: #fbe3a1; color: #5a3b00; padding: 0 2px; }

/* Lanes, meters, login */
.meter { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: middle; }
.meter i { display: inline-block; width: 14px; height: 8px; background: var(--surface-muted); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.meter i.on { background: var(--primary); border-color: var(--primary); }
.notice-soft { background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; color: var(--muted); }
.alert { background: var(--bad-soft); }
.notice { background: var(--ok-soft); }
.grid th { background: var(--surface-muted); }
.mainnav a { white-space: nowrap; }
@media (max-width: 700px) {
  .mainnav { flex-wrap: nowrap; overflow-x: auto; flex-basis: 100%; order: 3; }
  .who { margin-left: auto; }
}
@media (prefers-color-scheme: dark) { button.secondary { color: var(--text); } } /* white on Steel Navy is 5.2:1 */
