@import url("https://fonts.googleapis.com/css2?family=Fjalla+One&display=swap");

:root {
  --bg: #0d1117;
  --bg-soft: #111826;
  --surface: rgba(16, 24, 40, 0.86);
  --surface-strong: rgba(20, 29, 48, 0.96);
  --border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #8aa05c;
  --accent-2: #5f7f48;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

body.theme-light {
  --bg: #eef2e4;
  --bg-soft: #fbfcf5;
  --surface: rgba(250, 252, 244, 0.86);
  --surface-strong: rgba(255, 255, 248, 0.96);
  --border: rgba(76, 93, 58, 0.12);
  --text: #1f2a1d;
  --muted: #6d7a5d;
  --accent: #527a3f;
  --accent-2: #8aa05c;
  --shadow: 0 20px 48px rgba(70, 84, 48, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(138, 160, 92, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(82, 122, 63, 0.1), transparent 22%),
    linear-gradient(180deg, #0d1117 0%, #0c1216 48%, #0b1014 100%),
    var(--bg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
}

body.theme-light {
  background:
    radial-gradient(circle at top left, rgba(138, 160, 92, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(82, 122, 63, 0.12), transparent 24%),
    linear-gradient(180deg, #f8faf0 0%, #eef2e4 48%, #e7eddc 100%),
    var(--bg);
}

a {
  color: #b9ca8a;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
strong,
label,
div,
button,
input,
select {
  color: inherit;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(1680px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 20px 0 40px;
  position: relative;
}

.home-splash {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
  padding: 40px 0 24px;
}

.home-splash-card {
  width: min(760px, calc(100vw - 32px));
  padding: 34px 32px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(18, 27, 42, 0.94), rgba(13, 19, 30, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow);
  text-align: center;
}

body.theme-light .home-splash-card {
  background: linear-gradient(180deg, rgba(255, 255, 248, 0.96), rgba(244, 248, 236, 0.92));
  border-color: rgba(76, 93, 58, 0.14);
}

.home-splash-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-splash-title {
  margin: 0 0 16px;
  font-family: "Fjalla One", ui-sans-serif, sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: 0.02em;
}

.home-splash-copy {
  width: min(560px, 100%);
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.home-splash-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.home-splash-action {
  min-width: 220px;
}

.label-with-info,
.head-with-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.head-with-info {
  justify-content: center;
}

.info-tip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-tip-button {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.34);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.info-tip-wrap-open .info-tip-button,
.info-tip-button:focus-visible {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .info-tip-button {
  background: rgba(255, 255, 248, 0.95);
  border-color: rgba(76, 93, 58, 0.14);
}

.info-tip-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  width: min(280px, calc(100vw - 24px));
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(9, 13, 20, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.5;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  z-index: 140;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-weight: 400 !important;
}

.info-tip-wrap-open .info-tip-popover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.info-tip-wrap-popover-left .info-tip-popover {
  left: 0;
  bottom: calc(100% + 10px);
  transform: translateX(0) translateY(6px);
}

.info-tip-wrap-open.info-tip-wrap-popover-left .info-tip-popover {
  transform: translateX(0) translateY(0);
}

.info-tip-wrap-popover-right .info-tip-popover {
  left: auto;
  right: 0;
  bottom: calc(100% + 10px);
  transform: translateX(0) translateY(6px);
}

.info-tip-wrap-open.info-tip-wrap-popover-right .info-tip-popover {
  transform: translateX(0) translateY(0);
}

.info-tip-wrap-popover-below .info-tip-popover {
  top: calc(100% + 10px);
  bottom: auto;
}

body.theme-light .info-tip-popover {
  background: rgba(255, 255, 248, 0.98);
  border-color: rgba(76, 93, 58, 0.14);
}

.scanner-note-card {
  margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(22, 32, 49, 0.94), rgba(15, 22, 34, 0.9));
}

body.theme-light .scanner-note-card {
  background: linear-gradient(180deg, rgba(255, 255, 248, 0.98), rgba(243, 247, 235, 0.96));
}

.scanner-note-card-demo {
  border-color: rgba(138, 160, 92, 0.32);
}

.scanner-note-kicker {
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scanner-note-copy {
  font-size: 0.98rem;
  line-height: 1.55;
}

.scanner-note-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-state-explained {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.empty-state-explained strong {
  font-size: 1rem;
}

.empty-state-explained span {
  color: var(--muted);
  line-height: 1.6;
}

.settings-inline-note {
  margin: 10px 0 0;
}

.island-nav,
.status-bar,
.hero-grid,
.card,
.table-head,
.table-row {
  backdrop-filter: blur(14px);
}

.island-nav {
  width: fit-content;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(10, 10, 11, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

body.theme-light .island-nav {
  background: rgba(250, 252, 244, 0.82);
  border-color: rgba(76, 93, 58, 0.1);
  box-shadow: 0 14px 36px rgba(70, 84, 48, 0.12);
}

body.theme-light .island-link {
  color: rgba(31, 42, 29, 0.72);
}

body.theme-light .island-link:hover {
  color: #1f2a1d;
}

body.theme-light .island-link-active,
body.theme-light .island-link-settings {
  background: rgba(82, 122, 63, 0.14);
  color: #3f612f;
}

.island-link {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-rendering: optimizeLegibility;
}

.island-link:hover {
  text-decoration: none;
  color: white;
}

.island-link-disabled,
.island-link-disabled:hover {
  color: rgba(255, 255, 255, 0.32);
  cursor: not-allowed;
  text-decoration: none;
  opacity: 0.72;
}

body.theme-light .island-link-disabled,
body.theme-light .island-link-disabled:hover {
  color: rgba(31, 42, 29, 0.34);
}

.brand-corner {
  position: absolute;
  top: 20px;
  left: 0;
  z-index: 18;
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-corner:hover {
  text-decoration: none;
  color: var(--text);
}

body.theme-light .brand-corner {
  color: var(--text);
}

.brand-corner-logo {
  width: 48px;
  height: 48px;
  display: block;
  border: 0;
  object-fit: contain;
}

.brand-corner-name {
  color: var(--text);
  font-family: "Fjalla One", ui-sans-serif, sans-serif;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
}

.island-link-active,
.island-link-settings {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.island-link-settings,
.island-link-service {
  width: 40px;
  padding: 0;
}

.island-user-form {
  margin: 0;
}

.island-user-select {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 800;
}

.island-user-select span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.island-user-select select {
  max-width: 112px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.island-user-select select option {
  color: #111827;
}

.island-user-static strong {
  color: var(--text);
  font-size: 0.84rem;
}

.island-link-logout {
  min-width: 74px;
  font-size: 0.82rem;
}

body.theme-light .island-user-select {
  color: rgba(31, 42, 29, 0.78);
  background: rgba(82, 122, 63, 0.08);
  border-color: rgba(76, 93, 58, 0.1);
}

.user-popover {
  position: absolute;
  top: 20px;
  right: 0;
  z-index: 20;
}

.user-popover summary {
  list-style: none;
}

.user-popover summary::-webkit-details-marker {
  display: none;
}

.user-bubble {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 11, 0.88);
  box-shadow: var(--shadow);
  cursor: pointer;
  user-select: none;
}

body.theme-light .user-bubble {
  background: rgba(250, 252, 244, 0.88);
  border-color: rgba(76, 93, 58, 0.1);
  box-shadow: 0 14px 36px rgba(70, 84, 48, 0.12);
}

body.theme-light .user-avatar {
  background: linear-gradient(180deg, rgba(138, 160, 92, 0.94), rgba(82, 122, 63, 0.76));
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(138, 160, 92, 0.92), rgba(82, 122, 63, 0.72));
}

.user-avatar svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
}

.user-bubble-name {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.user-menu-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

body.theme-light .user-menu-card {
  background: rgba(255, 255, 248, 0.96);
  border-color: rgba(76, 93, 58, 0.12);
}

.user-menu-identity {
  display: grid;
  gap: 2px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.user-menu-identity strong {
  font-size: 0.95rem;
}

.user-menu-identity span {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.user-menu-row strong {
  color: var(--text);
  font-size: 0.84rem;
}

.user-menu-preferences {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 4px 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.user-menu-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.user-menu-toggle a {
  width: 34px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
}

.user-menu-toggle-language a,
.user-menu-toggle-theme a,
.user-menu-toggle-display a {
  width: 34px;
}

.user-menu-toggle a:hover {
  color: var(--text);
  text-decoration: none;
}

.user-menu-toggle-active {
  color: #ffffff !important;
  background: linear-gradient(180deg, #8aa05c, #527a3f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.theme-light .user-menu-toggle {
  background: rgba(82, 122, 63, 0.08);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .user-menu-toggle-active {
  background: linear-gradient(180deg, #8aa05c, #527a3f);
}

.user-theme-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-drawer {
  display: none;
}

.mobile-drawer summary {
  list-style: none;
}

.mobile-drawer summary::-webkit-details-marker {
  display: none;
}

.user-menu-action,
.user-menu-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.84rem;
}

.user-menu-action {
  color: #ffffff;
  background: linear-gradient(180deg, #8aa05c, #527a3f);
  border: 1px solid rgba(138, 160, 92, 0.34);
}

.user-menu-action-pay {
  background: linear-gradient(180deg, #f0b34f, #d18a19);
  border-color: rgba(240, 179, 79, 0.4);
  color: #ffffff;
}

.user-menu-link {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.user-menu-action:hover,
.user-menu-link:hover {
  text-decoration: none;
  filter: brightness(1.04);
}

.settings-gear-icon,
.service-pulse-icon {
  width: 19px;
  height: 19px;
  display: block;
  opacity: 0.96;
}

.settings-gear-icon {
  fill: currentColor;
}

.service-pulse-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.island-link-settings:hover .settings-gear-icon,
.island-link-service:hover .service-pulse-icon {
  opacity: 1;
}

.status-bar {
  position: absolute;
  top: 20px;
  right: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: 0;
  z-index: 3;
}

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

.filters-rail {
  position: sticky;
  top: 12px;
  justify-self: start;
  display: block;
}

.filter-drawer {
  display: block;
}

.filter-drawer-summary {
  display: none;
}

.filter-drawer-summary::-webkit-details-marker {
  display: none;
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: visible;
  width: 302px;
  min-height: 520px;
}

.filter-drawer-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  padding: 14px 16px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  letter-spacing: 0.01em;
}

.board-shell {
  min-width: 0;
  width: 100%;
}

.frame-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.34);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.theme-light .frame-indicator {
  background: rgba(250, 252, 244, 0.92);
  border-color: rgba(76, 93, 58, 0.1);
  color: #6d7a5d;
}

.frame-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #64748b;
  flex: 0 0 auto;
}

.frame-indicator-idle .frame-indicator-dot {
  background: #4ade80;
}

.frame-indicator-loading .frame-indicator-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35);
  animation: framePulse 1.15s ease infinite;
}

.frame-indicator-stale .frame-indicator-dot {
  background: #f59e0b;
}

.frame-indicator-error .frame-indicator-dot {
  background: #fb7185;
}

.board-frame {
  min-height: 320px;
}

.board-frame-loading {
  opacity: 0.92;
}

.board-card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.board-loading-state {
  color: var(--muted);
  font-size: 0.95rem;
}

.frame-status-bar {
  margin-top: 0;
  margin-bottom: 16px;
}

@keyframes framePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.hero-grid-tight {
  grid-template-columns: 1fr;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #fb7185;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}

h1, h2 {
  margin: 0;
  letter-spacing: -0.03em;
  color: var(--text);
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.25rem;
}

.subtle {
  color: var(--muted);
}

.card,
.card h1,
.card h2,
.card h3,
.card strong,
.card p,
.card span,
.card label,
.table-head,
.table-row,
.ticker-cell,
.profit-cell,
.setting-label,
.setting-copy,
.filter-form,
.filter-form span,
.metric-card,
.metric-card span,
.metric-card strong,
.section-head,
.empty-state {
  color: var(--text);
}

.filter-form span,
.metric-card span,
.table-head,
.subtle,
.empty-state {
  color: var(--muted);
}

.link-row,
.roadmap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill,
.roadmap-item {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

.pill.soft {
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 20px;
}

body.theme-light .filter-panel,
body.theme-light .card {
  backdrop-filter: blur(18px);
}

body.theme-light .card {
  background: linear-gradient(180deg, rgba(255, 255, 248, 0.9), rgba(246, 249, 237, 0.82));
  border-color: rgba(76, 93, 58, 0.1);
}

.filter-form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 14px;
}

.range-field,
.toggle-field,
.select-field,
.preset-field {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 8px;
  padding: 10px 10px 9px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

body.theme-light .range-field,
body.theme-light .toggle-field,
body.theme-light .select-field,
body.theme-light .preset-field {
  background: rgba(246, 249, 237, 0.9);
  border-color: rgba(76, 93, 58, 0.09);
}

.toggle-field,
.select-field {
  gap: 6px;
  padding: 8px 10px;
  min-height: 0;
}

.preset-field {
  padding: 10px;
}

.preset-field .info-tip-wrap[data-tip-placement="panel-presets"],
.range-field .info-tip-wrap[data-tip-placement="panel-minspread"] {
  position: static;
}

.preset-field .info-tip-wrap[data-tip-placement="panel-presets"] .info-tip-popover,
.range-field .info-tip-wrap[data-tip-placement="panel-minspread"] .info-tip-popover {
  left: 14px;
  top: calc(100% + 10px);
  bottom: auto;
  width: min(250px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  transform: translateY(6px);
}

.preset-field .info-tip-wrap-open[data-tip-placement="panel-presets"] .info-tip-popover,
.range-field .info-tip-wrap-open[data-tip-placement="panel-minspread"] .info-tip-popover {
  transform: translateY(0);
}

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

.field-top-split {
  align-items: flex-start;
}

.field-top strong,
.toggle-field span,
.select-field span,
.preset-field > span {
  font-size: 0.82rem;
}

.preset-bubble-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.demo-notice {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.preset-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.46);
  color: rgba(226, 232, 240, 0.82);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.preset-delete-button {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.24);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.preset-delete-button:hover {
  color: #d98282;
  border-color: rgba(217, 130, 130, 0.3);
  background: rgba(217, 130, 130, 0.12);
}

.preset-bubble:hover {
  text-decoration: none;
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.24);
  transform: translateY(-1px);
}

.preset-bubble-active {
  color: #ffffff;
  border-color: rgba(74, 222, 128, 0.42);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.92), rgba(21, 128, 61, 0.76));
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body.theme-light .preset-bubble {
  background: rgba(255, 255, 248, 0.96);
  border-color: rgba(76, 93, 58, 0.12);
  color: #6d7a5d;
}

body.theme-light .preset-delete-button {
  background: rgba(239, 245, 226, 0.9);
  border-color: rgba(76, 93, 58, 0.12);
}

body.theme-light .preset-bubble-active {
  color: #ffffff;
  border-color: rgba(22, 163, 74, 0.32);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.9), rgba(21, 128, 61, 0.76));
}

.preset-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.preset-save-row input {
  width: 100%;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.34);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}

body.theme-light .preset-save-row input {
  background: rgba(255, 255, 248, 0.95);
  border-color: rgba(76, 93, 58, 0.12);
}

.preset-save-action {
  min-height: 34px;
  flex: 0 0 auto;
  font-size: 0.78rem;
}

.field-top em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.88rem;
}

.field-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 4px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.theme-light .field-input-wrap {
  background: rgba(255, 255, 248, 0.96);
  border-color: rgba(76, 93, 58, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.field-value-input {
  width: 46px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: center;
  outline: none;
  min-width: 0;
}

.stepper-btn {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.stepper-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
}

.range-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.theme-dark .range-field input[type="range"] {
  accent-color: #6b7280;
}

.range-field-locked {
  opacity: 0.76;
}

.range-field-locked input,
.range-field-locked button {
  cursor: not-allowed;
}

.range-field-locked .field-input-wrap {
  border-color: rgba(245, 158, 11, 0.18);
}

.toggle-field-locked {
  opacity: 0.72;
  cursor: not-allowed;
}

.toggle-field-locked input,
.toggle-field-locked .switch-ui {
  cursor: not-allowed;
}

.toggle-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.checkbox-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 26px;
}

.checkbox-shell input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-ui {
  position: relative;
  width: 42px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: background 140ms ease, border-color 140ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.9));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  transition: transform 140ms ease, background 140ms ease;
}

body.theme-light .stepper-btn {
  background: linear-gradient(180deg, rgba(255, 255, 248, 0.98), rgba(232, 239, 219, 0.94));
  border-color: rgba(76, 93, 58, 0.12);
}

.checkbox-shell input[type="checkbox"]:checked + .switch-ui {
  background: linear-gradient(180deg, rgba(82, 122, 63, 0.82), rgba(63, 97, 47, 0.66));
  border-color: rgba(82, 122, 63, 0.34);
}

.checkbox-shell input[type="checkbox"]:checked + .switch-ui::after {
  transform: translateX(14px);
}

.checkbox-shell input[type="checkbox"]:focus-visible + .switch-ui {
  outline: 2px solid rgba(82, 122, 63, 0.3);
  outline-offset: 2px;
}

.select-field select {
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.34);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 0.84rem;
}

body.theme-light .select-field select {
  background: rgba(255, 255, 248, 0.95);
  border-color: rgba(76, 93, 58, 0.12);
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.primary-action,
.ghost-action {
  min-height: 40px;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.84rem;
  text-align: center;
  line-height: 1.15;
  padding: 0 10px;
  font-family: inherit;
}

.primary-action {
  background: linear-gradient(180deg, #8aa05c, #527a3f);
  border-color: rgba(138, 160, 92, 0.34);
  color: white;
  cursor: pointer;
}

body.theme-light .user-menu-action,
body.theme-light .primary-action {
  background: linear-gradient(180deg, #8aa05c, #527a3f);
  border-color: rgba(82, 122, 63, 0.34);
}

body.theme-light .user-menu-action-pay {
  background: linear-gradient(180deg, #f0b34f, #d18a19);
  border-color: rgba(209, 138, 25, 0.34);
}

.ghost-action {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
  white-space: normal;
}

.ghost-action:hover {
  text-decoration: none;
}

.board-more-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.board-more-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.board-more-action {
  min-width: 180px;
  flex: 0 0 auto;
}

.board-mobile-sort {
  display: none;
}

.danger-action {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.08);
}

.danger-action:hover {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.14);
}

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

.metric-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric-card strong {
  font-size: 1.35rem;
}

.board-card {
  padding-top: 18px;
  background: linear-gradient(180deg, rgba(18, 27, 44, 0.94), rgba(15, 22, 36, 0.9));
}

body.theme-light .board-card {
  background: linear-gradient(180deg, rgba(255, 255, 248, 0.94), rgba(240, 245, 229, 0.88));
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 0 4px 2px;
}

.arb-table-head,
.arb-row,
.arb-variant-row {
  display: grid;
  grid-template-columns: 1.62fr 0.88fr 0.88fr 0.82fr 0.9fr 0.78fr 0.98fr 1.42fr 0.66fr;
  gap: 12px;
  align-items: stretch;
}

.arb-row .tv-symbol-chip {
  font-size: 0.65rem;
}

.arb-table-head {
  color: var(--muted);
  font-size: 0.84rem;
  padding: 0 12px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: center;
}

.sort-head-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 900;
  text-align: center;
  transition: color 140ms ease;
}

.sort-head-link:hover,
.sort-head-active {
  color: #b9ca8a;
  text-decoration: none;
}

body.theme-light .sort-head-link:hover,
body.theme-light .sort-head-active {
  color: #527a3f;
}

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

.arb-group {
  display: grid;
  gap: 6px;
}

.arb-row {
  padding: 14px 12px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

body.theme-light .arb-row {
  background: rgba(250, 252, 244, 0.9);
  border-color: rgba(76, 93, 58, 0.08);
}

.arb-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.16);
  transform: translateY(-1px);
}

body.theme-light .arb-row:hover {
  background: rgba(255, 255, 248, 0.98);
  border-color: rgba(82, 122, 63, 0.16);
}

.arb-variant-list {
  display: none;
  gap: 4px;
}

.arb-group.group-open .arb-variant-list {
  display: grid;
}

.arb-variant-row {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.07);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.24);
}

body.theme-light .arb-variant-row {
  background: rgba(247, 250, 239, 0.84);
  border-color: rgba(76, 93, 58, 0.08);
}

.arb-cell {
  min-width: 0;
}

.mobile-cell-label {
  display: none;
}

.arb-table-head span:first-child,
.arb-table-head span:last-child {
  text-align: left;
}

.ticker-block,
.profit-block,
.tv-block,
.actions-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ticker-name {
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}

.ticker-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  position: relative;
}

.group-toggle-chip {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.42);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

.group-toggle-chip:hover,
.arb-group.group-open .group-toggle-chip {
  background: rgba(138, 160, 92, 0.12);
  border-color: rgba(138, 160, 92, 0.24);
  color: #b9ca8a;
  transform: translateY(-1px);
}

body.theme-light .group-toggle-chip {
  background: rgba(255, 255, 248, 0.94);
  border-color: rgba(76, 93, 58, 0.12);
}

body.theme-light .group-toggle-chip:hover,
body.theme-light .arb-group.group-open .group-toggle-chip {
  background: rgba(82, 122, 63, 0.1);
  border-color: rgba(82, 122, 63, 0.22);
  color: #527a3f;
}

.group-toggle-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.arb-group.group-open .group-toggle-icon {
  transform: rotate(90deg);
}

.variant-ticker-cell {
  flex-direction: row;
  align-items: center;
}

.variant-actions-cell {
  min-height: 1px;
}

.price-warning-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.price-warning-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(15, 23, 42, 0.42);
  color: #fb7185;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

.price-warning-button:hover,
.price-warning-wrap.warning-open .price-warning-button {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.34);
  transform: translateY(-1px);
}

body.theme-light .price-warning-button {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(185, 28, 28, 0.14);
}

body.theme-light .price-warning-button:hover,
body.theme-light .price-warning-wrap.warning-open .price-warning-button {
  background: rgba(254, 242, 242, 0.98);
  border-color: rgba(185, 28, 28, 0.24);
}

.price-warning-icon {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 15px solid currentColor;
  position: relative;
  display: inline-block;
  transform: translateY(-1px);
}

.price-warning-icon::after {
  content: "!";
  position: absolute;
  left: -2px;
  top: 5px;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 1000;
  line-height: 1;
}

.price-warning-popover {
  position: absolute;
  z-index: 12;
  left: 42px;
  top: 50%;
  transform: translateY(-50%) scale(0.98);
  width: 280px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.34);
  background: rgba(24, 10, 14, 0.98);
  color: #fee2e2;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.price-warning-wrap:hover .price-warning-popover,
.price-warning-wrap.warning-open .price-warning-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

body.theme-light .price-warning-popover {
  background: rgba(255, 248, 248, 0.98);
  color: #991b1b;
  border-color: rgba(185, 28, 28, 0.22);
  box-shadow: 0 18px 42px rgba(127, 29, 29, 0.16);
}

.direction-pill,
.copy-chip,
.favorite-chip,
.blacklist-chip,
.hide-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}

.signal-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ticker-meta-row {
  gap: 5px;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 4px 10px;
  width: fit-content;
  min-height: 0;
  border-width: 1px;
  border-style: solid;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}

.volume-pill {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.28);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stale-pill {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.24);
}

.signal-new {
  border-color: rgba(185, 202, 138, 0.34);
  background: rgba(185, 202, 138, 0.13);
  color: #b9ca8a;
}

.signal-live {
  border-color: rgba(172, 154, 112, 0.36);
  background: rgba(172, 154, 112, 0.14);
  color: #c8b98d;
}

.signal-stable {
  border-color: rgba(96, 187, 128, 0.34);
  background: rgba(96, 187, 128, 0.13);
  color: #86c99a;
}

.numeric-cell {
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.numeric-cell-stack {
  display: grid;
  grid-template-rows: 36px 42px;
  align-items: center;
  justify-items: center;
  align-content: start;
  gap: 6px;
}

.compact-exchange-label {
  display: none;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.compact-exchange-long {
  color: #86c99a;
}

.compact-exchange-short {
  color: #d98282;
}

.spread-good {
  color: #86c99a;
  font-weight: 700;
  font-size: 1.02rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.spread-cell {
  display: grid;
  grid-template-rows: 36px 42px;
  align-items: center;
  justify-items: center;
  align-content: start;
  gap: 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.spread-main {
  color: #86c99a;
  font-size: 1.02rem;
  font-weight: 800;
  white-space: nowrap;
}

.net-spread-pill {
  min-width: 68px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 8px;
  border-radius: 13px;
  border: 1px solid rgba(96, 187, 128, 0.22);
  background: rgba(96, 187, 128, 0.1);
  color: #86c99a;
  line-height: 1;
}

.net-spread-pill span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.net-spread-pill strong {
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.volume-cell {
  display: grid;
  grid-template-rows: 36px 42px;
  align-items: center;
  justify-items: center;
  align-content: start;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.profit-value {
  color: #86c99a;
  font-size: 1.15rem;
}

.profit-block {
  display: grid;
  grid-template-rows: 36px 42px;
  align-items: center;
  justify-items: center;
  align-content: start;
  text-align: center;
}

.funding-cell {
  display: grid;
  grid-template-rows: 36px 42px;
  align-items: center;
  justify-items: center;
  align-content: start;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.funding-positive-text {
  color: #d98282;
}

.funding-negative-text {
  color: #86c99a;
}

.funding-neutral-text {
  color: var(--muted);
}

.board-card .spread-good,
.board-card .spread-main,
.board-card .profit-value,
.board-card .net-spread-pill,
.board-card .net-spread-pill strong {
  color: #86c99a;
}

.board-card .volume-cell {
  color: #b9ca8a;
}

.board-card .funding-positive-text {
  color: #d98282;
}

.board-card .funding-negative-text {
  color: #86c99a;
}

.board-card .funding-neutral-text,
.board-card .net-spread-pill span {
  color: var(--muted);
}

.board-card .compact-exchange-long {
  color: #86c99a;
}

.board-card .compact-exchange-short {
  color: #d98282;
}

.direction-pill {
  padding: 4px 10px;
  width: fit-content;
}

.copy-action-pill {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;
  border: 0;
  white-space: nowrap;
}

.price-action-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 40px;
}

.exchange-pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  line-height: 1.08;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

.exchange-pill-link:hover {
  text-decoration: none;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.tv-symbol-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}

.tv-symbol-chip {
  min-height: 28px;
  min-width: 0;
  flex: 1 1 0;
  padding: 0 8px;
  font-size: 0.65rem;
  justify-content: center;
  white-space: nowrap;
}

.direction-long {
  background: rgba(96, 187, 128, 0.11);
  color: #86c99a;
  border: 1px solid rgba(96, 187, 128, 0.22);
}

.direction-short {
  background: rgba(217, 130, 130, 0.11);
  color: #d98282;
  border: 1px solid rgba(217, 130, 130, 0.22);
}

body.theme-light .signal-stable {
  border-color: rgba(82, 122, 63, 0.3);
  background: rgba(82, 122, 63, 0.1);
  color: #527a3f;
}

body.theme-light .volume-pill {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
  color: #6d7a5d;
}

body.theme-light .spread-good,
body.theme-light .spread-main,
body.theme-light .profit-value {
  color: #527a3f;
}

body.theme-light .board-card .spread-good,
body.theme-light .board-card .spread-main,
body.theme-light .board-card .profit-value,
body.theme-light .board-card .net-spread-pill,
body.theme-light .board-card .net-spread-pill strong {
  color: #527a3f;
}

body.theme-light .board-card .volume-cell {
  color: #607d47;
}

body.theme-light .board-card .compact-exchange-long {
  color: #527a3f;
}

body.theme-light .board-card .compact-exchange-short {
  color: #a95757;
}

body.theme-light .net-spread-pill {
  background: rgba(82, 122, 63, 0.1);
  border-color: rgba(82, 122, 63, 0.22);
  color: #527a3f;
}

body.theme-light .funding-negative-text {
  color: #527a3f;
}

body.theme-light .funding-positive-text {
  color: #a95757;
}

body.theme-light .direction-long {
  background: rgba(82, 122, 63, 0.1);
  color: #527a3f;
  border-color: rgba(82, 122, 63, 0.22);
}

body.theme-light .direction-short {
  background: rgba(169, 87, 87, 0.1);
  color: #a95757;
  border-color: rgba(169, 87, 87, 0.2);
}

.copy-chip,
.favorite-chip,
.blacklist-chip,
.hide-chip {
  min-height: 36px;
  padding: 0 12px;
  width: fit-content;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.42);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

body.theme-light .copy-chip,
body.theme-light .favorite-chip,
body.theme-light .blacklist-chip,
body.theme-light .hide-chip {
  background: rgba(255, 255, 248, 0.94);
  border-color: rgba(76, 93, 58, 0.12);
}

.tv-block {
  display: grid;
  grid-template-rows: 36px 42px;
  align-items: center;
  justify-content: center;
  justify-items: center;
  align-content: start;
  gap: 0;
  min-width: 0;
}

.copy-chip:hover,
.favorite-chip:hover,
.blacklist-chip:hover,
.hide-chip:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(148, 163, 184, 0.22);
  transform: translateY(-1px);
}

body.theme-light .copy-chip:hover,
body.theme-light .favorite-chip:hover,
body.theme-light .blacklist-chip:hover,
body.theme-light .hide-chip:hover {
  background: rgba(239, 245, 226, 0.98);
  border-color: rgba(82, 122, 63, 0.18);
}

.copy-chip-done {
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.favorite-chip {
  color: #fbbf24;
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.favorite-chip-active {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.blacklist-chip {
  color: #fb7185;
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.actions-block {
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: row;
}

.copy-chip-wide {
  width: 100%;
  max-width: 210px;
}

.board-card-compact .arb-row,
.board-card-compact .arb-variant-row {
  padding-top: 9px;
  padding-bottom: 9px;
}

.board-card-compact .ticker-block {
  display: grid;
  grid-template-rows: 24px 13px;
  align-content: center;
  justify-items: start;
  gap: 1px;
  justify-content: center;
}

.board-card-compact .ticker-title-row {
  min-height: 24px;
  align-self: center;
}

.board-card-compact .ticker-meta-row,
.board-card-compact .price-action-row,
.board-card-compact .net-spread-pill,
.board-card-compact .tv-symbol-row {
  display: none;
}

.board-card-compact .numeric-cell-stack,
.board-card-compact .spread-cell,
.board-card-compact .volume-cell,
.board-card-compact .profit-block,
.board-card-compact .funding-cell,
.board-card-compact .tv-block {
  grid-template-rows: 24px 13px;
  align-content: center;
  gap: 1px;
}

.board-card-compact .compact-exchange-label {
  display: inline-flex;
}

.board-card-compact .tv-block {
  grid-template-rows: 37px;
}

.board-card-compact .copy-chip-wide {
  min-height: 36px;
}

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

.service-status-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-status-card {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.24);
  text-decoration: none;
  color: var(--text);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.service-status-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.06);
}

.service-status-ok {
  border-color: rgba(74, 222, 128, 0.22);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.12), rgba(15, 23, 42, 0.2));
}

.service-status-idle {
  border-color: rgba(148, 163, 184, 0.14);
}

.service-status-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
}

.service-status-value {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

body.theme-light .service-status-card {
  background: rgba(255, 255, 248, 0.78);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .service-status-ok {
  background: linear-gradient(135deg, rgba(82, 122, 63, 0.12), rgba(255, 255, 248, 0.82));
}

.setting-block-stack {
  align-items: flex-start;
  flex-direction: column;
}

.empty-state {
  padding: 24px 8px 6px;
  color: var(--muted);
}

.settings-shell {
  display: flex;
  justify-content: center;
  padding-top: 18px;
  width: 100%;
}

.settings-card {
  width: min(1540px, 100%);
}

.settings-modal-card {
  width: min(500px, calc(100vw - 48px));
  min-width: 0;
  max-width: calc(100vw - 48px);
  max-height: min(820px, calc(100vh - 48px));
  padding: 18px;
}

.system-card {
  width: min(1180px, 100%);
}

.system-shell-wide .system-card {
  width: min(1500px, 100%);
}

.settings-grid {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

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

.settings-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.settings-title-row h1 {
  margin: 0;
}

.settings-dashboard-grid {
  grid-template-columns: minmax(720px, 920px);
  align-items: start;
  justify-content: center;
  gap: 14px;
}

.settings-form-contents {
  display: contents;
}

.setting-panel {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.setting-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.setting-panel-main {
  width: 100%;
  gap: 12px;
}

.settings-inner-form {
  display: grid;
  gap: 12px;
}

.settings-section {
  min-width: 0;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.settings-section-open {
  display: grid;
  gap: 10px;
}

.setting-panel-main {
  max-height: calc(100vh - 176px);
  overflow: auto;
}

.setting-panel-main .pair-list-collapsible {
  min-height: 0;
}

.setting-panel-main .pair-list-content {
  min-height: 0;
  padding-right: 2px;
}

.settings-exchange-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: auto;
  padding-right: 2px;
}

.settings-fees-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  align-items: start;
  gap: 8px;
}

.settings-blacklist-input {
  min-height: 220px;
  flex: 1;
  resize: none;
}

.setting-panel .route-setting-row,
.setting-panel .route-toggle-row {
  padding: 8px 10px;
  border-radius: 13px;
}

.setting-panel .route-fee-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(4.8ch + 20px);
  align-items: center;
  gap: 10px;
}

.setting-panel .route-setting-row span,
.setting-panel .route-toggle-row span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-exchange-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.settings-exchange-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-logo {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: block;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  object-fit: contain;
  padding: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.setting-panel .route-fee-row > .settings-exchange-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-panel .route-setting-row input {
  width: calc(4.8ch + 20px);
  min-height: 30px;
  padding: 5px 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.setting-panel .route-setting-row input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.setting-panel .route-setting-row input[type="number"]::-webkit-outer-spin-button,
.setting-panel .route-setting-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.setting-panel .settings-submit {
  width: 100%;
  min-width: 0;
  margin-top: 0;
}

.setting-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pair-lists-form {
  width: 100%;
}

.user-management-form {
  width: 100%;
}

.user-management-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.user-create-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.user-create-field span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-create-field input {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.38);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.user-create-field input:focus {
  border-color: rgba(82, 122, 63, 0.42);
  box-shadow: 0 0 0 4px rgba(82, 122, 63, 0.12);
}

.user-create-action {
  min-height: 42px;
}

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

.payment-shell {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
}

.profile-modal-card {
  width: min(1000px, calc(100vw - 48px));
  display: grid;
  gap: 16px;
}

.profile-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.profile-column {
  display: grid;
  align-content: start;
  gap: 16px;
}

.profile-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.2);
}

.profile-section h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--text);
}

.profile-form {
  display: grid;
  gap: 10px;
}

.profile-section-subscription {
  align-self: start;
}

.profile-section-history {
  align-self: start;
}

.profile-message {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-message-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: var(--success);
}

.profile-message-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.24);
  color: #f28f8f;
}

.profile-subscription-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-subscription-row strong {
  color: var(--text);
  font-size: 0.88rem;
}

.profile-pay-action {
  margin-top: 4px;
}

.profile-history-stack {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.profile-history-shell {
  display: grid;
  gap: 0;
}

.profile-history-shell > summary {
  list-style: none;
}

.profile-history-shell > summary::-webkit-details-marker {
  display: none;
}

.profile-history-shell-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.profile-history-shell-summary h2 {
  margin: 0;
}

.profile-history-shell-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.24);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease;
}

.profile-history-shell[open] .profile-history-shell-icon {
  transform: rotate(180deg);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.22);
}

.profile-history-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.18);
}

.profile-history-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.profile-history-summary {
  list-style: none;
  cursor: pointer;
}

.profile-history-summary::-webkit-details-marker {
  display: none;
}

.profile-history-summary h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--muted);
}

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

.profile-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.3);
}

