:root {
  --bg: #ffffff;
  --fg: #0e0f0c;
  --body: #454745;
  --muted: #868685;
  --green: #03c565;
  --green-hover: #26dc82;
  --green-text: #163300;
  --green-dark: #054d28;
  --green-soft: #e2f6d5;
  --green-tint: #f4fbf6;
  --blue: #03c565;
  --blue-soft: #e9fff2;
  --blue-ring: rgba(3, 197, 101, .14);
  --soft: #f8faf7;
  --soft-hover: #f1f4ef;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --border: #e6ebe4;
  --border-soft: #f1f3f0;
  --ring: rgba(14, 15, 12, 0.075);
  --subtle-ring: rgba(14, 15, 12, 0.045);
  --shadow-soft: 0 1px 2px rgba(14, 15, 12, .028);
  --danger: #0e0f0c;
  --danger-text: #454745;
  --warning: #868685;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: "calt";
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; color: var(--body); background: var(--bg); }
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f8faf7;
}
.login-card {
  width: min(420px, 100%);
  border-radius: 18px;
  box-shadow: var(--subtle-ring) 0 0 0 1px, var(--shadow-soft);
  padding: 26px;
  background: #fff;
}
.login-title { margin: 0 0 8px; font-size: 22px; line-height: 1.2; font-weight: 900; color: var(--fg); }
.login-copy { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 14px; color: #6f756d; font-weight: 700; }
.turnstile-box {
  min-height: 74px;
  margin: 2px 0 12px;
  overflow: hidden;
}
.input, .select, .textarea {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--fg);
  padding: 7px 10px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(14, 15, 12, .015);
}
.select {
  appearance: auto;
  -webkit-appearance: auto;
  padding-right: 32px;
}
.select { cursor: pointer; }
.select[multiple],
.select[size]:not([size="1"]) {
  background-image: none;
  padding-right: 10px;
}
.input::placeholder, .textarea::placeholder { color: #a8aaa5; }
.textarea { min-height: 88px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green);
  box-shadow: rgba(3, 197, 101, 0.3) 0 0 0 2px;
}
.select:focus {
  background-image: none;
}
.select[multiple]:focus,
.select[size]:not([size="1"]):focus {
  background-image: none;
}
.btn {
  border: 1px solid var(--border);
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 11px;
  background: #fff;
  color: var(--fg);
  font-weight: 610;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}
