/* Radar's visual shell. Trading elements retain their original IDs and handlers. */
:root {
    --bg-panel: #09110e;
    --bg-card: #0d1913;
    --gold-dim: rgba(209, 190, 128, .19);
    --gold-bright: #eee4c3;
    --text-muted: #95a69b;
}
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { background: radial-gradient(ellipse at 50% 0, #10241a 0, #060c09 50%, #040806 100%); }
body, html { height: auto; overflow-x: clip; overflow-y: auto; }
::selection { color: #06110b; background: #cbbb82; }
.radar-skip { position: absolute; top: -100px; left: 24px; z-index: 100; padding: 14px; background: #eee4c3; color: #07100b; }
.radar-skip:focus { top: 12px; }
.radar-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hud-grid {
    max-width: 1920px; margin: 0 auto; padding: 0 32px 40px; gap: 24px;
    grid-template-columns: minmax(300px, .85fr) minmax(0, 1.65fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "header header" "orbit orbit" "workspace workspace" "account wallet";
}
.vault-frame { border-color: var(--gold-dim); border-radius: 16px; box-shadow: 0 16px 48px #0003; background: linear-gradient(130deg, #0c1611f5, #080f0bf5); }
.vault-frame::before, .vault-frame::after { display: none; }
.top-bar {
    min-height: 94px; padding: 14px 0; gap: 24px; border: 0; border-bottom: 1px solid #b4c2b21f;
    border-radius: 0; background: transparent; box-shadow: none; overflow: visible; backdrop-filter: none;
}
.radar-crest { width: 40px; height: 46px; }
.brand-name { font-size: 1.12rem; letter-spacing: .2em; }
.brand-sub { font-size: .56rem; letter-spacing: .16em; margin-top: 4px; }
.terminal-nav { display: flex; align-items: center; gap: 28px; margin-right: auto; margin-left: 36px; }
.terminal-nav a { position: relative; color: #97a99c; text-decoration: none; font: 500 .75rem var(--font-sans); padding: 24px 0; }
.terminal-nav a span { color: #617467; font: .6rem var(--font-mono); margin-right: 7px; }
.terminal-nav a[aria-current] { color: #f0e7ce; }
.terminal-nav a[aria-current]::after { content: ''; position: absolute; height: 2px; bottom: 12px; left: 0; width: 24px; background: #d5c388; }
.terminal-nav a:hover { color: #fff3cb; }
.sync-cluster { gap: 18px; }
.wallet-badge { padding: 0; border: 0; }
.wallet-label { font-size: .56rem; letter-spacing: .1em; margin-bottom: 6px; }
.top-bar #wallet-addr-display { border: 1px solid #c7b77555 !important; background: #c7b77513 !important; padding: 9px 14px !important; border-radius: 7px !important; font-size: .68rem; }
.top-bar #term-disconnect-btn { padding: 7px !important; }
.sync-widget { flex-wrap: wrap; width: 140px; padding: 0; background: none; border: 0; border-radius: 0; gap: 6px; }
.sync-widget .sync-timer { font-size: .56rem; }
.sync-widget .btn-gold { margin-left: 12px; border: 0; border-bottom: 1px solid #bca96855; background: none; padding: 1px 0 4px; font: 500 .63rem var(--font-sans); text-transform: none; letter-spacing: 0; }
.center-stage { height: clamp(650px, calc(100svh - 142px), 960px); background: #030504; border-color: #bbcfb326; border-radius: 20px; isolation: isolate; }
.stage-top-hud { position: absolute; inset: 0 0 auto; z-index: 8; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 34px 38px; background: linear-gradient(#08110ce6, #08110c00); border: 0; pointer-events: none; }
.stage-eyebrow, .stage-coordinate { font: 500 .6rem/1.7 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: #b5bea8; }
.stage-eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.stage-eyebrow::before { content: ''; width: 5px; height: 5px; border: 1px solid #dcc990; transform: rotate(45deg); }
.stage-top-hud h1 { font: 500 clamp(2.6rem, 4.3vw, 5rem)/1 var(--font-sans); letter-spacing: -.065em; color: #f1efdf; }
.stage-top-hud h1 em { font: italic 500 1.22em/.8 'Cormorant Garamond', Georgia, serif; letter-spacing: -.04em; color: #d7c48c; }
.stage-top-hud p { max-width: 32ch; margin-top: 16px; font-size: .77rem; line-height: 1.8; color: #a3b3a7; }
.stage-tools { display: flex; align-items: flex-end; flex-direction: column; gap: 13px; pointer-events: auto; }
.stage-top-hud > div:first-child { flex: 0 1 350px; min-width: 0; }
.stage-top-hud { min-height: 205px; }
.stage-top-hud h1 { font-size: clamp(2.15rem, 3.6vw, 4rem); white-space: nowrap; }
.stage-tools { flex: 0 0 auto; }
.orbit-account-summary { position: absolute; left: 50%; transform: translateX(-50%); width: min(38%, 450px); flex: 0 1 450px; min-width: 0; margin-top: 4px; padding: 13px 18px 12px; border: 1px solid #b5c29b24; border-radius: 12px; background: linear-gradient(110deg, #102218a1, #0a150e99); backdrop-filter: blur(12px); pointer-events: auto; text-align: center; }
.orbit-account-summary #orbit-account-source { max-width: none; margin: 0 0 12px; font: .55rem/1.5 var(--font-mono); color: #acbc9f; letter-spacing: .05em; }
.orbit-account-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.orbit-account-metrics > div { min-width: 0; }
.orbit-account-metrics > div + div { border-left: 1px solid #a8bd9824; padding-left: 18px; }
.orbit-account-metrics span { display: block; color: #a9b5a6; font: .56rem/1.5 var(--font-mono); }
.orbit-account-metrics strong { display: block; margin: 7px 0 9px; font: 500 clamp(1.25rem, 2.05vw, 2rem)/1.1 var(--font-sans); letter-spacing: -.05em; color: #e9e2c5; overflow-wrap: anywhere; }
.orbit-account-metrics strong.c-emerald { color: #55e3a1; }
.orbit-account-metrics strong.c-crimson { color: #f48c92; }
.orbit-account-metrics small { display: block; color: #93aa95; font: .49rem/1.85 var(--font-mono); }
.orbit-account-summary #orbit-account-status { max-width: none; font: .47rem/1.7 var(--font-mono); color: #849a87; margin-top: 12px; }
#orbit-candle-status { margin-top: 7px; color: #b3bfa3; font: .55rem/1.6 var(--font-mono); }
.orbit-candle-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 5px; font: .5rem/1.5 var(--font-mono); }
.orbit-candle-legend span:first-child { color: #66bd97; }
.orbit-candle-legend span:last-child { color: #d6c48a; }
.portfolio-history-status { padding: 16px 24px; font: .65rem/1.8 var(--font-mono); color: var(--text-muted); }
#portfolio-history-list { padding: 0 24px 20px; }
.portfolio-history-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid #9db59722; }
.portfolio-history-row > div { min-width: 0; }
.portfolio-history-row > div > strong { display: block; font: 500 .77rem/1.7 var(--font-sans); overflow-wrap: anywhere; }
.portfolio-history-row > div > span { display: block; margin-top: 6px; font: .56rem/1.7 var(--font-mono); color: var(--text-muted); }
.portfolio-history-row > strong { flex: none; font: 600 .85rem var(--font-mono); }
.stage-coordinate { color: #7f9385; font-size: .55rem; }
.stage-expand { display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #b3c1ae35; border-radius: 6px; background: #10201899; color: #dce3d7; font: .64rem var(--font-mono); cursor: pointer; }
.stage-expand svg { width: 13px; height: 13px; }
.stage-expand[hidden] { display: none; }
.stage-expand:hover { border-color: #d5c388; color: #f5e9c3; }
.orbit-viewport { flex: 1; height: 100%; min-height: 0; }
.ambient-vignette { background: radial-gradient(ellipse at 50% 55%, transparent 35%, #050b0780 100%), linear-gradient(0deg, #050b07db, transparent 18%, transparent 78%, #050b0730); }
.orbit-instructions { position: absolute; z-index: 7; bottom: 94px; left: 32px; right: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; font: .56rem var(--font-mono); color: #809587; letter-spacing: .045em; }
.orbit-instructions a { color: #cebf91; text-decoration: none; pointer-events: auto; padding: 10px 0; }
.orbit-instructions a:hover { color: #fff0c9; }
.stage-control-dock { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 9; width: max-content; max-width: calc(100% - 40px); gap: 4px; padding: 7px; border: 1px solid #c6cfa92b; border-radius: 12px; background: #101a13de; box-shadow: 0 8px 40px #0009, inset 0 1px #fff1; backdrop-filter: blur(24px); }
.dock-btn { font: 500 .65rem var(--font-sans); min-height: 38px; padding: 10px 15px; border-color: transparent; background: transparent; color: #a7b6aa; border-radius: 7px; letter-spacing: 0; }
.dock-btn:hover { background: #d7c48c12; box-shadow: none; border-color: #d7c48c44; }
.dock-btn.active { background: #d9c793; color: #122016; border-color: #e6d8af; box-shadow: 0 2px 10px #0005; }
#radar-labels[aria-pressed="true"] { color: #e1d8b9; background: #d7c48c0d; }
.orbit-labels-hidden .node-label-3d { display: none !important; }
.orbit-labels-hidden .node-label-3d.active { display: block !important; }
.dock-btn[id="btn-wireframe"] { font: .56rem var(--font-mono); margin-left: 7px; border-left: 1px solid #c6cfa92b; border-radius: 0 7px 7px 0; }
.speed-slider-wrap { gap: 8px; padding: 0 9px; }
.speed-slider-wrap label { font-size: .55rem; }
.speed-slider-wrap input { width: 64px; accent-color: #d7c48c; }
.node-label-3d { min-width: 130px; max-width: 210px; padding: 9px 13px; border-radius: 8px; border-color: #d5c38855; background: #0b1510dc; box-shadow: 0 8px 28px #0005; pointer-events: none; transform: translate(-50%, -100%); transition: border-color .2s, box-shadow .2s; }
.node-label-3d:hover, .node-label-3d.active { transform: translate(-50%, -100%); }
.node-label-3d button { pointer-events: auto; }
.node-label-3d[data-projection-hidden] { visibility: hidden; pointer-events: none; }
.orbit-label-focus { position: absolute; top: -9px; right: -9px; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #9cb49166; border-radius: 50%; background: #101e14; color: #d8c68c; font: 17px var(--font-sans); cursor: pointer; }
.orbit-label-focus:hover { background: #d8c68c; color: #101e14; }
.orbit-label-connectors { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: hidden; }
.orbit-label-connectors path { fill: none; stroke: #a6b995; stroke-width: 1; opacity: .38; stroke-dasharray: 3 4; }
.orbit-labels-hidden .orbit-label-connectors { visibility: hidden; }
.node-label-3d::after { background: #0b1510; }
.nl-top { font: 600 .59rem var(--font-mono); letter-spacing: .03em; }
.nl-price { font-size: .78rem; margin-top: 5px; }
.nl-edge { margin-top: 4px; font-size: .55rem; }
.nl-active-pos.visible { animation: none; border: 0; border-top: 1px solid #7baf8b40; background: transparent; box-shadow: none; padding: 8px 0 0; color: #c1d6c5; }
.nl-active-pos .filter-pill { min-height: 28px; padding: 5px 9px; font-size: .55rem; margin-top: 6px; }
.bag-vault-badge-3d { border-radius: 5px; }
.workspace-heading { grid-area: workspace; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 2px 2px; pointer-events: auto; }
.workspace-heading .stage-eyebrow { margin-bottom: 10px; font-size: .56rem; color: #a99b75; }
.workspace-heading h2 { font: 500 clamp(1.5rem, 2.2vw, 2rem) var(--font-sans); letter-spacing: -.045em; color: #edeedf; }
.workspace-heading p { font-size: .75rem; line-height: 1.8; color: #96a79a; margin-top: 8px; }
.workspace-link { font: .65rem var(--font-mono); color: #d7c48c; text-decoration: none; white-space: nowrap; padding: 10px 0; border-bottom: 1px solid #d7c48c44; }
.account-vault-stack, .wallet-vault-stack { gap: 24px; }
.panel-header { padding: 23px 24px; background: #ffffff02; border-color: #a2b69820; }
.panel-title { font: 600 .83rem var(--font-sans); color: #e1e5d9; letter-spacing: -.015em; gap: 11px; }
.panel-title::before { content: ''; width: 6px; height: 6px; border: 1px solid #d3bf80; border-radius: 1px; transform: rotate(45deg); }
.panel-tag { font-size: .55rem; font-weight: 400; padding: 5px 9px; color: #a3c9b3; border-color: #5d9a7440; background: #4a916815; }
.panel-body, .position-toolbar { padding: 20px 24px; }
.vault-frame .filter-pill { min-height: 38px; border-radius: 7px; padding: 9px 13px; font-size: .67rem; border-color: #a3bba32b; background: #a7b6a508; color: #b9c7b9; transition: border-color .2s, background .2s, color .2s; }
.vault-frame .filter-pill:hover:not(:disabled) { background: #d7c48c13; color: #eee4c3; border-color: #d7c48c66; }
.vault-frame .action-primary { background: #d7c48c; color: #102015; border-color: #e4d6ac; }
.vault-frame .action-danger { color: #e4a5a0; border-color: #bc6a623d; }
.position-card, .copy-subscription-card { background: linear-gradient(125deg, #11231980, #0a160f80); border-color: #98b7972b; border-radius: 10px; }
#active-positions-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; padding: 0 24px 24px; }
#active-positions-list .position-card { margin: 0; }
.wallet-trade-empty { line-height: 1.7; }
.radar-extension { margin-top: 0; }
.fees-vault > div:last-child, .copy-setup-vault > div:last-child, .copy-execution-vault > div:last-child { padding: 24px !important; }
.fees-vault p, .copy-setup-vault p { font-size: .82rem; line-height: 1.9; }
.fees-vault > div:last-child > p:last-child { margin-top: 18px; padding-top: 16px; border-top: 1px solid #a2b69820; font-size: .68rem !important; line-height: 1.85; }
.filter-bar { border-color: #a2b69820; padding: 12px 24px; }
.center-stage:fullscreen { width: 100vw; height: 100dvh; min-height: 0; max-height: none; border: 0; border-radius: 0; }
.center-stage:fullscreen .stage-top-hud { padding: 36px; }
.radar-theater-open { overflow: hidden !important; }
.center-stage.radar-expanded { position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100dvh; min-height: 0; max-height: none; border: 0; border-radius: 0; }
@media (min-width: 1700px) { .hud-grid { padding-inline: 48px; } }
@media (max-width: 1150px) {
    .hud-grid { padding-inline: 20px; gap: 20px; }
    .terminal-nav { margin-left: 10px; gap: 18px; }
    .sync-widget { display: none; }
    .stage-top-hud { padding: 28px; }
    .stage-control-dock { gap: 2px; }
    .dock-btn { padding-inline: 10px; }
}
@media (max-width: 960px) {
    .stage-top-hud { flex-wrap: wrap; }
    .stage-top-hud > div:first-child { flex: 1; }
    .orbit-account-summary { position: static; transform: none; width: auto; order: 3; flex-basis: 100%; margin-top: 4px; }
    .orbit-account-metrics strong { font-size: 1.65rem; }
    .orbit-account-metrics small { font-size: .55rem; }
    .center-stage { min-height: 740px; }
}
@media (max-width: 760px) {
    .hud-grid { padding: 0 14px 24px; gap: 16px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "header" "orbit" "workspace" "account" "wallet"; }
    .top-bar { flex-wrap: wrap; min-height: 80px; padding: 16px 2px; gap: 18px 12px; }
    .terminal-nav { order: 3; width: 100%; margin: 0; gap: 24px; }
    .terminal-nav a { padding: 6px 0 12px; font-size: .7rem; }
    .terminal-nav a[aria-current]::after { bottom: 2px; width: 18px; }
    .terminal-nav a:last-child { margin-left: auto; }
    .radar-crest { width: 31px; height: 34px; }
    .brand-name { font-size: .95rem; }
    .brand-sub { font-size: .48rem; }
    .sync-cluster { margin-left: auto; }
    .wallet-label { font-size: .48rem; }
    .top-bar #wallet-addr-display { padding: 8px 9px !important; font-size: .58rem; }
    .top-bar #term-disconnect-btn { display: block; margin: 6px 0 0 auto !important; font-size: .5rem !important; }
    .top-bar #term-disconnect-btn[hidden] { display: none; }
    .center-stage { height: 740px; border-radius: 14px; }
    .stage-top-hud { padding: 23px 20px; gap: 8px; }
    .stage-top-hud h1 { font-size: 2.5rem; }
    .stage-top-hud p { max-width: 25ch; font-size: .68rem; margin-top: 12px; }
    .stage-eyebrow { font-size: .48rem; letter-spacing: .1em; margin-bottom: 13px; }
    .stage-coordinate { display: none; }
    .orbit-account-summary { padding: 12px; margin-top: 10px; }
    .orbit-account-metrics { gap: 12px; }
    .orbit-account-metrics > div + div { padding-left: 12px; }
    .orbit-account-metrics strong { font-size: 1.45rem; }
    .orbit-account-metrics small { font-size: .46rem; }
    .orbit-account-summary #orbit-account-status { font-size: .43rem; }
    .stage-expand { padding: 9px; }
    .stage-expand .expand-label { display: none; }
    .orbit-viewport { flex: 1; height: 100%; }
    .orbit-instructions { left: 20px; right: 20px; bottom: 133px; font-size: .46rem; }
    .orbit-instructions span { max-width: 24ch; line-height: 1.7; }
    .stage-control-dock { width: calc(100% - 24px); max-width: none; bottom: 12px; justify-content: center; padding: 7px; gap: 4px; }
    .dock-btn { min-height: 34px; font-size: .59rem; padding: 8px 11px; }
    .dock-btn[id="btn-wireframe"] { margin-left: 0; border-left: 0; }
    .speed-slider-wrap { padding: 4px 8px; }
    .node-label-3d { width: 126px; max-width: 126px; min-width: 0; padding: 7px 9px; left: var(--label-x); }
    .nl-top { font-size: .48rem; white-space: nowrap; }
    .nl-price { font-size: .65rem; }
    .nl-active-pos.visible { font-size: .5rem; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
    .nl-active-pos > div { display: none; }
    .nl-active-pos .filter-pill { font-size: .48rem; min-height: 26px; padding: 4px 5px; margin: 0; }
    .workspace-heading { padding: 20px 3px 3px; align-items: flex-start; }
    .workspace-heading p { max-width: 30ch; font-size: .69rem; }
    .workspace-link { font-size: .54rem; }
    .panel-header { padding: 19px; }
    .panel-body, .position-toolbar, .filter-bar { padding-inline: 19px; }
    .portfolio-history-status { padding-inline: 19px; }
    #portfolio-history-list { padding-inline: 19px; }
    .fees-vault > div:last-child, .copy-setup-vault > div:last-child, .copy-execution-vault > div:last-child { padding: 19px !important; }
    #active-positions-list { padding: 0 19px 19px; }
    .account-vault-stack, .wallet-vault-stack { gap: 16px; }
}
@media (max-width: 370px) {
    .hud-grid { padding-inline: 10px; }
    .brand-cluster { gap: 6px; }
    .brand-name { font-size: .8rem; }
    .stage-top-hud h1 { font-size: 2.15rem; }
    .stage-top-hud { padding: 22px 16px; }
    .dock-btn { padding-inline: 8px; }
    .workspace-heading { flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.copy-risk-form { display: grid; gap: 10px; margin: 14px 0; }
.copy-risk-input { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px; color: var(--text-primary, #eee); background: #060e0a; border: 1px solid #d4af3755; border-radius: 8px; font: inherit; }
