/* The token page. Shared parts come from ui.css; this file only lays them out. */

/* ---- header ---------------------------------------------------------------------------------------- */
.tk-head { display: flex; align-items: center; gap: 20px; margin-bottom: 36px; }
.tk-head > .av { --s: 64px; }
.tk-id { min-width: 0; display: grid; gap: 8px; }
.tk-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.tk-title h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; line-height: 1.1; }
.tk-ticker { font-size: 22px; font-weight: 600; color: var(--muted); }
.tk-star { align-self: center; }
.tk-star[aria-pressed="true"] { color: #e8b130; }
.tk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; color: var(--muted); }
.tk-meta .creator span { color: var(--text); }
.tk-dot { color: var(--faint); }
.tk-mi { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.tk-addr, .tk-links { display: inline-flex; align-items: center; gap: 2px; }
.tk-links { margin-left: 4px; }
.tk-cap { margin-left: auto; text-align: right; display: grid; gap: 2px; flex: none; }
.tk-capval { line-height: 1.15; }
.tk-capprice { font-size: 14px; }

/* ---- the two columns ------------------------------------------------------------------------------- */
.tk-grid {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "chart side" "rest side";
  column-gap: 40px;
}
.tk-chartcol { grid-area: chart; min-width: 0; }
.tk-rest { grid-area: rest; min-width: 0; }
.tk-side { grid-area: side; position: sticky; top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

/* ---- price and chart ------------------------------------------------------------------------------- */
.tk-pricebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.tk-price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.tk-change { margin-top: 4px; font-size: 14px; font-weight: 500; }
.tk-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.chart { position: relative; width: 100%; touch-action: pan-y; user-select: none; }
.chart-canvas { display: block; cursor: crosshair; }
.chart-readout {
  position: absolute; left: 0; top: 0;
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  max-width: calc(100% - 84px);
  padding: 4px 8px; border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.chart-readout.on { opacity: 1; }
.chart-readout b { color: var(--text); font-weight: 600; white-space: pre; }
.chart-readout b.up { color: var(--up); }
.chart-readout b.down { color: var(--down); }

/* ---- numbers, details, about ----------------------------------------------------------------------- */
.tk-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 28px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tk-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; padding: 20px 0 0; }
.tk-detail { display: grid; gap: 6px; min-width: 0; }
.tk-detail-val { display: flex; align-items: center; gap: 4px; min-height: 28px; font-size: 15px; }
.tk-h { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.tk-about { margin-top: 36px; }
.tk-about p { margin: 0; max-width: 62ch; line-height: 1.6; overflow-wrap: anywhere; }

/* ---- trades and holders ---------------------------------------------------------------------------- */
.tk-tape { margin-top: 40px; }
.tk-tabbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.tk-tabbar .tabs { border-bottom: 0; }
.tk-tabbar .t-label { padding-bottom: 12px; }
.tk-table td { white-space: nowrap; }
.tk-sidecell { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.tk-you { height: 20px; padding: 0 7px; margin-left: 2px; color: var(--text); }
.tk-youslot:empty { display: none; }
.tk-none { padding: 28px 8px; text-align: center; }
.tk-table .pill { height: 20px; padding: 0 7px; }

/* ---- trade card ------------------------------------------------------------------------------------ */
.tk-trade { display: grid; gap: 16px; padding: 20px; }
.tk-paytop { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tk-bal { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-recv { display: grid; gap: 4px; padding: 0 4px; }
.tk-recv-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tk-recv-val { font-size: 22px; font-weight: 700; }
.tk-recv-unit { font-size: 15px; font-weight: 600; color: var(--muted); }
.tk-row { display: flex; justify-content: space-between; gap: 12px; padding: 0 4px; font-size: 14px; color: var(--muted); }
.tk-row > :last-child { color: var(--text); font-variant-numeric: tabular-nums; }
.tk-row > .down:last-child { color: var(--down); }
.tk-go { height: 52px; font-size: 16px; border-radius: 14px; }
.tk-go.is-connect { background: var(--text); color: var(--bg); }
.tk-go.is-connect:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.tk-go.is-short:disabled, .tk-go:disabled:not(.btn-buy):not(.btn-sell) { background: var(--surface-2); color: var(--muted); opacity: 1; }
.tk-go.is-done:disabled { opacity: 1; }
.tk-note { margin: -4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---- rank card ------------------------------------------------------------------------------------- */
.tk-rankcard { display: grid; gap: 14px; padding: 20px; }
.tk-rankcard .tk-h { margin: 0; }
.tk-steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 4px 0 2px; padding: 0; list-style: none; }
.tk-steps::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 6px; height: 2px; background: var(--line); }
.tk-step { position: relative; display: grid; justify-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.tk-step-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.tk-step.is-done { color: var(--muted); }
.tk-step.is-done .tk-step-dot { background: var(--muted); border-color: var(--muted); }
.tk-step.is-now { color: var(--text); font-weight: 600; }
.tk-step.is-now .tk-step-dot { background: var(--rk); border-color: var(--rk); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rk) 22%, transparent); }
.tk-rank-line { margin: 0; font-size: 14px; }
.tk-rankcard .rankprog-text { font-size: 13px; color: var(--text); }

/* ---- narrower screens: one column, the trade card right under the chart ---------------------------- */
@media (max-width: 1100px) {
  .tk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .tk-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chart" "side" "rest"; }
  .tk-side { position: static; margin-top: 28px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}
@media (max-width: 767px) {
  .tk-head { gap: 14px; margin-bottom: 24px; align-items: flex-start; }
  .tk-head > .av { --s: 56px; }
  .tk-title { gap: 8px; flex-wrap: wrap; }
  .tk-title h1 { font-size: 26px; }
  .tk-ticker { font-size: 17px; }
  .tk-meta { font-size: 13px; }
  /* the byline wraps here: spacing alone separates the items, so no line starts or ends on a dot */
  .tk-meta .tk-dot { display: none; }
  .tk-cap { display: none; }
  .tk-pricebar { margin-bottom: 14px; }
  .tk-controls { width: 100%; }
  .tk-side { grid-template-columns: minmax(0, 1fr); margin-top: 24px; }
  .tk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; }
  .tk-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-detail:last-child { grid-column: 1 / -1; }
  .tk-tape { margin-top: 32px; }
}
