/* ==========================================================================
   Acertive — enterprise light design system (Phase 9)
   Tokens + components. Custom CSS (no framework): server-rendered Django,
   no node build chain; tokens live as custom properties so the whole
   palette is swappable in one place.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e7ee;
  --border-strong: #cbd3df;

  /* Ink */
  --ink: #17233c;        /* headings */
  --text: #3a4560;       /* body */
  --muted: #6b7590;      /* secondary */

  /* Brand */
  --primary: #2450c8;
  --primary-hover: #1d419f;
  --primary-soft: #eef2fc;

  /* Semantic status */
  --ok-text: #156239;    --ok-bg: #e6f4eb;    --ok-border: #b9e0c8;
  --warn-text: #7d5300;  --warn-bg: #fdf3dd;  --warn-border: #efdcab;
  --bad-text: #b3251e;   --bad-bg: #fcecea;   --bad-border: #f2c4c0;
  --neutral-text: #5a6478; --neutral-bg: #edf0f4; --neutral-border: #d8dee8;
  --info-text: #1d55ad;  --info-bg: #e9f1fd;  --info-border: #bcd4f5;

  /* Shape & depth */
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);

  /* Type scale */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px;
  --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;

  /* Spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Inter (self-hosted variable font, no CDN dependency) — the same face
   used by Linear/Stripe-class dashboards; variable weights 100-900. */
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11"; /* Inter's opened digits/letters */
}

