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

:root {
  --bg: #1b2632;
  --bg-soft: #2c3b4d;
  --surface: rgba(44, 59, 77, 0.88);
  --surface-strong: rgba(27, 38, 50, 0.96);
  --border: rgba(201, 193, 177, 0.16);
  --text: #eee9df;
  --muted: #c9c1b1;
  --accent: #ffb162;
  --accent-2: #a35139;
  --brand: #2c3b4d;
  --brand-strong: #1b2632;
  --positive: #ffb162;
  --success: #ffb162;
  --negative: #a35139;
  --warning: #ffb162;
  --danger: #a35139;
  --feed-positive: #9fb679;
  --feed-positive-bg: rgba(159, 182, 121, 0.12);
  --feed-positive-border: rgba(159, 182, 121, 0.26);
  --feed-negative: #c97863;
  --feed-negative-bg: rgba(201, 120, 99, 0.12);
  --feed-negative-border: rgba(201, 120, 99, 0.24);
  --line-faint: rgba(201, 193, 177, 0.08);
  --line-soft: rgba(201, 193, 177, 0.12);
  --line-mid: rgba(201, 193, 177, 0.14);
  --line-strong: rgba(201, 193, 177, 0.18);
  --line-heavy: rgba(201, 193, 177, 0.24);
  --panel-faint: rgba(44, 59, 77, 0.18);
  --panel-soft: rgba(44, 59, 77, 0.28);
  --panel-mid: rgba(44, 59, 77, 0.38);
  --panel-strong: rgba(44, 59, 77, 0.46);
  --panel-solid: rgba(27, 38, 50, 0.96);
  --panel-top: rgba(27, 38, 50, 0.98);
  --veil-faint: rgba(238, 233, 223, 0.03);
  --veil-soft: rgba(238, 233, 223, 0.06);
  --veil-mid: rgba(238, 233, 223, 0.08);
  --shadow: 0 18px 42px rgba(10, 14, 20, 0.34);
}

body.theme-light {
  --bg: #eee9df;
  --bg-soft: #f6f0e6;
  --surface: rgba(250, 246, 239, 0.9);
  --surface-strong: rgba(255, 251, 245, 0.98);
  --border: rgba(27, 38, 50, 0.12);
  --text: #1b2632;
  --muted: #7b7165;
  --accent: #ffb162;
  --accent-2: #a35139;
  --brand: #2c3b4d;
  --brand-strong: #1b2632;
  --positive: #ffb162;
  --success: #ffb162;
  --negative: #a35139;
  --warning: #ffb162;
  --danger: #a35139;
  --feed-positive: #6f8b53;
  --feed-positive-bg: rgba(111, 139, 83, 0.12);
  --feed-positive-border: rgba(111, 139, 83, 0.24);
  --feed-negative: #a35139;
  --feed-negative-bg: rgba(163, 81, 57, 0.12);
  --feed-negative-border: rgba(163, 81, 57, 0.22);
  --line-faint: rgba(27, 38, 50, 0.08);
  --line-soft: rgba(27, 38, 50, 0.12);
  --line-mid: rgba(27, 38, 50, 0.14);
  --line-strong: rgba(27, 38, 50, 0.18);
  --line-heavy: rgba(27, 38, 50, 0.24);
  --panel-faint: rgba(255, 251, 245, 0.78);
  --panel-soft: rgba(255, 251, 245, 0.86);
  --panel-mid: rgba(255, 251, 245, 0.94);
  --panel-strong: rgba(255, 251, 245, 0.98);
  --panel-solid: rgba(255, 251, 245, 0.96);
  --panel-top: rgba(255, 251, 245, 0.99);
  --veil-faint: rgba(27, 38, 50, 0.03);
  --veil-soft: rgba(27, 38, 50, 0.06);
  --veil-mid: rgba(27, 38, 50, 0.08);
  --shadow: 0 20px 48px rgba(27, 38, 50, 0.16);
}

* {
  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:
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-soft) 42%, var(--bg) 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
}

body.theme-light {
  background:
    linear-gradient(180deg, #f7f2e8 0%, #eee9df 50%, #e8e0d3 100%),
    var(--bg);
}

a {
  color: var(--accent);
  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(44, 59, 77, 0.94), rgba(27, 38, 50, 0.92));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  text-align: center;
}

body.theme-light .home-splash-card {
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(201, 193, 177, 0.42));
  border-color: var(--line-mid);
}

.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 var(--line-strong);
  border-radius: 999px;
  background: var(--panel-soft);
  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: var(--line-heavy);
  background: var(--veil-mid);
}

body.theme-light .info-tip-button {
  background: var(--panel-mid);
  border-color: var(--line-mid);
}

.info-tip-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(27, 38, 50, 0.96);
  border: 1px solid var(--line-heavy);
  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;
}

.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: var(--panel-top);
  border-color: var(--line-mid);
}

.scanner-note-card {
  margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(44, 59, 77, 0.94), rgba(27, 38, 50, 0.9));
}

body.theme-light .scanner-note-card {
  background: linear-gradient(180deg, var(--panel-top), rgba(201, 193, 177, 0.26));
}

.scanner-note-card-demo {
  border-color: rgba(255, 177, 98, 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(27, 38, 50, 0.94);
  border: 1px solid var(--veil-mid);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

body.theme-light .island-nav {
  background: rgba(255, 251, 245, 0.84);
  border-color: var(--line-soft);
  box-shadow: 0 14px 36px rgba(27, 38, 50, 0.12);
}

body.theme-light .island-link {
  color: rgba(27, 38, 50, 0.72);
}

body.theme-light .island-link:hover {
  color: var(--brand-strong);
}

body.theme-light .island-link-active,
body.theme-light .island-link-settings {
  background: rgba(44, 59, 77, 0.14);
  color: var(--brand-strong);
}

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

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

.island-link-disabled,
.island-link-disabled:hover {
  color: rgba(238, 233, 223, 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(27, 38, 50, 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: var(--veil-mid);
  color: var(--text);
}

.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(238, 233, 223, 0.78);
  background: var(--veil-soft);
  border: 1px solid var(--line-faint);
  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: var(--brand-strong);
}

.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(27, 38, 50, 0.78);
  background: rgba(44, 59, 77, 0.08);
  border-color: var(--line-soft);
}

.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 var(--veil-mid);
  background: rgba(27, 38, 50, 0.88);
  box-shadow: var(--shadow);
  cursor: pointer;
  user-select: none;
}

body.theme-light .user-bubble {
  background: rgba(255, 251, 245, 0.88);
  border-color: var(--line-soft);
  box-shadow: 0 14px 36px rgba(27, 38, 50, 0.12);
}

body.theme-light .user-avatar {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.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 var(--line-mid);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

body.theme-light .user-menu-card {
  background: var(--panel-solid);
  border-color: var(--line-soft);
}

.user-menu-identity {
  display: grid;
  gap: 2px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.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 var(--line-soft);
}

.user-menu-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--veil-soft);
  border: 1px solid var(--line-soft);
}

.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: var(--text);
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  box-shadow: inset 0 1px 0 var(--veil-mid);
}

body.theme-light .user-menu-toggle {
  background: rgba(44, 59, 77, 0.08);
  border-color: var(--line-soft);
}

body.theme-light .user-menu-toggle-active {
  color: var(--bg);
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

.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: var(--brand-strong);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(255, 177, 98, 0.34);
}

.user-menu-action-pay {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 177, 98, 0.4);
  color: var(--brand-strong);
}

.user-menu-link {
  color: var(--muted);
  background: var(--veil-soft);
  border: 1px solid var(--line-soft);
}

.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 var(--line-soft);
  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 var(--line-mid);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.theme-light .frame-indicator {
  background: var(--panel-mid);
  border-color: var(--line-soft);
  color: var(--muted);
}

