:root {
  color-scheme: dark;
  --bg: #070808;
  --panel: #101112;
  --panel-2: #151719;
  --panel-3: #1c1f22;
  --text: #e8e9ec;
  --muted: #8e939c;
  --line: #282b2f;
  --soft-line: #1d2024;
  --entry: #4fbd65;
  --exit: #d94b70;
  /* === АКВА — сигнатурный акцент Lara Soft (был near-white) === */
  --accent: #1ed6e0;
  --accent-2: #5ee9f2;
  --accent-deep: #0aa6bc;
  --accent-soft: #9bf1f8;
  --accent-glow: rgba(30, 214, 224, 0.34);
  --focus: #1ed6e0;
  --warn: #ff6b6b;
  --gold: #e3bd5f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #04282b;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.18s ease, transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

button:not(.secondary):not(.danger):not(:disabled):hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px -8px var(--accent-glow);
  transform: translateY(-1px);
}

button.secondary {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}

button.secondary:hover {
  border-color: rgba(30, 214, 224, 0.4);
  color: var(--text);
}

button.danger {
  border-color: rgba(217, 75, 112, 0.55);
  background: transparent;
  color: #ff6f91;
  font-weight: 600;
}

button.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0c0d;
  color: var(--text);
  padding: 6px 9px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(30, 214, 224, 0.2);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.secret-input {
  -webkit-text-security: disc;
}

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

.hidden {
  display: none !important;
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 44% at 50% -8%, rgba(30, 214, 224, 0.14), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 108%, rgba(30, 214, 224, 0.08), transparent 60%);
}

.auth-panel {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 30px;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.auth-brand {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(30, 214, 224, 0.3));
}

.auth-panel h1,
.topbar h1 {
  margin: 0;
  letter-spacing: 0;
}

.auth-panel h1 {
  font-size: 32px;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

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

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

.error-line.success-line {
  color: var(--green);
}

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

.app-shell {
  display: grid;
  gap: 8px;
  padding: 10px 12px 16px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.topbar h1 {
  font-size: 19px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(30, 214, 224, 0.26));
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px 6px 6px 2px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 52%, var(--accent-deep) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 20px rgba(30, 214, 224, 0.3);
  transform: skew(8deg);
}

.topbar h1 span {
  color: var(--muted);
  font-size: 15px;
}

.topbar p {
  margin: 4px 0 0;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.app-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.app-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.app-tabs a.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.view-stack,
.scanner-view,
.wiki-view,
.admin-view,
.settings-view {
  display: grid;
  gap: 8px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.online {
  border-color: rgba(47, 158, 84, 0.35);
  color: var(--entry);
  background: rgba(47, 158, 84, 0.08);
}

.status-pill.idle {
  border-color: rgba(47, 158, 84, 0.24);
  color: var(--entry);
  background: rgba(47, 158, 84, 0.05);
}

.status-pill.degraded {
  border-color: rgba(230, 185, 80, 0.38);
  color: #d6b15f;
}

.pro-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #04282b;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 16px -8px var(--accent-glow);
  transition: filter 0.15s ease, transform 0.12s ease;
}
.pro-pill:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.tradebar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.92fr) 40px minmax(150px, 0.92fr) 96px 40px minmax(145px, 1fr) minmax(145px, 1fr) minmax(94px, 0.66fr) minmax(94px, 0.66fr);
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  padding: 6px;
}

.level-field {
  width: 96px;
  min-height: 46px;
  align-content: center;
  align-self: stretch;
  gap: 3px;
  font-size: 11px;
  line-height: 1;
}

.level-field select {
  min-height: 32px;
  border-radius: 7px;
  padding: 0 24px 0 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 11px center / 6px 6px no-repeat,
    #0b0c0d;
}

.symbol-menu {
  position: relative;
  align-self: stretch;
}

.symbol-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  padding: 0 11px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  list-style: none;
  white-space: nowrap;
}

.symbol-menu summary::after {
  content: "⌄";
  color: var(--muted);
}

.symbol-menu[open] summary::after {
  content: "⌃";
}

.symbol-menu summary::-webkit-details-marker {
  display: none;
}

.symbol-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(390px, 90vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
  z-index: 10;
}

.result-row {
  width: 100%;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  border-color: var(--line);
  background: var(--panel-3);
  color: var(--text);
  font-weight: 800;
}

