/* market.css */
/* layer over base.css */

:root {
    --card-bg:
        linear-gradient(180deg, rgba(14, 24, 45, 0.96) 0%, rgba(8, 16, 33, 0.96) 100%);
    --card-border: rgba(147, 197, 253, 0.10);
    --card-border-strong: rgba(147, 197, 253, 0.16);
    --card-shadow:
        0 16px 50px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
    --panel-soft:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
        linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(10, 18, 35, 0.92));
    --good: var(--ok);
}

/* PAGE */

body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.11), transparent 24%),
        linear-gradient(180deg, #04101f 0%, #071224 46%, #040b17 100%);
}

.market-page {
    min-width: 0;
}

body:has(.market-page) > .layout > .sidebar {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    overflow: visible !important;
}

body:has(.market-page) > .layout > .content > .topbar {
    position: relative !important;
    top: auto !important;
}

.page-title {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f3f4f6;
}

/* MAIN GRID */

.market-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.35fr) minmax(300px, 0.78fr);
    gap: 10px;
    align-items: start;
}

.market-main,
.market-side {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.market-page .card .hd h2 {
    font-size: 12px;
    letter-spacing: 0.08em;
}

.market-page .card .bd {
    padding: 11px;
}

.market-page .box .val {
    font-size: 16px;
}

.market-page .table th {
    font-size: 10px;
}

.market-page .table td {
    font-size: 11px;
}

.market-page [data-tab-group][data-tab-pane] {
    display: none;
}

.market-page [data-tab-group][data-tab-pane].active {
    display: block;
}

.market-main {
    grid-template-columns: 1fr;
}

.market-side {
    align-content: start;
}

/* CARD */

.card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(96, 165, 250, 0.05), transparent 18%, transparent 82%, rgba(96, 165, 250, 0.04)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 28%);
}

.card > .hd {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)),
        linear-gradient(90deg, rgba(59, 130, 246, 0.06), transparent 35%);
}

.card > .hd h2 {
    margin: 0;
    color: #f3f4f6;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.card > .bd {
    position: relative;
    z-index: 1;
    padding: 14px;
    min-width: 0;
}

/* BUTTONS */

.btn {
    appearance: none;
    height: 34px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn:hover {
    text-decoration: none;
    border-color: rgba(96, 165, 250, 0.28);
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.14), rgba(96, 165, 250, 0.06));
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.14);
}

.btn.secondary {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.footer-actions,
.chart-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* DEPTH SWITCHER */

.depth {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
}

.depthBtn {
    appearance: none;
    height: 28px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.depthBtn.active {
    color: #eff6ff;
    border-color: rgba(96, 165, 250, 0.30);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.34), rgba(37, 99, 235, 0.16));
}

.overlayBtn.active {
    border-color: rgba(96, 165, 250, 0.30);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.34), rgba(37, 99, 235, 0.16));
    color: #eff6ff;
}

.tv-tab-btn.active {
    border-color: rgba(96, 165, 250, 0.30);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.34), rgba(37, 99, 235, 0.16));
    color: #eff6ff;
}

.market-toolbar-card .bd {
    padding-top: 12px;
    padding-bottom: 12px;
}

.market-toolbar-card {
    position: sticky;
    top: 10px;
    z-index: 30;
}