.btn:hover { background: var(--soft); border-color: #d7dfd4; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible,
.nav button:focus-visible,
.segmented button:focus-visible,
.tab-strip button:focus-visible,
.top-site-row:focus-visible {
  outline: 2px solid rgba(3, 197, 101, .45);
  outline-offset: 2px;
}
.btn.primary { background: var(--green); border-color: var(--green); color: var(--green-text); font-weight: 680; }
.btn.primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn.soft-primary {
  background: #fff;
  border-color: rgba(3, 197, 101, .45);
  color: var(--green-dark);
}
.btn.soft-primary:hover {
  background: #f1fbf5;
  border-color: rgba(3, 197, 101, .62);
}
.btn.danger { color: var(--danger-text); background: var(--soft); border-color: var(--border); }
.btn.icon { width: 40px; padding: 0; border-radius: 8px; }
.btn-svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.error { color: var(--danger-text); font-size: 14px; min-height: 18px; }

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  border-right: 1px solid rgba(14,15,12,.06);
  padding: 16px 10px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #fff;
}
.brand {
  display: flex;
  align-items: flex-start;
  padding: 6px 8px 18px;
}
.brand-main { display: grid; gap: 8px; min-width: 0; width: 100%; }
.brand-logo {
  display: block;
  width: min(174px, 100%);
  height: auto;
  object-fit: contain;
}
.brand-title { font-weight: 730; font-size: 17px; color: var(--fg); letter-spacing: 0; }
.brand-sub { font-size: 14px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.env-badge { font-size: 14px; border-radius: 999px; background: #fff; padding: 5px 9px; color: var(--body); box-shadow: rgba(14,15,12,.08) 0 0 0 1px; white-space: nowrap; }
.nav { display: grid; gap: 2px; }
.nav-group,
.nav-group-toggle {
  padding: 14px 9px 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0;
}
.nav-group-toggle {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}
.nav-group-toggle:hover {
  background: var(--soft);
  color: var(--fg);
}
.nav-group-toggle.active-group {
  color: var(--fg);
}
.nav-group-chevron {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}
.nav .nav-hidden-by-group {
  display: none;
}
.nav button {
  border: 1px solid transparent;
  background: transparent;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #6f756d;
  font-weight: 590;
  text-align: left;
  position: relative;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.nav button:hover { background: var(--soft); border-color: transparent; color: var(--fg); }
.nav button.active {
  background: #fbfcfa;
  border-color: transparent;
  color: var(--fg);
  box-shadow: inset 2px 0 0 var(--green);
  font-weight: 640;
}
.nav button.active::before {
  content: none;
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: var(--green);
}
.nav .ico {
  display: none;
}
.nav button.active .ico { background: transparent; color: var(--green); }
.nav .ico::before,
.nav .ico::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.35px solid currentColor;
  border-radius: 3px;
  opacity: .9;
}
.nav .ico::after { display: none; }
.ico-overview::before {
  inset: 5px;
  border: 0;
  width: 5px;
  height: 5px;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor, 0 7px 0 currentColor, 7px 7px 0 currentColor;
  border-radius: 1px;
}
.ico-finance::before {
  inset: 4px 6px;
  border-width: 0 0 1.5px;
  border-radius: 0;
  box-shadow: 0 -5px 0 -3px currentColor, 0 -9px 0 -3px currentColor;
}
.nav .ico-payments::before {
  inset: 4px 6px;
  border-width: 0 0 1.5px;
  border-radius: 0;
  box-shadow: 0 -5px 0 -3px currentColor, 0 -9px 0 -3px currentColor;
}
.nav .ico-payments::after {
  display: block;
  inset: 9px 5px 5px 10px;
  border-width: 0 0 1.5px;
  border-radius: 0;
  transform: rotate(-24deg);
}
.ico-inventory::before,
.ico-details::before,
.ico-audit::before {
  inset: 5px 4px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: inset 0 4px 0 -2.5px currentColor, inset 0 -4px 0 -2.5px currentColor;
}
.ico-sites::before,
.ico-analytics::before,
.ico-activity::before,
.ico-diagnostics::before {
  inset: 4px;
  border-radius: 999px;
}
.ico-sites::after,
.ico-analytics::after,
.ico-activity::after,
.ico-diagnostics::after {
  display: block;
  inset: 8px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
}
.ico-campaigns::before,
.ico-impressions::before {
  inset: 5px 4px;
  border-radius: 2px;
}
.ico-campaigns::after,
.ico-impressions::after {
  display: block;
  inset: 5px 9px 5px 4px;
  border-right: 1.5px solid currentColor;
}
.ico-trace::before,
.ico-clicks::before {
  inset: 5px;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0;
  transform: rotate(45deg);
}
.ico-trace::after,
.ico-clicks::after {
  display: block;
  width: 7px;
  height: 1.5px;
  inset: auto 5px 6px auto;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
}
.ico-quality::before,
.ico-funnel::before {
  inset: 5px;
  border-radius: 2px;
  transform: rotate(45deg);
}
.ico-operations::before,
.ico-config::before {
  inset: 4px;
  border-radius: 999px;
  border-style: dashed;
}
.ico-operations::after,
.ico-config::after {
  display: block;
  inset: 8px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
}
.ico-pricing::before {
  inset: 4px 7px;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: -4px 0 0 -2.5px currentColor, 4px 0 0 -2.5px currentColor;
}
.ico-whitelist::before,
.ico-status::before {
  inset: 4px;
}
.ico-whitelist::after,
.ico-status::after {
  display: block;
  inset: 6px 4px 6px 7px;
  border: 0;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  border-radius: 0;
  transform: rotate(-45deg);
}
.ico-blocking::before {
  inset: 4px;
  border-radius: 999px;
}
.ico-blocking::after {
  display: block;
  inset: 8px 4px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-35deg);
}
.ico-alerts::before {
  inset: 4px 8px 7px;
  border-width: 0 1.5px 1.5px;
  border-radius: 0 0 3px 3px;
}
.ico-alerts::after {
  display: block;
  inset: auto 8px 4px;
  height: 1.5px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
}
.ico-positions::before,
.ico-detection::before {
  inset: 4px;
  border-radius: 2px;
}
.ico-positions::after,
.ico-detection::after {
  display: block;
  inset: 8px 4px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
}

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 64px;
  border-bottom: 1px solid rgba(14,15,12,.06);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 24px 10px;
}
.topbar-actions-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1 1 auto;
}
.page-heading { min-width: 0; }
.page-title { margin: 0; font-size: 19px; line-height: 1.2; font-weight: 700; color: var(--fg); }
.page-caption { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.top-actions,
.topbar-utility { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar-utility { flex: 0 0 auto; }
.topbar-session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}
.date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.date-range .input {
  min-height: 34px;
  width: 132px;
  padding: 5px 8px;
  background: #fff;
}
.segmented {
  display: inline-flex;
  background: var(--soft);
  border-radius: 8px;
  box-shadow: rgba(14,15,12,.065) 0 0 0 1px;
  padding: 2px;
  gap: 1px;
}
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--body);
  padding: 0 11px;
  font-size: 14px;
  font-weight: 620;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.segmented button.active {
  background: #fff;
  color: var(--fg);
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px, rgba(14,15,12,.025) 0 1px 1px;
}
.segmented button.active::before {
  content: none;
}
.segmented.compact button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 14px;
}
.content {
  padding: 17px 24px 30px;
  display: grid;
  gap: 12px;
  background: var(--surface);
}
#content {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.filterbar {
  display: flex;
  gap: 8px 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 9px;
  background: #fff;
  border-radius: 8px;
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px;
}
.filter-summary {
  display: none;
}
.filter-fields {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}
.page-filter-fields {
  width: 100%;
  display: contents;
}
.filterbar .input, .filterbar .select {
  width: 100%;
  background-color: #fff;
  min-height: 34px;
  min-width: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 14px;
}
.filterbar .select {
  background-image: none;
}
.filterbar .field { margin-bottom: 0; }
.filterbar.global-filters {
  align-items: end;
  gap: 8px;
}
.page-filterbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}
.page-filterbar .filter-summary { grid-column: 1 / -1; }
.page-filterbar > .segmented {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
}
.page-filterbar .page-filter-fields > .segmented {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
}
.page-filterbar > .btn,
.page-filterbar .page-filter-fields > .btn {
  justify-self: start;
  min-height: 34px;
}
.audit-filterbar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.rank-admin-filterbar {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.rank-searchable-filter {
  position: relative;
  min-width: 0;
}
.rank-searchable-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.rank-searchable-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-searchable-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  width: min(420px, 92vw);
  max-width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .14);
}
.rank-searchable-filter.large .rank-searchable-menu {
  width: min(860px, calc(100vw - 320px));
  max-width: calc(100vw - 48px);
}
.rank-searchable-filter.large .rank-searchable-options {
  max-height: min(520px, calc(100vh - 300px));
}
.rank-searchable-query {
  margin-bottom: 8px;
}
.rank-searchable-options {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}
.rank-searchable-option {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rank-searchable-multi .rank-searchable-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.rank-option-check {
  color: var(--blue);
  font-weight: 700;
  text-align: center;
}
.rank-searchable-option:hover,
.rank-searchable-option.active {
  background: var(--blue-soft);
  color: var(--blue);
}
.rank-searchable-empty {
  padding: 10px 8px 4px;
  color: var(--muted);
  font-size: 13px;
}
.rank-searchable-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.rank-current-score-filterbar {
  grid-template-columns: minmax(0, 1fr);
}
.rank-current-model-filterbar {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  width: 100%;
}
.rank-current-model-primary {
  width: min(360px, 100%);
}
.rank-current-model-secondary {
  display: grid;
  grid-template-columns: minmax(170px, 360px) auto;
  align-items: end;
  gap: 8px;
}
.rank-admin-page {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: calc(100dvh - 132px);
}
.rank-admin-stack {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100dvh - 190px);
}
.rank-admin-stack > .panel,
.rank-admin-stack > [data-rank-current-score-panel] {
  min-height: 0;
}
.rank-admin-stack > .panel:not(.rank-adjustment-create-panel):not(.rank-adjustment-existing-panel):not(.rank-configs-panel) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.rank-admin-stack > .rank-configs-panel {
  display: block;
}
.rank-current-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.rank-current-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px;
  padding: 8px 10px;
}
.rank-current-metric span,
.rank-current-metric em {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.rank-current-metric strong {
  min-width: 0;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.rank-current-metric.ok { box-shadow: inset 3px 0 0 #03c565, rgba(14,15,12,.08) 0 0 0 1px; }
.rank-current-metric.warn { box-shadow: inset 3px 0 0 #f59e0b, rgba(14,15,12,.08) 0 0 0 1px; }
.rank-current-metric.error { box-shadow: inset 3px 0 0 #ef4444, rgba(14,15,12,.08) 0 0 0 1px; }
.rank-adjustment-create-panel {
  position: relative;
  z-index: 20;
  width: 100%;
  overflow: visible;
}
.rank-adjustment-create-panel .rank-admin-form {
  grid-template-columns: minmax(520px, 3fr) minmax(160px, 1fr) minmax(120px, .6fr) auto;
}
.rank-adjustment-create-panel .filterbar.panel-form {
  overflow: visible;
}
.rank-adjustment-create-panel .rank-searchable-filter {
  width: 100%;
}
.rank-adjustment-create-panel .rank-searchable-filter.large {
  position: relative;
  z-index: 60;
}
.rank-adjustment-create-panel .rank-searchable-trigger {
  width: 100%;
}
.rank-adjustment-create-panel .rank-searchable-menu {
  z-index: 80;
}
.rank-adjustment-create-actions {
  display: flex;
  justify-content: flex-start;
}
.rank-adjustment-panel-filter {
  position: relative;
  z-index: 70;
  overflow: visible;
  margin-bottom: 12px;
  align-items: flex-end;
}
.rank-adjustment-panel-filter .rank-searchable-filter {
  flex: 0 1 320px;
  min-width: min(260px, 100%);
}
.rank-adjustment-panel-filter > .btn {
  align-self: flex-end;
}
.rank-adjustment-panel-filter .rank-searchable-menu {
  z-index: 90;
}
.rank-adjustment-existing-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: visible;
}
.rank-adjustment-existing-table {
  height: 100%;
  min-height: 0;
  max-height: none;
}
.rank-adjustment-dialog {
  overflow: hidden;
}
.float-dialog.rank-adjustment-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: 50vh;
  overflow: hidden;
}
.rank-adjustment-dialog .float-dialog-body {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  min-height: 0;
}
.rank-adjustment-dialog-form {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.rank-adjustment-dialog .field,
.rank-adjustment-dialog .input,
.rank-adjustment-dialog .select,
.rank-adjustment-dialog .rank-searchable-trigger {
  min-width: 0;
  max-width: 100%;
}
.rank-adjustment-dialog .rank-searchable-filter {
  position: relative;
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
}
.rank-adjustment-dialog .rank-searchable-filter.large .rank-searchable-menu {
  width: 100%;
  max-width: 100%;
}
.rank-adjustment-dialog .rank-searchable-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-width: none;
  margin-top: 0;
  box-shadow: inset 0 0 0 1px var(--subtle-ring);
}
.rank-adjustment-dialog .rank-searchable-trigger span {
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.rank-adjustment-dialog .rank-searchable-options {
  max-height: min(360px, calc(70vh - 180px));
  overflow: auto;
}
.rank-adjustment-dialog .rank-searchable-option {
  display: block;
  min-height: 52px;
  padding: 12px 14px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
.rank-site-option {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.rank-site-option-primary {
  display: block;
  min-width: 0;
  color: var(--fg);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.rank-site-option-meta {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.rank-model-group-option {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.rank-model-group-option-primary {
  display: block;
  min-width: 0;
  color: var(--fg);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.rank-model-group-option-meta {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.rank-model-group-select-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.rank-adjustment-dialog-error {
  color: #dc2626;
  font-size: 13px;
  line-height: 1.4;
}
.rank-admin-table {
  max-height: 64vh;
}
.rank-admin-table .rank-empty-row td {
  height: 100%;
  border-bottom: 0;
  text-align: center;
  vertical-align: middle;
}
.rank-admin-table .rank-empty-row .empty {
  box-shadow: none;
  background: transparent;
}
.rank-factor-weights-table {
  height: 100%;
  min-height: calc(100dvh - 230px);
  max-height: none;
}
.rank-admin-table table {
  min-width: 1040px;
}
.rank-admin-table td {
  vertical-align: top;
}
.rank-admin-number {
  width: 96px;
}
.rank-admin-select {
  width: 96px;
}
.rank-unsaved-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
  margin-top: 4px;
  margin-left: 8px;
  color: #dc2626;
  font-size: 12px;
  line-height: 1.3;
  visibility: hidden;
  pointer-events: none;
}
.rank-unsaved-hint.visible {
  visibility: visible;
  pointer-events: auto;
}
.rank-restore-control {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d4fc7;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.rank-restore-control:hover {
  text-decoration: underline;
}
.rank-row-removed {
  opacity: 0.55;
}
.rank-admin-table .btn.small {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}
.rank-current-score-columns {
  background: #fff;
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px;
}
.rank-current-score-table table {
  min-width: max-content;
}
.rank-current-score-table {
  height: 100%;
  min-height: calc(100dvh - 275px);
  max-height: none;
}
.rank-current-score-table th,
.rank-current-score-table td {
  max-width: 220px;
  padding: 5px 7px;
  font-size: 13px;
  line-height: 1.35;
}
.rank-current-score-table th {
  font-size: 12px;
}
.rank-current-score-table .mono {
  font-size: 12px;
}
.rank-current-score-table .chip {
  min-height: 20px;
  gap: 4px;
  padding: 2px 6px;
  font-size: 12px;
}
.rank-current-score-table .rank-reason-text,
.rank-current-score-table .rank-json-summary {
  max-width: 220px;
}
.rank-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 720;
  text-align: left;
  cursor: pointer;
}
.rank-sort.active {
  color: var(--primary);
}
.rank-sort span {
  color: var(--muted);
  font-size: 11px;
}
.rank-sort-arrow.active {
  color: var(--primary);
}
.rank-factor-score-cell {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-color: rgba(29, 79, 199, .32);
  text-underline-offset: 3px;
}
.rank-factor-score-cell:hover {
  color: var(--primary);
}
.rank-displayable-detail {
  border: 0;
  cursor: pointer;
}
.rank-displayable-detail:hover {
  filter: brightness(.98);
}
.float-dialog.rank-factor-calc-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
}
.float-dialog.rank-score-detail-dialog {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80vw;
  max-width: 80vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 8px 0 0 8px;
  display: flex;
  flex-direction: column;
}
.rank-score-detail-dialog .float-dialog-body {
  min-width: 0;
  flex: 1;
  overflow: auto;
}
.rank-score-detail-summary {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.rank-score-detail-list {
  display: grid;
  gap: 8px;
}
.rank-score-detail-item {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 91, 255, .11);
  border-radius: 8px;
  background: #fff;
}
.rank-score-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.rank-score-detail-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.rank-score-detail-index {
  color: var(--muted);
  font-size: 12px;
}
.rank-score-detail-identity strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}
.rank-score-detail-identity .sub,
.rank-score-detail-model {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.rank-score-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 360px;
}
.rank-score-detail-metric {
  min-width: 66px;
  padding: 4px 7px;
  border: 1px solid rgba(14, 15, 12, .08);
  border-radius: 7px;
  background: rgba(247, 249, 252, .86);
  text-align: right;
}
.rank-score-detail-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}
.rank-score-detail-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.1;
}
.rank-score-detail-metric.primary {
  border-color: rgba(31, 91, 255, .2);
  background: rgba(31, 91, 255, .08);
  color: #1d4fc7;
}
.rank-score-detail-metrics .chip {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 12px;
}
.rank-score-detail-reason,
.rank-score-detail-inputs {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12px;
}
.rank-score-detail-reason > span,
.rank-score-detail-inputs > span {
  color: var(--muted);
}
.rank-score-detail-reason .rank-reason-text {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.rank-score-detail-inputs > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.rank-score-input-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(14, 15, 12, .05);
  color: var(--text);
  line-height: 1.35;
}
.rank-score-input-chip em {
  color: var(--muted);
  font-style: normal;
}
.rank-score-input-chip strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}
.rank-score-input-chip.muted {
  color: var(--muted);
}
.rank-factor-calc-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rank-factor-calc-summary > div {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  background: var(--soft);
  padding: 9px;
}
.rank-factor-calc-summary span {
  color: var(--muted);
  font-size: 12px;
}
.rank-factor-calc-formula {
  margin-top: 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px;
  padding: 10px;
}
.rank-factor-rule-box {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
}
.rank-factor-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rank-factor-rule-head strong {
  font-size: 14px;
}
.rank-factor-rule-head span {
  color: var(--muted);
  font-size: 12px;
}
.rank-factor-rule-box p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}
.rank-factor-rule-list {
  display: grid;
  gap: 7px;
  margin: 0;
}
.rank-factor-rule-list > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
}
.rank-factor-rule-list dt {
  color: var(--muted);
  font-weight: 700;
}
.rank-factor-rule-list dd {
  margin: 0;
  min-width: 0;
}
.rank-factor-rule-example {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.rank-factor-rule-example dd {
  color: var(--text);
  line-height: 1.55;
}
.rank-factor-calc-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.rank-factor-calc-section h3 {
  margin: 0;
  font-size: 14px;
}
.rank-factor-calc-intro {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  color: var(--text);
}
.rank-factor-calc-intro strong {
  font-size: 15px;
  line-height: 1.4;
}
.rank-factor-calc-intro span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.rank-factor-calc-details {
  display: grid;
  gap: 6px;
  margin: 0;
}
.rank-factor-calc-details > div {
  display: grid;
  grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr);
  gap: 8px;
}
.rank-factor-calc-details dt {
  color: var(--muted);
  font-weight: 680;
}
.rank-factor-calc-details dd {
  min-width: 0;
  margin: 0;
}
.rank-factor-rule-link {
  display: grid;
  gap: 2px;
  justify-items: start;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.rank-factor-rule-link span {
  font-weight: 760;
  text-decoration: underline;
  text-decoration-color: rgba(29, 79, 199, .32);
  text-underline-offset: 3px;
}
.rank-factor-rule-link small {
  color: var(--muted);
}
.rank-factor-rule-link:hover span {
  color: var(--primary);
}
.rank-factor-distribution-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rank-display-tags-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.rank-display-tags-head,
.rank-display-tags-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(56px, auto);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
}
.rank-display-tags-head {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.rank-display-tags-row + .rank-display-tags-row {
  border-top: 1px solid var(--line);
}
.rank-display-tags-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.rank-display-tags-row > span:last-child {
  justify-self: end;
  max-width: 100%;
}
.rank-display-tags-row > span:last-child .chip {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.rank-pipeline-calculations {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.rank-pipeline-calc-section {
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.06) 0 0 0 1px;
}
.rank-pipeline-calc-section summary {
  cursor: pointer;
  padding: 7px 8px;
  font-weight: 760;
}
.rank-pipeline-compact-section summary {
  font-size: 13px;
}
.rank-pipeline-compact-list {
  display: grid;
  gap: 0;
  padding: 0 8px 8px;
}
.rank-pipeline-compact-item {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(90px, .45fr) minmax(120px, .65fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.35;
}
.rank-pipeline-compact-item > span,
.rank-pipeline-compact-item > strong,
.rank-pipeline-compact-item > em,
.rank-pipeline-compact-item > small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rank-pipeline-compact-item > span {
  color: var(--muted);
  font-weight: 680;
}
.rank-pipeline-compact-item > strong {
  color: var(--fg);
  font-weight: 760;
}
.rank-pipeline-compact-item > em,
.rank-pipeline-compact-item > small {
  color: var(--muted);
  font-style: normal;
}
.rank-pipeline-calc-list {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}
.rank-pipeline-calc-item {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.rank-pipeline-calc-item h4 {
  margin: 0;
  font-size: 13px;
}
.float-dialog.rank-history-dialog {
  width: min(880px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
}
.rank-history-list {
  min-width: 0;
}
.rank-history-table {
  max-height: min(520px, calc(100vh - 240px));
}
.rank-history-table table {
  min-width: 760px;
}
.rank-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.float-dialog.rank-pipeline-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(760px, calc(100vh - 32px));
}
.rank-pipeline-dialog .float-dialog-body {
  overflow: auto;
}
.rank-pipeline-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.rank-pipeline-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rank-pipeline-main,
.rank-pipeline-stages {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.rank-pipeline-head,
.rank-pipeline-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rank-pipeline-stage {
  display: grid;
  gap: 6px;
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px;
  padding: 8px;
}
.rank-pipeline-stage h3 {
  margin: 0;
  font-size: 14px;
}
.rank-pipeline-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rank-pipeline-score {
  color: #123fb0;
  font-weight: 760;
}
.rank-displayable-process {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: rgba(0,102,204,.14) 0 0 0 1px;
  padding: 8px;
}
.rank-displayable-process-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.rank-displayable-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rank-config-page {
  --rank-config-label-offset: 25px;
  --rank-config-label-height: 18px;
  --rank-config-field-gap: 6px;
  --rank-config-control-height: 36px;
  min-height: 0;
}
.rank-config-open-panel {
  position: relative;
  overflow: visible;
}
.rank-config-open-panel.rank-searchable-panel-open {
  z-index: 90;
}
.rank-config-form {
  align-items: end;
  overflow: visible;
}
.rank-config-global-form {
  display: grid;
  grid-template-columns: minmax(120px, .65fr) minmax(120px, .65fr) minmax(150px, .8fr) minmax(180px, 1fr) minmax(132px, auto);
  align-items: end;
}
.rank-config-global-actions {
  display: flex;
  align-items: flex-start;
  padding-top: var(--rank-config-label-offset);
  min-width: 0;
}
.rank-config-global-actions .btn {
  width: 100%;
  height: var(--rank-config-control-height);
  min-height: var(--rank-config-control-height);
  align-self: end;
}
.rank-config-target-create,
.rank-config-target-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.rank-config-target-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) minmax(120px, .55fr) minmax(150px, .7fr) minmax(142px, auto);
  gap: 8px;
  align-items: end;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.rank-config-target-row .field {
  margin-bottom: 0;
  min-width: 0;
}
.rank-config-page .field {
  gap: var(--rank-config-field-gap);
}
.rank-config-page .field > span {
  display: flex;
  align-items: center;
  min-height: var(--rank-config-label-height);
  line-height: var(--rank-config-label-height);
}
.rank-config-page .field > .rank-unsaved-hint:not([data-rank-row-dirty-notice]) {
  display: none;
}
.rank-config-target-row .rank-searchable-trigger,
.rank-config-target-row .input,
.rank-config-target-row .select {
  width: 100%;
  height: var(--rank-config-control-height);
  min-height: var(--rank-config-control-height);
}
.rank-config-target-row .rank-searchable-filter,
.rank-config-target-row .rank-searchable-filter.large {
  overflow: visible;
  z-index: 3;
}
.rank-config-target-row .rank-searchable-menu {
  z-index: 80;
}
.rank-config-target-row .rank-searchable-filter.rank-searchable-open .rank-searchable-menu {
  z-index: 120;
}
.rank-config-target-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: var(--rank-config-label-offset);
  min-height: calc(var(--rank-config-label-offset) + var(--rank-config-control-height));
  white-space: nowrap;
}
.rank-config-target-actions .btn {
  height: var(--rank-config-control-height);
  min-height: var(--rank-config-control-height);
}
.rank-config-target-row [data-rank-row-dirty-notice] {
  grid-column: 1 / -1;
}
.rank-config-target-row .rank-searchable-filter > .rank-unsaved-hint:not([data-rank-row-dirty-notice]) {
  display: none;
}
.rank-config-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.rank-config-readonly-table table {
  min-width: 680px;
}
.rank-postprocess-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.rank-postprocess-rule-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px;
  padding: 10px;
}
.rank-postprocess-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rank-postprocess-rule-head h3 {
  margin: 0;
  font-size: 14px;
}
.rank-postprocess-rule-list {
  display: grid;
  gap: 8px;
}
.rank-postprocess-rule-row {
  display: grid;
  grid-template-columns: minmax(44px, .55fr) repeat(2, minmax(64px, 1fr)) minmax(52px, auto);
  gap: 6px;
  align-items: end;
}
.rank-postprocess-rule-row .field {
  min-width: 0;
  margin-bottom: 0;
}
.rank-postprocess-rule-row .input {
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding-left: 6px;
  padding-right: 6px;
}
.rank-postprocess-rule-row .rank-admin-number {
  width: 100%;
}
.rank-postprocess-rule-row .btn {
  min-width: 52px;
  min-height: 34px;
  height: 34px;
  padding: 0 8px;
  align-self: end;
}
.rank-postprocess-rule-card[data-time-window="true"] .rank-postprocess-rule-row {
  grid-template-columns: minmax(44px, .5fr) repeat(3, minmax(56px, .85fr)) minmax(52px, auto);
}
.field.compact span {
  font-size: 12px;
}
.rank-exposure-config-table table {
  min-width: 1180px;
  table-layout: fixed;
}
.rank-exposure-config-table th,
.rank-exposure-config-table td {
  vertical-align: middle;
}
.rank-exposure-config-table th:nth-child(1),
.rank-exposure-config-table td:nth-child(1) {
  width: 54px;
  text-align: center;
}
.rank-exposure-config-table th:nth-child(2),
.rank-exposure-config-table td:nth-child(2) {
  width: 92px;
}
.rank-exposure-config-table th:nth-child(3),
.rank-exposure-config-table td:nth-child(3) {
  width: 260px;
}
.rank-exposure-config-table th:nth-child(4),
.rank-exposure-config-table td:nth-child(4),
.rank-exposure-config-table th:nth-child(5),
.rank-exposure-config-table td:nth-child(5),
.rank-exposure-config-table th:nth-child(6),
.rank-exposure-config-table td:nth-child(6),
.rank-exposure-config-table th:nth-child(7),
.rank-exposure-config-table td:nth-child(7) {
  width: 112px;
}
.rank-exposure-config-table th:nth-child(8),
.rank-exposure-config-table td:nth-child(8) {
  width: 150px;
}
.rank-exposure-config-table th:nth-child(9),
.rank-exposure-config-table td:nth-child(9) {
  width: 140px;
}
.rank-exposure-config-table .input,
.rank-exposure-config-table .select,
.rank-exposure-config-table .rank-searchable-trigger {
  width: 100%;
  height: 34px;
  min-height: 34px;
}
.rank-exposure-config-table .rank-admin-number {
  min-width: 96px;
}
.rank-exposure-site-select {
  min-width: 220px;
}
.rank-exposure-site-select .rank-searchable-menu {
  width: min(520px, 92vw);
}
.rank-exposure-config-table .rank-row-actions {
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}
.rank-exposure-config-table .rank-row-actions .btn {
  min-width: 54px;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  justify-content: center;
}
.rank-configs-table {
  overflow-x: hidden;
  max-height: none;
}
.rank-configs-table table {
  width: 100%;
  table-layout: fixed;
  min-width: 0;
}
.rank-configs-table th,
.rank-configs-table td {
  max-width: none;
  padding: 7px 6px;
}
.rank-configs-table td {
  vertical-align: top;
}
.rank-configs-table .input,
.rank-configs-table .select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 6px 7px;
  font-size: 12px;
}
.rank-configs-table [data-rank-configs-field="value"] {
  text-overflow: ellipsis;
}
.rank-configs-table th:nth-child(1),
.rank-configs-table td:nth-child(1) {
  width: 10%;
}
.rank-configs-table th:nth-child(2),
.rank-configs-table td:nth-child(2) {
  width: 11%;
}
.rank-configs-table th:nth-child(3),
.rank-configs-table td:nth-child(3),
.rank-configs-table th:nth-child(4),
.rank-configs-table td:nth-child(4) {
  width: 9%;
}
.rank-configs-table th:nth-child(5),
.rank-configs-table td:nth-child(5) {
  width: 88px;
}
.rank-configs-table th:nth-child(6),
.rank-configs-table td:nth-child(6) {
  width: 92px;
}
.rank-configs-table th:nth-child(7),
.rank-configs-table td:nth-child(7) {
  width: auto;
}
.rank-configs-table th:nth-child(8),
.rank-configs-table td:nth-child(8) {
  width: 44px;
  text-align: center;
}
.rank-configs-table th:nth-child(9),
.rank-configs-table td:nth-child(9) {
  width: 112px;
}
.rank-configs-table .rank-row-actions {
  min-width: 116px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.rank-configs-table .rank-row-actions .btn {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
}
.rank-configs-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.rank-configs-panel-head .panel-title {
  margin-bottom: 0;
}
.rank-config-create-dialog {
  overflow: hidden;
}
.float-dialog.rank-config-create-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(680px, calc(100dvh - 112px));
  overflow: hidden;
}
.rank-config-create-dialog .float-dialog-body {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
.rank-config-create-form {
  display: grid;
  gap: 10px;
}
.rank-config-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.rank-config-create-value,
.rank-config-create-description {
  grid-column: 1 / -1;
}
.rank-config-create-description .textarea {
  min-height: 110px;
}
.rank-config-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, .28);
}
.rank-config-detail-drawer {
  width: 50vw;
  max-width: 50vw;
  min-width: 520px;
  height: 100vh;
  overflow: auto;
  background: #fff;
  box-shadow: -18px 0 48px rgba(15, 23, 42, .18);
  padding: 18px;
}
.rank-config-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.rank-config-detail-body {
  display: grid;
  gap: 18px;
}
.rank-config-detail-body .textarea {
  min-height: 140px;
}
.rank-config-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rank-config-detail-meta div,
.rank-config-detail-actions {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.rank-config-detail-meta span,
.rank-config-detail-actions > span {
  color: var(--muted);
  font-size: 12px;
}
.rank-config-detail-meta strong {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}
.rank-traffic-snapshot-table table,
.rank-traffic-history-table table {
  min-width: 900px;
}
.rank-traffic-snapshot-table .rank-sort-header {
  justify-content: flex-start;
  text-align: left;
}
.rank-sort-header {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  padding: 0;
  text-align: right;
}
.rank-sort-header:hover {
  color: var(--primary);
}
.rank-traffic-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.rank-traffic-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px;
  padding: 9px 10px;
}
.rank-traffic-metric span,
.rank-traffic-metric em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.rank-traffic-metric strong {
  color: var(--fg);
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.rank-traffic-note {
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: rgba(0,102,204,.16) 0 0 0 1px;
  color: #31546f;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
  padding: 10px 12px;
}
.rank-traffic-chart {
  display: grid;
  gap: 8px;
  min-height: 260px;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px;
  padding: 10px;
  margin: 12px 0;
}
.rank-traffic-chart svg {
  width: 100%;
  height: 220px;
  display: block;
}
.rank-traffic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.rank-traffic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rank-traffic-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.rank-current-score-table .rank-score-pipeline {
  min-width: 360px;
  gap: 3px;
}
.rank-current-score-table .rank-score-step {
  min-width: 48px;
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 11px;
}
.rank-current-score-table .rank-score-step strong {
  font-size: 11px;
}
.rank-model-result-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: calc(100dvh - 260px);
}
.rank-model-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rank-score-pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 520px;
}
.rank-score-step {
  display: inline-grid;
  grid-template-columns: auto;
  gap: 1px;
  min-width: 58px;
  border-radius: 8px;
  background: rgba(31, 91, 255, .06);
  padding: 4px 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.rank-score-step strong {
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 760;
}
.rank-final-rank {
  font-weight: 760;
}
.rank-status-chip {
  white-space: nowrap;
}
.rank-status-chip.ok {
  background: rgba(3, 197, 101, .1);
  color: #057a42;
}
.rank-status-chip.warn {
  background: rgba(248, 181, 35, .14);
  color: #8a5b00;
}
.rank-status-chip.plain {
  background: rgba(31, 91, 255, .08);
  color: #1d4fc7;
}
.rank-reason-text,
.rank-json-summary {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-json-summary {
  max-width: 360px;
  color: var(--muted);
}
.rank-admin-form {
  margin-bottom: 12px;
}
.rank-admin-empty {
  display: grid;
  gap: 8px;
}
.panel-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}
.panel > .filterbar,
.panel > form.filterbar,
.panel .filterbar.panel-form {
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.panel > .filterbar.panel-form,
.panel > form.filterbar.panel-form {
  padding: 0;
}
.panel-form > .field,
.panel-form > .input,
.panel-form > .select,
.panel-form > .textarea {
  min-width: 0;
}
.panel-form > .btn {
  justify-self: start;
}
.panel-form .textarea,
.panel-form .beta-field,
.panel-form .app-config-value,
.panel-form .inline-flex-field,
.panel-form .multi-select-field {
  grid-column: span 2;
}
.public-banner-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.public-banner-form .field {
  min-width: 0;
}
.public-banner-placements {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.public-banner-placements legend {
  font-size: 14px;
  color: #6f756d;
  font-weight: 700;
  margin-bottom: 6px;
}
.public-banner-image-path,
.public-banner-target-url,
.public-banner-placements,
.public-banner-notes {
  grid-column: span 3;
}
.public-banner-upload-field {
  grid-column: span 2;
}
.public-banner-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.check-option {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #d8ddd5;
  border-radius: 8px;
  background: #fbfcfa;
  color: #20251d;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.check-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #245d3c;
}
.check-option:has(input:checked) {
  border-color: #245d3c;
  background: #eef7f1;
}
.public-banner-placement-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 180px;
}
.public-banner-preview {
  width: 220px;
  max-width: 100%;
  aspect-ratio: 500 / 120;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f7f4;
  box-shadow: rgba(14,15,12,.09) 0 0 0 1px;
}
.public-banner-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.public-banner-table td:first-child {
  min-width: 240px;
}
.public-banner-stats-controls {
  margin-bottom: 12px;
}
.public-banner-stats-picker {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
}
.public-banner-stats-check {
  min-height: 34px;
}
.public-banner-stats-total {
  margin-top: 10px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--body);
  font-size: 14px;
}
.public-banner-stats-total strong {
  color: var(--fg);
  font-size: 14px;
}
.public-banner-stats-table table {
  min-width: 1040px;
}
.public-banner-stats-table th:first-child,
.public-banner-stats-table td:first-child {
  min-width: 210px;
  max-width: 280px;
}
.public-banner-stats-table .date-col {
  min-width: 86px;
  max-width: 96px;
}
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-field { min-width: 0; }
.global-filters .identity-filter,
.global-filters .filter-field { min-width: 0; }
.global-filters .btn { align-self: end; min-width: 64px; min-height: 36px; }
.stats-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.stats-search { width: min(260px, 100%); }
.stats-compact-select { min-width: 128px; background: #fff; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.section-head .panel-title { margin-bottom: 0; }
.inline-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}
.inline-spacer-sm { margin-bottom: 12px; }
.inline-spacer-top { margin-top: 12px; }
.inline-flex-field { flex: 1 1 260px; }
.wide-input { min-width: min(420px, 100%); }
.detection-summary-table table { min-width: 980px; }
.warn-panel {
  background: var(--soft);
  box-shadow: var(--ring) 0 0 0 1px;
}
.recommendation-controls { align-items: flex-start; }
.recommendation-controls .field { width: 180px; }
.recommendation-controls .field small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}
.recommendation-controls .btn { align-self: end; }
.explain-copy { margin: -4px 0 12px; max-width: 860px; }
.tab-strip {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  background: var(--soft);
  border-radius: 8px;
  box-shadow: rgba(14,15,12,.065) 0 0 0 1px;
  scrollbar-width: none;
}
.tab-strip::-webkit-scrollbar { display: none; }
.tab-strip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  min-height: 29px;
  border-radius: 6px;
  background: transparent;
  color: var(--body);
  padding: 0 11px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 620;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.tab-strip button.active {
  background: #fff;
  color: var(--fg);
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px, rgba(14,15,12,.025) 0 1px 1px;
}
.tab-strip button.active::before {
  content: none;
}
.tab-strip[data-tab-scope="rankFactorWeights"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}
.tab-strip[data-tab-scope="rankScoreAdjustments"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}
.tab-strip[data-tab-scope="rankTrafficConfigs"] {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: 100%;
}
.tab-strip[data-tab-scope="rankTrafficConfigs"] button {
  min-width: 0;
  white-space: normal;
}
.tab-strip[data-tab-scope="rankFactorWeights"] button {
  width: 100%;
  min-height: 36px;
}
.tab-strip[data-tab-scope="rankScoreAdjustments"] button {
  width: 100%;
  min-height: 36px;
}
.tab-strip[data-tab-scope="rankFactorWeights"] button:not(.active) {
  background: transparent;
  color: #1d4fc7;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .14);
}
.tab-strip[data-tab-scope="rankScoreAdjustments"] button:not(.active) {
  background: transparent;
  color: #1d4fc7;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .14);
}
.tab-strip[data-tab-scope="rankFactorWeights"] button.active {
  background: #fff;
  color: #123fb0;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .28), rgba(14,15,12,.025) 0 1px 1px;
}
.tab-strip[data-tab-scope="rankScoreAdjustments"] button.active {
  background: #fff;
  color: #123fb0;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .28), rgba(14,15,12,.025) 0 1px 1px;
}
.audit-nav { margin-bottom: -8px; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.pager-actions { display: inline-flex; gap: 8px; align-items: center; }
.pager-size-static {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 7px;
  background: #f7f9f6;
  color: var(--muted);
  box-shadow: rgba(14,15,12,.05) 0 0 0 1px inset;
  padding: 0 9px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.action-panel {
  display: block;
  width: 100%;
  min-height: 108px;
  text-align: left;
  border: 0;
  color: inherit;
  cursor: pointer;
}
.action-panel:hover { background: var(--soft); }
.action-panel .panel-title { margin-bottom: 6px; }
.panel .filterbar {
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}
.panel .filterbar .btn.primary {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
}
.beta-field { flex: 1 1 360px; }
.pricing-whitelist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.pricing-whitelist-editor,
.pricing-whitelist-picker {
  min-width: 0;
}
.pricing-whitelist-editor {
  display: grid;
  gap: 10px;
}
.pricing-whitelist-editor .btn {
  justify-self: start;
}
.pricing-beta-ids {
  height: 520px;
  min-height: 520px;
  width: 100%;
}
.pricing-whitelist-picker .allowlist-tools {
  margin-top: 0;
}
.pricing-whitelist-picker .allowlist-picker {
  max-height: 520px;
}
.allowlist-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}
.allowlist-tools .input { background: #fff; min-width: min(360px, 100%); }
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border-radius: 8px;
  background: var(--soft);
  padding: 0 10px;
  color: var(--body);
  font-size: 14px;
  font-weight: 700;
}
.inline-check input { accent-color: var(--green); }
.allowlist-picker {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  padding: 6px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: var(--subtle-ring) 0 0 0 1px;
  background: #fff;
}
.allowlist-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}
.allowlist-row:hover { background: var(--soft); }
.allowlist-row[data-selected="true"] {
  background: #f1fbf5;
  box-shadow: rgba(3, 197, 101, .22) 0 0 0 1px inset;
}
.allowlist-row input { accent-color: var(--green); }
.allowlist-main { min-width: 0; }
.allowlist-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-size: 14px;
}
.allowlist-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.app-config-value { flex: 1 1 320px; min-height: 72px; }
.multi-select-field { flex: 1 1 260px; min-width: 260px; }
.multi-select-field .select { width: 100%; }
.diag-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.diag-form .field { margin-bottom: 0; min-width: 0; }
.diag-form .wide { grid-column: span 2; }
.diag-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
  grid-column: span 2;
}
.diag-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.diag-rule-group {
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.diag-rule-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.diag-rule-item {
  display: grid;
  gap: 3px;
  font-size: 14px;
  line-height: 1.45;
}
.diag-rule-item strong { color: var(--fg); }
.diag-rule-item span { color: var(--muted); }
.grid { display: grid; gap: 12px; min-width: 0; }
.kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis-nine { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.card, .panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px;
}
.card {
  position: relative;
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px 9px;
  overflow: hidden;
}
.kpi-card {
  box-shadow: rgba(14,15,12,.045) 0 0 0 1px;
}
.kpi-badge {
  position: absolute;
  top: 9px;
  right: 10px;
  max-width: 48%;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 760;
  white-space: nowrap;
}
.kpi-card .kpi-badge + .label {
  padding-right: 48px;
}
.kpi-rate-inline {
  font-size: .68em;
  font-weight: 680;
  color: var(--muted);
  vertical-align: .08em;
  white-space: nowrap;
}
.kpi-card.danger {
  box-shadow: rgba(185, 28, 28, .34) 0 0 0 1px;
  background: #fffafa;
}
.kpi-card.danger .value {
  color: #b91c1c;
}
.kpi-card.danger .sub {
  color: #7f1d1d;
}
.kpi-card.warn {
  box-shadow: rgba(180, 83, 9, .26) 0 0 0 1px;
  background: #fffdf7;
}
.kpi-card.warn .value {
  color: #92400e;
}
.card::before {
  content: none;
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 999px;
  background: var(--green);
  opacity: .48;
}
.panel { min-width: 0; padding: 13px; overflow: hidden; }
.label { color: #6f756d; font-size: 14px; font-weight: 570; line-height: 1.35; }
.value {
  margin-top: 4px;
  color: var(--fg);
  font-size: clamp(17px, 1.08vw, 21px);
  font-weight: 650;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.sub { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.42; overflow-wrap: anywhere; }
.panel-title { margin: 0 0 9px; color: var(--fg); font-size: 15px; line-height: 1.25; font-weight: 670; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 12px; }
.action-hint { align-self: center; margin-top: 0; }
.trend-line { display: grid; min-width: 0; gap: 8px; }
.trend-line svg { width: 100%; height: auto; min-height: 230px; display: block; overflow: hidden; }
.trend-grid { stroke: #edf1ec; stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-domain-line { stroke: #e3e9e1; stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.trend-reference-line { stroke: rgba(14, 15, 12, .28); stroke-width: 1; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.trend-area { fill: rgba(3, 197, 101, .08); }
.trend-path { fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trend-path.secondary { stroke-width: 2; }
.trend-point { fill: #fff; stroke: var(--green); stroke-width: 1.9; vector-effect: non-scaling-stroke; }
.trend-point.secondary { stroke-width: 2; opacity: .9; }
.trend-point.high { stroke: var(--fg); fill: var(--soft); }
.trend-point.low { stroke: var(--muted); fill: #fff; }
.trend-axis-label { fill: var(--muted); font-size: 14px; font-weight: 700; }
.trend-axis-label.compact { font-size: 10px; font-weight: 500; }
.trend-axis-label.y.compact { dominant-baseline: middle; }
.trend-hover-zone {
  fill: transparent;
  cursor: crosshair;
  outline: none;
}
.trend-hover-zone:focus {
  fill: rgba(3, 197, 101, .08);
}
.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.trend-legend-line {
  width: 22px;
  height: 0;
  border-top: 4px solid var(--green);
  border-radius: 999px;
}
.trend-legend-line.dashed {
  border-top-style: dashed;
}
.trend-hover-tooltip {
  position: fixed;
  z-index: 60;
  min-width: 190px;
  max-width: 260px;
  border-radius: 8px;
  background: rgba(14, 15, 12, .96);
  color: #fff;
  padding: 10px 11px;
  box-shadow: 0 14px 36px rgba(14, 15, 12, .22);
  pointer-events: none;
}
.trend-hover-tooltip[hidden] { display: none; }
.trend-hover-title {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  font-weight: 800;
}
.trend-hover-items {
  display: grid;
  gap: 6px;
}
.trend-hover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  line-height: 1.3;
}
.trend-hover-item span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, .82);
  font-weight: 700;
}
.trend-hover-item i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.trend-hover-item strong {
  color: #fff;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.trend-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.trend-summary.single { grid-template-columns: minmax(0, 1fr); }
.trend-summary div {
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px;
  padding: 8px 10px;
}
.trend-summary span,
.trend-summary em {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.35;
}
.trend-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.trend-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }
.position-label { color: var(--fg); font-weight: 800; line-height: 1.35; white-space: normal; }
.raw-key { margin-top: 4px; word-break: break-all; white-space: normal; }
.identity-main { color: var(--fg); font-weight: 800; line-height: 1.35; white-space: normal; }
.identity-sub { margin-top: 3px; white-space: normal; word-break: break-all; }
.identity-filter { min-width: 220px; }
.identity-filter .select { width: 100%; max-width: 320px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--subtle-ring) 0 0 0 1px;
  color: var(--body);
  padding: 4px 9px;
  font-size: 14px;
  font-weight: 590;
  line-height: 1.2;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.chip.ok .dot { background: var(--green); }
.chip.warn .dot { background: var(--warning); }
.chip.bad { color: var(--danger-text); background: var(--soft); }
.chip.bad .dot { background: var(--danger); }
.table-wrap { max-width: 100%; overflow: auto; border-radius: 8px; box-shadow: rgba(14,15,12,.045) 0 0 0 1px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; white-space: nowrap; }
th { color: #747a72; font-size: 14px; font-weight: 620; background: #fafbfd; position: sticky; top: 0; z-index: 1; }
td { color: var(--body); }
td strong { color: var(--fg); }
tbody tr:hover td { background: #fcfdfb; }
.table-wrap table { min-width: max-content; }
.table-wrap th,
.table-wrap td { max-width: 320px; overflow-wrap: anywhere; }
.table-wrap td:not(.num) { white-space: normal; }
.table-wrap .num { white-space: nowrap; }
.warning-box {
  border: 1px solid rgba(201, 113, 0, .18);
  border-radius: 8px;
  background: #fff8eb;
  color: #7a4b00;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 620;
}
.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  font: inherit;
  font-weight: 720;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.dimension-panel {
  display: grid;
  gap: 14px;
}
.dimension-head,
.dimension-columns-head,
.dimension-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.dimension-report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-radius: 8px;
  background: var(--soft);
  padding: 6px;
}
.dimension-report-tabs button,
.dimension-sort {
  border: 0;
  background: transparent;
  color: var(--body);
  font: inherit;
  cursor: pointer;
}
.dimension-report-tabs button {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 640;
}
.dimension-report-tabs button.active {
  background: #fff;
  color: var(--fg);
  box-shadow: rgba(14,15,12,.08) 0 0 0 1px;
}
.dimension-filterbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  align-items: end;
}
.dimension-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dimension-columns {
  display: grid;
  gap: 10px;
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}
.dimension-column-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dimension-column-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.68);
  padding: 0 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
}
.dimension-column-chip.active {
  background: #fff;
  color: var(--fg);
  box-shadow: rgba(14,15,12,.07) 0 0 0 1px;
}
.dimension-table-stack {
  display: grid;
  gap: 7px;
}
.dimension-scroll {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: auto;
  scrollbar-color: var(--muted) var(--soft);
}
.dimension-scroll-top {
  border-radius: 8px;
  background: var(--soft);
}
.dimension-scroll::-webkit-scrollbar {
  height: 12px;
}
.dimension-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: var(--soft);
}
.dimension-scroll::-webkit-scrollbar-thumb {
  min-width: 44px;
  border: 3px solid var(--soft);
  border-radius: 999px;
  background: var(--muted);
}
.dimension-table-stack .sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 8px 0 16px -16px rgba(14,15,12,.28);
}
.dimension-table-stack th.sticky-col {
  z-index: 3;
  background: #fafbfd;
}
.dimension-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  color: inherit;
  font-weight: 650;
  text-align: left;
}
.dimension-sort:disabled {
  cursor: default;
}
.dimension-drilldown {
  white-space: nowrap;
}
.dimension-drawer {
  display: grid;
  align-content: start;
  gap: 14px;
}
.dimension-drawer .dimension-table-stack {
  min-height: 0;
}
.content.stats-page .panel { padding: 14px; }
.content.stats-page .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.stats-table-grid {
  display: grid;
  gap: 12px;
  align-items: start;
  min-width: 0;
}
.stats-table-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-table-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-table-grid .panel {
  min-height: 0;
}
.stats-wide-panel {
  overflow: hidden;
}
.content.stats-page .stats-wide-panel .table-wrap table {
  min-width: 980px;
}
.content.stats-page .stats-wide-panel .table-wrap th,
.content.stats-page .stats-wide-panel .table-wrap td {
  max-width: 260px;
  padding: 8px 9px;
  font-size: 14px;
}
.content.stats-page .stats-wide-panel .table-wrap th:first-child,
.content.stats-page .stats-wide-panel .table-wrap td:first-child {
  min-width: 150px;
}
.stats-table-grid .table-wrap {
  max-height: 560px;
}
.content.stats-page .table-wrap table { min-width: 760px; }
.content.stats-page .table-wrap th,
.content.stats-page .table-wrap td { max-width: 260px; padding: 9px 9px; }
.content.stats-page .stats-table-grid .table-wrap table { min-width: 620px; }
.content.stats-page .stats-table-grid .table-wrap th,
.content.stats-page .stats-table-grid .table-wrap td {
  max-width: 220px;
  padding: 7px 8px;
  font-size: 14px;
}
.content.stats-page .stats-table-grid .table-wrap th {
  font-size: 14px;
  font-weight: 650;
}
.content.stats-page .table-wrap th:first-child,
.content.stats-page .table-wrap td:first-child { min-width: 150px; }
.frontend-details-grid {
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  align-items: stretch;
}
.frontend-details-tab-content {
  min-width: 0;
}
.frontend-details-filterbar {
  margin-bottom: 12px;
}
.frontend-details-search {
  min-width: min(420px, 100%);
}
.frontend-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(460px, 1fr) auto;
  min-height: 560px;
}
.frontend-detail-tab-panel {
  width: 100%;
}
.content.stats-page .frontend-detail-tab-panel .table-wrap table {
  min-width: 920px;
}
.frontend-detail-panel .table-wrap {
  max-height: none;
  min-height: 460px;
  overflow: auto;
}
.frontend-detail-panel .pagination {
  margin-top: 10px;
  padding-top: 10px;
}
@media (max-width: 1180px) {
  .frontend-details-grid {
    grid-template-columns: 1fr;
  }
}
.content.stats-page .detection-summary-table table { min-width: 820px; table-layout: fixed; }
.content.stats-page .detection-summary-table th,
.content.stats-page .detection-summary-table td { white-space: normal; }
.content.stats-page .identity-inline-meta {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.content.stats-page .stats-section-head {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px;
}
.content.stats-page {
  --stats-blue: var(--blue);
  --stats-blue-soft: var(--blue-soft);
  --stats-blue-ring: var(--blue-ring);
  --stats-blue-alt: var(--blue);
  --stats-blue-alt-soft: var(--soft);
  --stats-blue-alt-ring: var(--ring);
  --stats-muted: var(--muted);
  --stats-muted-soft: var(--soft);
  --stats-muted-ring: var(--ring);
  --stats-ink: var(--fg);
  --stats-ink-soft: var(--soft);
  --stats-ink-ring: var(--ring);
  --stats-ink-alt: var(--fg);
  --stats-ink-alt-soft: var(--soft);
  --stats-ink-alt-ring: var(--ring);
  --stats-green-soft: var(--green-tint);
  --stats-panel-tint: #ffffff;
}
.content.stats-page .panel {
  background: var(--stats-panel-tint);
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px, 0 1px 2px rgba(14,15,12,.025);
}
.content.stats-page .panel:nth-of-type(4n + 1) {
  box-shadow: var(--stats-blue-ring) 0 0 0 1px, 0 1px 2px rgba(14,15,12,.025);
}
.content.stats-page .panel:nth-of-type(4n + 2) {
  box-shadow: rgba(3, 197, 101, .16) 0 0 0 1px, 0 1px 2px rgba(14,15,12,.025);
}
.content.stats-page .panel:nth-of-type(4n + 3) {
  box-shadow: var(--stats-muted-ring) 0 0 0 1px, 0 1px 2px rgba(14,15,12,.025);
}
.content.stats-page .panel:nth-of-type(4n) {
  box-shadow: var(--stats-ink-alt-ring) 0 0 0 1px, 0 1px 2px rgba(14,15,12,.025);
}
.content.stats-page .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.content.stats-page .panel-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--stats-blue);
  box-shadow: var(--blue-ring) 0 0 0 4px;
}
.content.stats-page .panel:nth-of-type(4n + 2) .panel-title::before {
  background: var(--green);
  box-shadow: rgba(3, 197, 101, .22) 0 0 0 4px;
}
.content.stats-page .panel:nth-of-type(4n + 3) .panel-title::before {
  background: var(--stats-muted);
  box-shadow: rgba(14, 15, 12, .08) 0 0 0 4px;
}
.content.stats-page .panel:nth-of-type(4n) .panel-title::before {
  background: var(--stats-ink-alt);
  box-shadow: rgba(14, 15, 12, .08) 0 0 0 4px;
}
.content.stats-page .kpi-card {
  background: #fff;
  box-shadow: rgba(14,15,12,.045) 0 0 0 1px, inset 0 3px 0 var(--green);
}
.content.stats-page .kpi-card:nth-child(6n + 1) {
  background: var(--stats-green-soft);
  box-shadow: rgba(3, 197, 101, .18) 0 0 0 1px, inset 0 3px 0 var(--green);
}
.content.stats-page .kpi-card:nth-child(6n + 2) {
  background: var(--stats-blue-soft);
  box-shadow: var(--stats-blue-ring) 0 0 0 1px, inset 0 3px 0 var(--stats-blue);
}
.content.stats-page .kpi-card:nth-child(6n + 3) {
  background: var(--stats-blue-alt-soft);
  box-shadow: var(--stats-blue-alt-ring) 0 0 0 1px, inset 0 3px 0 var(--stats-blue-alt);
}
.content.stats-page .kpi-card:nth-child(6n + 4) {
  background: var(--stats-muted-soft);
  box-shadow: var(--stats-muted-ring) 0 0 0 1px, inset 0 3px 0 var(--stats-muted);
}
.content.stats-page .kpi-card:nth-child(6n + 5) {
  background: var(--stats-ink-alt-soft);
  box-shadow: var(--stats-ink-alt-ring) 0 0 0 1px, inset 0 3px 0 var(--stats-ink-alt);
}
.content.stats-page .kpi-card:nth-child(6n) {
  background: var(--stats-ink-soft);
  box-shadow: var(--stats-ink-ring) 0 0 0 1px, inset 0 3px 0 var(--stats-ink);
}
.content.stats-page .kpi-card:nth-child(6n + 2) .value { color: var(--blue); }
.content.stats-page .kpi-card:nth-child(6n + 3) .value,
.content.stats-page .kpi-card:nth-child(6n + 4) .value,
.content.stats-page .kpi-card:nth-child(6n + 5) .value,
.content.stats-page .kpi-card:nth-child(6n) .value { color: var(--fg); }
.content.stats-page .segmented {
  background: var(--soft);
}
.content.stats-page .segmented button.active {
  background: #0e0f0c;
  color: #fff;
  box-shadow: rgba(14,15,12,.16) 0 0 0 1px, 0 8px 20px rgba(14,15,12,.08);
}
.click-report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--soft);
  box-shadow: rgba(3, 197, 101, .14) 0 0 0 1px;
}
.click-toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.click-toolbar-title h2 {
  margin: 0;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 720;
}
.click-toolbar-title span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 7px;
  background: #0e0f0c;
  color: #fff;
  box-shadow: rgba(14,15,12,.12) 0 0 0 1px;
  padding: 0 9px;
  font-size: 14px;
  font-weight: 650;
}
.click-summary-row,
.click-summary-layout {
  display: grid;
  gap: 12px;
  align-items: start;
}
.click-summary-row { grid-template-columns: 1fr; }
.click-summary-layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  align-items: stretch;
}
.click-daily-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}
.click-chart-grid .panel,
.click-second-row .panel {
  min-height: 0;
}
.stats-chart-panel .trend-line svg,
.click-daily-panel .trend-line svg {
  aspect-ratio: 1160 / 220;
  min-height: 0;
}
.click-hourly-panel .trend-line svg {
  aspect-ratio: 1040 / 300;
  min-height: 0;
}
.detection-summary-chart-panel {
  overflow: hidden;
}
.detection-bar-chart {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.detection-bar-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.detection-bar-scroll svg {
  width: 100%;
  min-width: 760px;
  height: auto;
  display: block;
}
.detection-bar-segment {
  shape-rendering: crispEdges;
}
.detection-bar-empty {
  fill: #e6ebe4;
}
.detection-bar-hover {
  cursor: crosshair;
}
.detection-model-cell {
  display: inline-grid;
  grid-template-columns: 10px minmax(0, 1fr);
  column-gap: 7px;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
}
.detection-model-cell i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.detection-model-cell em {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}
.click-period-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.click-period-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.045) 0 0 0 1px, inset 3px 0 0 var(--green);
  padding: 8px 9px 7px;
}
.click-period-card:nth-child(5n + 1) {
  background: var(--stats-green-soft);
  box-shadow: rgba(3, 197, 101, .2) 0 0 0 1px, inset 3px 0 0 var(--green);
}
.click-period-card:nth-child(5n + 2) {
  background: var(--stats-blue-soft);
  box-shadow: var(--stats-blue-ring) 0 0 0 1px, inset 3px 0 0 var(--stats-blue);
}
.click-period-card:nth-child(5n + 3) {
  background: var(--stats-blue-alt-soft);
  box-shadow: var(--stats-blue-alt-ring) 0 0 0 1px, inset 3px 0 0 var(--stats-blue-alt);
}
.click-period-card:nth-child(5n + 4) {
  background: var(--stats-ink-alt-soft);
  box-shadow: var(--stats-ink-alt-ring) 0 0 0 1px, inset 3px 0 0 var(--stats-ink-alt);
}
.click-period-card:nth-child(5n) {
  background: var(--stats-muted-soft);
  box-shadow: var(--stats-muted-ring) 0 0 0 1px, inset 3px 0 0 var(--stats-muted);
}
.click-period-card.estimated {
  background: #ecfdf5;
  box-shadow: rgba(3, 197, 101, .28) 0 0 0 1px, inset 3px 0 0 var(--green);
}
.click-period-head span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.click-period-card.estimated .click-period-head span { color: var(--green-dark); }
.click-period-head strong {
  display: block;
  margin-top: 2px;
  color: var(--fg);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.click-period-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 1px;
}
.click-period-details span,
.click-period-rate span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.click-period-details strong {
  display: block;
  margin-top: 1px;
  color: var(--body);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.click-period-meta {
  display: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 590;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.click-period-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 1px;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.click-period-card.estimated .click-period-rate { background: transparent; }
.click-period-rate strong {
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.click-second-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 12px;
  align-items: start;
}
.click-breakdown-grid {
  align-items: start;
}
.click-breakdown-grid .panel {
  min-height: 0;
}
.click-breakdown-grid .top-model-list,
.click-breakdown-grid .stats-breakdown-table,
.click-breakdown-grid .top-sites-rank-table {
  max-height: 560px;
  overflow: auto;
}
.click-breakdown-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.click-breakdown-grid .top-sites-panel {
  grid-column: 1 / -1;
}
.click-breakdown-grid .click-breakdown-span-2 {
  grid-column: span 2;
}
.top-sites-panel { overflow: hidden; }
.top-sites-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
.top-sites-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 7px;
  background: #fff;
  box-shadow: rgba(14,15,12,.05) 0 0 0 1px;
  padding: 0 10px;
}
.top-sites-summary .highlight {
  background: var(--stats-green-soft);
  color: var(--green-dark);
}
.top-sites-summary b {
  display: inline-flex;
  align-items: center;
  height: 16px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--green);
  color: var(--green-text);
  box-shadow: none;
  padding: 0 6px;
  font-size: 14px;
}
.top-sites-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.top-sites-column {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.top-site-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: var(--body);
  padding: 6px 7px;
  text-align: left;
}
.top-site-row:hover {
  border-color: rgba(3, 197, 101, .2);
  background: var(--stats-blue-soft);
}
.top-site-rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #0e0f0c;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  box-shadow: none;
}
.top-site-main { min-width: 0; display: grid; gap: 2px; }
.top-site-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 660;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-site-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-site-sub {
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 590;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-site-metric {
  display: none;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}
.top-sites-rank-table table {
  min-width: 560px;
}
.top-sites-rank-table td {
  vertical-align: middle;
}
.top-sites-rank-table .link {
  max-width: 100%;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}
.top-model-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
  box-shadow: var(--ring) 0 0 0 1px;
}
.top-model-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(136px, auto);
  align-items: center;
  gap: 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, .78);
  box-shadow: none;
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 10px 8px 8px;
}
.top-model-row:last-child { border-bottom: 0; }
.top-model-rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 24px;
  border-radius: 6px;
  background: var(--fg);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  box-shadow: none;
}
.top-model-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.top-model-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-size: 14px;
  font-weight: 660;
}
.top-model-sub {
  color: var(--muted);
  font-size: 14px;
  font-weight: 590;
}
.top-model-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(60px, auto));
  justify-content: end;
  gap: 10px;
  text-align: right;
}
.top-model-counts span {
  display: grid;
  gap: 2px;
}
.top-model-counts strong {
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.top-model-counts em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 590;
  white-space: nowrap;
}
.stats-breakdown-table {
  overflow: auto;
}
.stats-breakdown-table table {
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0 6px;
}
.stats-breakdown-table th {
  position: static;
  border-bottom: 0;
  background: #fafbfd;
  padding: 4px 10px;
}
.stats-breakdown-table td {
  border-bottom: 0;
  background: rgba(255, 255, 255, .86);
  box-shadow: inset 0 0 0 1px rgba(14,15,12,.05);
  padding: 8px 10px;
  font-size: 14px;
}
.stats-breakdown-table td:first-child {
  border-radius: 8px 0 0 8px;
  color: var(--fg);
  font-weight: 700;
}
.stats-breakdown-table tbody tr:nth-child(4n + 1) td:first-child {
  box-shadow: inset 3px 0 0 var(--green), inset 0 0 0 1px rgba(14,15,12,.05);
}
.stats-breakdown-table tbody tr:nth-child(4n + 2) td:first-child {
  box-shadow: inset 3px 0 0 var(--stats-blue), inset 0 0 0 1px rgba(14,15,12,.05);
}
.stats-breakdown-table tbody tr:nth-child(4n + 3) td:first-child {
  box-shadow: inset 3px 0 0 var(--muted), inset 0 0 0 1px rgba(14,15,12,.05);
}
.stats-breakdown-table tbody tr:nth-child(4n) td:first-child {
  box-shadow: inset 3px 0 0 var(--fg), inset 0 0 0 1px rgba(14,15,12,.05);
}
.stats-breakdown-table td:last-child { border-radius: 0 8px 8px 0; }
.mini-pro {
  display: inline-flex;
  align-items: center;
  height: 16px;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  box-shadow: none;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 750;
  vertical-align: 1px;
}
.content.cpm-page {
  --cpm-blue: var(--blue);
  --cpm-blue-soft: var(--blue-soft);
  --cpm-blue-ring: var(--blue-ring);
  --cpm-blue-alt: var(--blue);
  --cpm-blue-alt-soft: var(--soft);
  --cpm-blue-alt-ring: var(--ring);
  --cpm-muted: var(--muted);
  --cpm-muted-soft: var(--soft);
  --cpm-muted-ring: var(--ring);
  --cpm-ink: var(--fg);
  --cpm-ink-soft: var(--soft);
  --cpm-ink-ring: var(--ring);
  --cpm-danger: var(--fg);
  --cpm-danger-soft: var(--soft);
  --cpm-danger-ring: var(--ring);
}
.content.cpm-page .panel {
  background: #fff;
  box-shadow: rgba(14,15,12,.052) 0 0 0 1px, inset 0 3px 0 rgba(3, 197, 101, .5);
}
.content.cpm-page .panel:nth-of-type(5n + 1) {
  box-shadow: var(--cpm-blue-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-blue);
}
.content.cpm-page .panel:nth-of-type(5n + 2) {
  box-shadow: rgba(3, 197, 101, .16) 0 0 0 1px, inset 0 3px 0 var(--green);
}
.content.cpm-page .panel:nth-of-type(5n + 3) {
  box-shadow: var(--cpm-muted-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-muted);
}
.content.cpm-page .panel:nth-of-type(5n + 4) {
  box-shadow: var(--cpm-ink-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-ink);
}
.content.cpm-page .panel:nth-of-type(5n) {
  box-shadow: var(--cpm-blue-alt-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-blue-alt);
}
.content.cpm-page .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.content.cpm-page .panel-title::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cpm-blue);
  box-shadow: var(--blue-ring) 0 0 0 4px;
}
.content.cpm-page .panel:nth-of-type(5n + 2) .panel-title::before {
  background: var(--green);
  box-shadow: rgba(3, 197, 101, .2) 0 0 0 4px;
}
.content.cpm-page .panel:nth-of-type(5n + 3) .panel-title::before {
  background: var(--cpm-muted);
  box-shadow: rgba(14, 15, 12, .08) 0 0 0 4px;
}
.content.cpm-page .panel:nth-of-type(5n + 4) .panel-title::before {
  background: var(--cpm-ink);
  box-shadow: rgba(14, 15, 12, .08) 0 0 0 4px;
}
.content.cpm-page .panel:nth-of-type(5n) .panel-title::before {
  background: var(--cpm-blue-alt);
  box-shadow: var(--blue-ring) 0 0 0 4px;
}
.content.cpm-page .kpi-card:nth-child(6n + 1) {
  background: var(--green-tint);
  box-shadow: rgba(3, 197, 101, .18) 0 0 0 1px, inset 0 3px 0 var(--green);
}
.content.cpm-page .kpi-card:nth-child(6n + 2) {
  background: var(--cpm-blue-soft);
  box-shadow: var(--cpm-blue-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-blue);
}
.content.cpm-page .kpi-card:nth-child(6n + 3) {
  background: var(--cpm-muted-soft);
  box-shadow: var(--cpm-muted-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-muted);
}
.content.cpm-page .kpi-card:nth-child(6n + 4) {
  background: var(--cpm-blue-alt-soft);
  box-shadow: var(--cpm-blue-alt-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-blue-alt);
}
.content.cpm-page .kpi-card:nth-child(6n + 5) {
  background: var(--cpm-ink-soft);
  box-shadow: var(--cpm-ink-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-ink);
}
.content.cpm-page .kpi-card:nth-child(6n) {
  background: var(--cpm-danger-soft);
  box-shadow: var(--cpm-danger-ring) 0 0 0 1px, inset 0 3px 0 var(--cpm-danger);
}
.content.cpm-page .kpi-card:nth-child(6n + 2) .value { color: var(--blue); }
.content.cpm-page .kpi-card:nth-child(6n + 3) .value,
.content.cpm-page .kpi-card:nth-child(6n + 4) .value,
.content.cpm-page .kpi-card:nth-child(6n + 5) .value,
.content.cpm-page .kpi-card:nth-child(6n) .value { color: var(--fg); }
.content.cpm-page .tab-strip {
  background: var(--soft);
}
.content.cpm-page .tab-strip button.active {
  background: #0e0f0c;
  color: #fff;
  box-shadow: rgba(14,15,12,.16) 0 0 0 1px;
}
.content.cpm-page .chip.ok {
  background: var(--green-tint);
  color: var(--green-dark);
  box-shadow: rgba(3, 197, 101, .15) 0 0 0 1px;
}
.content.cpm-page .chip.warn {
  background: var(--cpm-muted-soft);
  color: var(--body);
  box-shadow: var(--cpm-muted-ring) 0 0 0 1px;
}
.content.cpm-page .chip.bad {
  background: var(--cpm-danger-soft);
  color: var(--danger-text);
  box-shadow: var(--cpm-danger-ring) 0 0 0 1px;
}
.content.cpm-page .kv-row:nth-child(4n + 1),
.content.cpm-page .metric-flow-row:nth-child(4n + 1),
.content.cpm-page .reason-row:nth-child(4n + 1),
.content.cpm-page .module-item:nth-child(4n + 1),
.content.cpm-page .diag-candidate-item:nth-child(4n + 1) {
  box-shadow: var(--cpm-blue-ring) 0 0 0 1px, inset 3px 0 0 var(--cpm-blue);
}
.content.cpm-page .kv-row:nth-child(4n + 2),
.content.cpm-page .metric-flow-row:nth-child(4n + 2),
.content.cpm-page .reason-row:nth-child(4n + 2),
.content.cpm-page .module-item:nth-child(4n + 2),
.content.cpm-page .diag-candidate-item:nth-child(4n + 2) {
  box-shadow: rgba(3, 197, 101, .16) 0 0 0 1px, inset 3px 0 0 var(--green);
}
.content.cpm-page .kv-row:nth-child(4n + 3),
.content.cpm-page .metric-flow-row:nth-child(4n + 3),
.content.cpm-page .reason-row:nth-child(4n + 3),
.content.cpm-page .module-item:nth-child(4n + 3),
.content.cpm-page .diag-candidate-item:nth-child(4n + 3) {
  box-shadow: var(--cpm-muted-ring) 0 0 0 1px, inset 3px 0 0 var(--cpm-muted);
}
.content.cpm-page .kv-row:nth-child(4n),
.content.cpm-page .metric-flow-row:nth-child(4n),
.content.cpm-page .reason-row:nth-child(4n),
.content.cpm-page .module-item:nth-child(4n),
.content.cpm-page .diag-candidate-item:nth-child(4n) {
  box-shadow: var(--cpm-ink-ring) 0 0 0 1px, inset 3px 0 0 var(--cpm-ink);
}
.kv-list,
.evidence-list,
.module-list,
.diag-candidate-list,
.metric-flow,
.reason-list {
  display: grid;
  gap: 8px;
}
.kv-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
}
.kv-row,
.evidence-item,
.module-item,
.diag-candidate-item,
.metric-flow-row,
.reason-row {
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: rgba(14,15,12,.055) 0 0 0 1px;
  padding: 8px 9px;
}
.plain-detail-list {
  display: grid;
  max-width: 920px;
  border-top: 1px solid var(--line);
}
.plain-detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 18px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
.plain-detail-label {
  color: var(--muted);
  font-size: 13px;
}
.plain-detail-value {
  color: var(--fg);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.plain-detail-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.35;
}
.kv-key,
.evidence-field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  line-height: 1.35;
}
.kv-value,
.evidence-field strong {
  display: block;
  margin-top: 3px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 620;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.evidence-item {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
}
.module-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.module-head,
.diag-candidate-head,
.metric-flow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.module-head strong,
.diag-candidate-head strong,
.metric-flow-row strong {
  color: var(--fg);
  overflow-wrap: anywhere;
}
.diag-candidate-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}
.metric-flow-row span,
.reason-row span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.metric-flow-values {
  text-align: right;
  white-space: nowrap;
}
.metric-flow-values b {
  display: block;
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
}
.reason-row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.reason-row strong {
  color: var(--fg);
  overflow-wrap: anywhere;
}
.reason-list-plain .reason-row {
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
}
.reason-values {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.reason-values b {
  color: var(--fg);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.15;
}
.reason-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(14,15,12,.065);
  overflow: hidden;
}
.reason-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #16c979;
}
.compact-table table { table-layout: fixed; min-width: 980px; }
.compact-table th, .compact-table td { white-space: normal; }
.wrap-cell { min-width: 0; line-height: 1.4; }
.audit-admin-table { overflow-x: hidden; }
.audit-admin-table table { table-layout: fixed; min-width: 0; }
.audit-admin-table th,
.audit-admin-table td { padding: 9px 7px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.audit-admin-table .btn { min-height: 30px; width: 100%; padding: 6px 2px; border-radius: 6px; font-size: 14px; }
.audit-admin-table th {
  color: #6f756d;
  font-size: 14px;
  font-weight: 620;
}
.audit-admin-table td {
  border-bottom-color: var(--border-soft);
  color: var(--body);
  font-size: 14px;
}
.audit-admin-table tr:hover td {
  background: #fbfcfa;
}
.audit-admin-table .btn {
  background: #fff;
  border-color: #dde3da;
  color: var(--fg);
}
.audit-admin-table th:nth-child(1), .audit-admin-table td:nth-child(1) { width: 11%; }
.audit-admin-table th:nth-child(2), .audit-admin-table td:nth-child(2) { width: 9%; }
.audit-admin-table th:nth-child(3), .audit-admin-table td:nth-child(3) { width: 9%; }
.audit-admin-table th:nth-child(4), .audit-admin-table td:nth-child(4) { width: 8%; }
.audit-admin-table th:nth-child(5), .audit-admin-table td:nth-child(5) { width: 6%; }
.audit-admin-table th:nth-child(6), .audit-admin-table td:nth-child(6) { width: 12%; }
.audit-admin-table th:nth-child(7), .audit-admin-table td:nth-child(7),
.audit-admin-table th:nth-child(8), .audit-admin-table td:nth-child(8) { width: 17%; }
.audit-admin-table th:nth-child(9), .audit-admin-table td:nth-child(9) { width: 6%; }
.audit-admin-table th:nth-child(10), .audit-admin-table td:nth-child(10) { width: 5%; }
.alert-table { overflow-x: hidden; }
.alert-table table { table-layout: fixed; min-width: 0; }
.alert-table th,
.alert-table td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.alert-table th:nth-child(1), .alert-table td:nth-child(1) { width: 78px; }
.alert-table th:nth-child(2), .alert-table td:nth-child(2) { width: 26%; }
.alert-table th:nth-child(3), .alert-table td:nth-child(3) { width: 86px; }
.alert-table th:nth-child(4), .alert-table td:nth-child(4) { width: 34%; }
.alert-table th:nth-child(5), .alert-table td:nth-child(5),
.alert-table th:nth-child(6), .alert-table td:nth-child(6) { width: 142px; }
.alert-table th:nth-child(7), .alert-table td:nth-child(7) { width: 72px; }
.inline-chips { margin-top: 8px; gap: 4px; }
.inline-chips .chip { min-height: 22px; padding: 3px 7px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 3px; background: transparent; border: 0; padding: 0; font-weight: 800; }
.empty {
  min-height: 68px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--subtle-ring);
  line-height: 1.5;
  font-size: 14px;
  font-weight: 560;
}
.float-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: 84px 18px 18px;
  background: rgba(14, 15, 12, .18);
  animation: dialogBackdropIn .14s ease-out;
}
.float-dialog-backdrop.closing {
  animation: dialogBackdropOut .12s ease-in forwards;
}
.float-dialog {
  width: min(460px, 100%);
  max-height: calc(100dvh - 112px);
  display: grid;
  gap: 12px;
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: rgba(14, 15, 12, .12) 0 16px 38px, rgba(14, 15, 12, .1) 0 0 0 1px;
  animation: dialogIn .16s ease-out;
}
.float-dialog-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.float-dialog-tone {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: rgba(14, 15, 12, .08) 0 0 0 4px;
}
.float-dialog.success .float-dialog-tone {
  background: var(--green);
  box-shadow: rgba(3, 197, 101, .18) 0 0 0 4px;
}
.float-dialog.warning .float-dialog-tone {
  background: var(--warning);
  box-shadow: rgba(14, 15, 12, .08) 0 0 0 4px;
}
.float-dialog.error .float-dialog-tone {
  background: var(--danger);
  box-shadow: rgba(14, 15, 12, .08) 0 0 0 4px;
}
.float-dialog-title {
  margin: 0;
  min-width: 0;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 720;
  overflow-wrap: anywhere;
}
.float-dialog-body {
  display: grid;
  gap: 10px;
}
.float-dialog-message {
  color: var(--body);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.float-dialog-field {
  margin-bottom: 0;
}
.float-dialog-field .textarea {
  min-height: 110px;
}
.float-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
@keyframes dialogBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dialogBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(-6px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.heatmap {
  overflow-x: auto;
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
}
.heat-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(24, 18px);
  gap: 4px;
  align-items: center;
  min-width: 660px;
}
.heat-head {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.heat-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--body);
  font-size: 14px;
}
.heat-cell {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(14,15,12,.08);
}
.inventory-heatmap-panel .heatmap {
  gap: 3px;
}
.inventory-heatmap-panel .heat-row {
  grid-template-columns: minmax(132px, 180px) repeat(24, 16px);
  gap: 3px;
  min-width: 585px;
}
.inventory-heatmap-panel .heat-cell {
  width: 16px;
  height: 16px;
}
.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(720px, 100vw);
  background: #fff;
  box-shadow: -18px 0 50px rgba(14,15,12,.12);
  z-index: 20;
  padding: 18px;
  overflow: auto;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14,15,12,.3);
  z-index: 19;
}
.json {
  white-space: pre-wrap;
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
  color: var(--fg);
  font-size: 14px;
  max-height: 360px;
  overflow: auto;
}