.recent-symbols {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.recent-symbols > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.recent-symbols-list {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}

.recent-symbols-list button {
  min-height: 32px;
  justify-content: space-between;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.recent-symbols-list button:hover {
  background: var(--panel-3);
}

.recent-symbols-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.exchange-picker {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
  background: var(--panel-2);
}

.exchange-picker span,
.market-stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.exchange-picker.long span,
.role-pill.long {
  color: var(--entry);
}

.exchange-picker.short span,
.role-pill.short {
  color: var(--exit);
}

.exchange-button {
  min-height: 32px;
  border-color: var(--line);
  background: #0b0c0d;
  color: var(--text);
  text-align: left;
  padding: 0 9px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-button::after {
  content: "⌄";
  float: right;
  color: var(--muted);
}

.exchange-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 220px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 8px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
  z-index: 12;
}

.exchange-option {
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 8px;
  text-align: left;
}

.exchange-option:hover {
  background: var(--panel-3);
}

.exchange-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.exchange-option.unsupported {
  opacity: 0.48;
  cursor: not-allowed;
}

.exchange-option[disabled] {
  opacity: 0.45;
}

.exchange-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #24272b;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.exchange-check {
  color: var(--entry);
  font-weight: 900;
}

.icon-button {
  min-width: 40px;
  padding: 0;
  align-self: stretch;
  font-size: 16px;
  line-height: 1;
}

.links-menu {
  position: relative;
  align-self: stretch;
}

.links-menu summary {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  cursor: pointer;
  list-style: none;
}

.links-menu summary::-webkit-details-marker {
  display: none;
}

.links-menu[open] summary {
  border-color: var(--accent);
}

.links-menu a {
  display: block;
  padding: 9px 12px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.links-menu a:hover {
  background: var(--panel-3);
}

.links-menu::details-content,
.links-menu[open] {
  z-index: 5;
}

.links-menu[open] a:first-of-type {
  border-top: 1px solid var(--line);
}

.links-menu[open]::after {
  content: "";
  position: absolute;
  inset: 40px auto auto 0;
  width: 140px;
  height: calc(100% - 40px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.36);
  z-index: -1;
}

.market-stat {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 46px;
  border-left: 1px solid var(--soft-line);
  padding-left: 8px;
}

.market-stat span {
  font-size: 9px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-stat strong {
  font-size: 12px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-stat.compact strong {
  font-size: 12px;
}

.toggle-line {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.toggle-line input {
  width: 18px;
  min-height: 18px;
}

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

.chart-controls {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-controls label {
  width: 160px;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0c0d;
  overflow: hidden;
}

.input-with-unit input {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.unit-toggle {
  min-height: 34px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  padding: 0 12px;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--accent);
  color: #08090a;
}

.market-mode-buttons {
  align-self: end;
}

.transfer-status {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-left: 6px;
  vertical-align: middle;
}

.transfer-letter {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  min-height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.transfer-letter.open {
  color: var(--green);
  border-color: rgba(70, 211, 105, 0.45);
  background: rgba(70, 211, 105, 0.12);
}

.transfer-letter.closed {
  color: var(--red);
  border-color: rgba(220, 70, 118, 0.45);
  background: rgba(220, 70, 118, 0.14);
}

.transfer-letter.unknown {
  color: var(--muted);
  border-color: var(--line);
  background: var(--panel-2);
}

.small-text {
  font-size: 11px;
}

.chart-section {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  padding: 9px;
}

.chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 6px;
}

.chart-heading h2,
.panel h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.legend {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.entry-dot {
  background: var(--entry);
}

.exit-dot {
  background: var(--exit);
}

canvas {
  width: 100%;
  height: 375px;
  display: block;
}

#spread-chart {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#spread-chart:active {
  cursor: grabbing;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 40vw);
  gap: 8px;
  align-items: start;
}

.left-workspace {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.orderbooks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.orderbook-panel {
  --book-row-height: 22px;
  min-width: 0;
  min-height: calc((var(--book-rows, 10) * var(--book-row-height) * 2) + 86px);
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  overflow: hidden;
}

.orderbook-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
}

.orderbook-panel h2 {
  margin: 1px 0 0;
  font-size: 13px;
}

.orderbook-panel header strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.role-pill {
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.book-table {
  display: grid;
  min-height: calc((var(--book-rows, 10) * var(--book-row-height) * 2) + 48px);
}

.book-side {
  display: grid;
  grid-auto-rows: var(--book-row-height);
  height: calc(var(--book-rows, 10) * var(--book-row-height));
  min-height: calc(var(--book-rows, 10) * var(--book-row-height));
  overflow: hidden;
}

.book-head,
.book-row {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) minmax(62px, 0.86fr) minmax(66px, 1fr);
  gap: 6px;
  align-items: center;
}

.book-head {
  padding: 5px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.book-row {
  position: relative;
  min-height: 22px;
  padding: 0 8px;
  overflow: hidden;
  font-size: 11px;
  background: #090a0b;
  font-variant-numeric: tabular-nums;
}

.book-row.empty {
  color: transparent;
}

.book-row span {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-row span:nth-child(2),
.book-row span:nth-child(3),
.book-head span:nth-child(2),
.book-head span:nth-child(3) {
  text-align: right;
}

.book-row::before {
  content: "";
  position: absolute;
  inset: 1px 0 1px auto;
  width: calc(var(--depth, 0) * 1%);
  opacity: 0.18;
}

.asks .book-row {
  color: var(--exit);
}

.asks .book-row::before {
  background: var(--exit);
}

.bids .book-row {
  color: var(--entry);
}

.bids .book-row::before {
  background: var(--entry);
}

.book-mid {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--entry);
  font-variant-numeric: tabular-nums;
}

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

.metrics-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  padding: 10px 12px;
}

.metric-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.metrics-grid strong {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.metric-range {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.metric-range span {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.metric-range span.positive {
  color: var(--entry);
}

.metric-range span.negative {
  color: var(--exit);
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 12px;
}

.panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.account-secret-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.account-secret-row p {
  margin: 0 0 6px;
}

.masked-email {
  letter-spacing: 0.02em;
}

.settings-form {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.settings-form button {
  justify-self: start;
}

.scanner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
}

.scanner-head h2,
.scanner-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.scanner-head p,
.scanner-panel p {
  margin: 6px 0 0;
}

.sub-tabs {
  display: flex;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.sub-tabs a,
.sub-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-2);
  color: var(--muted);
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
}

.sub-tabs a:last-child,
.sub-tabs button:last-child {
  border-right: 0;
}

.sub-tabs a.active,
.sub-tabs button.active {
  background: var(--accent);
  color: #08090a;
}

.wiki-hero {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #151821 0%, #101112 100%);
  padding: 24px;
}

.wiki-hero h2 {
  max-width: 980px;
  margin: 4px 0 10px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: 0;
}

.wiki-hero p:last-child {
  max-width: 920px;
  margin: 0;
  color: #aeb4c2;
  font-size: 17px;
  line-height: 1.45;
}

.wiki-menu-view {
  display: grid;
  gap: 28px;
  padding: 10px 8px 24px;
  background: #24283a;
}

.wiki-title {
  text-align: center;
}

.wiki-title h2 {
  margin: 0;
  color: #d7dbea;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 750;
  letter-spacing: 0;
}

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

.wiki-card {
  min-height: 250px;
  border: 1px solid #303548;
  background: #24283a;
  padding: 24px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
}

.wiki-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.wiki-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #34325d;
  color: #8b7cff;
  font-size: 22px;
  font-weight: 900;
}

.wiki-card h3 {
  margin: 0;
  color: #dce0ef;
  font-size: 22px;
  letter-spacing: 0;
}

.wiki-link-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiki-link-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #b9bfd1;
  padding: 0;
  text-decoration: none;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.wiki-link-list button::after {
  content: "›";
  color: #8b92cf;
  font-size: 24px;
  line-height: 1;
}

.wiki-link-list button:hover {
  color: #f0f2fb;
}

.wiki-article-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 28px;
  padding: 28px 26px 42px;
  background: #24283a;
}

.wiki-full-article {
  min-width: 0;
  max-width: 1100px;
}

.wiki-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  color: #b9bfd1;
  font-size: 15px;
  font-weight: 750;
}

.wiki-breadcrumb button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: #8b7cff;
  padding: 0;
  font-weight: 850;
}

.wiki-breadcrumb span {
  color: #aeb4c2;
}

.wiki-breadcrumb span:last-child {
  color: #d7dbea;
}

.wiki-full-article h2 {
  margin: 0 0 20px;
  color: #eef0f7;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: 0;
}

.wiki-updated {
  margin: 0 0 28px;
  color: #8790c8;
  font-size: 15px;
  font-weight: 650;
}

.wiki-readable {
  display: grid;
  gap: 22px;
  max-width: 980px;
  border-top: 1px solid #3b4056;
  padding-top: 28px;
  color: #c1c6d6;
  font-size: 18px;
  line-height: 1.65;
}

.wiki-readable p,
.wiki-readable ol {
  margin: 0;
}

.wiki-readable ol {
  padding-left: 24px;
}

.wiki-readable li + li {
  margin-top: 10px;
}

.wiki-readable strong {
  color: #f4f5fb;
}

.wiki-related-panel {
  align-self: start;
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
}

.wiki-related-panel h3 {
  margin: 0;
  border-radius: 8px;
  background: #303448;
  color: #dce0ef;
  padding: 18px 20px;
  font-size: 22px;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.wiki-related-list {
  display: grid;
  gap: 0;
}

.wiki-related-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid rgba(139, 146, 207, 0.16);
  border-radius: 0;
  background: transparent;
  color: #c1c6d6;
  padding: 0 8px 0 20px;
  text-align: left;
}

.wiki-related-list button::after {
  content: "›";
  color: #8b92cf;
  font-size: 28px;
  line-height: 1;
}

.wiki-related-list button:hover {
  color: #f4f5fb;
}

.wiki-article-list {
  display: grid;
  gap: 10px;
}

.wiki-article {
  border: 1px solid var(--line);
  background: var(--panel);
}

.wiki-article summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.wiki-article summary::-webkit-details-marker {
  display: none;
}

.wiki-article summary span:first-child {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.wiki-article summary span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.wiki-article summary::after {
  content: "⌄";
  color: #8b92cf;
  font-size: 18px;
  font-weight: 900;
}

.wiki-article[open] summary {
  border-bottom: 1px solid var(--soft-line);
}

.wiki-article[open] summary::after {
  content: "⌃";
}

.wiki-article-body {
  display: grid;
  gap: 12px;
  max-width: 1040px;
  padding: 18px;
  color: #b9bfd1;
  font-size: 15px;
  line-height: 1.55;
}

.wiki-article-body p,
.wiki-article-body ol {
  margin: 0;
}

.wiki-article-body ol {
  padding-left: 22px;
}

.wiki-article-body li + li {
  margin-top: 8px;
}

.wiki-article-body strong {
  color: #f0f2fb;
}

.scanner-tab-panel {
  display: grid;
  gap: 12px;
}

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

.scanner-panel,
.scanner-table-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
}

.scanner-panel {
  display: grid;
  gap: 14px;
}

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

.multi-row,
.scanner-fields {
  display: grid;
  gap: 10px;
}

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

.scanner-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-scanner-form {
  gap: 10px;
}

.scanner-settings-grid {
  width: min(780px, 100%);
  display: grid;
  gap: 14px;
}

.scanner-row {
  display: grid;
  gap: 12px;
  align-items: end;
}

.pair-row {
  grid-template-columns: minmax(220px, 1fr) 28px minmax(220px, 1fr);
}

.two-field-row {
  grid-template-columns: repeat(2, minmax(180px, 320px));
}

.scanner-actions-row {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.scanner-control-strip {
  display: grid;
  grid-template-columns: minmax(148px, 0.75fr) 26px minmax(148px, 0.75fr) repeat(5, minmax(92px, 0.5fr)) 92px;
  align-items: end;
  gap: 9px;
}

.mini-field {
  gap: 5px;
  min-width: 0;
  color: #b7bcc8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mini-field > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 16px;
  white-space: nowrap;
}

.mini-field input,
.mini-field select,
.scanner-exchange-picker summary {
  min-height: 38px;
  border-color: #343948;
  border-radius: 7px;
  background: #11141a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.mini-field input {
  padding: 7px 9px;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.scanner-switch-field {
  align-content: start;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text);
  text-transform: none;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  width: 48px;
  height: 26px;
  border: 1px solid #3a4050;
  border-radius: 999px;
  background: #171b22;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #98a0ad;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, background 0.16s ease;
}

.switch-control input:checked + .switch-slider {
  border-color: rgba(102, 196, 113, 0.75);
  background: rgba(102, 196, 113, 0.2);
}

.switch-control input:checked + .switch-slider::after {
  transform: translateX(22px);
  background: #66c471;
}

.switch-control input:focus-visible + .switch-slider {
  outline: 2px solid #85b9ff;
  outline-offset: 2px;
}

.switch-label {
  color: #b7bcc8;
  font-size: 13px;
  font-weight: 850;
}

.exchange-field {
  display: grid;
  width: 100%;
  justify-self: stretch;
}

.exchange-field .multi-select {
  width: 100%;
}

.scanner-exchange-picker {
  display: block;
  width: 100%;
  min-height: 60px;
  border: 1px solid #343948;
  border-radius: 8px;
  background: #11141a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.scanner-exchange-picker summary {
  box-sizing: border-box;
  width: 100%;
  min-height: 58px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.scanner-exchange-picker summary:hover,
.scanner-exchange-picker[open] summary {
  background: transparent;
}

.scanner-exchange-picker:hover,
.scanner-exchange-picker[open] {
  border-color: #6f7fb1;
  background: #171b25;
}

.pair-arrow {
  display: grid;
  place-items: center;
  min-height: 38px;
  color: #c7ccd8;
  font-size: 18px;
  font-weight: 900;
}

.scanner-start-button,
.roadmap-done-button {
  min-height: 38px;
  border-color: #e3e6ef;
  font-weight: 850;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease, transform 0.12s ease;
}

.scanner-start-button:not(:disabled):active,
.roadmap-done-button:not(:disabled):active {
  transform: translateY(1px);
}

.scanner-start-button.is-loading,
.roadmap-done-button.is-loading {
  border-color: #6f7fb1;
  background: #202638;
  color: #e6e9f4;
}

.scanner-start-button.is-success,
.roadmap-done-button.is-success {
  border-color: rgba(102, 196, 113, 0.75);
  background: rgba(102, 196, 113, 0.14);
  color: #8ee39a;
  opacity: 1;
}

.info-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #c8cde3;
  color: #202537;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  text-transform: none;
}

.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: 230px;
  transform: translateY(4px);
  border: 1px solid #606987;
  border-radius: 8px;
  background: #343a55;
  color: #f0f2fb;
  padding: 10px 12px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: normal;
}

.info-tip:hover::after,
.info-tip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.multi-select {
  position: relative;
  width: 100%;
}

.multi-select summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.scanner-exchange-picker > summary {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.multi-select summary::after {
  content: "⌄";
  color: var(--muted);
}

.multi-select[open] summary::after {
  content: "⌃";
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  overflow: hidden;
  border: 1px solid #343948;
  border-radius: 8px;
  background: #151820;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.42);
}

.multi-select label {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #151820;
  padding: 0 12px;
  color: var(--text);
}

.multi-select label:last-child {
  border-bottom: 0;
}

.multi-select label:has(input:disabled) {
  color: var(--muted);
  opacity: 0.65;
}

.soon-option span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.multi-select input {
  width: 16px;
  min-height: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
}

.panel-heading p {
  margin: 4px 0 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.rules-table th:nth-child(1),
.rules-table td:nth-child(1) {
  width: 14%;
}

.rules-table th:nth-child(2),
.rules-table td:nth-child(2) {
  width: 20%;
}

.rules-table th:nth-child(3),
.rules-table td:nth-child(3) {
  width: 8%;
}

.rules-table th:nth-child(4),
.rules-table td:nth-child(4) {
  width: 38%;
}

.rules-table th:nth-child(5),
.rules-table td:nth-child(5) {
  width: 8%;
  text-align: center;
}

.rules-table th:nth-child(6),
.rules-table td:nth-child(6) {
  width: 12%;
  text-align: center;
}

.rules-table th,
.rules-table td {
  border-bottom: 1px solid var(--soft-line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.rules-table th:nth-child(5),
.rules-table td:nth-child(5),
.rules-table th:nth-child(6),
.rules-table td:nth-child(6) {
  text-align: center;
}

.rules-table th {
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 900;
}

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

.empty-cell {
  color: var(--muted);
  text-align: center !important;
  padding: 24px !important;
}

.positive {
  color: var(--entry);
  font-weight: 900;
}

.negative {
  color: var(--exit);
  font-weight: 900;
}

.warning {
  color: var(--warn);
  font-weight: 900;
}

.diagnostic-status-line {
  margin-bottom: 10px;
  font-size: 22px;
}

.diagnostic-list.compact {
  gap: 5px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions button,
.rules-table button {
  min-height: 34px;
  padding: 0 10px;
}

.rule-value-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #303745;
  border-radius: 7px;
  background: #151a22;
  color: #eef0f5;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.rule-chip-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.rule-edit-row td {
  vertical-align: top;
}

.rule-edit-row .rule-edit-status,
.rule-edit-row .rule-edit-actions-cell {
  vertical-align: middle !important;
}

.rule-edit-row .rule-edit-status {
  text-align: center;
  white-space: nowrap;
}

.rule-pair-edit-cell {
  display: grid;
  gap: 12px;
  align-content: start;
}

.rule-pair-edit-cell .rule-edit-toggle {
  width: min(220px, 100%);
  max-width: none;
}

.rule-edit-actions-cell .table-actions {
  align-items: center;
  justify-content: center;
  min-height: 128px;
}

.rule-edit-stack,
.rule-edit-grid {
  display: grid;
  gap: 8px;
}

.rule-edit-grid {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.rule-edit-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.rule-edit-field input,
.rule-edit-field select {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #343948;
  border-radius: 7px;
  background: #0f1319;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.rule-edit-toggle {
  align-content: end;
}

.rule-edit-toggle .switch-control {
  min-height: 32px;
}

.rule-edit-toggle .switch-slider {
  width: 42px;
  height: 24px;
}

.rule-edit-toggle .switch-slider::after {
  width: 16px;
  height: 16px;
}

.rule-edit-toggle .switch-control input:checked + .switch-slider::after {
  transform: translateX(18px);
}

.alerts-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.alert-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px 90px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--soft-line);
  padding: 8px 0;
  font-size: 13px;
}

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

.admin-sub-tabs {
  margin: 16px 0 20px;
}

.admin-tab-panel {
  display: grid;
  gap: 12px;
}

.telegram-topic-form,
.telegram-topic-rule-form,
.telegram-topic-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.telegram-topics-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.telegram-topic-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0d0e;
  padding: 12px;
}

.telegram-topic-card header,
.telegram-topic-rule {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.telegram-topic-card h3 {
  margin: 0;
}

.telegram-topic-rules {
  display: grid;
  gap: 8px;
}

.telegram-topic-rule {
  align-items: center;
  border: 1px solid #30343b;
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.telegram-topic-rule p {
  margin: 4px 0 0;
}

.telegram-topic-rule-form input,
.telegram-topic-rule-form select,
.telegram-topic-form input {
  min-height: 38px;
}

.button-choice-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button-choice-field > span {
  width: 100%;
}

.button-choice-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 800;
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 12px;
}

.admin-chart-card {
  min-height: 310px;
}

.admin-chart-card .roadmap-heading {
  margin-bottom: 8px;
}

.funnel-chart {
  display: grid;
  gap: 18px;
}

.funnel-step {
  display: grid;
  gap: 7px;
}

.funnel-step > div:first-child,
.chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.funnel-step span,
.chart-legend span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.funnel-step strong {
  font-size: 22px;
}

.funnel-bar-shell {
  width: var(--funnel-width, 100%);
  height: 38px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0d10;
}

.funnel-bar {
  width: 100%;
  height: 100%;
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
}

.funnel-bar-1 {
  background: linear-gradient(90deg, #5b82f6, #7aa4ff);
}

.funnel-bar-2 {
  background: linear-gradient(90deg, #3aa7c9, #5fd0b0);
}

.funnel-bar-3 {
  background: linear-gradient(90deg, #55b86a, #9ddc73);
}

.line-chart {
  display: grid;
  gap: 8px;
}

.line-chart svg {
  width: 100%;
  min-height: 230px;
  overflow: visible;
}

.line-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-axis {
  stroke: #30343b;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.registrations,
.chart-point.registrations {
  stroke: #7aa4ff;
  fill: #7aa4ff;
}

.chart-line.active-bots,
.chart-point.active-bots {
  stroke: #66c471;
  fill: #66c471;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
}

.legend-dot.registrations {
  background: #7aa4ff;
}

.legend-dot.active-bots {
  background: #66c471;
}

.admin-metric-card,
.roadmap-progress-summary {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
}

.admin-metric-card span,
.roadmap-progress-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-metric-card strong,
.roadmap-progress-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.admin-diagnostics-panel {
  display: grid;
  gap: 10px;
}

.admin-diagnostics-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(220px, 0.75fr) minmax(420px, 1.5fr);
  gap: 10px;
}

.admin-diagnostic-card {
  border: 1px solid var(--line);
  background: #0c0d0e;
  padding: 12px;
}

.admin-diagnostic-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.diagnostic-list,
.diagnostic-recent-list {
  display: grid;
  gap: 7px;
}

.diagnostic-list div,
.diagnostic-recent-row {
  display: grid;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--soft-line);
  padding-top: 7px;
}

.diagnostic-list div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.diagnostic-list strong,
.diagnostic-recent-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostic-list span,
.diagnostic-recent-row span,
.diagnostic-recent-row time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.diagnostic-recent-row {
  grid-template-columns: 110px 120px 130px minmax(160px, 1fr) 120px;
}

.diagnostic-recent-row.operational-issue-row {
  grid-template-columns: 90px 180px minmax(240px, 1fr) 120px;
}

.diagnostic-empty {
  margin: 0;
}

@media (min-width: 1101px) {
  .admin-diagnostic-wide {
    min-width: 0;
  }
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 12px;
}

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

.roadmap-form,
.roadmap-form-row {
  display: grid;
  gap: 10px;
}

.roadmap-form-row {
  grid-template-columns: 1fr 1fr;
}

.roadmap-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.roadmap-heading h2,
.admin-roadmap-create h2,
.admin-users-panel h2 {
  margin-top: 0;
}

.roadmap-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.roadmap-column {
  min-width: 220px;
  border: 1px solid var(--line);
  background: #0c0d0e;
}

.roadmap-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.roadmap-column h3 {
  margin: 0;
  font-size: 15px;
}

.roadmap-column header span {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  font-weight: 900;
}

.roadmap-card-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.roadmap-card {
  display: grid;
  gap: 10px;
  border: 1px solid #30343b;
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.roadmap-card-top,
.roadmap-meta,
.roadmap-card-controls,
.roadmap-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roadmap-card-top,
.roadmap-meta,
.roadmap-progress {
  justify-content: space-between;
}

.roadmap-card h4 {
  margin: 0;
  font-size: 16px;
}

.roadmap-card p {
  margin: 0;
  color: #aeb4bd;
  font-size: 13px;
  line-height: 1.35;
}

.roadmap-type,
.priority,
.roadmap-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.priority-high,
.priority-urgent {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ff8a8a;
}

.priority-low {
  color: #87a6ff;
}

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

.roadmap-progress div {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #202329;
}

.roadmap-progress div span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5b82f6, #4fbd65);
}

.roadmap-progress strong {
  min-width: 38px;
  text-align: right;
}

.roadmap-card-controls select {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
}

.roadmap-range {
  gap: 4px;
}

.roadmap-range input {
  min-height: 26px;
  padding: 0;
}

.roadmap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roadmap-actions {
  justify-content: space-between;
}

.roadmap-empty {
  min-height: 80px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  margin: 0;
}

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

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

  .scanner-grid,
  .scanner-fields,
  .wiki-grid,
  .wiki-article-page,
  .admin-charts-grid,
  .admin-metrics,
  .admin-diagnostics-grid,
  .admin-grid,
  .scanner-control-strip {
    grid-template-columns: 1fr 1fr;
  }

  .wiki-article-page {
    grid-template-columns: 1fr;
  }

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

  .admin-diagnostic-wide {
    grid-column: 1 / -1;
  }

  .wiki-related-panel {
    position: static;
  }

  .scanner-settings-grid {
    width: 100%;
  }

  .pair-row,
  .two-field-row {
    grid-template-columns: 1fr 1fr;
  }

  .pair-arrow {
    display: none;
  }

  .metrics-grid,
  .lower-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    display: grid;
  }

  .tradebar,
  .orderbooks,
  .scanner-grid,
  .scanner-fields,
  .wiki-grid,
  .wiki-article-page,
  .admin-metrics,
  .admin-diagnostics-grid,
  .admin-grid,
  .scanner-control-strip,
  .pair-row,
  .two-field-row,
  .multi-row,
  .roadmap-form-row,
  .metrics-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .admin-diagnostic-wide {
    grid-column: auto;
  }

  .diagnostic-recent-row {
    grid-template-columns: 1fr;
  }

  .chart-controls label {
    width: calc(50% - 8px);
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding: 0 8px;
  }

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

}