.profile-history-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-history-row strong {
  color: var(--text);
  font-size: 0.82rem;
}

.profile-history-row span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.profile-history-meta {
  text-align: right;
}

.profile-history-status,
.profile-history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.34);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.profile-history-status-paid,
.profile-history-status-active {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--success);
}

.profile-history-status-pending {
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.profile-history-status-failed,
.profile-history-status-revoked,
.profile-history-status-expired {
  background: rgba(248, 113, 113, 0.13);
  border-color: rgba(248, 113, 113, 0.34);
  color: #fb7185;
}

.profile-history-badge {
  margin-left: 6px;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.3);
  color: #93c5fd;
}

.profile-history-empty {
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.14);
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-session-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.72rem;
  white-space: nowrap;
}

body.theme-light .profile-section {
  background: rgba(255, 255, 248, 0.78);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .profile-message-success {
  background: rgba(42, 126, 82, 0.12);
  border-color: rgba(42, 126, 82, 0.2);
  color: #2f7d4e;
}

body.theme-light .profile-message-error {
  background: rgba(184, 72, 66, 0.12);
  border-color: rgba(184, 72, 66, 0.22);
  color: #ad3f3a;
}

body.theme-light .profile-history-row {
  background: rgba(255, 255, 248, 0.92);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .profile-history-block {
  background: rgba(255, 255, 248, 0.78);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .profile-history-shell-icon {
  background: rgba(255, 255, 248, 0.9);
  border-color: rgba(76, 93, 58, 0.14);
  color: rgba(76, 93, 58, 0.7);
}

body.theme-light .profile-history-shell[open] .profile-history-shell-icon {
  color: #24311e;
  border-color: rgba(76, 93, 58, 0.22);
}

body.theme-light .profile-history-status-paid,
body.theme-light .profile-history-status-active {
  background: rgba(42, 126, 82, 0.12);
  border-color: rgba(42, 126, 82, 0.24);
  color: #2f7d4e;
}

body.theme-light .profile-history-status-pending {
  background: rgba(175, 117, 24, 0.13);
  border-color: rgba(175, 117, 24, 0.26);
  color: #9a670e;
}

body.theme-light .profile-history-status-failed,
body.theme-light .profile-history-status-revoked,
body.theme-light .profile-history-status-expired {
  background: rgba(184, 72, 66, 0.12);
  border-color: rgba(184, 72, 66, 0.24);
  color: #ad3f3a;
}

body.theme-light .profile-history-badge {
  background: rgba(68, 104, 164, 0.12);
  border-color: rgba(68, 104, 164, 0.24);
  color: #395f9e;
}

.payment-card {
  width: min(460px, 100%);
}

.payment-success-card {
  width: min(420px, calc(100vw - 48px));
  display: grid;
  gap: 16px;
}

.payment-close-action {
  text-decoration: none;
}

.payment-close-action:hover {
  text-decoration: none;
}

.payment-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.payment-message {
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.86rem;
  line-height: 1.35;
}

.payment-message-success {
  color: #86c99a;
  background: rgba(96, 187, 128, 0.12);
  border: 1px solid rgba(96, 187, 128, 0.24);
}

.payment-message-invalid,
.payment-message-used,
.payment-message-login_required {
  color: #d98282;
  background: rgba(217, 130, 130, 0.12);
  border: 1px solid rgba(217, 130, 130, 0.24);
}

.payment-message-admin {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.24);
}

body.theme-light .payment-message-success {
  color: #527a3f;
  background: rgba(82, 122, 63, 0.1);
  border-color: rgba(82, 122, 63, 0.22);
}

body.theme-light .payment-message-invalid,
body.theme-light .payment-message-used,
body.theme-light .payment-message-login_required {
  color: #a95757;
  background: rgba(169, 87, 87, 0.1);
  border-color: rgba(169, 87, 87, 0.2);
}

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

.login-brand h1 {
  margin: 0;
  font-size: 1.7rem;
}

.login-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8aa05c, #527a3f);
  box-shadow: 0 18px 40px rgba(82, 122, 63, 0.24);
}

.login-error {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.1);
  color: #fb7185;
  font-weight: 800;
}

