/* Chart styles (loaded after styles.css and css/terminal.css). Builder C owns this file.
   Colours only through the tokens of styles.css: the four candle presets of js/chart.js are pairs of tokens, and the
   swatches below use the same ones. */

/* ---------- the pro chart on the token page (js/chart.js createProChart) ---------- */
.chart-card { display: flex; flex-direction: column; min-width: 0; }
.pc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.pc-bar .seg { flex: 0 0 auto; }
.pc-bar .seg-btn { padding: 3px 9px; font-size: 12px; min-height: 26px; }
.pc-mode.pc-off { opacity: 0.45; pointer-events: none; }
.pc-zoom { display: inline-flex; gap: 4px; }
.pc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; min-width: 26px; padding: 3px 9px; font: 500 12px var(--font-ui); color: var(--muted); background: var(--chip); border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pc-btn:hover, .pc-btn:focus-visible { color: var(--text); border-color: var(--brand); }
.pc-bubble { margin-left: auto; color: var(--text); }
.pc-gearwrap { position: relative; display: inline-flex; }
.pc-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 236px; padding: 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px -12px var(--shade-a80); display: grid; gap: 8px; }
.pc-pop[hidden] { display: none; }
.pc-pop-h { font: 600 12px var(--font-ui); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pc-sws { display: grid; gap: 4px; }
.pc-sw { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font: 500 12px var(--font-ui); color: var(--text); background: var(--chip); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; text-align: left; }
.pc-sw.on { border-color: var(--brand); background: var(--brand-soft); }
.pc-swc { width: 10px; height: 16px; border-radius: 2px; flex: 0 0 auto; }
.pc-swc-classic-u { background: var(--up); } .pc-swc-classic-d { background: var(--down); }
.pc-swc-cb-u { background: var(--cb-4); } .pc-swc-cb-d { background: var(--brand-hi); }
.pc-swc-mono-u { background: var(--text); } .pc-swc-mono-d { background: var(--dim); }
.pc-swc-pop-u { background: var(--cb-3); } .pc-swc-pop-d { background: var(--heat-4); }
.pc-picks { display: flex; gap: 12px; }
.pc-pick, .pc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.pc-pick input { width: 30px; height: 22px; padding: 0; border: 1px solid var(--line-2); border-radius: 4px; background: none; }

.pc-stage { position: relative; width: 100%; height: 320px; overflow: hidden; --pc-up: var(--up); --pc-down: var(--down); }
@media (min-width: 1000px) { .pc-stage { height: clamp(320px, calc((100vh - 290px) * 0.64), 640px); } }
@media (max-width: 520px) { .pc-stage { height: 300px; } .pc-bar { gap: 6px; padding: 6px 8px; } .pc-bubble { margin-left: 0; } }
.pc-host { position: absolute; inset: 0; }
.pc-host.pc-hide { visibility: hidden; }
.pc-legend { position: absolute; top: 6px; left: 10px; right: 76px; z-index: 4; pointer-events: none; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.pc-lg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-lg-top b { color: var(--text); font: 600 13px var(--font-ui); }
.pc-lg-img { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; }
.pc-lg-img img, .pc-lg-img > * { width: 18px; height: 18px; min-width: 18px; font-size: 9px; }
.pc-lg-venue { padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text); background: var(--bg-a70); }
.pc-lg-tf, .pc-lg-kind { padding: 1px 6px; border-radius: 4px; background: var(--chip); }
.pc-lg-ohlc { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.pc-lg-ohlc i { font-style: normal; color: var(--dim); margin-right: 3px; }
.pc-up { color: var(--pc-up); } .pc-down { color: var(--pc-down); }
.pc-tip { position: absolute; z-index: 5; pointer-events: none; max-width: 310px; padding: 5px 8px; font-size: 12px; color: var(--text); background: var(--bg-2-a94); border: 1px solid var(--line-2); border-radius: 6px; white-space: nowrap; }
.pc-tip[hidden], .pc-msg[hidden], .pc-skel[hidden] { display: none; }
.pc-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.pc-skel { position: absolute; inset: 56px 70px 34px 12px; display: flex; align-items: flex-end; gap: 1.6%; opacity: 0.5; }
.pc-sk { flex: 1 1 0; border-radius: 2px; background: var(--line-2); animation: pc-pulse 1.4s ease-in-out infinite; }
.pc-sk-0 { height: 34%; } .pc-sk-1 { height: 46%; } .pc-sk-2 { height: 40%; } .pc-sk-3 { height: 58%; } .pc-sk-4 { height: 52%; } .pc-sk-5 { height: 66%; } .pc-sk-6 { height: 48%; }
@keyframes pc-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.8; } }
@media (prefers-reduced-motion: reduce) { .pc-sk { animation: none; } }
.pc-foot { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 5px 10px 2px; font-size: 11px; color: var(--dim); }
.pc-note-hot { color: var(--warn); font-weight: 600; font-size: 12px; }
.pc-attr a { color: var(--muted); }

