/* =========================================================
   VRA — Vendor Risk Assessment
   styles.css
   Design language: x365 UI/UX style guide
   Fonts: IBM Plex Sans + IBM Plex Mono
   ========================================================= */

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens — light ─────────────────────────────────── */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg:   #f9fafb;
  --bg-1: #ffffff;
  --bg-2: #f3f4f6;
  --bg-3: #e5e7eb;
  --surface: var(--bg-1);          /* alias — keeps old refs working */

  /* Text */
  --text:   #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --text-4: #d1d5db;

  /* Borders — hex, not rgba */
  --border:   #e5e7eb;
  --border-2: #d1d5db;
  --border-3: #d1d5db;             /* alias */

  /* Accent — strictly monochrome */
  --accent:        #111827;
  --accent-inv:    #ffffff;
  --accent-subtle: #f3f4f6;
  --accent-glow:   rgba(17,24,39,.08);
  --accent-dim:    rgba(17,24,39,.06);  /* alias */

  /* Nav */
  --nav-h:  64px;
  --nav-bg: rgba(249,250,251,0.92);

  /* Severity (functional color — both modes) */
  --sev-critical: #dc2626;
  --sev-high:     #ea580c;
  --sev-medium:   #d97706;
  --sev-low:      #16a34a;
  --sev-none:     #6b7280;

  /* Semantic color aliases */
  --green:     #16a34a;
  --green-bg:  rgba(22,163,74,0.08);
  --red:       #dc2626;
  --red-bg:    rgba(220,38,38,0.08);
  --orange:    #d97706;
  --orange-bg: rgba(217,119,6,0.08);

  /* Border radius */
  --r-xs:  2px;
  --r-sm:  6px;    /* buttons, inputs, badges */
  --r-md:  6px;    /* alias */
  --r:     10px;   /* cards */
  --r-lg:  10px;   /* cards alias */
  --r-xl:  14px;   /* large cards */
  --r-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05); /* alias */
  --shadow-lg: 0 10px 32px rgba(0,0,0,.10);

  --t: 150ms ease;

  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --header-h:  64px;   /* kept in sync with --nav-h */
  --sidebar-w: 220px;

  /* ── Phase 1 compatibility aliases ──────────────────────── */
  /* These vars were referenced in Phase 1 CSS but never defined;
     mapping them to the canonical v2 tokens fixes the broken refs. */
  --border-1:        var(--border);
  --surface-1:       var(--bg-1);
  --surface-2:       var(--bg-2);
  --surface-3:       var(--bg-3);
  --color-body:      var(--text);
  --color-slate:     var(--text-2);
  --color-slate-light: var(--text-3);
}

/* ── Design tokens — dark ──────────────────────────────────── */
html.dark {
  color-scheme: dark;

  /* GitHub-dark palette — NOT pure black */
  --bg:   #0f1117;
  --bg-1: #161b22;
  --bg-2: #21262d;
  --bg-3: #30363d;
  --surface: var(--bg-1);

  --text:   #f0f6fc;
  --text-2: #8b949e;
  --text-3: #484f58;
  --text-4: #30363d;

  --border:   #30363d;
  --border-2: #3d444d;
  --border-3: #3d444d;

  --accent:        #f0f6fc;
  --accent-inv:    #0f1117;
  --accent-subtle: #21262d;
  --accent-glow:   rgba(240,246,252,.08);
  --accent-dim:    rgba(240,246,252,.06);

  --nav-bg: rgba(15,17,23,0.92);

  --green:     #4ade80;
  --green-bg:  rgba(74,222,128,0.12);
  --red:       #f87171;
  --red-bg:    rgba(248,113,113,0.12);
  --orange:    #fbbf24;
  --orange-bg: rgba(251,191,36,0.12);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
  --shadow:    0 4px 16px rgba(0,0,0,.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 10px 32px rgba(0,0,0,.45);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-2); text-decoration: none; }
a:hover { color: var(--text); text-decoration: underline; }

h1 { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 0.875rem;  font-weight: 600; margin-bottom: 0.5rem; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0.75rem;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
}
.topbar.scrolled { box-shadow: var(--shadow-sm); }

.topbar__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar__logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  color: var(--accent-inv);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.topbar__logo-text {
  font-size: 0.875rem; font-weight: 600;
  color: var(--text); letter-spacing: -0.01em;
  line-height: 1.2;
}

