:root {
  --bg: #0c1016;
  --card: #151d28;
  --border: #2a3648;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #4a9bff;
  --accent-dim: #2f6fd4;
  --ok: #3ecf8e;
  --down: #ff7b7b;
  --warn: #f0b429;
  --profile: #6ee7a8;
  --non-profile: #9aa8bc;
  --header-h: 0px;
  --tabs-h: 2.75rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 139, 253, 0.12), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem 0.45rem;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.96);
  backdrop-filter: blur(10px);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.header-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.header-actions button {
  font-size: 0.82rem;
  padding: 0.38rem 0.75rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.header-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-brand-text {
  min-width: 0;
}

.header-brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.sub {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--muted);
}

.header-meta .stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  white-space: nowrap;
}

.header-meta .stat-pill strong {
  font-weight: 500;
  color: var(--text);
}

.header-meta .stat-pill.muted {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.header-meta .stat-pill--warn {
  border-color: rgba(240, 180, 41, 0.4);
  color: var(--warn);
}

.header-ticker-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.header-ticker-label {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.resource-ticker {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}

.resource-ticker::-webkit-scrollbar {
  height: 3px;
}

.resource-ticker::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.ticker-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.22rem;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  padding: 0.14rem 0.38rem 0.14rem 0.28rem;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.12s, background 0.12s;
  cursor: pointer;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.ticker-chip:hover {
  border-color: rgba(74, 155, 255, 0.4);
  background: rgba(74, 155, 255, 0.08);
}

.ticker-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ticker-chip .icon-chip {
  flex-shrink: 0;
}

.ticker-chip.ticker-up {
  border-color: rgba(62, 207, 142, 0.3);
}

.ticker-chip.ticker-down {
  border-color: rgba(255, 123, 123, 0.3);
}

.ticker-token {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
}

.ticker-price {
  font-size: 0.68rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ticker-price .amount-line,
.ticker-price .shard-in-ton {
  gap: 0.08rem;
}

.ticker-price .icon-chip img {
  width: 11px !important;
  height: 11px !important;
}

.ticker-trend {
  font-size: 0.6rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 2.85rem;
  text-align: right;
}

.ticker-trend.trend-up {
  color: var(--ok);
}

.ticker-trend.trend-down {
  color: var(--down);
}

.ticker-trend.trend-flat,
.ticker-trend.trend-unknown {
  color: var(--muted);
}

.ticker-empty {
  font-size: 0.72rem;
  padding: 0.1rem 0;
}

.page-tabs {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-dim);
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1rem 2rem;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.tab-panel.is-active {
  display: flex;
}

.panel-toolbar {
  margin-bottom: 0;
}

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

.small {
  font-size: 0.78rem;
}

.card-inset {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.75rem;
}

.card-inset:last-child {
  margin-bottom: 0;
}

.filter-panel {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045) 0%, rgba(0, 0, 0, 0.22) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.filter-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.filter-panel__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-mode {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.filter-mode__btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.32rem 0.72rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-mode__btn:hover {
  color: var(--text);
}

.filter-mode__btn.is-active {
  background: rgba(74, 155, 255, 0.22);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.filter-panel__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem 0.55rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr));
  gap: 0.5rem 0.55rem;
}

.filter-grid--entity {
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-grid--l1-prices {
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
}

.filter-grid__hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.filter-panel:not(.is-advanced) .filter-advanced-only {
  display: none !important;
}

.filter-panel__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  padding-top: 0.5rem;
  margin-top: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-panel__foot-spacer {
  flex: 1 1 0.5rem;
  min-width: 0.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-reset-btn {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  margin-left: 0.15rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}

.filter-group--checks {
  gap: 0.3rem;
}

.filter-group--view {
  margin-left: auto;
}

.filter-group--entity .filter-field select {
  min-width: 7.5rem;
  max-width: 11rem;
}

.filter-sep {
  width: 1px;
  align-self: stretch;
  min-height: 1.6rem;
  background: var(--border);
  flex: 0 0 1px;
}

.filter-field {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0;
  font-size: 0.8rem;
}

.filter-field span {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1.1;
}

.filter-field select,
.filter-field input {
  width: 100%;
  min-width: 0;
  min-height: 1.85rem;
  padding: 0.28rem 0.5rem;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.filter-field select:focus,
.filter-field input:focus {
  outline: none;
  border-color: rgba(74, 155, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(74, 155, 255, 0.12);
}

.filter-field--narrow input {
  min-width: 3.25rem;
  max-width: 4.5rem;
  text-align: center;
}

.filter-field--morale select {
  min-width: 11rem;
  max-width: 16rem;
}

.filter-chip,
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-chip:has(input:checked),
.filter-check:has(input:checked) {
  border-color: rgba(74, 155, 255, 0.55);
  background: rgba(74, 155, 255, 0.12);
  color: var(--text);
}

.filter-chip input,
.filter-check input {
  width: auto;
  min-height: auto;
  margin: 0;
  accent-color: var(--accent);
}

.segmented {
  display: inline-flex;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.segmented button {
  border-radius: 0;
  border: none;
  padding: 0.32rem 0.6rem;
  font-size: 0.78rem;
  background: transparent;
}

.segmented button + button {
  border-left: 1px solid var(--border);
}

.segmented button.is-active {
  background: rgba(74, 155, 255, 0.18);
  color: var(--accent);
}

.market-unavailable {
  font-size: 0.78rem;
  white-space: nowrap;
}

.market-unavailable-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

label span {
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.filter-field input,
.filter-field select,
.filter-check input {
  background: var(--card);
}

.row-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-dim);
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.price-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  align-items: center;
}

.price-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
}

.price-chip-text {
  font-variant-numeric: tabular-nums;
}

.amount-line {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount-line .icon-chip {
  flex-shrink: 0;
}

.amount-eq {
  opacity: 0.55;
  font-size: 0.85em;
  margin: 0 0.2rem;
}

.exchange-rate .amount-one {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-right: 0.1rem;
}

.exchange-rate .amount-val {
  font-variant-numeric: tabular-nums;
  margin-right: 0.12rem;
}

.mp-token-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.token-icon.currency-ton,
.token-icon.currency-shard {
  object-fit: contain;
}

.amount-sep {
  margin: 0 0.12rem;
  opacity: 0.45;
}

.th-currency {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 0;
}

th.num .th-currency {
  margin-left: auto;
}

.mp-token-price,
.mp-token-ton {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.icon-chip {
  position: relative;
  display: inline-flex;
  line-height: 0;
}

.token-icon,
.build-icon,
.char-icon {
  border-radius: 4px;
  object-fit: contain;
}

.build-icon {
  border-radius: 6px;
}

.icon-fallback {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--border);
  font-size: 0.65rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.icon-fallback.show {
  display: inline-flex;
}

.status-line {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}

.status-line.error {
  color: #ff8a8a;
}

.status-line.ok {
  color: var(--ok);
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

#roiTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

#roiTable th,
#roiTable td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  white-space: nowrap;
}

#roiTable th {
  position: sticky;
  top: 0;
  background: #1e2838;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

#roiTable th:hover {
  color: var(--accent);
}

#roiTable th.sorted-asc::after {
  content: " ▲";
  font-size: 0.65rem;
}

#roiTable th.sorted-desc::after {
  content: " ▼";
  font-size: 0.65rem;
}

#roiTable .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.value-unknown {
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
  font-weight: 700;
  color: var(--warn);
  cursor: help;
  letter-spacing: 0.02em;
}

.entity-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 10rem;
  white-space: normal;
}

.entity-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.entity-name {
  font-weight: 500;
}

.entity-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-profile {
  background: rgba(110, 231, 168, 0.15);
  color: var(--profile);
  border: 1px solid rgba(110, 231, 168, 0.35);
}

.badge-non-profile {
  background: rgba(154, 168, 188, 0.1);
  color: var(--non-profile);
  border: 1px solid rgba(154, 168, 188, 0.25);
}

.badge-farm-filter {
  background: rgba(147, 130, 220, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(147, 130, 220, 0.35);
}

.badge-farm-shard {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.badge-farm-native,
.badge-farm-recipe {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(96, 165, 250, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.char-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.roi-good {
  color: var(--ok);
  font-weight: 600;
}

.roi-mid {
  color: var(--warn);
}

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

.note-cell {
  max-width: 14rem;
  white-space: normal;
  font-size: 0.75rem;
  color: var(--muted);
}

.accounts-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.accounts-loading.hidden {
  display: none;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.layout-section-log .log {
  margin: 0;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  max-height: 10rem;
  overflow: auto;
  font-family: ui-monospace, monospace;
}

@media (max-width: 520px) {
  .header-top {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions button {
    flex: 1;
  }

}

@media (min-width: 900px) {
  .site-header {
    padding: 0.6rem 1.5rem 0.5rem;
    gap: 0.5rem;
  }

  .page-tabs,
  .page {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Marketplace */
.marketplace-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mp-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}

.subsection-title {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.mp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.mp-table th,
.mp-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.mp-table th {
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.mp-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mp-table-nested {
  margin: 0.35rem 0 0.5rem 1.5rem;
  font-size: 0.76rem;
}

.mp-orders-wrap {
  max-height: 22rem;
  overflow: auto;
}

.mp-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
}

.mp-summary-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.mp-group-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.mp-summary-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.mp-alias-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mp-alias-details {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
}

.mp-alias-details summary {
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  list-style: none;
}

.mp-alias-details summary::-webkit-details-marker {
  display: none;
}

.mp-alias-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.mp-alias-name {
  font-weight: 600;
}

.mp-alias-avg {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
}

.entity-cell.compact {
  min-width: 0;
  gap: 0.35rem;
}

.badge-build {
  background: rgba(61, 139, 253, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(61, 139, 253, 0.35);
}

.badge-char {
  background: rgba(110, 231, 168, 0.12);
  color: var(--profile);
  border: 1px solid rgba(110, 231, 168, 0.3);
}

.badge-muted {
  background: rgba(139, 156, 179, 0.1);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
}

.badge-soon {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #c62828, #e53935);
  border: 1px solid rgba(255, 120, 120, 0.5);
  box-shadow: 0 0 12px rgba(229, 57, 53, 0.35);
}

#roiTable tbody tr.row-soon {
  background: rgba(198, 40, 40, 0.08);
}

#roiTable tbody tr.row-soon:hover {
  background: rgba(198, 40, 40, 0.12);
}

.soon-cell {
  text-align: left;
  padding: 0.55rem 0.75rem !important;
}

.token-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

#roiTable tbody tr.row-clickable {
  cursor: pointer;
}

#roiTable tbody tr.row-clickable:hover {
  background: rgba(74, 155, 255, 0.08);
}

body.modal-open {
  overflow: hidden;
}

.detail-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.detail-modal-backdrop.hidden {
  display: none;
}

.detail-modal {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.detail-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.detail-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.detail-header {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.detail-header h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.detail-section {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-subhead {
  margin: 1rem 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
}

.detail-summary-compact {
  padding-bottom: 0.75rem;
}

.detail-formula-line {
  margin: 0.5rem 0 0;
}

.detail-params-block h3 {
  margin-bottom: 0.5rem;
}

.detail-gather-block h3 {
  margin-bottom: 0.35rem;
}

.detail-gather-table {
  margin-top: 0.5rem;
}

.detail-gather-table .gather-price {
  white-space: nowrap;
  font-size: 0.85rem;
}

.detail-level-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.detail-level-btn {
  min-width: 2.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.detail-level-btn:hover {
  background: rgba(74, 155, 255, 0.12);
}

.detail-level-btn.is-active {
  border-color: var(--accent);
  background: rgba(74, 155, 255, 0.2);
  color: var(--accent);
}

.detail-level-btn--extra {
  opacity: 0.85;
  border-style: dashed;
}

.detail-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.detail-level-catalog h3 {
  margin-bottom: 0.35rem;
}

.level-card-recipes {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.level-card-recipes__title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.recipe-table--compact {
  font-size: 0.72rem;
}

.recipe-row--locked {
  opacity: 0.55;
}

.detail-recipes-block h3 {
  margin-bottom: 0.5rem;
}

.recipe-table--layered .recipe-row-detail td {
  padding: 0 0.5rem 0.65rem;
  border-top: none;
  background: rgba(0, 0, 0, 0.12);
}

.recipe-row-fold,
.recipe-base-fold {
  margin: 0;
}

.recipe-row-fold > summary,
.recipe-base-fold > summary {
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.35rem 0;
}

.recipe-row-fold-body {
  padding: 0.35rem 0 0.5rem 0.5rem;
}

.recipe-in-summary {
  font-size: 0.82rem;
  max-width: 14rem;
}

.recipe-build-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.68rem;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.recipe-footnote {
  margin-top: 0.4rem;
}

.recipe-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipe-tree--d1 {
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
  margin-left: 0.35rem;
}

.recipe-tree-item {
  margin: 0.25rem 0;
}

.recipe-tree-fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.recipe-tree-fold > summary::-webkit-details-marker {
  display: none;
}

.recipe-tree-hint {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.recipe-tree-body {
  padding: 0.35rem 0 0.25rem 0.75rem;
}

.recipe-tree-head {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
}

.recipe-tree-sum {
  color: var(--muted);
  font-size: 0.85em;
}

.recipe-base-body {
  padding: 0.35rem 0 0.25rem 0.5rem;
}

.recipe-table .recipe-name-cell {
  min-width: 8rem;
  vertical-align: top;
}

.recipe-cycle-sum {
  margin-top: 0.25rem;
  font-size: 0.78rem;
}

.recipe-cycle-sum .label {
  color: var(--muted);
  font-weight: 500;
}

.recipe-cost-cell {
  min-width: 10rem;
  max-width: 16rem;
  vertical-align: top;
  font-size: 0.78rem;
}

.recipe-priced-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  margin-bottom: 0.28rem;
  line-height: 1.3;
}

.recipe-priced-formula {
  white-space: nowrap;
}

.recipe-priced-eq {
  color: var(--muted);
  white-space: nowrap;
}

.recipe-price-tag {
  display: inline-block;
  padding: 0 0.25rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.recipe-table .token-cell {
  vertical-align: top;
}

.recipe-build-cost {
  margin-top: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  font-size: 0.78rem;
}

.recipe-build-cost .label {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.recipe-row--building .recipe-cost-cell {
  max-width: 18rem;
}

.mp-craft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.mp-craft-card {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-inset, rgba(255, 255, 255, 0.03));
}

.mp-craft-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.mp-craft-price .label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.mp-craft-vs {
  font-size: 0.75rem;
}

.mp-craft-vs--up {
  color: #f87171;
}

.mp-craft-vs--down {
  color: #4ade80;
}

.detail-dl {
  display: grid;
  grid-template-columns: minmax(8rem, 38%) 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
  font-size: 0.88rem;
}

.detail-dl dt {
  margin: 0;
  color: var(--text-muted, #9ca3af);
  font-weight: 500;
}

.detail-dl dd {
  margin: 0;
}

.detail-grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 520px) {
  .detail-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.detail-fold {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
}

.detail-fold > summary {
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  user-select: none;
}

.detail-fold > summary::-webkit-details-marker {
  display: none;
}

.detail-fold > summary::before {
  content: "▸ ";
  opacity: 0.6;
}

.detail-fold[open] > summary::before {
  content: "▾ ";
}

.detail-fold-body {
  padding: 0 0.75rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-fold .detail-fold {
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.12);
}

.detail-folds {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.detail-folds > .detail-fold {
  margin: 0;
}

.detail-header.compact h2 {
  font-size: 1.15rem;
}

.detail-table.compact th,
.detail-table.compact td {
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
}

.detail-repair-block {
  margin-top: 0.35rem;
}

.detail-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-highlight {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.detail-warn {
  color: var(--warn);
  font-size: 0.82rem;
  margin: 0.35rem 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.detail-stat {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}

.detail-stat .label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.detail-kv {
  margin: 0.35rem 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.detail-table th,
.detail-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-table .num {
  text-align: right;
}

.detail-table tr.morale-band-active td {
  background: rgba(120, 200, 140, 0.12);
  font-weight: 600;
}

.detail-formula-table .formula-expr {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: rgba(232, 224, 208, 0.85);
}

.detail-formula-net {
  margin-top: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-formula-net .formula-expr {
  font-family: ui-monospace, monospace;
}

.detail-lots {
  max-height: 12rem;
  overflow: auto;
  margin-top: 0.5rem;
  font-size: 0.78rem;
}

.detail-lot-list {
  margin: 0.2rem 0 0.5rem;
  padding-left: 1rem;
}

.detail-lot-lv {
  font-weight: 600;
  margin-top: 0.35rem;
}

.detail-foot {
  margin-top: 0.75rem;
}

.hidden {
  display: none !important;
}

/* ——— Marketplace page ——— */
.marketplace-root {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mp-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.mp-stat {
  text-align: center;
}

.mp-stat .label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}

.mp-stat strong {
  font-size: 1.05rem;
}

.mp-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mp-subtab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}

.mp-subtab.is-active {
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #fff;
}

.mp-subtab-count {
  opacity: 0.85;
  font-size: 0.75rem;
}

.mp-panel {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.mp-panel.is-active {
  display: flex;
}

.mp-token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.mp-token-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.mp-token-card:hover {
  border-color: var(--accent);
  background: rgba(74, 155, 255, 0.1);
}

.mp-token-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.mp-token-price {
  font-size: 0.88rem;
  font-weight: 600;
}

.mp-token-ton {
  font-size: 0.72rem;
  color: var(--muted);
}

.mp-recipe-fold summary {
  cursor: pointer;
  font-weight: 500;
  padding: 0.35rem 0;
}

.mp-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 320px;
}

.mp-search-wrap span {
  font-size: 0.78rem;
  color: var(--muted);
}

.mp-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.55rem;
}

.mp-entity-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.mp-entity-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.mp-entity-head:hover {
  background: rgba(255, 255, 255, 0.04);
}

.mp-entity-info {
  flex: 1;
  min-width: 0;
}

.mp-entity-title {
  display: block;
  font-weight: 600;
}

.mp-entity-chevron {
  color: var(--muted);
  font-size: 0.75rem;
}

.mp-entity-body {
  padding: 0 0.65rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-entity-range {
  margin: 0.4rem 0;
}

.mp-table-compact {
  font-size: 0.76rem;
}

.mp-lot-row {
  cursor: pointer;
}

.mp-lot-row:hover {
  background: rgba(74, 155, 255, 0.08);
}

.mp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.mp-modal-backdrop.hidden {
  display: none;
}

.mp-modal {
  position: relative;
  width: min(640px, 100%);
  margin-top: 2vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.mp-modal-sm {
  width: min(420px, 100%);
}

.mp-modal-close {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

.mp-modal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  padding-right: 2rem;
  margin-bottom: 0.5rem;
}

.mp-chart-periods {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.mp-period {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

.mp-period.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dim);
}

.mp-chart-canvas {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.mp-chart-hint {
  margin: 0.5rem 0 0;
}

.mp-modal-wide {
  width: min(720px, 100%);
}

.mp-orderbook-section {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.mp-orderbook-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.mp-orderbook-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.mp-ob-refresh {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

.mp-ob-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.mp-orderbook-body {
  max-height: min(42vh, 380px);
  overflow: auto;
}

.ob-status {
  margin: 0.35rem 0;
  font-size: 0.85rem;
}

.ob-error {
  color: var(--down);
}

.ob-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.ob-pair {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ob-spread {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.ob-bid {
  color: var(--ok);
}

.ob-ask {
  color: var(--down);
}

.ob-last {
  margin: 0 0 0.5rem;
}

.ob-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 560px) {
  .ob-tables {
    grid-template-columns: 1fr;
  }
}

.ob-side-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ob-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.ob-table th,
.ob-table td {
  padding: 0.2rem 0.35rem;
  text-align: left;
}

.ob-table th.num,
.ob-table td.num {
  text-align: right;
}

.ob-table thead th {
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.ob-row {
  position: relative;
}

.ob-row .ob-depth {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 0;
  pointer-events: none;
  z-index: 0;
}

.ob-row td:not(.ob-depth) {
  position: relative;
  z-index: 1;
}

.ob-depth-bar {
  display: block;
  height: 100%;
  opacity: 0.18;
}

.ob-side-asks .ob-depth-bar {
  background: var(--down);
}

.ob-side-bids .ob-depth-bar {
  background: var(--ok);
}

.ob-side-asks .ob-price {
  color: #ff9e9e;
}

.ob-side-bids .ob-price {
  color: #7ee7b0;
}

.ob-empty {
  text-align: center;
  padding: 0.5rem;
}

/* --- ROI build cards (L1–L3) --- */
@media (max-width: 720px) {
  .filter-group--view {
    margin-left: 0;
    width: 100%;
  }

  .filter-group--view .segmented {
    width: 100%;
  }

  .filter-group--view .segmented button {
    flex: 1;
  }

  .filter-sep {
    display: none;
  }
}

.build-cards-root {
  margin-bottom: 1rem;
}

.build-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 1rem;
  align-items: start;
}

.build-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}

.build-group-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.build-group-title {
  margin: 0;
  font-size: 1.05rem;
}

.build-group-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.level-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.level-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.level-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}

.level-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
}

.level-badge {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.level-card-roi {
  font-weight: 700;
  font-size: 0.9rem;
}

.level-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
  flex: 1;
}

.level-metric .label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  margin-bottom: 0.1rem;
}

.level-metric strong {
  display: block;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-word;
}

.level-metric-wide strong .amount-line {
  flex-wrap: wrap;
}

.level-metric-wide {
  grid-column: 1 / -1;
}

.level-card.roi-good {
  border-color: rgba(72, 187, 120, 0.45);
}

.level-card.roi-mid {
  border-color: rgba(237, 201, 72, 0.4);
}

.level-card.roi-bad {
  border-color: rgba(245, 101, 101, 0.35);
}

@media (max-width: 1100px) {
  .level-cards {
    grid-template-columns: 1fr;
  }
}

/* —— Мой аккаунт —— */
.account-root {
  min-height: 12rem;
}

.account-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1rem;
  align-items: start;
}

.account-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.account-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.account-section__head .account-section__title {
  margin: 0;
}

.account-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.75rem;
}

.account-assignments {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.account-assignment {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto auto;
  gap: 0.5rem 0.65rem;
  align-items: end;
  padding: 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.account-assignment__icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  grid-row: span 2;
  align-self: center;
}

.account-assignment__remove {
  align-self: center;
  min-width: 2rem;
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
}

.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.account-results-table {
  margin-bottom: 1.25rem;
}

.account-charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.account-chart__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.account-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 80px;
  padding: 0.25rem 0;
}

.account-chart-bar {
  flex: 1;
  min-width: 6px;
  max-width: 28px;
  background: linear-gradient(180deg, var(--accent), rgba(99, 179, 237, 0.35));
  border-radius: 3px 3px 0 0;
  position: relative;
  cursor: default;
}

.account-chart-bar__label {
  position: absolute;
  bottom: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
}

.account-chart__legend {
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-assignment {
    grid-template-columns: auto 1fr 1fr;
  }

  .account-assignment__remove {
    grid-column: -1;
    grid-row: 1;
  }
}