@media (max-width: 980px) {
  .rank-config-detail-drawer {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
  }
  .rank-config-detail-meta {
    grid-template-columns: 1fr;
  }
  .shell { grid-template-columns: 1fr; align-content: start; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    align-self: start;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(14,15,12,.06);
    padding: 10px 14px 8px;
    overflow: hidden;
  }
  .brand { padding: 0 2px 7px; }
  .brand-title { font-size: 16px; }
  .brand-sub { font-size: 14px; }
  .env-badge { padding: 4px 8px; }
  .nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0 3px 3px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-group,
  .nav-group-toggle { display: none; }
  .nav .nav-hidden-by-group { display: flex; }
  .nav button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 9px;
    white-space: nowrap;
    font-size: 14px;
  }
  .nav button.active::before { display: none; }
  .topbar { align-items: stretch; flex-direction: column; gap: 8px; padding: 10px 16px; }
  .topbar-actions-row { width: 100%; }
  .top-actions { justify-content: flex-start; }
  .content { padding: 13px 15px 18px; gap: 11px; }
  .kpis, .two { grid-template-columns: 1fr; }
  .click-report-toolbar { align-items: flex-start; flex-direction: column; }
  .click-summary-row,
  .click-summary-layout { grid-template-columns: 1fr; }
  .click-period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .click-second-row,
  .click-breakdown-grid,
  .content.stats-page .grid.two { grid-template-columns: 1fr; }
  .click-breakdown-grid .top-sites-panel,
  .click-breakdown-grid .click-breakdown-span-2 { grid-column: auto; }
  .stats-table-grid,
  .stats-table-grid.cols-2,
  .stats-table-grid.cols-3 { grid-template-columns: 1fr; }
  .diag-form { grid-template-columns: 1fr; }
  .diag-rule-grid { grid-template-columns: 1fr; }
  .diag-form .wide, .diag-actions { grid-column: span 1; }
  .diag-actions { justify-content: flex-start; }
  .allowlist-row { grid-template-columns: auto minmax(0, 1fr); }
  .allowlist-meta { grid-column: 2; justify-content: flex-start; }
  .top-sites-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filterbar.global-filters .field,
  .filterbar.global-filters .input,
  .filterbar.global-filters .select { flex: 1 1 180px; min-width: 0; }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .kpis,
  .kpis-nine { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .click-summary-row,
  .click-summary-layout { grid-template-columns: 1fr; }
  .click-period-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .click-breakdown-grid .top-sites-panel,
  .click-breakdown-grid .click-breakdown-span-2 { grid-column: auto; }
  .top-sites-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-table-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .login-page { padding: 16px; }
  .login-card { padding: 20px; border-radius: 16px; }
  .content { padding: 12px 15px 18px; gap: 10px; background: #fafbf9; }
  #content { gap: 10px; }
  .sidebar { max-height: none; padding: 6px 14px 5px; }
  .nav {
    grid-template-columns: none;
  }
  .nav-group,
  .nav-group-toggle { padding-top: 0; }
  .nav button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 640;
    box-shadow: none;
  }
  .nav button.active {
    background: transparent;
    border-color: transparent;
    color: var(--fg);
    box-shadow: inset 0 -2px 0 var(--green);
  }
  .nav .ico { display: none; }
  .brand { align-items: center; padding-bottom: 6px; }
  .brand-main { gap: 5px; }
  .brand-logo { width: 132px; }
  .brand-sub { font-size: 14px; }
  .topbar-actions-row,
  .top-actions,
  .topbar-utility,
  .date-range,
  .filterbar,
  .stats-toolbar,
  .inline-toolbar { width: 100%; }
  .topbar-actions-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }
  .topbar-utility {
    justify-content: flex-end;
    gap: 7px;
    width: auto;
  }
  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
    gap: 12px;
    align-items: center;
    padding-top: 1px;
  }
  .rank-pipeline-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .rank-pipeline-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .rank-display-tags-head,
  .rank-display-tags-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(48px, auto);
    gap: 8px;
  }
  .rank-pipeline-compact-item {
    grid-template-columns: minmax(110px, .75fr) minmax(0, 1fr);
  }
  .rank-pipeline-compact-item > small {
    grid-column: 1 / -1;
  }
  .rank-config-target-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .rank-config-global-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .rank-config-target-actions {
    justify-content: flex-start;
  }
  .rank-config-target-actions .btn {
    flex: 1 1 0;
  }
  .rank-postprocess-rules {
    grid-template-columns: minmax(0, 1fr);
  }
  .rank-postprocess-rule-row,
  .rank-postprocess-rule-card[data-time-window="true"] .rank-postprocess-rule-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .tab-strip[data-tab-scope="rankTrafficConfigs"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rank-row-actions {
    white-space: normal;
  }
  .page-title { font-size: 16px; font-weight: 670; }
  .page-caption { font-size: 14px; margin-top: 1px; line-height: 1.35; }
  .topbar { gap: 6px; padding: 7px 15px 7px; }
  .topbar { min-height: 0; }
  .segmented {
    padding: 2px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--subtle-ring) 0 0 0 1px;
  }
  .segmented button {
    min-height: 25px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 660;
    border-radius: 6px;
  }
  .segmented button.active {
    background: transparent;
    color: var(--green-dark);
    box-shadow: inset 0 -2px 0 var(--green);
  }
  .segmented button.active::before { content: none; }
  .top-actions .segmented {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    gap: 10px;
  }
  .top-actions .segmented button {
    min-height: 24px;
    padding: 0 2px;
    border-radius: 0;
    color: var(--body);
  }
  .top-actions .segmented button.active {
    color: var(--green-dark);
    box-shadow: inset 0 -2px 0 var(--green);
  }
  .top-actions .btn,
  .topbar-utility .btn { min-height: 28px; font-size: 14px; font-weight: 640; }
  .date-range { flex-wrap: wrap; }
  .top-actions .segmented,
  .top-actions .date-range { width: 100%; }
  .top-actions .date-range { grid-column: 1 / -1; }
  .range-segmented {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .range-segmented::-webkit-scrollbar { display: none; }
  .mode-segmented {
    display: grid;
    gap: 3px;
  }
  .mode-segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-segmented button {
    flex: 0 0 auto;
    padding: 0 9px;
  }
  .range-segmented button[data-range="custom"],
  .range-segmented button[data-range="1h"] {
    display: none;
  }
  .mode-segmented button {
    justify-content: center;
    padding: 0 4px;
  }
  .topbar-utility .btn.icon { width: 32px; }
  .topbar-utility .btn:not(.icon) { padding: 0 10px; }
  .filterbar {
    align-items: stretch;
    overflow: hidden;
  }
  .filterbar:not(.global-filters) {
    display: block;
    gap: 8px;
  }
  .filterbar.rank-adjustment-panel-filter {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
    overflow: visible;
  }
  .rank-adjustment-panel-filter .rank-searchable-filter {
    flex: 1 1 auto;
    min-width: 0;
  }
  .rank-adjustment-panel-filter > .btn {
    flex: 0 0 auto;
  }
  .page-filterbar {
    display: block;
  }
  .page-filterbar > .segmented,
  .page-filterbar .page-filter-fields > .segmented {
    width: 100%;
    max-width: 100%;
  }
  .page-filter-fields {
    display: none;
  }
  .page-filterbar.open .page-filter-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 2px 2px;
  }
  .filterbar.open:not(.global-filters) > .segmented,
  .filterbar.open:not(.global-filters) > .stats-toolbar,
  .filterbar.open:not(.global-filters) > .inline-toolbar,
  .page-filterbar.open .page-filter-fields > .segmented,
  .page-filterbar.open .page-filter-fields > .stats-toolbar,
  .page-filterbar.open .page-filter-fields > .inline-toolbar {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filterbar.open:not(.global-filters) > .segmented::-webkit-scrollbar,
  .filterbar.open:not(.global-filters) > .stats-toolbar::-webkit-scrollbar,
  .filterbar.open:not(.global-filters) > .inline-toolbar::-webkit-scrollbar,
  .page-filterbar.open .page-filter-fields > .segmented::-webkit-scrollbar,
  .page-filterbar.open .page-filter-fields > .stats-toolbar::-webkit-scrollbar,
  .page-filterbar.open .page-filter-fields > .inline-toolbar::-webkit-scrollbar { display: none; }
  .filterbar.open:not(.global-filters) .segmented {
    max-width: 100%;
    width: 100%;
    justify-content: flex-start;
  }
  .filterbar.open:not(.global-filters) .segmented button {
    flex: 0 0 auto;
  }
  .filterbar .field,
  .filterbar .input,
  .filterbar .select { width: 100%; min-width: 0; }
  .filterbar .btn {
    width: auto;
    min-width: 0;
    justify-self: start;
  }
  .filterbar > .btn.primary {
    min-height: 38px;
    padding: 8px 14px;
  }
  .panel-form { padding: 8px; }
  .panel-form .btn.primary,
  .panel .panel-form .btn.primary {
    width: auto;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 14px;
    justify-self: start;
  }
  .panel-form .field {
    margin-bottom: 0;
  }
  .filterbar.global-filters { display: block; padding: 6px; background: #fff; }
  .filter-summary {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    list-style: none;
    border-radius: 8px;
    border: 0;
    background: transparent;
    padding: 0 8px;
    color: var(--fg);
    cursor: pointer;
  }
  .filter-summary span {
    font-size: 14px;
    font-weight: 700;
  }
  .filter-summary strong {
    color: var(--muted);
    font-size: 14px;
    font-weight: 620;
  }
  .filter-summary::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: .55;
  }
  .global-filters.open .filter-summary::after {
    transform: rotate(225deg);
  }
  .page-filterbar.open .filter-summary::after {
    transform: rotate(225deg);
  }
  .filter-fields {
    display: none;
  }
  .global-filters.open .filter-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 7px;
    padding: 7px 2px 2px;
  }
  .global-filters.open .filter-field:not(.identity-filter) {
    display: none;
  }
  .global-filters.open .field,
  .global-filters.open .input,
  .global-filters.open .select {
    width: 100%;
    min-width: 0;
  }
  .global-filters.open .btn {
    grid-column: 1 / -1;
    min-height: 36px;
    width: 100%;
    justify-self: stretch;
  }
  .filterbar .field .input,
  .filterbar .field .select,
  .filterbar .field .textarea { width: 100%; }
  .field span { font-size: 14px; font-weight: 620; }
  .input, .select, .textarea { min-height: 32px; font-size: 14px; }
  .filterbar .input,
  .filterbar .select,
  .filterbar .textarea { font-size: 14px; }
  .filterbar { padding: 7px; border-radius: 8px; gap: 7px; }
  .filterbar.global-filters .field span { margin-bottom: -1px; }
  .field { gap: 5px; margin-bottom: 12px; }
  .filterbar .field { margin-bottom: 0; }
  .select, .input { padding: 5px 8px; }
  .panel-form,
  .filterbar.panel-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .panel-form .input,
  .panel-form .select,
  .panel-form .textarea {
    min-height: 30px;
    border-color: #e1e6df;
    font-size: 14px;
  }
  .panel-form .btn.primary,
  .panel .panel-form .btn.primary {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 14px;
  }
  .panel-actions .btn {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 14px;
  }
  .panel-form .textarea,
  .panel-form .beta-field,
  .panel-form .app-config-value,
  .panel-form .inline-flex-field,
  .panel-form .multi-select-field {
    grid-column: auto;
  }
  .panel { padding: 10px; border-radius: 8px; background: #fff; }
  .panel-title { font-size: 14px; font-weight: 720; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { min-height: 56px; padding: 7px 9px; border-radius: 8px; background: #fff; }
  .card::before { content: none; }
  .value { font-size: 15px; margin-top: 3px; font-weight: 680; }
  .label { font-size: 14px; font-weight: 620; }
  .sub { margin-top: 4px; font-size: 14px; line-height: 1.3; }
  .segmented { overflow-x: auto; max-width: 100%; }
  .segmented button { white-space: nowrap; }
  .tab-strip {
    padding: 2px;
    gap: 1px;
    border-radius: 8px;
    background: #fff;
  }
  .tab-strip button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 660;
    border-radius: 6px;
  }
  .tab-strip button.active {
    background: transparent;
    color: var(--green-dark);
    box-shadow: inset 0 -2px 0 var(--green);
  }
  .tab-strip button.active::before { content: none; }
  .content.stats-page { padding-top: 10px; gap: 10px; background: #fafbf9; }
  .content.stats-page #content {
    gap: 10px;
  }
  .content.stats-page .panel {
    padding: 12px;
  }
  .click-period-grid {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .top-sites-columns { grid-template-columns: 1fr; }
  .click-period-card {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 3px 8px;
    border-radius: 7px;
    box-shadow: rgba(14,15,12,.045) 0 0 0 1px;
    border-bottom: 0;
    padding: 7px;
  }
  .click-period-card.estimated {
    box-shadow: rgba(14,15,12,.045) 0 0 0 1px, inset 2px 0 0 rgba(3, 197, 101, .34);
    background: #fff;
  }
  .click-period-head span { font-size: 14px; }
  .click-period-head strong {
    margin-top: 2px;
    font-size: 14px;
  }
  .click-period-head {
    min-width: 0;
  }
  .click-period-details {
    display: none;
  }
  .click-period-meta {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .click-period-rate {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: end;
    margin-top: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: grid;
    gap: 1px;
    align-items: end;
    text-align: right;
  }
  .click-period-details span,
  .click-period-rate span,
  .click-period-details strong { font-size: 14px; }
  .click-period-details strong { margin-top: 1px; }
  .click-period-rate strong { font-size: 14px; }
  .content.stats-page .panel-title { font-size: 15px; }
  .content.stats-page .trend-legend { gap: 10px; font-size: 14px; }
  .kv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .kv-row { padding: 7px 8px; }
  .kv-key { font-size: 14px; }
  .kv-value { font-size: 14px; }
  .content.stats-page .trend-line svg {
    height: 190px !important;
    min-height: 0;
  }
  .click-daily-panel .trend-line svg {
    height: 190px !important;
    min-height: 0;
  }
  .click-report-toolbar { padding: 10px; }
  .click-toolbar-title h2 { font-size: 15px; }
  .stats-toolbar { gap: 7px; }
  .stats-toolbar .segmented { width: auto; max-width: 100%; }
  .top-model-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }
  .top-model-counts {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(58px, 1fr));
    justify-content: stretch;
    text-align: left;
    gap: 8px;
  }
  .stats-breakdown-table table { min-width: 520px; }
  .audit-admin-table {
    overflow: visible;
    box-shadow: none;
    background: transparent;
  }
  .audit-admin-table table,
  .audit-admin-table thead,
  .audit-admin-table tbody,
  .audit-admin-table tr,
  .audit-admin-table td {
    display: block;
    width: 100%;
  }
  .audit-admin-table thead {
    display: none;
  }
  .audit-admin-table table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }
  .audit-admin-table tbody {
    display: grid;
    gap: 8px;
  }
  .audit-admin-table tr {
    min-width: 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--subtle-ring) 0 0 0 1px;
    padding: 9px 10px;
  }
  .audit-admin-table td {
    width: auto !important;
    min-height: 0;
    border-bottom: 0;
    padding: 6px 0;
    color: var(--fg);
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  .audit-admin-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
  }
  .audit-admin-table td + td {
    border-top: 1px solid var(--border-soft);
  }
  .audit-admin-table td:nth-child(1),
  .audit-admin-table td:nth-child(2),
  .audit-admin-table td:nth-child(3),
  .audit-admin-table td:nth-child(4) {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  .audit-admin-table td:nth-child(1)::before,
  .audit-admin-table td:nth-child(2)::before,
  .audit-admin-table td:nth-child(3)::before,
  .audit-admin-table td:nth-child(4)::before {
    margin-bottom: 0;
  }
  .audit-admin-table .btn {
    width: auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 14px;
  }
  .pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .pager-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 64px;
    gap: 8px;
  }
  .pager-actions .btn {
    min-height: 36px;
    padding: 6px 10px;
    white-space: nowrap;
    word-break: keep-all;
  }
  .empty {
    min-height: 74px;
    padding: 18px;
  }
  .reason-row { grid-template-columns: 1fr; }
  .metric-flow-row { align-items: flex-start; flex-direction: column; }
  .metric-flow-values { text-align: left; }

  /* Final mobile refinement: flatter admin density, lighter type, less card stacking. */
  .content,
  .content.stats-page {
    padding: 9px 12px 18px;
    gap: 8px;
    background: #fff;
  }
  #content,
  .content.stats-page #content {
    gap: 9px;
  }
  .nav button {
    font-weight: 600;
    color: #6a7068;
  }
  .nav button.active,
  .top-actions .segmented button.active {
    box-shadow: inset 0 -1px 0 var(--green);
  }
  .segmented button.active,
  .tab-strip button.active {
    background: #f8fbf7;
    color: var(--green-dark);
    box-shadow: rgba(3, 197, 101, .16) 0 0 0 1px inset;
  }
  .page-title { font-weight: 640; }
  .topbar { padding: 7px 14px 7px; }
  .segmented button,
  .tab-strip button {
    font-weight: 600;
  }
  .top-actions .segmented {
    gap: 8px;
  }
  .top-actions .btn,
  .topbar-utility .btn {
    font-weight: 600;
  }
  .filterbar.global-filters {
    padding: 5px;
  }
  .filterbar,
  .filterbar.global-filters {
    border-radius: 7px;
    box-shadow: rgba(14,15,12,.04) 0 0 0 1px;
  }
  .filter-summary {
    min-height: 26px;
    padding: 0 7px;
  }
  .filter-summary span {
    font-weight: 620;
  }
  .field span {
    font-weight: 570;
  }
  .panel {
    padding: 9px;
    border-radius: 7px;
    box-shadow: rgba(14,15,12,.045) 0 0 0 1px;
  }
  .panel-title,
  .content.stats-page .panel-title {
    font-size: 14px;
    font-weight: 620;
  }
  .kpis {
    gap: 0;
    overflow: hidden;
    border-radius: 7px;
    box-shadow: rgba(14,15,12,.045) 0 0 0 1px;
  }
  .kpi-card {
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
  }
  .kpi-card:nth-child(2n) {
    border-right: 0;
  }
  .kpi-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 0;
  }
  .card:not(.kpi-card) {
    min-height: 46px;
    padding: 5px 7px;
    border-radius: 6px;
    box-shadow: rgba(14,15,12,.045) 0 0 0 1px;
  }
  .value {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 620;
  }
  .label {
    font-size: 14px;
    font-weight: 560;
  }
  .content.stats-page .panel {
    padding: 9px;
  }
  .stats-table-grid,
  .stats-table-grid.cols-2,
  .stats-table-grid.cols-3 {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .stats-table-grid .table-wrap {
    max-height: none;
  }
  .content.stats-page .stats-table-grid .table-wrap table {
    min-width: 620px;
  }
  .panel-form,
  .filterbar.panel-form {
    gap: 6px;
  }
  .input,
  .select,
  .textarea,
  .panel-form .input,
  .panel-form .select,
  .panel-form .textarea {
    min-height: 34px;
    border-color: #e5ebe3;
    border-radius: 7px;
    background: #fff;
    box-shadow: rgba(14,15,12,.025) 0 1px 0 inset;
    font-size: 14px;
    padding: 6px 9px;
  }
  .textarea,
  .panel-form .textarea {
    min-height: 88px;
  }
  .btn,
  .panel-actions .btn,
  .panel-form .btn.primary,
  .panel .panel-form .btn.primary {
    border-radius: 7px;
  }
  .btn,
  .panel-actions .btn {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 620;
  }
  .btn.primary,
  .panel-form .btn.primary,
  .panel .panel-form .btn.primary {
    min-height: 32px;
    border-color: rgba(3, 197, 101, .46);
    background: #f3fbf6;
    color: var(--green-dark);
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 650;
  }
  .btn.primary:hover,
  .panel-form .btn.primary:hover,
  .panel .panel-form .btn.primary:hover {
    border-color: rgba(3, 197, 101, .62);
    background: #ecf9f1;
  }
  .topbar-utility .btn.icon {
    width: 34px;
    min-height: 34px;
  }
  .click-period-card {
    gap: 6px;
    padding: 8px;
    box-shadow: rgba(14,15,12,.05) 0 0 0 1px;
  }
  .click-period-card.estimated {
    box-shadow: rgba(14,15,12,.05) 0 0 0 1px, inset 2px 0 0 rgba(3, 197, 101, .38);
  }
  .click-period-head span,
  .click-period-details span,
  .click-period-rate span {
    font-weight: 590;
  }
  .click-period-head strong {
    font-size: 14px;
    font-weight: 660;
  }
  .click-period-details strong,
  .click-period-rate strong {
    font-weight: 640;
  }
  .click-report-toolbar {
    padding: 8px 9px;
  }
  .click-toolbar-title h2 {
    font-size: 14px;
    font-weight: 650;
  }
  .top-model-row {
    padding: 7px 8px 7px 7px;
  }
  .top-model-title,
  .top-site-title {
    font-weight: 620;
  }
  .top-model-counts strong {
    font-size: 14px;
    font-weight: 650;
  }
  .audit-admin-table tbody {
    gap: 6px;
  }
  .audit-admin-table tr {
    border-radius: 7px;
    box-shadow: rgba(14,15,12,.04) 0 0 0 1px;
    padding: 7px 9px;
  }
  .audit-admin-table td {
    padding: 5px 0;
  }
  .audit-admin-table td::before {
    font-weight: 600;
  }
  .audit-admin-table .btn {
    min-height: 32px;
    padding: 5px 10px;
  }

  /* Mobile header compression. */
  .sidebar {
    padding: 4px 11px 3px;
  }
  .brand {
    padding: 0 1px 3px;
  }
  .brand-logo { width: 118px; }
  .brand-sub { font-size: 14px; }
  .nav {
    gap: 2px;
    padding: 0 10px 3px 2px;
    scroll-padding-inline: 12px;
  }
  .nav button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 14px;
  }
  .segmented button,
  .tab-strip button,
  .top-actions .segmented button,
  .nav button {
    min-height: 30px;
  }
  .topbar {
    gap: 4px;
    padding: 7px 12px;
    border-bottom-color: rgba(14,15,12,.05);
  }
  .page-title {
    font-size: 16px;
    font-weight: 640;
  }
  .page-caption {
    display: none;
  }
  .topbar-actions-row {
    gap: 8px;
  }
  .topbar-utility {
    gap: 6px;
  }
  .topbar-utility .btn,
  .top-actions .btn {
    min-height: 32px;
    font-size: 14px;
  }
  .topbar-utility .btn.icon {
    width: 34px;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions .segmented button {
    min-height: 28px;
    font-size: 14px;
  }
  .top-actions .segmented button.active {
    background: transparent;
    color: var(--green-dark);
  }
  .content.stats-page .trend-line svg,
  .click-daily-panel .trend-line svg,
  .stats-chart-panel .trend-line svg {
    height: 176px !important;
    min-height: 0;
  }
  .content.stats-page .segmented button.active {
    background: #0e0f0c;
    color: #fff;
    box-shadow: rgba(14,15,12,.16) 0 0 0 1px;
  }
  .content.stats-page .panel {
    background: var(--stats-panel-tint);
  }
  .content.stats-page .kpi-card {
    border-right-color: rgba(14,15,12,.05);
    border-bottom-color: rgba(14,15,12,.05);
  }
  .content.stats-page .kpi-card:nth-child(6n + 2) .value { color: var(--blue); }
  .content.stats-page .kpi-card:nth-child(6n + 3) .value,
  .content.stats-page .kpi-card:nth-child(6n + 4) .value,
  .content.stats-page .kpi-card:nth-child(6n + 5) .value,
  .content.stats-page .kpi-card:nth-child(6n) .value { color: var(--fg); }
  .top-sites-rank-table table {
    min-width: 520px;
  }
  .stats-breakdown-table .link,
  .top-sites-rank-table .link {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
  }

  /* Audit rows should scan like compact records, not long document cards. */
  .audit-admin-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr) auto;
    gap: 2px 9px;
    padding: 6px 7px;
    background: #fff;
    box-shadow: rgba(14,15,12,.032) 0 0 0 1px;
  }
  .audit-admin-table td {
    display: block !important;
    padding: 2px 0;
    font-size: 14px;
    line-height: 1.34;
    color: var(--body);
  }
  .audit-admin-table td + td {
    border-top: 0;
  }
  .audit-admin-table td::before {
    margin-bottom: 1px;
    font-size: 14px;
    line-height: 1.25;
    color: #7b8179;
  }
  .audit-admin-table td:nth-child(1)::before,
  .audit-admin-table td:nth-child(2)::before,
  .audit-admin-table td:nth-child(3)::before,
  .audit-admin-table td:nth-child(4)::before,
  .audit-admin-table td:nth-child(9)::before,
  .audit-admin-table td:nth-child(10)::before {
    display: none;
  }
  .audit-admin-table td:nth-child(1),
  .audit-admin-table td:nth-child(2),
  .audit-admin-table td:nth-child(3),
  .audit-admin-table td:nth-child(4) {
    grid-template-columns: none;
    gap: 0;
  }
  .audit-admin-table td:nth-child(1) {
    grid-column: 1;
    color: var(--fg);
    font-weight: 620;
  }
  .audit-admin-table td:nth-child(2) {
    grid-column: 2;
    color: var(--muted);
  }
  .audit-admin-table td:nth-child(3) {
    grid-column: 1 / span 2;
    color: var(--fg);
  }
  .audit-admin-table td:nth-child(4) {
    grid-column: 1 / span 2;
    color: var(--muted);
  }
  .audit-admin-table td:nth-child(9) {
    grid-column: 1 / span 2;
    color: var(--muted);
  }
  .audit-admin-table td:nth-child(7),
  .audit-admin-table td:nth-child(8) {
    grid-column: 1 / -1;
  }
  .audit-admin-table td:nth-child(10) {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: start;
    justify-self: end;
  }
  .audit-admin-table td:nth-child(7),
  .audit-admin-table td:nth-child(8) {
    padding-top: 4px;
    border-top: 1px solid rgba(14,15,12,.045);
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .audit-admin-table td:nth-child(7).is-empty,
  .audit-admin-table td:nth-child(8).is-empty {
    display: none !important;
  }
  .audit-admin-table td:nth-child(9)::before {
    content: "IP ";
    display: inline;
  }
  .audit-admin-table td:nth-child(9) {
    padding-top: 3px;
    font-size: 14px;
  }
  .audit-admin-table td.is-empty {
    display: none !important;
  }
  .audit-admin-table td .sub {
    margin-top: 2px;
    font-size: 14px;
  }
  .audit-admin-table .btn {
    min-height: 32px;
    padding: 5px 10px;
    border-color: rgba(14,15,12,.12);
    font-size: 14px;
    font-weight: 600;
  }

  /* Final mobile polish pass: keep touch targets credible and records dense. */
  .filter-summary {
    min-height: 32px;
    padding: 0 9px;
  }
  .filterbar.global-filters {
    padding: 4px;
  }
  .panel-form,
  .filterbar.panel-form {
    gap: 5px;
    padding: 7px;
  }
  .panel-form .field,
  .filterbar.panel-form .field {
    grid-template-columns: minmax(92px, .38fr) minmax(0, 1fr);
    align-items: center;
    gap: 6px;
  }
  .panel-form .field span,
  .filterbar.panel-form .field span {
    align-self: center;
    color: #747a72;
    font-size: 14px;
    line-height: 1.25;
  }
  .panel-form .field .sub,
  .filterbar.panel-form .field .sub {
    grid-column: 2;
  }
  .panel-form .textarea,
  .textarea.app-config-value {
    min-height: 52px;
  }
  .panel-form textarea[name="allowPositions"],
  .panel-form textarea[name="notes"],
  .panel-form .textarea[name="allowPositions"],
  .panel-form .textarea[name="notes"] {
    min-height: 48px;
  }
  .panel-form .input,
  .panel-form .select,
  .panel-form .textarea {
    min-height: 32px;
    padding: 5px 8px;
  }
  .panel-form .btn.primary,
  .panel .panel-form .btn.primary {
    grid-column: 2;
    justify-self: start;
  }
  .panel-form .inline-flex-field,
  .panel-form .multi-select-field,
  .panel-form .beta-field,
  .panel-form .app-config-value {
    grid-column: 1 / -1;
  }
  .panel-form .multi-select-field .select,
  .filterbar.panel-form .multi-select-field .select {
    min-height: 72px;
    max-height: 96px;
  }
  .panel-form .inline-flex-field span,
  .panel-form .multi-select-field span,
  .panel-form .beta-field span {
    margin-bottom: 3px;
  }
  .audit-admin-table tbody {
    gap: 5px;
  }
  .audit-admin-table tr {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 8px;
    padding: 6px 7px;
  }
  .audit-admin-table td {
    padding: 1px 0;
    font-size: 14px;
    line-height: 1.28;
  }
  .audit-admin-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .audit-admin-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    font-size: 14px;
  }
  .audit-admin-table td:nth-child(3),
  .audit-admin-table td:nth-child(4),
  .audit-admin-table td:nth-child(9) {
    grid-column: 1 / -1;
  }
  .audit-admin-table td:nth-child(3),
  .audit-admin-table td:nth-child(4) {
    display: inline !important;
    color: var(--body);
  }
  .audit-admin-table td:nth-child(7),
  .audit-admin-table td:nth-child(8) {
    grid-column: 1 / -1;
    padding-top: 3px;
    -webkit-line-clamp: 1;
  }
  .audit-admin-table td:nth-child(10) {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .audit-admin-table .btn {
    min-height: 30px;
    padding: 4px 8px;
  }

  /* Mobile forms: keep admin controls compact without creating tall blank blocks. */
  .panel-form,
  .filterbar.panel-form {
    padding: 0;
    box-shadow: none;
    background: transparent;
  }
  .panel-form .field,
  .filterbar.panel-form .field,
  .panel-form .inline-flex-field,
  .panel-form .multi-select-field,
  .panel-form .beta-field {
    display: grid;
    grid-template-columns: minmax(86px, .36fr) minmax(0, 1fr);
    align-items: center;
    gap: 5px 7px;
    grid-column: auto;
    min-width: 0;
  }
  .panel-form .field span,
  .filterbar.panel-form .field span,
  .panel-form .inline-flex-field span,
  .panel-form .multi-select-field span,
  .panel-form .beta-field span {
    align-self: center;
    margin: 0;
    color: #747a72;
    font-size: 14px;
    line-height: 1.25;
  }
  .panel-form .field small,
  .filterbar.panel-form .field small {
    grid-column: 2;
    margin: -2px 0 1px;
    color: #868685;
    font-size: 14px;
    line-height: 1.25;
  }
  .panel-form .input,
  .panel-form .select,
  .panel-form .textarea,
  .filterbar.panel-form .input,
  .filterbar.panel-form .select,
  .filterbar.panel-form .textarea {
    width: 100%;
    min-height: 31px;
    padding: 5px 8px;
    font-size: 14px;
  }
  .panel-form .textarea,
  .panel-form .app-config-value,
  .filterbar.panel-form .textarea {
    min-height: 46px;
  }
  .panel-form .multi-select-field .select,
  .filterbar.panel-form .multi-select-field .select {
    min-height: 54px;
    max-height: 64px;
    padding-block: 4px;
  }
  .panel-form .btn.primary,
  .panel .panel-form .btn.primary,
  .filterbar.panel-form .btn.primary {
    grid-column: 2;
    justify-self: start;
    align-self: center;
    width: auto;
    min-height: 31px;
    padding: 5px 10px;
  }
  #basePriceForm {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 6px 10px;
  }
  #basePriceForm .field {
    grid-template-columns: 62px minmax(0, 1fr);
  }
  #basePriceForm .field:first-child,
  #basePriceForm .field:nth-child(6) {
    grid-column: 1 / -1;
  }
  #basePriceForm .field:first-child {
    grid-template-columns: 62px minmax(0, 1fr);
  }
  #basePriceForm .field:nth-child(6) {
    grid-template-columns: 62px minmax(0, 1fr);
  }
  #basePriceForm .btn.primary {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
  }
  #cfgAllowed {
    height: 58px;
  }
}