.login-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-field input {
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.38);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  outline: none;
  text-transform: none;
  letter-spacing: normal;
}

.login-field input:focus {
  border-color: rgba(82, 122, 63, 0.42);
  box-shadow: 0 0 0 4px rgba(82, 122, 63, 0.12);
}

.login-submit {
  min-height: 46px;
}

.login-alt-link {
  display: inline-flex;
  justify-content: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.login-alt-link:hover {
  color: var(--text);
  text-decoration: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 24px;
}

.auth-modal:target {
  display: grid;
}

.auth-modal-open {
  display: grid;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

body.theme-light .auth-modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.auth-modal-card {
  position: relative;
  z-index: 1;
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
}

.settings-modal .settings-modal-card {
  width: min(500px, calc(100vw - 48px));
  min-width: 0;
  max-width: calc(100vw - 48px);
  max-height: min(820px, calc(100vh - 48px));
  flex: 0 0 auto;
}

.settings-modal .setting-panel-main {
  width: min(500px, calc(100vw - 48px));
  max-height: min(820px, calc(100vh - 48px));
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: none;
}

.auth-modal-close:hover {
  color: var(--text);
  text-decoration: none;
}

.pair-lists-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.pair-list-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.pair-list-collapsible {
  gap: 0;
}

.pair-list-collapsible > summary {
  list-style: none;
}

.pair-list-collapsible > summary::-webkit-details-marker {
  display: none;
}

.pair-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.pair-list-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pair-list-summary-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.pair-list-summary-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translate(-50%, -60%) rotate(45deg);
  transition: transform 0.18s ease;
}

.pair-list-collapsible[open] .pair-list-summary-icon::before {
  transform: translate(-50%, -35%) rotate(-135deg);
}

.pair-list-content {
  margin-top: 12px;
}

.pair-list-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.pair-list-help {
  font-size: 0.82rem;
  color: var(--muted);
}

.pair-list-input {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.38);
  color: var(--text);
  padding: 14px 16px;
  font: 500 0.94rem/1.5 ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  line-height: 1.4;
  outline: none;
}

