/* UltrAI workspace — Ultra Building Co design system v1 (prototype)
   Brand source: Ultra Brand Guidelines 2022 (ULTRA-BRAND-SOURCE.md). Palette + 20% tint steps only.
   Typeface: Roboto Condensed (named brand alternate) until licensed DINPro web files are supplied.
   Signal colours (status only, always with words + icon) are the one documented deviation. */

@font-face {
  font-family: "Roboto Condensed";
  src: url("fonts/RobotoCondensed-Variable.ttf") format("truetype");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  /* Brand palette (exact) */
  --blue: #1d355e;        /* primary */
  --blue-80: #4a5d7e;
  --blue-60: #77869e;
  --blue-40: #a5aebf;
  --blue-20: #d2d7df;
  --grey: #e6e7e8;        /* light grey background */
  --grey-60: #f0f1f1;
  --grey-40: #f5f5f6;
  --grey-20: #fafafa;
  --teal: #7994a5;        /* grey teal */
  --teal-80: #94a9b7;
  --teal-60: #afbec9;
  --teal-40: #c9d4db;
  --teal-20: #e4e9ed;
  --ice: #7c8cac;         /* ice blue */
  --ice-40: #cbd1de;
  --ice-20: #e5e8ee;
  --black: #000000;
  --ink: #333333;         /* black 80% */
  --ink-60: #666666;      /* black 60% */
  --ink-40: #999999;
  --ink-20: #cccccc;
  --white: #ffffff;
  --suggest-green: #14655c;  --suggest-green-80: #1c786e;  /* suggested-action chips (ULT-1500) */

  /* Signal colours — status chips only, never decoration (documented deviation) */
  --sig-green: #1f6b45;  --sig-green-bg: #e3f1e9;
  --sig-amber: #8a5a00;  --sig-amber-bg: #fbf0d9;
  --sig-red:   #a12a1f;  --sig-red-bg:   #f9e1de;
  --sig-red-bright: #7d1209; --sig-red-bright-bg: #f3c9c4;

  /* Semantic tokens */
  --bg: var(--grey-40);
  --surface: var(--white);
  --surface-sunk: var(--grey-20);
  --line: var(--grey);
  --line-strong: var(--blue-20);
  --text: var(--ink);
  --text-muted: var(--ink-60);
  --heading: var(--blue);
  --accent: var(--blue);
  --focus: var(--blue);

  --radius-s: 4px;
  --radius: 8px;
  --radius-l: 14px;
  --shadow-1: 0 1px 2px rgba(29, 53, 94, .06), 0 1px 1px rgba(29, 53, 94, .04);
  --shadow-2: 0 10px 30px -12px rgba(29, 53, 94, .28), 0 2px 6px rgba(29, 53, 94, .06);
  --rail-w: 264px;
  --t-fast: 160ms cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Roboto Condensed", "Arial Narrow", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "tnum" 0;
}
h1, h2, h3, h4 { color: var(--heading); margin: 0; line-height: 1.15; letter-spacing: -.005em; }
h1 { font-size: 34px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-80); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.num, td.num, .tabular { font-feature-settings: "tnum" 1, "lnum" 1; font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--text-muted); }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-80); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Icons (heavy stroke, never filled — brand graphic language) ---------- */
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; stroke-width: 2.25; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ic-s { width: 16px; height: 16px; }
.ic-l { width: 28px; height: 28px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }
.rail {
  background: var(--blue); color: var(--white);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 26px 18px 22px;
}
.rail__logo { display: block; padding: 6px 10px 26px; }
.rail__logo img { width: 132px; height: auto; display: block; }
.rail__product { font-size: 12.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--teal-40); padding: 0 10px 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.rail__group { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-40); padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px; margin: 2px 0; min-height: 44px;
  color: var(--blue-20); text-decoration: none; border-radius: var(--radius); font-size: 16px; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: rgba(255,255,255,.07); color: var(--white); }
.nav a[aria-current="page"] { background: var(--white); color: var(--blue); font-weight: 700; }
.nav a .count { margin-left: auto; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.14); color: var(--white); border-radius: 999px; padding: 1px 9px; }
.nav a[aria-current="page"] .count { background: var(--blue); }
.nav__disabled { display:flex; gap:12px; align-items:center; padding:10px; min-height:44px; color:var(--blue-40); opacity:.9; }
.nav__disabled strong, .nav__disabled small { display:block; font-size:16px; font-weight:500; line-height:1.1; }
.nav__disabled small { margin-top:3px; font-size:12px; color:var(--blue-40); }
.rail__foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--blue-20); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.rail__foot strong { color: var(--white); display: block; font-size: 15px; }
.rail__foot a { color: var(--blue-20); font-size: 13px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 0 36px;
  background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-muted); flex-wrap: wrap; }
