:root {
  color-scheme: light;
  --site-header-height: 74px;
  --site-max: 1380px;
  --site-radius: 22px;
  --site-radius-small: 14px;
  --bg: #f5f7fb;
  --nav: #ffffff;
  --panel: #ffffff;
  --panel-2: #f9fbff;
  --panel-3: #eef3f9;
  --text: #0f172a;
  --muted: #66758f;
  --line: #cfdbeb;
  --line-soft: #e5ecf6;
  --accent: #ff6a00;
  --accent-strong: #e65f00;
  --red: #dc2626;
  --orange: #ea580c;
  --yellow: #b45309;
  --green: #059669;
  --blue: #2563eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.045);
  --shadow-large: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --code: #0f172a;
  --code-text: #e5e7eb;
  --focus: 0 0 0 3px rgba(249, 115, 22, 0.28);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101722;
  --nav: #151f2c;
  --panel: #151f2c;
  --panel-2: #111a25;
  --panel-3: #1c2836;
  --text: #eef4ff;
  --muted: #a8b6ca;
  --line: #2c3a50;
  --line-soft: #223046;
  --accent: #ff7a1a;
  --accent-strong: #ff9d2e;
  --red: #f87171;
  --orange: #fb923c;
  --yellow: #fbbf24;
  --green: #34d399;
  --blue: #60a5fa;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  --shadow-large: 0 24px 70px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button {
  min-height: 38px;
  padding: 9px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[hidden] {
  display: none !important;
}

/* IRP 3.0 overview composition. The public demo stays local and display-only. */
.dashboard-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-kpi-row .card {
  min-height: 118px;
  justify-content: center;
}

.dashboard-kpi-row .card-value {
  font-size: clamp(28px, 2vw, 38px);
}

.dashboard-kpi-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.dashboard-kpi-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-large);
  text-decoration: none;
  transform: translateY(-1px);
}

.dashboard-kpi-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #64748b;
  color: #fff;
  font-size: 29px;
  font-weight: 800;
  line-height: 1;
}

