:root {
  color-scheme: dark;
  --bg: #05080b;
  --panel: rgba(20, 25, 31, 0.88);
  --panel-2: rgba(29, 35, 43, 0.86);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(235, 184, 82, 0.34);
  --text: #f4f2eb;
  --muted: #969da9;
  --gold: #e8b958;
  --gold-soft: rgba(232, 185, 88, 0.14);
  --green: #35d174;
  --red: #ff5e57;
  --wallet-panel-height: 680px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(232, 185, 88, 0.16), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(180deg, #06090d 0%, #030507 100%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="gold"] {
  --bg: #110d05;
  --panel: rgba(37, 28, 12, 0.9);
  --panel-2: rgba(57, 42, 17, 0.86);
  --line: rgba(255, 219, 137, 0.16);
  --line-strong: rgba(255, 210, 99, 0.48);
  --text: #fff6df;
  --muted: #cbbf9c;
  --gold: #ffd36a;
  --gold-soft: rgba(255, 211, 106, 0.18);
}

body[data-theme="platinum"] {
  color-scheme: light;
  --bg: #eef1f4;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-2: rgba(246, 248, 250, 0.92);
  --line: rgba(29, 38, 52, 0.13);
  --line-strong: rgba(167, 137, 70, 0.38);
  --text: #141922;
  --muted: #697386;
  --gold: #a47b28;
  --gold-soft: rgba(164, 123, 40, 0.12);
}

body[data-theme="gold"] {
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 211, 106, 0.22), transparent 34%),
    linear-gradient(180deg, #150f05 0%, #090704 100%);
}

body[data-theme="platinum"] {
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.85), transparent 34%),
    linear-gradient(180deg, #f4f6f8 0%, #dfe4ea 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 26px 18px 108px;
}

.topbar,
.hero-row,
.panel-head,
.quick-actions,
.currency-row,
.history-row,
.my-order-row,
.book-row,
.trade-row {
  display: flex;
  align-items: center;
}

.topbar {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.topbar > * {
  min-width: 0;
}

.back-btn,
.notification-btn,
.earn-btn,
.action-btn,
.sheet button,
.grouping-control button,
.bottom-nav button,
.cancel-order-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.back-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 38px;
  line-height: 1;
}

.back-btn.is-hidden {
  visibility: hidden;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  text-align: center;
  font-size: clamp(23px, 4vw, 32px);
  font-weight: 760;
  letter-spacing: 0.01em;
}

h1 span,
.accent .portfolio-value,
.portfolio-half.accent .portfolio-label {
  color: var(--gold);
}

h2 {
  font-size: 18px;
  font-weight: 720;
}

p {
  color: var(--muted);
  font-size: 12px;
}

.earn-btn {
  min-height: 46px;
  border-color: var(--line-strong);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--gold);
  background: rgba(232, 185, 88, 0.06);
  font-weight: 800;
  text-transform: uppercase;
}

.notification-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border-color: var(--line-strong);
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  color: #1a1200;
  background: var(--gold);
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
}

.portfolio-card,
.quick-actions,
.panel,
.sheet {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 44px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.portfolio-card {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 24px;
  min-height: 170px;
  padding: 34px 40px;
  margin-bottom: 12px;
}

.portfolio-divider {
  background: var(--line);
}

.portfolio-half {
  display: grid;
  align-content: center;
  gap: 10px;
}

.portfolio-label {
  color: var(--muted);
  font-size: 17px;
}

.portfolio-value {
  font-size: clamp(38px, 7vw, 58px);
  font-weight: 760;
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.portfolio-value small {
  font-size: 20px;
  font-weight: 650;
}

.portfolio-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
}

.quote-select {
  width: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.22);
}

.native-select-hidden {
  position: absolute;
  width: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.wallet-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.portfolio-sub .wallet-select {
  width: auto;
}

.wallet-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 760;
  text-align: left;
  min-width: 0;
}

.wallet-select-label-wrap {
  display: grid;
  min-width: 0;
}

.wallet-select-label-wrap > span {
  grid-area: 1 / 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.wallet-select-size-text {
  display: none;
  visibility: hidden;
  pointer-events: none;
}

.portfolio-sub .wallet-select-btn {
  min-height: 32px;
  padding: 5px 9px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.22);
}

.wallet-select-btn::after {
  content: "⌄";
  color: var(--muted);
  font-size: 16px;
}

.wallet-select.open .wallet-select-btn::after {
  transform: rotate(180deg);
}

.wallet-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 14;
  display: none;
  max-height: min(280px, 46vh);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px;
  background: var(--panel-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.wallet-select.open .wallet-select-menu {
  z-index: 40;
  display: grid;
  gap: 4px;
}

.wallet-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  color: var(--text);
  background: transparent;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.wallet-select-option.active {
  color: #1a1200;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
}

.wallet-select-option.active::after {
  content: "✓";
  font-weight: 900;
}

.quick-actions {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 102px;
  margin-bottom: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  overscroll-behavior-x: contain;
}

.quick-actions::-webkit-scrollbar {
  height: 6px;
}

.quick-actions::-webkit-scrollbar-track {
  background: transparent;
}

.quick-actions::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.action-btn {
  display: grid;
  flex: 1 0 150px;
  place-items: center;
  gap: 8px;
  min-width: 150px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.action-btn:last-child {
  border-right: 0;
}

.action-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--gold);
  font-size: 32px;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 12px;
}

