/* ============================================================
   STRATA PROPERTY INTELLIGENCE — PROTOTYPE V2
   Wave 1: design tokens, application shell, E01, A01, P00.

   Token values sampled directly from
   docs/design/Strata_9A2_CONTACT_SHEET_FINAL_WEB.png
   ============================================================ */

/* ---------- 0. TYPEFACE ------------------------------------
   Decision D5: self-hosted, so the page still makes zero external
   requests. Inter variable, latin subset, 48KB, OFL licensed.
   Best identification of the face on the 9A2 contact sheet — the
   sheet's own rendering is too low-resolution to confirm exactly.
   ---------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1. TOKENS ------------------------------------- */
:root {
  /* Brand + structure */
  --navy-900:   #0D2243;   /* left rail, entry brand panel */
  --navy-800:   #13305C;
  --blue-700:   #00349E;   /* primary button, panel titles */
  --blue-600:   #1450C8;
  --blue-500:   #2E6BE6;   /* links, active state */
  --blue-050:   #EAF1FE;

  /* Semantic — status. Never used alone; always paired with a word. */
  --good-600:   #2E9C63;
  --good-050:   #EBF5EC;
  --fair-600:   #E8862F;
  --fair-050:   #FFF4C1;
  --poor-600:   #E12A1E;
  --poor-500:   #E80000;
  --poor-050:   #FDE7E4;
  --unknown-600:#64748B;
  --unknown-050:#EEF1F5;

  /* Neutrals */
  --page:       #FAFBFC;
  --surface:    #FFFFFF;
  --surface-2:  #F4F6F9;
  --border:     #E4E9F0;
  --border-2:   #D3DBE6;
  --text:       #0F1A28;
  --text-2:     #3D4C60;
  --muted:      #64748B;

  /* Type — swap --font-sans to a self-hosted face per decision D5 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-num: var(--font-sans);

  /* Space + shape */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(13,34,67,.05);
  --sh-2: 0 1px 3px rgba(13,34,67,.06), 0 8px 24px -14px rgba(13,34,67,.18);
  --sh-3: 0 12px 40px -12px rgba(13,34,67,.28);
  --rail-w: 72px;
}

/* ---------- 2. BASE --------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* Deliberately no height:100% on html/body. Setting it makes body a separate
   scrolling box, so window.scrollTo/scrollY and scrollIntoView disagree about
   which element is scrolling. The shell sizes itself with min-height:100dvh. */
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--blue-500); }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.ico { width: 20px; height: 20px; flex: none; display: block; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   3. E01 — VIEWER IDENTIFICATION
   9A2 panel 01: dark brand panel left, photograph right.
   Decision D2: all fields captured as data; Unique ID is the only gate.
   ============================================================ */
.entry {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--page);
}

.entry-card {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  overflow: hidden;
}

.entry-form-side {
  background: var(--navy-900);
  color: #fff;
  padding: 40px 40px 32px;
  display: flex;
  flex-direction: column;
}

.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  background: linear-gradient(150deg, #2E6BE6, #00349E);
  display: grid; place-items: center; color: #fff;
}
.brand-mark .ico { width: 21px; height: 21px; }
.brand-text {
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; line-height: 1.35; color: #E6EDF8;
}

