:root {
  color-scheme: dark;
  --bg: #070d12;
  --bg-2: #0a141a;
  --panel: rgba(10, 20, 26, 0.88);
  --panel-solid: #0c171d;
  --panel-2: rgba(18, 34, 42, 0.9);
  --line: rgba(130, 218, 255, 0.16);
  --line-strong: rgba(130, 218, 255, 0.38);
  --text: #edf7fb;
  --muted: #91a8b4;
  --primary: #39a7ff;
  --primary-dark: #1580d0;
  --cyan: #62e6ff;
  --openai: #10a37f;
  --anthropic: #a91d48;
  --danger: #ff6b3d;
  --warning: #f4b860;
  --violet: #8b7cf6;
  --window-bg: #0f171d;
  --window-title: #15232c;
  --window-chrome: #101b22;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.26);
  --glow-cyan: 0 0 22px rgba(98, 230, 255, 0.18);
  --glow-green: 0 0 22px rgba(16, 163, 127, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(7, 13, 18, 0.94), rgba(7, 13, 18, 0.98)),
    linear-gradient(120deg, rgba(57, 167, 255, 0.08), transparent 34%, rgba(16, 163, 127, 0.07) 68%, transparent);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(rgba(98, 230, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 230, 255, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(244, 184, 96, 0.06), transparent 32%, rgba(169, 29, 72, 0.06) 66%, transparent);
  background-size: 48px 48px, 48px 48px, 100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, transparent, rgba(98, 230, 255, 0.08), transparent),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.026) 0, rgba(255, 255, 255, 0.026) 1px, transparent 1px, transparent 5px);
  opacity: 0.34;
  pointer-events: none;
}

.cyber-grid,
.scan-sweep {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.cyber-grid {
  background:
    linear-gradient(115deg, transparent 0 20%, rgba(57, 167, 255, 0.12) 20.2%, transparent 20.6% 62%, rgba(16, 163, 127, 0.08) 62.2%, transparent 62.7%),
    linear-gradient(65deg, transparent 0 42%, rgba(244, 184, 96, 0.08) 42.2%, transparent 42.8%);
  opacity: 0.5;
}

.scan-sweep {
  background: linear-gradient(180deg, transparent 0%, rgba(98, 230, 255, 0.11) 48%, transparent 52%);
  transform: translateY(-100%);
  animation: scan-sweep 8s ease-in-out infinite;
  opacity: 0.44;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel,
.modal-panel,
.table-panel,
.progress-panel,
.route-card,
.summary-grid > div,
.subscribe-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(14, 29, 36, 0.94), rgba(8, 18, 24, 0.9)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cockpit-card,
.table-panel,
.modal-panel,
.login-panel {
  isolation: isolate;
}

.cockpit-card::after,
.table-panel::after,
.modal-panel::after,
.login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(98, 230, 255, 0.12), transparent 28%),
    linear-gradient(300deg, rgba(244, 184, 96, 0.08), transparent 34%);
  opacity: 0;
  transition: opacity 220ms ease;
}

.cockpit-card:hover::after,
.table-panel:hover::after,
.modal-panel:hover::after,
.login-panel:hover::after {
  opacity: 1;
}

.cockpit-card {
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.cockpit-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 230, 255, 0.36);
  box-shadow: var(--shadow), var(--glow-cyan);
}

.card-beam {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(98, 230, 255, 0.76), transparent);
  transform: translateX(-100%);
  animation: card-beam 5.4s ease-in-out infinite;
  opacity: 0.65;
}

.login-panel {
  width: min(440px, 100%);
  padding: 30px;
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(130, 218, 255, 0.18);
  border-radius: 6px;
  background: rgba(4, 12, 17, 0.76);
  color: var(--text);
  padding: 0 11px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: rgba(145, 168, 180, 0.7);
}

