/* Bind-Ready prototype — professional B2B operations styling.
   Neutral palette, moderate density, optimized for scanning.
   Status is always communicated with text + icon, never color alone.

   Token values below are sourced from the Wonderflow "Wanda" design
   system (design.wonderflow.ai) — Primary/Blue/Green/Yellow/Indigo/Red
   color scales, spacing scale, radius scale and motion tokens — mapped
   onto this prototype's existing variable names. See
   wonderflow-design-system.md for the full extracted reference. */

:root {
  /* Neutrals — Wanda "Primary" scale */
  --bg: hsl(210 20% 98%);            /* Primary-0 */
  --surface: hsl(0 0% 100%);          /* support.white */
  --surface-muted: hsl(210 20% 98%);  /* Primary-0 */
  --border: hsl(220 16% 85%);         /* Primary-10 */
  --border-strong: hsl(219 14% 75%);  /* Primary-20 */
  --text: hsl(218 11% 14%);           /* Primary-90 */
  --text-muted: hsl(221 10% 39%);     /* Primary-60 */
  --text-faint: hsl(221 9% 49%);      /* Primary-50 */

  /* Accent — Wanda "Blue" scale */
  --accent: hsl(221 100% 22%);        /* Blue-70 */
  --accent-strong: hsl(222 100% 17%); /* Blue-80 */
  --accent-soft: hsl(221 100% 22% / 8%); /* Blue-70 @ low alpha, per Wanda's token-opacity pattern */

  /* Status — 0/10/70 shade pattern (pastel bg / soft border / readable text) */
  --ok-bg: hsl(149 100% 91%);      /* Green-0 */
  --ok-border: hsl(145 76% 75%);   /* Green-10 */
  --ok-text: hsl(160 100% 18%);    /* Green-70 */

  --warn-bg: hsl(60 100% 89%);     /* Yellow-0 */
  --warn-border: hsl(38 100% 77%); /* Yellow-10 */
  --warn-text: hsl(22 100% 24%);   /* Yellow-70 */

  --info-bg: hsl(240 60% 98%);     /* Indigo-0 */
  --info-border: hsl(240 57% 90%); /* Indigo-10 */
  --info-text: hsl(241 60% 38%);   /* Indigo-70 */

  --alert-bg: hsl(343 100% 96%);   /* Red-0 */
  --alert-border: hsl(351 100% 81%); /* Red-10 */
  --alert-text: hsl(351 100% 20%); /* Red-70 */

  /* Radius — softer than the raw Wanda scale (radius-16/radius-8), deliberately:
     surfaces are defined by shadow + a near-invisible edge below, not by a
     visible border, so a bigger radius reads as "product" not "wireframe". */
  --radius: 0.875rem;   /* 14px */
  --radius-sm: 0.5rem;  /* 8px */
  --card-edge: 1px solid rgba(17, 24, 39, 0.06); /* barely-there edge; shadow does the work */
  --shadow-sm: 0 1px 2px rgba(20,30,45,.04), 0 2px 6px rgba(20,30,45,.05);
  --shadow-md: 0 2px 4px rgba(20,30,45,.06), 0 12px 32px rgba(20,30,45,.14);
  --shadow-btn: 0 1px 2px rgba(0,20,60,.14), 0 2px 6px rgba(0,20,60,.10);
  --maxw: 1080px;
  --focus: 0 0 0 3px hsl(221 100% 22% / 40%);

  /* Motion — Wanda duration + easing tokens; used sparingly per design spec */
  --transition-fast: 0.1s cubic-bezier(0.3, 0.07, 0.34, 1);   /* duration-100, easing-standard */
  --transition-standard: 0.2s cubic-bezier(0.3, 0.07, 0.34, 1); /* duration-200, easing-standard */

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px; /* Wanda font-size-16 */
  line-height: 1.5;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0; }

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- App shell: sidebar + topbar ---------- */

.app-shell { min-height: 100vh; }

