/* Trade (terminal.html): the live terminal's own parts, on top of system.css. web/terminal.js draws the chart with
   Lightweight Charts; the trade panel's form comes from web/tsell.js and web/jupswap.js, so their classes are dressed
   here in the system's parts: .tin as a field, .presets and .smode as segments, .bigbtn as the capped button,
   .sst as a message, .ssum as a sum. */

/* ---------- header ---------- */
.chead .err { display: grid; gap: 4px; padding: 4px 0; }
.chead .err b { font-size: var(--fs-3); font-weight: 500; }
.chead .err span { color: var(--paper2); }
.csub .tag { margin-left: 6px; vertical-align: -1px; }
.copy { font-family: var(--mono); font-size: var(--fs-1); color: var(--label); transition: color var(--t1) var(--ease); }
.copy:hover { color: var(--paper); }
.copy.copied::after { content: "Copied"; margin-left: 7px; font-family: var(--f); color: var(--paper2); }
.px sub { position: relative; top: 0.28em; margin: 0 0.04em; font-size: 0.7em; line-height: 0; vertical-align: baseline; }
body.loading .term { opacity: 0.5; transition: opacity var(--t1) var(--ease); }
.term svg.sol { flex: none; width: 0.95em; height: 0.95em; margin-left: 3px; vertical-align: -0.12em; }

/* ---------- chart ---------- */
.cbar .tfs, .cbar .unit { display: flex; gap: 2px; }
.cbar .tool { display: grid; place-items: center; width: 32px; padding: 0; }
.cbar .tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#ohlc { display: contents; } /* its spans sit in the legend's row */
.legend .when { color: var(--label); }
.plot[data-msg]::after { content: attr(data-msg); position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; color: var(--paper2); font-size: var(--fs-2); pointer-events: none; }
section.chart:fullscreen { border-radius: 0; }

/* ---------- tape ---------- */
.tape .tnone { padding: 12px 16px; color: var(--paper2); font-size: var(--fs-2); }