input:focus,
select:focus {
  border-color: rgba(98, 230, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(98, 230, 255, 0.12), var(--glow-cyan);
  background: rgba(5, 16, 22, 0.94);
}

input[type="color"] {
  padding: 3px;
}

.primary,
.secondary,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  height: 38px;
  padding: 0 14px;
  color: var(--text);
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary {
  background: linear-gradient(135deg, rgba(57, 167, 255, 0.96), rgba(16, 163, 127, 0.88));
  color: #031015;
  box-shadow: 0 10px 22px rgba(57, 167, 255, 0.16);
}

.primary:hover {
  box-shadow: 0 0 0 1px rgba(98, 230, 255, 0.28), 0 14px 30px rgba(57, 167, 255, 0.24);
}

.secondary,
.icon-button {
  background: rgba(8, 18, 24, 0.72);
  border-color: rgba(130, 218, 255, 0.22);
  color: var(--text);
}

.secondary:hover,
.icon-button:hover {
  border-color: rgba(98, 230, 255, 0.52);
  background: rgba(18, 34, 42, 0.92);
  box-shadow: var(--glow-cyan);
}

.primary:active,
.secondary:active,
.icon-button:active,
.route-toggle-button:active,
.filter-chip:active {
  transform: translateY(1px);
}

.route-toggle-button {
  min-width: 106px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  color: #071116;
  font-weight: 900;
}

.route-toggle-button.is-on {
  background: linear-gradient(135deg, #ff875f, #f04f2f);
  border-color: rgba(255, 107, 61, 0.54);
  box-shadow: 0 0 18px rgba(255, 107, 61, 0.24);
}

.route-toggle-button.is-off {
  background: linear-gradient(135deg, #17caa0, #0b9b78);
  border-color: rgba(16, 163, 127, 0.54);
  box-shadow: var(--glow-green);
}

.route-toggle-button:disabled {
  cursor: default;
  opacity: 0.75;
}

.compact,
.compact-button {
  min-height: 30px;
  height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.error-text {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.app-shell {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 30px;
}

.guest-login {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
}

.topbar,
.panel-head,
.top-actions,
.filters,
.modal-head,
.modal-actions,
.check-row,
.brand-cluster,
.brand-signal {
  display: flex;
  align-items: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -1px 16px;
  padding: 12px 0 14px;
  background: rgba(7, 13, 18, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(130, 218, 255, 0.14);
}

.brand-cluster {
  gap: 12px;
  min-width: 280px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-version {
  flex: 0 0 auto;
  border: 1px solid rgba(98, 230, 255, 0.28);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--cyan);
  background: rgba(8, 18, 24, 0.72);
  font-size: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(98, 230, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 230, 255, 0.18), rgba(16, 163, 127, 0.08)),
    rgba(9, 22, 28, 0.84);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--glow-cyan);
}

.brand-signal {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.brand-signal span {
  height: 22px;
  border: 1px solid rgba(130, 218, 255, 0.18);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: rgba(8, 18, 24, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.top-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions select {
  width: 150px;
}

.status-deck {
  margin-bottom: 14px;
}

.progress-panel {
  padding: 16px;
  transition: padding 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.progress-panel.is-running {
  border-color: rgba(98, 230, 255, 0.42);
  box-shadow: var(--shadow-soft), 0 0 28px rgba(98, 230, 255, 0.16);
}

.progress-panel.is-running .card-beam {
  animation-duration: 2.4s;
}

.progress-head {
  width: 100%;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.progress-head:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.progress-status-copy {
  min-width: 0;
}

.progress-head strong {
  display: block;
  max-width: 960px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

.progress-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.progress-stats span {
  min-width: 54px;
  padding: 5px 9px;
  border: 1px solid rgba(130, 218, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 12, 17, 0.62);
  text-align: center;
}

.panel-chevron {
  position: relative;
  width: 30px;
  min-width: 30px !important;
  height: 30px;
  padding: 0 !important;
}

.panel-chevron::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  transform: rotate(45deg);
  transition: transform 180ms ease, top 180ms ease;
}

.progress-panel:not(.is-collapsed) .panel-chevron::before,
.route-panel:not(.is-collapsed) .route-panel-chevron::before {
  top: 11px;
  transform: rotate(225deg);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(130, 218, 255, 0.14);
  border-radius: 999px;
  background: rgba(4, 12, 17, 0.86);
}

.progress-bar {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--openai), var(--cyan), var(--primary));
  box-shadow: 0 0 22px rgba(98, 230, 255, 0.38);
  transition: width 180ms ease;
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: bar-shimmer 1.8s linear infinite;
}

.progress-details {
  display: block;
}

.progress-panel.is-collapsed {
  padding: 7px 12px 9px;
}

.progress-panel.is-collapsed .progress-head {
  align-items: center;
  margin-bottom: 6px;
}

.progress-panel.is-collapsed .progress-status-copy {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-panel.is-collapsed .progress-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-panel.is-collapsed .progress-details {
  display: none;
}

.progress-panel.is-collapsed .progress-track {
  height: 5px;
}

.progress-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.progress-logs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 9px;
}

.progress-logs.is-expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.log-card {
  position: relative;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px 9px 12px;
  color: var(--muted);
  background: rgba(4, 12, 17, 0.34);
  font-size: 12px;
  overflow: hidden;
}

.progress-logs.is-expanded .log-card {
  animation: card-rise 260ms ease both;
}

.progress-logs:not(.is-expanded) .log-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
}

.progress-logs:not(.is-expanded) .log-card strong {
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(130, 218, 255, 0.34);
}

.log-card.is-latest {
  background: rgba(16, 163, 127, 0.09);
}

.log-card.is-latest::before {
  background: var(--openai);
}

.log-card strong,
.log-time {
  display: block;
}

.log-card strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.log-time {
  color: var(--muted);
  white-space: nowrap;
}

.empty-log {
  grid-column: 1 / -1;
}

.route-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(260px, 0.9fr) minmax(420px, 1.55fr);
  align-items: stretch;
  gap: 14px;
  margin-bottom: 14px;
}

.route-panel-summary {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(14, 29, 36, 0.94), rgba(8, 18, 24, 0.9)),
    var(--panel);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: left;
}

.route-panel-summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.route-panel.route-live .route-panel-summary {
  border-color: rgba(16, 163, 127, 0.42);
  box-shadow: var(--shadow-soft), var(--glow-green);
}

.route-summary-main,
.route-summary-meta {
  display: flex;
  align-items: center;
  min-width: 0;
}

.route-summary-main {
  gap: 12px;
}

.route-summary-main strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-summary-meta {
  flex: 0 0 auto;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.route-panel-chevron {
  border: 1px solid rgba(130, 218, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 12, 17, 0.62);
}

.route-panel.is-collapsed {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.route-panel.is-collapsed .route-card {
  display: none;
}

.route-card {
  min-width: 0;
  padding: 16px;
}

.route-panel.route-live .route-current {
  border-color: rgba(16, 163, 127, 0.42);
  box-shadow: var(--shadow-soft), var(--glow-green);
}

.route-panel.route-live .route-current .card-beam {
  background: linear-gradient(90deg, transparent, rgba(16, 163, 127, 0.84), transparent);
}

.route-current strong {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.45;
}

.route-line,
.route-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-panel code {
  display: block;
  margin-top: 10px;
  color: var(--cyan);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.route-usage {
  display: grid;
  gap: 9px;
}

.route-usage-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(52px, 1fr));
  gap: 8px;
}

.route-usage-grid div {
  min-width: 0;
}

.route-usage-grid span,
.route-usage-last {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.route-usage-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.route-usage-last {
  margin: 0;
}

.route-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns:
    minmax(82px, 0.5fr)
    minmax(88px, 0.56fr)
    repeat(3, minmax(110px, 0.72fr))
    minmax(250px, 1.45fr)
    repeat(2, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-grid > div {
  min-height: 86px;
  display: grid;
  align-content: space-between;
  padding: 14px 16px;
}

.summary-card {
  position: relative;
}

.compact-summary {
  min-width: 92px;
}

.compact-metric-summary {
  min-width: 110px;
}

.summary-subline {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

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

.usage-card-head .metric-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.usage-period-switch {
  width: 148px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(130, 218, 255, 0.18);
  border-radius: 6px;
  background: rgba(4, 12, 17, 0.58);
}

.usage-period-switch button {
  height: 22px;
  min-width: 0;
  border: 0;
  border-right: 1px solid rgba(130, 218, 255, 0.12);
  padding: 0 3px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 900;
}

.usage-period-switch button:last-child {
  border-right: 0;
}

.usage-period-switch button:hover,
.usage-period-switch button.is-active {
  color: #031015;
  background: var(--cyan);
}

.usage-summary-card {
  overflow: visible !important;
  cursor: help;
}

.usage-summary-card:hover,
.usage-summary-card:focus-within {
  z-index: 100;
  transform: none;
}

.history-card.usage-summary-tooltip {
  z-index: 120;
  width: 330px;
}

.usage-hover:hover .history-card,
.usage-hover:focus-within .history-card {
  opacity: 1;
  transform: translateY(0);
}

.usage-ranking {
  display: grid;
  gap: 5px;
}

.usage-ranking-row,
.usage-ranking-labels {
  display: grid;
  grid-template-columns: 24px minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-bottom: 1px solid rgba(130, 218, 255, 0.1);
  padding: 5px 0;
  font-size: 11px;
}

.usage-ranking-labels {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.usage-ranking-row:last-child {
  border-bottom: 0;
}

.usage-summary-tooltip .history-card-head strong {
  font-size: 13px;
}

.usage-summary-tooltip .usage-ranking-row strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-ranking-row em {
  color: var(--cyan);
  font-style: normal;
  white-space: nowrap;
}

.usage-rank,
.usage-ranking-empty {
  color: var(--muted);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(98, 230, 255, 0.82), transparent);
}

.summary-card.accent-good::before {
  background: linear-gradient(90deg, transparent, rgba(16, 163, 127, 0.94), transparent);
}

.metric-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.summary-grid strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  text-shadow: 0 0 14px rgba(98, 230, 255, 0.12);
}

.subscribe-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: start;
  gap: 14px;
  padding: 16px;
  margin-bottom: 18px;
}

.subscribe-title strong,
.subscribe-label {
  display: block;
}

.subscribe-forms {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 12px;
}

.subscribe-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(130, 218, 255, 0.1);
  border-radius: 8px;
  background: rgba(4, 12, 17, 0.2);
}

.subscribe-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.subscribe-actions input {
  width: 320px;
}

.subscribe-actions #subscribeEmail,
.subscribe-actions #unsubscribeEmail {
  width: min(420px, 100%);
}

.subscribe-actions #subscribeCode {
  width: 90px;
}

.danger-button {
  border-color: rgba(255, 107, 61, 0.34);
  color: #ff946f;
}

.danger-button:hover {
  background: rgba(255, 107, 61, 0.12);
}

.workspace {
  display: block;
}

.table-panel {
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(14, 29, 36, 0.94), rgba(8, 18, 24, 0.92)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.table-head {
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(130, 218, 255, 0.12);
}

.filters {
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.filters select {
  width: 150px;
  flex: 0 0 150px;
}

.primary-filters {
  flex: 0 0 auto;
  max-width: none;
}

.primary-filters input[type="search"] {
  width: 330px;
  flex: 0 0 330px;
}

.primary-filters button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.quick-filter-bar {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  padding: 0;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(130, 218, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 12, 17, 0.6);
  color: var(--muted);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.filter-chip:hover {
  border-color: rgba(98, 230, 255, 0.48);
  background: rgba(18, 34, 42, 0.86);
  box-shadow: var(--glow-cyan);
}

.filter-chip.is-active {
  border-color: rgba(16, 163, 127, 0.5);
  background: rgba(16, 163, 127, 0.12);
  color: #8ef1d6;
  box-shadow: var(--glow-green);
}

.site-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(130, 218, 255, 0.14);
  border-left: 5px solid var(--site-color, var(--primary));
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 12, 17, 0.48);
}

.site-card header,
.site-card footer,
.site-flags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-card header {
  justify-content: space-between;
}

.site-card h3 {
  margin: 0;
  font-size: 15px;
}

.site-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.site-card footer {
  justify-content: space-between;
}

.compact-site {
  min-height: 82px;
}

.manager-panel {
  width: min(900px, 100%);
}

.modal-panel.visitor-panel {
  width: min(1180px, calc(100vw - 56px));
}

.visitor-modal-body {
  display: grid;
  gap: 14px;
}

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

.visitor-summary-item {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid rgba(98, 230, 255, 0.18);
  border-radius: 8px;
  background: rgba(4, 12, 17, 0.5);
}

.visitor-summary-item span,
.visitor-stat-row span {
  color: var(--muted);
  font-size: 11px;
}

.visitor-summary-item strong {
  color: #f1fbff;
  font-size: 22px;
}

.visitor-summary-admin {
  border-color: rgba(246, 196, 83, 0.42);
  background: rgba(246, 196, 83, 0.08);
}

.visitor-summary-admin strong {
  color: #f6c453;
}

.visitor-stats-list {
  display: grid;
  gap: 8px;
}

.visitor-stat-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(84px, 0.55fr) minmax(135px, 1fr) minmax(135px, 1fr) minmax(180px, 1.4fr);
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(130, 218, 255, 0.14);
  border-radius: 8px;
  background: rgba(4, 12, 17, 0.44);
}

.visitor-stat-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.visitor-stat-row strong,
.visitor-stat-row code {
  min-width: 0;
  color: #dcecf5;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.visitor-ip-cell code {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
}

.visitor-admin-row {
  border-color: rgba(246, 196, 83, 0.48);
  background: linear-gradient(90deg, rgba(246, 196, 83, 0.12), rgba(4, 12, 17, 0.5) 42%);
  box-shadow: inset 3px 0 0 #f6c453;
}

.visitor-admin-row .visitor-ip-cell code {
  color: #f6c453;
}

.visitor-admin-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 5px;
  padding: 0 6px;
  border: 1px solid rgba(246, 196, 83, 0.46);
  border-radius: 8px;
  background: rgba(246, 196, 83, 0.12);
  color: #f6c453;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.visitor-stat-row strong small {
  display: block;
  margin-top: 2px;
  color: #f6c453;
  font-size: 10px;
  font-weight: 700;
}

.visitor-agent-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visitor-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
}

.email-panel {
  width: min(800px, 100%);
}

.subscription-manager {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(130, 218, 255, 0.14);
}

.compact-head {
  margin-bottom: 10px;
}

.modal-body .compact-head {
  margin: 0 0 10px;
  padding-right: 10px;
  border: 1px solid rgba(130, 218, 255, 0.14);
  border-radius: 6px;
}

.subscription-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
}