h1, h2, h3 { color: var(--ink); letter-spacing: -0.01em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-6);
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: var(--sp-4); flex-wrap: wrap;
}
.navbar-brand { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.navbar-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.navbar-links a {
  color: var(--muted); font-size: var(--fs-sm); padding: 6px 12px;
  border-radius: 6px; text-decoration: none;
}
.navbar-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.navbar-links a.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.navbar-right { display: flex; align-items: center; gap: var(--sp-2); }
.navbar-right a {
  color: var(--muted); font-size: var(--fs-sm); padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 6px; text-decoration: none;
}
.navbar-right a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* ── App shell (§17: persistent left sidebar, dark premium rail) ──────── */
:root {
  /* Dark rail palette — deliberately independent of the light content
     theme so the main surface stays untouched. */
  --rail-bg: #1e2636;           /* charcoal-slate — dark, not black */
  --rail-bg-soft: rgba(255, 255, 255, .06);
  --rail-border: rgba(255, 255, 255, .09);
  --rail-text: #b6bfd2;         /* resting link */
  --rail-text-strong: #ffffff;  /* hover / active */
  --rail-title: #7c87a0;        /* section micro-caps */
  --rail-accent: #6d8cff;
  --rail-accent-soft: rgba(109, 140, 255, .18);
}
.app-shell { display: flex; min-height: 100vh; }
.app-shell.app-shell-guest { display: block; }
.app-sidebar {
  width: 248px; flex-shrink: 0; background: var(--rail-bg);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0; overflow-y: auto;
}
/* Slim, unobtrusive scrollbar inside the dark rail */
.app-sidebar::-webkit-scrollbar { width: 8px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }

.app-sidebar-brand {
  padding: var(--sp-4); border-bottom: 1px solid var(--rail-border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.app-brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.app-brand-link:hover { text-decoration: none; }
.app-brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #5b7cfa 0%, #7c5bfa 100%);
  color: #fff; font-size: 14px; font-weight: 800; letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(91, 124, 250, .35);
}
.app-brand-name {
  font-size: 15px; font-weight: 700; color: var(--rail-text-strong);
  letter-spacing: -.01em;
}
.app-sidebar-close { display: none; background: none; border: none; color: var(--rail-text);
  font-size: var(--fs-md); cursor: pointer; padding: 4px; }

.app-sidebar-nav { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-3) var(--sp-4); }
.app-sidebar-org {
  font-size: 12px; font-weight: 650; color: #c7d4ff;
  padding: 7px 12px; margin: 2px 0 var(--sp-3);
  background: var(--rail-accent-soft); border: 1px solid rgba(91,124,250,.25);
  border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-sidebar-section { margin-bottom: var(--sp-2); padding-bottom: var(--sp-2); }
.app-sidebar-section:not(:last-child) { border-bottom: 1px solid var(--rail-border); }
.app-sidebar-section-title {
  font-size: 10.5px; font-weight: 650; color: var(--rail-title);
  text-transform: uppercase; letter-spacing: .12em;
  padding: var(--sp-3) 12px 6px;
}
.app-sidebar-link {
  position: relative; display: block; color: var(--rail-text);
  font-size: 13.5px; font-weight: 480; line-height: 1.4;
  letter-spacing: .002em;
  padding: 8px 12px; border-radius: 8px; text-decoration: none; margin: 1px 0;
  transition: background .12s ease, color .12s ease;
}
.app-sidebar-link:hover {
  color: var(--rail-text-strong); background: var(--rail-bg-soft);
  text-decoration: none;
}
.app-sidebar-link.active {
  color: var(--rail-text-strong); font-weight: 600;
  background: var(--rail-accent-soft);
}
.app-sidebar-link.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 3px; background: var(--rail-accent);
}

.app-sidebar-user {
  padding: var(--sp-3); border-top: 1px solid var(--rail-border);
  display: flex; align-items: center; gap: var(--sp-2);
  flex-shrink: 0;
}
.app-user-card {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: 10px; text-decoration: none;
  transition: background .12s ease;
}
.app-user-card:hover { background: var(--rail-bg-soft); text-decoration: none; }
.app-user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #46608c 0%, #5b7cfa 100%);
  color: #fff; font-size: 13px; font-weight: 700;
}
.app-user-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.app-user-name {
  color: var(--rail-text-strong); font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-user-role { color: var(--rail-title); font-size: 11px; }
.app-logout-btn {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid rgba(255,255,255,.16);
  color: var(--rail-text); font-size: 14px; line-height: 1;
  transition: border-color .12s ease, color .12s ease;
}
.app-logout-btn:hover {
  border-color: rgba(255,255,255,.45); color: var(--rail-text-strong);
  background: var(--rail-bg-soft);
}

.app-sidebar-toggle {
  display: none; position: fixed; top: var(--sp-3); left: var(--sp-3); z-index: 60;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  width: 40px; height: 40px; font-size: 18px; cursor: pointer; color: var(--ink);
}
.app-sidebar-backdrop { display: none; }
.app-main { flex: 1; min-width: 0; }

/* Provenance chips (12 Jul): one consistent language for WHERE text
   came from — '📄 Your document' = verbatim-verified quote from the
   customer's own uploads; '✦ AI analysis' = model-written reasoning.
   Icon + label, never colour alone (colour-blind-safe, self-evident). */
.prov-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent; vertical-align: middle;
}
.prov-doc { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.prov-ai { background: #f1edfd; color: #5b3fc4; border-color: #ddd2f5; }

/* Back affordance for pages NOT in the sidebar (detail/sub-pages) —
   sidebar pages deliberately have no back button (the rail IS the nav). */
.page-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 550; color: var(--muted);
  margin-bottom: var(--sp-3); text-decoration: none;
}
.page-back:hover { color: var(--primary); text-decoration: none; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-7); }
.page-title { font-size: var(--fs-2xl); font-weight: 650; margin-bottom: var(--sp-1); }
.page-sub { color: var(--muted); font-size: var(--fs-base); }
.header-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-5);
  box-shadow: var(--shadow);
}
.card-title {
  font-size: var(--fs-xs); font-weight: 650; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--sp-4);
}
.section-title {
  font-size: var(--fs-md); font-weight: 650; color: var(--ink);
  margin-bottom: var(--sp-3);
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: 9px 16px; border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.btn-success:hover:not(:disabled) { border-color: var(--ok-text); }
.btn-danger-ghost { background: transparent; color: var(--bad-text); border-color: var(--border); }
.btn-danger-ghost:hover:not(:disabled) { border-color: var(--bad-text); background: var(--bad-bg); }
.btn-full { width: 100%; }
.btn-sm { padding: 4px 10px; font-size: var(--fs-xs); font-weight: 500; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-4); }
.form-group label, .field-label {
  display: block; font-size: var(--fs-sm); color: var(--text);
  margin-bottom: var(--sp-1); font-weight: 550;
}
.form-control {
  width: 100%; padding: 9px 12px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--ink); font-size: var(--fs-base); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #9aa3b8; }
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ── Badges / status pills ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: 11px;
  font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-ok, .badge-compliant, .badge-active, .badge-accepted
  { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.badge-warn, .badge-partial, .badge-pending, .badge-review
  { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.badge-bad, .badge-gap, .badge-blocked, .badge-revoked
  { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad-border); }
.badge-neutral, .badge-not_assessed, .badge-na, .badge-expired
  { background: var(--neutral-bg); color: var(--neutral-text); border-color: var(--neutral-border); }
.badge-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: var(--radius); font-size: var(--fs-sm);
         margin-bottom: var(--sp-5); display: none; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); display: block; }
