/* ============================================================
   MCEL JSA — Visual System
   Clean enterprise safety SaaS. White surfaces, slate ink,
   industrial-blue primary action, strict green/amber/red risk.
   ============================================================ */

:root {
  /* ===== Morgan brand (MAR-006-R01) =====
     Morgan Black #000000 (primary/interactive), Morgan Red #E6281A
     (brand mark + high-risk danger only), grey neutrals. */

  /* Primary / action — Morgan Black (≈#000; nudged for hover headroom) */
  --accent: #161616;
  --accent-700: #000000;
  --accent-100: #e7e7e7;
  --accent-050: #f4f4f4;

  /* Morgan Red — reserved for brand + danger */
  --morgan-red: #E6281A;

  /* Risk semantics — functional green/amber + Morgan Red for High */
  --risk-low: #1f8a4c;
  --risk-low-bg: color-mix(in srgb, var(--risk-low) 13%, #fff);
  --risk-med: #c77a00;
  --risk-med-bg: color-mix(in srgb, var(--risk-med) 14%, #fff);
  --risk-high: #E6281A;
  --risk-high-bg: color-mix(in srgb, var(--risk-high) 11%, #fff);

  /* Ink + surfaces — Morgan greys */
  --ink: #141414;
  --ink-2: #4F4F4F;
  --ink-3: #707070;
  --ink-4: #9b9b9b;
  --line: #E5E5E5;
  --line-2: #f0f0f0;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --canvas: #e9e9e9;

  /* Status */
  --ok: #1f8a4c;
  --warn: #c77a00;
  --danger: #E6281A;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(18,32,46,.06), 0 1px 3px rgba(18,32,46,.05);
  --shadow-md: 0 4px 14px rgba(18,32,46,.08), 0 2px 6px rgba(18,32,46,.05);
  --shadow-lg: 0 18px 48px rgba(18,32,46,.18), 0 6px 16px rgba(18,32,46,.10);

  /* Morgan type — Roboto (headings/subheads), Montserrat (body), Roboto Mono (data) */
  --font-display: "Roboto", system-ui, sans-serif;
  --font-sans: "Montserrat", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* Stage holding the device/browser frames */
.stage {
  min-height: 100vh;
  width: 100%;
  background:
    radial-gradient(1200px 600px at 50% -10%, #f1f1f1, transparent),
    var(--canvas);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 16px 80px;
}

/* Switcher row (device + role pills) */
.switch-row { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; flex: none; }
.switch-row .role-switch { margin-bottom: 0; }

/* Device switcher (links between phone / tablet versions) */
.device-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  gap: 2px;
}
.device-switch a, .device-switch button {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 13.5px;
  font-family: var(--font-sans);
  letter-spacing: .01em;
  padding: 9px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .16s ease;
}
.device-switch a:hover, .device-switch button:hover { color: var(--ink); }
.device-switch a.on, .device-switch button.on {
  background: var(--ink);
  color: #fff;
}

/* Role switcher */
.role-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  gap: 2px;
  margin-bottom: 24px;
}
.role-switch button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .01em;
  padding: 9px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .16s ease;
}
.role-switch button.on {
  background: var(--ink);
  color: #fff;
}
.role-switch button .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; opacity: .55;
}

/* ---------- Phone frame ---------- */
.phone {
  width: 412px;
  height: 868px;
  background: #0c1116;
  border-radius: 52px;
  padding: 13px;
  box-shadow: var(--shadow-lg);
  position: relative;
  flex: none;
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-notch {
  position: absolute;
  top: 13px; left: 50%; transform: translateX(-50%);
  width: 122px; height: 30px;
  background: #0c1116;
  border-radius: 0 0 18px 18px;
  z-index: 60;
}
.phone-toast {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 80; background: var(--ink); color: #fff;
  border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 9px; max-width: 80%;
  box-shadow: var(--shadow-lg); animation: phoneToastIn .26s ease;
}
@keyframes phoneToastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.statusbar {
  flex: none;
  height: 50px;
  padding: 14px 30px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2);
  z-index: 50;
}
.statusbar .sb-icons { display: flex; gap: 7px; align-items: center; }

/* Scroll region inside phone */
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.screen-scroll::-webkit-scrollbar { width: 0; }

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
}
.appbar .back {
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--ink-2);
  flex: none;
}
.appbar h1 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; margin: 0;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.appbar .sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

/* Generic */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-4);
}
.mono { font-family: var(--font-mono); }