.topbar__logo-sub {
  font-size: 0.68rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  display: block;
  margin-top: 1px;
}

.topbar__breadcrumb {
  color: var(--text-3);
  font-size: 0.78rem;
  display: flex; align-items: center; gap: 0.375rem;
}
.topbar__breadcrumb a { color: var(--text-2); }
.topbar__breadcrumb a:hover { color: var(--text); }
.topbar__breadcrumb span { color: var(--text-4); }

.topbar__sep { flex: 1; }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar__back {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.topbar__back:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--bg-2);
  text-decoration: none;
}

.topbar__btn {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}
.topbar__btn:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border-3);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  width: 34px; height: 34px;
  cursor: pointer;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t), border-color var(--t), background var(--t);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-2);
  border-color: var(--border-3);
}

/* ── Screens ───────────────────────────────────────────────── */
#screen-home,
#screen-workspace {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
}

/* ── Home screen ───────────────────────────────────────────── */
.home-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.home-header h1 { font-size: 1.35rem; }
.home-header p  { color: var(--text-2); font-size: 0.875rem; margin-top: 0.25rem; }

.home-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Assessment cards ──────────────────────────────────────── */
#assessment-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.assessment-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t);
}
.assessment-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.assessment-card--archived { opacity: 0.6; }

.assessment-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.625rem;
}

.assessment-card__name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.assessment-card__type { font-size: 0.72rem; color: var(--text-3); margin-top: 1px; }
.assessment-card__badges { display: flex; gap: 0.375rem; align-items: center; }

.assessment-card__meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-3);
  margin-bottom: 0.625rem;
}
.assessment-card__meta strong { color: var(--text-2); }

.assessment-card__progress { margin-bottom: 0.875rem; }
.assessment-card__actions  { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 3.5rem 1.5rem;
  color: var(--text-3);
  text-align: center;
}
.empty-state svg { width: 44px; height: 44px; opacity: 0.3; }

/* ── Workspace layout ──────────────────────────────────────── */
.workspace {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar__meta {
  padding: 0.875rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar__vendor {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar__type {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 2px;
}

.sidebar__back {
  display: flex; align-items: center; gap: 0.375rem;
  font-size: 0.75rem; color: var(--text-3);
  background: none; border: none; cursor: pointer;
  padding: 0.5rem 1rem 0.25rem;
  transition: color var(--t);
  text-align: left;
  font-family: var(--font-body);
}
.sidebar__back:hover { color: var(--text); }

.sidebar__nav-label {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-3);
  padding: 0.625rem 1rem 0.25rem;
}

#side-nav {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 0.25rem 0;
}

.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background var(--t);
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--bg-3); }
.nav-item--active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.nav-item__title {
  font-size: 0.78rem;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item--active .nav-item__title { color: var(--text); font-weight: 600; }
.nav-item__title em { font-style: normal; font-size: 0.68rem; color: var(--text-3); }

.nav-item__meta {
  display: flex; align-items: center; gap: 0.375rem;
  flex-shrink: 0;
}
.nav-item__count { font-size: 0.68rem; color: var(--text-3); }

.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot--warn { background: var(--orange); }
.dot--ok   { background: var(--green); }

.sidebar__views {
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar__view-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-2);
  text-align: left;
  padding: 0.375rem 0.625rem;
  border-radius: var(--r-sm);
  transition: background var(--t), color var(--t);
  display: flex; align-items: center; gap: 0.5rem;
}
.sidebar__view-btn:hover { background: var(--bg-3); color: var(--text); }
.sidebar__view-btn--active { background: var(--accent-dim); color: var(--text); font-weight: 600; }

/* ── Main area ─────────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Scope bar ─────────────────────────────────────────────── */
.scope-bar-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 1.25rem;
}

#scope-bar {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.scope-field { display: flex; flex-direction: column; gap: 3px; }
.scope-field__label {
  font-size: 0.65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3);
}
.scope-field__select,
.scope-field__input {
  height: 30px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0 0.5rem;
  font-size: 0.78rem;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.scope-field__select:focus,
.scope-field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.scope-field__input { width: 130px; }
.scope-field__value {
  height: 30px;
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  padding: 0 0.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  white-space: nowrap;
}

#tier-guidance {
  font-size: 0.72rem;
  color: var(--text-2);
  background: var(--bg-2);
  border-left: 2px solid var(--border-3);
  padding: 0.25rem 0.625rem;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-top: 0.375rem;
  width: 100%;
}