.official-ai-kpis {
  margin-bottom: 14px;
}

.official-ai-nav {
  margin-bottom: 14px;
}

.official-ai-editor {
  margin-bottom: 14px;
}

.official-ai-force-refresh {
  margin-bottom: 14px;
}

.official-ai-force-refresh-output {
  margin: 12px 0 0;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.official-ai-force-refresh-output.muted {
  color: var(--muted);
}

.official-ai-form {
  display: grid;
  gap: 12px;
}

.official-ai-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 12px;
}

.official-ai-form .field {
  margin-bottom: 0;
}

.official-ai-form-wide {
  grid-column: 1 / -1;
}

.official-ai-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

/* Global visual de-noise pass: keep the admin UI functional, not decorative. */
.nav button.active {
  background: var(--soft);
  box-shadow: none;
}

.segmented,
.tab-strip,
.filterbar,
.panel-form,
.allowlist-picker,
.table-wrap,
.top-model-list,
.empty {
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}

.segmented button.active,
.tab-strip button.active,
.content.stats-page .segmented button.active,
.content.cpm-page .tab-strip button.active,
.top-actions .segmented button.active {
  background: #fff;
  color: var(--fg);
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}

.card,
.panel,
.kpi-card,
.content.stats-page .panel,
.content.cpm-page .panel,
.content.stats-page .stats-section-head,
.trend-summary div,
.kv-row,
.evidence-item,
.module-item,
.diag-candidate-item,
.metric-flow-row,
.reason-row,
.click-period-card,
.click-period-card.estimated,
.content.stats-page .kpi-card,
.content.stats-page .kpi-card:nth-child(6n + 1),
.content.stats-page .kpi-card:nth-child(6n + 2),
.content.stats-page .kpi-card:nth-child(6n + 3),
.content.stats-page .kpi-card:nth-child(6n + 4),
.content.stats-page .kpi-card:nth-child(6n + 5),
.content.stats-page .kpi-card:nth-child(6n),
.content.cpm-page .kpi-card:nth-child(6n + 1),
.content.cpm-page .kpi-card:nth-child(6n + 2),
.content.cpm-page .kpi-card:nth-child(6n + 3),
.content.cpm-page .kpi-card:nth-child(6n + 4),
.content.cpm-page .kpi-card:nth-child(6n + 5),
.content.cpm-page .kpi-card:nth-child(6n) {
  background: #fff;
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}