.tv-mini-toolbar {
    position: sticky;
    top: 6px;
    z-index: 8;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: rgba(10, 18, 35, 0.86);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tv-mini-group { display: inline-flex; align-items: center; gap: 6px; }
.tv-mini-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #93a4bf; font-weight: 800; }
.tv-mini-chip { font-size: 10px; color: #c7d2fe; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 999px; padding: 2px 8px; }
.tv-mini-btn {
    appearance: none; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); color: #dbeafe;
    font-size: 10px; font-weight: 800; border-radius: 8px; padding: 4px 8px; cursor: pointer;
}
.tv-mini-btn.active { border-color: rgba(96, 165, 250, 0.35); background: rgba(37, 99, 235, 0.28); }
.tv-mini-hint { margin-left: auto; font-size: 10px; color: #93a4bf; }

/* CHIPS / PILLS */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(6, 16, 34, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #c7d2fe;
    font-size: 11px;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.chip.good {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(20, 83, 45, 0.24);
}

.chip.warn {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(120, 53, 15, 0.20);
}

.chip.bad {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(127, 29, 29, 0.18);
}

/* LINKS */

.link {
    color: #93c5fd;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* KPI PANEL */

.kpi {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.box {
    min-width: 0;
    min-height: 88px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: var(--panel-soft);
    box-shadow:
        0 0 0 1px rgba(96, 165, 250, 0.04),
        0 10px 30px rgba(30, 64, 175, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.box .val {
    color: #eef2ff;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 900;
    word-break: break-word;
}

.box .sub {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* CHART META */

.chart-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.chart-overlay-note {
    margin: 0;
}

/* DECISION (sidebar card — same column as Market artifacts) */

.market-decision-card .rail-sync {
    min-height: 14px;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(151, 159, 175, 0.88);
}

.market-decision-card .rail-body--decision {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
    min-height: 100px;
    max-height: min(520px, 52vh);
}

.rail-body.rail-body--loading {
    justify-content: center;
    align-items: center;
    min-height: 200px;
    max-height: none;
    overflow: hidden;
}

.rail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 12px;
    text-align: center;
}

.rail-loading-text {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(151, 159, 175, 0.95);
}

.rail-spinner--large {
    width: 48px;
    height: 48px;
    border-width: 4px;
    border-color: rgba(148, 163, 184, 0.35);
    border-top-color: #93c5fd;
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.45);
}

.rail-spinner {
    display: inline-block;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(148, 163, 184, 0.4);
    border-top-color: #93c5fd;
    border-radius: 50%;
    animation: rail-spin 1.65s linear infinite;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.35);
}

.rail-spinner--inline {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

@keyframes rail-spin {
    to {
        transform: rotate(360deg);
    }
}

.rail-agent {
    border-radius: 12px;
    border: 1px solid rgba(42, 46, 57, 0.75);
    background: rgba(24, 27, 38, 0.65);
    padding: 10px 10px 8px;
}

.rail-agent.present {
    border-color: rgba(8, 153, 129, 0.28);
    box-shadow: 0 0 0 1px rgba(8, 153, 129, 0.08);
}

.rail-agent-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.rail-agent-title {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #c9cdd4;
}

.rail-agent-thinking-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 44px;
    padding: 6px 0 4px;
    transition: opacity 0.72s ease;
}

.rail-agent-thinking-row.rail-fade-out {
    opacity: 0;
}

.rail-agent-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition:
        opacity 1s ease,
        transform 1s ease;
}

.rail-agent-content.rail-agent-content--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rail-agent-sum {
    font-size: 11px;
    line-height: 1.45;
    color: #aeb2bb;
    margin-bottom: 8px;
    word-break: break-word;
}

.rail-agent-link {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* CHART */

.chart-wrap {
    width: 100%;
    height: clamp(560px, 74vh, 900px);
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(71, 85, 105, 0.45);
    background:
        radial-gradient(140% 70% at 10% 0%, rgba(30, 41, 59, 0.55), rgba(19, 23, 34, 0) 55%),
        linear-gradient(180deg, #161c2b 0%, #131722 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 16px 46px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(59, 130, 246, 0.08);
    overflow: hidden;
}

.chart-wrap.tv-chart {
    height: clamp(620px, 82vh, 980px);
}

.chart-stage {
    position: relative;
}

.tv-left-toolbar {
    position: absolute;
    left: 10px;
    top: 54px;
    z-index: 5;
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(10, 14, 24, 0.46);
    backdrop-filter: blur(8px);
}

.tv-tool-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: #aab4c5;
    font-size: 12px;
    cursor: pointer;
}

.tv-tool-btn:hover {
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(148, 163, 184, 0.1);
    color: #ecf3ff;
}

.tv-corner-actions {
    position: absolute;
    right: 10px;
    top: 54px;
    z-index: 5;
    display: inline-flex;
    gap: 6px;
}

.tv-corner-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(10, 14, 24, 0.46);
    color: #aab4c5;
    cursor: pointer;
}

.tv-corner-btn:hover {
    border-color: rgba(148, 163, 184, 0.36);
    color: #ecf3ff;
}

.tv-like-topbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
    position: absolute;
    left: 12px;
    top: 12px;
    right: 12px;
    z-index: 4;
    padding: 6px 8px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: linear-gradient(180deg, rgba(15, 18, 28, 0.56), rgba(15, 18, 28, 0.34));
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    color: #b8c0cc;
    font-size: 11px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
}

.tv-like-topbar:hover {
    border-color: rgba(96, 165, 250, 0.44);
}

.tv-like-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-right: 7px;
    margin-right: 1px;
    border-right: 1px solid rgba(148, 163, 184, 0.22);
}

.tv-like-group:last-child {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
}

.tv-like-group--quicktf {
    margin-left: auto;
}

.tv-like-change.up {
    color: #22c55e;
}

.tv-like-change.down {
    color: #ef4444;
}

.tv-like-series-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 2px;
}

.tv-like-series-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #aab4c5;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
}

.tv-like-series-btn:hover {
    border-color: rgba(148, 163, 184, 0.36);
    background: rgba(148, 163, 184, 0.1);
    color: #e6edf8;
}

