/* styles.css — Biofouling Compliance Copilot. Mobile-first, no external CDNs.
   "Port Authority" visual direction, elevated: deep-navy chrome, serious-blue
   machined controls, layered depth (shadow + soft gradients), 6px controls /
   12px surfaces, mono for data, quiet one-shot motion. The goal is a maritime
   regulatory instrument panel — engineered, not decorated. Tokens drive both
   pages + the JS-rendered report. */

:root {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --ink: #111c27;
  --ink-soft: #344656;
  --muted: #51616f;
  --line: #dbe2ea;
  --line-strong: #94a3b4;
  --field-bg: #ffffff;
  --brand: #0f2940;
  --brand-dark: #091724;
  --accent: #005bb8;
  --accent-dark: #00468f;
  --accent-weak: rgba(0, 91, 184, 0.15);
  --warn-bg: #fff7e6;
  --warn-ink: #6b4a08;
  --warn-line: #e9c46a;
  --low: #15803d;
  --low-bg: #e7f6ee;
  --med: #b45309;
  --med-bg: #fdf3e0;
  --high: #b3261e;
  --high-bg: #fdecea;

  /* Radius system: sharp-but-modern 6px on controls/data, a larger 12px on
     structural surfaces (panels, chat column, big textareas). 4px read dead. */
  --radius: 6px;
  --radius-lg: 12px;

  /* Depth scale — realistic multi-layer shadows so surfaces sit ON the page
     instead of being pasted flat. Kept low-opacity and tight (institutional,
     not floaty-SaaS). --shadow kept as an alias for anything still reading it. */
  --shadow-ring: 0 0 0 1px rgba(9, 23, 36, 0.06);
  --shadow-sm: 0 1px 2px rgba(9, 23, 36, 0.06), 0 1px 3px rgba(9, 23, 36, 0.09);
  --shadow-md: 0 2px 4px rgba(9, 23, 36, 0.04), 0 5px 12px rgba(9, 23, 36, 0.08);
  --shadow-lg: 0 10px 24px -6px rgba(9, 23, 36, 0.12), 0 4px 8px -4px rgba(9, 23, 36, 0.06);
  --shadow: var(--shadow-sm);

  /* Surface + control gradients — a single soft top-to-bottom light, no candy. */
  --highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --surface-grad: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  --btn-primary-grad: linear-gradient(180deg, #1e72cf 0%, #005bb8 100%);
  --btn-primary-grad-hover: linear-gradient(180deg, #2a80e0 0%, #0a66c8 100%);
  --btn-secondary-grad: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
  --page-grad: linear-gradient(180deg, #f4f7fb 0%, #eaf0f6 100%);

  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* Aliases consumed by chat.css via var(--name, fallback) so the chat page
     tracks the same brand tokens. styles.css itself does not read these. */
  --border: var(--line);
  --text: var(--ink);
  --page-bg: var(--bg);
  --panel-bg: var(--panel);
  --bot-bg: #eef2f7;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  /* Faint cool wash so cards read as elevated against the page, not floating in white. */
  background: var(--bg);
  background-image: var(--page-grad);
  background-attachment: fixed;
  line-height: 1.5;
}

a { color: var(--accent); }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* ---- Header + persistent disclaimer ---- */
/* Institutional maritime chrome: layered navy gradient + a faint control-grid
   texture (2% white) + a serious accent rule and drop shadow, so the masthead
   reads like a port-authority control panel rather than a flat black bar. */
header.site {
  background-color: var(--brand-dark);
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Cpath%20d='M32%200H0v32'%20fill='none'%20stroke='rgba(255,255,255,0.03)'%20stroke-width='1'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #0c2236 0%, var(--brand) 100%);
  color: #ffffff;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 6px 18px rgba(9, 23, 36, 0.18);
  position: relative;
  z-index: 1;
}
header.site .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 14px;
}
header.site h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
/* Small maritime monogram before the wordmark — a port-authority seal /
   porthole: domed navy disc, inner white hairline, accent-blue rim. Pure CSS
   (both pages get it without markup edits); all-opaque gradient stops, so no
   transparent-interpolation fringe. */
header.site h1::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #2f74c4 0%, #0c2236 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    0 0 0 1.5px var(--accent), 0 1px 2px rgba(0, 0, 0, 0.4);
}
header.site .tagline {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #b6c6d6;
}
.disclaimer-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-bottom: 1px solid var(--warn-line);
  font-size: 0.86rem;
}
.disclaimer-banner .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.disclaimer-banner strong { white-space: nowrap; }