/* ── Tab bar (main content tabs) ───────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 1.25rem;
}

.tab-btn {
  padding: 0.625rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-body);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t), border-color var(--t);
}
.tab-btn:hover { color: var(--text); }
.tab-btn--active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Main content ──────────────────────────────────────────── */
#main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.section-title { font-size: 1rem; font-weight: 600; }
.header-actions { margin-left: auto; display: flex; gap: 0.5rem; }

/* ── Checklist table ───────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 900px;
}

.checklist-table thead tr {
  background: var(--bg-2);
}

.checklist-table thead th {
  padding: 0.5rem 0.625rem;
  text-align: left;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-2);
}

.checklist-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.checklist-table tbody tr:last-child { border-bottom: none; }
.checklist-table tbody tr:nth-child(even) { background: var(--bg); }
.checklist-table tbody tr:hover { background: var(--accent-dim); }

.checklist-row--issue { background: var(--orange-bg) !important; }
.checklist-row--issue:hover { background: var(--orange-bg) !important; filter: brightness(0.97); }
.checklist-row--dimmed { opacity: 0.5; }

.checklist-table td { padding: 0.4rem 0.625rem; vertical-align: middle; }

/* Column widths */
.col-check    { min-width: 220px; max-width: 280px; }
.col-status   { min-width: 100px; }
.col-evidence { min-width: 160px; }
.col-date     { min-width: 130px; }
.col-age      { min-width: 70px;  }
.col-owner    { min-width: 120px; }
.col-due      { min-width: 120px; }
.col-notes    { min-width: 140px; }

.check-label { font-weight: 500; color: var(--text); }
.check-hint  { font-size: 0.68rem; color: var(--text-3); margin-top: 2px; }
.tier-tag    { font-size: 0.63rem; background: var(--bg-3); color: var(--text-3); padding: 1px 5px; border-radius: var(--r-xs); }

/* Cell inputs */
.cell-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  outline: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.cell-input:hover  { border-color: var(--border-2); background: var(--surface); }
.cell-input:focus  {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.cell-input--date     { max-width: 140px; }
.cell-input--required { border-color: var(--orange); background: var(--orange-bg); }
.cell-input--required:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(217,119,6,0.15); }

/* Cell selects */
.cell-select {
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  min-width: 90px;
  transition: border-color var(--t), box-shadow var(--t);
}
.cell-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.select--yes     { border-color: var(--green);  color: var(--green);  background: var(--green-bg); }
.select--no      { border-color: var(--red);    color: var(--red);    background: var(--red-bg);   }
.select--partial { border-color: var(--orange); color: var(--orange); background: var(--orange-bg); }
.select--na      { border-color: var(--border-2); color: var(--text-3); background: var(--bg-2); }

/* Age badges */
.age-badge    { font-size: 0.68rem; padding: 1px 5px; border-radius: var(--r-xs); font-weight: 500; }
.age--current { color: var(--green);  background: var(--green-bg); }
.age--stale   { color: var(--red);    background: var(--red-bg);   }

/* Section nav */
.section-nav {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0 1rem;
}

/* Row flash animation */
@keyframes flashRow {
  0%, 100% { background: inherit; }
  50%       { background: var(--accent-dim); outline: 2px solid var(--accent); }
}
.flash { animation: flashRow 0.8s ease 2; }

/* ── Issues view ───────────────────────────────────────────── */
.row--overdue       { background: var(--red-bg) !important; }
.cell--missing      { color: var(--red); font-weight: 600; }
.cell--overdue      { color: var(--red); }
.overdue-tag        { font-size: 0.63rem; background: var(--red-bg); color: var(--red); padding: 1px 5px; border-radius: var(--r-xs); margin-left: 4px; }
.link               { color: var(--text-2); font-size: 0.78rem; }
.link-btn           { background: none; border: none; cursor: pointer; color: var(--text-2); font-family: var(--font-body); font-size: 0.78rem; text-decoration: underline; padding: 0; }
.link-btn:hover     { color: var(--text); }