.tv-like-series-btn.active {
    background: rgba(74, 222, 128, 0.14);
    border-color: rgba(74, 222, 128, 0.52);
    color: #dbeafe;
}

.tv-like-indicators {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tv-like-ind-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #aab4c5;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
}

.tv-like-ind-btn:hover {
    border-color: rgba(148, 163, 184, 0.36);
    background: rgba(148, 163, 184, 0.1);
    color: #e6edf8;
}

.tv-like-ind-btn.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.54);
    color: #dbeafe;
}

.tv-like-quicktf {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tv-like-tf-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #aab4c5;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
}

.tv-like-tf-btn:hover {
    border-color: rgba(148, 163, 184, 0.36);
    background: rgba(148, 163, 184, 0.1);
    color: #e6edf8;
}

.tv-like-tf-btn.active {
    background: rgba(96, 165, 250, 0.16);
    border-color: rgba(96, 165, 250, 0.62);
    color: #dbeafe;
}

.tv-like-zoom {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tv-like-zoom-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #aab4c5;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
}

.tv-like-zoom-btn:hover {
    border-color: rgba(148, 163, 184, 0.36);
    background: rgba(148, 163, 184, 0.1);
    color: #e6edf8;
}
.tv-like-symbol { color: #f1f5f9; font-weight: 800; }
.tv-like-tf { color: #93c5fd; font-weight: 700; }
.tv-like-sep { opacity: .5; }
.tv-like-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(19, 23, 34, 0.95);
    color: #b2b5be;
    font-size: 11px;
}

.market-page .unified-page-head {
    display: none;
}

.market-page .market-ohlcv-card > .hd {
    display: none;
}

.market-page .market-lower-card {
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(8, 13, 24, 0.92), rgba(8, 13, 24, 0.82));
}

.market-chat-card {
    min-height: 705px;
}

.market-chat-card .hd {
    min-height: 44px;
    padding: 8px 10px;
    gap: 8px;
}

.market-chat-tabs {
    display: inline-flex;
    gap: 4px;
}

.market-chat-tabs .btn {
    height: 28px;
    border-radius: 999px;
    font-size: 11px;
    padding: 0 12px;
}

.market-chat-tabs .btn.active {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.2);
}

.market-chat-card .rail-body--decision {
    max-height: none;
    min-height: 610px;
}

.chart-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    z-index: 0;
}

.chart-wrap > * {
    position: relative;
    z-index: 1;
}

/* TABLES */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table th,
.table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
    text-align: left;
}

.table th {
    color: #93a4bf;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* REF LIST */

.refs {
    display: grid;
    gap: 12px;
}

.ref {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 42%);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: var(--panel-soft);
}

.ref .k {
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 800;
}

.ref .v {
    color: #cbd5e1;
    font-size: 12px;
    word-break: break-word;
}

.hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

/* UTILITIES */

.small {
    font-size: 11px;
}

.muted {
    color: var(--muted);
}

.mono {
    word-break: break-word;
}

/* MODAL */

#jsonModal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
}

#jsonModal.open {
    display: flex;
}

#jsonModal .inner {
    width: min(1100px, 96vw);
    max-height: 88vh;
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.94));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

#jsonModal .mh {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 12, 22, 0.88);
    backdrop-filter: blur(10px);
}

#jsonPre {
    margin: 0;
    padding: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #dbeafe;
    font-size: 12px;
    line-height: 1.5;
}

/* SAFETY FOR LONG CONTENT */

.market-grid,
.market-grid * {
    min-width: 0;
}

/* RESPONSIVE */

@media (max-width: 1350px) {
    .market-grid {
        grid-template-columns: 1fr;
    }

    .market-side {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1100px) {
    .card > .hd {
        flex-direction: column;
        align-items: start;
    }

    .footer-actions,
    .chart-actions {
        width: 100%;
    }

    .kpi {
        grid-template-columns: 1fr 1fr;
    }

    .chart-wrap {
        height: clamp(460px, 68vh, 760px);
    }
    .tv-left-toolbar,
    .tv-corner-actions {
        display: none;
    }
}

@media (max-width: 820px) {
    .market-side {
        grid-template-columns: 1fr;
    }

    .kpi {
        grid-template-columns: 1fr;
    }

    .ref {
        grid-template-columns: 1fr;
    }

    .chart-wrap {
        height: clamp(380px, 62vh, 620px);
    }
}

@media (max-width: 620px) {
    .btn {
        width: 100%;
    }

    .footer-actions,
    .chart-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .depth {
        flex-wrap: wrap;
    }
}

/* unified header spacing */
.market-page .page-title,
.market-page .page-subtitle {
  margin: 0 !important;
}

.market-page > .market-grid,
.market-page > .grid,
.market-page > .stack,
.market-page > section + section {
  margin-top: 0 !important;
}