/* The library's attribution logo is switched off in js/chart.js (layout.attributionLogo: false): drawing it is the
   only place the library writes markup, which the page's Trusted Types policy refuses. The text attribution in
   .pc-attr, under the chart, is what credits it. */

/* phone: the corner legend stays on two short lines so it never sits on the candles */
@media (max-width: 520px) {
  .pc-legend { left: 8px; right: 62px; font-size: 11px; }
  .pc-lg-kind { display: none; }
  .pc-lg-ohlc { gap: 2px 7px; font-size: 11px; }
  .pc-lg-ohlc > span:last-child { display: none; }
}

/* ---------- token page: clean compact header, tighter stats, less text (js/views/coin.js) ----------
   Overrides the older token page rules in styles.css (this file loads after it). */

/* header: picture, then two tight lines */
.term-v2 .term-head { gap: 8px 20px; padding: 7px 12px; }
.term-v2 .term-id { flex: 0 1 auto; gap: 10px; align-items: center; min-width: 0; }
.term-v2 .th-img, .term-v2 .term-id .coin-img { width: 44px; height: 44px; border-radius: 6px; }
.term-v2 .coin-title { display: grid; gap: 4px; min-width: 0; flex: 1 1 auto; }
.th-l1 { display: flex; align-items: center; gap: 6px; min-width: 0; height: 20px; }
.term-v2 .term-id h1 { flex: 0 1 auto; min-width: 0; overflow: hidden; font: 700 16px/20px var(--font-ui); }
.term-v2 .th-sym { flex: none; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.term-v2 .term-name { max-width: 22ch; font: 400 13.5px/20px var(--font-ui); color: var(--muted); }
.th-acts { display: inline-flex; align-items: center; gap: 1px; flex: none; }
.term-v2 .th-acts .icon-btn { width: 20px; height: 20px; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--dim); cursor: pointer; }
.term-v2 .th-acts .icon-btn:hover, .term-v2 .th-acts .icon-btn:focus-visible { background: var(--chip); color: var(--text); }
.term-v2 .th-acts .icon-btn .ico { width: 13px; height: 13px; }
.term-v2 .th-acts .th-star[aria-pressed="true"] { color: var(--warn); }
.term-v2 .th-acts .th-star[aria-pressed="true"] path { fill: currentColor; }
.term-v2 .th-acts .th-hide[aria-pressed="true"] { color: var(--down); background: var(--down-a12); }
.term-v2 .th-l1 .chip { flex: none; height: 18px; padding: 0 7px; border: 0; border-radius: 4px; font: 600 11px/18px var(--font-mono); white-space: nowrap; }
.term-v2 .th-l1 .chip-curve { background: var(--brand-soft); color: var(--brand-hi); }
/* "graduated" is a stage, not a profit: no green (green and red are buy / sell and gain / loss alone) */
.term-v2 .th-l1 .chip-amm { background: var(--chip); color: var(--text); }

.th-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; height: 22px; font: 500 11.5px/1 var(--font-mono); color: var(--muted); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.th-l2::-webkit-scrollbar { display: none; }
.th-l2 > * { flex: none; }
.th-age { color: var(--text); font-weight: 600; }
.th-age[hidden] { display: none; }
.th-venue { display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 8px 0 7px; border-radius: 999px; background: var(--chip); color: var(--text); font: 500 11px/1 var(--font-ui); }
.th-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-hi); }
.tv-pool .th-dot { background: var(--brand-hi); }
.term-v2 .th-l2 .mint { font: 500 11px/1 var(--font-mono); color: var(--dim); }
.th-links { display: inline-flex; align-items: center; gap: 1px; }
.th-ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; color: var(--muted); }
.th-ic:hover, .th-ic:focus-visible { background: var(--chip); color: var(--text); text-decoration: none; }
.th-ic .ico { width: 13px; height: 13px; }
.th-cnt { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font: 600 11.5px/1 var(--font-mono); }
.th-cnt .ico { width: 12px; height: 12px; color: var(--dim); }