.pair-list-input:focus {
  border-color: rgba(82, 122, 63, 0.34);
  box-shadow: 0 0 0 4px rgba(82, 122, 63, 0.1);
}

.route-settings-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

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

.admin-users-shell {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: 100%;
  padding-inline: 0;
}

.admin-users-card {
  width: min(1640px, 100%);
  padding: 18px 20px;
}

.admin-foldout {
  display: grid;
  gap: 10px;
  width: min(1640px, 100%);
  justify-self: stretch;
}

.admin-foldout summary {
  list-style: none;
}

.admin-foldout summary::-webkit-details-marker {
  display: none;
}

.admin-foldout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.admin-foldout-summary::before {
  content: "›";
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.28);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  transition: transform 140ms ease, color 140ms ease, border-color 140ms ease;
}

.admin-foldout[open] .admin-foldout-summary::before {
  transform: rotate(90deg);
  color: var(--text);
  border-color: rgba(138, 160, 92, 0.28);
}

body.theme-light .admin-foldout-summary::before {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

.admin-foldout-title {
  margin-right: auto;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.admin-users-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.admin-users-title-row h1 {
  margin: 0;
}

.admin-users-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(130px, 0.52fr) minmax(150px, 0.62fr) 92px 86px;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.admin-users-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-users-filters input,
.admin-users-filters select {
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.34);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  outline: none;
  text-transform: none;
  letter-spacing: 0;
}

.admin-users-filters .primary-action,
.admin-users-filters .ghost-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.78rem;
}