/* Buttons */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: filter .15s ease, background .15s ease, transform .05s ease;
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.7); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 16px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Risk chip */
.risk {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-weight: 600; font-size: 12.5px;
  padding: 4px 9px; border-radius: 7px;
  letter-spacing: .02em;
}
.risk-low { background: var(--risk-low-bg); color: var(--risk-low); }
.risk-med { background: var(--risk-med-bg); color: var(--risk-med); }
.risk-high { background: var(--risk-high-bg); color: var(--risk-high); }
.risk .lvl { width: 7px; height: 7px; border-radius: 2px; background: currentColor; }

/* Pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}

/* Progress bar */
.prog { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.prog.done > i { background: var(--risk-low); }

/* Inputs */
.field { display: block; }
.field label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px;
}
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: 14.5px; color: var(--ink); background: var(--surface);
  outline: none; transition: border .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-100);
}

/* Toggle */
.toggle {
  width: 46px; height: 28px; border-radius: 999px; background: var(--line);
  border: 0; padding: 0; position: relative; flex: none; transition: background .18s ease;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease;
}
.toggle.on { background: var(--risk-low); }
.toggle.on::after { transform: translateX(18px); }

/* Checkbox */
.check {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line);
  background: var(--surface); display: grid; place-items: center; flex: none;
  transition: all .14s ease; color: #fff;
}
.check.on { background: var(--accent); border-color: var(--accent); }
.check svg { opacity: 0; transform: scale(.6); transition: all .14s ease; }
.check.on svg { opacity: 1; transform: scale(1); }