.content.stats-page .panel:nth-of-type(4n + 1),
.content.stats-page .panel:nth-of-type(4n + 2),
.content.stats-page .panel:nth-of-type(4n + 3),
.content.stats-page .panel:nth-of-type(4n),
.content.cpm-page .panel:nth-of-type(5n + 1),
.content.cpm-page .panel:nth-of-type(5n + 2),
.content.cpm-page .panel:nth-of-type(5n + 3),
.content.cpm-page .panel:nth-of-type(5n + 4),
.content.cpm-page .panel:nth-of-type(5n),
.content.cpm-page .kv-row:nth-child(4n + 1),
.content.cpm-page .metric-flow-row:nth-child(4n + 1),
.content.cpm-page .reason-row:nth-child(4n + 1),
.content.cpm-page .module-item:nth-child(4n + 1),
.content.cpm-page .diag-candidate-item:nth-child(4n + 1),
.content.cpm-page .kv-row:nth-child(4n + 2),
.content.cpm-page .metric-flow-row:nth-child(4n + 2),
.content.cpm-page .reason-row:nth-child(4n + 2),
.content.cpm-page .module-item:nth-child(4n + 2),
.content.cpm-page .diag-candidate-item:nth-child(4n + 2),
.content.cpm-page .kv-row:nth-child(4n + 3),
.content.cpm-page .metric-flow-row:nth-child(4n + 3),
.content.cpm-page .reason-row:nth-child(4n + 3),
.content.cpm-page .module-item:nth-child(4n + 3),
.content.cpm-page .diag-candidate-item:nth-child(4n + 3),
.content.cpm-page .kv-row:nth-child(4n),
.content.cpm-page .metric-flow-row:nth-child(4n),
.content.cpm-page .reason-row:nth-child(4n),
.content.cpm-page .module-item:nth-child(4n),
.content.cpm-page .diag-candidate-item:nth-child(4n) {
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}