/* ---------- trade panel ---------- */
/* the panel's own wrappers stay out of the column, so every part keeps the column's 13px rhythm */
#pbody, .stepw, #blistwrap { display: contents; }
.sellbox, .buybox, .jupbox { display: flex; flex-direction: column; gap: 13px; }
:is(.sellbox, .buybox, .jupbox):empty { display: none; }
#tpanel .quiet { margin: 0; color: var(--paper2); font-size: var(--fs-2); line-height: 1.5; }
#tpanel .jnote { display: none; } /* the venue note above says it */
/* blocks for sale: a price and a size band, never the size */
.blist { display: grid; gap: 1px; max-height: 246px; overflow: hidden auto; border-radius: var(--r-bar); background: var(--hair); scrollbar-width: thin; scrollbar-color: var(--rule2) transparent; }
.blk { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 16px; background: var(--tile2); color: var(--paper2); font-size: var(--fs-1); text-align: left; transition: background var(--t1) var(--ease); }
.blk:hover { background: var(--tile3); }
.blk.on { background: var(--tile3); color: var(--paper); }
.blk.on::before { content: ""; position: absolute; left: 6px; top: 11px; bottom: 11px; width: 3px; border-radius: 1px; background: var(--coral); }
.blk > span:first-child { display: inline-flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.blk .redact { --w: 26px; margin-right: 8px; }
.blk .bpx { display: inline-flex; align-items: center; color: var(--paper); font-variant-numeric: tabular-nums; }
.vs { color: var(--label); font-variant-numeric: tabular-nums; }
.vs.under { color: var(--paper); }
/* a field you type into */
#tpanel .tin { position: relative; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 19px; border-radius: var(--r-bar); background: var(--tile2); cursor: text; }
#tpanel .tin::before { content: ""; position: absolute; left: 7px; top: 11px; bottom: 11px; width: 3px; border-radius: 1px; background: var(--hair); transition: background var(--t1) var(--ease); }
#tpanel .tin:focus-within::before { background: var(--coral); }
#jupbox .tin:focus-within::before { background: var(--steel); }
#tpanel .tin > span { flex: none; color: var(--label); font-size: var(--fs-1); }
#tpanel .tin input { flex: 1; width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--paper); font: 500 var(--fs-3)/1 var(--f); letter-spacing: inherit; text-align: right; font-variant-numeric: tabular-nums; }
#tpanel .tin input::placeholder { color: var(--label); font-weight: 400; }
#tpanel .tin input:disabled { color: var(--label); }
#tpanel .tin > em { flex: none; display: inline-flex; align-items: center; color: var(--label); font-size: var(--fs-1); font-style: normal; }
/* presets, prices under market and how to sell: segments, the chosen one on a capped bar */
#tpanel :is(.presets, .smode) { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1px; overflow: hidden; border-radius: var(--r-bar); background: var(--hair); }
#tpanel :is(.presets, .smode) > * { position: relative; display: grid; place-items: center; min-width: 0; height: 32px; padding: 0 6px; background: var(--tile2); color: var(--label); font-size: var(--fs-1); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color var(--t1) var(--ease), background var(--t1) var(--ease); }
#tpanel :is(.presets, .smode) > :hover { color: var(--paper); }
#tpanel :is(.presets, .smode) > .on { background: var(--tile3); color: var(--paper); }
#tpanel :is(.presets, .smode) > .on::before, #tpanel :is(.presets, .smode) > .on::after { content: ""; position: absolute; bottom: 3px; height: 2px; border-radius: 1px; background: var(--coral); }
#tpanel :is(.presets, .smode) > .on::before { left: 4px; width: 3px; }
#tpanel :is(.presets, .smode) > .on::after { left: 9px; right: 6px; }
#jupbox .presets > .on::before, #jupbox .presets > .on::after { background: var(--steel); }
/* lines and sums */
#tpanel .wline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--label); font-size: var(--fs-1); }
#tpanel .wline b { color: var(--paper); font-weight: 500; font-variant-numeric: tabular-nums; }
#tpanel .wline button { color: var(--paper2); text-decoration: underline; text-decoration-color: var(--rule3); text-underline-offset: 3px; }
#tpanel .wline button:hover { color: var(--paper); text-decoration-color: var(--paper); }
#tpanel .ssum { display: grid; gap: 8px; font-size: var(--fs-1); }
#tpanel .ssum:empty { display: none; }
#tpanel .ssum > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
#tpanel .ssum > div > span { color: var(--label); white-space: nowrap; }
#tpanel .ssum b { display: inline-flex; align-items: center; color: var(--paper); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
#tpanel .ssum .tot { padding-top: 9px; border-top: 1px solid var(--hair); font-size: var(--fs-2); }
#tpanel .ssum .tot > span { color: var(--paper2); }
#tpanel .ssum .tot b { font-size: var(--fs-3); font-weight: 600; }
#tpanel .ssum .redact { --w: 30px; margin-right: 7px; }
#tpanel .under { color: var(--paper); }
#tpanel .over { color: var(--paper2); }
#tpanel .warnline { color: var(--warn); line-height: 1.5; }
#bhold.low { color: var(--warn); }
/* the button carries the state: coral for a private step, paper to connect, swap in public or go elsewhere */
#tpanel .bigbtn { --btn-bg: var(--coral); --btn-fg: var(--on-coral); position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 8px); height: 46px; margin-left: 8px; padding: 0 16px 0 15px; border-radius: var(--r-bar); background: var(--btn-bg); color: var(--btn-fg); font: 500 var(--fs-3)/1 var(--f); letter-spacing: -0.005em; white-space: nowrap; transition: background var(--t1) var(--ease), transform var(--t1) var(--ease); }
#tpanel .bigbtn::before { content: ""; position: absolute; left: -8px; top: 0; bottom: 0; width: 5px; border-radius: var(--r-bar); background: var(--btn-bg); transition: transform var(--t1) var(--ease), background var(--t1) var(--ease); }
#tpanel .bigbtn:hover { --btn-bg: var(--coral-hi); }
#tpanel .bigbtn:hover::before { transform: translateX(3px); }
#tpanel .bigbtn:active { transform: translateY(1px); }
#tpanel :is(.bigbtn[data-act="pick"], a.bigbtn, .bigbtn.pub) { --btn-bg: var(--paper); --btn-fg: var(--on-paper); }
#tpanel :is(.bigbtn[data-act="pick"], a.bigbtn, .bigbtn.pub):hover { --btn-bg: #ffffff; }
#tpanel .bigbtn[disabled] { --btn-bg: var(--tile3); --btn-fg: var(--label); cursor: default; }
#tpanel .bigbtn[disabled]:hover::before, #tpanel .bigbtn[disabled]:active { transform: none; }
/* status: a message whose cap says its tone; one under way shows the filling bar instead */
#tpanel .sst { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 13px 11px 19px; border-radius: var(--r-bar); background: var(--veil); color: var(--paper); font-size: var(--fs-1); line-height: 1.5; }
#tpanel .sst::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 3px; border-radius: 1px; background: var(--paper2); }
#tpanel .sst.bad::before { background: var(--warn); }
#tpanel .sst:has(> .spin) { padding-left: 13px; color: var(--paper2); }
#tpanel .sst:has(> .spin)::before { display: none; }
#tpanel .sst:empty { display: none; }
#tpanel .sst a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--label); text-underline-offset: 3px; }
/* the wallets this browser has */
#tpanel .wpick { display: grid; gap: 1px; overflow: hidden; border-radius: var(--r-bar); background: var(--hair); }
#tpanel .wpick :is(button, a) { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: var(--tile2); color: var(--paper); font-weight: 500; text-align: left; transition: background var(--t1) var(--ease); }
#tpanel .wpick :is(button, a):hover { background: var(--tile3); }
#tpanel .wpick img { width: 20px; height: 20px; border-radius: 5px; }
#tpanel .wpick em { margin-left: auto; color: var(--label); font-size: var(--fs-1); font-style: normal; }
@media (min-width: 861px) {
  .term > .panel { overflow: hidden auto; scrollbar-width: thin; scrollbar-color: var(--rule2) transparent; } /* a long form scrolls inside its tile */
}

/* ---------- facts ---------- */
.side-facts .facts dl { display: grid; gap: 8px; }
.side-facts .facts dl > div { display: flex; justify-content: space-between; gap: 12px; }
.side-facts .facts dd { min-width: 0; overflow-wrap: anywhere; }
.side-facts .facts dd.warn { color: var(--paper); font-weight: 600; } /* mint or freeze still on: said in words, not in colour */

/* ---------- trades, holders, traders ---------- */
.bbar { display: flex; align-items: center; gap: 12px; padding-right: 14px; border-bottom: 1px solid var(--hair); }
.bbar .tabs { flex: 1; min-width: 0; border-bottom: 0; }
.bbar .segs > * { height: 28px; }
.tabs em:empty { display: none; }
.ttable td a { transition: color var(--t1) var(--ease); }
.ttable td a:hover { color: var(--paper); }
.trades-t tr.new td { animation: row-in var(--t3) var(--ease); }
@keyframes row-in { from { background-color: var(--tile3); } }
.ttable td.maker { white-space: nowrap; }
.mtags { display: inline-flex; align-items: center; gap: 4px; margin-right: 7px; vertical-align: -2px; }
.mtags:empty { display: none; }
.mt { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 3px; color: var(--paper2); font-style: normal; }
.mt svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mt.logo { object-fit: cover; background: var(--tile3); }
.mt.app { width: auto; min-width: 16px; padding: 0 3px; font: 700 7.5px/14px var(--f); letter-spacing: 0.02em; }
/* uses Confidential: the redact bar itself, cap and body */
.mt.conf { position: relative; width: 14px; height: 8px; margin-left: 3px; border-radius: 1px; background: var(--bar); }
.mt.conf::before { content: ""; position: absolute; left: -3px; top: 0; bottom: 0; width: 2px; border-radius: 1px; background: var(--coral); }
.fl, .txl { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 2px; border-radius: var(--r-bar); color: var(--label); vertical-align: middle; opacity: 0; transition: opacity var(--t1) var(--ease), background var(--t1) var(--ease); }
.fl svg, .txl svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ttable tr:hover :is(.fl, .txl), .fl.on, .fl:focus-visible, .txl:focus-visible { opacity: 1; }
.fl:hover, .txl:hover { background: var(--tile3); color: var(--paper); }
.fl.on { color: var(--paper); }
.fl.on svg { fill: currentColor; }
.ttable td.maker .fl:first-child { margin: 0 4px 0 0; }
@media (hover: none) { .fl, .txl { opacity: 1; } }
.thf { display: inline-flex; align-items: center; gap: 5px; margin: -3px -6px; padding: 3px 6px; border-radius: var(--r-bar); color: inherit; transition: background var(--t1) var(--ease), color var(--t1) var(--ease); }
.thf svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; opacity: 0.6; }
.thf:hover { background: var(--tile3); color: var(--paper); }
.thf:hover svg, .thf.on svg { opacity: 1; }
.thf.on { color: var(--paper); }
.thf.on svg { fill: currentColor; }
.hsum { display: flex; flex-wrap: wrap; gap: 10px 30px; padding: 14px 18px; border-bottom: 1px solid var(--hair); }
.hsum > div { display: grid; gap: 2px; }
.hsum span { color: var(--label); font-size: var(--fs-1); }
.hsum b { color: var(--paper); font-size: var(--fs-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.htable td.rem { text-align: right; }
.htable td.rem div { display: inline-flex; align-items: baseline; gap: 8px; }
.htable td.rem b { font-weight: 500; }
:is(.htable td.rem, .trtable td) em { color: var(--label); font-style: normal; }
.hbar { display: block; width: 120px; height: 4px; margin: 5px 0 0 auto; overflow: hidden; border-radius: 1px; background: var(--tile3); }
.hbar i { display: block; height: 100%; background: var(--paper2); }
.htag { margin-left: 8px; color: var(--paper2); font-size: var(--fs-1); }
.txn { margin-left: 6px; color: var(--label); font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.trtable td.two { line-height: 1.3; }
.trtable td small { display: block; color: var(--label); font-size: 11px; }
.trtable td.sell div { color: var(--paper2); }
.trtable .rem2 div { display: inline-flex; align-items: center; gap: 8px; }
.trtable .rem2 .hbar { width: 64px; margin: 0; }
/* the filter under a column head */
.fpop { position: fixed; z-index: 30; display: grid; gap: 10px; width: 280px; padding: 14px; border: 1px solid var(--hair); border-radius: var(--r-tile); background: var(--tile2); }
.fpop label { color: var(--label); font-size: var(--fs-1); }
.fin { position: relative; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px 0 19px; border-radius: var(--r-bar); background: var(--tile3); }
.fin::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 3px; border-radius: 1px; background: var(--rule3); }
.fin:focus-within::before { background: var(--paper); }
.fin span { color: var(--label); }
.fin input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--paper); font: 500 var(--fs-2)/1 var(--f); font-variant-numeric: tabular-nums; }
.fin input::placeholder { color: var(--label); font-weight: 400; }
.fpre { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1px; overflow: hidden; border-radius: var(--r-bar); background: var(--hair); }
.fpre button { height: 32px; background: var(--tile3); color: var(--paper2); font-size: var(--fs-1); font-weight: 500; transition: color var(--t1) var(--ease); }
.fpre button:hover { color: var(--paper); }
.fbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fbtns :is(.go, .ghost) { width: calc(100% - 8px); }
.ferr { color: var(--warn); font-size: var(--fs-1); }
/* a wallet's record in this coin, on hover */
.wcard { position: fixed; z-index: 40; width: 248px; border: 1px solid var(--hair); border-radius: var(--r-tile); background: var(--tile2); font-size: var(--fs-1); }
.wc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px 9px 14px; }
.wc-addr { display: inline-flex; align-items: center; gap: 6px; color: var(--paper); font-family: var(--mono); }
.wc-addr svg, .wc-cur svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--label); }
.wc-addr:hover svg { color: var(--paper); }
.wc-cur { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: var(--r-bar); background: var(--tile3); color: var(--paper); font-weight: 500; }
.wc-cur:hover { background: #27272e; }
.wc-grp { display: grid; gap: 5px; padding: 10px 14px; border-top: 1px solid var(--hair); }
.wc-line { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 10px; }
.wc-line:has(em) { grid-template-columns: 1fr auto auto; }
.wc-line span { color: var(--label); }
.wc-line b { display: inline-flex; align-items: center; justify-content: flex-end; color: var(--paper); font-weight: 500; font-variant-numeric: tabular-nums; }
.wc-line b:is(.sell, .down) { color: var(--paper2); }
.wc-line em { max-width: 92px; margin-left: 8px; overflow: hidden; color: var(--label); font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.wc-tier { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--hair); color: var(--label); }
.wc-tier em { margin-left: auto; font-style: normal; }
.wc-steps { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.wc-steps i { width: 3px; border-radius: 1px; background: var(--rule3); }
.wc-steps i.on { background: var(--paper); }
.wc-note { padding: 10px 14px 12px; border-top: 1px solid var(--hair); color: var(--paper2); }
.wc-load { display: grid; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--hair); }
.wc-load i { height: 10px; border-radius: 1px; background: var(--tile3); }
.wc-load i:nth-child(2) { width: 70%; }
.wc-load i:nth-child(3) { width: 85%; }

@media (max-width: 860px) {
  .bottom .scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--rule2) transparent; }
}
@media (max-width: 640px) {
  .cbar { overflow-x: auto; scrollbar-width: none; } /* six timeframes, the unit and the stamps on a phone */
  .cbar .tool { display: none; } /* pinch and drag do what Fit does */
  .cbar::-webkit-scrollbar { display: none; }
  .legend b, .legend .when { display: none; }
  .bbar { flex-wrap: wrap; row-gap: 0; padding: 0 0 10px; }
  .bbar .tabs { flex: 1 1 100%; }
  .bbar .segs { margin-left: 14px; }
  .hsum { gap: 8px 22px; padding: 12px 14px; }
  .hbar { width: 60px; }
}
@media (max-width: 420px) {
  .cbar button { padding: 0 5px; } /* the whole bar fits from 375; narrower, it scrolls */
  .cbar .sep { margin: 0 2px; }
}
@media (prefers-reduced-motion: reduce) {
  #tpanel .bigbtn, #tpanel .bigbtn::before, body.loading .term, .blk, .fl, .txl, .thf { transition: none !important; }
  #tpanel .bigbtn:hover::before, #tpanel .bigbtn:active { transform: none; }
  .trades-t tr.new td { animation: none; }
}

/* ---------- the coin menu: the name opens the search; on a narrow screen the search moves in here ---------- */
#cmenu { z-index: 45; width: min(340px, calc(100vw - 16px)); }
#cmenu .search { display: flex; width: 100%; background: var(--tile3); }
#cmenu .search kbd { display: none; }