.crumb + .crumb::before { content: "/"; color: var(--ink-20); margin-right: 8px; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs .sep { color: var(--ink-20); }
.crumbs [aria-current] { color: var(--blue); font-weight: 700; }
.topbar__right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.content { padding: 30px 36px 64px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 8px; color: var(--text-muted); max-width: 70ch; }
.page-head__actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Job header band (photography under a blue wash; logo never on it) ---------- */
.jobband { position: relative; color: var(--white); background: var(--blue); overflow: hidden; }
.jobband::before {
  content: ""; position: absolute; inset: 0;
  background: url("login-hero.jpg") center 38% / cover no-repeat;
  opacity: .32; mix-blend-mode: luminosity;
}
.jobband::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(29,53,94,.96) 0%, rgba(29,53,94,.86) 48%, rgba(29,53,94,.55) 100%); }
.jobband__in { position: relative; z-index: 1; padding: 30px 36px 26px; display: grid; grid-template-columns: 1fr auto; gap: 20px 36px; align-items: end; max-width: 1360px; }
.jobband__name { color: var(--white); font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.jobband .addr { color: var(--blue-20); margin-top: 6px; font-size: 16px; }
.jobband__meta { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.jobband__meta div { font-size: 13px; color: var(--blue-20); }
.jobband__meta strong { display: block; color: var(--white); font-size: 16px; font-weight: 700; }
.jobband__eyebrow { color: var(--teal-40); margin-bottom: 6px; }
.jobband__systems { position: relative; z-index: 1; max-width: 1360px; padding: 0 36px 24px; }
.jobband__systems h2 { color: var(--white); font-size: 16px; margin: 0 0 8px; }
.jobband__systems table { width: 100%; border-collapse: collapse; font-size: 14px; }
.jobband__systems th { color: var(--teal-40); text-align: left; font-weight: 700; padding: 6px 10px 6px 0; }
.jobband__systems td { border-top: 1px solid rgba(255,255,255,.16); color: var(--white); padding: 8px 10px 8px 0; }
.jobband__systems .chip--typed { background: rgba(255,255,255,.16); color: var(--white); }
.tabs { display: flex; gap: 4px; padding: 0 30px; background: var(--blue); position: relative; z-index: 1; border-top: 1px solid rgba(255,255,255,.1); overflow-x: auto; }
.tabs a { color: var(--blue-20); text-decoration: none; padding: 14px 14px 13px; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--white); }
.tabs a[aria-current="page"] { color: var(--white); border-bottom-color: var(--white); }

/* ---------- Surfaces ---------- */
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.card__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card__head h2, .card__head h3 { font-size: 18px; }
.card__head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.card__body { padding: 20px 22px; }
.card__foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-sunk); border-radius: 0 0 var(--radius-l) var(--radius-l); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.section-title h2 { font-size: 20px; }
.section-title .right { margin-left: auto; }
.stack > * + * { margin-top: 20px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* Agent cards on the Job dashboard */
.agent { display: flex; flex-direction: column; gap: 14px; padding: 22px; text-decoration: none; color: inherit; transition: box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast); }
.agent:hover { box-shadow: var(--shadow-2); border-color: var(--blue-20); transform: translateY(-1px); }
.agent__icon { width: 46px; height: 46px; border-radius: 12px; background: var(--blue); color: var(--white); display: grid; place-items: center; }
.agent h2 { font-size: 20px; }
.agent p { color: var(--text-muted); font-size: 15px; }
.agent__stat { display: flex; gap: 18px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }
.agent__stat div { font-size: 13px; color: var(--text-muted); }
.agent__stat strong { display: block; font-size: 22px; color: var(--blue); font-weight: 700; }
.agent__go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--blue); }