.content.stats-page .panel-title::before,
.content.cpm-page .panel-title::before,
.float-dialog-tone,
.dot {
  display: none;
}

.content.stats-page .panel-title,
.content.cpm-page .panel-title {
  gap: 0;
}

.stats-breakdown-table td,
.stats-breakdown-table tbody tr:nth-child(4n + 1) td:first-child,
.stats-breakdown-table tbody tr:nth-child(4n + 2) td:first-child,
.stats-breakdown-table tbody tr:nth-child(4n + 3) td:first-child,
.stats-breakdown-table tbody tr:nth-child(4n) td:first-child {
  box-shadow: inset 0 0 0 1px rgba(14,15,12,.05);
}

.click-report-toolbar,
.warn-panel,
.content.cpm-page .chip.ok,
.content.cpm-page .chip.warn,
.content.cpm-page .chip.bad,
.chip.bad,
.allowlist-row[data-selected="true"],
.top-sites-summary .highlight {
  background: var(--soft);
  color: var(--body);
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}

.top-sites-summary b,
.top-site-rank,
.top-model-rank,
.mini-pro,
.click-toolbar-title span {
  background: var(--soft);
  color: var(--fg);
  box-shadow: var(--subtle-ring) 0 0 0 1px;
}

.top-site-row:hover {
  border-color: var(--border);
  background: var(--soft);
}

.top-site-metric,
.click-period-card.estimated .click-period-head span {
  color: var(--body);
}

.link {
  color: var(--fg);
  text-decoration-color: rgba(14, 15, 12, .28);
}

.metric-flow {
  width: min(560px, 100%);
}

.metric-flow .metric-flow-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(96px, max-content);
  align-items: center;
  gap: 12px 24px;
}

.metric-flow .metric-flow-values {
  text-align: right;
}

@media (max-width: 640px) {
  .public-banner-form {
    grid-template-columns: 1fr;
  }
  .public-banner-image-path,
  .public-banner-target-url,
  .public-banner-placements,
  .public-banner-notes,
  .public-banner-upload-field {
    grid-column: 1 / -1;
  }
  .public-banner-form-actions {
    align-items: stretch;
  }
  .public-banner-form-actions .btn {
    width: 100%;
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
  .public-banner-preview {
    width: min(260px, 100%);
  }
  .nav button.active,
  .segmented button.active,
  .tab-strip button.active,
  .content.stats-page .segmented button.active,
  .top-actions .segmented button.active {
    background: #fff;
    color: var(--fg);
    box-shadow: var(--subtle-ring) 0 0 0 1px;
  }

  .kpis,
  .kpi-card,
  .card:not(.kpi-card),
  .panel,
  .content.stats-page .panel,
  .click-period-card,
  .click-period-card.estimated,
  .audit-admin-table tr {
    box-shadow: var(--subtle-ring) 0 0 0 1px;
  }

  .kpi-card {
    border-right-color: var(--border-soft);
    border-bottom-color: var(--border-soft);
  }

  .panel-form,
  .filterbar.panel-form {
    box-shadow: none;
  }

  .metric-flow {
    width: 100%;
  }

  .metric-flow .metric-flow-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .metric-flow .metric-flow-values {
    text-align: left;
  }
}

/* Contrast pass: stronger hierarchy without reintroducing decorative color. */
.nav button:hover {
  background: #e8ebe6;
  color: var(--fg);
}

.nav button.active {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
  box-shadow: none;
}

.nav button.active .ico {
  color: #fff;
}

.segmented button.active,
.tab-strip button.active,
.content.stats-page .segmented button.active,
.content.cpm-page .tab-strip button.active,
.top-actions .segmented button.active {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
  box-shadow: none;
}

.table-wrap {
  box-shadow: rgba(14,15,12,.11) 0 0 0 1px;
}

th,
.content.stats-page .stats-table-grid .table-wrap th,
.content.stats-page .stats-wide-panel .table-wrap th,
.stats-breakdown-table th,
.audit-admin-table th,
.alert-table th {
  background: #fafbfd;
  color: var(--fg);
  border-bottom-color: rgba(14,15,12,.16);
  font-weight: 720;
}

td {
  border-bottom-color: rgba(14,15,12,.08);
}

tbody tr:hover td,
.audit-admin-table tr:hover td,
.top-site-row:hover,
.allowlist-row:hover {
  background: #f1f4ef;
}

.stats-breakdown-table tbody tr:hover td {
  background: #f1f4ef;
}

.btn:hover {
  background: #e8ebe6;
  border-color: #cfd6cb;
}

@media (max-width: 640px) {
  .nav button.active,
  .segmented button.active,
  .tab-strip button.active,
  .content.stats-page .segmented button.active,
  .top-actions .segmented button.active {
    background: var(--fg);
    color: #fff;
    border-color: var(--fg);
    box-shadow: none;
  }
}

/* Beacon visual system: aligned with beacon.html reference. */
:root {
  --bg: #f8fafd;
  --fg: #1a2029;
  --body: #474d57;
  --muted: #6a727d;
  --green: #03c565;
  --green-hover: #35dc86;
  --green-text: #f9fcff;
  --green-dark: #028a48;
  --green-soft: #e9fff2;
  --green-tint: #f6faff;
  --blue: #03c565;
  --blue-soft: #e9fff2;
  --blue-ring: rgba(3, 197, 101, .14);
  --soft: #f0f4f7;
  --soft-hover: #e8eef4;
  --surface: #f8fafd;
  --surface-strong: #ffffff;
  --border: #e3e7ea;
  --border-soft: #edf0f3;
  --ring: rgba(3, 197, 101, .18);
  --subtle-ring: rgba(94, 115, 143, .13);
  --shadow-soft: 0 1px 2px rgba(94, 115, 143, .04), 0 1px 3px rgba(94, 115, 143, .05);
  --shadow-card: 0 1px 2px rgba(94, 115, 143, .04), 0 1px 3px rgba(94, 115, 143, .05);
  --shadow-card-hover: 0 8px 24px -6px rgba(81, 116, 160, .12);
  --danger: #d73337;
  --danger-text: #d73337;
  --warning: #d97706;
  --success: #0fa05c;
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.login-page {
  background: var(--bg);
}

.login-card {
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--subtle-ring) 0 0 0 1px, var(--shadow-card);
}

.login-title {
  font-size: 24px;
  font-weight: 760;
  color: var(--fg);
}

.login-copy {
  color: var(--muted);
  font-size: 14px;
}

.shell {
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  background: #fff;
  border-right: 1px solid #e5e8ec;
}

.brand {
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e8ec;
}

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

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--green);
  color: var(--green-text);
  box-shadow: var(--shadow-card);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.brand-logo {
  display: none;
}