.alert-error { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad-border); display: block; }
.alert-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); display: block; }

/* ── Stat tiles ─────────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4); margin-bottom: var(--sp-5);
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-4) var(--sp-4);
  box-shadow: var(--shadow);
}
.stat-card .number { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat-card .label { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px;
                    text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.num-blue { color: var(--primary); }
.num-green { color: var(--ok-text); }
.num-amber { color: var(--warn-text); }
.num-red { color: var(--bad-text); }

/* ── Progress ───────────────────────────────────────────────────────── */
.progress-track { background: var(--neutral-bg); border-radius: 999px; height: 8px;
                  overflow: hidden; margin-top: var(--sp-2); }
.progress-fill { height: 100%; border-radius: 999px; background: var(--primary);
                 transition: width .5s ease; }

/* ── Result table (grid rows) ───────────────────────────────────────── */
.table-header, .control-row {
  display: grid; grid-template-columns: 90px 1fr 210px 90px;
  gap: var(--sp-4); align-items: start; padding: var(--sp-3) var(--sp-2);
}
.table-header {
  font-size: var(--fs-xs); font-weight: 650; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border-strong);
}
.control-row { border-bottom: 1px solid var(--border); }
.control-row:hover { background: var(--surface-2); }
.control-id { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.control-name { font-weight: 550; color: var(--ink); }
.control-gap { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.control-rec { font-size: var(--fs-xs); color: var(--info-text); margin-top: 2px; }
.control-conf { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Lists / doc rows ───────────────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; gap: var(--sp-3); }
.list-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3); flex-wrap: wrap;
}
.list-item:hover { border-color: var(--border-strong); }
.item-title { font-size: var(--fs-base); font-weight: 600; color: var(--ink); }
.item-meta { font-size: var(--fs-sm); color: var(--muted); }

/* A1/A2 page-merge tab bars — sibling pages grouped under one rail entry. */
.page-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.page-tab {
  padding: 8px 16px; font-size: var(--fs-sm); color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.page-tab:hover { color: var(--ink); }
.page-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.doc-list { margin-top: var(--sp-3); }
/* Long evidence lists scroll inside their card instead of stretching the
   whole page (user report, 19 Jul — 20+ documents made the page endless). */
.doc-scroll {
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: var(--sp-2);
  scrollbar-width: thin;
}
.doc-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3); padding: var(--sp-2) var(--sp-1);
  border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
}
.doc-item .doc-name { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink); }
.doc-item .doc-meta { display: flex; align-items: center; gap: var(--sp-3); }
.doc-item .doc-date { color: var(--muted); font-size: var(--fs-xs); }

.upload-area {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: var(--sp-5); text-align: center; color: var(--muted);
  cursor: pointer; background: var(--surface-2); width: 100%;
  font: inherit; transition: border-color .15s, background .15s;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tabs { display: inline-flex; gap: 2px; background: var(--neutral-bg);
        padding: 3px; border-radius: 10px; }
.tab {
  padding: 6px 16px; border-radius: 8px; border: none; font-size: var(--fs-sm);
  cursor: pointer; background: transparent; color: var(--muted);
  font-family: inherit; font-weight: 550;
}
.tab.active { background: var(--surface); color: var(--primary);
              box-shadow: var(--shadow); }

/* ── Misc ───────────────────────────────────────────────────────────── */
.help-text { font-size: var(--fs-sm); color: var(--muted); }
.help-text-xs { font-size: var(--fs-xs); color: var(--muted); }
.empty-state {
  text-align: center; padding: var(--sp-7) var(--sp-5); color: var(--muted);
  font-size: var(--fs-base); border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg); background: var(--surface-2);
}
.panel { background: var(--surface-2); border: 1px solid var(--border);
         border-radius: var(--radius-lg); padding: var(--sp-4); }
kbd { background: var(--neutral-bg); border: 1px solid var(--border-strong);
      padding: 1px 6px; border-radius: 4px; font-size: var(--fs-xs); color: var(--ink); }