/* ── Summary ───────────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-sm);
}
.summary-card__label {
  font-size: 0.67rem; color: var(--text-3);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 4px;
}
.summary-card__value { font-size: 1rem; font-weight: 700; color: var(--text); }

.summary-stats {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.stat-block {
  flex: 1; min-width: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.875rem;
  text-align: center;
}
.stat-block__num   { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-block__label { font-size: 0.68rem; color: var(--text-3); margin-top: 4px; }
.stat-block--yes     .stat-block__num { color: var(--green);  }
.stat-block--partial .stat-block__num { color: var(--orange); }
.stat-block--no      .stat-block__num { color: var(--red);    }
.stat-block--na      .stat-block__num { color: var(--text-3); }

.summary-progress-wrap { margin-bottom: 1.5rem; }
.summary-progress-label {
  display: flex; justify-content: space-between;
  margin-bottom: 0.375rem; font-size: 0.82rem;
}
.summary-progress-label strong { font-weight: 700; color: var(--text); }

.summary-section { margin-bottom: 1.75rem; }

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.summary-table thead { background: var(--bg-2); }
.summary-table thead th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-2);
}
.summary-table tbody tr { border-bottom: 1px solid var(--border); }
.summary-table tbody tr:nth-child(even) { background: var(--bg); }
.summary-table td { padding: 0.5rem 0.75rem; }
.cell--yes     { color: var(--green);  font-weight: 600; }
.cell--partial { color: var(--orange); font-weight: 600; }
.cell--no      { color: var(--red);    font-weight: 600; }
.cell--blank   { color: var(--text-3); }

.notes-area {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 0.625rem 0.75rem;
  font-size: 0.82rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.notes-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.status-controls { display: flex; gap: 0.625rem; }

/* ── Progress bar ──────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-bar--lg { height: 10px; }
.progress-bar__fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--r-pill);
  transition: width 0.4s ease;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-inv);
  border-color: var(--accent);
}
.btn--primary:hover { opacity: 0.88; }

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
}
.btn--ghost:hover { background: var(--bg-2); border-color: var(--border-3); color: var(--text); }

.btn--danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn--danger:hover { background: var(--red-bg); }

.btn--success {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn--success:hover { opacity: 0.88; }

.btn--sm  { padding: 0.25rem 0.625rem; font-size: 0.75rem; }
.btn--xs  { padding: 0.15rem 0.5rem;   font-size: 0.7rem; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 0.68rem; font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge--success { background: var(--green-bg);  color: var(--green);  border-color: rgba(22,163,74,0.25); }
.badge--warning { background: var(--orange-bg); color: var(--orange); border-color: rgba(217,119,6,0.25); }
.badge--danger  { background: var(--red-bg);    color: var(--red);    border-color: rgba(220,38,38,0.25); }
.badge--info    { background: var(--bg-2);      color: var(--text-2); border-color: var(--border-2); }
.badge--muted   { background: var(--bg-2);      color: var(--text-3); border-color: var(--border); }

/* ── Modal ─────────────────────────────────────────────────── */
#modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 440px;
  max-width: 95vw;
  padding: 1.75rem;
}

.modal h2 { margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.72rem; font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-control {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0 0.625rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-actions {
  display: flex; gap: 0.625rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── Import modal ──────────────────────────────────────────── */
#import-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  padding: 1.875rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
  color: var(--text-3);
  font-size: 0.82rem;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}
#import-file-input { display: none; }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--r-lg);
  background: var(--accent);
  color: var(--surface);
  font-family: var(--font-body);
  font-size: 0.82rem;
  box-shadow: var(--shadow-md);
  z-index: 300;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
html.dark .toast { color: var(--bg); }
.toast--show    { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--green);  color: #fff; }
.toast--error   { background: var(--red);    color: #fff; }
.toast--info    { background: var(--accent); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .scope-field__input { width: 100px; }
  .topbar__back { display: none; }
}

/* ════════════════════════════════════════════════════════════
   PHASE 1 — WIZARD MODAL
   ════════════════════════════════════════════════════════════ */

/* Expanded modal for step 2 (questionnaire) */
.modal--wizard          { max-width: 600px; width: 94vw; }
.modal--wizard-expanded { max-width: 820px; max-height: 88vh; overflow-y: auto; }

/* ── Step indicator ──────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-1);
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.wizard-step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border-2);
  color: var(--color-slate);
  font-size: .75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, color .2s;
}
.wizard-step__label {
  font-size: .7rem;
  color: var(--color-slate-light);
  white-space: nowrap;
}
.wizard-step--active .wizard-step__num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wizard-step--active .wizard-step__label { color: var(--color-body); font-weight: 600; }
.wizard-step--completed .wizard-step__num {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.wizard-step--completed .wizard-step__label { color: var(--green); }
.wizard-step__connector {
  flex: 1;
  height: 2px;
  background: var(--border-2);
  margin: 0 6px;
  margin-bottom: 20px;
}

/* ── Wizard panes ────────────────────────────────────────── */
.wizard-pane h2          { margin: 0 0 6px; font-size: 1.1rem; }
.wizard-pane__sub        { color: var(--color-slate); font-size: .83rem; margin: 0 0 20px; line-height: 1.5; }
.wizard-pane--results    { min-height: 200px; }

/* Section title inside questionnaire */
.p1-section-title {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-slate);
}

/* ── Weight configuration ────────────────────────────────── */
.p1-weights-section {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.p1-weights-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.p1-weights-hint { font-size: .75rem; color: var(--color-slate-light); }
.p1-weights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 600px) {
  .p1-weights-grid { grid-template-columns: repeat(4, 1fr); }
}
.p1-weight-field { display: flex; flex-direction: column; gap: 4px; }
.p1-weight-label { font-size: .73rem; color: var(--color-slate); font-weight: 500; }
.p1-weight-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  padding: 4px 8px;
}
.p1-weight-input {
  width: 48px;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--color-body);
  outline: none;
}
.p1-weight-pct { font-size: .8rem; color: var(--color-slate); }
.p1-weight-total {
  margin-top: 10px;
  font-size: .8rem;
  color: var(--color-slate);
}
.p1-weight-total strong { font-family: var(--font-mono); }
.p1-weight-total--invalid { color: var(--red); }
.p1-weight-warn { margin-left: 8px; font-size: .75rem; }