.brand-title {
  font-size: 16px;
  font-weight: 760;
  color: var(--fg);
}

.brand-kicker {
  color: #81878f;
  font-size: 14px;
  font-weight: 720;
}

.brand-sub {
  margin-top: 3px;
  color: #81878f;
  font-size: 14px;
  line-height: 1.25;
}

.nav {
  gap: 2px;
  padding: 16px 12px;
}

.nav-group,
.nav-group-toggle {
  padding: 13px 12px 7px;
  color: #81878f;
  font-size: 14px;
  font-weight: 760;
}
.nav-group-toggle {
  width: calc(100% - 24px);
  margin: 0 12px;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.nav-group-toggle:hover,
.nav-group-toggle.active-group {
  color: var(--fg);
}

.nav button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  color: #474d57;
  font-size: 14px;
  font-weight: 570;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.nav .ico {
  display: block;
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: currentColor;
  opacity: .62;
}

.nav button:hover {
  background: var(--soft);
  color: var(--fg);
}

.nav button.active {
  background: #131b29;
  border-color: #131b29;
  color: #f9fcff;
  box-shadow: var(--shadow-card);
  font-weight: 660;
}

.nav button.active .ico {
  color: #f9fcff;
  opacity: .86;
}

.topbar {
  min-height: 64px;
  padding: 11px 28px 10px;
  background: rgba(248, 250, 253, .86);
  border-bottom: 1px solid #e3e7ea;
  backdrop-filter: blur(12px);
}

.page-title {
  font-size: 19px;
  line-height: 1.2;
  font-weight: 720;
  color: var(--fg);
}

.page-caption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.content {
  padding: 24px 28px 32px;
  gap: 20px;
  background: var(--bg);
}

#content {
  gap: 20px;
}

.grid {
  gap: 12px;
}

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

.kpis-nine {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.two {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

.card,
.panel,
.kpi-card,
.content.stats-page .panel,
.content.cpm-page .panel,
.content.stats-page .stats-section-head,
.trend-summary div,
.kv-row,
.evidence-item,
.module-item,
.diag-candidate-item,
.metric-flow-row,
.reason-row,
.click-period-card,
.click-period-card.estimated,
.allowlist-picker,
.top-model-list,
.filterbar,
.panel-form,
.table-wrap,
.empty {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.card,
.panel {
  border-radius: 12px;
}

.card {
  min-height: 88px;
  padding: 16px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(3, 197, 101, .3);
  box-shadow: var(--shadow-card-hover);
}

.panel {
  padding: 24px;
}

.content.stats-page .panel,
.content.cpm-page .panel {
  padding: 20px;
}

.label {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 560;
}

.value {
  margin-top: 8px;
  color: var(--fg);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: 0;
}

.sub {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(227, 231, 234, .72);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.panel-title {
  margin-bottom: 18px;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 760;
}

.section-head {
  margin-bottom: 16px;
}

.section-head .panel-title {
  margin-bottom: 0;
}

.btn {
  min-height: 34px;
  border-color: var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--fg);
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 620;
}

.btn:hover {
  background: var(--soft);
  border-color: #d6dde4;
}

.btn.primary,
.panel-form .btn.primary,
.panel .panel-form .btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--green-text);
  font-weight: 680;
}

.btn.primary:hover,
.panel-form .btn.primary:hover,
.panel .panel-form .btn.primary:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
}

.btn.soft-primary {
  background: #fff;
  border-color: rgba(3, 197, 101, .5);
  color: var(--green-dark);
}

.btn.soft-primary:hover {
  background: var(--blue-soft);
  border-color: rgba(3, 197, 101, .64);
}

.btn.danger {
  background: #fff;
  border-color: rgba(215, 51, 55, .32);
  color: var(--danger-text);
}

.btn.icon {
  width: 34px;
  border-radius: 8px;
}

.btn-svg {
  width: 16px;
  height: 16px;
}

.btn:focus-visible,
.nav button:focus-visible,
.segmented button:focus-visible,
.tab-strip button:focus-visible,
.top-site-row:focus-visible {
  outline: 2px solid rgba(3, 197, 101, .42);
  outline-offset: 2px;
}

.input,
.select,
.textarea {
  min-height: 36px;
  border-color: var(--border);
  border-radius: 8px;
  background: rgba(240, 244, 247, .5);
  color: var(--fg);
  padding: 7px 11px;
  font-size: 14px;
  box-shadow: none;
}

.input::placeholder,
.textarea::placeholder {
  color: #9aa2ad;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green);
  box-shadow: rgba(3, 197, 101, .2) 0 0 0 2px;
}

.field span,
.public-banner-placements legend {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.filterbar {
  padding: 16px;
  border-radius: 12px;
}

.filter-fields {
  gap: 14px;
}

.filterbar .input,
.filterbar .select {
  min-height: 36px;
  background: rgba(240, 244, 247, .55);
}

.panel-form {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.panel > .filterbar,
.panel > form.filterbar,
.panel .filterbar.panel-form {
  border: 0;
}

.segmented,
.tab-strip {
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: none;
}

.segmented button,
.tab-strip button {
  min-height: 30px;
  border-radius: 6px;
  color: var(--body);
  font-size: 14px;
  font-weight: 620;
}

.segmented button.active,
.tab-strip button.active,
.content.stats-page .segmented button.active,
.content.cpm-page .tab-strip button.active,
.top-actions .segmented button.active {
  background: #fff;
  color: var(--fg);
  box-shadow: rgba(94, 115, 143, .13) 0 0 0 1px, 0 1px 1px rgba(94, 115, 143, .04);
}

.date-range {
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
}

.chip {
  min-height: 25px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
  color: var(--body);
  font-size: 14px;
  font-weight: 600;
}

.chip.ok,
.content.cpm-page .chip.ok {
  background: #f2fbf7;
  border-color: rgba(15, 160, 92, .2);
  color: #0b6b41;
}

.chip.warn,
.content.cpm-page .chip.warn {
  background: #fff8e8;
  border-color: rgba(217, 119, 6, .24);
  color: #8a4b00;
}

.chip.bad,
.content.cpm-page .chip.bad {
  background: #fff1f2;
  border-color: rgba(215, 51, 55, .24);
  color: var(--danger-text);
}

.dot {
  display: inline-block;
}

.chip.ok .dot {
  background: var(--success);
}

.chip.warn .dot {
  background: var(--warning);
}

.chip.bad .dot {
  background: var(--danger);
}

.table-wrap {
  border-radius: 12px;
  overflow: auto;
}

table {
  font-size: 14px;
}

th,
.content.stats-page .stats-table-grid .table-wrap th,
.content.stats-page .stats-wide-panel .table-wrap th,
.stats-breakdown-table th,
.audit-admin-table th,
.alert-table th {
  background: #f9fbfd;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 720;
}

th,
td {
  padding: 9px 11px;
  border-bottom-color: var(--border-soft);
}

td {
  color: var(--body);
}

td strong {
  color: var(--fg);
}

tbody tr:hover td,
.audit-admin-table tr:hover td {
  background: #f6fff9;
}

.trend-line svg {
  min-height: 176px;
}

.trend-grid {
  stroke: rgba(227, 231, 234, .8);
}

.trend-domain-line {
  stroke: var(--border);
}

.trend-reference-line {
  stroke: rgba(106, 114, 125, .35);
}

.trend-area {
  fill: rgba(3, 197, 101, .1);
}

.trend-path,
.trend-legend-line {
  stroke: var(--green);
  border-top-color: var(--green);
}

.trend-point {
  stroke: var(--green);
}

.trend-hover-zone:focus {
  fill: rgba(3, 197, 101, .08);
}

.trend-axis-label,
.trend-axis,
.trend-legend {
  color: var(--muted);
  fill: var(--muted);
}

.kv-row,
.evidence-item,
.module-item,
.diag-candidate-item,
.metric-flow-row,
.reason-row,
.click-period-card,
.top-model-row,
.top-site-row {
  border-radius: 8px;
}

.kv-key,
.evidence-field span,
.metric-flow-row span,
.reason-row span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
}

.kv-value,
.evidence-field strong,
.metric-flow-values b,
.reason-values b {
  color: var(--fg);
}

.metric-flow {
  width: min(620px, 100%);
}

.metric-flow .metric-flow-row {
  background: rgba(240, 244, 247, .5);
  border: 1px solid var(--border);
  box-shadow: none;
}

.metric-flow .metric-flow-row:last-child {
  background: #131b29;
  border-color: #131b29;
  color: #f9fcff;
}

.metric-flow .metric-flow-row:last-child strong,
.metric-flow .metric-flow-row:last-child b {
  color: #f9fcff;
}

.metric-flow .metric-flow-row:last-child span,
.metric-flow .metric-flow-row:last-child .metric-flow-values {
  color: rgba(249, 252, 255, .7);
}

.reason-bar {
  background: rgba(227, 231, 234, .9);
}

.reason-bar span {
  background: var(--green);
}

.empty {
  min-height: 72px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(240, 244, 247, .6);
}

.warn-panel {
  background: #fff8e8;
  border-color: rgba(217, 119, 6, .24);
}

.link {
  color: var(--green-dark);
  text-decoration-color: rgba(3, 197, 101, .35);
}

.check-option {
  border-color: var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--fg);
}

.check-option input,
.inline-check input,
.allowlist-row input {
  accent-color: var(--green);
}

.check-option:has(input:checked),
.allowlist-row[data-selected="true"] {
  border-color: rgba(3, 197, 101, .45);
  background: var(--blue-soft);
  box-shadow: rgba(3, 197, 101, .14) 0 0 0 1px inset;
}

.public-banner-preview {
  width: 240px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, #f9fbfd, #eef4fb);
  box-shadow: var(--shadow-card);
}

.public-banner-preview img {
  object-fit: cover;
  transition: transform .18s ease;
}

.public-banner-preview:hover img {
  transform: scale(1.015);
}

.public-banner-placement-badges {
  gap: 7px;
}

.public-banner-table td:first-child {
  min-width: 270px;
}

.top-site-row,
.top-model-row {
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
}

.top-site-row:hover,
.allowlist-row:hover,
.stats-breakdown-table tbody tr:hover td {
  background: #f6fff9;
}

.top-site-rank,
.top-model-rank,
.mini-pro,
.click-toolbar-title span {
  background: #131b29;
  color: #f9fcff;
  box-shadow: none;
}

.top-site-title,
.top-model-title,
.identity-main,
.position-label {
  color: var(--fg);
}

.top-site-sub,
.top-model-sub,
.identity-sub,
.raw-key,
.click-breakdown-note {
  color: var(--muted);
}

.click-report-toolbar,
.content.stats-page .stats-section-head {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.click-period-card.estimated {
  background: #f6faff;
  border-color: rgba(3, 197, 101, .22);
}

.click-period-card.estimated .click-period-head span,
.top-site-metric {
  color: var(--green-dark);
}

.stats-breakdown-table td {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(227, 231, 234, .8);
}

.stats-breakdown-table td:first-child {
  color: var(--fg);
}

.content.stats-page {
  --stats-blue: #03c565;
  --stats-blue-soft: #e9fff2;
  --stats-blue-ring: rgba(3, 197, 101, .14);
  --stats-blue-alt: #131b29;
  --stats-blue-alt-soft: #f0f4f7;
  --stats-blue-alt-ring: rgba(19, 27, 41, .12);
  --stats-muted: #81878f;
  --stats-muted-soft: #f3f5f8;
  --stats-muted-ring: rgba(94, 115, 143, .13);
  --stats-ink: #1a2029;
  --stats-ink-soft: #f0f4f7;
  --stats-ink-ring: rgba(19, 27, 41, .12);
  --stats-ink-alt: #1a2029;
  --stats-ink-alt-soft: #f0f4f7;
  --stats-ink-alt-ring: rgba(19, 27, 41, .12);
  --stats-green-soft: #e9fff2;
  --stats-panel-tint: #ffffff;
}

.content.cpm-page {
  --cpm-blue: #03c565;
  --cpm-blue-soft: #e9fff2;
  --cpm-blue-ring: rgba(3, 197, 101, .14);
  --cpm-blue-alt: #131b29;
  --cpm-blue-alt-soft: #f0f4f7;
  --cpm-blue-alt-ring: rgba(19, 27, 41, .12);
  --cpm-muted: #81878f;
  --cpm-muted-soft: #f3f5f8;
  --cpm-muted-ring: rgba(94, 115, 143, .13);
  --cpm-ink: #1a2029;
  --cpm-ink-soft: #f0f4f7;
  --cpm-ink-ring: rgba(19, 27, 41, .12);
  --cpm-danger: #d73337;
  --cpm-danger-soft: #fff1f2;
  --cpm-danger-ring: rgba(215, 51, 55, .18);
}

.content.stats-page .panel-title::before,
.content.cpm-page .panel-title::before,
.float-dialog-tone {
  display: inline-block;
}

.content.stats-page .panel-title::before,
.content.cpm-page .panel-title::before {
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: rgba(3, 197, 101, .16) 0 0 0 4px;
}

.content.stats-page .panel-title,
.content.cpm-page .panel-title {
  gap: 8px;
}

.float-dialog-backdrop {
  background: rgba(19, 27, 41, .28);
  backdrop-filter: blur(2px);
}

.float-dialog {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -20px rgba(19, 27, 41, .28), rgba(19, 27, 41, .12) 0 0 0 1px;
}

.float-dialog-title {
  color: var(--fg);
  font-size: 15px;
  font-weight: 760;
}

.float-dialog-tone {
  background: var(--green);
  box-shadow: rgba(3, 197, 101, .16) 0 0 0 4px;
}

.drawer {
  background: #fff;
  box-shadow: -18px 0 50px rgba(19, 27, 41, .16);
}

.json {
  background: var(--soft);
}

.audit-json-detail {
  margin-top: 10px;
}

.audit-json-detail summary {
  cursor: pointer;
  color: var(--fg);
  font-size: 14px;
  font-weight: 680;
}

.audit-json {
  overflow: auto;
  white-space: pre;
  word-break: normal;
}

@media (max-width: 1180px) and (min-width: 981px) {
  .kpis,
  .kpis-nine {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    overflow-y: visible;
    overscroll-behavior: auto;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
  }

  .brand {
    padding: 10px 16px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .brand-mark svg {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 15px;
  }

  .nav {
    padding: 8px 14px 10px;
    gap: 6px;
  }

  .nav .ico {
    display: none;
  }

  .topbar {
    padding: 10px 16px;
    background: rgba(248, 250, 253, .92);
  }

  .content {
    padding: 16px;
    gap: 14px;
  }

  #content {
    gap: 14px;
  }

  .kpis,
  .kpis-nine,
  .two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-card {
    border-radius: 12px;
  }

  .brand {
    padding: 8px 14px;
  }

  .brand-kicker,
  .brand-sub {
    display: none;
  }

  .nav {
    padding: 7px 14px 8px;
    gap: 4px;
  }

  .nav button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 620;
  }

  .nav button.active,
  .segmented button.active,
  .tab-strip button.active,
  .content.stats-page .segmented button.active,
  .top-actions .segmented button.active {
    background: #131b29;
    color: #f9fcff;
    border-color: #131b29;
  }

  .topbar {
    gap: 6px;
    padding: 8px 14px;
  }

  .page-title {
    font-size: 16px;
    font-weight: 720;
  }

  .content,
  .content.stats-page {
    padding: 12px 14px 18px;
    gap: 12px;
    background: var(--bg);
  }

  #content,
  .content.stats-page #content {
    gap: 12px;
  }

  .filterbar,
  .filterbar.global-filters {
    border-radius: 12px;
    padding: 8px;
  }

  .filter-summary {
    min-height: 34px;
  }

  .panel {
    padding: 12px;
    border-radius: 12px;
  }

  .content.stats-page .panel,
  .content.cpm-page .panel {
    padding: 12px;
  }

  .panel-title,
  .content.stats-page .panel-title {
    font-size: 14px;
    font-weight: 760;
  }

  .kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .kpi-card,
  .card:not(.kpi-card) {
    min-height: 72px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
  }

  .kpi-card:nth-child(2n),
  .kpi-card:last-child:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .kpi-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .value {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 760;
  }

  .label {
    font-size: 14px;
  }

  .sub {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 14px;
  }

  .input,
  .select,
  .textarea,
  .panel-form .input,
  .panel-form .select,
  .panel-form .textarea,
  .filterbar.panel-form .input,
  .filterbar.panel-form .select,
  .filterbar.panel-form .textarea {
    min-height: 34px;
    border-color: var(--border);
    border-radius: 8px;
    background: rgba(240, 244, 247, .55);
    font-size: 14px;
  }

  .btn,
  .panel-actions .btn,
  .panel-form .btn.primary,
  .panel .panel-form .btn.primary,
  .filterbar.panel-form .btn.primary {
    min-height: 34px;
    border-radius: 8px;
  }

  .public-banner-preview {
    width: min(280px, 100%);
    border-radius: 12px;
  }

  .metric-flow .metric-flow-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .metric-flow .metric-flow-values {
    text-align: left;
  }
}

/* Dashboard KPI override: fixed card size with auto wrapping. */
.kpis.dashboard-kpis {
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  align-items: stretch;
}

.kpis.dashboard-kpis .kpi-card {
  min-height: 96px;
  display: flex;
  flex-direction: column;
}

.kpis.dashboard-kpis .label {
  line-height: 1.25;
}

