/* PNC operations UI — original, dependency-free design system */
:root {
  --navy-950: #0a2032;
  --navy-900: #102d45;
  --navy-800: #173c57;
  --navy-700: #28546e;
  --teal-700: #0a6a67;
  --teal-600: #087d75;
  --teal-100: #d9eeea;
  --teal-50: #edf7f4;
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --surface-muted: #efede6;
  --ink: #172631;
  --muted: #61717b;
  --line: #d9d8d1;
  --line-strong: #c7c8c2;
  --danger: #a83c39;
  --danger-bg: #f9e9e6;
  --warning: #8a5a08;
  --warning-bg: #fbf0d5;
  --success: #2e6d4f;
  --success-bg: #e5f2e9;
  --info: #315f82;
  --info-bg: #e5eef5;
  --shadow: 0 1px 2px rgb(10 32 50 / 5%), 0 12px 32px rgb(10 32 50 / 6%);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-width: 264px;
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}
body.nav-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, [type="button"], [type="submit"], [type="reset"] { cursor: pointer; }
a { color: var(--teal-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-800); }
img, svg { max-width: 100%; }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }

:focus-visible {
  outline: 3px solid rgb(8 125 117 / 32%);
  outline-offset: 2px;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--navy-900);
  font-weight: 700;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* Application shell */