/* ── Dimension blocks ────────────────────────────────────── */
.p1-dimensions { display: flex; flex-direction: column; gap: 20px; }
.p1-dimension {
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  overflow: hidden;
}
.p1-dimension--ai { border-color: var(--accent); }
.p1-dimension--ai .p1-dimension__header { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.p1-dimension__header {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-1);
}
.p1-dimension__title {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: var(--color-body);
}
.p1-dimension__desc {
  display: block;
  font-size: .73rem;
  color: var(--color-slate);
  margin-top: 2px;
}

/* ── Questions ───────────────────────────────────────────── */
.p1-question {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
}
.p1-question:last-child { border-bottom: none; }
.p1-question__text {
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-body);
  margin-bottom: 10px;
  line-height: 1.45;
}

/* ── Radio option cards ──────────────────────────────────── */
.p1-radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.p1-radio-group--3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) {
  .p1-radio-group      { grid-template-columns: repeat(4, 1fr); }
  .p1-radio-group--3   { grid-template-columns: repeat(3, 1fr); }
}
.p1-radio-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface-1);
}
.p1-radio-option:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface-1)); }
.p1-radio-option--selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-1));
}
.p1-radio-option input[type="radio"] { display: none; }
.p1-radio-option__score {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  font-size: .68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-slate);
  transition: background .15s, border-color .15s, color .15s;
}
.p1-radio-option--selected .p1-radio-option__score {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.p1-radio-option__content { flex: 1; min-width: 0; }
.p1-radio-option__label   { font-size: .75rem; font-weight: 600; color: var(--color-body); }
.p1-radio-option__desc    { font-size: .7rem; color: var(--color-slate); margin-top: 1px; line-height: 1.35; }

/* ── Section subtitle in checklist ──────────────────────── */
.section-subtitle {
  font-size: .78rem;
  color: var(--color-slate);
  margin: 4px 0 0;
}

/* ════════════════════════════════════════════════════════════
   PHASE 1 — WORKSPACE CARD
   ════════════════════════════════════════════════════════════ */

.phase1-card {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.phase1-card--incomplete { padding: 10px 14px; }
.phase1-card--incomplete .phase1-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.phase1-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface-3, var(--surface-2));
  border-bottom: 1px solid var(--border-1);
  gap: 10px;
  flex-wrap: wrap;
}
.phase1-card__header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phase1-card__label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-slate);
}
.phase1-card__info { display: flex; flex-direction: column; gap: 2px; }
.phase1-card__value { font-size: .83rem; color: var(--color-body); }
.phase1-card__value--pending { color: var(--color-slate-light); font-style: italic; }

.phase1-card__body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.phase1-card__score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.phase1-dims { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 7px; }