.kpis.dashboard-kpis .value {
  margin-top: 6px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.kpis.dashboard-kpis .sub {
  margin-top: auto;
  padding-top: 8px;
}

@media (max-width: 640px) {
  .kpis.dashboard-kpis {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px;
  }

  .kpis.dashboard-kpis .kpi-card {
    min-height: 86px;
    padding: 8px 8px;
  }

  .kpis.dashboard-kpis .label {
    font-size: 14px;
    line-height: 1.2;
  }

  .kpis.dashboard-kpis .value {
    margin-top: 4px;
    font-size: clamp(14px, 4vw, 16px);
    line-height: 1.12;
  }

  .kpis.dashboard-kpis .sub {
    padding-top: 6px;
    font-size: 14px;
    line-height: 1.25;
  }
}

/* Keep table borders legible across all admin tables and responsive variants. */
.table-wrap {
  border-color: var(--border);
  box-shadow: none;
}

.table-wrap th,
.table-wrap td,
.audit-admin-table th,
.audit-admin-table td,
.alert-table th,
.alert-table td,
.content.stats-page .stats-table-grid .table-wrap th,
.content.stats-page .stats-table-grid .table-wrap td,
.content.stats-page .stats-wide-panel .table-wrap th,
.content.stats-page .stats-wide-panel .table-wrap td {
  border-bottom-color: var(--border);
}

.stats-breakdown-table td {
  box-shadow: inset 0 0 0 1px var(--border);
}

.stats-breakdown-table tbody tr:nth-child(4n + 1) td:first-child {
  box-shadow: inset 3px 0 0 var(--green), inset 0 0 0 1px var(--border);
}

.stats-breakdown-table tbody tr:nth-child(4n + 2) td:first-child {
  box-shadow: inset 3px 0 0 var(--stats-blue), inset 0 0 0 1px var(--border);
}

.stats-breakdown-table tbody tr:nth-child(4n + 3) td:first-child {
  box-shadow: inset 3px 0 0 var(--muted), inset 0 0 0 1px var(--border);
}

.stats-breakdown-table tbody tr:nth-child(4n) td:first-child {
  box-shadow: inset 3px 0 0 var(--fg), inset 0 0 0 1px var(--border);
}

.drawer.dimension-drawer {
  width: 70vw;
}

@media (max-width: 980px) {
  .drawer.dimension-drawer {
    width: 100vw;
  }
}

/* Header action layout: keep logout separated at the far right. */
.topbar-actions-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.topbar-actions-row .page-heading {
  flex: 1 1 220px;
}

.topbar-actions-row .top-actions {
  flex: 0 1 auto;
}

.topbar-session {
  margin-left: 18px;
}

@media (max-width: 980px) {
  .pricing-whitelist-layout {
    grid-template-columns: 1fr;
  }

  .pricing-beta-ids,
  .pricing-whitelist-picker .allowlist-picker {
    min-height: 420px;
    max-height: 520px;
  }

  .topbar-actions-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "heading refresh logout"
      "actions actions actions";
    gap: 8px;
  }

  .topbar-actions-row .page-heading {
    grid-area: heading;
  }

  .topbar-actions-row .topbar-utility {
    grid-area: refresh;
    width: auto;
  }

  .topbar-actions-row .top-actions {
    grid-area: actions;
    width: 100%;
  }

  .topbar-session {
    grid-area: logout;
    margin-left: 2px;
  }
}

.content.cpm-page .kpi-card .value,
.content.stats-page .kpi-card .value {
  color: var(--fg);
}

.content.cpm-page .kpi-card.plain,
.content.stats-page .kpi-card.plain {
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

.content.cpm-page .kpi-card.plain .label,
.content.cpm-page .kpi-card.plain .value,
.content.cpm-page .kpi-card.plain .sub,
.content.stats-page .kpi-card.plain .label,
.content.stats-page .kpi-card.plain .value,
.content.stats-page .kpi-card.plain .sub {
  color: inherit;
}

.content.cpm-page .kpi-card.estimated,
.content.stats-page .kpi-card.estimated,
.click-period-card.estimated {
  background: #ecfdf5;
  border-color: rgba(5, 77, 40, .18);
  box-shadow: rgba(5, 77, 40, .14) 0 0 0 1px, inset 0 3px 0 #22c55e;
}

.click-period-card.estimated {
  box-shadow: rgba(5, 77, 40, .14) 0 0 0 1px, inset 3px 0 0 #22c55e;
}

.content.cpm-page .kpi-card.estimated .label,
.content.stats-page .kpi-card.estimated .label,
.click-period-card.estimated .click-period-head span {
  color: var(--green-dark);
}

/* Admin tables should scan from the left edge, including numeric columns. */
th.num,
td.num,
.table-wrap th,
.table-wrap td,
.table-wrap .num,
.stats-breakdown-table th,
.stats-breakdown-table td,
.stats-breakdown-table .num {
  text-align: left;
}
/* Final admin theme: DESIGN.md palette interpreted through shadcn-style dashboard surfaces. */
:root {
  --bg: #f5f5f7;
  --fg: #1d1d1f;
  --body: #333333;
  --muted: #7a7a7a;
  --green: #03c565;
  --green-hover: #02ad59;
  --green-text: #ffffff;
  --green-dark: #03c565;
  --green-soft: #e9fff2;
  --green-tint: #f6fff9;
  --blue: #03c565;
  --blue-soft: #e9fff2;
  --blue-ring: rgba(3, 197, 101, .22);
  --soft: #f5f5f7;
  --soft-hover: #eeeeef;
  --surface: #f5f5f7;
  --surface-strong: #ffffff;
  --border: #e0e0e0;
  --border-soft: #f0f0f0;
  --ring: rgba(3, 197, 101, .22);
  --subtle-ring: rgba(0, 0, 0, .08);
  --shadow-soft: none;
  --shadow-card: none;
  --shadow-card-hover: none;
  --danger: #b42318;
  --danger-text: #b42318;
  --warning: #7a7a7a;
  --success: #1d1d1f;
}

html,
body,
.shell,
.content,
.content.stats-page {
  background: #f5f5f7;
}

body {
  color: #333333;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0;
}

.sidebar {
  background: #001322;
  border-right: 0;
}

.brand {
  min-height: 68px;
  background: #001322;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 40px;
  height: 44px;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.brand-mark {
  background: #03c565;
  color: #ffffff;
  box-shadow: none;
}

.brand-title {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-sub {
  color: #cccccc;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-toggle {
  color: #cccccc;
}

.nav-group-toggle:hover,
.nav-group-toggle.active-group {
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
}

.nav-group-chevron {
  color: #cccccc;
}

.nav button {
  color: #cccccc;
  background: transparent;
  border-color: transparent;
}

.nav button:hover {
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
}

.nav button.active,
.nav button.active:hover {
  background: #03c565;
  border-color: #03c565;
  color: #ffffff;
}

.nav button.active::after {
  background: #ffffff;
}

.nav .ico {
  opacity: .72;
}

.topbar {
  background: rgba(245, 245, 247, .82);
  border-bottom: 1px solid #e0e0e0;
  backdrop-filter: blur(18px);
  box-shadow: none;
}

.page-title,
.panel-title,
.section-head .panel-title {
  color: #1d1d1f;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-caption,
.label,
.sub,
.field span,
.trend-axis-label,
.trend-axis,
.trend-legend,
.top-site-sub,
.top-model-sub,
.identity-sub,
.raw-key,
.click-breakdown-note {
  color: #7a7a7a;
  fill: #7a7a7a;
}

.login-card,
.filterbar,
.panel,
.card,
.kpi-card,
.content.stats-page .panel,
.content.cpm-page .panel,
.content.stats-page .stats-section-head,
.trend-summary div,
.kv-row,
.evidence-item,
.module-item,
.diag-candidate-item,
.metric-flow-row,
.reason-row,
.click-period-card,
.click-period-card.estimated,
.allowlist-picker,
.top-model-list,
.table-wrap,
.empty,
.click-report-toolbar,
.public-banner-preview {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: none;
}

.panel,
.card,
.kpi-card,
.filterbar,
.table-wrap,
.content.stats-page .stats-section-head,
.click-report-toolbar,
.public-banner-preview {
  border-radius: 18px;
}

.panel {
  padding: 20px;
}

.content.stats-page .panel,
.content.cpm-page .panel {
  padding: 18px;
}

.panel-title::before,
.content.stats-page .panel-title::before,
.content.cpm-page .panel-title::before {
  width: 4px;
  height: 16px;
  border-radius: 9999px;
  background: #03c565;
  box-shadow: none;
}

.kpi-card,
.content.cpm-page .kpi-card.plain,
.content.stats-page .kpi-card.plain {
  background: #ffffff;
  border-color: #e0e0e0;
}

.kpi-card::after,
.kpi-card:nth-child(6n + 2)::after,
.kpi-card:nth-child(6n + 3)::after,
.kpi-card:nth-child(6n + 4)::after,
.kpi-card:nth-child(6n + 5)::after,
.kpi-card:nth-child(6n)::after {
  background: #03c565;
}

.value,
.kv-value,
.evidence-field strong,
.metric-flow-values b,
.reason-values b,
td strong,
.identity-main,
.position-label,
.top-site-title,
.top-model-title {
  color: #1d1d1f;
  font-weight: 600;
}

.card:hover,
.top-site-row:hover,
.allowlist-row:hover {
  transform: none;
  background: #fafafc;
  border-color: #d2d2d7;
  box-shadow: none;
}

.btn {
  background: #ffffff;
  border-color: #e0e0e0;
  color: #1d1d1f;
  border-radius: 8px;
  box-shadow: none;
}

.btn:hover {
  background: #f5f5f7;
  border-color: #d2d2d7;
}

.btn.primary,
.panel-form .btn.primary,
.panel .panel-form .btn.primary {
  background: #03c565;
  border-color: #03c565;
  color: #ffffff;
  border-radius: 9999px;
}

.btn.primary:hover,
.panel-form .btn.primary:hover,
.panel .panel-form .btn.primary:hover {
  background: #02ad59;
  border-color: #02ad59;
}

.btn.soft-primary {
  background: transparent;
  border-color: #03c565;
  color: #03c565;
  border-radius: 9999px;
}

.btn.danger {
  border-color: rgba(180, 35, 24, .28);
  color: #b42318;
  background: #ffffff;
}

.btn:active,
.segmented button:active,
.tab-strip button:active {
  transform: scale(.97);
}

.btn:focus-visible,
.nav button:focus-visible,
.segmented button:focus-visible,
.tab-strip button:focus-visible,
.top-site-row:focus-visible,
.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid #03c565;
  outline-offset: 2px;
}

.input,
.select,
.textarea {
  background: #ffffff;
  border-color: #e0e0e0;
  color: #1d1d1f;
  border-radius: 8px;
  box-shadow: none;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #d2d2d7;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #03c565;
  box-shadow: none;
}

.segmented,
.tab-strip,
.dimension-report-tabs {
  background: #f5f5f7;
  border: 1px solid #e0e0e0;
  border-radius: 9999px;
  box-shadow: none;
}

.segmented button,
.tab-strip button,
.dimension-report-tabs button {
  border-radius: 9999px;
  color: #333333;
}

.segmented button.active,
.tab-strip button.active,
.dimension-report-tabs button.active,
.content.stats-page .segmented button.active,
.content.cpm-page .tab-strip button.active,
.top-actions .segmented button.active {
  background: #001322;
  color: #ffffff;
  box-shadow: none;
}

.tab-strip[data-tab-scope="rankFactorWeights"] button:not(.active) {
  background: transparent;
  color: #1d4fc7;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .18);
}

.tab-strip[data-tab-scope="rankScoreAdjustments"] button:not(.active) {
  background: transparent;
  color: #1d4fc7;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .18);
}

.tab-strip[data-tab-scope="rankFactorWeights"] button.active {
  background: #fff;
  color: #123fb0;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .34);
}

.tab-strip[data-tab-scope="rankScoreAdjustments"] button.active {
  background: #fff;
  color: #123fb0;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 255, .34);
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
.content.stats-page .stats-table-grid .table-wrap th,
.content.stats-page .stats-wide-panel .table-wrap th,
.stats-breakdown-table th,
.audit-admin-table th,
.alert-table th {
  background: #fafafc;
  color: #333333;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
}

td,
.audit-admin-table td,
.alert-table td {
  color: #1d1d1f;
  border-bottom-color: #f0f0f0;
}

tbody tr:nth-child(even) td {
  background: #fafafc;
}

tbody tr:hover td,
.audit-admin-table tr:hover td,
.stats-breakdown-table tbody tr:hover td {
  background: #f5f5f7;
}

.chip,
.content.cpm-page .chip.ok,
.content.cpm-page .chip.warn,
.content.cpm-page .chip.bad,
.chip.ok,
.chip.warn,
.chip.bad {
  background: #fafafc;
  border-color: #e0e0e0;
  color: #333333;
}

.chip.bad,
.content.cpm-page .chip.bad,
.kpi-card.danger .value {
  color: #b42318;
}

.chip.warn,
.content.cpm-page .chip.warn,
.kpi-card.warn .value {
  color: #7a7a7a;
}

.dot,
.chip.ok .dot,
.chip.warn .dot,
.chip.bad .dot {
  background: #03c565;
}

.link,
.link-button,
.text-link,
.click-period-card.estimated .click-period-head span,
.top-site-metric {
  color: #03c565;
  text-decoration-color: rgba(3, 197, 101, .32);
}

.trend-area {
  fill: rgba(3, 197, 101, .08);
}

.trend-path,
.trend-legend-line {
  stroke: #03c565;
  border-top-color: #03c565;
}

.trend-point {
  stroke: #03c565;
}

.trend-grid,
.trend-domain-line {
  stroke: #e0e0e0;
}

.top-site-rank,
.top-model-rank,
.mini-pro,
.click-toolbar-title span,
.metric-flow .metric-flow-row:last-child {
  background: #001322;
  border-color: #001322;
  color: #ffffff;
}

.metric-flow .metric-flow-row {
  background: #fafafc;
  border-color: #e0e0e0;
}

.warning-box,
.warn-panel,
.empty {
  background: #fafafc;
  border-color: #e0e0e0;
  color: #333333;
}

.check-option,
.inline-check,
.dimension-column-chip,
.top-site-row,
.top-model-row {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: none;
}

.check-option:has(input:checked),
.allowlist-row[data-selected="true"],
.dimension-column-chip.active {
  background: #e9fff2;
  border-color: #03c565;
  box-shadow: inset 0 0 0 1px #03c565;
}

.float-dialog-backdrop {
  background: rgba(0, 0, 0, .22);
  backdrop-filter: blur(8px);
}

.float-dialog,
.drawer {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: none;
}

.float-dialog {
  border-radius: 18px;
}

.float-dialog-tone {
  background: #03c565;
  box-shadow: none;
}

.json {
  background: #f5f5f7;
  color: #1d1d1f;
}

@media (max-width: 980px) {
  .sidebar {
    background: #001322;
    border-bottom: 0;
  }

  .brand {
    background: #001322;
  }

  .brand-logo {
    width: 36px;
    height: 40px;
  }

  .nav {
    background: #001322;
  }

  .topbar {
    background: rgba(245, 245, 247, .9);
  }
}

@media (max-width: 640px) {
  body,
  .shell,
  .content,
  .content.stats-page {
    background: #f5f5f7;
  }

  .panel,
  .filterbar,
  .table-wrap,
  .card,
  .kpi-card,
  .card:not(.kpi-card) {
    border-radius: 14px;
  }

  .nav button.active,
  .segmented button.active,
  .tab-strip button.active,
  .content.stats-page .segmented button.active,
  .top-actions .segmented button.active {
    background: #03c565;
    border-color: #03c565;
    color: #ffffff;
  }

  tbody tr:nth-child(even) td {
    background: transparent;
  }
}

.partner-pro-brief {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.partner-pro-brief h2 {
  margin: 0 0 6px;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.25;
}

.partner-pro-brief p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.partner-pro-brief-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.partner-pro-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.partner-pro-table-wrap table {
  min-width: 1120px;
}

.partner-pro-table-wrap th:nth-child(1),
.partner-pro-table-wrap td:nth-child(1) {
  min-width: 230px;
}

.partner-pro-table-wrap th:nth-child(4),
.partner-pro-table-wrap td:nth-child(4) {
  min-width: 240px;
}

.partner-pro-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.partner-pro-segments {
  min-width: 110px;
}

@media (max-width: 980px) {
  .partner-pro-brief {
    display: grid;
  }

  .partner-pro-brief-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .partner-pro-kpis {
    grid-template-columns: 1fr;
  }

  .partner-pro-brief {
    border-radius: 14px;
    padding: 14px;
  }
}

.nav {
  gap: 0;
}

.nav .nav-level-1,
.nav-group-toggle.nav-level-1 {
  min-height: 28px;
  margin: 18px 12px 7px;
  padding: 0 2px 0 11px;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, .58);
  background: transparent;
  box-shadow: inset 3px 0 0 rgba(3, 197, 101, .72);
  font-size: 15px;
  font-weight: 820;
  letter-spacing: .02em;
}

.nav .nav-level-1:first-child,
.nav-group-toggle.nav-level-1:first-child {
  margin-top: 6px;
}

.nav .nav-level-1.active-group,
.nav .nav-level-1:hover,
.nav-group-toggle.nav-level-1.active-group,
.nav-group-toggle.nav-level-1:hover {
  color: #ffffff;
  background: transparent;
}

.nav-group-chevron {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1;
}

.nav button.nav-level-2 {
  min-height: 42px;
  margin: 3px 10px;
  padding: 0 12px 0 15px;
  border-radius: 9px;
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .055);
  font-size: 14px;
  font-weight: 660;
}

.nav button.nav-level-2::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .32);
  transform: translateY(-50%);
}

.nav button.nav-level-3 {
  min-height: 31px;
  margin: 0 10px 0 28px;
  padding: 0 10px 0 23px;
  border-radius: 7px;
  color: rgba(255, 255, 255, .62);
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  font-weight: 540;
}

.nav button.nav-level-3::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -7px;
  bottom: 50%;
  width: 10px;
  border-left: 1px solid rgba(255, 255, 255, .23);
  border-bottom: 1px solid rgba(255, 255, 255, .23);
  border-radius: 0 0 0 6px;
}

.nav button.nav-level-2:hover {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .12);
  color: #ffffff;
}

.nav button.nav-level-3:hover {
  background: rgba(255, 255, 255, .06);
  color: #ffffff;
}

.nav button.nav-level-2.active,
.nav button.nav-level-2.active:hover {
  background: #03c565;
  border-color: #03c565;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(3, 197, 101, .24);
}

.nav button.nav-level-2.active::after {
  background: #ffffff;
}

.nav button.nav-level-3.active,
.nav button.nav-level-3.active:hover {
  background: rgba(3, 197, 101, .16);
  border-color: rgba(3, 197, 101, .34);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #03c565;
}

.nav button.nav-level-3.active::before {
  border-color: rgba(3, 197, 101, .82);
}

@media (max-width: 980px) {
  .nav button.nav-level-2,
  .nav button.nav-level-3 {
    min-height: 32px;
    margin: 0;
    padding: 0 10px;
    font-size: 14px;
  }

  .nav button.nav-level-2 {
    background: transparent;
    border-color: transparent;
  }

  .nav button.nav-level-2::after,
  .nav button.nav-level-3::before {
    display: none;
  }
}

.rank-config-open-panel {
  position: relative;
  overflow: visible;
}
.rank-config-open-panel.rank-searchable-panel-open {
  z-index: 90;
}

.rank-config-page {
  --rank-config-label-offset: 25px;
  --rank-config-label-height: 18px;
  --rank-config-field-gap: 6px;
  --rank-config-control-height: 36px;
}

.rank-config-global-form {
  display: grid;
  grid-template-columns: minmax(120px, .65fr) minmax(120px, .65fr) minmax(150px, .8fr) minmax(180px, 1fr) minmax(132px, auto);
  align-items: end;
}

.rank-config-global-actions {
  display: flex;
  align-items: flex-start;
  padding-top: var(--rank-config-label-offset);
  min-width: 0;
}

.rank-config-global-actions .btn {
  width: 100%;
  height: var(--rank-config-control-height);
  min-height: var(--rank-config-control-height);
  align-self: end;
  border-radius: 8px;
}

.rank-config-target-actions {
  padding-top: var(--rank-config-label-offset);
  min-height: calc(var(--rank-config-label-offset) + var(--rank-config-control-height));
}

.rank-config-target-actions .btn {
  height: var(--rank-config-control-height);
  min-height: var(--rank-config-control-height);
}

.rank-config-page .field {
  gap: var(--rank-config-field-gap);
}

.rank-config-page .field > span {
  display: flex;
  align-items: center;
  min-height: var(--rank-config-label-height);
  line-height: var(--rank-config-label-height);
}

.rank-config-target-row .rank-searchable-trigger,
.rank-config-target-row .input,
.rank-config-target-row .select {
  width: 100%;
  height: var(--rank-config-control-height);
  min-height: var(--rank-config-control-height);
}

.rank-config-target-row [data-rank-row-dirty-notice] {
  grid-column: 1 / -1;
}

.rank-config-page .field > .rank-unsaved-hint:not([data-rank-row-dirty-notice]),
.rank-config-target-row .field > .rank-unsaved-hint:not([data-rank-row-dirty-notice]) {
  display: none;
}

.rank-config-target-row .rank-searchable-filter > .rank-unsaved-hint:not([data-rank-row-dirty-notice]) {
  display: none;
}

@media (max-width: 980px) {
  .rank-config-global-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