.frame-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  flex: 0 0 auto;
}

.frame-indicator-idle .frame-indicator-dot {
  background: var(--positive);
}

.frame-indicator-loading .frame-indicator-dot {
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(255, 177, 98, 0.35);
  animation: framePulse 1.15s ease infinite;
}

.frame-indicator-stale .frame-indicator-dot {
  background: var(--warning);
}

.frame-indicator-error .frame-indicator-dot {
  background: var(--negative);
}

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

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

.board-card-loading {
  min-height: 320px;
}

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

.board-loading-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.board-loading-state strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.board-loading-state span {
  max-width: 420px;
  line-height: 1.5;
}

.board-loading-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

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

@keyframes framePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 177, 98, 0.35);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(255, 177, 98, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 177, 98, 0);
  }
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--negative);
  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: var(--veil-soft);
  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, var(--panel-mid), rgba(201, 193, 177, 0.18));
  border-color: var(--line-soft);
}

.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 var(--line-faint);
  border-radius: 18px;
  background: var(--veil-faint);
}

body.theme-light .range-field,
body.theme-light .toggle-field,
body.theme-light .select-field,
body.theme-light .preset-field {
  background: var(--panel-mid);
  border-color: var(--line-faint);
}

.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;
}

.preset-bubble-row-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.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 var(--line-strong);
  background: var(--panel-strong);
  color: rgba(238, 233, 223, 0.94);
  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-bubble-button {
  cursor: pointer;
  appearance: none;
  font: inherit;
}

.preset-bubble-button-mode {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
  font-size: 0.90rem;
}

.preset-bubble-button-mode.preset-bubble-active {
  color: #eee9df;
  border-color: rgba(44, 59, 77, 0.42);
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  box-shadow: 0 0 0 3px rgba(44, 59, 77, 0.08), inset 0 1px 0 rgba(238, 233, 223, 0.16);
}

body.theme-light .preset-bubble-button-mode.preset-bubble-active {
  color: #eee9df;
  border-color: rgba(44, 59, 77, 0.28);
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

.preset-picker {
  position: relative;
}

.preset-picker-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: rgba(238, 233, 223, 0.9);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.preset-picker-trigger::-webkit-details-marker {
  display: none;
}

.preset-picker-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

.preset-picker[open] .preset-picker-icon {
  transform: rotate(270deg);
}

.preset-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(44, 59, 77, 0.98), rgba(27, 38, 50, 0.96));
  box-shadow: var(--shadow);
}

.preset-bubble-row-picker {
  display: grid;
  gap: 8px;
}

body.theme-light .preset-picker-trigger {
  background: var(--panel-solid);
  border-color: var(--line-soft);
  color: var(--muted);
}

body.theme-light .preset-picker-menu {
  background: linear-gradient(180deg, var(--panel-top), rgba(201, 193, 177, 0.2));
  border-color: var(--line-soft);
}

body:not(.theme-light) .toggle-field,
body:not(.theme-light) .preset-field {
  background: linear-gradient(180deg, rgba(57, 72, 92, 0.72), rgba(44, 59, 77, 0.58));
  border-color: rgba(201, 193, 177, 0.14);
  box-shadow: inset 0 1px 0 rgba(238, 233, 223, 0.03);
}

body:not(.theme-light) .preset-bubble,
body:not(.theme-light) .preset-picker-trigger,
body:not(.theme-light) .preset-save-row input {
  background: linear-gradient(180deg, rgba(35, 47, 62, 0.96), rgba(27, 38, 50, 0.9));
  border-color: rgba(201, 193, 177, 0.18);
  color: rgba(238, 233, 223, 0.96);
  box-shadow: inset 0 1px 0 rgba(238, 233, 223, 0.04);
}

body:not(.theme-light) .preset-bubble:hover,
body:not(.theme-light) .preset-picker-trigger:hover {
  border-color: rgba(201, 193, 177, 0.26);
  background: linear-gradient(180deg, rgba(40, 53, 69, 0.98), rgba(31, 43, 57, 0.94));
}

body:not(.theme-light) .preset-bubble-active,
body:not(.theme-light) .preset-bubble-button-mode.preset-bubble-active {
  color: var(--text);
  border-color: rgba(255, 177, 98, 0.34);
  background: linear-gradient(180deg, rgba(255, 177, 98, 0.18), rgba(163, 81, 57, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 177, 98, 0.08);
}

body:not(.theme-light) .preset-picker-icon {
  color: rgba(238, 233, 223, 0.76);
}

body:not(.theme-light) .preset-picker-menu {
  background: linear-gradient(180deg, rgba(57, 72, 92, 0.98), rgba(30, 41, 54, 0.98));
  border-color: rgba(201, 193, 177, 0.16);
  box-shadow: 0 18px 42px rgba(8, 12, 18, 0.42);
}

body:not(.theme-light) .preset-save-row input::placeholder {
  color: rgba(201, 193, 177, 0.72);
}

body:not(.theme-light) .preset-save-action {
  background: linear-gradient(180deg, rgba(77, 92, 112, 0.9), rgba(61, 76, 95, 0.86));
  border-color: rgba(201, 193, 177, 0.16);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(238, 233, 223, 0.04);
}

body:not(.theme-light) .preset-field .info-tip-button,
body:not(.theme-light) .toggle-field .info-tip-button {
  background: rgba(27, 38, 50, 0.42);
  border-color: rgba(201, 193, 177, 0.18);
  color: rgba(238, 233, 223, 0.82);
}

.board-mode-chip-row {
  display: inline-flex;
}

.board-mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: rgba(238, 233, 223, 0.82);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

body.theme-light .board-mode-chip {
  background: var(--panel-solid);
  border-color: var(--line-soft);
  color: var(--muted);
}

.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 var(--line-strong);
  background: var(--panel-faint);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.preset-delete-button:hover {
  color: var(--negative);
  border-color: rgba(163, 81, 57, 0.3);
  background: rgba(163, 81, 57, 0.12);
}

.preset-bubble:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--line-heavy);
  transform: translateY(-1px);
}

.preset-bubble-active {
  color: #eee9df;
  border-color: rgba(44, 59, 77, 0.42);
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  box-shadow: 0 0 0 3px rgba(44, 59, 77, 0.08), inset 0 1px 0 rgba(238, 233, 223, 0.16);
}

body.theme-light .preset-bubble {
  background: var(--panel-solid);
  border-color: var(--line-soft);
  color: var(--muted);
}

body.theme-light .preset-delete-button {
  background: var(--panel-mid);
  border-color: var(--line-soft);
}

body.theme-light .preset-bubble-active {
  color: #eee9df;
  border-color: rgba(44, 59, 77, 0.32);
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

.preset-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.preset-save-row input {
  width: 100%;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}

body.theme-light .preset-save-row input {
  background: var(--panel-mid);
  border-color: var(--line-soft);
}

.preset-save-action {
  box-sizing: border-box;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  align-self: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--veil-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: none;
  appearance: none;
}

.preset-save-action:hover {
  text-decoration: none;
}

body:not(.theme-light) .preset-save-action {
  background: linear-gradient(180deg, rgba(35, 47, 62, 0.96), rgba(27, 38, 50, 0.9));
  border-color: rgba(201, 193, 177, 0.18);
  color: rgba(238, 233, 223, 0.96);
  box-shadow: inset 0 1px 0 rgba(238, 233, 223, 0.04);
}

body.theme-light .preset-save-action {
  background: var(--panel-mid);
  border-color: var(--line-soft);
}

.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 var(--line-soft);
  background: var(--panel-soft);
  box-shadow: inset 0 1px 0 var(--veil-faint);
}