.guest-push-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.guest-push-control select {
  width: 128px;
  height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

.subscription-head-actions button {
  min-width: 106px;
  white-space: nowrap;
}

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

.subscription-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(130, 218, 255, 0.14);
  border-radius: 8px;
  background: rgba(4, 12, 17, 0.44);
}

.subscription-row strong,
.subscription-row span {
  display: block;
}

.subscription-row span,
.muted-line {
  color: var(--muted);
  font-size: 12px;
}

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

.manager-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(180deg, rgba(18, 31, 39, 0.96), rgba(12, 22, 29, 0.96));
}

.visitor-period-filter {
  width: 140px;
  margin-left: auto;
}

.visitor-period-filter + #reloadVisitorStatsBtn {
  margin-left: 10px;
}

.modal-sticky-zone {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(130, 218, 255, 0.2);
  background: var(--window-title);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-sticky-zone .modal-head {
  margin-bottom: 0;
}

.modal-sticky-zone .manager-toolbar,
.modal-sticky-zone .check-row {
  margin-bottom: 0;
}

.modal-sticky-zone .check-row {
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(180deg, rgba(18, 31, 39, 0.96), rgba(12, 22, 29, 0.96));
}

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

.text-button {
  border: 0;
  background: transparent;
  color: var(--cyan);
  padding: 0;
  font-weight: 900;
}

.text-button:hover {
  color: #fff;
}

.route-active {
  color: var(--openai);
}

.route-button {
  min-width: 78px;
  min-height: 32px;
  border: 1px solid rgba(57, 167, 255, 0.34);
  border-radius: 8px;
  background: rgba(57, 167, 255, 0.1);
  color: #8bd3ff;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.route-button:hover {
  border-color: rgba(98, 230, 255, 0.68);
  background: rgba(57, 167, 255, 0.16);
  box-shadow: var(--glow-cyan);
}

.route-button.route-active {
  border-color: transparent;
  background: rgba(16, 163, 127, 0.16);
  color: #8ef1d6;
}

.route-button:disabled {
  cursor: default;
  opacity: 1;
}

.test-button {
  min-width: 58px;
}

.test-button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-color: rgba(98, 230, 255, 0.68);
  background: rgba(57, 167, 255, 0.18);
  box-shadow: 0 0 18px rgba(98, 230, 255, 0.18);
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(130, 218, 255, 0.32);
  border-top-color: #62e6ff;
  border-right-color: transparent;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(98, 230, 255, 0.34);
  animation: spin 0.55s linear infinite;
}

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

