.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #425772;
  font-weight: 600;
  font-size: 11px;
  transition: background 150ms, box-shadow 150ms;
  white-space: nowrap
}

.button:hover {
  background: #f5f8fc;
  border-color: #b7c7dc
}

.button.primary {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 2px 3px #2569de20
}

.button.primary:hover {
  background: #1959c8
}

.button.text {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 5px 0
}

.button .icon {
  width: 15px;
  height: 15px
}

.icon-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  width: 31px;
  height: 31px;
  font-size: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted)
}

.badge {
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  line-height: 1.5;
  white-space: nowrap
}

.badge.good {
  color: var(--green);
  background: var(--green-soft)
}

.badge.warn {
  color: var(--amber);
  background: var(--amber-soft)
}

.badge.danger {
  color: var(--rose);
  background: var(--rose-soft)
}

.badge.info {
  color: var(--blue);
  background: var(--blue-soft)
}

.badge.muted {
  color: #6c7d92;
  background: #eef1f5
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 11px;
  color: #51647c;
  white-space: nowrap
}

.toggle-label input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px
}

.toggle-track {
  width: 27px;
  height: 15px;
  background: #cbd4e1;
  border-radius: 15px;
  position: relative;
  transition: background 180ms
}

.toggle-track:before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  position: absolute;
  left: 2px;
  top: 2px;
  background: white;
  box-shadow: 0 1px 2px #0002;
  transition: transform 180ms
}

.toggle-label input:checked+.toggle-track {
  background: var(--blue)
}

.toggle-label input:checked+.toggle-track:before {
  transform: translateX(12px)
}

.toggle-label input:focus-visible+.toggle-track {
  outline: 3px solid #59b7ff;
  outline-offset: 3px
}

.optional-label {
  font-size: 9px;
  color: #9aa7b8
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden
}

.card-header {
  padding: 17px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #edf0f5
}

.card-header p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px
}

.card-body {
  padding: 20px
}

.card-footer {
  padding: 10px 20px;
  border-top: 1px solid #edf0f5;
  font-size: 10px;
  color: var(--muted)
}

.metric-label {
  font-size: 11px;
  font-weight: 550;
  color: #6f8096
}

.metric-value {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums
}

.metric-unit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 4px
}

.metric-previous {
  font-size: 11px;
  color: #8795a7;
  margin-top: 6px
}

.metric-delta {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #60758f;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 13px
}

.metric-card {
  padding: 18px 20px;
  position: relative
}

.metric-card .metric-value {
  margin-top: 12px
}

.metric-card .badge {
  margin-top: 12px
}

.metric-card:before {
  content: "";
  position: absolute;
  height: 3px;
  top: 0;
  left: 18px;
  right: 18px;
  background: #dbe6f7;
  border-radius: 3px
}

.metric-card.accent:before {
  background: #3181e9
}

.metric-card.missing {
  background: #fafbfd
}

.missing-metric {
  color: #7c8ba0;
  font-size: 12px;
  margin-top: 15px
}

.comparison {
  margin-top: 17px;
  display: grid;
  gap: 7px
}

.comparison-row {
  display: grid;
  grid-template-columns: 49px 1fr 65px;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  color: #8091a7
}

.comparison-row strong {
  font-size: 11px;
  color: #415772;
  font-weight: 550;
  text-align: right;
  font-variant-numeric: tabular-nums
}

.bar-track {
  height: 7px;
  border-radius: 3px;
  background: #f0f3f8;
  overflow: hidden
}

.bar-fill {
  height: 100%;
  width: var(--bar, 0%);
  background: #4f8be5;
  border-radius: 3px;
  min-width: 0
}

.bar-fill.baseline {
  background: #b9c9e0
}

.bar-fill.cyan {
  background: #37a7b7
}

.bar-fill.amber {
  background: #d5a04c
}

.bar-fill.negative {
  background: #7c8fbd
}