body.theme-light .field-input-wrap {
  background: var(--panel-solid);
  border-color: var(--line-soft);
  box-shadow: inset 0 1px 0 rgba(238, 233, 223, 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 var(--line-soft);
  border-radius: 999px;
  background: var(--veil-soft);
  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: var(--veil-mid);
  border-color: var(--line-heavy);
}

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

.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(255, 177, 98, 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 var(--line-mid);
  background: var(--panel-soft);
  box-shadow: inset 0 1px 0 var(--veil-faint);
  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(238, 233, 223, 0.95), rgba(201, 193, 177, 0.92));
  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, var(--panel-top), rgba(232, 239, 219, 0.94));
  border-color: var(--line-soft);
}

body:not(.theme-light) .switch-ui {
  border-color: rgba(201, 193, 177, 0.18);
  background: linear-gradient(180deg, rgba(35, 47, 62, 0.96), rgba(27, 38, 50, 0.9));
  box-shadow: inset 0 1px 0 rgba(238, 233, 223, 0.03);
}

.checkbox-shell input[type="checkbox"]:checked + .switch-ui {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  border-color: rgba(44, 59, 77, 0.34);
}

body:not(.theme-light) .checkbox-shell input[type="checkbox"]:checked + .switch-ui {
  background: linear-gradient(180deg, rgba(255, 177, 98, 0.18), rgba(163, 81, 57, 0.2));
  border-color: rgba(255, 177, 98, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 177, 98, 0.08);
}

.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(44, 59, 77, 0.3);
  outline-offset: 2px;
}

.select-field select {
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 0.84rem;
}

body.theme-light .select-field select {
  background: var(--panel-mid);
  border-color: var(--line-soft);
}

.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, var(--accent), var(--accent-2));
  border-color: rgba(255, 177, 98, 0.34);
  color: var(--brand-strong);
  cursor: pointer;
}

body.theme-light .user-menu-action,
body.theme-light .primary-action {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 177, 98, 0.34);
}

body.theme-light .user-menu-action-pay {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 177, 98, 0.34);
}

.ghost-action {
  background: var(--veil-soft);
  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: var(--negative);
  border-color: rgba(163, 81, 57, 0.28);
  background: rgba(163, 81, 57, 0.08);
}

.danger-action:hover {
  color: var(--text);
  background: rgba(163, 81, 57, 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: var(--veil-soft);
}

.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(44, 59, 77, 0.94), rgba(27, 38, 50, 0.9));
}

body.theme-light .board-card {
  background: linear-gradient(180deg, var(--panel-mid), rgba(201, 193, 177, 0.18));
}

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

.section-head-title-wrap {
  min-width: 0;
}

.section-head-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.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 var(--line-soft);
  text-align: center;
}

.spot-cell .price-action-row,
.futures-cell .price-action-row,
.spread-cell .ff-supporting-metric,
.volume-cell .ff-volume-bubble,
.funding-cell .ff-funding-breakdown,
.tv-block .copy-chip-wide,
.actions-block {
  align-self: center;
  justify-self: center;
}

