:root {
  --ink: #172027;
  --muted: #65727d;
  --line: #dde5e8;
  --paper: #f7faf9;
  --panel: #ffffff;
  --accent: #006b68;
  --accent-dark: #004c49;
  --gold: #b47b00;
  --red: #b42318;
  --green: #157347;
  --blue: #2456a6;
  --shadow: 0 20px 60px rgba(23, 32, 39, 0.11);
  --font-scale: 1;
  --font-body: "Cascadia Mono", "Consolas", "Lucida Console", "Courier New", monospace;
  --font-display: "Cascadia Mono", "Consolas", "Lucida Console", "Courier New", monospace;
  --font-ui: "Cascadia Mono", "Consolas", "Lucida Console", "Courier New", monospace;
}

:root[data-theme="high-contrast"] {
  --ink: #ffffff;
  --muted: #f2f2f2;
  --line: #ffffff;
  --paper: #000000;
  --panel: #000000;
  --accent: #ffff00;
  --accent-dark: #f2cf00;
  --gold: #ffff00;
  --red: #ff5c5c;
  --green: #40ff80;
  --blue: #66ccff;
  --shadow: none;
}

:root[data-theme="light"] {
  --ink: #111827;
  --muted: #4b5563;
  --line: #cbd5e1;
  --paper: #ffffff;
  --panel: #ffffff;
  --accent: #005eb8;
  --accent-dark: #003f7d;
  --gold: #9a6700;
  --red: #b42318;
  --green: #146c43;
  --blue: #1d4ed8;
  --shadow: 0 14px 40px rgba(17, 24, 39, 0.09);
}