/* Offline banner */
.netbanner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: #fff;
}
.netbanner.off { background: #b4690e; }
.netbanner.on { background: var(--risk-low); }
.netbanner .ring { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.netbanner.off .ring { animation: pulse 1.4s ease infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Desktop dashboard */
.dash {
  background: var(--canvas);
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 14px;
}
.dash-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.dash-side {
  width: 248px; flex: none; background: var(--ink); color: #cfcfcf;
  padding: 22px 16px; display: flex; flex-direction: column; gap: 4px;
}
.dash-main { flex: 1; padding: 26px 30px 60px; overflow-x: hidden; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dash-table th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.dash-table td { padding: 12px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: 0; }

/* Skeleton loading placeholder — shimmer sweep over a flat bar. */
.skel {
  position: relative; overflow: hidden; display: inline-block;
  background: var(--line-2); border-radius: 5px; vertical-align: middle;
}
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: skel-sweep 1.3s ease-in-out infinite;
}
@keyframes skel-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.scrim {
  position: absolute; inset: 0; background: rgba(12,18,24,.5);
  z-index: 80; display: flex; align-items: flex-end;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--surface); width: 100%;
  border-radius: 24px 24px 0 0; max-height: 92%;
  display: flex; flex-direction: column;
  animation: slideup .26s cubic-bezier(.2,.7,.3,1);
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grab { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 10px auto 4px; }

.fade-in { animation: fade .26s ease; }
@keyframes screenIn { from { transform: translateY(7px); } to { transform: translateY(0); } }
.screen-in { animation: screenIn .26s ease; }

/* ============================================================
   AI-guided JSA (Option B)
   ============================================================ */
.ai-modeseg {
  display: flex; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 3px; gap: 3px; margin-bottom: 16px;
}
.ai-modeseg button {
  flex: 1; border: 0; background: transparent;
  font-family: var(--font-sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3);
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .15s ease;
}
.ai-modeseg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.ai-modeseg button .spk { color: var(--morgan-red, #E6281A); }

.ai-wrap { max-width: 560px; margin: 0 auto; padding: 26px 22px 30px; animation: aiIn .3s ease; }
@keyframes aiIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.ai-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.ai-eyebrow svg { color: var(--morgan-red, #E6281A); }
.ai-prog { height: 4px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-bottom: 22px; }
.ai-prog i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.ai-title {
  font-family: var(--font-display); font-size: 24px; font-weight: 800;
  letter-spacing: -.015em; line-height: 1.15; margin: 0 0 8px; color: var(--ink);
  text-wrap: pretty;
}
.ai-sub { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.ai-opts { display: flex; flex-direction: column; gap: 10px; }
.ai-opt {
  display: flex; align-items: center; gap: 13px; width: 100%;
  text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 15px 16px; font-family: var(--font-sans); font-size: 15px; font-weight: 600; color: var(--ink);
  transition: border-color .14s ease, background .14s ease, transform .1s ease;
  min-height: 54px;
}
.ai-opt:hover { border-color: #c6c6c6; }
.ai-opt:active { transform: scale(.99); }
.ai-opt.on { border-color: var(--accent); background: var(--accent-050); }
.ai-opt-ic {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2);
}
.ai-opt.on .ai-opt-ic { background: var(--accent); color: #fff; }
.ai-opt-check {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--accent); opacity: 0; transform: scale(.6);
  transition: all .16s ease;
}
.ai-opt.on .ai-opt-check { opacity: 1; transform: scale(1); }
.ai-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; min-height: 40px; }
.ai-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; color: var(--ink-3);
  padding: 8px 6px;
}
.ai-back:hover { color: var(--ink); }
.ai-grounding {
  display: flex; align-items: center; gap: 7px; margin-top: 22px;
  font-size: 11.5px; color: var(--ink-4); line-height: 1.4;
}

/* review */
.ai-review { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 20px; background: var(--surface); }
.ai-review-row { display: flex; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.ai-review-row:last-child { border-bottom: 0; background: var(--surface-2); }
.ai-review-q { flex: none; width: 38%; font-size: 12px; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: .03em; line-height: 1.35; padding-top: 1px; }
.ai-review-a { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }

/* build animation */
.ai-build { max-width: 480px; margin: 0 auto; padding: 44px 24px; text-align: center; animation: aiIn .3s ease; }
.ai-build-mark {
  width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 8px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  position: relative; animation: aiMarkPulse 1.6s ease-in-out infinite;
}
.ai-build-mark.ready { background: var(--risk-low); animation: none; }
@keyframes aiMarkPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,.18); }
  50% { box-shadow: 0 0 0 14px rgba(0,0,0,0); }
}
.ai-build-refs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; min-height: 30px; }
.ai-refchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; opacity: 0;
  animation: aiChipIn .4s ease forwards;
}
.ai-refchip b { color: var(--accent); font-weight: 700; }
@keyframes aiChipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.ai-build-steps { display: flex; flex-direction: column; gap: 12px; margin: 22px auto 24px; max-width: 400px; text-align: left; }
.ai-build-step {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 13.5px; line-height: 1.4; color: var(--ink-4); font-weight: 500;
  transition: color .25s ease;
}
.ai-build-step.now { color: var(--ink); font-weight: 600; }
.ai-build-step.done { color: var(--ink-2); }
.ai-step-dot {
  width: 19px; height: 19px; border-radius: 50%; flex: none; margin-top: 1px;
  display: grid; place-items: center;
  border: 2px solid var(--line); color: #fff;
  transition: all .25s ease;
}
.ai-build-step.now .ai-step-dot { border-color: var(--accent); animation: aiSpin 1s linear infinite; border-top-color: transparent; }
.ai-build-step.done .ai-step-dot { background: var(--risk-low); border-color: var(--risk-low); }
@keyframes aiSpin { to { transform: rotate(360deg); } }
.ai-build-bar { height: 5px; border-radius: 999px; background: var(--line-2); overflow: hidden; max-width: 400px; margin: 0 auto; }
.ai-build-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .9s ease; }

/* ---------- Live AI flow (ai-jsa-live.jsx) ---------- */
.ai-live { display: flex; flex-direction: column; height: 100%; }
.ai-live-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.ai-live-close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.ai-live-close:hover { border-color: #c6c6c6; }
.ai-live-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: #fff; background: var(--risk-high); padding: 3px 8px; border-radius: 999px; }
.ai-live .ai-wrap, .ai-live .ai-build { flex: 1; overflow-y: auto; }

.ai-bar-indet { width: 40%; animation: aiIndet 1.1s ease-in-out infinite; }
@keyframes aiIndet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* Indented intake-question groups */
.ai-qgroup { margin-bottom: 16px; }
.ai-qgroup-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-4); margin: 0 2px 8px; }

/* Inputs on the connect screen */
.ai-field-label { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-4); margin: 14px 2px 5px; }
.ai-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); background: var(--surface); box-sizing: border-box; }
.ai-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-100); }

.ai-opt-meta { display: block; font-size: 11.5px; color: var(--ink-4); margin-top: 2px; line-height: 1.35; }

.ai-empty { display: flex; gap: 9px; align-items: flex-start; padding: 13px 15px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-3); font-size: 13px; line-height: 1.45; background: var(--surface-2); }
.ai-empty.err { border-color: var(--risk-high); color: var(--risk-high); background: var(--risk-high-bg); border-style: solid; }