.platform-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.platform-openai {
  border-color: rgba(16, 163, 127, 0.32);
  background: rgba(16, 163, 127, 0.12);
  color: #8ef1d6;
}

.platform-anthropic {
  border-color: rgba(169, 29, 72, 0.34);
  background: rgba(169, 29, 72, 0.14);
  color: #ff95b6;
}

.status-pill {
  border-color: rgba(130, 218, 255, 0.16);
  background: rgba(130, 218, 255, 0.08);
  color: var(--muted);
}

.status-active {
  border-color: rgba(16, 163, 127, 0.32);
  background: rgba(16, 163, 127, 0.12);
  color: #8ef1d6;
}

.status-error {
  border-color: rgba(255, 107, 61, 0.34);
  background: rgba(255, 107, 61, 0.12);
  color: #ff946f;
}

.table-wrap {
  overflow: auto;
  max-height: min(700px, calc(100vh - 280px));
  padding: 0 16px 16px;
}

table {
  width: 100%;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid rgba(130, 218, 255, 0.1);
  padding: 11px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(8, 18, 24, 0.96);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 -1px 0 rgba(130, 218, 255, 0.16);
}

.recommendation-cell {
  width: 128px;
  min-width: 128px;
  text-align: center;
}

td {
  background: rgba(7, 16, 21, 0.74);
  transition: background 160ms ease, color 160ms ease;
}