body.theme-light .admin-users-filters input,
body.theme-light .admin-users-filters select {
  background: rgba(255, 255, 248, 0.95);
  border-color: rgba(76, 93, 58, 0.12);
}

.admin-users-table {
  display: grid;
  gap: 6px;
}

.admin-users-head,
.admin-user-row {
  display: grid;
  grid-template-columns: 1.02fr 1.35fr 0.62fr 0.82fr 2.62fr;
  gap: 10px;
  align-items: center;
}

.admin-users-head {
  padding: 0 8px 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-user-row {
  padding: 7px 8px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.22);
}

body.theme-light .admin-user-row {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

.admin-user-main,
.admin-user-contact,
.admin-user-date,
.admin-user-subscription {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-user-main span,
.admin-user-contact span,
.admin-user-date span,
.admin-user-subscription span {
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-main strong {
  font-size: 0.84rem;
}

.admin-subscription-chip,
.admin-subscription-days {
  width: fit-content;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.34);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.admin-user-subscription .admin-subscription-chip,
.admin-user-subscription .admin-subscription-days {
  color: var(--muted);
}

.admin-user-subscription .admin-subscription-active {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.32);
  color: var(--success);
}

.admin-user-subscription .admin-subscription-warning {
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24;
}

.admin-user-subscription .admin-subscription-critical,
.admin-user-subscription .admin-subscription-expired {
  background: rgba(248, 113, 113, 0.13);
  border-color: rgba(248, 113, 113, 0.38);
  color: #fb7185;
}

.admin-user-subscription .admin-subscription-admin {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.34);
  color: #93c5fd;
}

.admin-user-subscription .admin-subscription-none {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.admin-subscription-date {
  padding-left: 2px;
}

body.theme-light .admin-user-subscription .admin-subscription-active {
  background: rgba(42, 126, 82, 0.12);
  border-color: rgba(42, 126, 82, 0.28);
  color: #2f7d4e;
}

body.theme-light .admin-user-subscription .admin-subscription-warning {
  background: rgba(175, 117, 24, 0.13);
  border-color: rgba(175, 117, 24, 0.3);
  color: #9a670e;
}

body.theme-light .admin-user-subscription .admin-subscription-critical,
body.theme-light .admin-user-subscription .admin-subscription-expired {
  background: rgba(184, 72, 66, 0.12);
  border-color: rgba(184, 72, 66, 0.32);
  color: #ad3f3a;
}

body.theme-light .admin-user-subscription .admin-subscription-admin {
  background: rgba(68, 104, 164, 0.12);
  border-color: rgba(68, 104, 164, 0.28);
  color: #395f9e;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: 58px minmax(170px, 1fr) 70px 70px 34px;
  gap: 6px;
  align-items: center;
}

.admin-user-actions input {
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.34);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 0.76rem;
  outline: none;
}

.admin-user-actions .primary-action,
.admin-user-actions .ghost-action {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.7rem;
}

.admin-user-action-placeholder {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.admin-user-delete-action {
  min-width: 34px;
  width: 34px;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

body.theme-light .admin-user-actions input {
  background: rgba(255, 255, 248, 0.95);
  border-color: rgba(76, 93, 58, 0.12);
}

.admin-payments-list {
  display: grid;
  gap: 6px;
}

.admin-payments-head,
.admin-payment-row {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr 0.7fr 0.7fr 0.86fr 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.admin-payments-head {
  padding: 0 8px 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-payment-row {
  min-height: 40px;
  padding: 7px 8px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.22);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

body.theme-light .admin-payment-row {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

.admin-payment-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-payment-order {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.route-setting-row,
.route-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.route-setting-row input {
  width: 92px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.38);
  color: var(--text);
}

.route-toggle-row {
  justify-content: flex-start;
}

.exchange-status-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exchange-runtime-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}

.exchange-runtime-ok {
  background: #4ade80;
}

.exchange-runtime-partial {
  background: #b9ca8a;
}

.exchange-runtime-timeout {
  background: #f59e0b;
}

.exchange-runtime-warn {
  background: #f59e0b;
}

.exchange-runtime-info {
  background: #b9ca8a;
}

.exchange-runtime-ssl {
  background: #a78bfa;
}

.exchange-runtime-dns {
  background: #9fb679;
}

.exchange-runtime-rate_limit {
  background: #f97316;
}

.exchange-runtime-error {
  background: #fb7185;
}

.exchange-runtime-empty,
.exchange-runtime-cooldown {
  background: #f59e0b;
}

.exchange-runtime-idle,
.exchange-runtime-off,
.exchange-runtime-forced_off {
  background: #64748b;
}

.exchange-runtime-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.exchange-error-text {
  margin: -4px 0 2px 54px;
  color: #fb7185;
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-word;
}

.system-health-list {
  gap: 10px;
}

.system-health-frame {
  width: 100%;
}

.system-runtime-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.18);
}

.system-runtime-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.system-runtime-grid {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.system-runtime-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--muted);
  background: rgba(15, 23, 42, 0.28);
  font-size: 0.76rem;
}

.system-runtime-chip strong {
  color: var(--text);
  font-size: 0.8rem;
}

.system-runtime-ok {
  border-color: rgba(74, 222, 128, 0.2);
}

.system-runtime-warn {
  border-color: rgba(245, 158, 11, 0.26);
}

.system-snapshot-panel {
  background: linear-gradient(135deg, rgba(138, 160, 92, 0.1), rgba(15, 23, 42, 0.18));
}

.system-health-card .setting-copy {
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.system-events-card {
  grid-column: 1 / -1;
}

.system-events-card .setting-copy {
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.system-events-collapsible {
  display: grid;
  gap: 12px;
}

.system-events-collapsible > summary {
  list-style: none;
  cursor: pointer;
}

.system-events-collapsible > summary::-webkit-details-marker {
  display: none;
}

.system-events-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.system-events-frame {
  width: 100%;
}

.system-table-card {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.system-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.system-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.system-table th,
.system-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  vertical-align: top;
  text-align: left;
}

.system-table th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.035);
  white-space: nowrap;
}

.system-table td {
  font-size: 0.84rem;
  color: var(--text);
}

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

.system-table-row-ok {
  background: transparent;
}

.system-table-row-partial {
  background: transparent;
}

.system-table-row-warn,
.system-table-row-timeout,
.system-table-row-slow,
.system-table-row-empty,
.system-table-row-cooldown {
  background: transparent;
}

.system-table-row-error,
.system-table-row-ssl,
.system-table-row-dns,
.system-table-row-rate_limit {
  background: transparent;
}

.system-table-row-off,
.system-table-row-idle,
.system-table-row-forced_off {
  opacity: 0.72;
}

.system-table-cell-exchange {
  min-width: 180px;
}

.system-table-error {
  margin-top: 8px;
}

.system-table-markets {
  display: inline-block;
  line-height: 1.45;
  white-space: nowrap;
}

.system-table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.system-events-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.system-events-copy-button {
  min-height: 36px;
  padding-inline: 14px;
}

.system-event-message-cell {
  min-width: 420px;
}

.system-event-empty-row {
  color: var(--muted);
}

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

.system-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.22);
}