/* KPI tiles */
.kpi { padding: 18px 20px; }
.kpi .label { font-size: 14px; color: var(--text-muted); }
.kpi .value { font-size: 30px; font-weight: 700; color: var(--blue); margin-top: 4px; line-height: 1.1; }
.kpi .sub { margin-top: 10px; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.chip .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.chip--source { background: var(--ice-20); color: var(--blue); font-weight: 600; }
.chip--typed { background: var(--grey); color: var(--ink); font-weight: 600; }
.chip--off { background: var(--white); color: var(--ink-60); border-color: var(--ink-20); font-weight: 600; }
.chip--stale { background: var(--sig-amber-bg); color: var(--sig-amber); }
.chip--state { background: var(--teal-20); color: var(--blue); }
.chip--live { background: var(--sig-green-bg); color: var(--sig-green); }
.chip--blue { background: var(--blue); color: var(--white); }
/* Status / traffic lights / cost flags — always words + icon */
.flag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; padding: 6px 11px 6px 9px; border-radius: 6px; }
.flag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.flag--green  { color: var(--sig-green); background: var(--sig-green-bg); }
.flag--amber  { color: var(--sig-amber); background: var(--sig-amber-bg); }
.flag--lred   { color: var(--sig-red); background: var(--sig-red-bg); }
.flag--bred   { color: var(--sig-red-bright); background: var(--sig-red-bright-bg); }
.flag--grey   { color: var(--blue-80); background: var(--teal-20); }
.flag--grey::before { background: transparent; border: 2.5px solid currentColor; width: 9px; height: 9px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1.5px solid var(--blue); background: var(--blue); color: var(--white); font: inherit; font-weight: 700; font-size: 15.5px; cursor: pointer; text-decoration: none; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast); }
.btn:hover { background: var(--blue-80); border-color: var(--blue-80); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn--secondary { background: var(--white); color: var(--blue); border-color: var(--blue-40); }
.btn--secondary:hover { background: var(--ice-20); color: var(--blue); border-color: var(--blue); }
.btn--ghost { background: transparent; color: var(--blue); border-color: transparent; }
.btn--ghost:hover { background: var(--ice-20); color: var(--blue); border-color: transparent; }
.btn--danger { background: var(--white); color: var(--sig-red); border-color: var(--sig-red); }
.btn--danger:hover { background: var(--sig-red-bg); color: var(--sig-red); border-color: var(--sig-red); }
.btn--s { min-height: 36px; padding: 0 12px; font-size: 14.5px; }
.btn[aria-disabled="true"] { cursor: not-allowed; background: var(--grey-60); border-color: var(--ink-20); color: var(--ink-60); box-shadow: none; }
.btn[aria-disabled="true"]:hover, .btn[aria-disabled="true"]:active { background: var(--grey-60); border-color: var(--ink-20); color: var(--ink-60); transform: none; }
.action { display: grid; justify-items: start; gap: 6px; }
.why { color: var(--ink-60); font-size: 13.5px; }
form { display:grid; gap:16px; max-width:42rem; }
label { display:grid; gap:6px; font-weight:700; color:var(--ink); }
input, select, textarea { width:100%; min-height:46px; padding:10px 13px; font:inherit; font-size:16px; color:var(--ink); background:var(--white); border:1.5px solid var(--ink-20); border-radius:var(--radius); }
textarea { min-height:104px; resize:vertical; }
input:focus, select:focus, textarea:focus { outline:3px solid var(--blue); outline-offset:2px; border-color:var(--blue); box-shadow:none; }
form > button:not(.rail-signout) { justify-self:start; }

/* ---------- Workflow stage tracker ---------- */
.stages { display: flex; align-items: stretch; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-1); }
.stage { flex: 1; position: relative; padding: 16px 18px 16px 22px; display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.stage + .stage { border-left: 1px solid var(--line); }
.stage__dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 14px; border: 2px solid var(--ink-20); color: var(--ink-60); background: var(--white); }
.stage__dot .ic { width: 16px; height: 16px; stroke-width: 3; }
.stage strong { display: block; font-size: 15.5px; color: var(--ink); line-height: 1.2; }
.stage span { font-size: 13px; color: var(--text-muted); }
.stage .who { display: inline-flex; margin-top: 5px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-80); }
.stage--done .stage__dot { background: var(--blue); border-color: var(--blue); color: var(--white); }
.stage--now { background: var(--ice-20); }
.stage--now::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--blue); }
.stage--now .stage__dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px var(--blue-20); }
.stage--now strong { color: var(--blue); }
.stage--human .stage__dot { border-style: dashed; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15.5px; }
.t th { text-align: left; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 11px 14px; border-bottom: 1.5px solid var(--line-strong); background: var(--white); white-space: nowrap; }
.t td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; }
.t tbody tr { transition: background var(--t-fast); }
.t tbody tr:hover { background: var(--grey-20); }
.t .rowlink { font-weight: 700; color: var(--blue); text-decoration: none; }
.t .rowlink:hover { text-decoration: underline; }
.t .sub { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.t tr.is-selected td { background: var(--ice-20); }

/* Weekly report line table */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); text-align: right; padding: 0 14px 10px; }
.lines th:first-child { text-align: left; padding-left: 0; }
.lines td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: right; font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; }
.lines td:first-child { text-align: left; padding-left: 0; font-weight: 600; color: var(--ink); }
.lines td.src { text-align: right; white-space: nowrap; }
.lines .delta-up { color: var(--sig-green); font-weight: 700; }
.lines .delta-down { color: var(--sig-red); font-weight: 700; }
.lines input { width: 120px; text-align: right; }