.secondary-bubble-track {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.secondary-bubble-track .price-action-row,
.secondary-bubble-track .tv-symbol-row {
  min-height: 38px;
  height: 38px;
  margin-top: 0;
}

.secondary-bubble-track .price-action-row {
  align-items: stretch;
}

.secondary-bubble-track .direction-pill,
.secondary-bubble-track .ff-data-bubble,
.secondary-bubble-track .copy-chip,
.secondary-bubble-track .favorite-chip,
.secondary-bubble-track .blacklist-chip {
  min-height: 38px;
  height: 38px;
  box-sizing: border-box;
}

.secondary-bubble-track .direction-pill,
.secondary-bubble-track .copy-chip,
.secondary-bubble-track .favorite-chip,
.secondary-bubble-track .blacklist-chip,
.secondary-bubble-track .tv-symbol-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-bubble-track .ff-data-bubble {
  padding-top: 4px;
  padding-bottom: 4px;
  align-content: center;
}

.secondary-bubble-track .tv-symbol-chip {
  min-height: 38px;
  height: 38px;
}

.ticker-secondary-track {
  justify-content: flex-start;
  align-items: flex-start;
}

.ticker-secondary-track .signal-pill {
  min-height: 0;
  height: auto;
  padding: 4px 10px;
  line-height: 1.1;
}

.actions-secondary-track {
  justify-content: center;
}

@media (min-width: 1101px) {
  .arb-row,
  .arb-variant-row {
    grid-template-rows: minmax(44px, auto) 38px;
    row-gap: 0;
  }

  .arb-row > .ticker-block,
  .arb-row > .numeric-cell-stack,
  .arb-row > .spread-cell,
  .arb-row > .volume-cell,
  .arb-row > .profit-block,
  .arb-row > .funding-cell,
  .arb-row > .tv-block,
  .arb-row > .actions-block,
  .arb-variant-row > .ticker-block,
  .arb-variant-row > .numeric-cell-stack,
  .arb-variant-row > .spread-cell,
  .arb-variant-row > .volume-cell,
  .arb-variant-row > .profit-block,
  .arb-variant-row > .funding-cell,
  .arb-variant-row > .tv-block,
  .arb-variant-row > .actions-block {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    align-content: stretch;
    justify-items: center;
    gap: 0;
  }

  .arb-row > .ticker-block,
  .arb-variant-row > .ticker-block {
    justify-items: stretch;
  }

  .arb-row .cell-primary,
  .arb-variant-row .cell-primary {
    grid-row: 1;
    width: 100%;
    min-height: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
  }

  .arb-row .ticker-primary,
  .arb-variant-row .ticker-primary {
    align-content: center;
    justify-items: start;
  }

  .arb-row .actions-primary,
  .arb-variant-row .actions-primary {
    justify-items: center;
  }

  .arb-row .secondary-bubble-track,
  .arb-variant-row .secondary-bubble-track {
    grid-row: 2;
    min-height: 38px;
    height: 38px;
    align-self: stretch;
  }

  .arb-row > .actions-block,
  .arb-variant-row > .actions-block {
    grid-template-rows: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  .arb-row > .actions-block .actions-primary,
  .arb-variant-row > .actions-block .actions-primary {
    display: none;
  }

  .arb-row > .actions-block .actions-secondary-track,
  .arb-variant-row > .actions-block .actions-secondary-track {
    grid-row: auto;
    min-height: auto;
    height: auto;
    width: auto;
    align-self: center;
  }
}

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

.sort-head-arrow {
  display: inline;
}

.volume-head-label {
  display: inline;
}

.volume-head-suffix {
  display: inline;
}

.sort-head-link:hover,
.sort-head-active {
  color: var(--accent);
  text-decoration: none;
}

body.theme-light .sort-head-link:hover,
body.theme-light .sort-head-active {
  color: var(--positive);
}

@media (min-width: 1101px) and (max-width: 1630px) {
  .sort-head-arrow {
    display: none;
  }
}

@media (min-width: 1101px) and (max-width: 1540px) {
  .arb-table-head .head-with-info .info-tip-wrap {
    display: none;
  }
}

@media (min-width: 1101px) and (max-width: 1285px) {
  .volume-head-suffix {
    display: none;
  }

  .board-card:not(.board-card-compact) .ticker-secondary-track {
    display: none;
  }
}

@media (min-width: 1101px) and (max-width: 1265px) {
  .board-card:not(.board-card-compact) .arb-table-head,
  .board-card:not(.board-card-compact) .arb-row,
  .board-card:not(.board-card-compact) .arb-variant-row {
    grid-template-columns: 1.62fr 0.88fr 0.88fr 0.82fr 0.9fr 0.78fr 1.42fr 0.66fr;
  }

  .board-card:not(.board-card-compact) .arb-table-head > :nth-child(7),
  .board-card:not(.board-card-compact) .arb-row > :nth-child(7),
  .board-card:not(.board-card-compact) .arb-variant-row > :nth-child(7) {
    display: none;
  }
}

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

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

.arb-row {
  padding: 14px 12px;
  border: 1px solid var(--line-faint);
  border-radius: 18px;
  background: var(--veil-faint);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

body.theme-light .arb-row {
  background: var(--panel-faint);
  border-color: var(--line-faint);
}

.arb-row:hover {
  background: var(--veil-soft);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

body.theme-light .arb-row:hover {
  background: var(--panel-top);
  border-color: var(--line-soft);
}

.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: var(--panel-faint);
}

body.theme-light .arb-variant-row {
  background: var(--panel-soft);
  border-color: var(--line-faint);
}

.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-block {
  display: grid;
  grid-template-rows: auto auto 42px;
  align-content: start;
}

.ticker-meta-row-primary {
  min-height: 0;
}

.actions-top-spacer {
  min-height: 0;
}

.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 var(--line-soft);
  background: var(--panel-strong);
  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(255, 177, 98, 0.12);
  border-color: rgba(255, 177, 98, 0.24);
  color: var(--accent);
  transform: translateY(-1px);
}

body.theme-light .group-toggle-chip {
  background: var(--panel-mid);
  border-color: var(--line-soft);
}

body.theme-light .group-toggle-chip:hover,
body.theme-light .arb-group.group-open .group-toggle-chip {
  background: rgba(255, 177, 98, 0.1);
  border-color: rgba(255, 177, 98, 0.22);
  color: var(--positive);
}

.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;
  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(163, 81, 57, 0.2);
  background: var(--panel-strong);
  color: var(--negative);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 var(--veil-faint);
  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(163, 81, 57, 0.1);
  border-color: rgba(163, 81, 57, 0.34);
  transform: translateY(-1px);
}

body.theme-light .price-warning-button {
  background: var(--panel-mid);
  border-color: rgba(163, 81, 57, 0.14);
}

body.theme-light .price-warning-button:hover,
body.theme-light .price-warning-wrap.warning-open .price-warning-button {
  background: rgba(163, 81, 57, 0.1);
  border-color: rgba(163, 81, 57, 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: 900;
  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(163, 81, 57, 0.34);
  background: rgba(27, 38, 50, 0.98);
  color: var(--text);
  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: var(--panel-top);
  color: var(--negative);
  border-color: rgba(163, 81, 57, 0.22);
  box-shadow: 0 18px 42px rgba(27, 38, 50, 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 var(--line-soft);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stale-pill {
  color: var(--warning);
  background: rgba(255, 177, 98, 0.1);
  border-color: rgba(255, 177, 98, 0.24);
}

.signal-new {
  border-color: rgba(255, 177, 98, 0.34);
  background: rgba(255, 177, 98, 0.13);
  color: var(--accent);
}

.signal-live {
  border-color: rgba(201, 193, 177, 0.36);
  background: rgba(201, 193, 177, 0.14);
  color: var(--muted);
}

.signal-stable {
  border-color: rgba(255, 177, 98, 0.34);
  background: rgba(255, 177, 98, 0.13);
  color: var(--positive);
}

.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: var(--positive);
}

.compact-exchange-short {
  color: var(--negative);
}

.spread-good {
  color: var(--positive);
  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: var(--positive);
  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(255, 177, 98, 0.22);
  background: rgba(255, 177, 98, 0.1);
  color: var(--positive);
  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;
}

.ff-supporting-metric {
  display: inline-grid;
  justify-items: center;
  gap: 1px;
  line-height: 1;
}

.ff-data-bubble {
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid var(--line-mid);
  background: var(--veil-faint);
  box-sizing: border-box;
}

.ff-supporting-metric-label {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ff-supporting-metric-value {
  color: var(--positive);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.ff-metric-positive {
  color: var(--positive);
}

.ff-metric-negative {
  color: var(--negative);
}

.ff-metric-neutral {
  color: var(--muted);
}

.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: var(--positive);
  font-size: 1.02rem;
  font-weight: 800;
  white-space: nowrap;
}

.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 rate невыгоден для лонга */
.funding-positive-text {
  color: var(--negative);
}

.funding-negative-text {
  color: var(--positive);
}

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

.ff-funding-breakdown {
  display: grid;
  gap: 2px;
  width: 100%;
  max-width: 132px;
}

.ff-funding-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.ff-funding-side {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}

.ff-funding-value {
  font-size: 0.64rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.ff-volume-bubble {
  width: fit-content;
  min-width: 0;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.ff-volume-value {
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  color: var(--text);
}

.ff-credit-text {
  color: var(--positive);
}

.ff-cost-text {
  color: var(--negative);
}

.board-card .spread-good,
.board-card .spread-main,
.board-card .profit-value,
.board-card .net-spread-pill,
.board-card .net-spread-pill strong {
  color: var(--feed-positive);
}

.board-card .volume-cell {
  color: var(--accent);
}

.board-card .funding-positive-text {
  color: var(--feed-negative);
}

.board-card .funding-negative-text {
  color: var(--feed-positive);
}

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

.board-card .ff-metric-positive,
.board-card .ff-credit-text {
  color: var(--feed-positive);
}

.board-card .ff-metric-negative,
.board-card .ff-cost-text {
  color: var(--feed-negative);
}

.board-card .ff-metric-neutral {
  color: var(--muted);
}

.board-card .ff-data-bubble {
  border-color: var(--line-mid);
  background: var(--veil-faint);
}

.board-card .compact-exchange-long {
  color: var(--feed-positive);
}

.board-card .compact-exchange-short {
  color: var(--feed-negative);
}

.board-card .signal-new,
.board-card .signal-stable {
  border-color: var(--feed-positive-border);
  background: var(--feed-positive-bg);
  color: var(--feed-positive);
}

.board-card .direction-long {
  background: var(--feed-positive-bg);
  color: var(--feed-positive);
  border-color: var(--feed-positive-border);
}

.board-card .direction-short {
  background: var(--feed-negative-bg);
  color: var(--feed-negative);
  border-color: var(--feed-negative-border);
}

.board-card .net-spread-pill {
  border-color: var(--feed-positive-border);
  background: var(--feed-positive-bg);
}

.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: 32px;
  min-width: 0;
  flex: 1 1 0;
  padding: 0 8px;
  font-size: 0.65rem;
  justify-content: center;
  white-space: nowrap;
}

.direction-long {
  background: rgba(255, 177, 98, 0.11);
  color: var(--positive);
  border: 1px solid rgba(255, 177, 98, 0.22);
}

.direction-short {
  background: rgba(163, 81, 57, 0.11);
  color: var(--negative);
  border: 1px solid rgba(163, 81, 57, 0.22);
}

body.theme-light .signal-stable {
  border-color: rgba(255, 177, 98, 0.3);
  background: rgba(255, 177, 98, 0.1);
  color: var(--positive);
}

body.theme-light .volume-pill {
  background: var(--panel-faint);
  border-color: var(--line-soft);
  color: var(--muted);
}

body.theme-light .spread-good,
body.theme-light .spread-main,
body.theme-light .profit-value {
  color: var(--positive);
}

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: var(--feed-positive);
}

body.theme-light .ff-metric-positive,
body.theme-light .ff-credit-text {
  color: var(--feed-positive);
}

body.theme-light .ff-metric-negative,
body.theme-light .ff-cost-text {
  color: var(--feed-negative);
}

body.theme-light .ff-metric-neutral {
  color: var(--muted);
}

body.theme-light .ff-data-bubble {
  background: var(--panel-mid);
  border-color: var(--line-soft);
}

body.theme-light .ff-volume-value {
  color: var(--brand-strong);
}

body.theme-light .board-card .volume-cell {
  color: var(--muted);
}

body.theme-light .board-card .compact-exchange-long {
  color: var(--feed-positive);
}

body.theme-light .board-card .compact-exchange-short {
  color: var(--feed-negative);
}

body.theme-light .net-spread-pill {
  background: rgba(255, 177, 98, 0.1);
  border-color: rgba(255, 177, 98, 0.22);
  color: var(--positive);
}

body.theme-light .funding-negative-text {
  color: var(--feed-positive);
}

body.theme-light .funding-positive-text {
  color: var(--feed-negative);
}

body.theme-light .direction-long {
  background: rgba(255, 177, 98, 0.1);
  color: var(--positive);
  border-color: rgba(255, 177, 98, 0.22);
}

body.theme-light .direction-short {
  background: rgba(163, 81, 57, 0.1);
  color: var(--negative);
  border-color: rgba(163, 81, 57, 0.2);
}

body.theme-light .board-card .signal-new,
body.theme-light .board-card .signal-stable {
  border-color: var(--feed-positive-border);
  background: var(--feed-positive-bg);
  color: var(--feed-positive);
}

body.theme-light .board-card .direction-long {
  background: var(--feed-positive-bg);
  color: var(--feed-positive);
  border-color: var(--feed-positive-border);
}

body.theme-light .board-card .direction-short {
  background: var(--feed-negative-bg);
  color: var(--feed-negative);
  border-color: var(--feed-negative-border);
}

body.theme-light .board-card .net-spread-pill {
  background: var(--feed-positive-bg);
  border-color: var(--feed-positive-border);
  color: var(--feed-positive);
}

.copy-chip,
.favorite-chip,
.blacklist-chip,
.hide-chip {
  min-height: 36px;
  padding: 0 12px;
  width: fit-content;
  border: 1px solid var(--line-soft);
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--veil-faint);
  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: var(--panel-mid);
  border-color: var(--line-soft);
}

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

.copy-chip:hover,
.favorite-chip:hover,
.blacklist-chip:hover,
.hide-chip:hover {
  text-decoration: none;
  background: var(--veil-mid);
  border-color: var(--line-heavy);
  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: var(--panel-top);
  border-color: rgba(255, 177, 98, 0.18);
}

.copy-chip-done {
  border-color: rgba(255, 177, 98, 0.3);
  color: var(--positive);
}

.favorite-chip {
  color: var(--warning);
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.favorite-chip-active {
  border-color: rgba(255, 177, 98, 0.28);
  background: rgba(255, 177, 98, 0.12);
  color: var(--warning);
}

.blacklist-chip {
  color: var(--negative);
  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: 6px 10px;
  border-radius: 14px;
}

.board-card-compact .arb-list {
  gap: 6px;
}

.board-card-compact .arb-group {
  gap: 4px;
}

.board-card-compact .ticker-block {
  display: grid;
  grid-template-rows: 22px 11px;
  align-content: center;
  justify-items: start;
  gap: 0;
  justify-content: center;
}

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

.board-card-compact .ticker-name {
  font-size: 0.94rem;
}

.board-card-compact .group-toggle-chip {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
}

.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 .spread-cell .secondary-bubble-track,
.board-card-compact .volume-cell .secondary-bubble-track,
.board-card-compact .funding-cell .secondary-bubble-track {
  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: 22px 11px;
  align-content: center;
  gap: 0;
}

.board-card-compact .compact-exchange-label {
  display: inline-flex;
  font-size: 0.52rem;
}

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

.board-card-compact .copy-chip-wide {
  min-height: 32px;
  max-width: 168px;
  padding: 0 10px;
  font-size: 0.72rem;
}

.board-card-compact .favorite-chip,
.board-card-compact .blacklist-chip {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
}

.board-card-compact .favorite-chip {
  font-size: 0.92rem;
}

.board-card-compact .blacklist-chip {
  font-size: 0.82rem;
}

@media (min-width: 1101px) {
  .board-card-compact .arb-list {
    gap: 6px;
  }

  .board-card-compact .arb-group {
    gap: 4px;
  }

  .board-card-compact .arb-row,
  .board-card-compact .arb-variant-row {
    grid-template-rows: none;
    align-items: center;
    padding: 7px 10px;
    border-radius: 14px;
  }

  .board-card-compact .arb-row > .ticker-block,
  .board-card-compact .arb-row > .numeric-cell-stack,
  .board-card-compact .arb-row > .spread-cell,
  .board-card-compact .arb-row > .volume-cell,
  .board-card-compact .arb-row > .profit-block,
  .board-card-compact .arb-row > .funding-cell,
  .board-card-compact .arb-row > .tv-block,
  .board-card-compact .arb-row > .actions-block,
  .board-card-compact .arb-variant-row > .ticker-block,
  .board-card-compact .arb-variant-row > .numeric-cell-stack,
  .board-card-compact .arb-variant-row > .spread-cell,
  .board-card-compact .arb-variant-row > .volume-cell,
  .board-card-compact .arb-variant-row > .profit-block,
  .board-card-compact .arb-variant-row > .funding-cell,
  .board-card-compact .arb-variant-row > .tv-block,
  .board-card-compact .arb-variant-row > .actions-block {
    grid-row: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1px;
    min-height: 0;
  }

  .board-card-compact .ticker-block,
  .board-card-compact .variant-ticker-cell {
    align-items: flex-start;
  }

  .board-card-compact .cell-primary {
    width: 100%;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 1px;
    min-height: 0;
  }

  .board-card-compact .ticker-primary {
    justify-items: start;
  }

  .board-card-compact .ticker-title-row {
    min-height: 22px;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .board-card-compact .ticker-name {
    font-size: 0.94rem;
  }

  .board-card-compact .group-toggle-chip {
    width: 24px;
    min-width: 24px;
    min-height: 24px;
  }

  .board-card-compact .mobile-cell-label {
    display: none;
  }

  .board-card-compact .compact-exchange-label {
    display: inline-flex;
    font-size: 0.52rem;
  }

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

  .board-card-compact .tv-block,
  .board-card-compact .actions-block {
    display: flex;
  }

  .board-card-compact .tv-block .cell-primary,
  .board-card-compact .actions-block .actions-secondary-track {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
  }

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

  .board-card-compact .copy-chip-wide {
    width: auto;
    min-height: 30px;
    max-width: 166px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .board-card-compact .favorite-chip,
  .board-card-compact .blacklist-chip {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  .board-card-compact .favorite-chip {
    font-size: 0.88rem;
  }

  .board-card-compact .blacklist-chip {
    font-size: 0.8rem;
  }

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

@media (min-width: 1101px) and (max-width: 1280px) {
  .board-card-compact .arb-table-head,
  .board-card-compact .arb-row,
  .board-card-compact .arb-variant-row {
    grid-template-columns: 1.62fr 0.88fr 0.88fr 0.82fr 0.9fr 0.78fr 1.42fr 0.66fr;
  }

  .board-card-compact .arb-table-head > :nth-child(7),
  .board-card-compact .arb-row > :nth-child(7),
  .board-card-compact .arb-variant-row > :nth-child(7) {
    display: none;
  }
}

.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 var(--line-soft);
  background: var(--panel-faint);
  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: var(--line-heavy);
  background: var(--veil-soft);
}

.service-status-ok {
  border-color: var(--feed-positive-border);
  background: linear-gradient(135deg, var(--feed-positive-bg), var(--panel-faint));
}

.service-status-idle {
  border-color: var(--line-mid);
}

.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: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .service-status-ok {
  background: linear-gradient(135deg, var(--feed-positive-bg), var(--panel-soft));
}

.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;
  max-height: calc(100vh - 176px);
  overflow: auto;
}

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

.settings-section {
  min-width: 0;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--veil-faint);
}

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

.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, 251, 245, 0.9);
  object-fit: contain;
  padding: 3px;
  box-shadow: inset 0 1px 0 rgba(238, 233, 223, 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: var(--veil-faint);
  box-shadow: inset 0 1px 0 var(--veil-faint);
}

.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 var(--line-mid);
  background: var(--panel-mid);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.user-create-field input:focus {
  border-color: rgba(44, 59, 77, 0.42);
  box-shadow: 0 0 0 4px rgba(44, 59, 77, 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 var(--line-soft);
  background: var(--panel-faint);
}

.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(255, 177, 98, 0.12);
  border: 1px solid rgba(255, 177, 98, 0.24);
  color: var(--success);
}

.profile-message-error {
  background: rgba(163, 81, 57, 0.12);
  border: 1px solid rgba(163, 81, 57, 0.24);
  color: var(--negative);
}

.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 var(--line-strong);
  background: var(--panel-faint);
  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: var(--line-heavy);
}

.profile-history-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--panel-faint);
}

.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 var(--line-soft);
  background: var(--panel-soft);
}