/* Score ring */
.phase1-score-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--border-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-1);
  transition: border-color .2s;
}
.phase1-score-ring--lg { width: 90px; height: 90px; }
.phase1-score-ring__num  { font-size: 1.3rem; font-weight: 700; font-family: var(--font-mono); line-height: 1; }
.phase1-score-ring--lg .phase1-score-ring__num { font-size: 1.7rem; }
.phase1-score-ring__label { font-size: .6rem; color: var(--color-slate); }

/* Tier colouring */
.tier--low    { border-color: var(--green)  !important; color: var(--green); }
.tier--medium { border-color: var(--orange) !important; color: var(--orange); }
.tier--high   { border-color: var(--red)    !important; color: var(--red); }

.phase1-tier-label {
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
}
.phase1-tier-label--lg { font-size: 1rem; }

/* Dimension bars in workspace card */
.phase1-dim-bar {
  display: grid;
  grid-template-columns: 130px 1fr 32px;
  align-items: center;
  gap: 8px;
}
.phase1-dim-bar__label { font-size: .72rem; color: var(--color-slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase1-dim-bar__track { height: 6px; background: var(--border-1); border-radius: var(--r-pill); overflow: hidden; }
.phase1-dim-bar__fill  { height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width .4s; }
.phase1-dim-bar__fill.tier--low    { background: var(--green); }
.phase1-dim-bar__fill.tier--medium { background: var(--orange); }
.phase1-dim-bar__fill.tier--high   { background: var(--red); }
.phase1-dim-bar__val { font-size: .7rem; font-family: var(--font-mono); color: var(--color-slate); text-align: right; }

/* ── AI badge ────────────────────────────────────────────── */
.badge--ai {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface-1));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   PHASE 1 — WIZARD STEP 3 (RESULTS)
   ════════════════════════════════════════════════════════════ */

.p1-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}
.p1-results__score-section {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
}
.p1-results__tier-wrap { display: flex; flex-direction: column; gap: 10px; }
.p1-results__ai-flag   { margin-top: 4px; }
.p1-results__breakdown {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.p1-results__breakdown-title {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-slate);
  margin-bottom: 4px;
}
.p1-result-bar { display: flex; flex-direction: column; gap: 4px; }
.p1-result-bar__header { display: flex; justify-content: space-between; align-items: baseline; }
.p1-result-bar__label  { font-size: .78rem; font-weight: 500; color: var(--color-body); }
.p1-result-bar__meta   { font-size: .72rem; color: var(--color-slate); }
.p1-result-bar__track  { height: 8px; background: var(--border-1); border-radius: var(--r-pill); overflow: hidden; }
.p1-result-bar__fill   { height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width .4s; }
.p1-result-bar__fill.tier--low    { background: var(--green); }
.p1-result-bar__fill.tier--medium { background: var(--orange); }
.p1-result-bar__fill.tier--high   { background: var(--red); }

/* ════════════════════════════════════════════════════════════
   PHASE 1 — SUMMARY VIEW BLOCK
   ════════════════════════════════════════════════════════════ */

.summary-section--phase1 {
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 20px;
  background: var(--surface-2);
}
.summary-section--phase1 h3 { margin: 0 0 12px; font-size: .9rem; }
.p1-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
@media (min-width: 500px) {
  .p1-summary-grid { grid-template-columns: repeat(4, 1fr); }
}
.p1-summary-item__label { font-size: .7rem; color: var(--color-slate); margin-bottom: 4px; }
.p1-summary-item__value { font-size: .88rem; font-weight: 600; }
.p1-summary-item__value--score {
  font-size: 1.5rem;
  font-family: var(--font-mono);
}
.p1-summary-item__value--score span { font-size: .75rem; color: var(--color-slate); }