code { background: var(--neutral-bg); padding: 1px 5px; border-radius: 4px;
       font-size: var(--fs-xs); color: var(--ink); }

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

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border-strong); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
  margin-right: var(--sp-2); vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .dashboard-grid, .two-col { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 var(--sp-4); height: auto; min-height: 56px; }
}
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed; left: 0; top: 0; z-index: 70; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 24px rgba(16,24,40,.18);
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-sidebar-close { display: block; }
  .app-sidebar-toggle { display: block; }
  .app-shell:has(.app-sidebar) { padding-top: 56px; }
  .app-sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(16,24,40,.4);
    z-index: 65; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .app-sidebar-backdrop.open { opacity: 1; pointer-events: all; }
}
@media (max-width: 640px) {
  .container { padding: var(--sp-4); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .table-header { display: none; }
  .control-row { grid-template-columns: 1fr; gap: var(--sp-1); }
  .control-conf::before { content: "Confidence: "; color: var(--muted); font-weight: 400; }
}

/* Top strip: journey stage on the left, AI-readiness badge on the right.
   Replaces the old full-width amber banner — same words, one line, no
   banner blindness. */
.app-topstrip { display:flex; align-items:center; justify-content:space-between;
  gap: var(--sp-3); background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 7px 24px; font-size: var(--fs-xs); flex-wrap: wrap; }
.app-topstrip-journey strong { color: var(--ink); }
.app-topstrip-blurb { color: var(--muted); }
.ai-badge { flex: none; display: inline-flex; align-items: center; gap: 5px;
  background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid var(--warn-border); border-radius: 999px;
  padding: 2px 10px; font-size: var(--fs-xs); cursor: help; white-space: nowrap; }
.ai-badge-strong { font-weight: 650; }
@media (max-width: 700px) {
  .app-topstrip { padding: 6px 16px; }
  .app-topstrip-blurb { display: none; }
}

/* Status glyphs: colour must never be the only signal. */
.status-glyph { font-weight: 700; margin-right: 4px; font-style: normal; }

/* Row action menu: one primary button, everything else one click away. */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; display: inline-flex; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary::after { content: " ▾"; }
.row-menu-items { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  min-width: 200px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 6px 20px rgba(16,26,48,.14));
  padding: 4px; display: flex; flex-direction: column; }
.row-menu-item { background: none; border: 0; text-align: left; font: inherit;
  font-size: var(--fs-sm); color: var(--ink); padding: 7px 10px; border-radius: 6px;
  cursor: pointer; }
.row-menu-item:hover { background: var(--surface-2); }

/* Framework cards: equal height, action pinned to the foot, staff note
   demoted to an icon so data leads. */
.fw-card { display: flex; flex-direction: column; gap: var(--sp-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-4); background: var(--surface); height: 100%; }
.fw-card-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.fw-card-locked { opacity: .78; }
.fw-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.fw-card-label { font-weight: 650; font-size: var(--fs-sm); color: var(--ink); }
.fw-card-staff { flex: none; cursor: help; font-size: var(--fs-sm); line-height: 1; }
.fw-card-body { flex: 1 1 auto; }
.fw-card-score { font-size: var(--fs-lg); font-weight: 700; }
.fw-card-foot { margin-top: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Hosting profile: a setting, not part of the document — collapsed by
   default so it stops interrupting the SoA itself. */
.hosting-card { margin-bottom: var(--sp-5); }
.hosting-summary { cursor: pointer; font-weight: 650; color: var(--ink);
  font-size: var(--fs-base); list-style: none; display: flex; align-items: baseline;
  gap: 6px; flex-wrap: wrap; }
.hosting-summary::-webkit-details-marker { display: none; }
.hosting-summary::before { content: "▸"; color: var(--muted); }
.hosting-card[open] .hosting-summary::before { content: "▾"; }
.hosting-body { margin-top: var(--sp-3); }

/* Colour must never be the only signal: every verdict badge carries a
   glyph, so the three states stay distinguishable in greyscale and for
   colour-blind readers. Applies wherever badge-<status> is used. */
.badge-ok::before, .badge-compliant::before, .badge-active::before,
.badge-accepted::before { content: "✓ "; }
.badge-warn::before, .badge-partial::before, .badge-pending::before,
.badge-review::before { content: "◐ "; }
.badge-bad::before, .badge-gap::before, .badge-blocked::before,
.badge-revoked::before { content: "✗ "; }
.badge-neutral::before, .badge-not_assessed::before, .badge-na::before,
.badge-expired::before { content: "– "; }