.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 var(--line-mid);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.profile-history-status-paid,
.profile-history-status-active {
  background: rgba(255, 177, 98, 0.12);
  border-color: rgba(255, 177, 98, 0.3);
  color: var(--success);
}

.profile-history-status-pending {
  background: rgba(255, 177, 98, 0.13);
  border-color: rgba(255, 177, 98, 0.3);
  color: var(--warning);
}

.profile-history-status-failed,
.profile-history-status-revoked,
.profile-history-status-expired {
  background: rgba(163, 81, 57, 0.13);
  border-color: rgba(163, 81, 57, 0.34);
  color: var(--negative);
}

.profile-history-badge {
  margin-left: 6px;
  background: rgba(44, 59, 77, 0.12);
  border-color: rgba(44, 59, 77, 0.3);
  color: var(--brand);
}

.profile-history-empty {
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed var(--line-mid);
  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: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .profile-message-success {
  background: rgba(255, 177, 98, 0.12);
  border-color: rgba(255, 177, 98, 0.2);
  color: var(--positive);
}

body.theme-light .profile-message-error {
  background: rgba(163, 81, 57, 0.12);
  border-color: rgba(163, 81, 57, 0.22);
  color: var(--negative);
}

body.theme-light .profile-history-row {
  background: var(--panel-mid);
  border-color: var(--line-soft);
}

body.theme-light .profile-history-block {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .profile-history-shell-icon {
  background: var(--panel-mid);
  border-color: var(--line-mid);
  color: rgba(44, 59, 77, 0.7);
}

body.theme-light .profile-history-shell[open] .profile-history-shell-icon {
  color: var(--brand-strong);
  border-color: var(--line-heavy);
}

body.theme-light .profile-history-status-paid,
body.theme-light .profile-history-status-active {
  background: rgba(255, 177, 98, 0.12);
  border-color: rgba(255, 177, 98, 0.24);
  color: var(--positive);
}

body.theme-light .profile-history-status-pending {
  background: rgba(255, 177, 98, 0.13);
  border-color: rgba(255, 177, 98, 0.26);
  color: var(--warning);
}

body.theme-light .profile-history-status-failed,
body.theme-light .profile-history-status-revoked,
body.theme-light .profile-history-status-expired {
  background: rgba(163, 81, 57, 0.12);
  border-color: rgba(163, 81, 57, 0.24);
  color: var(--negative);
}

body.theme-light .profile-history-badge {
  background: rgba(44, 59, 77, 0.12);
  border-color: rgba(44, 59, 77, 0.24);
  color: var(--brand);
}

.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: var(--positive);
  background: rgba(255, 177, 98, 0.12);
  border: 1px solid rgba(255, 177, 98, 0.24);
}

.payment-message-invalid,
.payment-message-used,
.payment-message-login_required {
  color: var(--negative);
  background: rgba(163, 81, 57, 0.12);
  border: 1px solid rgba(163, 81, 57, 0.24);
}

.payment-message-admin {
  color: var(--warning);
  background: rgba(255, 177, 98, 0.1);
  border: 1px solid rgba(255, 177, 98, 0.24);
}

body.theme-light .payment-message-success {
  color: var(--positive);
  background: rgba(255, 177, 98, 0.1);
  border-color: rgba(255, 177, 98, 0.22);
}

body.theme-light .payment-message-invalid,
body.theme-light .payment-message-used,
body.theme-light .payment-message-login_required {
  color: var(--negative);
  background: rgba(163, 81, 57, 0.1);
  border-color: rgba(163, 81, 57, 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, var(--accent), var(--accent-2));
  box-shadow: 0 18px 40px rgba(163, 81, 57, 0.24);
}

.login-error {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(163, 81, 57, 0.28);
  background: rgba(163, 81, 57, 0.1);
  color: var(--negative);
  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 var(--line-mid);
  background: var(--panel-mid);
  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(44, 59, 77, 0.42);
  box-shadow: 0 0 0 4px rgba(44, 59, 77, 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(27, 38, 50, 0.72);
  backdrop-filter: blur(10px);
}

body.theme-light .auth-modal-backdrop {
  background: var(--panel-strong);
}

.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: var(--veil-soft);
  border: 1px solid var(--line-soft);
  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 var(--line-faint);
  background: var(--veil-faint);
}

.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 var(--line-strong);
  background: var(--veil-faint);
}