tbody tr:hover td {
  background: rgba(18, 34, 42, 0.86);
}

.row-ok td:first-child {
  box-shadow: inset 3px 0 0 rgba(16, 163, 127, 0.58);
}

.row-warn td:first-child {
  box-shadow: inset 3px 0 0 rgba(255, 107, 61, 0.54);
}

.dense-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.dense-table .table-wrap {
  max-height: min(780px, calc(100vh - 240px));
}

.route-selected-row td {
  background: rgba(16, 163, 127, 0.12);
}

.route-selected-row td:first-child {
  border-radius: 8px 0 0 8px;
}

.route-selected-row td:last-child {
  border-radius: 0 8px 8px 0;
}

.route-selected-row .rate-strong {
  color: var(--site-color, var(--cyan));
}

.refresh-active-row {
  background:
    linear-gradient(
      90deg,
      rgba(9, 30, 34, 0) 0%,
      rgba(9, 30, 34, 0) 34%,
      rgba(98, 230, 255, 0.08) 44%,
      rgba(16, 163, 127, 0.22) 50%,
      rgba(98, 230, 255, 0.08) 56%,
      rgba(9, 30, 34, 0) 66%,
      rgba(9, 30, 34, 0) 100%
    ),
    rgba(9, 30, 34, 0.9);
  background-size: 260% 100%;
  animation: refresh-row-flow 1.25s linear infinite;
}