:root[data-theme="soft"] {
  --ink: #21302f;
  --muted: #546463;
  --line: #d5dfdb;
  --paper: #f4f7f1;
  --panel: #fffefa;
  --accent: #315f52;
  --accent-dark: #244a40;
  --gold: #8a6b22;
  --red: #9d3b37;
  --green: #3d6f42;
  --blue: #3d5f8c;
  --shadow: 0 16px 45px rgba(33, 48, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: calc(16px * var(--font-scale));
}

body:not(.is-authenticated) .app-shell,
body:not(.show-login):not(.is-authenticated) .login-gate,
body.show-login .public-home,
body.is-authenticated .public-home {
  display: none;
}

body.is-authenticated .login-gate {
  display: none;
}

.public-home {
  background: var(--paper);
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 54px);
  background: rgba(247, 250, 249, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.public-nav nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.public-nav a {
  font-family: var(--font-ui);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.public-hero {
  position: relative;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
  overflow: hidden;
  padding: clamp(48px, 8vw, 96px) clamp(18px, 6vw, 80px);
  background: #102522;
  color: #fff;
}

.hero-copy {
  position: relative;
  max-width: 720px;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
}

.hero-copy p {
  max-width: 650px;
  color: rgba(255,255,255,0.88);
  font-size: 19px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.product-preview {
  margin: 0;
  color: var(--ink);
  background: #f7faf9;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.preview-topbar,
.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-topbar {
  font-family: var(--font-ui);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.preview-topbar span,
.preview-footer {
  color: var(--muted);
  font-size: 13px;
}

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

.preview-metrics div,
.preview-main section,
.preview-footer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.preview-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.preview-metrics strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 24px;
}

.preview-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 12px;
}

.preview-main h3 {
  margin: 6px 0 12px;
  font-size: 17px;
}

.preview-row,
.preview-alert {
  display: grid;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.preview-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.preview-alert b {
  color: var(--accent);
}

.preview-risk {
  min-width: 64px;
  border-radius: 999px;
  padding: 6px 10px;
  text-align: center;
  color: #fff;
  font-size: 13px;
}

.preview-risk.red {
  background: var(--red);
}

.preview-risk.amber {
  background: var(--gold);
}

.preview-footer {
  margin-top: 12px;
  flex-wrap: wrap;
}

.public-section,
.public-band,
.public-footer {
  padding: clamp(40px, 7vw, 82px) clamp(18px, 6vw, 80px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.85fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 24px;
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.section-heading h2,
.split-section > div:first-child h2,
.public-band h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

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

.feature-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.feature-grid h3,
.why-cards strong {
  font-family: var(--font-display);
  margin: 10px 0 8px;
}

.feature-grid p {
  color: var(--muted);
  line-height: 1.5;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 32px;
  align-items: start;
}

.text-stack {
  display: grid;
  gap: 12px;
}

.text-stack p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.58;
}

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

.why-cards article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.why-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 8px;
  background: #f4fbfa;
}

.why-icon svg {
  width: 24px;
  height: 24px;
}

.why-icon path,
.why-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.why-cards span {
  color: var(--muted);
  line-height: 1.45;
}

.why-cards .why-icon {
  color: var(--accent);
}

.feature-number {
  color: var(--accent);
  font-weight: 800;
}

.public-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  background: #e9f2ef;
  border-block: 1px solid var(--line);
}

.public-band p:not(.eyebrow) {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.assurance-list {
  display: grid;
  gap: 10px;
}

.assurance-list span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 700;
}

.public-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 280px;
  padding: clamp(64px, 8vw, 104px) clamp(18px, 6vw, 80px);
  color: #ffffff;
  background: #172027;
}

.public-cta div {
  max-width: 820px;
}

.public-cta h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.08;
}

.public-cta p:not(.eyebrow) {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(255,255,255,0.82);
  font-size: 18px;
  line-height: 1.55;
}

.public-cta .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  text-decoration: none;
  text-align: center;
}

.demo-cta-button {
  min-height: 76px;
  padding: 0 36px;
  color: #172027;
  background: #ffff00;
  border-color: #ffff00;
  font-size: 21px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.demo-cta-button:hover {
  background: #f2cf00;
  border-color: #f2cf00;
}

.regulator-section {
  display: grid;
  gap: 24px;
  padding: clamp(40px, 6vw, 72px) clamp(18px, 6vw, 80px);
  background: #f7faf9;
  border-top: 1px solid var(--line);
}

.regulator-section h2 {
  width: 100%;
  max-width: none;
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.08;
}

.regulator-logos {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.4fr) minmax(180px, 0.8fr);
  gap: 14px;
  align-items: stretch;
}

.regulator-logo-card {
  display: grid;
  min-height: 178px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  filter: grayscale(1);
}

.regulator-logo-card img {
  display: block;
  width: 100%;
  max-width: 300px;
  max-height: 150px;
  object-fit: contain;
}

.regulator-logo-card.wide img {
  max-width: 520px;
}

.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f7faf9, #e6f0ee);
}

.login-panel {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 22px;
}

.login-panel h1 {
  margin: 0 0 8px;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--ink);
  background: #e9f1ef;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-accounts {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.demo-account {
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px 12px;
  cursor: pointer;
}

.demo-account:hover {
  border-color: var(--accent);
}

button,
input,
select {
  font: inherit;
}

button,
select,
.count-pill,
.status-pill,
.risk-pill,
.source-pill {
  font-family: var(--font-ui);
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 26px;
  color: #f4fbfa;
  background: #123937;
}

:root[data-theme="high-contrast"] .sidebar {
  color: #ffffff;
  background: #000000;
}

:root[data-theme="light"] .sidebar {
  color: #ffffff;
  background: #003f5f;
}

:root[data-theme="soft"] .sidebar {
  color: #f8fff9;
  background: #315f52;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #f4fbfa;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-family: var(--font-display);
}

.sidebar .brand strong {
  font-size: 21px;
}

.brand span {
  margin-top: 3px;
  color: #b9d3d0;
  font-size: 13px;
}