.p1-dim-breakdown { display: flex; flex-direction: column; gap: 8px; }
.p1-breakdown-row {
  display: grid;
  grid-template-columns: 160px 36px 1fr 60px;
  align-items: center;
  gap: 8px;
}
.p1-breakdown-row__label  { font-size: .78rem; color: var(--color-body); }
.p1-breakdown-row__weight { font-size: .72rem; color: var(--color-slate); font-family: var(--font-mono); text-align: right; }
.p1-breakdown-row__track  { height: 7px; background: var(--border-1); border-radius: var(--r-pill); overflow: hidden; }
.p1-breakdown-row__fill   { height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.p1-breakdown-row__score  { font-size: .72rem; color: var(--color-slate); font-family: var(--font-mono); text-align: right; }

/* ════════════════════════════════════════════════════════════════
   PHASE 1 & WIZARD — v2.0.0
   ════════════════════════════════════════════════════════════════ */

/* ── Wizard modal (edit_phase1 mode only) ──────────────────── */
.modal--wizard {
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
}
.modal--wizard-expanded {
  width: 860px;
}

/* ── Wizard step indicator (modal) ─────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: opacity var(--t);
}
.wizard-step--active   { opacity: 1; }
.wizard-step--completed { opacity: 0.7; }
.wizard-step__num {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  color: var(--text-3);
  transition: background var(--t), border-color var(--t), color var(--t);
}
.wizard-step--active .wizard-step__num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wizard-step--completed .wizard-step__num {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.wizard-step__label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}
.wizard-step--active .wizard-step__label { color: var(--text); }
.wizard-step__connector {
  flex: 1;
  height: 1px;
  background: var(--border-2);
  min-width: 24px;
  margin: 0 8px;
}

/* ── Wizard pane ────────────────────────────────────────────── */
.wizard-pane__sub {
  color: var(--text-3);
  font-size: .875rem;
  margin-bottom: 1.5rem;
  margin-top: -0.5rem;
}


/* ════════════════════════════════════════════════════════════
   FULL-PAGE WIZARD — #screen-new
   ════════════════════════════════════════════════════════════ */

#screen-new {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Top nav bar (back · dots · skip) ─────────────────────── */
.wp-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg);
  flex-shrink: 0;
}
.wp-nav__back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.wp-nav__back:hover { background: var(--surface-2); color: var(--text); }
.wp-nav__steps {
  display: flex;
  align-items: center;
  margin: 0 auto;
}
.wp-nav__skip-link {
  font-size: .8rem;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.wp-nav__skip-link:hover { color: var(--text); background: var(--surface-2); }

/* ── Step dots ─────────────────────────────────────────────── */
.wp-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  border: 2px solid var(--border-2);
  background: var(--bg);
  color: var(--text-3);
  transition: border-color .2s, background .2s, color .2s;
}
.wp-step-dot--active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.wp-step-dot--done {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.wp-step-connector {
  width: 36px;
  height: 2px;
  background: var(--border-2);
  transition: background .2s;
}
.wp-step-connector--done { background: var(--green); }

/* ── Progress bar ──────────────────────────────────────────── */
.wp-progress {
  height: 3px;
  background: var(--border-1);
  flex-shrink: 0;
}
.wp-progress__fill {
  height: 100%;
  background: var(--accent);
  transition: width .35s ease;
}

/* ── Scrollable body ───────────────────────────────────────── */
.wp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* ── Content wrappers ──────────────────────────────────────── */
.wp-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
}
.wp-inner--wide { max-width: 940px; }

.wp-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .5rem;
}
.wp-subheading {
  font-size: .9rem;
  color: var(--text-3);
  margin: 0 0 1.75rem;
  line-height: 1.5;
}

/* ── Step 1 form card ──────────────────────────────────────── */
.wp-form-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Action bar (rendered into #wp-actions outside .wp-body) ─ */
#wp-actions {
  flex-shrink: 0;
  background: var(--bg);
  border-top: 1px solid var(--border-2);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Step-specific button rows inside #wp-actions */
.wp-actions__row { flex: 1; display: flex; align-items: center; gap: 10px; }
/* Class used on modal form-actions rows and child elements */
.wp-actions { display: flex; align-items: center; gap: 10px; }
.wp-actions__spacer { flex: 1; }
.wp-actions__skip {
  font-size: .82rem;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.wp-actions__skip:hover { color: var(--text); background: var(--surface-2); }

/* ── Step 3 results layout ─────────────────────────────────── */
.wp-results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.wp-results__hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  flex-wrap: wrap;
}
.wp-results__tier-block {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.wp-results__breakdown {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
}
.wp-results__breakdown-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 1rem;
}

/* ── Dimension result bars (step 3) ────────────────────────── */
.p1-result-bar { margin-bottom: .875rem; }
.p1-result-bar:last-child { margin-bottom: 0; }
.p1-result-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .375rem;
}
.p1-result-bar__label { font-size: .82rem; font-weight: 600; color: var(--text); }
.p1-result-bar__meta  { font-size: .75rem; color: var(--text-3); }
.p1-result-bar__track {
  height: 8px;
  background: var(--border-1);
  border-radius: 4px;
  overflow: hidden;
}
.p1-result-bar__fill   { height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width .4s; }
.p1-result-bar__fill.tier--low    { background: var(--green); }
.p1-result-bar__fill.tier--medium { background: var(--orange); }
.p1-result-bar__fill.tier--high   { background: var(--red); }