.panel {
  padding: 18px;
}

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

.search-input,
.field,
.select-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: none;
}

textarea.field {
  min-height: 118px;
  resize: vertical;
  line-height: 1.35;
}

/* What: контролируемое поле даты админки. Why: нативный date input показывает формат браузера. Why this way: text input сохраняет YYYY.MM.DD, а прозрачный date input открывает picker. */
.admin-date-field {
  position: relative;
  min-width: 0;
}

.admin-date-display {
  padding-right: 44px;
  font-variant-numeric: tabular-nums;
}

.admin-date-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  color: var(--text);
  pointer-events: none;
  transform: translateY(-50%);
}

.admin-date-native {
  position: absolute;
  right: 0;
  top: 0;
  width: 48px;
  height: 100%;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.admin-date-native::-webkit-calendar-picker-indicator {
  width: 48px;
  height: 100%;
  cursor: pointer;
}

.admin-date-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 3px;
  border-top: 2px solid currentColor;
}

.search-input {
  max-width: 260px;
}

.currency-header {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr 0.9fr;
  gap: 12px;
  padding: 0 8px 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.currency-list {
  display: grid;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.currency-row {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr 0.9fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  color: inherit;
  min-height: 108px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 8px;
  background: transparent;
  text-align: left;
}

.currency-row.active {
  background: rgba(232, 185, 88, 0.08);
}

.currency-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.currency-price-line {
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.currency-price-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.coin-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #1d1300;
  background: linear-gradient(135deg, var(--gold), #fff1b2);
  font-size: 24px;
  font-weight: 900;
}

.coin-logo {
  overflow: hidden;
}

.coin-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coin-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.coin-mark-compact {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.coin-mark-mini {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.currency-code {
  overflow: hidden;
  font-size: 18px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-chip {
  display: inline-flex;
  margin-top: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 11px;
}

.balance-main {
  font-size: 18px;
  font-weight: 720;
}

.balance-stack {
  align-self: center;
  padding-top: 10px;
}

.balance-meta,
.currency-meta {
  color: var(--muted);
  font-size: 12px;
}

.market-cell {
  display: grid;
  justify-items: end;
  align-self: center;
  gap: 6px;
  text-align: right;
}

.change-up {
  color: var(--green);
}

.change-down {
  color: var(--red);
}

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

.sparkline {
  width: 86px;
  height: 26px;
}

.grouping-control {
  display: grid;
  grid-template-columns: 32px minmax(82px, auto) 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.grouping-control button {
  height: 32px;
  border: 0;
}

.grouping-control span {
  padding: 0 8px;
  color: var(--gold);
  font-size: 12px;
}

.ticker-line {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.ticker-buy {
  color: var(--green);
}

.ticker-sell {
  color: var(--red);
}

.pair-chart {
  position: relative;
  height: 154px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    rgba(0, 0, 0, 0.18);
  background-size: 100% 25%, 25% 100%;
}

.pair-chart svg {
  width: 100%;
  height: 100%;
}

.chart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.chart-controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.chart-controls button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  font-weight: 800;
}

.chart-controls [data-chart-reset] {
  color: var(--muted);
  font-size: 11px;
}

.chart-trade-btn {
  width: 100%;
  margin-bottom: 12px;
}

.chart-overlay {
  position: absolute;
  inset: 8px 10px;
  z-index: 1;
  pointer-events: none;
  color: var(--muted);
  font-size: 11px;
}

.chart-price-label {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--gold);
  font-weight: 760;
}

.chart-source-label {
  position: absolute;
  top: 18px;
  left: 0;
  color: var(--muted);
}

.chart-level {
  position: absolute;
  right: 0;
}

.chart-level.top {
  top: 8px;
}

.chart-level.mid {
  top: 48%;
}

.chart-level.bottom {
  bottom: 18px;
}

.chart-time {
  position: absolute;
  bottom: 0;
}

.chart-time.left {
  left: 0;
}

.chart-time.center {
  left: 48%;
}

.chart-time.right {
  right: 0;
}

.orderbook {
  display: grid;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.book-row {
  width: 100%;
  justify-content: space-between;
  border: 0;
  border-radius: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 15px;
  text-align: left;
}

.book-row.ask {
  color: var(--red);
  background: linear-gradient(90deg, rgba(255, 94, 87, 0.17), rgba(255, 94, 87, 0.035));
}

.book-row.bid {
  color: var(--green);
  background: linear-gradient(90deg, rgba(53, 209, 116, 0.17), rgba(53, 209, 116, 0.035));
}

.book-row.has-mine {
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
}

.mine-arrow {
  display: inline-grid;
  place-items: center;
  margin-right: 6px;
  color: var(--gold);
  font-size: 13px;
}

.book-help {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.history-panel {
  margin-top: 12px;
}

.history-list,
.my-orders-list,
.trades-list {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 8px;
}

.my-orders-list,
.trades-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.balances-panel,
.market-panel {
  display: flex;
  flex-direction: column;
  height: var(--wallet-panel-height);
}

.history-row,
.my-order-row,
.trade-row {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.compact-history-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  cursor: pointer;
}

.compact-history-row:active {
  transform: scale(0.99);
}

.compact-history-row.history-buy,
.compact-history-row.history-sell,
.compact-history-row.history-exchange {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.compact-history-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.compact-history-title {
  font-weight: 760;
}

.history-buy .compact-history-title {
  color: var(--green);
}

.history-sell .compact-history-title {
  color: var(--red);
}

.history-transfer .compact-history-title {
  color: #4da3ff;
}

.history-bridge .compact-history-title {
  color: var(--text);
}

.history-exchange .compact-history-title,
.history-admin .compact-history-title {
  color: var(--gold);
}

.compact-history-meta,
.compact-history-status,
.history-entry-status {
  color: var(--muted) !important;
  font-size: 11px;
}

.compact-history-comment,
.history-entry-comment {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  font-style: italic;
  overflow-wrap: break-word;
  word-break: break-word;
}

.compact-history-status,
.history-entry-status {
  display: grid;
  gap: 2px;
}

.compact-history-amount {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
  max-width: 46vw;
}

.compact-history-row.history-buy .compact-history-amount,
.compact-history-row.history-sell .compact-history-amount,
.compact-history-row.history-exchange .compact-history-amount {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}

.compact-history-amount > span,
.history-entry-amount > span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.compact-history-row.history-buy .compact-history-amount > span,
.compact-history-row.history-sell .compact-history-amount > span,
.compact-history-row.history-exchange .compact-history-amount > span {
  white-space: nowrap;
}

.compact-history-amount small,
.history-entry-amount small {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.trade-row strong {
  color: var(--text);
}

.trade-row.trade-buy strong,
.trade-row.trade-buy span,
.trade-row.trade-up strong,
.trade-row.trade-up span {
  color: var(--green);
}

.trade-row.trade-sell strong,
.trade-row.trade-sell span,
.trade-row.trade-down strong,
.trade-row.trade-down span {
  color: var(--red);
}

.trade-row.trade-flat strong,
.trade-row.trade-flat span {
  color: var(--muted);
}

.my-order-main {
  display: grid;
  gap: 3px;
}

.my-order-main strong {
  color: var(--text);
}

.my-order-buy .order-side-word {
  color: var(--green);
}

.my-order-sell .order-side-word {
  color: var(--red);
}

.cancel-order-btn {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 11px;
  color: var(--red);
}

.trades-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.trades-pagination button {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.trades-pagination button.active {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
  font-weight: 800;
}

.app-version-footer {
  grid-column: 1 / -1;
  margin-top: 6px;
  color: rgba(148, 160, 189, 0.72);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  min-height: 82px;
  padding: 8px max(10px, calc((100vw - 1040px) / 2)) calc(10px + env(safe-area-inset-bottom));
  background: rgba(6, 9, 13, 0.92);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  grid-template-rows: 30px minmax(28px, auto);
  place-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 64px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
}

.bottom-nav span {
  display: -webkit-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  line-height: 1.12;
  text-align: center;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bottom-nav .active {
  color: var(--gold);
}

.history-top {
  align-items: end;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.history-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.history-page-search {
  display: grid;
  grid-template-columns: auto minmax(92px, 140px) auto auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.history-page-search .field {
  min-height: 38px;
  padding: 8px 10px;
}

.history-page-search .secondary-btn {
  min-height: 38px;
  padding: 0 14px;
}

.history-page-range {
  color: var(--muted);
  font-weight: 760;
  white-space: nowrap;
}

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

.history-filter-grid label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-filter-grid .wallet-select {
  min-width: 0;
  max-width: 100%;
}

.history-filter-grid .wallet-select-btn {
  min-height: 38px;
  border-color: var(--line-strong);
  padding: 8px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.history-filter-grid .wallet-select-btn::after {
  color: var(--gold);
}

.history-filter-grid .wallet-select-menu {
  max-width: 100%;
  min-width: 100%;
  border-color: rgba(232, 185, 88, 0.42);
  background: var(--panel-2);
  overflow-x: hidden;
}

.history-filter-grid .wallet-select-option {
  min-width: 0;
  min-height: 36px;
}

.history-filter-notice {
  margin: 0;
}

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

.pay-toolbar label,
.pay-search {
  min-width: 0;
}

.pay-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pay-toolbar .select-field {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
}

.pay-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.pay-search .field,
.pay-search .secondary-btn {
  min-height: 40px;
}

.pay-invoice-list {
  display: grid;
  gap: 8px;
  max-height: min(48vh, 520px);
  overflow-y: auto;
  padding-right: 2px;
}

.pay-invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.pay-invoice-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pay-invoice-row strong,
.pay-invoice-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-invoice-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.pay-invoice-side {
  justify-items: end;
  flex: 0 0 auto;
}

.pay-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.pay-status-created {
  color: var(--gold);
  border-color: var(--line-strong);
  background: var(--gold-soft);
}

.pay-status-paid {
  color: var(--green);
  border-color: rgba(53, 209, 116, 0.35);
  background: rgba(53, 209, 116, 0.1);
}

.pay-status-cancelled,
.pay-status-expired,
.pay-status-failed {
  color: var(--red);
  border-color: rgba(255, 94, 87, 0.32);
  background: rgba(255, 94, 87, 0.09);
}

.pay-pagination {
  margin-top: 0;
}

/* What: компактная сетка деталей инвойса. Why: пользователь должен быстро сверить статус, сумму и срок. Why this way: пары label/value читаются стабильно на mobile и desktop. */
.pay-detail {
  display: grid;
  gap: 8px;
}

.pay-detail > div {
  display: grid;
  grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
}

.pay-detail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pay-detail strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

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

.history-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.history-entry-main {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-entry-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-weight: 760;
}

.history-payment .history-entry-title {
  display: grid;
  gap: 4px;
}

.history-payment .history-entry-status {
  display: block;
}

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

.history-entry-amount {
  grid-column: 1 / -1;
  width: 100%;
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
  font-size: 18px;
  font-weight: 760;
  min-width: 0;
}

.history-entry-amount > span {
  white-space: nowrap;
}

.history-entry-details {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.history-entry-details > div {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 8px;
}

.history-entry-details dt,
.history-entry-details dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.history-entry-details dt {
  color: var(--muted);
}

.history-entry-details dd {
  color: var(--text);
  overflow-wrap: anywhere;
}

.amount-positive {
  color: var(--green);
}

.amount-negative {
  color: var(--red);
}

.amount-transfer {
  color: #4da3ff;
}

.amount-exchange {
  color: var(--gold);
}

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

.amount-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.deal-word-buy {
  color: var(--green);
}

.deal-word-sell {
  color: var(--red);
}

.history-buy {
  border-left-color: var(--green);
}

.history-buy .history-entry-amount,
.history-buy .history-entry-title {
  color: var(--green);
}

.history-sell {
  border-left-color: var(--red);
}

.history-sell .history-entry-amount,
.history-sell .history-entry-title {
  color: var(--red);
}

.history-transfer {
  border-left-color: #4da3ff;
}

.history-bridge {
  border-left-color: var(--text);
}

.history-transfer .history-entry-amount,
.history-transfer .history-entry-title {
  color: #4da3ff;
}

.history-bridge .history-entry-amount,
.history-bridge .history-entry-title {
  color: var(--text);
}

.history-exchange,
.history-admin {
  border-left-color: var(--gold);
}

.history-exchange .history-entry-amount,
.history-exchange .history-entry-title,
.history-admin .history-entry-amount,
.history-admin .history-entry-title {
  color: var(--gold);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}

.pagination button {
  min-width: 38px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.pagination button.active {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
  font-weight: 800;
}

.pagination-ellipsis {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 36px;
  color: var(--muted);
  font-weight: 800;
}

.markets-view,
.settings-view,
.exchange-view {
  display: grid;
  gap: 12px;
}

.markets-hero,
.settings-hero,
.exchange-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(232, 185, 88, 0.16), transparent 52%),
    rgba(255, 255, 255, 0.035);
}

.markets-hero h2,
.settings-hero h2,
.exchange-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 5vw, 42px);
}

.markets-hero span,
.settings-hero span,
.exchange-hero span {
  color: var(--muted);
  font-size: 14px;
}

.exchange-page-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.exchange-page-form {
  max-width: 980px;
}

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

.exchange-page-layout .mini-book {
  align-self: start;
}

/* What: ограничивает высоту стакана Exchange. Why: глубокие книги должны прокручиваться, а не растягивать форму. Why this way: scroll только внутри строк стакана сохраняет заголовок и форму на месте. */
.exchange-page-layout .mini-book .mini-book-scroll {
  max-height: min(52vh, 520px);
}

/* What: нижние торговые панели Exchange. Why: recent trades и open orders относятся к выбранной паре. Why this way: две колонки на десктопе и один поток на мобиле сохраняют плотный trading workspace. */
.exchange-trading-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.exchange-trading-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.exchange-trading-panel .panel-head {
  margin: 0;
}

/* What: компактная история внизу Exchange. Why: после заявки пользователь должен видеть последние операции без длинной страницы. Why this way: секция занимает всю ширину, а список скроллится внутри. */
.exchange-history-panel {
  grid-column: 1 / -1;
}

.exchange-history-list {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 185, 88, 0.55) rgba(255, 255, 255, 0.05);
  -webkit-overflow-scrolling: touch;
}

.exchange-history-list::-webkit-scrollbar {
  width: 6px;
}

.exchange-history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.exchange-history-list::-webkit-scrollbar-thumb {
  background: rgba(232, 185, 88, 0.55);
  border-radius: 999px;
}

.market-hero-price {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.market-hero-price span,
.market-hero-price em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.market-hero-price strong {
  color: var(--gold);
  font-size: 34px;
}

.markets-grid {
  align-items: start;
}

.markets-table-head,
.market-row {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr 0.55fr 0.7fr;
  gap: 10px;
  align-items: center;
}

.markets-table-head {
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.markets-list {
  display: grid;
  max-height: 560px;
  overflow-y: auto;
}

.market-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.market-row.active {
  background: rgba(232, 185, 88, 0.09);
}

.market-pair {
  display: grid;
  gap: 3px;
}

.market-pair-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.market-pair b {
  color: var(--gold);
  font-size: 16px;
}

.market-pair em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

#selectedMarketPair {
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-row-spark {
  display: flex;
  justify-content: flex-end;
}

.selected-market-panel {
  position: sticky;
  top: 14px;
}

.market-detail-chart {
  height: 210px;
}

.market-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.market-stats div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.032);
}

.market-stats span {
  color: var(--muted);
  font-size: 12px;
}

.market-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.market-actions .secondary-btn {
  background: rgba(255, 255, 255, 0.035);
}

.market-stats:empty {
  display: none;
}

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

.settings-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.032);
  text-align: left;
  min-width: 0;
}

.settings-row:disabled {
  cursor: default;
  opacity: 0.82;
}

.settings-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-row strong,
.settings-row em {
  overflow-wrap: anywhere;
}

.settings-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.settings-row b {
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.settings-row.active {
  border-color: var(--line-strong);
  background: rgba(232, 185, 88, 0.09);
}

.support-admin-row {
  align-items: stretch;
}

.support-admin-row > span,
.support-admin-row > form {
  flex: 1;
  min-width: 0;
}

/* What: фильтры и summary Support admin. Why: обращения нужно быстро искать и сортировать. Why this way: scoped классы не затрагивают другие вкладки. */
.admin-support-filter-form {
  grid-template-columns: 1fr;
  gap: 10px;
}

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

.admin-support-summary > div {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-support-summary strong {
  color: var(--gold);
  font-size: 22px;
}

.admin-support-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-support-scroll {
  max-height: clamp(320px, 44vh, 470px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.admin-support-pagination {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 12px;
}

.admin-support-page-jump {
  grid-template-columns: minmax(82px, 120px) auto;
  align-items: end;
}

.support-status-badge {
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
}

.support-status-open {
  color: var(--gold);
  border-color: rgba(232, 185, 88, 0.35);
}

.support-status-answered {
  color: var(--green);
  border-color: rgba(87, 214, 145, 0.35);
}

.support-status-closed {
  color: var(--muted);
}

.user-id-row em {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.clipboard-helper {
  position: fixed;
  top: -1000px;
  left: -1000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

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

.scroll-list {
  max-height: min(52vh, 430px);
  overflow-y: auto;
  padding-right: 4px;
}

.settings-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--gold-soft);
}

.settings-toast button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.toggle-row,
.allowed-recipient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.toggle-row span,
.allowed-recipient-row .recipient-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.toggle-row strong,
.toggle-row em,
.info-card span,
.notice {
  overflow-wrap: anywhere;
}

.toggle-row em,
.allowed-recipient-row .recipient-label {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

/* What: строка выбора тайм-аута app unlock. Why: настройка должна выглядеть как часть Wallet, а не системный select. Why this way: используем существующий custom Wallet select и только выравниваем подсказку. */
.app-unlock-timeout-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.app-unlock-timeout-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.allowed-recipient-row .recipient-id {
  cursor: pointer;
  font-weight: 700;
  transition: color 0.15s;
}

.allowed-recipient-row .recipient-id:hover {
  color: var(--gold);
}

.allowed-recipient-row .recipient-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.allowed-recipient-row .recipient-tg-btn {
  display: grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 16px;
  padding: 0 6px;
  transition: border-color 0.15s, background 0.15s;
}

.allowed-recipient-row .recipient-tg-btn:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.trusted-users-trigger {
  margin-top: 6px;
}

.trusted-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  transition: border-color 0.15s, color 0.15s;
}

.trusted-trigger-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

.trusted-pick-list {
  display: grid;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0 0 8px;
}

.trusted-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.trusted-pick-row:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.trusted-pick-id {
  font-weight: 700;
  color: var(--text);
}

.trusted-pick-label {
  color: var(--muted);
  font-size: 12px;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
}

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

.choice-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.choice-group button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.choice-group button.active {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
}

.settings-list.scroll-list {
  max-height: min(40vh, 350px);
  overflow-y: auto;
  padding-right: 4px;
}

.search-row {
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.search-row .field {
  width: 100%;
}



.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: end;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.58);
}

.sheet-backdrop.open {
  display: flex;
}

.sheet {
  width: min(100%, 560px);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  padding: 18px;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.5);
}

.sheet-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

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

.mock-sheet {
  display: grid;
  gap: 14px;
}

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

.notification-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

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

.notification-limit-list button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.notification-limit-list button.active {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
}

.notification-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.028);
  text-align: left;
}

.notification-row.unread {
  border-color: var(--line-strong);
  background: rgba(232, 185, 88, 0.08);
}

.notification-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.notification-main strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: break-word;
}

.notification-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 52px;
}

.mini-action {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 800;
}

.compact-btn {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
  width: 100%;
}

.notification-pagination {
  margin-top: 4px;
}

.notification-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: break-word;
}

.notification-meta {
  color: var(--muted);
  font-size: 11px;
}

.notification-comment {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  overflow-wrap: break-word;
  word-break: break-word;
}

.notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.asset-picker,
.bridge-route,
.result-card,
.info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.asset-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.asset-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.asset-main .coin-mark {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.available-caption {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.exchange-balances {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
}

.balance-snapshot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.balance-snapshot-row strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-with-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.field-with-unit input {
  border: 0;
  background: transparent;
}

.field-with-unit span {
  padding-right: 12px;
  color: var(--muted);
}

.bridge-amount-field input {
  min-width: 0;
}

.bridge-amount-field [data-bridge-input-unit] {
  white-space: nowrap;
}

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

.percent-row button {
  min-height: 32px;
  border-radius: 7px;
}

.bridge-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.route-side {
  display: grid;
  gap: 5px;
}

.route-arrow {
  color: var(--muted);
  font-size: 28px;
}

.result-card {
  display: grid;
  gap: 8px;
  border-color: var(--line-strong);
}

.result-value {
  color: var(--text);
  font-size: 30px;
  font-weight: 760;
}

.info-card {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.info-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
}

.sheet-market {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(180px, 1fr);
  gap: 12px;
}

.mini-book {
  display: grid;
  gap: 7px;
  align-content: start;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

/* What: прокручиваемая область строк стакана. Why: открытые ордера могут находиться глубже top-5 уровней. Why this way: vertical scroll сохраняет существующие строки и click handlers. */
.mini-book-scroll {
  display: grid;
  gap: 3px;
  max-height: min(48vh, 500px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 185, 88, 0.55) rgba(255, 255, 255, 0.05);
  -webkit-overflow-scrolling: touch;
}

.mini-book-scroll::-webkit-scrollbar {
  width: 6px;
}

.mini-book-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.mini-book-scroll::-webkit-scrollbar-thumb {
  background: rgba(232, 185, 88, 0.55);
  border-radius: 999px;
}

.mini-book-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* What: понятная шапка стакана. Why: пользователь должен видеть выбранную пару и смысл блока. Why this way: компактный header не увеличивает форму, но убирает неоднозначность Price/size. */
.mini-book-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

.mini-book-head div {
  display: grid;
  gap: 2px;
}

.mini-book-head strong {
  color: var(--text);
  font-size: 16px;
}

.mini-book-head span,
.mini-book-head em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.book-side-label {
  padding: 5px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.book-side-label.ask-label {
  color: var(--red);
}

.book-side-label.bid-label {
  color: var(--green);
}

.book-mid-row {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 800;
}

.mini-book .book-row {
  padding: 6px 8px;
  font-size: 12px;
}

.form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label {
  color: var(--muted);
  font-size: 12px;
}

/* What: app-style segmented controls для admin forms. Why: убрать системный dropdown. Why this way: hidden input сохраняет FormData, а кнопки дают стиль приложения. */
.admin-segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.admin-segmented-control-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-segmented-control-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-segmented-control button {
  min-width: 0;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.admin-segmented-control-wrap {
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
}

.admin-segmented-control button.active {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
  font-weight: 850;
}

.primary-btn {
  min-height: 44px;
  border-radius: 8px;
  border: 0;
  color: #1a1200;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
  font-weight: 800;
}

.secondary-btn {
  min-height: 42px;
  border-radius: 8px;
}

.link-btn {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  text-decoration: none;
}

.confirm-box,
.notice,
.exchange-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.notice-error {
  border-color: rgba(255, 94, 87, 0.38);
  color: #ffb8b3;
  background: rgba(255, 94, 87, 0.12);
}

.route-unavailable {
  color: #ffb8b3;
  font-size: 15px;
  line-height: 1.25;
}

.sheet-notice {
  margin-top: 12px;
}

.confirm-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-color: rgba(232, 185, 88, 0.32);
  background: rgba(232, 185, 88, 0.08);
}

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

.confirm-actions.three {
  grid-template-columns: 1fr;
}

.exchange-summary {
  display: grid;
  gap: 6px;
}

.exchange-summary strong {
  color: var(--gold);
}

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

.side-switch label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.side-switch input {
  display: none;
}

.side-switch label:has(input:checked) {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
  font-weight: 800;
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

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

.choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 720;
  text-align: left;
}

.choice-btn.active {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
}

.choice-btn.active::after {
  content: "✓";
  font-weight: 900;
}

.period-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.period-btn.active {
  color: #1a1200;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
  font-weight: 800;
}

.admin-shell {
  max-width: 1180px;
}

.topbar-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.admin-tabs {
  position: sticky;
  top: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-radius: 12px;
  border: 1px solid var(--line);
}

.admin-tabs button {
  min-height: 46px;
}

.admin-tab-view {
  display: grid;
  gap: 14px;
}

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

.admin-metric {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-metric strong {
  color: var(--gold);
  font-size: 24px;
}

.admin-metric span {
  color: var(--muted);
  font-size: 12px;
}

/* What: четырехколоночные cards для dashboard totals. Why: новые summary значения должны читаться плотнее стандартной сетки. Why this way: отдельный admin-класс не меняет остальные metrics. */
.admin-metrics-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* What: таблица агрегированных балансов админки. Why: глобальные суммы требуют шести стабильных колонок. Why this way: scoped selector не затрагивает таблицы Users, Operations и Support. */
.admin-wallet-total-table .admin-table-head,
.admin-wallet-total-table .admin-table-row {
  grid-template-columns: minmax(120px, 0.9fr) repeat(4, minmax(110px, 1fr)) minmax(130px, 0.9fr);
}

/* What: вторичные подписи внутри Wallet totals. Why: показывают источник locked и контекст значений. Why this way: мелкий em сохраняет плотность dashboard. */
.admin-wallet-total-table em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

/* What: бейдж сверки locked-балансов. Why: админ должен быстро увидеть расхождение без автокоррекции. Why this way: цветовая метка только визуализирует read-only статус. */
.admin-check-badge {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 900;
}

.admin-check-ok {
  color: #12361f;
  background: rgba(84, 214, 128, 0.9);
}

.admin-check-warning {
  color: #2e1d00;
  background: rgba(255, 193, 87, 0.95);
}

/* What: пустое состояние dashboard-таблицы. Why: нулевые данные не должны выглядеть как ошибка загрузки. Why this way: один scoped блок вместо отдельного компонента. */
.admin-empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

/* What: компактная сетка дополнительных статистик. Why: counts по пользователям, support и операциям должны помещаться на dashboard. Why this way: карточки одинакового размера проще сканировать. */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-stats-box {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-stats-box h3 {
  margin: 0;
  font-size: 14px;
}

.admin-stats-box div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-stats-box span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-stats-box strong {
  color: var(--gold);
  font-size: 12px;
}

.admin-stats-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-search-form {
  grid-template-columns: 1fr 140px;
}

.admin-operations-filter-form {
  grid-template-columns: 1fr;
  gap: 10px;
}

/* What: трехстрочная раскладка admin-фильтров. Why: даты From/To должны жить отдельной строкой. Why this way: scoped rows не меняют логику FormData. */
.admin-filter-row {
  display: grid;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.admin-operations-filter-form .admin-filter-row-main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) minmax(220px, 1fr);
}

.admin-support-filter-form .admin-filter-row-main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, 1.35fr);
}

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

.admin-operations-filter-form .admin-filter-row-actions {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 180px) minmax(120px, 150px);
}

.admin-support-filter-form .admin-filter-row-actions {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.85fr) minmax(150px, 180px) minmax(120px, 150px);
}

.admin-operations-pagination {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 12px;
}

/* What: внутренний скролл списка Operations. Why: много записей не должно растягивать всю страницу. Why this way: scoped wrapper не меняет таблицы других вкладок. */
.admin-operations-scroll {
  max-height: clamp(300px, 42vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.pagination-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-operation-page-jump {
  grid-template-columns: minmax(82px, 120px) auto;
  align-items: end;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}

/* What: вертикальная раскладка вкладки Users. Why: выбранный пользователь, список и таблицы должны читаться сверху вниз. Why this way: scoped-классы не меняют другие вкладки админки. */
.admin-users-layout {
  display: grid;
  gap: 14px;
}

.admin-users-selected {
  display: grid;
  justify-items: center;
}

.admin-user-controls {
  width: 100%;
  max-width: 860px;
}

.admin-user-controls .panel-head {
  justify-content: center;
  text-align: center;
}

.admin-combobox {
  position: relative;
  min-width: 0;
}

.admin-combobox-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px;
  background: #20262c;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.admin-combobox.open .admin-combobox-menu {
  display: grid;
  gap: 4px;
}

.admin-combobox-menu button {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.admin-combobox-menu button.active {
  color: #1a1200;
  background: linear-gradient(135deg, var(--gold), #fff0ad);
}

.admin-combobox-menu span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-combobox-menu button.active span {
  color: rgba(26, 18, 0, 0.72);
}

.admin-users-picker {
  width: 100%;
}

.admin-user-data-section {
  gap: 12px;
}

.admin-user-list-filter-form {
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-user-filter-row {
  display: grid;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.admin-user-filter-row-main {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.9fr) minmax(150px, 180px) minmax(120px, 150px);
}

.admin-user-list-filter-form[data-admin-user-list-filter="trades"] .admin-user-filter-row-main {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr) minmax(220px, 0.9fr) minmax(150px, 180px) minmax(120px, 150px);
}

.admin-user-filter-row-dates {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-user-list-scroll {
  max-height: clamp(300px, 42vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.admin-user-list-pagination {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.admin-user-list-page-jump {
  grid-template-columns: minmax(82px, 120px) auto;
  align-items: end;
}

.admin-list {
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-list-row.active {
  border-color: var(--line-strong);
  background: rgba(232, 185, 88, 0.08);
}

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

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

.admin-box {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-box h3 {
  margin: 0;
  font-size: 15px;
}

.admin-adjust-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.admin-table {
  display: grid;
  gap: 6px;
  min-width: 0;
}

/* What: горизонтальный скролл таблиц в деталях Users. Why: технические значения не должны переноситься вниз на узком экране. Why this way: scoped-правило не меняет таблицы Operations и Support. */
.admin-users-layout .admin-table {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}

.admin-table-head,
.admin-table-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

.admin-table-head {
  color: var(--muted);
  font-weight: 800;
}

.admin-table-3 .admin-table-head,
.admin-table-3 .admin-table-row {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.admin-table-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-users-layout .admin-table-head,
.admin-users-layout .admin-table-row {
  min-width: 980px;
}

.admin-users-layout .admin-table-3 .admin-table-head,
.admin-users-layout .admin-table-3 .admin-table-row {
  min-width: 460px;
}

/* What: отдельная сетка строк Orders в Users. Why: длинное поле Remaining/Price не должно наезжать на дату. Why this way: ширина уходит в горизонтальный скролл только в таблице Orders. */
.admin-users-layout .admin-table-orders .admin-table-row {
  grid-template-columns: minmax(90px, 0.55fr) minmax(140px, 0.7fr) minmax(220px, 1fr) minmax(360px, 1.35fr) minmax(190px, 0.8fr);
  min-width: 1120px;
}

.admin-users-layout .admin-table-row span {
  overflow-wrap: normal;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 18px 10px 102px;
  }

  .topbar {
    grid-template-columns: 38px 1fr auto;
  }

  .admin-top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-top-actions .compact-btn,
  .admin-top-actions .earn-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .history-page-search {
    grid-template-columns: 1fr minmax(86px, 120px) auto;
  }

  .history-page-search label {
    grid-column: 1 / -1;
  }

  .history-filter-grid {
    grid-template-columns: 1fr;
  }

  .pay-toolbar {
    grid-template-columns: 1fr;
  }

  .pay-search {
    grid-template-columns: 1fr;
  }

  .pay-invoice-row {
    align-items: stretch;
    flex-direction: column;
  }

  .pay-invoice-side {
    justify-items: start;
  }

  .admin-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }

  .admin-metrics,
  .admin-grid-two,
  .admin-split,
  .admin-adjust-form,
  .admin-search-form,
  .admin-user-list-filter-form,
  .admin-operations-filter-form,
  .admin-support-filter-form,
  .admin-support-summary,
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-filter-row,
  .admin-operations-filter-form .admin-filter-row-main,
  .admin-support-filter-form .admin-filter-row-main,
  .admin-filter-row-dates,
  .admin-operations-filter-form .admin-filter-row-actions,
  .admin-support-filter-form .admin-filter-row-actions {
    grid-template-columns: 1fr;
  }

  .admin-user-filter-row-main,
  .admin-user-filter-row-dates {
    grid-template-columns: 1fr;
  }

  .admin-list {
    max-height: 360px;
  }

  .admin-tab-view:not(#usersTab) .admin-table-head {
    display: none;
  }

  .admin-tab-view:not(#usersTab) .admin-table-row,
  .admin-tab-view:not(#usersTab) .admin-table-3 .admin-table-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .earn-btn {
    padding: 0 10px;
    font-size: 12px;
  }

  .portfolio-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }

  .portfolio-divider {
    height: 1px;
  }

  .quick-actions {
    min-height: 88px;
  }

  .action-btn {
    flex-basis: 126px;
    min-width: 126px;
    font-size: 13px;
  }

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

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

  .chart-controls {
    justify-content: center;
  }

  .balances-panel,
  .market-panel {
    height: auto;
    max-height: var(--wallet-panel-height);
  }

  .currency-list,
  .orderbook,
  .my-orders-list,
  .trades-list {
    max-height: 420px;
  }

  .markets-hero,
  .settings-hero,
  .exchange-hero {
    align-items: start;
    flex-direction: column;
  }

  .market-hero-price {
    justify-items: start;
    text-align: left;
  }

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

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

  .balance-snapshot-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .selected-market-panel {
    position: static;
  }

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

  .currency-header {
    display: none;
  }

  .currency-row {
    grid-template-columns: minmax(0, 1fr) 102px;
    grid-template-areas:
      "title market"
      "available market"
      "locked market";
    min-height: 214px;
    gap: 12px;
    padding: 18px 10px;
  }

  .currency-title {
    grid-area: title;
  }

  .currency-row > .balance-stack:nth-of-type(2) {
    grid-area: available;
  }

  .currency-row > .balance-stack:nth-of-type(3) {
    grid-area: locked;
  }

  .balance-stack {
    padding-top: 0;
  }

  .balance-main {
    overflow-wrap: anywhere;
  }

  .market-cell {
    grid-area: market;
    justify-items: end;
    align-self: start;
    text-align: right;
    padding-top: 4px;
  }

  .market-cell .sparkline {
    max-width: 96px;
  }

  .exchange-page-panel {
    padding: 12px;
  }

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

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

  .search-input {
    max-width: 160px;
  }

  .history-entry {
    grid-template-columns: 1fr;
  }

  .history-entry-amount {
    text-align: left;
  }
}