.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 var(--line-soft);
  background: var(--panel-mid);
  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(44, 59, 77, 0.34);
  box-shadow: 0 0 0 4px rgba(44, 59, 77, 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 var(--line-soft);
  background: var(--panel-soft);
  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(255, 177, 98, 0.28);
}

body.theme-light .admin-foldout-summary::before {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

.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 var(--line-soft);
  background: var(--panel-soft);
  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: var(--panel-mid);
  border-color: var(--line-soft);
}

.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 var(--line-soft);
  background: var(--panel-faint);
}

body.theme-light .admin-user-row {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

.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 var(--line-mid);
  background: var(--panel-soft);
  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(255, 177, 98, 0.12);
  border-color: rgba(255, 177, 98, 0.32);
  color: var(--success);
}

.admin-user-subscription .admin-subscription-warning {
  background: rgba(255, 177, 98, 0.13);
  border-color: rgba(255, 177, 98, 0.34);
  color: var(--warning);
}

.admin-user-subscription .admin-subscription-critical,
.admin-user-subscription .admin-subscription-expired {
  background: rgba(163, 81, 57, 0.13);
  border-color: rgba(163, 81, 57, 0.38);
  color: var(--negative);
}

.admin-user-subscription .admin-subscription-admin {
  background: rgba(44, 59, 77, 0.12);
  border-color: rgba(44, 59, 77, 0.34);
  color: var(--brand);
}

.admin-user-subscription .admin-subscription-none {
  background: var(--line-soft);
  border-color: var(--line-strong);
  color: var(--muted);
}

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

body.theme-light .admin-user-subscription .admin-subscription-active {
  background: rgba(255, 177, 98, 0.12);
  border-color: rgba(255, 177, 98, 0.28);
  color: var(--positive);
}

body.theme-light .admin-user-subscription .admin-subscription-warning {
  background: rgba(255, 177, 98, 0.13);
  border-color: rgba(255, 177, 98, 0.3);
  color: var(--warning);
}

body.theme-light .admin-user-subscription .admin-subscription-critical,
body.theme-light .admin-user-subscription .admin-subscription-expired {
  background: rgba(163, 81, 57, 0.12);
  border-color: rgba(163, 81, 57, 0.32);
  color: var(--negative);
}

body.theme-light .admin-user-subscription .admin-subscription-admin {
  background: rgba(44, 59, 77, 0.12);
  border-color: rgba(44, 59, 77, 0.28);
  color: var(--brand);
}

.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 var(--line-soft);
  background: var(--panel-soft);
  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: var(--panel-mid);
  border-color: var(--line-soft);
}

.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 var(--line-soft);
  background: var(--panel-faint);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

body.theme-light .admin-payment-row {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

.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 var(--line-soft);
  background: var(--veil-faint);
}