.app-shell { padding-left: var(--sidebar-width); }
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  background: var(--navy-950);
  color: #fff;
  box-shadow: 10px 0 30px rgb(10 32 50 / 8%);
}
.brand {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { letter-spacing: .08em; font-size: 20px; }
.brand-copy small { margin-top: 5px; color: #b8c6cf; font-size: 11px; letter-spacing: .025em; }
.nav-close { display: none; }
.nav-label {
  margin: 6px 24px 8px;
  color: #8399a8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.sidebar-nav { display: grid; gap: 2px; padding: 0 12px 18px; }
.sidebar-nav a {
  position: relative;
  display: grid;
  min-height: 44px;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 7px;
  color: #c6d2da;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}
.sidebar-nav a > span {
  color: #76909f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.sidebar-nav a:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.sidebar-nav a[aria-current="page"] { background: #17445a; color: #fff; }
.sidebar-nav a[aria-current="page"]::after {
  position: absolute;
  top: 12px;
  right: 0;
  bottom: 12px;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: #69c8bc;
  content: "";
}
.sidebar-nav a[aria-current="page"] > span { color: #8ad7ce; }
.sidebar-account {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 18px 20px 20px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}
.account-meta { display: flex; min-width: 0; align-items: center; gap: 10px; }
.account-meta > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: #244a60;
  color: #c4ede8;
  font-weight: 700;
}
.account-meta p { display: grid; min-width: 0; margin: 0; line-height: 1.25; }
.account-meta small { color: #8ea2af; font-size: 10px; }
.account-meta strong { overflow: hidden; color: #eaf0f3; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #d8e1e6;
  font-size: 12px;
  font-weight: 700;
}
.logout-button:hover { border-color: rgb(255 255 255 / 34%); background: rgb(255 255 255 / 6%); color: #fff; }
.mobile-bar, .nav-scrim { display: none; }
input[type="hidden"], [hidden] { display: none !important; }
.main-content {
  width: min(100%, 1600px);
  min-height: 100vh;
  padding: 34px clamp(24px, 4vw, 60px) 64px;
  outline: none;
}

/* Public shell */
.public-shell { padding-top: 78px; }
.public-header {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  display: flex;
  height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 248 / 94%);
}
.brand-public { min-height: auto; padding: 0; color: var(--navy-900); }
.brand-public:hover { color: var(--navy-900); }
.brand-public .brand-copy small { color: var(--muted); }
.public-header nav { display: flex; align-items: center; gap: 8px; }
.public-header nav > a:not(.button) {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--navy-700);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.public-header nav > a:hover, .public-header nav > a[aria-current="page"] { background: var(--teal-50); color: var(--teal-700); }
.public-shell .main-content { width: min(100%, 1180px); min-height: calc(100vh - 78px); margin: 0 auto; }
.public-shell .main-content > .section,
.public-shell .main-content > form,
.public-shell .main-content > .card { max-width: 920px; margin-right: auto; margin-left: auto; }

/* Content hierarchy */
h1, h2, h3, h4 { margin: 0 0 .55em; color: var(--navy-900); line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; }
h2 { font-size: clamp(20px, 2vw, 27px); letter-spacing: -.02em; }
h3 { font-size: 17px; }
p { text-wrap: pretty; }
small, .muted, .helptext { color: var(--muted); }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.page-head, .page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-head > div:first-child, .page-header > div:first-child { max-width: 760px; }
.page-head:has(> h1:first-child + p), .page-header:has(> h1:first-child + p) { align-items: flex-start; flex-direction: column; gap: 6px; }
.stat-grid h2, .stats-grid h2 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.stat-grid > .card, .stats-grid > .card { margin-bottom: 0; }
form.card > div:not(.field-grid):not(.form-actions):has(> label) { margin-bottom: 18px; }
.field:has(textarea), .field:has(input[type="file"]), .field:has(input[type="checkbox"]) { grid-column: 1 / -1; }
.field:has([required]) > label::after { color: var(--danger); content: " *"; }
.page-head h1, .page-header h1 { margin-bottom: 5px; }
.page-head p, .page-header p { margin: 0; color: var(--muted); }
.page-head-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.eyebrow, .kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Cards and operation summaries */
.card, .section, fieldset {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card, .section { padding: clamp(18px, 2.3vw, 28px); }
.card > :first-child, .section > :first-child { margin-top: 0; }
.card > :last-child, .section > :last-child { margin-bottom: 0; }
.card-header, .section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: -2px 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card-header h2, .card-header h3, .section-header h2, .section-header h3 { margin: 0; }
.card-header p, .section-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.stat-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}
.stat-card, .stat-grid > article, .stat-grid > div, .stats-grid > article, .stats-grid > div {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal-600);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(10 32 50 / 4%);
}
.stat-card small, .stat-grid small, .stats-grid small,
.stat-label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.stat-card strong, .stat-grid strong, .stats-grid strong,
.stat-value { display: block; margin-top: 7px; color: var(--navy-900); font-size: clamp(22px, 3vw, 31px); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-card p, .stat-grid p, .stats-grid p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.stat-grid:has(> :nth-child(7):last-child), .stat-grid:has(> :nth-child(9):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid:has(> :nth-child(7):last-child) > :first-child {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-top-width: 1px;
  border-color: #bfd7d0;
  background: var(--teal-50);
}
.stat-grid:has(> :nth-child(7):last-child) > :first-child strong { margin: 0; font-size: 25px; }
.stat-grid:has(> :nth-child(7):last-child) > :first-child h2 { color: var(--teal-700); }
.content-grid, .dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.empty-state { padding: 44px 24px; color: var(--muted); text-align: center; }
.empty-state h2, .empty-state h3 { margin-bottom: 8px; }
.empty-state p { max-width: 520px; margin: 0 auto 18px; }

/* Buttons and filters */
.button, button, input[type="submit"], input[type="button"], input[type="reset"] {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--navy-900);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: #fff;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, transform 120ms ease;
}
.button:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover { border-color: var(--navy-800); background: var(--navy-800); color: #fff; }
.button:active, button:active { transform: translateY(1px); }
.button-secondary, .button-quiet, button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--navy-900);
}
.button-secondary:hover, .button-quiet:hover, button.secondary:hover { border-color: var(--teal-600); background: var(--teal-50); color: var(--teal-700); }
.button-danger, button.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .58; }
.filter, .filters, .filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}
.filter > *, .filters > *, .filter-bar > * { margin: 0; }
.search-field { flex: 1 1 250px; }

/* Forms */
form { accent-color: var(--teal-700); }
fieldset { min-width: 0; padding: clamp(18px, 2.3vw, 28px); }
legend { padding: 0 8px; color: var(--navy-900); font-size: 17px; font-weight: 750; }
label { display: inline-block; margin-bottom: 6px; color: var(--navy-900); font-size: 13px; font-weight: 700; }
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgb(10 32 50 / 3%);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { min-height: 112px; resize: vertical; }
select { padding-right: 34px; }
input::placeholder, textarea::placeholder { color: #8d999f; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgb(8 125 117 / 13%);
  outline: none;
}
input[readonly], textarea[readonly] { background: var(--surface-muted); color: #4e5c64; }
input[type="file"] { padding: 7px; background: var(--surface); }
input[type="file"]::file-selector-button {
  margin: -2px 10px -2px -2px;
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  background: var(--teal-100);
  color: var(--teal-700);
  font-weight: 700;
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0 7px 0 0; vertical-align: -4px; }
form > p { margin: 0 0 18px; }
form > p label { display: block; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.field-grid > *, .field { min-width: 0; }
.field-full, .full-width { grid-column: 1 / -1; }
.field:has(input[type="checkbox"]) { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #faf9f4; }
.field:has(input[type="checkbox"]) label { grid-column: 2; grid-row: 1; margin: 0; font-size: 13px; line-height: 1.45; }
.field:has(input[type="checkbox"]) input { grid-column: 1; grid-row: 1; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--teal-600); }
.field:has(input[type="checkbox"]) .errorlist, .field:has(input[type="checkbox"]) > small { grid-column: 1 / -1; }
.field:has(input[type="file"]) { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #faf9f4; }
.helptext { display: block; margin-top: 6px; font-size: 12px; line-height: 1.4; }
ul.errorlist {
  display: grid;
  gap: 3px;
  margin: 6px 0 0;
  padding: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}
ul.errorlist.nonfield {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e7b6b0;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
}
[aria-invalid="true"], .field-error input, .field-error select, .field-error textarea { border-color: var(--danger) !important; }
.required label::after, label.required::after { margin-left: 3px; color: var(--danger); content: "*"; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-actions .button:first-child:last-child, .form-actions button:first-child:last-child { margin-left: auto; }
.draft-status { min-height: 20px; margin-right: auto; color: var(--muted); font-size: 12px; }

/* Tables */
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  overflow: hidden;
}
.table-wrap table { min-width: 680px; border: 0; border-radius: 0; }
caption { padding: 12px 14px; color: var(--navy-900); font-weight: 750; text-align: left; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th {
  background: var(--surface-muted);
  color: var(--navy-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #faf8f3; }
td a { font-weight: 700; }
td.actions, th.actions { width: 1%; white-space: nowrap; }

/* Operational state */
.badge, .status, .pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-muted);
  color: #4e5c64;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-success, .status-success, .badge.diterima, .badge.lulus, .badge.terverifikasi { border-color: #b9d9c5; background: var(--success-bg); color: var(--success); }
.badge-warning, .status-warning, .badge.menunggu, .badge.dalam-proses { border-color: #e7cf94; background: var(--warning-bg); color: var(--warning); }
.badge-danger, .status-danger, .badge.ditolak, .badge.tidak-lulus, .badge.perlu-perbaikan { border-color: #e7b6b0; background: var(--danger-bg); color: var(--danger); }
.badge-info, .status-info, .badge.terjadwal { border-color: #bfd2e0; background: var(--info-bg); color: var(--info); }
progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dfe2de;
  accent-color: var(--teal-600);
}
progress::-webkit-progress-bar { border-radius: 999px; background: #dfe2de; }
progress::-webkit-progress-value { border-radius: 999px; background: var(--teal-600); }
progress::-moz-progress-bar { border-radius: 999px; background: var(--teal-600); }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #dfe2de; }
.progress > span, .progress-bar { display: block; height: 100%; border-radius: inherit; background: var(--teal-600); }
.pipeline, .pipeline-grid, .pipeline-columns {
  display: grid;
  grid-auto-columns: minmax(240px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  max-width: 100%;
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.pipeline-column, .pipeline > section, .pipeline-grid > section, .pipeline-columns > section {
  min-height: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  scroll-snap-align: start;
}
.pipeline-column > header, .pipeline > section > header, .pipeline-grid > section > header, .pipeline-columns > section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 2px 11px;
}
.pipeline-column h2, .pipeline-column h3, .pipeline section h2, .pipeline section h3 { margin: 0; font-size: 13px; }
.pipeline-card, .pipeline-column > article, .pipeline section > article {
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(10 32 50 / 4%);
}
.pipeline-card:last-child, .pipeline-column > article:last-child { margin-bottom: 0; }
.pipeline-card h3, .pipeline-card h4 { margin-bottom: 4px; font-size: 13px; }
.pipeline-card p { margin: 0; color: var(--muted); font-size: 11px; }
.definition-grid, dl.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
dl.detail-grid > div, .definition-grid > div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
dd { margin: 4px 0 0; color: var(--ink); font-weight: 650; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; margin-top: 20px; }
.pagination a, .pagination span { display: grid; min-width: 36px; min-height: 36px; place-items: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; }
.pagination .current, .pagination [aria-current="page"] { border-color: var(--navy-900); background: var(--navy-900); color: #fff; }

/* Messages */
.messages { display: grid; gap: 8px; margin-bottom: 22px; }
.draft-notice {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid #c9ded9;
  border-radius: var(--radius-sm);
  background: var(--teal-50);
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 650;
}
.draft-notice[hidden] { display: none; }
.message {
  padding: 12px 14px;
  border: 1px solid #bfd2e0;
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  color: var(--info);
  font-weight: 650;
}
.message.success { border-color: #b9d9c5; background: var(--success-bg); color: var(--success); }
.message.warning { border-color: #e7cf94; background: var(--warning-bg); color: var(--warning); }
.message.error { border-color: #e7b6b0; background: var(--danger-bg); color: var(--danger); }

@media (max-width: 1120px) {
  .stat-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
  .app-shell { padding-top: 60px; padding-left: 0; }
  .public-shell { padding-top: 0; }
  .public-header {
    position: static;
    height: auto;
    min-height: 66px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
  }
  .public-header nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .public-header nav > a, .public-header nav > a:not(.button) { min-height: 44px; padding: 8px 6px; justify-content: center; font-size: 12px; text-align: center; white-space: nowrap; }
  .public-shell .main-content { min-height: auto; }
  .page-head:has(> h1:first-child + p), .page-header:has(> h1:first-child + p) {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .mobile-bar {
    position: fixed;
    z-index: 35;
    inset: 0 0 auto;
    display: flex;
    height: 60px;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid #244a60;
    background: var(--navy-950);
  }
  .mobile-brand { color: #fff; font-weight: 800; letter-spacing: .06em; text-decoration: none; }
  .mobile-brand:hover { color: #fff; }
  .mobile-brand span { margin-left: 5px; color: #9db0bc; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
  .nav-toggle {
    position: relative;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 6px;
    background: transparent;
  }
  .nav-toggle:hover { background: rgb(255 255 255 / 8%); }
  .nav-toggle-lines, .nav-toggle-lines::before, .nav-toggle-lines::after {
    position: absolute;
    left: 11px;
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    content: "";
  }
  .nav-toggle-lines { top: 20px; }
  .nav-toggle-lines::before { top: -6px; left: 0; }
  .nav-toggle-lines::after { top: 6px; left: 0; }
  /* Navigation stays in document flow until JS binds successfully. */
  .sidebar { position: static; width: 100%; box-shadow: none; }
  .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-bar .nav-toggle { visibility: hidden; }
  .nav-ready .mobile-bar .nav-toggle { visibility: visible; }
  .nav-ready .sidebar { position: fixed; width: min(84vw, 300px); transform: translateX(-105%); transition: transform 180ms ease; }
  .nav-ready .sidebar-nav { grid-template-columns: 1fr; }
  .nav-ready .nav-close { display: flex; justify-content: space-between; min-height: 44px; margin: 0 14px 18px; border-color: #335267; background: transparent; color: #dce8ee; font-size: 12px; }
  .nav-ready .nav-close span { font-size: 22px; line-height: 1; }
  .nav-ready.nav-open .sidebar { transform: translateX(0); }
  .nav-scrim {
    position: fixed;
    z-index: 39;
    inset: 0;
    width: 100%;
    min-height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgb(4 18 29 / 58%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  .nav-open .nav-scrim { display: block; opacity: 1; pointer-events: auto; }
  .main-content { padding: 26px 18px 52px; }

  .brand-public .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .brand-public .brand-copy small { display: none; }
  .public-header nav { gap: 4px; }
  .public-header nav > a:not(.button) { padding: 10px 8px; }
  .page-head, .page-header { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-head-actions, .actions { width: 100%; justify-content: flex-start; }
  .field-grid, .definition-grid, dl.detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .main-content { padding-right: 14px; padding-left: 14px; }
  .stat-grid, .stats-grid, .stat-grid:has(> :nth-child(7):last-child), .stat-grid:has(> :nth-child(9):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-grid:has(> :nth-child(9):last-child) > :first-child { grid-column: 1 / -1; }
  .stat-grid > article, .stat-grid > div, .stats-grid > article, .stats-grid > div { padding: 14px; }
  .stat-grid h2, .stats-grid h2 { font-size: 11px; }
  .stat-grid strong, .stats-grid strong { font-size: 24px; }
  .button, button, input[type="submit"], .public-header nav > a, .public-header nav > a:not(.button) { min-height: 44px; }
  .card, .section, fieldset { padding: 17px; border-radius: var(--radius); }
  .card-header, .section-header { align-items: flex-start; flex-direction: column; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button, .form-actions button, .form-actions input { width: 100%; }
  .draft-status { width: 100%; }
  .filter, .filters, .filter-bar { align-items: stretch; flex-direction: column; }
  .filter .button, .filter button, .filters .button, .filters button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  :root { --ink: #000; --paper: #fff; --surface: #fff; --line: #bbb; }
  @page { margin: 16mm; }
  body, .app-shell, .public-shell { padding: 0; background: #fff; color: #000; font-size: 12pt; }
  table, th, td, small, label, .helptext, .badge, .status, .pill, dt, dd { font-size: 12pt; }
  .table-wrap { overflow: visible; }
  .table-wrap table { min-width: 0; }
  th, td { padding: 8px; overflow-wrap: anywhere; }
  .draft-notice { display: none !important; }
  .sidebar, .mobile-bar, .public-header, .nav-scrim, .skip-link, .page-head-actions, .actions, .form-actions, .filter, .filters, .filter-bar, .pagination, button, .button { display: none !important; }
  .main-content, .public-shell .main-content { width: 100%; min-height: auto; padding: 0; }
  .card, .section, fieldset, table { break-inside: avoid; border-color: #aaa; box-shadow: none; }
  .pipeline, .pipeline-grid, .pipeline-columns { display: block; overflow: visible; }
  .pipeline-column, .pipeline > section, .pipeline-grid > section, .pipeline-columns > section { margin-bottom: 12px; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