.refresh-active-row td {
  background: transparent;
}

.refresh-active-row td:first-child {
  box-shadow: inset 3px 0 0 #62e6ff, 0 0 18px rgba(98, 230, 255, 0.08);
}

.rank {
  color: var(--muted);
  font-weight: 900;
}

.top-rate-row .rank {
  color: var(--warning);
}

.top-rate-row .rate-strong {
  color: #8ef1d6;
}

.route-selected-row.top-rate-row .rate-strong {
  color: var(--site-color, var(--cyan));
}

.site-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--site-color, var(--primary));
  box-shadow: 0 0 14px var(--site-color, var(--primary));
}

.site-link {
  color: var(--text);
  text-decoration: none;
}

.site-link:hover {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.history-hover {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: visible;
}

.history-card {
  position: fixed;
  left: var(--history-left, 12px);
  top: var(--history-top, 12px);
  z-index: 80;
  width: 260px;
  max-width: calc(100vw - 24px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(98, 230, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 28, 36, 0.98), rgba(5, 14, 19, 0.98)),
    #081218;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.46), 0 0 24px rgba(98, 230, 255, 0.12);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  transform: translateY(5px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.history-hover:hover .history-card,
.history-hover:focus-within .history-card {
  opacity: 1;
  transform: translateY(0);
}

.history-card-head,
.history-metrics,
.history-axis,
.history-foot,
.history-empty {
  display: flex;
}

.history-card-head {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-card-head strong {
  font-size: 13px;
}

.history-card-head em {
  color: var(--cyan);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.history-metrics {
  flex-wrap: wrap;
  gap: 6px;
}

.history-metrics span {
  border: 1px solid rgba(130, 218, 255, 0.12);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(130, 218, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.history-chart {
  width: 100%;
  height: 72px;
  overflow: visible;
}

.history-grid-line {
  stroke: rgba(130, 218, 255, 0.14);
  stroke-width: 1;
}

.history-avg-line {
  stroke: rgba(244, 184, 96, 0.55);
  stroke-dasharray: 4 4;
  stroke-width: 1.4;
}

.history-line {
  fill: none;
  stroke: #62e6ff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
  filter: drop-shadow(0 0 5px rgba(98, 230, 255, 0.45));
}

.history-dot {
  fill: #8ca4af;
  stroke: rgba(5, 14, 19, 0.95);
  stroke-width: 1.4;
}

.history-dot-ok {
  fill: #8ef1d6;
}

.history-dot-fail {
  fill: #ff7a57;
}

.history-dot-unknown {
  fill: #8ca4af;
}

.history-axis {
  justify-content: space-between;
  margin-top: -7px;
  color: #8ca4af;
  font-size: 10px;
  font-weight: 800;
}

.history-foot,
.history-empty {
  color: var(--muted);
  font-size: 11px;
}

.rate-strong {
  color: #8ef1d6;
  font-size: 16px;
  font-weight: 900;
}

.trend-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 28px;
  border: 1px solid rgba(130, 218, 255, 0.18);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(8, 18, 24, 0.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.recommendation-pill {
  width: 104px;
  min-width: 104px;
  padding-inline: 0;
}

.trend-good {
  border-color: rgba(16, 163, 127, 0.42);
  background: rgba(16, 163, 127, 0.14);
  color: #8ef1d6;
}

.trend-mid {
  border-color: rgba(244, 184, 96, 0.42);
  background: rgba(244, 184, 96, 0.12);
  color: #ffd58b;
}

.trend-risk {
  border-color: rgba(255, 107, 61, 0.42);
  background: rgba(255, 107, 61, 0.12);
  color: #ffad8e;
}

.trend-muted {
  color: #9badb7;
}

.empty-row {
  height: 160px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(5, 12, 17, 0.72), rgba(0, 5, 9, 0.82)),
    rgba(3, 9, 12, 0.76);
  backdrop-filter: blur(16px) saturate(120%);
}

.modal-nested {
  z-index: 54;
  background: rgba(3, 9, 12, 0.58);
}

#visitorStatsModal {
  background: rgba(3, 10, 14, 0.34);
  backdrop-filter: blur(6px) saturate(105%);
  -webkit-backdrop-filter: blur(6px) saturate(105%);
}

.modal-panel {
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-color: rgba(150, 205, 232, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 35, 44, 0.98), rgba(13, 23, 30, 0.98) 46px, rgba(10, 18, 24, 0.98) 46px),
    var(--window-bg);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: modal-window-in 180ms ease-out;
}

.subscriber-add-panel {
  width: min(460px, 100%);
}

.admin-credentials-panel {
  width: min(520px, 100%);
}

.admin-credentials-fields {
  display: grid;
  gap: 14px;
}

.modal-panel::after {
  display: none;
}

.modal-head {
  min-height: 46px;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 0;
  padding: 0 0 0 16px;
  color: #f5fbff;
  background: linear-gradient(180deg, rgba(25, 42, 52, 0.98), rgba(16, 28, 36, 0.98));
}

.modal-panel > .modal-head {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(130, 218, 255, 0.2);
}

.modal-head h2,
.modal-head h3 {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
}

.modal-head h2::before,
.modal-head h3::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(57, 167, 255, 0.98), rgba(98, 230, 255, 0.72)),
    #39a7ff;
  box-shadow: 0 0 12px rgba(57, 167, 255, 0.26);
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.window-controls {
  align-self: stretch;
  display: flex;
  margin-left: auto;
}

.window-control {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(237, 247, 251, 0.82);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease;
  cursor: pointer;
  user-select: none;
}

.window-control:focus-visible {
  outline: 2px solid rgba(98, 230, 255, 0.72);
  outline-offset: -2px;
}

.window-controls span.window-control {
  cursor: default;
  color: rgba(237, 247, 251, 0.58);
}

.window-control:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.window-controls span.window-control:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(237, 247, 251, 0.74);
}

.window-close:hover {
  background: #e81123;
  color: #fff;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
  background:
    linear-gradient(180deg, rgba(10, 18, 24, 0.98), rgba(8, 16, 21, 0.98)),
    var(--window-bg);
  scrollbar-color: rgba(130, 218, 255, 0.38) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.modal-body::-webkit-scrollbar {
  width: 12px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.modal-body::-webkit-scrollbar-thumb {
  border: 3px solid rgba(10, 18, 24, 0.98);
  border-radius: 999px;
  background: rgba(130, 218, 255, 0.34);
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(130, 218, 255, 0.52);
}

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

.platform-rate-filter {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(130, 218, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 12, 17, 0.46);
}

.platform-rate-head {
  min-width: 76px;
  display: grid;
  gap: 2px;
}

.platform-rate-head span {
  font-size: 13px;
  font-weight: 800;
}

.platform-rate-head small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.platform-rate-openai {
  border-color: rgba(16, 163, 127, 0.3);
}

.platform-rate-openai .platform-rate-head span {
  color: #8ef1d6;
}

.platform-rate-anthropic {
  border-color: rgba(169, 29, 72, 0.34);
}

.platform-rate-anthropic .platform-rate-head span {
  color: #ff95b6;
}

.platform-rate-range {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.platform-rate-range input {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
}

.platform-rate-range > span {
  color: var(--muted);
  font-size: 11px;
}

.check-row {
  gap: 18px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid rgba(130, 218, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(18, 31, 39, 0.96), rgba(12, 22, 29, 0.98)),
    var(--window-chrome);
  box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.18);
}

.route-switch-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 9, 12, 0.84);
  backdrop-filter: blur(12px);
  cursor: wait;
}

.route-switch-panel {
  width: min(440px, 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(98, 230, 255, 0.34);
  border-radius: 8px;
  background: rgba(10, 20, 26, 0.94);
  box-shadow: var(--shadow), var(--glow-cyan);
}

.route-switch-panel h2 {
  margin-bottom: 4px;
}

.route-switch-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.route-spinner {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 4px solid rgba(130, 218, 255, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 20, 26, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.toast-success {
  border-color: rgba(16, 163, 127, 0.4);
  color: #8ef1d6;
}

.toast-error {
  border-color: rgba(255, 107, 61, 0.4);
  color: #ff946f;
}

@keyframes scan-sweep {
  0% {
    transform: translateY(-100%);
  }
  52% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes card-beam {
  0%,
  64% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(105%);
  }
}

@keyframes bar-shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes refresh-row-flow {
  0% {
    background-position: 160% 50%;
  }
  100% {
    background-position: -60% 50%;
  }
}

@keyframes modal-window-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .route-panel {
    grid-template-columns: 1fr;
  }
}

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

  .progress-logs.is-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subscribe-panel,
  .subscribe-forms {
    grid-template-columns: 1fr;
  }

  .table-head,
  .filters,
  .quick-filter-bar {
    flex-wrap: wrap;
  }

  .primary-filters {
    flex: 1 1 100%;
  }

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

  .visitor-ip-cell,
  .visitor-agent-cell {
    grid-column: span 3;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1500px);
  }

  .summary-grid,
  .form-grid,
  .manager-site-list,
  .visitor-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .modal-panel.visitor-panel {
    width: 100%;
  }

  .visitor-ip-cell,
  .visitor-agent-cell {
    grid-column: span 2;
  }

  .brand-cluster {
    align-items: flex-start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .filters,
  .top-actions {
    width: 100%;
  }

  .filters select,
  .primary-filters input[type="search"],
  .top-actions select,
  .top-actions button,
  .filters button {
    flex: 1 1 140px;
  }

  .subscribe-actions input,
  .subscribe-actions #subscribeEmail,
  .subscribe-actions #unsubscribeEmail,
  .subscribe-actions button {
    width: 100%;
  }

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

  .route-panel-summary {
    gap: 8px;
  }

  .route-summary-main .metric-label,
  .route-summary-meta > span:first-child {
    display: none;
  }

  .progress-head {
    display: grid;
  }

  .progress-panel.is-collapsed .progress-head {
    display: flex;
    gap: 8px;
  }

  .progress-panel.is-collapsed .progress-stats {
    gap: 5px;
  }

  .progress-panel.is-collapsed .progress-stats span {
    min-width: 46px;
    padding-inline: 6px;
  }

  .progress-stats {
    justify-content: space-between;
  }

  .progress-logs,
  .progress-logs.is-expanded {
    grid-template-columns: 1fr;
  }

  .progress-logs:not(.is-expanded) .log-card {
    display: grid;
    gap: 3px;
  }

  .progress-logs:not(.is-expanded) .log-card strong {
    white-space: normal;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .modal-head {
    min-height: 42px;
    padding-left: 12px;
  }

  .window-control {
    width: 40px;
    min-width: 40px;
    height: 42px;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions button {
    width: 100%;
  }

  .subscription-head-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .modal-body .compact-head {
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
  }

  .guest-push-control {
    width: 100%;
    margin-left: 0;
  }

  .guest-push-control select {
    flex: 1 1 auto;
    width: auto;
  }

  .subscription-head-actions button {
    flex: 1 1 120px;
    min-width: 0;
  }
}

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