@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400&family=Space+Grotesk:wght@700&display=swap");

@font-face {
  font-family: "Space Grotesk";
  src: local("Space Grotesk"), local("SpaceGrotesk");
}

@font-face {
  font-family: "Inter";
  src: local("Inter");
}

@font-face {
  font-family: "JetBrains Mono";
  src: local("JetBrains Mono"), local("JetBrainsMono");
}

:root {
  --color-accent-card: #eef4ff;
  --color-bg-canvas: #f2f6fc;
  --color-bg-shell: #eaf1ff;
  --color-border: #d9e3f3;
  --color-muted: #61738f;
  --color-primary: #1767e8;
  --color-primary-2: #0f52c7;
  --color-success-bg: #dff7ea;
  --color-success-text: #146a43;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fbff;
  --color-text: #2a3b55;
  --color-title: #0e1a2b;
  --state-running: #1767e8;
  --state-success: #0f9f63;
  --state-failed: #d14545;
  --shadow-card: 0 10px 26px rgba(23, 56, 117, 0.08);
  --shadow-soft: 0 3px 10px rgba(10, 31, 75, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--color-bg-canvas);
}

#root {
  min-height: 100vh;
}

.v3-canvas {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
  padding: 16px;
  background:
    linear-gradient(206deg, #f8fbff 0%, #eef3ff 100%);
}

.v3-app-shell {
  width: 100%;
  min-height: 1052px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

.v3-side-nav {
  min-height: 1052px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v3-side-nav-title {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 8px;
}

.v3-side-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v3-side-nav-link {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.v3-side-nav-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.v3-side-nav-link:hover {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
}

.v3-side-nav-link.is-active {
  border-color: #c9daf8;
  background: #ecf3ff;
  color: var(--color-primary-2);
}

.v3-side-nav-settings {
  border-top: 1px solid #e5ecf8;
  margin-top: 6px;
  padding-top: 8px;
}

.v3-side-nav-settings-toggle {
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.outcomes-toggle {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.outcomes-toggle:hover {
  border-color: transparent;
  background: transparent;
}

.outcomes-title {
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
  padding-left: 8px;
  border-left: 3px solid var(--color-primary);
}

.v3-side-nav-settings-toggle:hover {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
}

.v3-side-nav-settings-chevron {
  font-size: 12px;
  color: var(--color-muted);
  transition: transform 0.15s ease;
}

.v3-side-nav-settings-chevron.is-open {
  transform: rotate(180deg);
}

.v3-side-nav-settings-panel {
  margin-top: 6px;
  border: 1px solid #dfe8f6;
  border-radius: 12px;
  background: #f4f7fd;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v3-side-nav-settings-panel[hidden] {
  display: none;
}

.v3-side-nav-leagues {
  border-top: 1px solid #e5ecf8;
  margin-top: 6px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v3-side-nav-leagues-chips {
  min-height: 0;
  gap: 6px;
  padding: 0 2px;
}

.v3-side-nav-leagues .chip {
  min-height: 28px;
}

.v3-side-nav-leagues-panel {
  border: 1px solid #dfe8f6;
  border-radius: 12px;
  background: #f4f7fd;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v3-side-nav-leagues-panel[hidden] {
  display: none;
}

.v3-side-nav-leagues-list-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  max-height: 420px;
  overflow: hidden;
}

.v3-side-nav-leagues-list-wrap .league-list {
  height: 100%;
  max-height: 402px;
  overflow-y: auto;
  padding-right: 2px;
}

.v3-side-nav-leagues-list-wrap .league-list::after {
  content: "";
  display: block;
  height: 2px;
}

.v3-side-nav-settings-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v3-side-nav-settings-section-title {
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 3px solid var(--color-primary);
}

.settings-bk-master-row {
  margin-bottom: 2px;
}

.settings-bk-master-row .v3-side-nav-settings-section-title {
  margin-bottom: 0;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  padding-left: 8px;
  border-left: 3px solid var(--color-primary);
}

/* Segmented control (radio) */
.settings-seg {
  display: flex;
  background: #e2e8f3;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.settings-seg-option {
  flex: 1;
  cursor: pointer;
}

.settings-seg-option input[type="radio"] {
  display: none;
}

.settings-seg-option span {
  display: block;
  text-align: center;
  padding: 5px 4px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.settings-seg-option input:checked + span {
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Toggle switch (checkbox) */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 3px 0;
  gap: 8px;
}

.settings-toggle-row span {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
}

.settings-toggle-row input[type="checkbox"] {
  display: none;
}

.settings-toggle-switch {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.settings-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}

.settings-toggle-row input:checked ~ .settings-toggle-switch {
  background: var(--color-primary);
}

.settings-toggle-row input:checked ~ .settings-toggle-switch::after {
  transform: translateX(13px);
}

.v3-shell {
  width: 100%;
  min-height: 1052px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-block h1 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  color: var(--color-title);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.14;
}

.control-orchestrator {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cc-variant {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-variant-label {
  font-size: 11px;
  font-weight: 700;
  color: #4d6687;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.runbar {
  border-radius: 12px;
  border: 1px solid #d8e5f8;
  background: #f6f9ff;
  padding: 9px 12px;
}

.runbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.runbar-left,
.runbar-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.runbar-state {
  border-radius: 999px;
  background: #e4edf9;
  color: #2e4a6d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
}

.runbar-title {
  color: #1f3757;
  font-size: 13px;
  font-weight: 600;
}

.runbar-elapsed {
  color: #456182;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
}

.runbar.running .runbar-state {
  background: #d9e9ff;
  color: #1354c7;
}

.runbar.success .runbar-state {
  background: #dff4e8;
  color: #157748;
}

.runbar.failed .runbar-state {
  background: #fde8e8;
  color: #b43030;
}

.control-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.stats-col {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid #d8e4f8;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  min-height: 110px;
  padding: 9px 9px 9px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow-soft);
}

.card-status-rail {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 3px;
  height: calc(100% - 16px);
  border-radius: 999px;
  background: #d7e4f8;
  z-index: 0;
}

.stat-card.state-running .card-status-rail {
  background: var(--state-running);
}

.stat-card.state-success .card-status-rail {
  background: var(--state-success);
}

.stat-card.state-failed .card-status-rail {
  background: var(--state-failed);
}

.stat-head {
  width: 100%;
  padding-left: 0;
}

.stat-title-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-title {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
}

.stat-meta {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.count-row {
  width: 100%;
  min-height: 24px;
  display: flex;
  align-items: center;
  padding-left: 0;
}

.metrics-pair {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.metric-card {
  border-radius: 10px;
  background: #e9f2ff;
  border: 1px solid #d5e3fb;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 400;
}

.metric-value {
  color: var(--color-title);
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.stat-spacer { display: none; }

.stat-card p {
  color: var(--color-muted);
  font-size: 9px;
  line-height: 1.25;
  padding-left: 0;
}

.action-btn {
  min-height: 28px;
  width: 100%;
  max-width: none;
  margin-top: auto;
  border: 0;
  border-radius: 10px;
  background: #1767e8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(23, 103, 232, 0.28);
}

.action-btn:focus-visible {
  outline: 2px solid rgba(23, 103, 232, 0.32);
  outline-offset: 2px;
}

.action-btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-btn.is-running .action-btn-icon {
  animation: spin 1.2s linear infinite;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn-secondary {
  background: #2d3748;
  margin-top: 4px;
}

.snapshot-scope-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.bk-sync-checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 12px;
  margin-top: 4px;
}

.bk-check,
.scope-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #3f5978;
  user-select: none;
}

.bk-check input,
.scope-check input {
  width: 14px;
  height: 14px;
}

.bk-check-all {
  font-weight: 600;
  grid-column: 1 / -1;
}

.bk-sync-selection-summary {
  color: #345176;
  font-size: 10px;
  font-weight: 600;
}

.live-wrap {
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  min-height: 190px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.cc-variant-b .live-wrap {
  min-height: 320px;
}

.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-title {
  color: var(--color-title);
  font-size: 18px;
  font-weight: 700;
}

.live-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-badge {
  border-radius: 999px;
  background: #eef4ff;
  color: var(--color-primary-2);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1767e8;
  flex-shrink: 0;
}

.live-badge.idle {
  background: #f4f7fd;
  color: var(--color-muted);
}

.live-badge.idle .live-dot {
  background: #9cadc2;
}

.live-badge.active {
  background: #eef4ff;
}

.cancel-btn {
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid #f3b9b9;
  background: #fff1f1;
  color: #b4232d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.cancel-btn:hover {
  background: #ffe5e5;
  border-color: #eb8f8f;
  color: #991b1b;
}

.cancel-btn:active {
  background: #ffd8d8;
}

.cancel-btn:focus-visible {
  outline: 2px solid rgba(220, 38, 38, 0.28);
  outline-offset: 2px;
}

.live-ribbon {
  display: none;
}

.live-ribbon-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.live-ribbon-action {
  color: #143254;
  font-size: 13px;
  font-weight: 700;
}

.live-ribbon-meta {
  color: #4c678a;
  font-size: 12px;
  font-weight: 500;
}

.live-ribbon.running {
  border-color: #bcd4f8;
  background: #e9f2ff;
}

.live-ribbon.success {
  border-color: #bce5d2;
  background: #eaf9f1;
}

.live-ribbon.failed {
  border-color: #f0c5c5;
  background: #fff0f0;
}

.logs {
  flex: 1;
  min-height: 380px;
  max-height: 380px;
  overflow: auto;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(180deg, #031a30 0%, #001226 100%);
  padding: 12px 14px;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  line-height: 1.38;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line {
  color: #cfe5ff;
  margin-bottom: 0;
  white-space: nowrap;
}

.log-line.success {
  color: #d7ffe8;
}

.log-line.warn {
  color: #ffe2ac;
}

.log-line.error {
  color: #ffc7c7;
}

.log-line.kind-start {
  color: #8fc2ff;
}

.log-line.kind-progress {
  color: #cfe5ff;
}

.log-line.kind-done {
  color: #b7ffd3;
}

.log-line.kind-warn {
  color: #ffd892;
}

.log-line.kind-error {
  color: #ffb1b1;
}

.log-sep {
  color: #6c8ebf;
  font-weight: 600;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #1a3050;
}

.log-line.bk-summary {
  color: #9de8b8;
  font-weight: 600;
  margin: 4px 0 2px 0;
}

.log-line.bk-result {
  padding-left: 4px;
  font-size: 0.91em;
  color: #b4d4ff;
}

.log-line.bk-log {
  padding-left: 12px;
  font-size: 0.88em;
  color: #4a6a8a;
  font-style: italic;
}

.log-line.bk-log.kind-warn {
  color: #9a7030;
}

.log-line.bk-log {
  padding-left: 4px;
  font-size: 0.88em;
  color: #5a7a9a;
  font-style: italic;
}

.log-line.bk-log.kind-warn {
  color: #a07840;
}

.log-line.bk-log.bk-log-info {
  color: #4a6a8a;
}

.log-line.bk-result.kind-done {
  color: #9de8b8;
}

.log-line.bk-result.kind-error {
  color: #ffb1b1;
}

.log-line.bk-result.kind-warn {
  color: #ffd892;
}

.workspace {
  width: 100%;
  min-height: 750px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: stretch;
}

.center-panel {
  min-height: 750px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.center-panel {
  background: var(--color-surface);
}

.panel-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-head-main {
  gap: 8px;
}

.head-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.head-label {
  color: var(--color-title);
  font-size: 18px;
  font-weight: 700;
}

.head-pill {
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--color-primary-2);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.head-pill.success {
  background: #eef7f2;
  color: var(--color-success-text);
}

.search-wrap {
  flex: 1;
  min-width: 250px;
}

.search-wrap input {
  width: 100%;
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-size: 13px;
  padding: 8px 12px;
}

.search-wrap input::placeholder {
  color: var(--color-muted);
}

.chips-row {
  min-height: 29px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seg-filters {
  --bk-slider-thumb-size: 16px;
  --bk-slider-track-size: 4px;
  --bk-hist-visual-col-size: 42px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seg-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seg-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 68px;
  flex-shrink: 0;
}

.bk-count-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bk-count-slider {
  width: 288px;
  height: var(--bk-slider-thumb-size);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.bk-count-slider::-webkit-slider-runnable-track {
  height: var(--bk-slider-track-size);
  background: #d7e4f7;
  border-radius: 999px;
}

.bk-count-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  box-sizing: border-box;
  width: var(--bk-slider-thumb-size);
  height: var(--bk-slider-thumb-size);
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--color-primary);
  margin-top: calc((var(--bk-slider-track-size) - var(--bk-slider-thumb-size)) / 2);
  box-shadow: 0 1px 3px rgba(31, 76, 156, 0.35);
}

.bk-count-slider::-moz-range-track {
  height: var(--bk-slider-track-size);
  background: #d7e4f7;
  border-radius: 999px;
}

.bk-count-slider::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--bk-slider-thumb-size);
  height: var(--bk-slider-thumb-size);
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--color-primary);
  box-shadow: 0 1px 3px rgba(31, 76, 156, 0.35);
}

.bk-count-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary-2);
  min-width: 28px;
  text-align: right;
}

.bk-count-stats {
  padding: 4px 0 2px 76px;
}

.bk-histogram {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 288px;
  padding: 0;
}

.bk-hist-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  width: var(--bk-slider-thumb-size);
  overflow: visible;
}

.bk-hist-bar-wrap {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

.bk-hist-bar {
  width: var(--bk-hist-visual-col-size);
  flex: 0 0 var(--bk-hist-visual-col-size);
  background: #c5d8f5;
  border-radius: 3px 3px 0 0;
  transition: background 0.15s;
  min-height: 2px;
}

.bk-hist-col:hover .bk-hist-bar {
  background: var(--color-primary);
}

.bk-hist-active .bk-hist-bar {
  background: var(--color-primary);
}

.bk-hist-label-top {
  font-size: 10px;
  color: var(--color-muted);
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.bk-hist-pct {
  font-size: 9px;
  color: var(--color-muted);
  opacity: 0.7;
}

.bk-hist-active .bk-hist-label-top {
  color: var(--color-primary-2);
  font-weight: 600;
}

.bk-hist-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-muted);
  line-height: 1;
}

.bk-hist-active .bk-hist-label {
  color: var(--color-primary);
}

.seg-group {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--color-muted);
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s;
}

.seg-btn:hover:not(.seg-active) {
  color: var(--color-text);
}

.seg-badge {
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  color: inherit;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.seg-btn.seg-active {
  background: #fff;
  color: var(--color-text);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(23,103,232,0.15), 0 0 0 1px rgba(23,103,232,0.08);
}

.seg-btn.seg-active .seg-badge {
  background: #e8f0fd;
  color: var(--color-primary-2);
}

.chip {
  min-height: 29px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chip-badge {
  border-radius: 999px;
  background: #eef3ff;
  color: var(--color-muted);
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.chip.chip-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.chip.chip-active .chip-badge {
  background: #fff;
  color: var(--color-primary-2);
}

.league-list,
.match-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.league-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.league-item {
  width: 100%;
  border: 1px solid #cfebdd;
  border-radius: 10px;
  background: var(--color-accent-card);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.league-item.active {
  background: #f4f4f4;
}

.league-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.league-name {
  color: var(--color-title);
  font-size: 14px;
  font-weight: 600;
}

.league-star {
  color: #8fa0b8;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.league-star.active {
  color: #1b74f0;
}

.league-meta {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 400;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-item {
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-item.collapsed {
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.match-item.expanded {
  border: 1px solid #3d7bf0;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px #3d7bf0;
}

.match-head {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.match-title {
  color: var(--color-title);
  font-size: 14px;
  line-height: 1.35;
}

.match-title.strong {
  font-weight: 700;
}

.match-title.weak {
  font-weight: 600;
}

.match-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.match-id-badge {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: text;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.match-id-badge:hover {
  border-color: var(--color-border);
  background: #f0f4ff;
}

.match-id-badge--copied {
  color: var(--color-success-text);
  background: var(--color-success-bg);
  border-color: #a3e0c0;
}

.match-id-badge--copied::after {
  content: " ✓";
}

.match-bk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 0 4px;
}

.bk-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #d97706;
  border: 1px solid transparent;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  margin: 0 3px;
}
.bk-chip-link {
  text-decoration: none;
  cursor: pointer;
}
.bk-chip-link:hover {
  background: var(--bk-chip-hover, #b45309);
}

.bk-chip-pm {
  background: #e8f3ff;
  color: #1452a6;
  border: 1px solid #bad1f6;
  text-transform: none;
  letter-spacing: 0.01em;
}

.bk-chip-link.bk-chip-pm:hover {
  background: #d6e9ff;
}

.matches-sentinel {
  height: 1px;
  text-align: center;
  font-size: 12px;
  color: var(--color-muted);
  padding: 8px 0;
}

.chevron {
  display: inline-block;
  width: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.chevron.up {
  color: var(--color-primary);
}

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

.match-meta {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.35;
}

.markets-expanded {
  border: 1px solid #d8e3f4;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.markets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--color-title);
  font-size: 13px;
  font-weight: 700;
}

.markets-head-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.markets-updated {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.markets-updated-label {
  color: var(--color-muted);
}

.markets-updated-value {
  color: var(--color-text);
}

.refresh-btn {
  min-height: 26px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #eef4ff;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  white-space: nowrap;
  cursor: pointer;
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.market-group-block {
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.market-group-block h3 {
  color: var(--color-title);
  font-size: 15px;
  font-weight: 700;
  padding: 4px 0 2px;
}

.market-group-title-row {
  display: flex;
  align-items: center;
  padding: 2px 0 4px;
}

.market-group-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.market-group-badge.badge-moneyline {
  background: #e9f1ff;
  color: #1d4fa8;
  border-color: #c6d9fb;
}

.market-group-badge.badge-spreads {
  background: #eeecff;
  color: #4d3a9a;
  border-color: #d8cff8;
}

.market-group-badge.badge-totals {
  background: #e8f6f5;
  color: #176a67;
  border-color: #c8e9e7;
}

.market-question {
  color: var(--color-title);
  font-size: 12px;
  font-weight: 600;
}

.market-entry {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 2px 0 6px;
  margin-bottom: 0;
}

.market-entry + .market-entry {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dbe5f5;
}

.market-freshness {
  color: #5a6c88;
  font-size: 11px;
  margin-top: 3px;
}

.market-freshness.tone-fresh {
  color: #1f8f5f;
}

.market-freshness.tone-warm {
  color: #b07216;
}

.market-freshness.tone-stale {
  color: #8f6270;
}

.odds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  table-layout: fixed;
  margin-top: 4px;
  border: 1px solid #d6e2f4;
  border-radius: 8px;
  overflow: hidden;
  background: #f7fbff;
}

.odds-table th,
.odds-table td {
  border-right: 1px solid #d9e4f5;
  border-bottom: 1px solid #d9e4f5;
  padding: 5px 7px;
  text-align: left;
}

.odds-table tr > *:last-child {
  border-right: 0;
}

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

.odds-table thead tr:first-child th {
  background: #edf4ff;
}

.odds-table thead tr:first-child th.odds-col-pm-header {
  background: linear-gradient(180deg, #d9e9ff 0%, #cfe3ff 100%);
  color: #0f4fae;
  border-bottom: 1px solid #d9e4f5;
}

.odds-table thead tr:first-child th.odds-col-bk-header {
  border-left: 1px solid #d9e4f5;
}

.odds-table th[rowspan="2"] {
  vertical-align: middle;
}

.odds-table tbody tr:nth-child(odd) {
  background: #f8fbff;
}

.odds-table tbody tr:nth-child(even) {
  background: #f1f6ff;
}

.odds-table tbody tr:hover {
  background: #e8f0ff;
}

.odds-col-outcome {
  width: 28%;
}

.odds-col-metric {
  text-align: right;
}

.odds-table th {
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 600;
}

.odds-table-group-header {
  text-align: center;
  color: var(--color-primary-2);
  font-weight: 700;
}

.odds-col-pm-sub {
  background: #edf4ff;
  color: #345982;
}

.odds-col-bk-sub {
  background: #f4f6fa;
  color: #4f5d75;
}

.odds-table th.odds-col-bk-sub,
.odds-table td.odds-col-bk-sub {
  border-left: 1px solid #d9e4f5;
}

.odds-table td.odds-col-bk-sub {
  background: #f9fbff;
}

.odds-table-group-header a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.group-empty,
.empty {
  color: var(--color-muted);
  font-size: 12px;
  padding: 6px 0;
}

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

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

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

  .right-panel {
    grid-column: auto;
    min-height: 300px;
  }

  .center-panel {
    min-height: 420px;
  }
}

@media (max-width: 1100px) {
  .v3-app-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .v3-side-nav {
    min-height: auto;
    border-radius: 14px;
    padding: 10px;
  }

  .v3-side-nav-title {
    display: none;
  }

  .v3-side-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .v3-side-nav-link {
    flex: 1;
    justify-content: center;
    min-width: 170px;
  }

  .v3-side-nav-settings {
    width: 100%;
    min-width: 240px;
  }

  .v3-side-nav-leagues {
    width: 100%;
    min-width: 240px;
  }

  .v3-side-nav-settings-toggle {
    min-width: 170px;
  }

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

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

@media (max-width: 820px) {
  .v3-canvas {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 10px;
  }

  .v3-shell {
    min-height: auto;
    padding: 12px;
    border-radius: 14px;
  }

  .v3-side-nav-link {
    min-width: 0;
  }

  .v3-side-nav-settings {
    min-width: 0;
  }

  .header-block h1 {
    font-size: 30px;
  }

  .stats-col {
    grid-template-columns: 1fr;
  }

  .cc-variant {
    padding: 8px;
  }

  .runbar-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-ribbon-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-head-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-wrap {
    width: 100%;
    min-width: 0;
  }

  .chips-row {
    overflow-x: auto;
  }

  .markets-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .markets-head-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .markets-updated {
    white-space: normal;
  }

  .logs {
    max-height: 220px;
  }
}

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

/* Match Links Panel */
.right-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 750px;
  height: 100%;
}

.match-link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.match-link-item {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}

.match-link-item-unmatched {
  border-color: #c9daf8;
  background: linear-gradient(180deg, #fcfeff 0%, #f4f8ff 100%);
}

.match-link-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.match-link-header-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.match-link-source {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-link-bk-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-title);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-link-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.match-link-status.status-auto {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.match-link-status.status-confirmed {
  background: #dbeafe;
  color: #1e40af;
}

.match-link-status.status-unmatched {
  background: #f3f4f6;
  color: #6b7280;
}

.match-link-meta {
  font-size: 12px;
  color: var(--color-muted);
}

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

.match-link-block {
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.match-link-block-bk {
  background: #f8fbff;
}

.match-link-block-pm {
  background: #fbfcff;
}

.match-link-block-title {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-link-block-name {
  color: var(--color-title);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-link-block-teams {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--color-text);
  font-size: 12px;
}

.match-link-block-meta {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.35;
}

.match-link-block-link {
  align-self: flex-start;
  color: var(--color-primary-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.match-link-block-link:hover {
  text-decoration: underline;
}

.match-link-comparison-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-link-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.match-link-chip-confidence {
  background: #edf4ff;
  color: #1e40af;
  border-color: #cfe0ff;
}

.match-link-chip-time {
  background: #f7f9fc;
}

.badge-match {
  background: var(--color-success-bg);
  border-color: #bce7cf;
  color: var(--color-success-text);
}

.badge-mismatch {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.badge-neutral {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #4b5563;
}

.match-link-feedback {
  border: 1px solid #d6e3f8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f7fbff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-link-feedback-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.match-link-feedback-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-link-feedback-text {
  color: var(--color-text);
  font-size: 12px;
  line-height: 1.4;
}

.match-link-feedback-hint {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

.match-link-feedback-hint a {
  color: var(--color-primary-2);
  font-weight: 600;
  text-decoration: none;
}

.match-link-feedback-hint a:hover {
  text-decoration: underline;
}

.alias-status-linked {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #166534;
}

.alias-status-partial {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.alias-status-manual {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.alias-status-skipped {
  border-color: #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
}

.alias-status-neutral {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.match-link-confirm-btn {
  align-self: flex-start;
  padding: 6px 12px;
  border: 1px solid rgba(30, 64, 175, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.match-link-confirm-btn:hover:not(:disabled) {
  border-color: rgba(30, 64, 175, 0.32);
  box-shadow: 0 6px 14px rgba(30, 64, 175, 0.12);
  transform: translateY(-1px);
}

.match-link-confirm-btn:focus-visible {
  outline: 2px solid rgba(30, 64, 175, 0.35);
  outline-offset: 2px;
}

.match-link-confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 4-column layout for match links panel */
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .right-panel {
    min-height: 600px;
  }
}

@media (max-width: 1360px) {
  .right-panel {
    min-height: 300px;
    height: auto;
  }
}

@media (max-width: 1100px) {
  .right-panel {
    min-height: auto;
    height: auto;
  }

  .match-link-body {
    grid-template-columns: 1fr;
  }
}

/* AVG column */
.odds-col-avg-header {
  background: #edf4ff;
  color: #3a5a8a;
  text-align: center;
  border-left: 1px solid #d9e4f5;
}

.odds-col-avg {
  text-align: right;
  color: #4a6080;
  border-left: 1px solid #d9e4f5;
}

/* Deviation row */
.odds-row-deviation td {
  border-top: 1px solid #e8eff8;
  padding: 2px 7px;
  background: transparent;
}

.odds-dev-label {
  font-size: 10px;
  color: #8a9ab5;
  font-style: italic;
}

.odds-dev-value {
  font-size: 11px;
  font-weight: 600;
  color: #2a3a52;
}

/* PM deviation chips */
.dev-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.6;
  border: 1px solid transparent;
}

.pm-dev-yellow      { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.pm-dev-light-green { background: #dcfce7; color: #166534; border-color: #86efac; }
.pm-dev-green       { background: #bbf7d0; color: #14532d; border-color: #4ade80; }
.pm-dev-anomaly     {
  background: #bbf7d0;
  color: #14532d;
  border-color: #16a34a;
  animation: anomaly-pulse 1.5s ease-in-out infinite;
}

@keyframes anomaly-pulse {
  0%, 100% { border-color: #16a34a; box-shadow: none; }
  50%       { border-color: #15803d; box-shadow: 0 0 0 2px #86efac; }
}

/* ── Proxy status bar ──────────────────────────────────────────────── */
.proxy-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-family: "Inter", sans-serif;
  min-height: 38px;
  flex-wrap: wrap;
}

.proxy-status-label {
  color: #475569;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 12px;
  margin-right: 2px;
}

.proxy-provider {
  display: flex;
  align-items: center;
  gap: 6px;
}

.proxy-provider-name {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}

.proxy-divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.proxy-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: default;
  border: 1px solid transparent;
  white-space: nowrap;
}

.proxy-chip b { font-weight: 700; }

.proxy-chip-sub {
  font-size: 11px;
  color: inherit;
  opacity: .7;
  margin-left: 2px;
}

.proxy-chip-ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.proxy-chip-warn {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde68a;
}

.proxy-chip-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
  animation: proxy-danger-pulse 2s ease-in-out infinite;
}

/* per-port chips */
.proxy-ports {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.proxy-port-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: default;
  white-space: nowrap;
}

/* top-up / manage link */
.proxy-topup-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  background: #e2e8f0;
  color: #1e40af;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  transition: background .15s;
}
.proxy-topup-btn:hover { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }

/* "Пересоздать" button — same shape as topup but border emphasizes action */
.proxy-recreate-btn {
  cursor: pointer;
  font-family: inherit;
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.proxy-recreate-btn:hover:not(:disabled) { background: #fde68a; color: #78350f; border-color: #fcd34d; }
.proxy-recreate-btn:disabled { opacity: 0.6; cursor: wait; }

/* Zero-port emphasis */
.proxy-chip-zero {
  color: #dc2626;
  font-weight: 700;
}

@keyframes proxy-danger-pulse {
  0%, 100% { border-color: #fecaca; }
  50%       { border-color: #f87171; box-shadow: 0 0 0 2px #fee2e2; }
}