.table-scroll {
  overflow: auto;
  max-width: 100%
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
  text-align: left;
  white-space: nowrap
}

th {
  font-size: 9px;
  font-weight: 650;
  color: #8391a5;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: #fbfcfd;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line)
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f5;
  font-variant-numeric: tabular-nums;
  max-width: 350px
}

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

tbody tr:hover {
  background: #f8faff
}

td.wrap {
  white-space: normal;
  min-width: 160px
}

.empty-inline {
  text-align: center;
  padding: 30px 20px;
  color: #8493a7;
  font-size: 12px
}

.empty-inline strong {
  display: block;
  color: #526781;
  font-weight: 550;
  margin-bottom: 5px
}

.empty-inline .icon {
  display: block;
  margin: 0 auto 10px;
  color: #9bb0cb;
  width: 25px;
  height: 25px
}

.notice {
  padding: 13px 16px;
  border: 1px solid #dce8f8;
  border-radius: 9px;
  background: #f0f6ff;
  color: #476d9f;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px
}

.notice.warn {
  background: #fff9eb;
  border-color: #efe0bd;
  color: #90702e
}

.notice.error {
  background: var(--rose-soft);
  border-color: #ebbdc7;
  color: var(--rose)
}

.notice p {
  margin-top: 3px;
  font-size: 11px
}

.quality-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f6
}

.quality-row:last-child {
  border: 0
}

.quality-row p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px
}

.quality-row strong {
  font-size: 12px;
  font-weight: 550
}

.quality-numbers {
  font-variant-numeric: tabular-nums;
  font-size: 12px
}

.quality-numbers span {
  color: #8c9aab
}

.quality-list {
  padding: 0 20px
}

.quality-note {
  font-size: 11px;
  color: #76879d;
  margin: 14px 0 0
}

.kv {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 2fr;
  gap: 10px 20px;
  font-size: 12px;
  margin: 0
}

.kv dt {
  color: var(--muted)
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere
}

.accordion {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 18px;
  overflow: hidden
}

.accordion summary {
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #637690
}

.accordion>div {
  border-top: 1px solid var(--line);
  padding: 18px
}

.evidence-link {
  font-family: var(--mono);
  font-size: 10px;
  color: #3573c9;
  padding: 2px 5px;
  border: 1px solid #d8e6fa;
  border-radius: 4px;
  background: #f3f7ff;
  margin: 2px;
  cursor: pointer
}

.evidence-link:hover {
  background: #dfebff
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: 540px;
  max-width: 95vw;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0;
  color: var(--ink);
  background: white;
  box-shadow: -10px 0 40px #17283b15
}

.drawer::backdrop {
  background: #16243d60
}

.drawer-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 23px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  z-index: 1
}

.drawer-header h2 {
  margin-top: 6px
}

.drawer #drawer-content {
  padding: 23px
}

.drawer h3 {
  margin: 22px 0 12px
}

.drawer .kv {
  font-size: 11px
}

.toasts {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 100;
  display: grid;
  gap: 8px;
  max-width: 380px
}

.toast {
  background: #1d304c;
  color: #fff;
  border-radius: 8px;
  padding: 13px 18px;
  font-size: 12px;
  box-shadow: 0 5px 20px #14243620
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff60;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 850ms linear infinite
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, #edf1f6 25%, #f9fafc 50%, #edf1f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  height: 16px;
  margin: 12px 0
}

.skeleton.big {
  height: 70px
}

.skeleton-workspace {
  opacity: .8
}

.filters {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap
}

.filters input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  min-width: 210px;
  flex: 1;
  font-size: 12px
}

.filters select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  font-size: 11px
}

.pill-filter {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 10px
}

.pill-filter.active {
  background: #eaf2ff;
  border-color: #bcd2f6;
  color: var(--blue)
}

.text-link {
  color: var(--blue);
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  text-align: left
}

.stale {
  opacity: .57
}

.sr-status {
  font-size: 11px;
  color: var(--blue)
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important
  }
}