/* Fixed (not sticky) — pinned to the viewport at every scroll position,
   including inside long pages. Main content is offset by margin-left
   instead of relying on flex sibling sizing. */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 248px;
  height: 100vh;
  overflow-y: auto;
  background: var(--accent-strong);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
  z-index: 25;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 6px 8px 18px;
  color: #fff;
  text-align: left;
}
.sidebar-brand .brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #fff;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.sidebar-brand__name { font-weight: 700; font-size: 15px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: hsl(0 0% 100% / 78%);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  width: 100%;
  transition: background-color var(--transition-standard), color var(--transition-standard);
}
.sidebar-nav__icon { font-size: 13px; width: 16px; flex-shrink: 0; text-align: center; }
.sidebar-nav__item:hover { background: hsl(0 0% 100% / 10%); color: #fff; }
.sidebar-nav__item[aria-current="page"] { background: hsl(0 0% 100% / 16%); color: #fff; }
.sidebar-nav__badge {
  margin-left: auto;
  background: var(--alert-text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.sidebar-nav__item--ghost { color: hsl(0 0% 100% / 45%); cursor: not-allowed; }
.sidebar-nav__item--ghost:hover { background: none; color: hsl(0 0% 100% / 45%); }

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid hsl(0 0% 100% / 14%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.avatar-chip {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: hsl(0 0% 100% / 16%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user__text { display: flex; flex-direction: column; line-height: 1.3; }
.sidebar-user__text b { font-size: 13px; color: #fff; }
.sidebar-user__text small { font-size: 12px; color: hsl(0 0% 100% / 60%); }

.app-shell__main {
  margin-left: 248px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
}
.topbar-search {
  flex: 1;
  max-width: 360px;
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.topbar-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  padding: 0 12px 0 32px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
}
.topbar-search input:focus { background: var(--surface); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.notif { position: relative; }
.notif__bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
}
.notif__bell:hover { background: var(--surface-muted); color: var(--text); }
.notif__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--alert-text);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
.notif__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: var(--card-edge);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 30;
}
.notif__list { max-height: 280px; overflow-y: auto; }
.notif__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif__item:last-child { border-bottom: none; }
.notif__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.notif__text { display: block; color: var(--text); }
.notif__ts { display: block; color: var(--text-faint); font-size: 11px; margin-top: 2px; }
.notif__viewall {
  display: block;
  width: 100%;
  background: var(--surface-muted);
  border: none;
  border-top: 1px solid var(--border);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.notif__empty { padding: 20px 14px; font-size: 13px; color: var(--text-muted); text-align: center; }

/* ---------- Layout ---------- */

.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 24px 96px;
  width: 100%;
}
.app-main:focus { outline: none; }

/* Per-page breadcrumb + title + status context row (replaces the old
   static header for product pages; case-study keeps its own hero). */
.context-row { margin-bottom: 24px; }
.context-row__crumb { font-size: 12px; color: var(--text-faint); margin-bottom: 10px; }
.context-row__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.context-row__title { font-size: 28px; letter-spacing: -0.01em; } /* Wanda font-size-28 */
.context-row__meta { color: var(--text-muted); margin-top: 6px; }
.context-row__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.context-row__updated { font-size: 13px; color: var(--text-faint); }
.context-row__overflow {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  font-size: 16px;
  cursor: not-allowed;
}
.screen-sub { color: var(--text-muted); margin: -14px 0 24px; max-width: 62ch; }

.section { margin-top: 32px; }
.section__title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: var(--card-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* ---------- Callout (blocking status — top of hierarchy) ---------- */

.callout {
  border: var(--card-edge);
  border-left: 4px solid var(--warn-border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
}
.callout--blocking { border-left-color: hsl(26 82% 42%); } /* Yellow-40 */
.callout--clear { border-left-color: var(--ok-border); }
.callout__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.callout h2 { font-size: 20px; } /* Wanda font-size-20 */
.callout p { color: var(--text-muted); margin-top: 4px; }
.callout__actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  transition: background-color var(--transition-standard), color var(--transition-standard),
    border-color var(--transition-standard);
}
/* Primary/secondary/danger actions are real buttons — meet the 44px
   accessible tap-target minimum. .btn--ghost is exempt: it renders as an
   inline text-style link (WCAG 2.5.8 exempts targets within a text run). */
.btn--primary, .btn--secondary, .btn--danger-ghost { min-height: 44px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); }
.btn--primary:disabled {
  background: var(--border-strong);
  color: var(--surface-muted);
  cursor: not-allowed;
}
.btn--secondary {
  background: var(--surface);
  color: var(--accent-strong);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--surface-muted); }
.btn--ghost {
  background: none;
  border: none;
  color: var(--accent);
  padding: 6px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color var(--transition-standard);
}
.btn--ghost:hover { color: var(--accent-strong); }
.btn--danger-ghost {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--alert-text);
  transition: background-color var(--transition-standard);
}
.btn--danger-ghost:hover { background: var(--alert-bg); }

.linkbtn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 2px;
  transition: color var(--transition-standard);
}
.linkbtn:hover { color: var(--accent-strong); }

.disabled-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---------- Metrics ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.metric {
  background: var(--surface);
  border: var(--card-edge);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.metric__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
}
.metric__value { font-size: 20px; font-weight: 700; margin-top: 6px; }
.metric__value small { font-size: 13px; font-weight: 500; color: var(--text-muted); }

/* The one metric driving the next action gets more visual weight; the
   other two stay quiet by contrast. Text still states the number/label
   plainly, so meaning never depends on this styling alone. */
.metric--attention {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}
.metric--attention .metric__label { color: var(--warn-text); }
.metric--attention .metric__value { font-size: 28px; color: var(--warn-text); }
.metric--attention .metric__value small { color: var(--warn-text); opacity: 0.75; }

/* ---------- Evidence table ---------- */

.table-wrap {
  background: var(--surface);
  border: var(--card-edge);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.evidence {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.evidence thead th {
  text-align: left;
  padding: 11px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
}
.evidence tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.evidence tbody tr:last-child td { border-bottom: none; }
.evidence .req { font-weight: 600; }
.evidence .doc-btn {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  font: inherit;
  font-weight: 500;
  transition: color var(--transition-standard);
  text-align: left;
}
.evidence .doc-btn:hover { color: var(--accent-strong); }
.evidence .muted { color: var(--text-faint); }

/* ---------- Badges (text + icon always) ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  color: var(--text);
  white-space: nowrap;
}
.badge__icon { display: inline-flex; flex-shrink: 0; }
.icon-svg { display: block; color: inherit; }

.badge--verified { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.badge--resolved { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.badge--ready    { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.badge--bindready{ background: var(--ok-text); border-color: var(--ok-text); color: #fff; }

.badge--review     { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.badge--action     { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.badge--attention  { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.badge--mismatch   { background: var(--alert-bg); border-color: var(--alert-border); color: var(--alert-text); }
.badge--missing    { background: var(--alert-bg); border-color: var(--alert-border); color: var(--alert-text); }

.badge--awaiting   { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.badge--received   { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }

/* System matched is deliberately visually distinct from Verified:
   dashed border + "auto" treatment, never the solid confirmed style. */
.badge--system {
  background: repeating-linear-gradient(
    -45deg, hsl(210 20% 98%), hsl(210 20% 98%) 6px, hsl(220 19% 91%) 6px, hsl(220 19% 91%) 12px); /* Primary-0 / Primary-5 */
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

.badge--lg { font-size: 13px; padding: 5px 12px; }

.subnote { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ---------- Checklist summary (collapsible, secondary) ---------- */

.checklist {
  margin-top: 22px;
  background: var(--surface);
  border: var(--card-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.checklist__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  padding: 14px 18px;
  text-align: left;
  transition: background-color var(--transition-standard);
}
.checklist__toggle:hover { background: var(--surface-muted); }
.checklist__label { font-weight: 600; }
.checklist__meta { color: var(--text-muted); font-size: 13px; }
.checklist__caret { color: var(--text-faint); font-size: 12px; }
.checklist__body {
  border-top: 1px solid var(--border);
  padding: 8px 18px 14px;
}
.checklist__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.checklist__row:last-child { border-bottom: none; }

/* ---------- Tabs (Exceptions) ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  padding-bottom: 8px;
}
.tab {
  border-radius: 999px;
  background: none;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-standard), background-color var(--transition-standard), border-color var(--transition-standard);
}
.tab:hover { color: var(--text); background: var(--surface-muted); }
.tab[aria-selected="true"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--border);
}

/* ---------- Issue card + comparison ---------- */

.issue__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.issue h2 { font-size: 20px; } /* Wanda font-size-20 */
.issue__desc { color: var(--text-muted); margin-top: 4px; max-width: 66ch; }

/* ---------- Exception progress stepper ---------- */
/* Always shows the full 4-step arc, not just the current badge, so an
   exception's history/remaining work reads at a glance. */

.stepper {
  display: flex;
  align-items: flex-start;
  margin: 16px 0 4px;
}
.stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 84px;
}
.stepper__node {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.stepper__node--done {
  background: var(--ok-text);
  color: #fff;
}
.stepper__node--current {
  background: var(--surface);
  border: 2px solid var(--accent);
  color: var(--accent);
}
.stepper__node--upcoming {
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  color: var(--text-faint);
}
.stepper__label {
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.25;
}
.stepper__step--current .stepper__label { color: var(--text); font-weight: 600; }
.stepper__line {
  flex: 1;
  height: 2px;
  margin-top: 12px;
  min-width: 16px;
}
.stepper__line--done { background: var(--ok-text); }
.stepper__line--upcoming { background: var(--border); }

@media (max-width: 520px) {
  .stepper__label { display: none; }
  .stepper__step { min-width: 0; }
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.compare__col {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--surface-muted);
}
.compare__doc { font-weight: 600; font-size: 14px; word-break: break-all; }
.compare__field { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); margin-top: 10px; }
.compare__value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.compare__src { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.compare__col .btn--ghost { margin-top: 8px; padding-left: 0; }

.neutral-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 16px;
  font-weight: 600;
}
.banner--ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok-text); }

.evidence-block {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.evidence-block dl { margin: 8px 0 0; display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 14px; }
.evidence-block dt { color: var(--text-faint); }

.history {
  margin-top: 16px;
  border-top: 1px dashed var(--border-strong);
  padding-top: 12px;
}
.history__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-faint); margin-bottom: 8px; }

.auditline {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.actionrow { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.timestamp { font-size: 13px; color: var(--text-faint); }

/* ---------- Final review ---------- */

.precon {
  list-style: none;
  margin: 0;
  padding: 0;
  border: var(--card-edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.precon li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.precon li:last-child { border-bottom: none; }
.precon__mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.precon__mark--ok { background: var(--ok-bg); color: var(--ok-text); }
.precon__mark--pending { background: var(--alert-bg); color: var(--alert-text); }
.precon__name { font-weight: 600; }
.precon__state { color: var(--text-muted); margin-left: auto; }

.issue-count { margin-top: 10px; font-weight: 600; }

/* Two zones: the explanation/inputs on the left, a self-contained decision
   panel on the right — the CTA reads as a distinct moment, not the last
   item in a scrolling column. Collapses to one column under 760px. */
.confirm-card {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  border: var(--card-edge);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}
.confirm-card h2 { font-size: 20px; } /* Wanda font-size-20 — matches other card headings */
.confirm-card__body > p { color: var(--text-muted); margin-top: 6px; max-width: 52ch; }

.confirm-card__action {
  border-left: 1px solid var(--border);
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.confirm-card__action-status {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  font-weight: 700;
}
.confirm-card__action .btn { width: 100%; }
.confirm-card__action .disabled-hint { margin-top: 0; }

@media (max-width: 760px) {
  .confirm-card { grid-template-columns: 1fr; }
  .confirm-card__action {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 20px;
  }
}

.checkrow {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.checkrow input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.checkrow label { cursor: pointer; }
.checkrow label { font-size: 14px; }

.notefield { margin-top: 14px; }
.notefield label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.notefield textarea {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.success {
  border: 1px solid var(--ok-border);
  border-left: 4px solid var(--ok-text);
  background: var(--ok-bg);
  border-radius: var(--radius);
  padding: 24px;
}
.success h2 { font-size: 20px; color: var(--ok-text); } /* Wanda font-size-20 */
.success p { margin-top: 8px; color: var(--ok-text); max-width: 62ch; }
.success__meta { margin-top: 14px; font-size: 13px; color: hsl(156 100% 23%); } /* Green-60 */
.success__meta div { margin-top: 2px; }
.success .actionrow { margin-top: 18px; }

/* ---------- Modal / drawer ---------- */

#modal-root:empty { display: none; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow: auto;
}
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal__head h2 { font-size: 16px; }
.modal__head .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.modal__close {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.modal__close:hover { background: var(--surface-muted); }
.modal__body { padding: 18px 20px; }
.modal__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.fixture-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 12px;
}
.doc-excerpt {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  padding: 4px 14px;
}
.doc-excerpt .row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.doc-excerpt .row:last-child { border-bottom: none; }
.doc-excerpt .row dt { color: var(--text-faint); }
.doc-excerpt .row--highlight {
  background: var(--warn-bg);
  margin: 0 -14px;
  padding-left: 14px;
  padding-right: 14px;
  font-weight: 700;
}

.request-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  padding: 12px 14px;
  font-size: 14px;
  white-space: pre-wrap;
  color: var(--text);
}
.modal__body .field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

/* ---------- Comparison divider ("$2,000,000 ≠ $1,000,000") ---------- */

.compare--divided { grid-template-columns: 1fr auto 1fr; align-items: center; }
.compare__divider {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--alert-bg);
  color: var(--alert-text);
  font-size: 18px;
  font-weight: 700;
}
.compare__value { font-size: 24px; } /* bigger than the base 20px — this is the number the whole exception is about */

/* Two exception cards stacked in the "All" tab need breathing room. */
.issue + .issue { margin-top: 20px; }

.evidence-empty { text-align: center; color: var(--text-muted); padding: 24px 16px !important; }

/* ---------- Submission Details ---------- */

.details { display: grid; gap: 0; margin-top: 12px; }
.details__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.details__row:last-child { border-bottom: none; }
.details__row dt { color: var(--text-faint); }
.details__row dd { margin: 0; font-weight: 600; }

/* ---------- Documents library ---------- */

.doclib {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.doclib__card {
  background: var(--surface);
  border: var(--card-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.doclib__name { font-weight: 600; word-break: break-all; }
.doclib__req { font-size: 13px; color: var(--text-faint); margin-top: 4px; }
.doclib__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.doclib__card .btn--ghost { margin-top: 12px; padding-left: 0; }

/* ---------- Activity timeline ---------- */

.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.timeline__item:last-child { border-bottom: none; }
.timeline__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; }
.timeline__ts { color: var(--text-faint); font-size: 13px; white-space: nowrap; }

.empty-state { padding: 40px 16px; text-align: center; }
.empty-state__title { font-weight: 700; font-size: 16px; }
.empty-state__body { color: var(--text-muted); margin-top: 6px; max-width: 42ch; margin-left: auto; margin-right: auto; }

/* ---------- Responsive (desktop-first, graceful narrow) ---------- */

@media (max-width: 860px) {
  .metrics { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .compare--divided { grid-template-columns: 1fr; }
  .compare__divider { margin: -4px auto; }

  .app-sidebar {
    z-index: 40;
    transform: translateX(-100%);
    transition: transform var(--transition-standard);
    box-shadow: var(--shadow-md);
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-shell__main { margin-left: 0; }
  .sidebar-toggle { display: grid; place-items: center; }
  .topbar-search { max-width: none; }
  .context-row__right { width: 100%; justify-content: space-between; }
}

/* Case study is narrative content, not part of the submission workflow —
   the search/notification chrome doesn't apply there. */
.is-case-study .topbar-search,
.is-case-study .topbar-actions { visibility: hidden; }

/* Evidence table -> stacked cards below 640px, so five columns never
   force horizontal scrolling on a narrow viewport. */
@media (max-width: 640px) {
  table.evidence thead { display: none; }
  table.evidence, table.evidence tbody, table.evidence tr, table.evidence td {
    display: block;
    width: 100%;
  }
  table.evidence tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }
  table.evidence tbody tr:last-child { border-bottom: none; }
  table.evidence td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: none;
  }
  table.evidence td::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-faint);
    flex-shrink: 0;
  }
  table.evidence td.req { font-size: 15px; padding-top: 0; }
  table.evidence td.req::before { content: ""; }
}