.route-setting-row input {
  width: 92px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-mid);
  background: var(--panel-mid);
  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 var(--veil-faint);
}

.exchange-runtime-ok {
  background: var(--feed-positive);
}

.exchange-runtime-partial {
  background: var(--accent);
}

.exchange-runtime-timeout {
  background: var(--warning);
}

.exchange-runtime-warn {
  background: var(--warning);
}

.exchange-runtime-info {
  background: var(--accent);
}

.exchange-runtime-ssl {
  background: var(--feed-negative);
}

.exchange-runtime-dns {
  background: var(--muted);
}

.exchange-runtime-rate_limit {
  background: var(--warning);
}

.exchange-runtime-error {
  background: var(--feed-negative);
}

.exchange-runtime-empty,
.exchange-runtime-cooldown {
  background: var(--warning);
}

.exchange-runtime-idle,
.exchange-runtime-off,
.exchange-runtime-forced_off {
  background: var(--brand);
}

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

.exchange-error-text {
  margin: -4px 0 2px 54px;
  color: var(--feed-negative);
  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 var(--line-soft);
  background: var(--panel-faint);
}

.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 var(--line-soft);
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.76rem;
}

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

.system-runtime-ok {
  border-color: var(--feed-positive-border);
}

.system-runtime-ok strong {
  color: var(--feed-positive);
}

.system-runtime-warn {
  border-color: rgba(255, 177, 98, 0.26);
}

.system-runtime-warn strong {
  color: var(--warning);
}

.system-snapshot-panel {
  background: linear-gradient(135deg, rgba(255, 177, 98, 0.1), var(--panel-faint));
}

.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 var(--line-soft);
  background: var(--veil-faint);
  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 var(--line-soft);
  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: var(--veil-faint);
  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: linear-gradient(90deg, var(--feed-positive-bg), transparent 68%);
}

.system-table-row-partial {
  background: linear-gradient(90deg, rgba(255, 177, 98, 0.08), transparent 68%);
}

.system-table-row-warn,
.system-table-row-timeout,
.system-table-row-slow,
.system-table-row-empty,
.system-table-row-cooldown {
  background: linear-gradient(90deg, rgba(255, 177, 98, 0.1), transparent 68%);
}

.system-table-row-error,
.system-table-row-ssl,
.system-table-row-dns,
.system-table-row-rate_limit {
  background: linear-gradient(90deg, var(--feed-negative-bg), transparent 68%);
}

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

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

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

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

.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 var(--line-soft);
  background: var(--panel-faint);
}

.system-event-info {
  border-color: rgba(44, 59, 77, 0.22);
  background: linear-gradient(90deg, rgba(44, 59, 77, 0.1), var(--panel-faint));
}

.system-event-warn {
  border-color: rgba(255, 177, 98, 0.28);
  background: linear-gradient(90deg, rgba(255, 177, 98, 0.12), var(--panel-faint));
}

.system-event-error {
  border-color: rgba(163, 81, 57, 0.3);
  background: linear-gradient(90deg, rgba(163, 81, 57, 0.14), var(--panel-faint));
}

.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: var(--panel-soft);
  border: 1px solid var(--line-soft);
}

.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 var(--line-soft);
  background: var(--panel-faint);
  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: var(--feed-positive-border);
  background: linear-gradient(90deg, var(--feed-positive-bg), var(--panel-faint));
}

.system-health-status-ok .system-exchange-name {
  color: var(--feed-positive);
  border-color: var(--feed-positive-border);
  background: var(--feed-positive-bg);
}

.system-health-status-partial {
  border-color: rgba(201, 193, 177, 0.24);
  background: linear-gradient(90deg, rgba(201, 193, 177, 0.12), var(--panel-faint));
}

.system-health-status-partial .system-exchange-name {
  color: var(--warning);
  border-color: rgba(255, 177, 98, 0.24);
  background: rgba(255, 177, 98, 0.1);
}

.system-health-status-slow,
.system-health-status-timeout,
.system-health-status-empty,
.system-health-status-cooldown {
  border-color: rgba(255, 177, 98, 0.28);
  background: linear-gradient(90deg, rgba(255, 177, 98, 0.13), var(--panel-faint));
}

.system-health-status-slow .system-exchange-name,
.system-health-status-timeout .system-exchange-name,
.system-health-status-empty .system-exchange-name,
.system-health-status-cooldown .system-exchange-name {
  color: var(--warning);
  border-color: rgba(255, 177, 98, 0.24);
  background: rgba(255, 177, 98, 0.1);
}

.system-health-status-error,
.system-health-status-ssl,
.system-health-status-dns,
.system-health-status-rate_limit {
  border-color: var(--feed-negative-border);
  background: linear-gradient(90deg, rgba(201, 120, 99, 0.14), var(--panel-faint));
}

.system-health-status-error .system-exchange-name,
.system-health-status-ssl .system-exchange-name,
.system-health-status-dns .system-exchange-name,
.system-health-status-rate_limit .system-exchange-name {
  color: var(--feed-negative);
  border-color: var(--feed-negative-border);
  background: var(--feed-negative-bg);
}

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

.system-exchange-name {
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  font-weight: 800;
}

.system-count-chip {
  min-width: 92px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-faint);
  border: 1px solid var(--line-soft);
  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: var(--feed-positive);
  background: var(--feed-positive-bg);
  border-color: var(--feed-positive-border);
}

.system-freshness-stale {
  color: var(--warning);
  background: rgba(255, 177, 98, 0.1);
  border-color: rgba(255, 177, 98, 0.24);
}

.system-freshness-dead {
  color: var(--feed-negative);
  background: var(--feed-negative-bg);
  border-color: var(--feed-negative-border);
}

.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: var(--panel-soft);
  border: 1px solid var(--line-soft);
}

.system-retry-link {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 177, 98, 0.22);
  color: var(--accent);
  background: rgba(255, 177, 98, 0.08);
  text-decoration: none;
  font-weight: 700;
}

.system-retry-link:hover {
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 177, 98, 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: var(--feed-negative);
  border-color: var(--feed-negative-border);
  background: var(--feed-negative-bg);
}

.system-disable-link:hover {
  color: var(--text);
  background: rgba(163, 81, 57, 0.14);
}

.system-enable-link {
  color: var(--feed-positive);
  border-color: var(--feed-positive-border);
  background: var(--feed-positive-bg);
}

.system-enable-link:hover {
  color: var(--text);
  background: rgba(255, 177, 98, 0.14);
}