.system-event-info {
  border-color: rgba(138, 160, 92, 0.22);
  background: linear-gradient(90deg, rgba(138, 160, 92, 0.1), rgba(15, 23, 42, 0.18));
}

.system-event-warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.18));
}

.system-event-error {
  border-color: rgba(251, 113, 133, 0.3);
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.14), rgba(15, 23, 42, 0.18));
}

.system-event-main {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.35;
}

.system-event-main strong {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.system-event-main span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-event-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.system-event-meta span,
.system-event-empty {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.system-event-empty {
  display: inline-flex;
  width: fit-content;
  color: var(--muted);
  font-size: 0.84rem;
}

.system-health-row-wrap {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.system-health-row {
  cursor: default;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  background: transparent;
  min-height: 54px;
  flex-wrap: nowrap;
}

.system-health-status-ok {
  border-color: rgba(74, 222, 128, 0.22);
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.12), rgba(15, 23, 42, 0.18));
}

.system-health-status-partial {
  border-color: rgba(138, 160, 92, 0.24);
  background: linear-gradient(90deg, rgba(138, 160, 92, 0.12), rgba(15, 23, 42, 0.18));
}

.system-health-status-slow,
.system-health-status-timeout,
.system-health-status-empty,
.system-health-status-cooldown {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.13), rgba(15, 23, 42, 0.18));
}