/* ---- Panels ---- */
/* "Report dossier" surfaces: soft elevation + a 3px navy ribbon along the top
   edge (drawn as an inset shadow so it follows the rounded corners cleanly,
   unlike a border-top which leaves a corner hook). */
.panel {
  position: relative;
  background: var(--surface-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), inset 0 3px 0 0 var(--brand);
  padding: 26px 24px 24px;
  margin-top: 20px;
}
.panel > h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: var(--brand-dark);
  letter-spacing: -0.2px;
}
.panel > .sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- Form ---- */
form .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) {
  form .grid { grid-template-columns: 1fr 1fr; }
  form .grid .full { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.86rem; color: var(--ink); }
.field .hint { font-size: 0.78rem; color: var(--muted); }
.field input[type="text"],
.field input[type="number"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(9, 23, 36, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: #6b7785; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  /* Transparent outline stays invisible normally but renders as the system
     highlight colour in Windows forced-colors mode (where box-shadow is dropped). */
  outline: 2px solid transparent;
  outline-offset: 1px;
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(9, 23, 36, 0.04), 0 0 0 3px var(--accent-weak);
}
.field textarea { min-height: 80px; resize: vertical; }
.checkbox-row { flex-direction: row; align-items: center; gap: 8px; }
.checkbox-row label { font-weight: 600; }

/* Fieldsets as top-border section separators (no full boxes). The legend is
   floated full-width so it reads as a heading BELOW the rule, not straddling it. */
fieldset {
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin: 18px 0 0;
  padding: 0;
}
fieldset legend {
  float: left;
  width: 100%;
  padding: 14px 0 12px;
  margin: 0;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
fieldset legend::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.78em;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -1px;
}
fieldset > .grid { clear: both; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
/* ---- Buttons: machined controls, not flat rectangles ---- */
/* Each variant gets a soft vertical gradient, a crisp 1px border, a 1px top
   highlight and a tight shadow so it reads as a physical control. Hover lifts
   1px and deepens; :active presses down with an inset shadow. Motion is removed
   wholesale by the prefers-reduced-motion guard at the foot of this file. */
button {
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease,
    background-image 0.15s ease;
}
button:focus-visible {
  /* A real accent outline: visible in normal mode AND forced to a system colour
     in Windows high-contrast. Using outline (not box-shadow) keeps the ring from
     being overridden by the hover/active box-shadow rules below, and it never
     collides with the buttons' depth shadow. */
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:active:not(:disabled) { transform: translateY(1px); }

button.primary {
  background-color: var(--accent);
  background-image: var(--btn-primary-grad);
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: var(--shadow-sm), var(--highlight-top);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}
button.primary:hover:not(:disabled) {
  background-image: var(--btn-primary-grad-hover);
  box-shadow: var(--shadow-md), var(--highlight-top);
  transform: translateY(-1px);
}
button.primary:active:not(:disabled) {
  background-image: none;
  background-color: var(--accent-dark);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.22);
}
button.primary:disabled {
  background-image: none;
  background-color: #8aa9c9;
  border-color: #7c9bbb;
  box-shadow: none;
  text-shadow: none;
  cursor: progress;
}

button.secondary {
  background-color: #ffffff;
  background-image: var(--btn-secondary-grad);
  color: var(--brand-dark);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm), inset 0 1px 0 #fff;
}
button.secondary:hover:not(:disabled) {
  background-image: linear-gradient(180deg, #ffffff 0%, #e6edf5 100%);
  border-color: var(--muted);
  box-shadow: var(--shadow-md), inset 0 1px 0 #fff;
  transform: translateY(-1px);
}
button.secondary:active:not(:disabled) {
  background-image: none;
  background-color: #e7eef5;
  box-shadow: inset 0 2px 3px rgba(9, 23, 36, 0.08);
}
button.secondary:disabled, .mars-gen-btn[aria-busy="true"] {
  opacity: 0.6;
  box-shadow: none;
  cursor: progress;
}

.mode-pill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}
.mode-pill {
  box-shadow: var(--shadow-sm);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.mode-pill.live { background: var(--low-bg); color: var(--low); border-color: #bfe3cd; }
.mode-pill.mock { background: var(--med-bg); color: var(--med); border-color: var(--warn-line); }

/* Coherent low-key elevation across the status-chip family. */
.draft-tag,
.enrich-hero-badge,
.band-pill,
.est-badge,
.mars-pill,
.dq,
.conf-pill {
  box-shadow: var(--shadow-ring);
}
.enrich-hero-badge {
  background-image: linear-gradient(180deg, #1e72cf 0%, var(--accent) 100%);
  box-shadow: var(--shadow-sm), var(--highlight-top);
}

/* ---- Error state ---- */
.error-box {
  margin-top: 16px;
  border: 1px solid #f0b4af;
  background: var(--high-bg);
  color: var(--high);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
}

/* ---- DRAFT marker ---- */
.draft-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--high);
  background: var(--high-bg);
  border: 1px solid #f0b4af;
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
  margin-left: 8px;
}

/* ---- Risk gauge / band ---- */
.risk-head {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.gauge {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  background: conic-gradient(var(--gauge-color) calc(var(--score) * 1%), #e7edf1 0);
  box-shadow: inset 0 2px 6px rgba(9, 23, 36, 0.18), 0 1px 2px rgba(9, 23, 36, 0.06);
}
.gauge::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #ffffff 0%, #f4f7fa 100%);
  box-shadow: 0 2px 6px rgba(9, 23, 36, 0.12);
}
.gauge .num {
  position: relative;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--gauge-color);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}
.gauge .den { position: relative; font-size: 0.8rem; color: var(--muted); }
.gauge .gauge-inner { position: relative; text-align: center; }

.band-block { flex: 1 1 240px; }
.band-pill {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
}
.band-LOW { background: var(--low-bg); color: var(--low); border: 1px solid #bfe3cd; }
.band-MEDIUM { background: var(--med-bg); color: var(--med); border: 1px solid var(--warn-line); }
.band-HIGH { background: var(--high-bg); color: var(--high); border: 1px solid #f0b4af; }
.gauge.band-LOW { --gauge-color: var(--low); }
.gauge.band-MEDIUM { --gauge-color: var(--med); }
.gauge.band-HIGH { --gauge-color: var(--high); }

.likelihood { margin: 8px 0 0; color: var(--ink); font-size: 0.92rem; }
.narrative { margin-top: 14px; }
.narrative p { margin: 0; }

/* ---- Missing inputs callout ---- */
.missing-callout {
  margin-top: 14px;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
}
.missing-callout ul { margin: 6px 0 0; padding-left: 20px; }

/* ---- Driver table ---- */
.table-scroll { overflow-x: auto; margin-top: 14px; }
table.drivers {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 640px;
}
table.drivers th,
table.drivers td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.drivers thead th {
  background: #eef4f8;
  color: var(--brand-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--line-strong);
}
table.drivers tbody tr { transition: background 0.12s ease; }
table.drivers tbody tr:hover { background: #f6f9fc; }
table.drivers td.num, table.drivers th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dq {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dq-high { background: var(--low-bg); color: var(--low); }
.dq-medium { background: #eaf1f6; color: var(--brand-dark); }
.dq-low { background: var(--med-bg); color: var(--med); }
.dq-missing { background: var(--high-bg); color: var(--high); }
.driver-comment { color: var(--muted); margin-top: 4px; font-size: 0.82rem; }

/* ---- Declaration ---- */
.practice-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: #f6fafb;
  border-radius: var(--radius);
  padding: 12px 14px 12px 16px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 2px rgba(9, 23, 36, 0.03);
}
.practice-card .label { font-weight: 700; color: var(--brand-dark); }
.practice-card .basis { color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
.practice-card .key { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }

/* "Meets none of the three" elevated-risk outcome — visually distinct from a
   normal endorsed practice and from the hallucinated-key manual-review state. */
.practice-card.non-demonstrated {
  background: var(--high-bg);
  border-color: #f0b4af;
}
.practice-card.non-demonstrated .label { color: var(--high); }
/* Hallucinated / unknown key: amber "needs a human" accent. */
.practice-card.manual-review {
  background: #fff7e6;
  border-color: #f0d28a;
}

textarea.decl {
  width: 100%;
  min-height: 220px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--ink);
  resize: vertical;
}

.list-block { margin-top: 14px; }
.list-block h4 { margin: 0 0 6px; font-size: 0.9rem; color: var(--brand-dark); }
.list-block ul { margin: 0; padding-left: 20px; font-size: 0.88rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list .tag {
  font-family: var(--mono);
  font-size: 0.76rem;
  background: #eef4f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}

/* ---- Citations ---- */
table.cites { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 6px; }
table.cites th, table.cites td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top;
}
table.cites thead th { background: #f2f7f9; color: var(--brand-dark); font-size: 0.76rem; text-transform: uppercase; }
.src-ref { font-family: var(--mono); font-size: 0.78rem; }
.src-none { color: var(--high); font-weight: 700; font-size: 0.78rem; }

/* ---- Cleaning record ---- */
.record-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 6px;
  box-shadow: var(--shadow-ring);
}
@media (min-width: 640px) {
  .record-grid { grid-template-columns: 260px 1fr; }
}
.record-grid .rk, .record-grid .rv {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}
.record-grid .rk { background: #f6fafb; font-weight: 600; color: var(--brand-dark); }
.record-grid .rv { background: #fff; }
.record-grid .rv.todo { color: var(--med); font-style: italic; }

.confidence {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.confidence .conf-pill {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.confidence .conf-high { background: var(--low-bg); color: var(--low); }
.confidence .conf-medium { background: var(--med-bg); color: var(--med); }
.confidence .conf-low { background: var(--high-bg); color: var(--high); }

.caveats-block { margin-top: 16px; }
.caveats-block ul { margin: 6px 0 0; padding-left: 20px; font-size: 0.86rem; color: var(--ink); }

.meta-manifest {
  margin-top: 18px;
  font-size: 0.76rem;
  color: var(--muted);
  font-family: var(--mono);
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.section-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Required-field marker + invalid highlight (form submit guard). */
.req { color: var(--high); font-weight: 700; }
.input-error,
.input-error:focus {
  border-color: var(--high) !important;
  box-shadow: 0 0 0 3px var(--high-bg) !important;
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Print: only the cleaning record, cleanly ---- */
@media print {
  body { background: #fff; color: #000; }
  header.site, .disclaimer-banner, .enrich-hero, #intake-panel, #risk-panel,
  #declaration-panel, #caveats-panel, .site-footer, .section-actions, .actions,
  .mode-pill, #error-box { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  #cleaning-panel {
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
  }
  #cleaning-panel .draft-tag {
    color: #000;
    border: 1px solid #000;
    background: #fff;
  }
  .record-grid { border: 1px solid #000; }
  .record-grid .rk, .record-grid .rv { border-bottom: 1px solid #888; }
  .record-grid .rk { background: #f0f0f0; }
  .print-only { display: block !important; }
  .print-footer {
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px solid #000;
    font-size: 0.72rem;
    color: #333;
  }
  @page { margin: 18mm; }
}
.print-only { display: none; }

.site-footer {
  margin-top: 28px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ---- Data-enrichment: hero callout, IMO auto-fill, estimate badges ---- */
/* High-contrast navy data-callout — advertises the auto-fill capability while
   keeping the honest "estimates for review" qualifier the whole tool is built on. */
.enrich-hero {
  background-color: var(--brand);
  background-image: linear-gradient(180deg, #16395a 0%, var(--brand) 100%);
  border-bottom: 1px solid var(--brand-dark);
  color: #e8eef4;
  box-shadow: inset 0 6px 8px -8px rgba(0, 0, 0, 0.45);
}
.enrich-hero .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.enrich-hero a { color: #ffffff; text-decoration: underline; }
.enrich-hero-badge {
  flex: 0 0 auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius);
  margin-top: 2px;
}
.enrich-hero-body { font-size: 0.9rem; line-height: 1.45; }
.enrich-hero-body strong { color: #ffffff; }
.enrich-hero-qual { display: block; margin-top: 4px; font-size: 0.8rem; color: #a9bccd; }

/* IMO field + "Auto-fill from AIS" button row */
.imo-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.imo-row input { flex: 1 1 220px; }
.imo-row input[type="text"] { font-family: var(--mono); letter-spacing: 0.5px; }
.enrich-btn { white-space: nowrap; flex: 0 0 auto; }

/* Provenance / status line under the IMO field */
.enrich-note {
  margin: 8px 0 0;
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #f2f7f9;
  color: var(--ink);
}
.enrich-note.info { background: var(--low-bg); border-color: #bfe3cd; color: var(--brand-dark); }
.enrich-note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }

/* "estimated — confirm" badge appended to each enriched field's label */
.est-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-weak);
  border: 1px dotted var(--accent);
  border-radius: var(--radius);
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* MARS arrival-pack XML generators — button group + per-field provenance checklist. */
.mars-xml-block .sub { color: var(--muted); font-size: 0.86rem; margin: 0 0 4px; }
.mars-actions { align-items: stretch; }
.mars-actions .mars-gen-btn { flex: 1 1 auto; min-width: 12rem; }
.mars-xml-notes { margin-top: 12px; }
.mars-xml-summary { font-size: 0.86rem; margin: 0 0 8px; }
.mars-xml-err {
  background: var(--high-bg);
  border: 1px solid #f0b4af;
  color: var(--high);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.86rem;
  margin: 0;
}
table.mars-xml-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.mars-xml-table th,
table.mars-xml-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.mars-xml-table thead th {
  background: #f2f7f9;
  color: var(--brand-dark);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mars-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}
.mars-set { background: var(--low-bg); color: var(--low); }
.mars-agent { background: #eaf1f6; color: var(--brand-dark); }
.mars-hint { background: var(--med-bg); color: var(--med); }
.mars-val { font-family: var(--mono); font-size: 0.78rem; color: var(--brand-dark); }
.mars-why { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }

/* ---- Motion: quiet, functional, one-shot. Never loops, never on the gauge. ---- */
@keyframes ottoRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Result panels ease in as they're revealed; the always-on intake panel gets a
   gentle settle on load. `both` is safe: if animation is unsupported the
   property is ignored and content shows at full opacity. */
.panel { animation: ottoRise 0.4s cubic-bezier(0.2, 0, 0, 1) both; }

/* Forced-colors (Windows high-contrast): keep button edges visible once the
   gradient/shadow chrome is stripped by the OS. */
@media (forced-colors: active) {
  button { border: 1px solid ButtonText; }
}

/* Honor reduced-motion: kill transitions, animations and all the hover/press
   transforms wholesale, but leave every final (visible) state intact. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  button:hover, button:active { transform: none !important; }
}
