/* TraderMap home: three-column live deck (markets | radar | tape). Loaded after shell.css + theme.css */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.home { margin: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.deck { flex: 1 1 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: 240px minmax(0, 1fr) 356px; gap: 12px; padding: 12px 16px 10px; }
.rail, .center, .side { min-height: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }

/* ---- markets rail ---- */
.rail { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; gap: 0; }
.rail-top { padding: 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.coin-search-input { width: 100%; font: inherit; font-size: 0.82rem; color: #fff; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; outline: none; }
.coin-search-input:focus { border-color: var(--gold); }
.coin-search-input::placeholder { color: var(--dim); }
.rail-set { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.rail .lbl { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--dim); }
.min-grp { display: flex; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.min-filter-btn { flex: 1; font: inherit; font-size: 0.7rem; color: var(--dim); background: none; border: 0; padding: 3px 6px; border-radius: 999px; cursor: pointer; }
.min-filter-btn:hover { color: #fff; }
.min-filter-btn[aria-pressed="true"] { background: var(--gold); color: #1a1205; font-weight: 700; }
#snd { font: inherit; font-size: 0.76rem; font-weight: 600; border-radius: 999px; padding: 6px 12px; cursor: pointer; border: 1px solid rgba(63,224,176,0.5); background: rgba(63,224,176,0.12); color: var(--buy); }
#snd[aria-pressed="false"] { border-color: var(--line); background: transparent; color: var(--dim); }
.coin-list { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 6px 6px 10px; display: flex; flex-direction: column; gap: 1px; }
.coin-chip-btn { font: inherit; text-align: left; color: var(--fg); background: none; border: 0; cursor: pointer; }
.coin { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; row-gap: 4px; width: 100%; padding: 7px 10px 6px 12px; border-radius: 6px; position: relative; }
.coin:hover { background: var(--panel-hover); }
.coin[aria-pressed="true"] { background: var(--panel-card); box-shadow: inset 2px 0 var(--gold); }
.coin .sym { font-weight: 600; font-size: 0.84rem; display: inline-flex; align-items: center; gap: 6px; }
.coin .px { font-size: 0.76rem; color: var(--dim); }
.coin .pr { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: rgba(255,116,104,0.35); overflow: hidden; }
.coin .pr i { display: block; height: 100%; width: var(--p, 50%); background: var(--buy); transition: width 0.6s; }
.coin.hot .sym::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(241,194,125,0.2); }
.coin.all .sym { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.05rem; }
.feeds { padding: 10px 12px; border-top: 1px solid var(--line); }
.feeds .lbl { display: block; margin-bottom: 6px; }
.feeds .ex-status { flex-wrap: wrap; gap: 4px 12px; }

/* ---- radar column ---- */
.flow { padding: 2px 4px 0; display: grid; gap: 8px; }
.flow-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.flow-line b { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
#tugB { color: var(--buy); } #tugS { color: var(--sell); text-align: right; }
.meter { position: relative; height: 12px; border-radius: 999px; background: var(--sell); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.meter i { display: block; height: 100%; width: 50%; background: var(--buy); transition: width 0.45s cubic-bezier(.3,.7,.2,1); }
.meter::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--bg); opacity: 0.85; }
.flow-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.78rem; color: var(--dim); }
.flow-meta em { font-style: normal; font-weight: 700; margin-left: 4px; }
.flow-stats { display: flex; gap: 18px; align-items: center; }
.combo { font-size: 0.72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.combo:empty { display: none; }
.combo.buy { background: rgba(63,224,176,0.16); color: var(--buy); } .combo.sell { background: rgba(255,116,104,0.16); color: var(--sell); }
.bump { animation: bump 0.3s; } @keyframes bump { 40% { transform: scale(1.12); } }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; flex: 0 0 auto; }
.tier-card { padding: 10px 16px 11px; min-width: 0; border-right: 1px solid var(--line); }
.tier-card:last-child { border-right: 0; }
.tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tier-head > span:first-child { font-family: var(--serif); font-style: italic; font-size: 1.12rem; color: #fff; white-space: nowrap; }
.tier-head .badge { font-size: 0.68rem; color: var(--dim); white-space: nowrap; }
.tier-big .tier-head > span:first-child { color: var(--gold) !important; }
.tier-nums { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; font-weight: 600; margin: 6px 0 5px; white-space: nowrap; }
.tier-bar { height: 4px; border-radius: 2px; background: var(--sell); overflow: hidden; }
.tier-bar-fill { height: 100%; width: 50%; background: var(--buy); transition: width 0.5s; }
.tier-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 0.68rem; color: var(--dim); white-space: nowrap; overflow: hidden; }

.chartwrap { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; background: #0a2030; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chart-top-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; border-bottom: 1px solid var(--line); background: rgba(14,34,49,0.9); }
.ctitle { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--dim); }
.ctitle b { font-style: normal; font-weight: 400; color: #fff; font-size: 1.3rem; }
.chart-ctrl-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chart-tf-picker, .chart-engine-picker, .chart-pane-picker { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.chart-tf-btn, .chart-engine-btn { font: inherit; font-size: 0.72rem; color: var(--dim); background: none; border: 0; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.chart-tf-btn:hover, .chart-engine-btn:hover { color: #fff; }
.chart-tf-btn[data-pane][aria-pressed="true"] { background: var(--panel-hover); color: #fff; box-shadow: inset 0 0 0 1px var(--line-light); }
.chart-tf-btn.active, .chart-engine-btn.active { background: var(--panel-hover); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-light); }
.btn-reset-pan { font: inherit; font-size: 0.72rem; font-weight: 700; color: #1a1205; background: var(--gold); border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
#chart { flex: 1 1 0; min-height: 0; width: 100%; display: block; cursor: grab; touch-action: none; }
#chart.dragging { cursor: grabbing; }
.tv-frame { flex: 1 1 0; min-height: 0; width: 100%; border: 0; }
.anomaly-alert-banner { display: none; position: absolute; top: 58px; right: 14px; z-index: 5; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; color: #2a1405; background: var(--gold); }
.anomaly-alert-banner.active { display: flex; animation: pulseA 1s ease-in-out infinite alternate; }
@keyframes pulseA { to { opacity: 0.72; } }
#banner { position: absolute; left: 50%; top: 100px; z-index: 4; transform: translate(-50%, 0); padding: 8px 20px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; opacity: 0; pointer-events: none; white-space: nowrap; border: 1px solid; backdrop-filter: blur(6px); }
#banner.buy { color: var(--buy); background: rgba(11,28,41,0.82); border-color: rgba(63,224,176,0.6); }
#banner.sell { color: var(--sell); background: rgba(11,28,41,0.82); border-color: rgba(255,116,104,0.6); }
#banner.show { animation: ban 2.6s ease-out; }
@keyframes ban { 0% { opacity: 0; transform: translate(-50%, -10px); } 10% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }
.shake { animation: shake 0.3s; } @keyframes shake { 25% { transform: translate(2px, 0); } 75% { transform: translate(-2px, 0); } }

.intel-toggle-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; color: var(--dim); font-size: 0.78rem; flex: 0 0 auto; background: var(--panel); }
.intel-toggle-bar:hover { border-color: var(--line-light); color: #fff; }
.intel-toggle-bar span:first-child { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: #fff; font-weight: 400 !important; }
.intel-drawer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; color: var(--dim); font-size: 0.8rem; line-height: 1.6; flex: 0 0 auto; }
.intel-drawer.open { max-height: 30vh; overflow-y: auto; padding: 4px 6px; }
.intel-drawer h2 { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: #fff; margin: 6px 0; }
.intel-drawer p { margin: 0 0 8px; max-width: 78ch; }
.intel-drawer b { color: #cfe3ec; }
.lnk-buy { color: var(--buy); font-weight: 700; } .lnk-gold { color: var(--gold); font-weight: 700; }

/* ---- tape + liquidations ---- */
.tape, .liq-box { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.tape { flex: 1 1 0; } .liq-box { flex: 0 0 34%; min-height: 150px; }
.box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px 9px; border-bottom: 1px solid var(--line); background: var(--bg-subtle); }
.box-head > span:first-child { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: #fff; }
.box-head .dim { font-size: 0.72rem; }
.dim { color: var(--dim); }
.tape-rows-container, .liq-rows-container { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.row { display: grid; grid-template-columns: 58px 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 14px; font-size: 0.8rem; position: relative; }
.row[hidden] { display: none; }
.row.head { color: var(--dim); font-size: 0.7rem; font-weight: 500; background: var(--bg-subtle); border-bottom: 1px solid var(--line); padding-top: 6px; padding-bottom: 6px; }
.row .dim { font-size: 0.74rem; }
.row a { color: #fff; font-weight: 700; } .row a:hover { color: var(--gold); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row.buy, .row.sell { border-bottom: 1px solid rgba(33,69,93,0.5); }
.row.buy { background: linear-gradient(90deg, transparent calc(100% - var(--w, 30%)), rgba(63,224,176,0.13)); }
.row.sell { background: linear-gradient(90deg, transparent calc(100% - var(--w, 30%)), rgba(255,116,104,0.13)); }
.row.buy .num { color: var(--buy); font-weight: 700; } .row.sell .num { color: var(--sell); font-weight: 700; }
.row.t2 { box-shadow: inset 2px 0 rgba(241,194,125,0.6); }
.row.t3 { box-shadow: inset 3px 0 var(--gold); font-weight: 600; background-color: rgba(241,194,125,0.06); }
.row.t2 .num::before, .row.t3 .num::before { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 0.82rem; color: var(--gold); margin-right: 8px; }
.row.t2 .num::before { content: "std"; opacity: 0.75; } .row.t3 .num::before { content: "mega"; }
.row.new { animation: flash 0.8s ease-out; } @keyframes flash { from { filter: brightness(1.9); } to { filter: none; } }
.liq-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 14px; font-size: 0.8rem; border-bottom: 1px solid rgba(33,69,93,0.5); }
.liq-badge { font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.liq-row.long .liq-badge { background: rgba(255,116,104,0.16); color: var(--sell); } .liq-row.short .liq-badge { background: rgba(63,224,176,0.16); color: var(--buy); }
.liq-row.long > span:last-child { color: var(--sell); } .liq-row.short > span:last-child { color: var(--buy); }
#empty, #liqEmpty { color: var(--dim); padding: 22px 18px; text-align: center; font-size: 0.8rem; margin: 0; }

.home .foot { padding: 6px 18px 8px; flex: 0 0 auto; }

@media (max-width: 1360px) { .deck { grid-template-columns: 208px minmax(0, 1fr) 320px; } .tier-meta span:first-child { display: none; } }
@media (max-width: 1100px) {
  body.home { height: auto; overflow: auto; }
  .deck { display: flex; flex-direction: column; flex: 0 0 auto; padding: 10px; }
  .bar { flex-wrap: wrap; row-gap: 6px; padding: 8px 10px; } .bar nav { order: 5; flex: 1 1 100%; overflow-x: auto; } .ref-links { margin-left: 0; flex-wrap: wrap; } .lang-select { margin-left: auto; }
  .center, .side, .rail { display: contents; }
  .flow { order: 1; } .tiers { order: 2; } .chartwrap { order: 3; flex: 0 0 auto; height: 62vh; min-height: 360px; }
  .rail { display: flex; order: 4; } .rail-top { flex-direction: row; flex-wrap: wrap; align-items: center; } .coin-search-input { flex: 1 1 160px; width: auto; }
  .coin-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; flex: 0 0 auto; padding: 8px; } .coin { width: auto; min-width: 96px; }
  .feeds { display: none; }
  .tape { order: 5; flex: 0 0 auto; height: 440px; } .liq-box { order: 6; flex: 0 0 auto; height: 300px; }
  .intel-toggle-bar { order: 7; } .intel-drawer { order: 8; }
  .tier-card { padding: 9px 10px; } .tier-head .badge { display: none; }
}
@media (max-width: 640px) { .flow-line b { font-size: 1.25rem; } .tiers { grid-template-columns: 1fr; } .tier-card { border-right: 0; border-bottom: 1px solid var(--line); } .tier-card:last-child { border-bottom: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.intel-drawer h3 { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; color: #fff; margin: 12px 0 6px; }
.coin-links { display: flex; flex-wrap: wrap; gap: 4px 6px; padding-bottom: 8px; }
.coin-links a { font-size: 0.72rem; font-weight: 600; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.coin-links a:hover { color: var(--gold); border-color: var(--gold); }

/* ---- coin pages: live deck first screen, article below ---- */
body.home.coinpage { height: auto; overflow: auto; }
.coinpage .deck { flex: 0 0 auto; height: calc(100vh - 46px); height: calc(100dvh - 46px); min-height: 560px; }
.coin-article { max-width: 940px; width: 100%; margin: 34px auto 44px; padding: 0 22px; color: var(--dim); line-height: 1.75; font-size: 0.95rem; }
.coin-article h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; color: #fff; margin: 30px 0 8px; line-height: 1.2; }
.coin-article h2:first-child { margin-top: 0; }
.coin-article h3 { font-size: 0.98rem; color: #e4f0f5; margin: 16px 0 4px; font-weight: 600; }
.coin-article p { margin: 0 0 12px; } .coin-article ul { margin: 0 0 12px; padding-left: 20px; } .coin-article li { margin-bottom: 6px; }
.coin-article a { color: var(--gold); } .coin-article a:hover { text-decoration: underline; }
.coin-article .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 16px 0 6px; }
.coin-article .facts > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.coin-article dt { font-size: 0.72rem; color: var(--dim); } .coin-article dd { margin: 3px 0 0; color: #fff; font-weight: 600; font-size: 0.95rem; }
.coin-article .related { display: flex; flex-wrap: wrap; gap: 8px; }
.coin-article .related a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; color: #e4f0f5; }
.coin-article .related a:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
@media (max-width: 1100px) { .coinpage .deck { height: auto; min-height: 0; } }