.sidebar .brand span {
  font-size: 14px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-group-label {
  margin: 12px 0 2px;
  font-family: var(--font-ui);
  color: #b9d3d0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-item {
  width: 100%;
  font-family: var(--font-ui);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  color: #d7eeeb;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item span,
.nav-item small {
  display: block;
}

.nav-item small {
  margin-top: 4px;
  color: #a7c6c2;
}

.nav-item.active {
  color: #123937;
  background: #f4fbfa;
}

:root[data-theme="high-contrast"] .nav-item.active {
  color: #000000;
  background: #ffff00;
}

:root[data-theme="high-contrast"] .panel,
:root[data-theme="high-contrast"] .metric,
:root[data-theme="high-contrast"] .controls,
:root[data-theme="high-contrast"] .partner-card,
:root[data-theme="high-contrast"] .alert-card,
:root[data-theme="high-contrast"] .action-card,
:root[data-theme="high-contrast"] .news-card,
:root[data-theme="high-contrast"] .record-card,
:root[data-theme="high-contrast"] .table-row,
:root[data-theme="high-contrast"] .matching-row,
:root[data-theme="high-contrast"] .alert-column,
:root[data-theme="high-contrast"] .feed-card,
:root[data-theme="high-contrast"] .source-status,
:root[data-theme="high-contrast"] .matching-summary article,
:root[data-theme="high-contrast"] .detail-grid > div,
:root[data-theme="high-contrast"] .live-result,
:root[data-theme="high-contrast"] .live-result-grid > div,
:root[data-theme="high-contrast"] .domain-rating-grid > div,
:root[data-theme="high-contrast"] .rating-row-list > div,
:root[data-theme="high-contrast"] .rating-history-card,
:root[data-theme="high-contrast"] .sidebar-card,
:root[data-theme="high-contrast"] dialog {
  color: #ffffff;
  background: #000000;
  border-color: #ffffff;
  box-shadow: none;
}

:root[data-theme="high-contrast"] input,
:root[data-theme="high-contrast"] select,
:root[data-theme="high-contrast"] textarea,
:root[data-theme="high-contrast"] .segmented,
:root[data-theme="high-contrast"] .scheme-option,
:root[data-theme="high-contrast"] .icon-button,
:root[data-theme="high-contrast"] .action-menu summary,
:root[data-theme="high-contrast"] .action-menu-panel,
:root[data-theme="high-contrast"] .text-button,
:root[data-theme="high-contrast"] .link-button {
  color: #ffffff;
  background: #000000;
  border-color: #ffffff;
}

:root[data-theme="high-contrast"] .primary-button,
:root[data-theme="high-contrast"] .accessibility-sidebar-button,
:root[data-theme="high-contrast"] .count-pill,
:root[data-theme="high-contrast"] .source-pill,
:root[data-theme="high-contrast"] .status-pill {
  color: #000000;
  background: #ffff00;
  border-color: #ffff00;
}

:root[data-theme="high-contrast"] .eyebrow,
:root[data-theme="high-contrast"] .label,
:root[data-theme="high-contrast"] .metric span,
:root[data-theme="high-contrast"] .metric small,
:root[data-theme="high-contrast"] .meta,
:root[data-theme="high-contrast"] .feed-card p,
:root[data-theme="high-contrast"] .news-card p,
:root[data-theme="high-contrast"] .record-card p,
:root[data-theme="high-contrast"] .source-status span,
:root[data-theme="high-contrast"] .empty-state,
:root[data-theme="high-contrast"] .app-footer {
  color: #ffffff;
}

:root[data-theme="high-contrast"] .sidebar-version {
  color: #000000;
  background: #ffff00;
  border-color: #ffff00;
}

:root[data-theme="high-contrast"] .rating-history-chart line,
:root[data-theme="high-contrast"] .rating-history-chart polyline,
:root[data-theme="high-contrast"] .rating-history-chart circle {
  stroke: #ffff00;
}

:root[data-theme="high-contrast"] .rating-history-chart text,
:root[data-theme="high-contrast"] .rating-history-list small {
  fill: #ffffff;
  color: #ffffff;
}

:root[data-theme="high-contrast"] a,
:root[data-theme="high-contrast"] .news-card h3 a {
  color: #ffff00;
}

:root[data-theme="high-contrast"] .table-head,
:root[data-theme="high-contrast"] .matching-head {
  color: #ffff00;
  background: #000000;
}

.nav-item.active small {
  color: #44635f;
}

.sidebar-bottom {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.user-panel {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.user-panel strong,
.user-panel span {
  display: block;
}

.user-panel > span:last-of-type {
  color: #c6ddd9;
  font-size: 13px;
}

.accessibility-sidebar-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  color: #123937;
  font-weight: 400;
  background: #f4fbfa;
}

.accessibility-sidebar-button:hover {
  background: #d6f1ed;
}

.accessibility-sidebar-button.secondary {
  color: #f4fbfa;
  background: transparent;
}

.accessibility-sidebar-button.secondary:hover {
  color: #123937;
  background: #f4fbfa;
}

.sidebar-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-card p {
  color: #c6ddd9;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 28px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.version-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ink);
  background: var(--panel);
  font-family: var(--font-ui);
  font-size: 12px;
}

.sidebar-version {
  justify-self: flex-start;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e8f5f3;
  background: rgba(255, 255, 255, 0.08);
}

.topbar,
.controls,
.panel-heading,
.top-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.topbar h1,
.panel h2,
dialog h2 {
  font-family: var(--font-display);
  margin: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.1;
}

.eyebrow,
.label {
  display: block;
  margin: 0 0 5px;
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  gap: 10px;
}

.action-menu-bar {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  list-style: none;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 9px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
}

.action-menu[open] summary {
  border-color: var(--accent);
}

.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 6;
  display: grid;
  gap: 8px;
  min-width: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.action-menu-panel .icon-button,
.action-menu-panel .primary-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}

.primary-button,
.icon-button,
.text-button,
.segment,
.link-button {
  border-radius: 7px;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
}

.primary-button {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button.small {
  min-height: 34px;
  font-size: 14px;
}

.text-button {
  color: var(--accent);
  font-weight: 700;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.link-button:hover,
.text-button:hover,
.icon-button:hover {
  border-color: #b7c7c8;
  background: #f5f9f8;
}

.import-link-button {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  text-decoration: none;
}

.import-link-button:hover {
  color: #ffffff;
  background: var(--accent-dark);
}

.controls {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.controls label {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.controls .search {
  flex: 1;
  min-width: 260px;
}

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

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
}

.segmented {
  display: flex;
  gap: 5px;
  margin-left: auto;
  margin-top: 17px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6f6;
}

.segment {
  min-height: 32px;
  border: 0;
  background: transparent;
}

.segment.active {
  color: #fff;
  background: var(--ink);
}

:root[data-theme="high-contrast"] .segment.active,
:root[data-theme="high-contrast"] .primary-button {
  color: #000000;
  background: #ffff00;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(23, 32, 39, 0.04);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 10px 0 4px;
  font-family: var(--font-display);
  font-size: 34px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
}

.live-panel {
  margin-bottom: 16px;
}

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

.feed-card {
  display: grid;
  align-content: space-between;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfa;
}

.feed-card.accent {
  color: #fff;
  background: var(--accent-dark);
}

.feed-card.accent .source-pill {
  color: var(--accent-dark);
  background: #d6f1ed;
}

.feed-card h3 {
  margin: 10px 0 8px;
  font-size: 17px;
}

.feed-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.feed-card.accent p {
  color: #c7e5e1;
}

.feed-card > strong {
  margin-top: 16px;
}

.live-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #f8fbfa;
}

.live-status strong {
  color: var(--ink);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.full {
  width: 100%;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel h2 {
  font-size: 20px;
}

.partner-list,
.alert-list,
.action-list,
.timeline,
.news-list,
.record-list,
.partner-news-list {
  display: grid;
  gap: 10px;
}

.partner-card,
.alert-card,
.action-card,
.news-card,
.partner-news-card,
.record-card,
.table-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.partner-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.partner-card h3,
.alert-card h3,
.action-card h3,
.news-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 16px;
}

.news-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.3fr);
  gap: 14px;
}

.news-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.news-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.partner-news-card {
  display: grid;
  gap: 7px;
}

.partner-news-card a {
  color: var(--ink);
  text-decoration: none;
}

.partner-news-card a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.news-card p,
.action-card p,
.record-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
}

.action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.news-matches {
  display: flex;
  align-content: start;
  align-items: start;
  flex-wrap: wrap;
  gap: 8px;
}

.source-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.source-status {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}

.source-status.ok {
  border-color: #b7dac8;
  background: #f1fbf5;
}

.source-status.blocked {
  border-color: #f0c3bf;
  background: #fff7f6;
}

.source-status span,
.record-card span,
.empty-state {
  color: var(--muted);
  line-height: 1.45;
}

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

.scheme-option {
  min-height: 62px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: var(--panel);
  font-weight: 700;
}

.scheme-option.active {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.font-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.risk-pill,
.count-pill,
.status-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.verified {
  color: #fff;
  background: var(--green);
}

.status-pill.candidate {
  color: #382500;
  background: #ffd666;
}

.status-pill.needs-review {
  color: #fff;
  background: var(--red);
}

.risk-red {
  color: #fff;
  background: var(--red);
}

:root[data-theme="high-contrast"] .risk-red,
:root[data-theme="high-contrast"] .risk-green {
  color: #000000;
}

.risk-amber {
  color: #382500;
  background: #ffd666;
}

.risk-green {
  color: #fff;
  background: var(--green);
}

.count-pill,
.status-pill,
.source-pill {
  color: var(--muted);
  background: #eef3f3;
}

.alert-card {
  display: grid;
  gap: 10px;
}

.alert-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

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

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(110px, 0.55fr) minmax(90px, 0.45fr) minmax(120px, 0.7fr) auto;
  align-items: center;
  gap: 12px;
}

.register-row {
  grid-template-columns:
    minmax(360px, 1fr)
    minmax(190px, 230px)
    minmax(150px, 190px)
    minmax(110px, 130px)
    minmax(172px, 172px)
    minmax(116px, 136px);
}

.register-row > span:nth-child(2),
.register-row > span:nth-child(3),
.register-row > span:nth-child(4) {
  justify-self: stretch;
}

.register-row.table-head > span:nth-child(2),
.register-row.table-head > span:nth-child(3),
.register-row.table-head > span:nth-child(4) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.register-row > .status-pill,
.register-row > .risk-pill {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.table-head {
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.bulk-unselect-button {
  width: 172px;
  justify-content: center;
  text-transform: none;
}

.table-row strong {
  font-family: var(--font-display);
}

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

.alert-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}

.alert-column h3 {
  margin: 0;
  font-size: 15px;
}

.action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.matching-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.matching-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfa;
}

.matching-summary strong {
  display: block;
  font-size: 28px;
}

.matching-table {
  display: grid;
  gap: 8px;
}

.matching-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(110px, 0.7fr) minmax(90px, 0.5fr) minmax(150px, 0.7fr) minmax(150px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.matching-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  background: #f8fbfa;
}

.confidence {
  width: 100%;
  height: 7px;
  margin: 8px 0 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeee;
}

.confidence span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.identifier-stack,
.row-actions {
  display: grid;
  gap: 6px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.pagination .icon-button {
  min-width: 40px;
  min-height: 34px;
  padding: 0 10px;
}

.pagination .page-button.active {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.pagination .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

#partnerDialog {
  width: min(1080px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(23, 32, 39, 0.45);
}

.dialog-header,
.dialog-body {
  padding: 20px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-body {
  display: grid;
  gap: 18px;
}

.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.live-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfa;
  line-height: 1.45;
}

.live-result p {
  margin: 10px 0 0;
}

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

.live-result-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.cqc-detail-grid {
  margin-bottom: 12px;
}

.domain-rating-grid {
  display: grid;
  grid-template-columns: minmax(240px, 420px);
  gap: 10px;
  margin-top: 12px;
}

.domain-rating-grid > div,
.rating-row-list > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.rating-row-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.rating-row-list > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(90px, 0.6fr) minmax(110px, 0.7fr);
  gap: 10px;
  align-items: center;
}

.rating-history-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

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

.rating-history-head strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.trend-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
}

.trend-pill.good {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, #fff);
}

.trend-pill.poor {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: color-mix(in srgb, var(--red) 10%, #fff);
}

.trend-pill.stable {
  color: var(--muted);
  background: #f8fbfa;
}

.rating-history-chart {
  width: 100%;
  min-height: 190px;
  overflow: visible;
}

.rating-history-chart line {
  stroke: var(--line);
  stroke-width: 1;
}

.rating-history-chart polyline {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.rating-history-chart circle {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 3;
}

.rating-history-chart text {
  fill: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
}

.rating-history-list {
  display: grid;
  gap: 8px;
}

.rating-history-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.rating-history-list small {
  color: var(--muted);
}

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

.form-grid label {
  display: grid;
  gap: 6px;
}

.record-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.3fr) minmax(140px, 0.25fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.import-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #f8fbfa;
}

.import-progress {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}

.import-progress[hidden] {
  display: none;
}

.import-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
}

.import-progress progress {
  width: 100%;
  height: 16px;
  accent-color: var(--accent);
}

:root[data-theme="high-contrast"] .import-preview {
  color: #ffffff;
  background: #000000;
  border-color: #ffffff;
}

:root[data-theme="high-contrast"] .import-progress {
  color: #ffffff;
  background: #000000;
  border-color: #ffffff;
}

.record-form label {
  display: grid;
  gap: 6px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  font: inherit;
}

.danger-zone {
  border: 1px solid #f0c3bf;
  border-radius: 8px;
  padding: 14px;
  background: #fff7f6;
}

.danger-zone p {
  color: var(--muted);
}

.danger-button {
  min-height: 38px;
  border: 1px solid var(--red);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--red);
  background: #ffffff;
}

.danger-button.confirm {
  color: #ffffff;
  background: var(--red);
}

.icon-button.danger-confirm {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

.icon-button.danger-confirm:hover {
  color: #ffffff;
  background: #8f1d14;
  border-color: #8f1d14;
}

:root[data-theme="high-contrast"] .danger-zone {
  color: #ffffff;
  background: #000000;
  border-color: #ff5c5c;
}

:root[data-theme="high-contrast"] .danger-button {
  color: #000000;
  background: #ff5c5c;
  border-color: #ff5c5c;
}

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

.detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 12px;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 5;
  max-width: 340px;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    gap: 16px;
  }

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

  .nav-group-label {
    grid-column: 1 / -1;
  }

  .sidebar-card {
    display: none;
  }

  .metric-grid,
  .two-column,
  .alert-board,
  .feed-grid,
  .source-status-grid,
  .section-heading,
  .feature-grid,
  .split-section,
  .why-cards,
  .regulator-logos,
  .public-band {
    grid-template-columns: 1fr;
  }

  .public-hero {
    min-height: 560px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .controls,
  .panel-heading,
  .partner-card,
  .action-card {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .action-menu-bar {
    justify-content: stretch;
  }

  .action-menu {
    width: 100%;
  }

  .action-menu summary {
    width: 100%;
    justify-content: space-between;
  }

  .action-menu-panel {
    position: static;
    margin-top: 6px;
    box-shadow: none;
  }

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

  .public-nav,
  .public-footer,
  .app-footer,
  .public-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-nav nav {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .preview-metrics,
  .preview-main {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .matching-row {
    grid-template-columns: 1fr;
  }

  .news-card,
  .record-form {
    grid-template-columns: 1fr;
  }

  .table-head,
  .matching-head {
    display: none;
  }

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

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

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

  .live-result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .domain-rating-grid {
    grid-template-columns: 1fr;
  }

  .rating-row-list > div {
    grid-template-columns: 1fr 1fr;
  }

  .rating-history-list > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