.system-health-status-error,
.system-health-status-ssl,
.system-health-status-dns,
.system-health-status-rate_limit {
  border-color: rgba(251, 113, 133, 0.3);
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.14), rgba(15, 23, 42, 0.18));
}

.system-health-status-off,
.system-health-status-idle,
.system-health-status-forced_off {
  opacity: 0.72;
}

.system-exchange-name {
  min-width: 112px;
  font-weight: 800;
}

.system-count-chip {
  min-width: 92px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.1);
  text-align: center;
}

.system-freshness-chip {
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
  border: 1px solid transparent;
}

.system-freshness-fresh {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.24);
}

.system-freshness-stale {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.24);
}

.system-freshness-dead {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.24);
}

.system-health-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.system-health-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.system-retry-link {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(138, 160, 92, 0.22);
  color: #b9ca8a;
  background: rgba(138, 160, 92, 0.08);
  text-decoration: none;
  font-weight: 700;
}

.system-retry-link:hover {
  text-decoration: none;
  color: #d2dfa9;
  background: rgba(138, 160, 92, 0.14);
}

.system-control-link {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1;
}

.system-disable-link {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.08);
}

.system-disable-link:hover {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.14);
}

.system-enable-link {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.24);
  background: rgba(74, 222, 128, 0.08);
}

.system-enable-link:hover {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.14);
}

body.theme-light .system-health-meta span {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .system-event-row {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .system-event-info {
  background: linear-gradient(90deg, rgba(82, 122, 63, 0.12), rgba(255, 255, 248, 0.82));
}

body.theme-light .system-event-warn {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12), rgba(255, 255, 248, 0.82));
}

body.theme-light .system-event-error {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.1), rgba(255, 255, 248, 0.82));
}

body.theme-light .system-event-meta span,
body.theme-light .system-event-empty {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .system-runtime-panel,
body.theme-light .system-runtime-chip {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .system-count-chip {
  background: rgba(255, 255, 248, 0.74);
  border-color: rgba(76, 93, 58, 0.1);
}

body.theme-light .system-freshness-fresh {
  color: #15803d;
  background: rgba(22, 163, 74, 0.1);
}

body.theme-light .system-freshness-stale {
  color: #b45309;
  background: rgba(217, 119, 6, 0.1);
}

body.theme-light .system-freshness-dead {
  color: #be123c;
  background: rgba(225, 29, 72, 0.1);
}

body.theme-light .system-health-status-ok {
  background: linear-gradient(90deg, rgba(82, 122, 63, 0.14), rgba(255, 255, 248, 0.82));
}

body.theme-light .system-health-status-partial {
  background: linear-gradient(90deg, rgba(96, 125, 71, 0.12), rgba(255, 255, 248, 0.82));
}

body.theme-light .system-health-status-slow,
body.theme-light .system-health-status-timeout,
body.theme-light .system-health-status-empty,
body.theme-light .system-health-status-cooldown {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12), rgba(255, 255, 248, 0.82));
}

body.theme-light .system-health-status-error,
body.theme-light .system-health-status-ssl,
body.theme-light .system-health-status-dns,
body.theme-light .system-health-status-rate_limit {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.1), rgba(255, 255, 248, 0.82));
}

body.theme-light .system-retry-link {
  color: #527a3f;
  border-color: rgba(82, 122, 63, 0.2);
  background: rgba(82, 122, 63, 0.08);
}

body.theme-light .system-disable-link {
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.22);
  background: rgba(225, 29, 72, 0.08);
}

body.theme-light .system-enable-link {
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(22, 163, 74, 0.08);
}