.dashboard-kpi-copy { display: grid; gap: 2px; }
.dashboard-kpi-label { color: var(--muted); font-size: 13px; }
.dashboard-kpi-value { font-size: clamp(29px, 2vw, 38px); line-height: 1; }
.dashboard-kpi-arrow { color: var(--muted); font-size: 34px; font-weight: 400; }
.dashboard-kpi-card.open .dashboard-kpi-icon { background: #2563eb; }
.dashboard-kpi-card.resolved .dashboard-kpi-icon { background: #059669; }
.dashboard-kpi-card.resolved .dashboard-kpi-value { color: #059669; }
.dashboard-kpi-card.progress .dashboard-kpi-icon { background: #4f46e5; }
.dashboard-kpi-card.unassigned .dashboard-kpi-icon { background: #f97316; }
.dashboard-kpi-card.unassigned .dashboard-kpi-value { color: #ea580c; }

.dashboard-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-bar-list { display: grid; gap: 13px; }

.dashboard-bar-row {
  display: grid;
  grid-template-columns: minmax(105px, 0.9fr) minmax(90px, 1.7fr) 32px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.dashboard-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-track {
  width: 100%;
  height: 5px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 3px;
  background: var(--panel-3);
}

.dashboard-bar-track::-webkit-progress-bar { border-radius: 3px; background: var(--panel-3); }
.dashboard-bar-track::-webkit-progress-value { border-radius: 3px; background: #aab7c8; }
.dashboard-bar-track::-moz-progress-bar { border-radius: 3px; background: #aab7c8; }
[data-theme="dark"] .dashboard-bar-track::-webkit-progress-value { background: #718198; }
[data-theme="dark"] .dashboard-bar-track::-moz-progress-bar { background: #718198; }
.dashboard-bar-value { text-align: right; font-size: 12px; }
.panel-link { color: var(--accent-strong); font-size: 12px; font-weight: 700; white-space: nowrap; }

.activity-demo {
  min-height: 340px;
}

.activity-chart {
  width: 100%;
  height: 245px;
  display: block;
  margin: 0 0 8px;
}

.activity-axis {
  stroke: var(--line-soft);
  stroke-width: 1;
}

.activity-axis-label {
  fill: var(--muted);
  font-size: 8px;
}

.activity-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.activity-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
}

.activity-legend .critical::before { background: #dc2626; }
.activity-legend .high::before { background: #ea580c; }
.activity-legend .medium::before { background: #eab308; }
.activity-legend .low::before { background: #059669; }

.assignment-bell small {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

@media (max-width: 1100px) {
  .dashboard-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-three { grid-template-columns: 1fr; }
}

.skip-link {
  position: fixed;
  top: 4px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-140%);
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--accent);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell-header {
  position: sticky;
  top: 0;
  z-index: 120;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(245, 247, 251, 0.88);
  backdrop-filter: blur(20px);
}

[data-theme="dark"] .site-shell-header {
  background: rgba(16, 23, 34, 0.88);
}

.site-shell-inner {
  width: min(100% - 48px, var(--site-max));
  height: var(--site-header-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-shell-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.site-shell-brand img {
  width: 148px;
  max-height: 40px;
  object-fit: contain;
}

.site-shell-navigation {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.site-shell-navigation a,
.site-shell-login {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.site-shell-navigation a:hover,
.site-shell-login:hover {
  border-color: var(--accent);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.13);
}

.site-shell-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.site-language-select {
  min-width: 48px;
  height: 36px;
  width: 62px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.site-theme-toggle {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.site-theme-toggle:hover {
  background: transparent;
}

.site-theme-toggle span {
  display: block;
  width: 25px;
  height: 25px;
  margin: auto;
  border-radius: 50%;
  background: linear-gradient(90deg, #ffffff 0 50%, #101722 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.site-theme-toggle:hover span {
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.13), inset 0 0 0 1px var(--accent);
}

.site-shell-toggle,
.site-shell-navigation .site-shell-mobile-login {
  display: none;
}

.demo-site-main {
  min-height: 62vh;
}

.site-shell-content,
.auth-shell,
.app-shell {
  width: min(100% - 48px, var(--site-max));
  margin-right: auto;
  margin-left: auto;
}

.demo-intro {
  padding: 56px 0 18px;
}

.demo-intro h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 3.25vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.demo-intro p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.auth-shell {
  padding: 18px 0 64px;
}

.login-card {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--site-radius-small);
  background: var(--panel);
  box-shadow: var(--shadow-large);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-card h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.muted {
  color: var(--muted);
}

.login-card > .muted {
  margin: 10px 0 20px;
}

.demo-credentials {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(249, 115, 22, 0.38);
  border-radius: var(--radius);
  background: rgba(249, 115, 22, 0.08);
  color: var(--text);
}

.demo-credentials span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.demo-credentials code {
  color: var(--orange);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.login-fields {
  display: grid;
  gap: 7px;
}

.login-fields label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.login-fields input,
.toolbar input,
.toolbar select,
.mapping-picker select {
  width: 100%;
  min-height: 40px;
  margin: 0 0 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--panel-2);
  color: var(--text);
}

.login-fields input:focus,
.toolbar input:focus,
.toolbar select:focus,
.mapping-picker select:focus {
  border-color: var(--accent);
}

.login-fields button {
  width: 100%;
  margin-top: 7px;
}

.error-message {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: var(--radius);
  background: rgba(220, 38, 38, 0.1);
  color: var(--red);
  font-weight: 700;
}

.privacy-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.app-shell {
  position: relative;
  margin-top: 18px;
  margin-bottom: 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--site-radius);
  background: var(--panel);
  box-shadow: var(--shadow-large);
  font-size: 14px;
}

.topbar {
  position: static;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--nav);
}

.workspace-identity {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.workspace-identity img {
  display: block;
  width: 132px;
  height: auto;
}

.demo-theme-toggle {
  width: 42px;
  min-width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.demo-theme-toggle span {
  width: 19px;
  height: 19px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: linear-gradient(90deg, #ffffff 0 50%, #111827 50% 100%);
}

.primary-navigation {
  flex: 1 1 auto;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.primary-navigation a,
.disabled-nav-item {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.primary-navigation a:hover {
  color: var(--orange);
  text-decoration: none;
}

.primary-navigation a[aria-current="page"] {
  color: var(--orange);
}

.disabled-nav-item {
  opacity: 0.58;
  cursor: not-allowed;
}

.nav-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.end-demo-icon {
  display: none;
}

.demo-user {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-bell {
  color: var(--orange);
  font-size: 18px;
}

.secondary-button,
.small-button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.secondary-button:hover,
.small-button:hover {
  border-color: rgba(249, 115, 22, 0.55);
  background: var(--panel-3);
}

.nav-menu-toggle {
  display: none;
}

.demo-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 32px clamp(18px, 3vw, 46px) 48px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#page-title:focus {
  outline: none;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.page-header p {
  margin: 6px 0 0;
}

.readonly-pill,
.badge,
.status-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.readonly-pill {
  border-color: rgba(249, 115, 22, 0.42);
  color: var(--orange);
}

.page-context {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.context-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.readonly-notice,
.module-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.06);
  color: var(--text);
  font-size: 12px;
}

.module-note.warning {
  border-color: rgba(249, 115, 22, 0.36);
  background: rgba(249, 115, 22, 0.08);
}

.lock-mark {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 10px;
  line-height: 1.8;
}

.view-content {
  display: grid;
  gap: 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-counts {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.card-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.card-value {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.card-note {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.critical-text,
.badge.critical {
  color: var(--red);
}

.high-text,
.badge.high {
  color: var(--orange);
}

.medium-text,
.badge.medium {
  color: var(--yellow);
}

.low-text,
.badge.low {
  color: var(--green);
}

.status-badge.open,
.status-badge.pending {
  color: var(--orange);
}

.status-badge.closed,
.status-badge.sent {
  color: var(--green);
}

.status-badge.failed {
  color: var(--red);
}

.clickable-table tbody tr {
  cursor: pointer;
}

.clickable-table tbody tr:hover,
.clickable-table tbody tr:focus-visible {
  background: var(--panel-2);
  outline: none;
  box-shadow: inset 3px 0 0 var(--accent);
}

.scan-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scan-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.scan-badge.critical { color: var(--red); }
.scan-badge.high { color: var(--orange); }
.scan-badge.medium { color: var(--yellow); }
.scan-badge.low { color: var(--green); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-panel-content,
.section-stack {
  display: grid;
  gap: 12px;
}

.dashboard-block-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-block-pagination span {
  min-width: 76px;
  text-align: center;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head p {
  margin: 4px 0 0;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.toolbar label:first-child {
  min-width: min(280px, 100%);
}

.toolbar label,
.mapping-picker label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.toolbar input,
.toolbar select,
.mapping-picker select {
  margin: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  scrollbar-gutter: stable;
}

.dashboard-table > table {
  min-width: 760px;
}

.admin-connectors-table {
  min-width: 900px;
}

.panel > .table-wrap > table,
.panel > .section-stack > .table-wrap > table {
  min-width: 760px;
}

.admin-shortcuts {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.view-content > .table-wrap > table {
  min-width: 1120px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  table-layout: fixed;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  overflow-wrap: anywhere;
}

th {
  height: 48px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--panel-2);
}

.table-empty {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.small-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.procedure-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.knowledge-primary-action,
.report-primary-action {
  min-width: 126px;
}

button[aria-disabled="true"] {
  cursor: not-allowed;
}

.knowledge-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(280px, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.knowledge-toolbar input,
.knowledge-toolbar select {
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--panel-2);
  color: var(--text);
}

.knowledge-toolbar input:focus,
.knowledge-toolbar select:focus {
  border-color: var(--accent);
}

.knowledge-browser {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.knowledge-sidebar,
.knowledge-materials {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.knowledge-sidebar-head,
.knowledge-materials-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.knowledge-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.knowledge-sidebar-head h2,
.knowledge-materials-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.knowledge-sidebar-head .eyebrow,
.knowledge-materials-head .eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.knowledge-add-category {
  width: 38px;
  min-width: 38px;
  padding: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--orange);
  font-size: 20px;
}

.knowledge-category-list {
  display: grid;
  gap: 3px;
  padding: 8px;
}

.knowledge-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.knowledge-category:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.knowledge-category.active {
  border-color: var(--line);
  background: var(--panel-2);
  font-weight: 750;
}

.knowledge-category-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.knowledge-category-edit {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.knowledge-category:hover .knowledge-category-edit {
  color: var(--orange);
}

.knowledge-material-list {
  min-height: 300px;
}

.knowledge-material {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 22px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.knowledge-material:last-child {
  border-bottom: 0;
}

.knowledge-material-main h3 {
  margin: 10px 0 5px;
  font-size: 18px;
  line-height: 1.3;
}

.knowledge-material-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.knowledge-material-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.knowledge-material-side .small-button {
  margin-top: 7px;
  color: var(--text);
}

.knowledge-empty {
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.knowledge-empty strong {
  color: var(--text);
  font-size: 16px;
}

.report-table-wrap {
  overflow-x: auto;
}

.report-template-table {
  min-width: 900px;
}

.report-template-table th:nth-child(1) { width: 24%; }
.report-template-table th:nth-child(2) { width: 13%; }
.report-template-table th:nth-child(3) { width: 10%; }
.report-template-table th:nth-child(4) { width: 19%; }
.report-template-table th:nth-child(5) { width: 34%; }

.report-template-table td {
  padding-block: 16px;
  vertical-align: middle;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-generate,
.report-delete {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.report-edit {
  color: var(--text);
}

.report-delete,
.report-delete:hover {
  background: var(--red);
  color: #fff;
}

.mapping-picker {
  width: min(100%, 420px);
}

.mapping-table {
  min-width: 1900px;
}

.mapping-table th:nth-child(1) { width: 150px; }
.mapping-table th:nth-child(2) { width: 140px; }
.mapping-table th:nth-child(3) { width: 220px; }
.mapping-table th:nth-child(4) { width: 140px; }
.mapping-table th:nth-child(5) { width: 130px; }
.mapping-table th:nth-child(6) { width: 100px; }
.mapping-table th:nth-child(7) { width: 110px; }
.mapping-table th:nth-child(8) { width: 110px; }
.mapping-table th:nth-child(9) { width: 70px; }
.mapping-table th:nth-child(10) { width: 100px; }
.mapping-table th:nth-child(11) { width: 90px; }
.mapping-table th:nth-child(12) { width: 90px; }

.template-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

pre {
  max-width: 100%;
  max-height: 430px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code);
  color: var(--code-text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-field {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.preview-field span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.preview-field strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.record-detail-page {
  display: grid;
  gap: 18px;
}

.detail-back {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
}

.detail-back:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.detail-summary-grid.alert-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.detail-summary-card {
  min-height: 96px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-summary-card > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.detail-summary-card > strong,
.detail-summary-card > .badge,
.detail-summary-card > .status-badge {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.detail-page-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-page-panel h2,
.detail-page-panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
}

.readonly-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.readonly-action-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.readonly-action-card {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.readonly-action-card > strong {
  font-size: 13px;
}

.readonly-action-card small {
  color: var(--muted);
  font-size: 11px;
}

.readonly-action-value {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow-wrap: anywhere;
}

.detail-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.detail-kv-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-kv-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.detail-kv-row:last-child {
  border-bottom: 0;
}

.detail-kv-key {
  padding: 12px 14px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-kv-value {
  padding: 12px 14px;
  overflow-wrap: anywhere;
}

.readonly-comments {
  display: grid;
  gap: 12px;
}

.readonly-comments p {
  margin: 0;
}

.readonly-comment {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.readonly-comment strong,
.readonly-comment span {
  display: block;
}

.readonly-comment span {
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 11px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mapped-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mapped-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.mapped-group h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.mapped-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mapped-field {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.mapped-field > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.mapped-field > strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.detail-field {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.detail-field.wide {
  grid-column: 1 / -1;
}

.detail-field span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-field strong,
.detail-field p {
  display: block;
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.procedure-list {
  counter-reset: procedure;
  display: grid;
  gap: 11px;
}

.procedure-list li {
  position: relative;
  min-height: 34px;
  padding: 8px 10px 8px 45px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.procedure-list li::before {
  position: absolute;
  top: 7px;
  left: 9px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-3);
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  counter-increment: procedure;
  content: counter(procedure);
}

.site-demo-footer {
  margin-top: 0;
  background: #111b28;
  color: #dbe5f2;
}

.site-demo-footer-inner {
  width: min(100% - 48px, var(--site-max));
  display: flex;
  justify-content: space-between;
  margin: auto;
  padding: 34px 0;
  gap: 30px;
}

.site-demo-footer-inner img {
  max-width: 132px;
  filter: brightness(0) invert(1);
}

.site-demo-footer-inner p {
  max-width: 520px;
  margin: 16px 0 0;
  color: #aebbd0;
}

.site-demo-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px;
}

.site-demo-footer-links a {
  color: #dbe5f2;
}

.site-demo-footer-links a:hover {
  color: var(--accent);
}

.noscript-message {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 14px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--red);
  box-shadow: var(--shadow-large);
}

@media (min-width: 901px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-block: 10px;
  }

  .primary-navigation {
    order: 3;
    flex: 1 0 100%;
    min-height: 38px;
  }

  .nav-actions {
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .topbar {
    gap: 8px;
    padding-inline: 12px;
  }

  .nav-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  .primary-navigation {
    position: absolute;
    top: 72px;
    right: 12px;
    left: 12px;
    z-index: 80;
    max-height: calc(100vh - var(--site-header-height) - 88px);
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 12px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-large);
  }

  .primary-navigation.is-open {
    display: grid;
  }

  .primary-navigation a,
  .disabled-nav-item {
    white-space: normal;
  }

  .nav-actions {
    margin-left: auto;
  }

  .demo-user {
    display: none;
  }
}

@media (max-width: 1180px) {
  .site-shell-inner {
    width: min(100% - 28px, var(--site-max));
  }

  .site-shell-content,
  .auth-shell,
  .app-shell {
    width: min(100% - 28px, var(--site-max));
  }

  .site-shell-navigation {
    position: absolute;
    top: var(--site-header-height);
    right: 24px;
    left: 24px;
    display: none;
    max-height: calc(100dvh - var(--site-header-height) - 16px);
    overflow-y: auto;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-large);
  }

  .site-shell-navigation.is-open {
    display: flex;
  }

  .site-shell-navigation a {
    width: 100%;
    justify-content: center;
  }

  .site-shell-toggle {
    width: 40px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
  }
}

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

  .detail-summary-grid,
  .detail-summary-grid.alert-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .readonly-action-grid,
  .readonly-action-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 820px) {
  .demo-main {
    padding: 18px 14px 32px;
  }

  .page-header {
    display: grid;
  }

  .page-context {
    justify-content: flex-start;
  }

  .knowledge-toolbar,
  .knowledge-browser,
  .knowledge-material {
    grid-template-columns: 1fr;
  }

  .knowledge-toolbar button {
    width: 100%;
  }

  .knowledge-material-side {
    justify-items: start;
    text-align: left;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mapped-groups {
    grid-template-columns: 1fr;
  }

  .panel.wide {
    grid-column: auto;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar label:first-child {
    grid-column: 1 / -1;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-summary-grid,
  .detail-summary-grid.alert-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-shell-inner {
    width: min(100% - 24px, var(--site-max));
    gap: 8px;
  }

  .site-shell-content,
  .auth-shell,
  .app-shell {
    width: min(100% - 24px, var(--site-max));
  }

  .demo-intro {
    padding-top: 40px;
  }

  .demo-intro h1 {
    font-size: 36px;
  }

  .demo-intro p {
    font-size: 17px;
  }

  .site-shell-brand img {
    width: 124px;
  }

  .site-shell-login {
    display: none;
  }

  .site-shell-navigation .site-shell-mobile-login {
    display: inline-flex;
  }

  .login-card {
    padding: 24px 20px;
  }

  .topbar {
    min-height: 72px;
    gap: 8px;
    padding-inline: 12px;
  }

  .primary-navigation {
    top: 72px;
    grid-template-columns: 1fr;
  }

  .nav-menu-toggle {
    min-width: 42px;
    padding-inline: 10px;
  }

  .nav-menu-toggle span:last-child,
  #end-demo span:last-child {
    display: none;
  }

  #end-demo {
    width: 38px;
    min-width: 38px;
    padding: 8px;
  }

  .end-demo-icon {
    display: inline;
  }

  .cards,
  .toolbar,
  .detail-grid,
  .preview-blocks,
  .detail-summary-grid,
  .detail-summary-grid.alert-summary-grid,
  .readonly-action-grid,
  .readonly-action-grid.compact,
  .detail-kv-row,
  .mapped-field-grid {
    grid-template-columns: 1fr;
  }

  .toolbar label:first-child,
  .detail-field.wide {
    grid-column: auto;
  }

  .page-header h1 {
    font-size: 23px;
  }

  .readonly-notice {
    font-size: 11px;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-actions button {
    flex: 1;
  }

  .detail-kv-key {
    border-bottom: 1px solid var(--line);
  }

  .site-demo-footer-inner {
    width: min(100% - 24px, var(--site-max));
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .site-shell-brand img {
    width: 116px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