.entry-form-side h1 {
  font-size: 25px; font-weight: 650; line-height: 1.22;
  letter-spacing: -.015em; margin-bottom: 8px;
}
.entry-lede { color: #A9BAD4; font-size: 13.5px; margin-bottom: 26px; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 12px; font-weight: 550;
  color: #C3D0E4; margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 10px 13px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-md);
  color: #fff; font: inherit;
}
.field input::placeholder { color: #7D90AC; }
.field input:focus-visible {
  outline: 2px solid var(--blue-500); outline-offset: 1px;
  background: rgba(255,255,255,.12);
}
.field input[aria-invalid="true"] { border-color: #FF8B7E; }

.field-error {
  display: flex; align-items: center; gap: 6px;
  color: #FFB3A8; font-size: 12.5px; margin-top: 6px;
}
.field-error .ico { width: 15px; height: 15px; }

.btn-primary {
  width: 100%; margin-top: 8px; padding: 12px 18px;
  background: var(--blue-600); color: #fff;
  border: 0; border-radius: var(--r-md);
  font-weight: 600; font-size: 14.5px;
  transition: background .14s ease;
}
.btn-primary:hover { background: #1A5AD8; }

.entry-legal { margin-top: 18px; font-size: 11.5px; color: #8195B2; line-height: 1.55; }

.entry-synthetic {
  margin-top: auto; padding-top: 22px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: #93A6C2;
}
.entry-synthetic .ico { width: 15px; height: 15px; }

.entry-photo { position: relative; background: var(--navy-800); min-height: 420px; }
.entry-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 26px 20px; color: #fff; font-size: 12.5px;
  background: linear-gradient(transparent, rgba(9,20,38,.82));
}
/* Placeholder shown until the generated photograph lands (docs/PHOTO_PROMPTS.md) */
.img-placeholder {
  width: 100%; height: 100%; min-height: inherit; display: grid;
  place-items: center; text-align: center; padding: 24px;
  background: linear-gradient(150deg, #1B3358 0%, #2C4E7E 52%, #4A6E9E 100%);
  color: #C6D6EC; font-size: 11px; letter-spacing: .03em; overflow: hidden;
}
.img-placeholder span { max-width: 20ch; line-height: 1.55; }
.bsa-figure .img-placeholder { font-size: 10px; padding: 10px; }

@media (max-width: 800px) {
  .entry-card { grid-template-columns: 1fr; }
  .entry-photo { min-height: 190px; order: -1; }
  .entry-form-side { padding: 30px 26px 26px; }
}

/* ============================================================
   4. APPLICATION SHELL
   F01: compact left rail — Attention / Property / Evidence / Action only.
   ============================================================ */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100dvh; }

.rail {
  padding: 14px 0 14px 14px;
  position: sticky; top: 0; align-self: start; height: 100dvh;
}
.rail-inner {
  height: 100%;
  background: var(--navy-900);
  border-radius: var(--r-xl);
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0; gap: 4px;
}
.rail-mark {
  width: 32px; height: 32px; border-radius: 8px; margin-bottom: 16px;
  background: linear-gradient(150deg, #2E6BE6, #00349E);
  display: grid; place-items: center; color: #fff; flex: none;
}
.rail-mark .ico { width: 19px; height: 19px; }

.rail-btn {
  width: 44px; height: 44px; border: 0; background: transparent;
  border-radius: var(--r-md); color: #93A9C9;
  display: grid; place-items: center; position: relative;
  transition: background .14s ease, color .14s ease;
}
.rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-btn[aria-current="page"] { background: var(--blue-600); color: #fff; }
.rail-btn .rail-label {
  position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--navy-900); color: #fff;
  padding: 5px 10px; border-radius: var(--r-sm);
  font-size: 12px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .13s ease, transform .13s ease; z-index: 40;
}
.rail-btn:hover .rail-label, .rail-btn:focus-visible .rail-label {
  opacity: 1; transform: translateY(-50%) translateX(0);
}

.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-viewer {
  width: 34px; height: 34px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.12); color: #DCE6F5;
  display: grid; place-items: center; font-size: 12px; font-weight: 650;
}

.main { min-width: 0; padding: 22px 26px 60px; }

.page-head { margin-bottom: 18px; }
.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
}
.page-head h1 { font-size: 25px; font-weight: 650; letter-spacing: -.018em; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }

.link-more {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--blue-500); font-size: 12.5px; font-weight: 550;
  background: none; border: 0; padding: 2px 0; text-decoration: none;
}
.link-more .ico { width: 15px; height: 15px; }
.link-more:hover { text-decoration: underline; }

/* ============================================================
   5. A01 — ATTENTION / PROPERTY HEALTH
   ============================================================ */
.prop-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 16px;
}
.prop-head h1 { font-size: 23px; font-weight: 650; letter-spacing: -.018em; }
.prop-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.prop-meta .dot-sep { margin: 0 7px; opacity: .5; }

/* Health indicators — F02 labels, Evidence lowest and cued (D3) */
.health {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.health-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 8px 14px;
}
.ring { position: relative; width: 74px; height: 74px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-track { stroke: var(--surface-2); }
.ring-value {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; color: var(--text);
}
.health-item.is-poor .ring-value { color: var(--poor-600); }
.health-item.is-fair .ring-value { color: var(--text); }
.health-label {
  font-size: 12px; color: var(--muted); text-align: center;
  display: flex; align-items: center; gap: 4px;
}
.health-label .ico { width: 13px; height: 13px; color: var(--poor-600); }
.health-item.is-flagged .health-label { color: var(--poor-600); font-weight: 600; }

/* Two-column: attention list + building status */
.attn-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}

/* Attention list */
.attn-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 13px 20px; background: none; border: 0;
  border-bottom: 1px solid var(--border);
  transition: background .12s ease;
}
.attn-item:last-child { border-bottom: 0; }
.attn-item:hover { background: var(--surface-2); }

.attn-badge {
  width: 24px; height: 24px; border-radius: var(--r-pill);
  display: grid; place-items: center; color: #fff; flex: none;
}
.attn-badge .ico { width: 14px; height: 14px; }
.sev-high .attn-badge   { background: var(--poor-600); }
.sev-medium .attn-badge { background: var(--fair-600); }
.sev-low .attn-badge    { background: var(--good-600); }