/* stat strip: small muted labels, hairline separators, the verdict as one chip at the far right */
.term-v2 .term-nums { gap: 0; }
.term-v2 .tn { gap: 6px; }
.term-v2 .tn-k { color: var(--muted); }
.term-v2 .tn-chk { display: inline-flex; align-items: center; flex: none; margin-left: auto; padding-left: 14px; text-decoration: none; }
.term-v2 .tn-chk:hover .lvl, .term-v2 .tn-chk:focus-visible .lvl { box-shadow: 0 0 0 1px var(--line-2); }
@media (min-width: 1000px) {
  .term-v2 .term-head { gap: 0 20px; padding: 6px 16px; min-height: 58px; }
  .term-v2 .tn { padding: 2px 14px; border-left: 1px solid var(--line); }
  .term-v2 .tn:first-child { padding-left: 0; border-left: 0; }
}
@media (min-width: 1000px) and (max-width: 1439px) {
  .term-v2 .term-head { gap: 0 14px; }
  .term-v2 .tn { padding: 2px 10px; }
  .term-v2 .term-name { max-width: 14ch; }
}
@media (max-width: 999px) {
  .term-v2 .term-head { gap: 8px 0; }
  .term-v2 .term-id { flex: 1 1 100%; }
  .term-v2 .term-nums { gap: 8px 18px; }
  .term-v2 .tn-chk { margin-left: 0; padding-left: 0; }
}
/* phone: three columns of stats; line 2 of the header scrolls sideways */
@media (max-width: 640px) {
  .term-v2 .term-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 0; overflow: visible; }
  .term-v2 .tn { min-width: 0; padding: 0 10px; border-left: 1px solid var(--line); overflow: hidden; }
  .term-v2 .tn:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  .term-v2 .tn-chk { align-self: center; padding-left: 10px; }
  .term-v2 .tn-chk:nth-child(3n + 1) { padding-left: 0; }
  .term-v2 .term-name { max-width: 14ch; }
}

/* safety lines: a dot, the label in white, the detail muted, two lines at most (title on hover, tap to open) */
.term-v2 .flags { margin: 4px 0 0; padding: 0; list-style: none; }
.term-v2 .ttab-flags { margin: 0; padding: 4px 12px; }
.term-v2 .flag { gap: 8px; padding: 5px 0; border-bottom: 0; font: 400 12px/1.4 var(--font-ui); cursor: pointer; }
.term-v2 .flag:focus-visible { outline: 1px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.term-v2 .flag-mark { width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; }
.term-v2 .flag-txt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; min-width: 0; overflow: hidden; }
.term-v2 .flag.open .flag-txt { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.term-v2 .flag-title { color: var(--text); font-weight: 600; }
.term-v2 .flag-says { color: var(--muted); }
.term-v2 .ti-verdict { padding-top: 8px; }
.term-v2 .ti-more { margin-top: 4px; }

/* ---------- token page on a phone: the ticker, the name and every icon fit at 390 wide ---------- */
/* Both header lines wrap onto a second line when they need to, instead of clipping the name or running off the edge. */
@media (max-width: 559px) {
  .term-v2 .term-id { flex: 1 1 100%; align-items: flex-start; }
  .term-v2 .th-l1 { flex-wrap: wrap; height: auto; min-height: 20px; gap: 4px 6px; }
  .term-v2 .term-id h1 { flex: 0 1 auto; max-width: 100%; }
  .term-v2 .th-sym { max-width: 14ch; }
  .term-v2 .term-name { flex: 0 1 auto; max-width: 100%; }
  .term-v2 .th-l2 { flex-wrap: wrap; height: auto; min-height: 22px; gap: 4px 8px; overflow: visible; }
  .term-v2 .th-links { flex-wrap: wrap; }
}

/* ---------- token page on a phone or tablet: tap targets ----------
   The four header actions (copy, share, watch, hide) and the link icons are 32 px targets, 4 px apart: they were 20
   to 22 px, 1 px apart, and one of them hides the coin. Both header lines grow with them. The "?" of a label keeps
   its size so the stat strip stays aligned; its tap area grows to 25 px. */
@media (max-width: 899px) {
  .term-v2 .th-l1 { height: auto; min-height: 20px; }
  .term-v2 .th-l2 { height: auto; min-height: 22px; }
  .term-v2 .th-acts, .term-v2 .th-links { gap: 4px; }
  .term-v2 .th-acts .icon-btn, .term-v2 .th-ic { width: 32px; height: 32px; }
  .term-v2 .th-acts .icon-btn .ico, .term-v2 .th-ic .ico { width: 15px; height: 15px; }
  .term-v2 .tipq { position: relative; }
  .term-v2 .tipq::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; }
}

/* safety check: "Checking…" while an old saved check is re-run, and a dated note when only an old one is on file */
.check-wait { padding: 4px 0 8px; }
.check-wait .loading { padding: 8px 0 4px; }
.check-wait p { margin: 0; }
.check-old { margin: 6px 0 8px; padding: 8px 10px; border-left: 3px solid var(--warn); border-radius: 6px; background: var(--warn-soft); color: var(--text); font: 500 12.5px/1.4 var(--font-ui); }

/* ---------- token page on a phone: nothing runs off the side, nothing covers the Buy bar ---------- */
@media (max-width: 999px) {
  /* The token info card needs side padding here, and the full-width rows inside it pull out by exactly that much:
     one pixel more and the whole page scrolls sideways. */
  .term-v2 .term-right > .check-card { padding: 12px 16px; }
  .term-v2 .ti-more { margin-left: -16px; margin-right: -16px; }
  .term-v2 .ti-more .ttab-row { padding-left: 16px; padding-right: 16px; }
}