.settings-submit {
  margin-top: 4px;
  width: 100%;
  min-width: 0;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.setting-copy {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.setting-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.toggle-chip {
  min-width: 78px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  text-rendering: optimizeLegibility;
}

.toggle-chip:hover {
  text-decoration: none;
  color: var(--text);
}

.toggle-chip-active {
  background: linear-gradient(180deg, #ff6c5f, #ff5b4d);
  color: white;
}

@media (max-width: 1100px) {
  .profile-sections {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-column {
    gap: 14px;
  }

  .page-shell {
    padding-top: 82px;
  }

  .status-bar {
    position: static;
    margin-bottom: 12px;
  }

  .brand-corner {
    left: 12px;
  }

  .island-nav,
  .user-popover {
    display: none;
  }

  .mobile-drawer {
    display: block;
    position: absolute;
    top: 20px;
    right: 12px;
    z-index: 80;
  }

  .mobile-menu-button {
    position: relative;
    z-index: 2;
    width: 48px;
    height: 48px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 11, 0.88);
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  body.theme-light .mobile-menu-button {
    background: rgba(250, 252, 244, 0.88);
    border-color: rgba(76, 93, 58, 0.1);
    box-shadow: 0 14px 36px rgba(70, 84, 48, 0.12);
  }

  .mobile-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
  }

  .mobile-menu-panel {
    position: fixed;
    z-index: 1;
    top: 76px;
    right: 10px;
    width: min(360px, calc(100vw - 20px));
    max-height: calc(100dvh - 86px);
    display: grid;
    gap: 12px;
    padding: 12px;
    overflow-y: auto;
    border-radius: 26px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.97);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
  }

  body.theme-light .mobile-menu-panel {
    background: rgba(255, 255, 248, 0.97);
    border-color: rgba(76, 93, 58, 0.12);
    box-shadow: 0 24px 64px rgba(70, 84, 48, 0.18);
  }

  .mobile-drawer:not([open]) .mobile-menu-panel {
    display: none;
  }

  .mobile-menu-nav {
    display: grid;
    gap: 8px;
  }

  .mobile-menu-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 850;
    text-decoration: none;
  }

  .mobile-menu-link:hover {
    text-decoration: none;
  }

  .mobile-menu-link-active {
    border-color: rgba(138, 160, 92, 0.34);
    background: linear-gradient(180deg, rgba(138, 160, 92, 0.22), rgba(82, 122, 63, 0.14));
  }

  .mobile-menu-link-disabled {
    color: var(--muted);
    opacity: 0.52;
  }

  body.theme-light .mobile-menu-link {
    background: rgba(246, 249, 237, 0.9);
    border-color: rgba(76, 93, 58, 0.1);
  }

  .mobile-user-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.035);
  }

  body.theme-light .mobile-user-panel {
    background: rgba(246, 249, 237, 0.82);
    border-color: rgba(76, 93, 58, 0.1);
  }

  .mobile-user-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .mobile-user-name {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .mobile-user-name strong,
  .mobile-user-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-user-name span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
  }

  .mobile-menu-preferences {
    justify-content: space-between;
    padding: 10px 0 0;
    margin-top: 2px;
  }

  .arbitrage-layout,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .filters-rail {
    position: static;
  }

  .filter-drawer,
  .filter-drawer:not([open]) {
    width: 100%;
  }

  .filter-drawer summary {
  }

  .filters-rail {
    display: block;
  }

  .filter-panel {
    width: 100%;
    min-height: 0;
  }

  .filter-drawer-title {
    display: none;
  }

  .filter-form-sidebar {
    padding: 10px;
  }

  .filter-form-sidebar > :not(input[type="hidden"]):not(.preset-field) {
    display: none;
  }

  .preset-field {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.theme-light .preset-field {
    background: transparent;
    border-color: transparent;
  }

  .preset-field > span,
  .preset-save-row {
    display: none;
  }

  .preset-bubble-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 1px 2px 3px;
    scrollbar-width: none;
  }

  .preset-bubble-row::-webkit-scrollbar {
    display: none;
  }

  .preset-bubble {
    flex: 0 0 auto;
  }

  .field-top-split {
    flex-direction: column;
    align-items: stretch;
  }

  .field-input-wrap {
    width: 100%;
  }

  .field-input-wrap .field-value-input {
    width: 100%;
    transform: none;
    text-align: left;
  }

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

  .pair-lists-grid {
    grid-template-columns: 1fr;
  }

  .settings-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .setting-panel-main {
    max-height: none;
  }

  .exchange-toggle-grid {
    grid-template-columns: 1fr;
  }

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

  .arb-table-head,
  .arb-row,
  .arb-variant-row {
    grid-template-columns: minmax(104px, 1.22fr) minmax(76px, 0.88fr) minmax(76px, 0.88fr) minmax(74px, 0.82fr);
  }

  .arb-table-head > :nth-child(n+5),
  .arb-row > :nth-child(n+5),
  .arb-variant-row > :nth-child(n+5) {
    display: none;
  }

  .ticker-meta-row,
  .price-action-row,
  .net-spread-pill,
  .tv-symbol-row {
    display: none;
  }

  .ticker-block {
    display: grid;
    grid-template-rows: 24px 13px;
    align-content: center;
    justify-items: start;
    gap: 1px;
    justify-content: center;
  }

  .ticker-title-row {
    min-height: 24px;
    align-self: center;
  }

  .numeric-cell-stack,
  .spread-cell,
  .volume-cell,
  .profit-block,
  .funding-cell,
  .tv-block {
    grid-template-rows: 24px 13px;
    align-content: center;
    gap: 1px;
  }

  .compact-exchange-label {
    display: inline-flex;
  }

  .admin-users-head {
    display: none;
  }

  .admin-users-shell {
    padding-inline: 0;
  }

  .admin-users-title-row,
  .admin-users-filters {
    grid-template-columns: 1fr;
  }

  .admin-users-title-row {
    display: grid;
  }

  .admin-user-row,
  .admin-user-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .status-bar {
    margin-bottom: 10px;
  }

  .arbitrage-layout {
    gap: 12px;
  }

  .filters-rail {
    order: -1;
    width: 100%;
  }

  .filter-drawer {
    width: 100%;
  }

  .filter-drawer-summary {
    list-style: none;
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 27, 44, 0.94), rgba(15, 22, 36, 0.9));
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  body.theme-light .filter-drawer-summary {
    background: linear-gradient(180deg, rgba(255, 255, 248, 0.94), rgba(240, 245, 229, 0.88));
    border-color: rgba(76, 93, 58, 0.1);
  }

  .filter-drawer-summary-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .filter-drawer-summary-copy strong {
    color: var(--text);
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: -0.02em;
  }

  .filter-drawer-summary-copy span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .filter-drawer-summary-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 1rem;
    font-weight: 900;
    transform: rotate(90deg);
    transition: transform 160ms ease;
  }

  .filter-drawer[open] .filter-drawer-summary-icon {
    transform: rotate(270deg);
  }

  .filter-drawer:not([open]) .filter-panel {
    display: none;
  }

  .filter-panel {
    width: 100%;
    min-height: 0;
    margin-top: 10px;
  }

  .filter-drawer-title {
    display: block;
  }

  .filter-form-sidebar {
    padding: 10px;
    gap: 10px;
  }

  .filter-form-sidebar > :not(input[type="hidden"]):not(.preset-field) {
    display: none;
  }

  .preset-field {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.theme-light .preset-field {
    background: transparent;
    border-color: transparent;
  }

  .preset-field > span,
  .preset-save-row {
    display: none;
  }

  .preset-bubble-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 1px 2px 3px;
    scrollbar-width: none;
  }

  .preset-bubble-row::-webkit-scrollbar {
    display: none;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0;
  }

  .section-head h2 {
    font-size: 1.1rem;
  }

  .frame-indicator {
    width: fit-content;
    max-width: 100%;
  }

  .board-mobile-sort {
    display: none;
  }

  .arb-table-head {
    display: none;
  }

  .arb-list {
    gap: 12px;
  }

  .arb-group {
    gap: 8px;
  }

  .arb-row,
  .arb-variant-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "ticker ticker"
      "spot futures"
      "spread funding";
    gap: 10px;
    padding: 14px;
  }

  .board-card-compact .arb-row,
  .board-card-compact .arb-variant-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "ticker ticker"
      "spot futures"
      "spread funding";
    gap: 10px;
    padding: 14px;
  }

  .ticker-block {
    grid-area: ticker;
    display: grid;
    gap: 8px;
  }

  .board-card-compact .ticker-block {
    grid-area: ticker;
    display: grid;
    grid-template-rows: none;
    align-content: stretch;
    justify-items: stretch;
    justify-content: stretch;
    gap: 8px;
  }

  .spot-cell {
    grid-area: spot;
  }

  .futures-cell {
    grid-area: futures;
  }

  .spread-cell {
    grid-area: spread;
  }

  .volume-cell {
    display: none;
  }

  .funding-cell {
    grid-area: funding;
    display: grid;
  }

  .profit-block {
    display: none;
  }

  .tv-block {
    grid-area: tv;
    display: none;
  }

  .actions-block {
    grid-area: actions;
    display: none;
  }

  .ticker-meta-row,
  .board-card-compact .ticker-meta-row {
    display: none;
  }

  .board-card-compact .funding-cell {
    display: grid;
  }

  .board-card-compact .tv-block {
    display: none;
  }

  .board-card-compact .actions-block {
    display: none;
  }

  .numeric-cell-stack,
  .spread-cell,
  .funding-cell {
    grid-template-rows: none;
    align-content: stretch;
    justify-items: center;
    gap: 6px;
    text-align: center;
  }

  .board-card-compact .numeric-cell-stack,
  .board-card-compact .spread-cell,
  .board-card-compact .funding-cell {
    grid-template-rows: none;
    align-content: stretch;
    justify-items: center;
    gap: 6px;
    text-align: center;
  }

  .numeric-cell-stack,
  .spread-cell,
  .funding-cell {
    min-height: 88px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    justify-content: center;
  }

  .board-card-compact .numeric-cell-stack,
  .board-card-compact .spread-cell,
  .board-card-compact .funding-cell {
    min-height: 88px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    justify-content: center;
  }

  body.theme-light .numeric-cell-stack,
  body.theme-light .spread-cell,
  body.theme-light .funding-cell {
    background: rgba(250, 252, 244, 0.92);
    border-color: rgba(76, 93, 58, 0.08);
  }

  body.theme-light .board-card-compact .numeric-cell-stack,
  body.theme-light .board-card-compact .spread-cell,
  body.theme-light .board-card-compact .funding-cell {
    background: rgba(250, 252, 244, 0.92);
    border-color: rgba(76, 93, 58, 0.08);
  }

  .mobile-cell-label {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
  }

  .board-card-compact .mobile-cell-label,
  .board-card-compact .compact-exchange-label {
    display: inline-flex;
  }

  .numeric-cell-stack,
  .spread-cell,
  .funding-cell,
  .board-card-compact .numeric-cell-stack,
  .board-card-compact .spread-cell,
  .board-card-compact .funding-cell {
    gap: 4px;
  }

  .ticker-name {
    font-size: 1rem;
  }

  .ticker-title-row {
    min-height: 0;
    flex-wrap: wrap;
  }

  .board-card-compact .ticker-title-row {
    min-height: 0;
    align-self: auto;
    flex-wrap: wrap;
  }

  .compact-exchange-label {
    display: inline-flex;
    font-size: 0.56rem;
  }

  .price-action-row {
    display: none;
  }

  .exchange-pill-link,
  .direction-pill {
    min-height: 30px;
  }

  .spread-main,
  .profit-value {
    font-size: 0.92rem;
  }

  .tv-block {
    display: none;
  }

  .board-card-compact .tv-block {
    display: none;
  }

  .copy-chip-wide {
    width: 100%;
    max-width: none;
  }

  .actions-block {
    display: none;
  }

  .board-card-compact .actions-block {
    display: none;
  }

  .variant-ticker-cell {
    align-items: flex-start;
  }

  .variant-actions-cell {
    display: none;
  }

  .net-spread-pill {
    display: none;
  }

  .board-card-compact .net-spread-pill {
    display: none;
  }

  .user-menu-toggle-display {
    display: none;
  }

  .price-warning-popover {
    left: 0;
    top: calc(100% + 10px);
    width: min(280px, calc(100vw - 56px));
    transform: translateY(6px) scale(0.98);
  }

  .price-warning-wrap:hover .price-warning-popover,
  .price-warning-wrap.warning-open .price-warning-popover {
    transform: translateY(0) scale(1);
  }
}