/* ============================================================
   Official JSA sheet — the full-sheet view (JsaDetailView) rendered to
   match the Morgan JSA form (header block, critical questions, the 8-column
   hazard table grouped by section, per-section sign-off, footer). Same markup
   prints to PDF via Export (see print rules below).
   ============================================================ */
.jsa-sheet { font-size: 12px; color: var(--ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.jsa-meta { width: 100%; border-collapse: collapse; margin-bottom: 12px; table-layout: fixed; }
.jsa-meta td { border: 1px solid var(--line); padding: 6px 9px; vertical-align: top; width: 33.33%; }
.jsa-meta .lbl, .jsa-crit .lbl, .jsa-foot .lbl { display: block; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-4); margin-bottom: 2px; }
.jsa-meta .val { font-size: 13px; font-weight: 600; }
.jsa-crit { border: 1px solid var(--line); padding: 8px 10px; margin-bottom: 14px; }
.jsa-crit ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; font-size: 12px; }
.jsa-form { width: 100%; border-collapse: collapse; table-layout: fixed; }
.jsa-form th, .jsa-form td { border: 1px solid var(--line); padding: 5px 7px; vertical-align: top; text-align: left; font-size: 11.5px; line-height: 1.35; overflow-wrap: anywhere; }
.jsa-form th { background: var(--surface-2); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.jsa-form tr.jsa-secrow td { background: #ecebe8; font-size: 12.5px; }
.jsa-form tr.jsa-signrow td { background: var(--surface-2); }
.jsa-signhead { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); margin-bottom: 8px; }
.jsa-signhead .cnt { margin-left: 6px; font-weight: 700; color: var(--ink-4); text-transform: none; letter-spacing: 0; }
.jsa-signnote { color: var(--ink-3); font-size: 12px; }
.jsa-sigrow { display: flex; flex-wrap: wrap; gap: 10px; }
.jsa-foot { margin-top: 16px; display: grid; gap: 12px; }
.jsa-foot-block { border: 1px solid var(--line); padding: 9px 11px; }
.jsa-foot-block p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }

/* ---- Static reference appendix (1:1 with the paper form) ---- */
.jsa-appx { margin-top: 16px; display: grid; gap: 14px; }
.jsa-appx > section { border: 1px solid var(--line); padding: 10px 12px; }
.jsa-appx h3 { margin: 0 0 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.jsa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px 16px; font-size: 11.5px; }
.jsa-defs { display: grid; gap: 6px; font-size: 11.5px; line-height: 1.45; }
.jsa-defs b { color: var(--ink); }
.jsa-defs .ex { color: var(--ink-3); }
.jsa-matrix { width: 100%; border-collapse: collapse; font-size: 10.5px; table-layout: fixed; margin-bottom: 8px; }
.jsa-matrix th, .jsa-matrix td { border: 1px solid var(--line); padding: 4px 5px; text-align: center; vertical-align: middle; }
.jsa-matrix th { background: var(--surface-2); font-weight: 700; }
.jsa-matrix th.cons { text-align: left; font-weight: 600; }
.jsa-matrix td.low  { background: var(--risk-low-bg);  color: var(--risk-low);  font-weight: 700; }
.jsa-matrix td.med  { background: var(--risk-med-bg);  color: var(--risk-med);  font-weight: 700; }
.jsa-matrix td.high { background: var(--risk-high-bg); color: var(--risk-high); font-weight: 700; }
.jsa-refs { width: 100%; border-collapse: collapse; font-size: 11.5px; table-layout: fixed; }
.jsa-refs th, .jsa-refs td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.jsa-refs th { background: var(--surface-2); font-weight: 700; }

/* ---- Print / PDF export: strip app chrome, keep rows off page breaks ---- */
.print-only { display: none; }
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  .jsa-detail-scroll { height: auto !important; overflow: visible !important; }
  .jsa-sheet-wrap { padding: 0 !important; max-width: none !important; }
  body, .dash-app-root { background: #fff !important; }
  @page { size: landscape; margin: 10mm; }
  .jsa-secrow, .jsa-signrow, .jsa-sig, tr, .jsa-appx > section, .jsa-matrix { break-inside: avoid; }
  .jsa-form th, .jsa-matrix th, .jsa-refs th, .jsa-matrix td.low, .jsa-matrix td.med, .jsa-matrix td.high { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