.section-card .card__head { gap: 14px; }
.section-card .sec-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--ice-20); color: var(--blue); display: grid; place-items: center; }
.section-card .card__head .sys { font-size: 13.5px; color: var(--text-muted); }
.commentary { margin-top: 16px; padding: 14px 16px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius); }
.commentary .lbl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.commentary p { color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.field label, .field .label { font-weight: 700; font-size: 15px; color: var(--ink); }
.field .help { font-size: 13.5px; color: var(--text-muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 13px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--ink-20); border-radius: var(--radius);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { min-height: 104px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--blue-40); }
.input:focus { outline: 3px solid var(--blue); outline-offset: 2px; border-color: var(--blue); box-shadow: none; }
.field.has-error .input { border-color: var(--sig-red); }
.field .error { color: var(--sig-red); font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.choice:hover { border-color: var(--blue-40); }
.choice input { margin-top: 3px; accent-color: var(--blue); width: 18px; height: 18px; }
.choice.is-on { border-color: var(--blue); background: var(--ice-20); }
.choice strong { display: block; color: var(--ink); }
.choice span { font-size: 14px; color: var(--text-muted); }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); }
.notice .ic { margin-top: 2px; }
.notice strong { color: var(--ink); }
.notice--info { background: var(--ice-20); border-color: var(--ice-40); color: var(--blue); }
.notice--warn { background: var(--sig-amber-bg); border-color: var(--sig-amber-bg); color: var(--sig-amber); }
.notice--ok { background: var(--sig-green-bg); border-color: var(--sig-green-bg); color: var(--sig-green); }
.notice p { color: var(--ink); font-size: 15px; }

/* Key/value list */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; font-size: 15.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; }

/* Activity / timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 2px; width: 1.5px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline strong { color: var(--ink); }
.timeline time { display: block; font-size: 13px; color: var(--text-muted); }

/* Document viewer (docket) */
.docview { background: var(--grey); border-radius: var(--radius); padding: 18px; display: grid; place-items: center; min-height: 420px; }
.paper { background: var(--white); width: 100%; max-width: 420px; aspect-ratio: 1 / 1.35; box-shadow: var(--shadow-2); padding: 26px 24px; font-size: 13px; color: var(--ink); line-height: 1.45; font-family: "Courier New", monospace; }
.ocr { font-family: "Courier New", monospace; font-size: 13.5px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; white-space: pre-wrap; color: var(--ink); max-height: 240px; overflow: auto; }
.extract td:first-child { color: var(--text-muted); width: 40%; }
.conf { font-size: 12.5px; font-weight: 700; color: var(--teal); }

/* Leadership report view */
.report-head { background: var(--blue); color: var(--white); border-radius: var(--radius-l); padding: 26px 30px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; position: relative; overflow: hidden; }
.report-head h1 { color: var(--white); font-size: 30px; }
.report-head p { color: var(--blue-20); margin-top: 6px; }
.status-big { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.status-big .flag { font-size: 16px; padding: 9px 14px; }
.signoff { display: flex; gap: 26px; flex-wrap: wrap; font-size: 14px; color: var(--blue-20); }
.signoff strong { color: var(--white); display: block; font-size: 15px; }
.risk { padding: 16px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.risk:first-child { border-top: 0; padding-top: 0; }
.risk .n { width: 30px; height: 30px; border-radius: 8px; background: var(--blue); color: var(--white); display: grid; place-items: center; font-weight: 700; }
.risk h4 { color: var(--ink); font-size: 16px; }
.risk .meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; font-size: 14px; }
.risk .meta div span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }

/* Sign-in */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 520px; background: var(--blue); }
.signin__photo { position: relative; overflow: hidden; }
.signin__photo::before { content: ""; position: absolute; inset: 0; background: url("login-hero.jpg") center / cover no-repeat; }
.signin__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(29,53,94,.15) 0%, rgba(29,53,94,.35) 55%, rgba(29,53,94,.92) 100%); }
.signin__words { position: absolute; z-index: 1; left: 64px; right: 64px; bottom: 60px; color: var(--white); }
.signin__words .eyebrow { color: var(--teal-40); }
.signin__words h1 { color: var(--white); font-size: 66px; font-weight: 700; line-height: .98; margin-top: 14px; letter-spacing: -.015em; }
.signin__words p { margin-top: 18px; max-width: 540px; font-size: 19px; color: var(--blue-20); }
.signin__panel { background: var(--blue); color: var(--white); display: flex; flex-direction: column; padding: 56px 56px 40px; }
.signin__panel img { width: 168px; }
.signin__card { margin-top: auto; margin-bottom: auto; background: var(--white); color: var(--ink); border-radius: var(--radius-l); padding: 38px 36px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }
.signin__card h2 { font-size: 30px; }
.signin__card p { color: var(--text-muted); margin-top: 8px; }
.btn-ms { width: 100%; margin-top: 28px; min-height: 54px; font-size: 17px; }
.signin__fine { margin-top: 22px; font-size: 13.5px; color: var(--text-muted); border-top: 1px solid var(--line); padding-top: 16px; }
.signin__foot { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-40); font-weight: 700; }

/* Load motion: one staggered reveal per page, respects reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal > * { animation: rise .42s cubic-bezier(.2,.7,.2,1) both; }
  .reveal > *:nth-child(2) { animation-delay: .05s; }
  .reveal > *:nth-child(3) { animation-delay: .10s; }
  .reveal > *:nth-child(4) { animation-delay: .15s; }
  .reveal > *:nth-child(5) { animation-delay: .20s; }
  .reveal > *:nth-child(n+6) { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------- Responsive ---------- */
.menu-toggle { display: none; }
@media (max-width: 1180px) {
  .g-main { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: 14px 16px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .rail__logo { padding: 4px; }
  .rail__logo img { width: 104px; }
  .rail__product, .rail__group, .rail__foot { display: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; color: var(--white); background: transparent; border: 1.5px solid rgba(255,255,255,.3); }
  .rail .nav { display: none; width: 100%; }
  .rail:focus-within .nav, .rail.open .nav { display: block; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .crumbs .crumb:not(:last-child) { display: none; }
  .crumbs .crumb:last-child::before { content: "…"; margin-right: 8px; }
  .jobband__in, .jobband__systems { padding-left: 16px; padding-right: 16px; }
  .jobband__in { padding-top: 22px; padding-bottom: 22px; grid-template-columns: 1fr; }
  .jobband__name { font-size: 30px; }
  .tabs { padding: 0 8px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stages { flex-direction: column; }
  .stage + .stage { border-left: 0; border-top: 1px solid var(--line); }
  .signin { grid-template-columns: 1fr; }
  .signin__photo { min-height: 300px; }
  .signin__words { left: 16px; right: 16px; bottom: 22px; }
  .signin__words h1 { font-size: 40px; }
  .signin__panel { padding: 28px 16px; }
  .report-head { grid-template-columns: 1fr; }
  .status-big { align-items: flex-start; }
  .risk .meta { grid-template-columns: 1fr; }
}

/* ---------- v1.1 fixes from first render ---------- */
.stage span { display: block; }
.stage .who { display: block; }
.flag, .chip { white-space: nowrap; }
.btn { white-space: nowrap; }
.grid > .field + .field { margin-top: 0; }
.jobband--compact .jobband__in { padding: 20px 36px 18px; }
.jobband--compact .jobband__name { font-size: 26px; }
.jobband--compact .addr { display: none; }
.stage .stage__dot { display: grid; }
.risk .meta div span { display: inline; font-size: inherit; font-weight: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.risk .meta div > span:first-child { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-80); margin-bottom: 2px; }
.risk .meta .flag { display: inline-flex; font-weight: 700; }
.jobband::before { opacity: .5; }

/* Weekly Report PM page: line tables scroll inside their card on a phone */
.table-scroll { overflow-x: auto; }
.g-main > *, .stack > * { min-width: 0; }
form.stack { grid-template-columns: minmax(0, 1fr); }
.lines td[colspan] { text-align: left; font-weight: 400; padding-left: 0; }
.lines td.src small { display: block; white-space: normal; color: var(--text-muted); }
.lines summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.lines td:first-child small { display: block; font-weight: 400; color: var(--text-muted); }
.lines td:first-child { min-width: 120px; }
@media (max-width: 640px) {
  .lines td, .lines th { padding-left: 8px; padding-right: 8px; }
  .lines input { width: 84px; }
}