/* ═══════════════════════════════════════════════════════════════
   v3 — Residual risk model, decisions, criticality, applicability
   ═══════════════════════════════════════════════════════════════ */

/* Critical / unverified item tags */
.critical-tag {
  display: inline-block; margin-top: 4px; margin-right: 6px;
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  color: var(--red); background: var(--red-bg);
  border: 1px solid rgba(220,38,38,0.25); border-radius: var(--r-pill);
  padding: 1px 8px;
}
.unverified-tag {
  display: inline-block; margin-top: 4px;
  font-size: .68rem; font-weight: 600;
  color: var(--orange); background: var(--orange-bg);
  border: 1px solid rgba(217,119,6,0.25); border-radius: var(--r-pill);
  padding: 1px 8px;
}
.checklist-row--critical td { background: var(--red-bg); }

/* Non-applicable section banner + nav state */
.section-na-banner {
  margin: 0 0 14px; padding: 10px 14px;
  font-size: .82rem; color: var(--text-3);
  background: var(--bg-2); border: 1px dashed var(--border-2);
  border-radius: var(--r-md);
}
.nav-item--na .nav-item__title { color: var(--text-3); }
.nav-item--na { opacity: .6; }
tr.row--na td { color: var(--text-3); }

/* Risk scoring card */
.riskmodel-grid {
  display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap;
  margin: 10px 0 6px;
}
.riskmodel-item {
  flex: 1 1 120px; min-width: 110px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--r-md); padding: 12px 14px; text-align: center;
}
.riskmodel-item__op {
  flex: 0 0 auto; min-width: 0; background: none; border: none;
  align-self: center; font-size: 1.3rem; color: var(--text-3); padding: 0 2px;
}
.riskmodel-item__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 4px; }
.riskmodel-item__value { font-size: 1.5rem; font-weight: 700; color: var(--text-1); }
.riskmodel-item__value span { font-size: .8rem; font-weight: 400; color: var(--text-3); }
.riskmodel-item__value--low    { color: var(--green); }
.riskmodel-item__value--medium { color: var(--orange); }
.riskmodel-item__value--high   { color: var(--red); }
.riskmodel-item__sub { margin-top: 4px; font-size: .72rem; color: var(--text-3); }
.riskmodel-item--result { border-color: var(--border-2); }
.riskmodel-note { font-size: .76rem; color: var(--text-3); margin: 8px 0 0; line-height: 1.5; }

/* Critical fail / warn / unverified lists */
.critical-fail-list, .critical-warn-list, .unverified-list { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-md); }
.critical-fail-list { background: var(--red-bg);    border: 1px solid rgba(220,38,38,0.25); }
.critical-warn-list { background: var(--orange-bg); border: 1px solid rgba(217,119,6,0.25); }
.unverified-list    { background: var(--bg-2);      border: 1px solid var(--border-2); }
.critical-fail-list h4 { color: var(--red);    font-size: .8rem; margin: 0 0 6px; }
.critical-warn-list h4 { color: var(--orange); font-size: .8rem; margin: 0 0 6px; }
.unverified-list    h4 { color: var(--text-2); font-size: .8rem; margin: 0 0 6px; }
.critical-fail-list ul, .critical-warn-list ul, .unverified-list ul { margin: 0; padding-left: 18px; }
.critical-fail-list li, .critical-warn-list li, .unverified-list li { font-size: .8rem; margin: 2px 0; }

/* Decision & sign-off */
.decision-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.decision-conditions label,
.decision-field label {
  display: block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3); margin-bottom: 4px;
}
.decision-conditions { margin: 10px 0; }
.notes-area--sm { min-height: 64px; }
.decision-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.decision-field { min-width: 180px; }
.decision-value { font-size: .88rem; color: var(--text-1); }
.decision-value--overdue { color: var(--red); font-weight: 600; }
.decision-note { font-size: .74rem; color: var(--text-3); margin-top: 10px; line-height: 1.5; }

/* Overdue indicators */
.meta--overdue { color: var(--red); }
.meta--overdue strong { color: var(--red); }
.scope-field__input--overdue { border-color: var(--red) !important; color: var(--red); }

/* Summary card aux value */
.summary-card__aux { font-size: .74rem; color: var(--text-3); margin-left: 4px; }