body.theme-light .system-health-meta span {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .system-event-row {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .system-event-info {
  background: linear-gradient(90deg, rgba(44, 59, 77, 0.12), var(--panel-soft));
}

body.theme-light .system-event-warn {
  background: linear-gradient(90deg, rgba(255, 177, 98, 0.12), var(--panel-soft));
}

body.theme-light .system-event-error {
  background: linear-gradient(90deg, rgba(163, 81, 57, 0.1), var(--panel-soft));
}

body.theme-light .system-event-meta span,
body.theme-light .system-event-empty {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .system-runtime-panel,
body.theme-light .system-runtime-chip {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .system-count-chip {
  background: var(--panel-faint);
  border-color: var(--line-soft);
}

body.theme-light .system-freshness-fresh {
  color: var(--feed-positive);
  background: var(--feed-positive-bg);
}

body.theme-light .system-freshness-stale {
  color: var(--warning);
  background: rgba(255, 177, 98, 0.1);
}

body.theme-light .system-freshness-dead {
  color: var(--feed-negative);
  background: var(--feed-negative-bg);
}

body.theme-light .system-table-row-ok {
  background: linear-gradient(90deg, var(--feed-positive-bg), transparent 68%);
}

body.theme-light .system-table-row-partial {
  background: linear-gradient(90deg, rgba(255, 177, 98, 0.08), transparent 68%);
}

body.theme-light .system-table-row-warn,
body.theme-light .system-table-row-timeout,
body.theme-light .system-table-row-slow,
body.theme-light .system-table-row-empty,
body.theme-light .system-table-row-cooldown {
  background: linear-gradient(90deg, rgba(255, 177, 98, 0.1), transparent 68%);
}

body.theme-light .system-table-row-error,
body.theme-light .system-table-row-ssl,
body.theme-light .system-table-row-dns,
body.theme-light .system-table-row-rate_limit {
  background: linear-gradient(90deg, var(--feed-negative-bg), transparent 68%);
}

body.theme-light .system-health-status-ok {
  background: linear-gradient(90deg, var(--feed-positive-bg), var(--panel-soft));
}

body.theme-light .system-health-status-ok .system-exchange-name {
  color: var(--feed-positive);
  border-color: var(--feed-positive-border);
  background: var(--feed-positive-bg);
}

body.theme-light .system-health-status-partial {
  background: linear-gradient(90deg, rgba(201, 193, 177, 0.12), var(--panel-soft));
}

body.theme-light .system-health-status-partial .system-exchange-name {
  color: var(--warning);
  border-color: rgba(255, 177, 98, 0.24);
  background: rgba(255, 177, 98, 0.1);
}

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(255, 177, 98, 0.12), var(--panel-soft));
}

body.theme-light .system-health-status-slow .system-exchange-name,
body.theme-light .system-health-status-timeout .system-exchange-name,
body.theme-light .system-health-status-empty .system-exchange-name,
body.theme-light .system-health-status-cooldown .system-exchange-name {
  color: var(--warning);
  border-color: rgba(255, 177, 98, 0.24);
  background: rgba(255, 177, 98, 0.1);
}

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, var(--feed-negative-bg), var(--panel-soft));
}

body.theme-light .system-health-status-error .system-exchange-name,
body.theme-light .system-health-status-ssl .system-exchange-name,
body.theme-light .system-health-status-dns .system-exchange-name,
body.theme-light .system-health-status-rate_limit .system-exchange-name {
  color: var(--feed-negative);
  border-color: var(--feed-negative-border);
  background: var(--feed-negative-bg);
}

body.theme-light .system-retry-link {
  color: var(--positive);
  border-color: rgba(255, 177, 98, 0.2);
  background: rgba(255, 177, 98, 0.08);
}

body.theme-light .system-disable-link {
  color: var(--feed-negative);
  border-color: var(--feed-negative-border);
  background: var(--feed-negative-bg);
}

body.theme-light .system-enable-link {
  color: var(--feed-positive);
  border-color: var(--feed-positive-border);
  background: var(--feed-positive-bg);
}

.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: var(--veil-soft);
  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, var(--brand), var(--brand-strong));
  color: var(--bg);
}

@media (max-width: 1184px) {
  .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 var(--veil-mid);
    background: rgba(27, 38, 50, 0.88);
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  body.theme-light .mobile-menu-button {
    background: rgba(255, 251, 245, 0.88);
    border-color: var(--line-soft);
    box-shadow: 0 14px 36px rgba(27, 38, 50, 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 var(--line-strong);
    background: var(--panel-top);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
  }

  body.theme-light .mobile-menu-panel {
    background: var(--panel-solid);
    border-color: var(--line-soft);
    box-shadow: 0 24px 64px rgba(27, 38, 50, 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 var(--line-soft);
    background: var(--veil-soft);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 900;
    text-decoration: none;
  }

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

  .mobile-menu-link-active {
    border-color: rgba(44, 59, 77, 0.34);
    background: linear-gradient(180deg, rgba(44, 59, 77, 0.22), rgba(27, 38, 50, 0.14));
  }

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

  body.theme-light .mobile-menu-link {
    background: var(--panel-mid);
    border-color: var(--line-soft);
  }

  .mobile-user-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid var(--line-soft);
    background: var(--veil-faint);
  }

  body.theme-light .mobile-user-panel {
    background: var(--panel-mid);
    border-color: var(--line-soft);
  }

  .mobile-user-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
  }

  .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: 700;
  }

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

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

  .arbitrage-layout {
    gap: 12px;
  }

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

  .filter-drawer,
  .filter-drawer:not([open]) {
    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 var(--line-mid);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(44, 59, 77, 0.94), rgba(27, 38, 50, 0.9));
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  body.theme-light .filter-drawer-summary {
    background: linear-gradient(180deg, var(--panel-mid), rgba(201, 193, 177, 0.2));
    border-color: var(--line-soft);
  }

  .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: 700;
    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 var(--line-mid);
    background: var(--veil-soft);
    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-mode {
    display: grid;
    grid-template-columns: 1fr;
  }

  .preset-bubble-button-mode {
    font-size: 0.90rem;
    padding-inline: 10px;
  }

  .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;
  }

  .preset-picker {
    width: 100%;
  }

  .preset-picker-trigger {
    width: 100%;
  }

  .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 var(--line-mid);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(44, 59, 77, 0.94), rgba(27, 38, 50, 0.9));
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  body.theme-light .filter-drawer-summary {
    background: linear-gradient(180deg, var(--panel-mid), rgba(201, 193, 177, 0.2));
    border-color: var(--line-soft);
  }

  .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: 700;
    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 var(--line-mid);
    background: var(--veil-soft);
    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-picker {
    width: 100%;
  }

  .preset-picker-trigger {
    width: 100%;
  }

  .preset-picker-menu {
    position: static;
    inset: auto;
    margin-top: 8px;
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .preset-bubble-row-picker {
    grid-template-columns: 1fr;
  }

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

  .section-head-title-row {
    justify-content: space-between;
    gap: 8px;
  }

  .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: 8px;
    padding: 12px;
  }

  .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: 0;
  }

  .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: 2px;
    text-align: center;
  }

  .numeric-cell-stack,
  .spread-cell,
  .funding-cell {
    min-height: 88px;
    padding: 8px 10px;
    border: 1px solid var(--line-faint);
    border-radius: 16px;
    background: var(--veil-faint);
    justify-content: center;
  }

  .board-card-compact .numeric-cell-stack,
  .board-card-compact .spread-cell,
  .board-card-compact .funding-cell {
    min-height: 64px;
    padding: 8px;
    border: 1px solid var(--line-faint);
    border-radius: 16px;
    background: var(--veil-faint);
    justify-content: center;
  }

  .board-card-compact .secondary-bubble-track,
  .board-card-compact .ticker-secondary-track {
    display: none;
  }

  body.theme-light .numeric-cell-stack,
  body.theme-light .spread-cell,
  body.theme-light .funding-cell {
    background: var(--panel-mid);
    border-color: var(--line-faint);
  }

  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: var(--panel-mid);
    border-color: var(--line-faint);
  }

  .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 .cell-primary,
  .board-card-compact .numeric-cell-stack .cell-primary {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
  }

  .spread-cell .cell-primary,
  .funding-cell .cell-primary,
  .board-card-compact .spread-cell .cell-primary,
  .board-card-compact .funding-cell .cell-primary {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
  }

  .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;
  }

  .ff-supporting-metric {
    gap: 2px;
  }

  .ff-data-bubble {
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
  }

  .ff-supporting-metric-label {
    font-size: 0.52rem;
  }

  .ff-supporting-metric-value {
    font-size: 0.68rem;
  }

  .ff-funding-breakdown {
    gap: 1px;
    max-width: 132px;
  }

  .ff-volume-bubble {
    gap: 1px;
  }

  .ff-funding-line {
    gap: 4px;
  }

  .ff-funding-side {
    font-size: 0.5rem;
  }

  .ff-funding-value {
    font-size: 0.58rem;
  }


  .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;
  }

  .copy-chip-wide {
    width: 100%;
    max-width: 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);
  }
}