.attn-title { font-size: 14px; font-weight: 550; color: var(--text); }
.attn-reason { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.attn-due { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.pill-high   { background: var(--poor-050); color: var(--poor-600); }
.pill-medium { background: var(--fair-050); color: #9A5B12; }
.pill-low    { background: var(--good-050); color: var(--good-600); }

/* Hero attention row — first card visibly dominant (S8A §8) */
.attn-item.is-hero {
  display: block; padding: 18px 20px;
  background: linear-gradient(180deg, #FFF9F8, var(--surface));
  border-left: 3px solid var(--poor-600);
}
.attn-item.is-hero:hover { background: linear-gradient(180deg, #FFF4F2, var(--surface)); }
.hero-top { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.hero-top .attn-badge { width: 26px; height: 26px; }
.attn-item.is-hero .attn-title { font-size: 16.5px; font-weight: 650; letter-spacing: -.012em; }
.hero-foot {
  display: flex; align-items: center; gap: 8px 16px;
  flex-wrap: wrap; margin-top: 11px;
}
.hero-fact { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.hero-fact .ico { width: 14px; height: 14px; color: var(--muted); }
.hero-fact strong { font-weight: 600; color: var(--text); }
.hero-next {
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--border-2);
  font-size: 12.5px; color: var(--muted);
}
.hero-next b { display: block; color: var(--text); font-weight: 600; font-size: 13.5px; margin-top: 2px; }

/* Building status by area — A01 uses compact bars */
.bsa-figure {
  border-radius: var(--r-md); overflow: hidden; background: #fff;
  aspect-ratio: 4 / 5; min-height: 240px; margin-bottom: 4px;
}
.bsa-figure img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bsa-body { display: grid; grid-template-columns: minmax(140px,0.85fr) minmax(0,1.15fr); gap: 16px; padding: 16px 20px 18px; }

.area-row {
  display: grid; grid-template-columns: minmax(0,1fr) 54px 34px;
  align-items: center; gap: 9px; padding: 6px 0;
}
.area-name { font-size: 12.5px; color: var(--text-2); }
.area-bar {
  display: block; height: 8px; border-radius: var(--r-pill);
  background: var(--surface-2); overflow: hidden;
}
/* display:block matters — an inline span ignores width and height. */
.area-fill { display: block; height: 100%; border-radius: var(--r-pill); }
.area-pct {
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--muted); text-align: right;
}
.fill-good { background: var(--good-600); }
.fill-fair { background: var(--fair-600); }
.fill-poor { background: var(--poor-500); }

.bsa-updated { padding: 0 20px 16px; font-size: 11.5px; color: var(--muted); }

@media (max-width: 1080px) {
  .attn-grid { grid-template-columns: 1fr; }
  .bsa-body { grid-template-columns: minmax(0,220px) minmax(0,1fr); }
}
@media (max-width: 760px) {
  .health { grid-template-columns: repeat(3, 1fr); }
  .bsa-body { grid-template-columns: 1fr; }
  .attn-item { grid-template-columns: 26px minmax(0,1fr) auto; }
  .attn-due { display: none; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; top: auto;
          height: auto; padding: 0; z-index: 50; }
  .rail-inner { flex-direction: row; justify-content: space-around;
                border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 8px 10px; height: auto; }
  .rail-mark, .rail-foot { display: none; }
  .rail-btn .rail-label { display: none; }
  .main { padding: 18px 16px 96px; }
  .health { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   6. P00 — PROPERTY SUMMARY
   9A2 panel 09 uses percentage chips plus a quality word, not bars.
   ============================================================ */
.p00-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.p00-photo { padding: 20px; }
.p00-photo img { width: 100%; border-radius: var(--r-md); display: block; aspect-ratio: 4/3; object-fit: cover; }
.p00-status { padding: 20px 22px; border-left: 1px solid var(--border); }
.p00-status h2 { font-size: 14px; font-weight: 650; margin-bottom: 12px; }

.chip-row {
  display: grid; grid-template-columns: minmax(0,1fr) 58px 62px;
  align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.chip-row:last-of-type { border-bottom: 0; }
.chip-name { font-size: 13px; color: var(--text-2); }
.chip {
  display: inline-block; text-align: center;
  padding: 3px 9px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.chip-good { background: var(--good-050); color: var(--good-600); }
.chip-fair { background: var(--fair-050); color: #9A5B12; }
.chip-poor { background: var(--poor-500); color: #fff; }
.chip-word { font-size: 12.5px; }
.word-good { color: var(--good-600); }
.word-fair { color: #9A5B12; }
.word-poor { color: var(--poor-600); }

.p00-updated { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
               font-size: 11.5px; color: var(--muted); }

.p00-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
             gap: 1px; background: var(--border); border-radius: var(--r-md);
             overflow: hidden; margin-top: 16px; }
.p00-fact { background: var(--surface); padding: 12px 14px; }
.p00-fact dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.p00-fact dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; }

@media (max-width: 860px) {
  .p00-grid { grid-template-columns: 1fr; }
  .p00-status { border-left: 0; border-top: 1px solid var(--border); }
}

/* ============================================================
   7. WAVE-1 SCAFFOLD NOTICE
   Removed at Wave 2 when the issue workspace lands.
   ============================================================ */
.stub {
  display: grid; place-items: center; text-align: center;
  padding: 56px 24px; color: var(--muted);
}
.stub .ico { width: 26px; height: 26px; margin-bottom: 10px; color: var(--border-2); }
.stub b { display: block; color: var(--text-2); font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.stub p { max-width: 42ch; font-size: 13px; }

/* ============================================================
   8. IW01–IW03 — CONTINUOUS ISSUE WORKSPACE
   F02: one continuous workspace. F03: sticky Why/Evidence/Action anchors.
   ============================================================ */

.crumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin-bottom: 12px;
}
.crumb button {
  background: none; border: 0; padding: 0; color: var(--blue-500);
  font-size: 12.5px; font-weight: 550;
}
.crumb button:hover { text-decoration: underline; }
.crumb .ico { width: 13px; height: 13px; opacity: .55; }
.crumb .here { color: var(--text-2); font-weight: 600; }

/* Issue header — red title for High severity, matching 9A2 panel 03 */
.iw-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 4px;
}
.iw-title-wrap { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.iw-icon {
  width: 30px; height: 30px; border-radius: var(--r-pill); flex: none;
  display: grid; place-items: center; margin-top: 2px;
}
.sev-high .iw-icon   { background: var(--poor-050); color: var(--poor-600); }
.sev-medium .iw-icon { background: var(--fair-050); color: #9A5B12; }
.sev-low .iw-icon    { background: var(--good-050); color: var(--good-600); }
.iw-title { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.sev-high .iw-title { color: var(--poor-600); }
.iw-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* Sticky section anchors */
.iw-anchors {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 4px; padding: 10px 0 11px;
  background: linear-gradient(var(--page) 74%, transparent);
  margin-bottom: 4px;
}
.iw-anchor {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-pill); padding: 7px 16px;
  font-size: 13px; font-weight: 550; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .13s ease, color .13s ease, border-color .13s ease;
}
.iw-anchor .ico { width: 15px; height: 15px; }
.iw-anchor:hover { border-color: var(--border-2); background: var(--surface-2); }
.iw-anchor[aria-current="true"] {
  background: var(--navy-900); border-color: var(--navy-900); color: #fff;
}

.iw-section { scroll-margin-top: 62px; margin-bottom: 16px; }
.iw-section > .card { overflow: hidden; }
.sec-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--blue-500); margin-bottom: 4px;
}
.block { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.block:last-child { border-bottom: 0; }
.block h2 { font-size: 13.5px; font-weight: 650; margin-bottom: 8px; color: var(--text); }
.prose { font-size: 14.5px; line-height: 1.62; color: var(--text-2); max-width: 68ch; }

/* "What does this mean?" — F05, on demand, never a chatbot */
.explain { margin-top: 12px; }
.explain summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 550; color: var(--blue-500); list-style: none;
}
.explain summary::-webkit-details-marker { display: none; }
.explain summary .ico { width: 15px; height: 15px; }
.explain[open] summary { margin-bottom: 9px; }
.explain-body {
  background: var(--blue-050); border: 1px solid #CFE0FB;
  border-radius: var(--r-md); padding: 13px 15px;
  font-size: 13.5px; line-height: 1.6; color: #133A78; max-width: 66ch;
}

/* Timeline — historical + now + due (9A2 panel 03) */
.timeline { position: relative; padding: 4px 0 2px; }
.tl-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  position: relative; gap: 8px;
}
.tl-track::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 63px; height: 2px;
  background: var(--border-2); border-radius: 2px;
}
.tl-node { text-align: center; position: relative; }
.tl-big { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.tl-small { font-size: 11.5px; color: var(--muted); margin-top: 2px; min-height: 15px; }
.tl-dot {
  width: 13px; height: 13px; border-radius: var(--r-pill);
  background: var(--navy-800); border: 3px solid var(--surface);
  margin: 9px auto 0; position: relative; z-index: 1;
  box-shadow: 0 0 0 1.5px var(--navy-800);
}
.tl-node.is-now .tl-dot { background: var(--poor-600); box-shadow: 0 0 0 1.5px var(--poor-600); }
.tl-node.is-future .tl-dot { background: var(--border-2); box-shadow: 0 0 0 1.5px var(--border-2); }
.tl-node.is-due .tl-big { color: var(--poor-600); }
.tl-note { margin-top: 7px; font-size: 12px; font-weight: 650; color: var(--poor-600); }

/* Act now vs defer risk chart */
.riskchart { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.riskchart svg { flex: 1 1 320px; min-width: 260px; max-width: 470px; height: auto; }
.rc-legend { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.rc-key { display: flex; align-items: center; gap: 9px; color: var(--text-2); }
.rc-swatch { width: 26px; height: 0; border-top-width: 3px; border-radius: 2px; }
.rc-swatch.now { border-top-style: solid; border-top-color: var(--good-600); }
.rc-swatch.defer { border-top-style: dashed; border-top-color: var(--poor-500); }

/* Evidence — tabs, photo strip, quality, sources */
.tabs { display: flex; gap: 2px; padding: 12px 22px 0; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: 0; padding: 9px 15px 11px;
  font-size: 13px; font-weight: 550; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text-2); }
.tab[aria-selected="true"] { color: var(--blue-700); border-bottom-color: var(--blue-700); font-weight: 650; }

.photostrip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
.photostrip > * { scroll-snap-align: start; }
.pthumb {
  width: 108px; height: 92px; flex: none; border-radius: var(--r-md);
  overflow: hidden; border: 1px solid var(--border); background: var(--surface-2);
  padding: 0; position: relative;
}
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb .img-placeholder { font-size: 9.5px; padding: 6px; }
.pthumb-more {
  display: grid; place-items: center; background: var(--navy-900); color: #fff;
  font-size: 17px; font-weight: 650; border-color: var(--navy-900);
}

.quality-row { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.quality-word { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 14px; min-width: 128px; }
.quality-word .ico { width: 17px; height: 17px; }
.q-good { color: var(--good-600); } .q-fair { color: #9A5B12; } .q-poor { color: var(--poor-600); }
.quality-bar { flex: 1 1 180px; height: 9px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.quality-fill { display: block; height: 100%; border-radius: var(--r-pill); }
.quality-pct { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.quality-why { font-size: 12.5px; color: var(--muted); margin-top: 9px; }

.srclist { background: var(--surface-2); border-radius: var(--r-md); padding: 5px 0; }
.srcrow {
  display: grid; grid-template-columns: 26px minmax(0,1fr) auto auto;
  align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 15px; background: none; border: 0; border-radius: var(--r-sm);
}
.srcrow:hover { background: #E8EDF4; }
.srcrow .ico { width: 17px; height: 17px; color: var(--blue-600); }
.srcname { font-size: 13.5px; color: var(--text); font-weight: 500; }
.srcsnip { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.srcage { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* Evidence state badges — distinct icon shape per state, never colour alone */
.estate {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.estate .ico { width: 13px; height: 13px; }
.estate-verified     { background: var(--good-050);    color: var(--good-600); }
.estate-needsreview  { background: var(--fair-050);    color: #9A5B12; }
.estate-conflicting  { background: var(--poor-050);    color: var(--poor-600); }
.estate-missing      { background: var(--poor-050);    color: var(--poor-600); }
.estate-unknown      { background: var(--unknown-050); color: var(--unknown-600); }

/* Action — field rows and primary actions */
.arow {
  display: grid; grid-template-columns: 132px minmax(0,1fr);
  gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.arow:last-of-type { border-bottom: 0; }
.arow dt { font-size: 13px; color: var(--muted); }
.arow dd { margin: 0; font-size: 14px; color: var(--text); }
.arow dd.strong { font-weight: 650; font-size: 15px; }
.arow .conf { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 7px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 650;
}
.status-badge .ico { width: 13px; height: 13px; }
.st-recommended { background: var(--blue-050);    color: var(--blue-700); }
.st-assigned    { background: var(--good-050);    color: var(--good-600); }
.st-inprogress  { background: var(--fair-050);    color: #9A5B12; }
.st-completed   { background: var(--good-050);    color: var(--good-600); }

.primary-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  padding: 10px 20px; border-radius: var(--r-md); font-size: 14px; font-weight: 600;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  transition: background .13s ease, border-color .13s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-solid { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn-solid:hover { background: #002C86; border-color: #002C86; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--blue-500); }
.btn-quiet:hover { background: var(--blue-050); border-color: transparent; }

.defer-note {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--fair-050); border: 1px solid #F0D69A;
  border-radius: var(--r-md); padding: 12px 14px; margin-top: 14px;
  font-size: 13px; color: #7A4A0C;
}
.defer-note .ico { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* Overlays — native <dialog> gives focus trap, Esc and backdrop free */
dialog {
  border: 0; padding: 0; border-radius: var(--r-lg);
  box-shadow: var(--sh-3); background: var(--surface); color: var(--text);
  width: min(460px, calc(100vw - 32px)); max-height: 86vh;
}
dialog::backdrop { background: rgba(11,22,40,.46); }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dlg-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.dlg-head h2 { font-size: 15.5px; font-weight: 650; }
.dlg-close {
  width: 30px; height: 30px; border: 0; background: none; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--muted); flex: none;
}
.dlg-close:hover { background: var(--surface-2); color: var(--text); }
.dlg-body { padding: 18px 20px; overflow-y: auto; }
.dlg-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.dfield { margin-bottom: 14px; }
.dfield label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.dfield select, .dfield input, .dfield textarea {
  width: 100%; padding: 9px 12px; font: inherit; color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface);
}
.dfield textarea { min-height: 74px; resize: vertical; }
.ack {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--fair-050); border: 1px solid #F0D69A;
  border-radius: var(--r-md); padding: 11px 13px; font-size: 13px; color: #7A4A0C;
}
.ack input { margin-top: 2px; flex: none; }

/* Source preview overlay */
.srcmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 13px; }
.doc-page {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px;
  font-size: 12.5px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; max-height: 300px; overflow-y: auto;
}
.doc-foot { display: flex; justify-content: space-between; align-items: center;
            font-size: 12px; color: var(--muted); margin-top: 11px; }
.photo-full-wrap { aspect-ratio: 3/2; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.photo-full-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 760px) {
  .iw-anchors { overflow-x: auto; }
  .arow { grid-template-columns: 1fr; gap: 2px; }
  .tl-track::before { display: none; }
  .tl-track { grid-auto-flow: row; gap: 14px; }
  .tl-node { text-align: left; display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; }
  .tl-dot { margin: 0; }
  .tl-node > .tl-big, .tl-node > .tl-small, .tl-node > .tl-note { grid-column: 2; }
  .tl-note { margin-top: 0; }
}

/* ============================================================
   9. R01 — BOARD / COUNCIL DECISION SUMMARY
   F08: scanning-first — decision required -> urgency/evidence/cost
   -> why -> recommended action -> export.
   Panel 08's compact key-value card is embedded near the end.
   ============================================================ */

.r01 { max-width: 900px; }

.r01-decision {
  background: var(--navy-900); color: #fff;
  border-radius: var(--r-lg); padding: 22px 26px; margin-bottom: 16px;
}
.r01-decision .lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #8FB4E8; margin-bottom: 7px;
}
.r01-decision h2 {
  font-size: 21px; font-weight: 650; letter-spacing: -.015em; line-height: 1.3;
  text-wrap: balance;
}
.r01-decision .ctx { margin-top: 9px; font-size: 13.5px; color: #A9BAD4; }

/* Three scanning tiles */
.r01-tiles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.r01-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 15px 17px; box-shadow: var(--sh-1);
  border-top: 3px solid var(--border-2);
}
.r01-tile.t-urgency  { border-top-color: var(--poor-500); }
.r01-tile.t-evidence { border-top-color: var(--poor-500); }
.r01-tile.t-cost     { border-top-color: var(--fair-600); }
/* Declared last so it wins at equal specificity: a tile with nothing to warn
   about must not wear an alarm colour. */
.r01-tile.is-calm    { border-top-color: var(--border-2); }
.r01-tile .k {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.r01-tile .v {
  font-size: 20px; font-weight: 650; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.r01-tile .s { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.r01-tile .warn { color: var(--poor-600); }

/* Evidence roll-up inside the brief */
.r01-ev { display: grid; gap: 8px; }
.r01-evrow {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto;
  gap: 12px; align-items: center;
  padding: 9px 13px; background: var(--surface-2); border-radius: var(--r-md);
}
.r01-evname { font-size: 13px; color: var(--text-2); }

/* Panel 08 compact card */
.r01-card { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.r01-card .hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 12px;
}
.r01-card .hd h2 { font-size: 15px; font-weight: 700; color: var(--blue-700); }
.r01-kv { padding: 0 20px 8px; }
.r01-kvrow {
  display: grid; grid-template-columns: 150px minmax(0,1fr);
  gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: baseline;
}
.r01-kvrow:last-child { border-bottom: 0; }
.r01-kvrow dt { font-size: 12.5px; color: var(--muted); }
.r01-kvrow dd { margin: 0; font-size: 14px; font-weight: 600; }
.r01-kvrow dd.pos { color: var(--good-600); }
.r01-kvrow dd.neg { color: var(--poor-600); }
.r01-card .ft { padding: 10px 20px 15px; display: flex; justify-content: flex-end; }

/* Export */
.r01-export {
  display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
  margin-top: 16px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.r01-export .note { font-size: 12.5px; color: var(--muted); }
.export-done {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--good-600); font-weight: 600;
}
.export-done .ico { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .r01-tiles { grid-template-columns: 1fr; }
  .r01-kvrow { grid-template-columns: 1fr; gap: 2px; }
  .r01-evrow { grid-template-columns: 1fr; gap: 6px; }
}

/* Print — the brief is the only thing that should reach paper */
@media print {
  .rail, .iw-anchors, .r01-export, .crumb, .link-more { display: none !important; }
  body { background: #fff; }
  .app { grid-template-columns: 1fr; }
  .main { padding: 0; }
  .r01-decision { background: #fff; color: #000; border: 2px solid #000; }
  .r01-decision .lbl, .r01-decision .ctx { color: #333; }
  .card, .r01-card, .r01-tile { box-shadow: none; border-color: #999; break-inside: avoid; }
}

/* ============================================================
   10. D01–D02 — DOCUMENT TO INTELLIGENCE COMPANION
   9A2 panels 10, 11, 11A, 12, 12A.
   ============================================================ */

.doc-wrap { max-width: 860px; }

/* D01 — select / upload */
.dropzone {
  border: 2px dashed var(--border-2); border-radius: var(--r-lg);
  background: var(--surface); padding: 40px 24px; text-align: center;
  display: block; width: 100%; transition: border-color .14s ease, background .14s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue-500); background: var(--blue-050); }
.dropzone .ico { width: 26px; height: 26px; margin: 0 auto 10px; color: var(--blue-600); }
.dropzone b { display: block; font-size: 17px; font-weight: 650; color: var(--blue-600); }
.dropzone span { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }

.connect-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.connect-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-2); background: var(--surface);
  border-radius: var(--r-md); padding: 9px 14px; font-size: 13px; font-weight: 550;
}
.connect-btn:hover { background: var(--surface-2); }
.connect-btn .ico { width: 16px; height: 16px; color: var(--muted); }

.samplelist { display: grid; gap: 8px; }
.sample {
  display: grid; grid-template-columns: 30px minmax(0,1fr) auto;
  gap: 12px; align-items: center; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: 12px 15px;
}
.sample:hover { border-color: var(--blue-500); background: var(--blue-050); }
.sample .ico { width: 18px; height: 18px; color: var(--blue-600); }
.sample b { font-size: 13.5px; font-weight: 600; }
.sample span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sample em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* D01-P — processing */
.proc-head { font-size: 17px; font-weight: 650; }
.proc-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.proc-barrow { display: flex; align-items: center; gap: 14px; margin: 18px 0 10px; }
.proc-bar { flex: 1; height: 10px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.proc-fill {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--good-600); width: 0; transition: width .35s linear;
}
.proc-pct { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.proc-pages { font-size: 13px; color: var(--muted); }
.proc-steps { display: grid; gap: 11px; margin-top: 18px; }
.proc-step { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.proc-step .ico { width: 17px; height: 17px; }
.proc-step.is-done { color: var(--text); }
.proc-step.is-done .ico { color: var(--good-600); }
.proc-step.is-active { color: var(--text); font-weight: 550; }
.proc-step.is-active .dotring {
  width: 15px; height: 15px; border-radius: var(--r-pill);
  border: 2px solid var(--blue-500); border-top-color: transparent;
  animation: spin .7s linear infinite;
}
.proc-step .dotring { width: 15px; height: 15px; border-radius: var(--r-pill); border: 2px solid var(--border-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* D01-F — failure */
.fail-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--poor-600); font-size: 18px; font-weight: 700; margin-bottom: 14px;
}
.fail-head .ico { width: 22px; height: 22px; }
.fail-body { text-align: center; }
.fail-body p { font-size: 14.5px; font-weight: 600; margin-bottom: 10px; }
.fail-reasons { display: inline-block; text-align: left; font-size: 13.5px; color: var(--text-2); }
.fail-reasons li { margin: 4px 0; list-style: disc; margin-left: 18px; }
.fail-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* D02 — candidate review (F09: individual cards, inline controls) */
.cand-grid { display: grid; gap: 10px; }
.cand {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 15px 18px;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: start;
}
.cand.is-confirmed { border-color: var(--good-600); background: var(--good-050); }
.cand.is-edited    { border-color: var(--good-600); background: var(--good-050); }
.cand.is-rejected  { opacity: .62; background: var(--surface-2); }
.cand.is-deferred  { border-color: var(--fair-600); background: var(--fair-050); }

.cand-label { font-size: 13.5px; font-weight: 650; color: var(--blue-700); }
.cand-value { font-size: 15px; font-weight: 600; margin-top: 3px; }
.cand-value .pre { font-weight: 400; color: var(--muted); }
.cand-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.cand-conf {
  display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.cand-conf i { display: block; width: 42px; height: 5px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.cand-conf i b { display: block; height: 100%; border-radius: var(--r-pill); }
.cand-src { text-decoration: underline; background: none; border: 0; padding: 0; color: var(--blue-500); font-size: 12.5px; }
.cand-snippet { font-size: 12.5px; color: var(--muted); margin-top: 7px; font-style: italic; }

.cand-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: var(--r-sm); font-weight: 600;
          border: 1px solid var(--border-2); background: var(--surface); }
.btn-sm:hover { background: var(--surface-2); }
.btn-sm.solid { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn-sm.solid:hover { background: #002C86; }

.cand-state {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill);
}
.cand-state .ico { width: 12px; height: 12px; }
.cs-confirmed { background: var(--good-050); color: var(--good-600); }
.cs-edited    { background: var(--good-050); color: var(--good-600); }
.cs-rejected  { background: var(--unknown-050); color: var(--unknown-600); }
.cs-deferred  { background: var(--fair-050); color: #9A5B12; }

/* D02-E — inline edit */
.cand-edit { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cand-edit input {
  font: inherit; font-weight: 600; padding: 8px 12px; min-width: 160px;
  border: 1px solid var(--blue-500); border-radius: var(--r-md); background: var(--surface);
}

.findings-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding: 13px; border-radius: var(--r-md);
  background: var(--surface-2); font-size: 13px; color: var(--muted);
}

/* shared companion launcher */
.launcher {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px dashed var(--border-2); border-radius: var(--r-lg);
  background: var(--surface); padding: 15px 18px; margin-top: 4px;
}
.launcher .ico { width: 22px; height: 22px; color: var(--blue-600); flex: none; }
.launcher .t { flex: 1; min-width: 200px; }
.launcher b { display: block; font-size: 13.5px; font-weight: 650; }
.launcher span { font-size: 12.5px; color: var(--muted); }

/* transient confirmations for simulated behaviour */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--navy-900); color: #fff; padding: 12px 18px;
  border-radius: var(--r-md); box-shadow: var(--sh-3); z-index: 200;
  font-size: 13.5px; display: flex; align-items: center; gap: 9px; max-width: 90vw;
}
.toast .ico { width: 16px; height: 16px; color: #7FD3A6; }

@media (max-width: 700px) {
  .cand { grid-template-columns: 1fr; }
  .cand-actions { justify-content: flex-start; }
}

/* ============================================================
   11. I01–I04 — FIELD INSPECTION COMPANION
   9A2 panels 14–17 and 17A. Responsive web, not a native app.
   ============================================================ */

.insp-wrap { max-width: 900px; }

/* Stepper */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.step-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-pill); padding: 6px 14px 6px 8px;
  font-size: 12.5px; font-weight: 550; color: var(--muted);
}
.step-chip .n {
  width: 20px; height: 20px; border-radius: var(--r-pill); flex: none;
  background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.step-chip.is-done { color: var(--good-600); border-color: var(--good-050); background: var(--good-050); }
.step-chip.is-done .n { background: var(--good-600); color: #fff; }
.step-chip.is-current { color: #fff; background: var(--navy-900); border-color: var(--navy-900); }
.step-chip.is-current .n { background: rgba(255,255,255,.22); color: #fff; }

/* Panel 14 — desktop web entry */
.insp-entry { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0; }
.insp-form { padding: 20px 22px; }
.insp-photo { background: var(--surface-2); }
.insp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 300px; }
.insp-field { margin-bottom: 13px; }
.insp-field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.insp-field select, .insp-field input {
  width: 100%; padding: 9px 12px; font: inherit; color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface);
}

/* Device frame — makes the narrow layout read as intentional on desktop */
.device {
  width: 372px; max-width: 100%; margin: 0 auto;
  background: var(--navy-900); border-radius: 30px; padding: 12px;
  box-shadow: var(--sh-3);
}
.device-screen {
  background: var(--surface); border-radius: 20px; overflow: hidden;
  min-height: 560px; display: flex; flex-direction: column;
}
.device-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }

/* Panel 15 — camera viewfinder */
.viewfinder { position: relative; flex: 1; background: #0B121C; display: flex; flex-direction: column; }
.viewfinder img { width: 100%; flex: 1; object-fit: cover; display: block; }
.vf-top {
  position: absolute; top: 0; left: 0; right: 0; padding: 14px 16px;
  display: flex; justify-content: space-between; color: #fff;
}
.vf-top .ico { width: 18px; height: 18px; }
.vf-controls {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 18px 16px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(transparent, rgba(8,15,26,.85));
}
.vf-btn {
  background: rgba(20,32,50,.85); color: #fff; border: 0;
  border-radius: var(--r-pill); padding: 9px 16px; font-size: 13px; font-weight: 600;
}
.vf-btn:hover { background: rgba(30,46,70,.95); }
.vf-shutter {
  width: 56px; height: 56px; border-radius: var(--r-pill); flex: none;
  background: #fff; border: 4px solid rgba(255,255,255,.4);
  display: grid; place-items: center; color: var(--navy-900);
}
.vf-shutter .ico { width: 22px; height: 22px; }

/* Panel 16 — mobile observation form */
.m-form { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.m-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 0; font-size: 14px; font-weight: 650;
}
.m-thumb { border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; aspect-ratio: 16/10; background: var(--surface-2); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-form .insp-field { margin-bottom: 11px; }
.m-form .btn-solid { width: 100%; margin-top: auto; }

/* Panel 17 — mobile result */
.m-saved {
  display: flex; align-items: center; gap: 9px; justify-content: center;
  background: var(--good-050); color: var(--good-600);
  font-weight: 650; font-size: 14.5px; padding: 13px;
}
.m-saved .ico { width: 18px; height: 18px; }
.m-result { padding: 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.m-row .k { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.m-row .v { font-size: 15px; font-weight: 600; }
.m-row .sub { font-size: 13px; color: var(--muted); }

/* I04 — resulting attention (web) */
.result-card { border: 1px solid var(--good-600); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.result-head {
  background: var(--good-050); color: var(--good-600);
  padding: 13px 20px; font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; gap: 9px;
}
.result-head .ico { width: 18px; height: 18px; }
.result-body { padding: 18px 20px; }
.result-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 650; margin-bottom: 12px; }
.result-title .attn-badge { width: 26px; height: 26px; }
.result-meta { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 8px 14px; font-size: 14px; }
.result-meta dt { color: var(--muted); font-size: 13px; }
.result-meta dd { margin: 0; font-weight: 600; }
.result-foot {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 15px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}

@media (max-width: 760px) {
  .insp-entry { grid-template-columns: 1fr; }
  .insp-photo img { min-height: 200px; }
  .device { width: 100%; border-radius: 0; padding: 0; background: transparent; box-shadow: none; }
  .device-screen { border-radius: var(--r-lg); min-height: 0; }
  .device-note { display: none; }
  .result-meta { grid-template-columns: 1fr; gap: 2px; }
  .result-meta dd { margin-bottom: 8px; }
}

/* ============================================================
   12. C01 / C02 — COMPLETION AND CLOSED LOOP
   9A2 panel 18. Secondary flow (F12), fully built but outside the
   primary two-minute walkthrough.
   ============================================================ */

.done-wrap { max-width: 860px; }

.progress-track { display: flex; gap: 0; margin: 4px 0 18px; flex-wrap: wrap; }
.progress-node {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px 8px 10px;
  font-size: 12.5px; font-weight: 550; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  margin-right: -1px;
}
.progress-node:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); padding-left: 14px; }
.progress-node:last-child  { border-radius: 0 var(--r-pill) var(--r-pill) 0; margin-right: 0; }
.progress-node .d { width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--border-2); flex: none; }
.progress-node.is-past    { color: var(--good-600); background: var(--good-050); border-color: #CFE7D8; }
.progress-node.is-past .d { background: var(--good-600); }
.progress-node.is-now     { color: #fff; background: var(--navy-900); border-color: var(--navy-900); }
.progress-node.is-now .d  { background: #7FD3A6; }

.evidence-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ev-thumb {
  width: 96px; height: 78px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); padding: 0;
}
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-more {
  width: 96px; height: 78px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 16px; font-weight: 650; color: var(--muted);
}

/* Before / after state change */
.change-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.change-col {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; background: var(--surface);
}
.change-col.before { opacity: .8; }
.change-col.after { border-color: var(--good-600); background: var(--good-050); }
.change-col .lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 9px;
}
.change-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.change-row .k { color: var(--muted); }
.change-row .v { font-weight: 600; text-align: right; }
.change-arrow { color: var(--muted); display: grid; place-items: center; }
.change-arrow .ico { width: 22px; height: 22px; }

.history-preserved { margin-top: 16px; }
.history-row {
  display: grid; grid-template-columns: 110px minmax(0,1fr);
  gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.history-row:last-child { border-bottom: 0; }
.history-row .d { color: var(--muted); font-size: 12.5px; }
.history-row b { font-weight: 600; }
.history-row span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

@media (max-width: 700px) {
  .change-grid { grid-template-columns: 1fr; }
  .change-arrow { transform: rotate(90deg); }
  .history-row { grid-template-columns: 1fr; gap: 2px; }
}
