/* Moved out of index.html so the Content-Security-Policy needs no 'unsafe-inline'. */
/* Page-local layout for the Terminal dashboard. Candidates for the design system are marked [DS]. */

/* [DS] compact notice strip — replaces the full-width yellow banner */
.notes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--s-4); }
.note {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%;
  padding: 6px 12px 6px 8px; border-radius: var(--r-pill); font-size: 12px; color: var(--text-dim);
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--hairline-strong);
  cursor: help;
}
.note b { color: var(--text); font-weight: 600; }
.note .ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--text-dim); }
.note.warn .ico { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.note.info .ico { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.note.ok .ico   { background: color-mix(in srgb, var(--yes) 18%, transparent); color: var(--yes); }
.note .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html { overflow-x: clip; }  /* hidden tooltips must never widen the page */
.notes { position: relative; }
.note[data-tip] { position: static; }
.note[data-tip]::after { left: 0; transform: translate(0, 4px); max-width: min(360px, 100%); }
.note[data-tip]:hover::after, .note[data-tip]:focus-visible::after { transform: translate(0, 0); }

/* eyebrow above the title */
.pagehead .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pagehead .eyebrow .live-dot { width: 6px; height: 6px; }
.pagehead h1 .grad { background: linear-gradient(90deg, #fff 10%, #9db6ff 60%, #4c7dff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statusline .sep { width: 1px; height: 12px; background: var(--hairline-strong); }

/* [DS] KPI with icon tile */
.kpi .head { display: flex; align-items: center; gap: 10px; }
.kpi .ktile { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none;
  color: var(--accent); background: linear-gradient(180deg, rgba(76,125,255,.20), rgba(76,125,255,.06));
  box-shadow: inset 0 0 0 1px rgba(76,125,255,.28), 0 6px 18px -8px rgba(58,99,255,.7); }
.kpi .ktile.t-g { color: #3cc47f; background: linear-gradient(180deg, rgba(46,168,106,.20), rgba(46,168,106,.05)); box-shadow: inset 0 0 0 1px rgba(46,168,106,.28); }
.kpi .ktile.t-v { color: #b39cff; background: linear-gradient(180deg, rgba(155,110,243,.22), rgba(155,110,243,.05)); box-shadow: inset 0 0 0 1px rgba(155,110,243,.3); }
.kpi .ktile.t-y { color: #f5cf5b; background: linear-gradient(180deg, rgba(242,201,76,.18), rgba(242,201,76,.04)); box-shadow: inset 0 0 0 1px rgba(242,201,76,.26); }
.kpi .ktile svg { max-width: none; }
.kpi .v .u { color: var(--text-dim); font-weight: 600; font-size: .8em; margin-left: 1px; }
.kpi .s b { color: var(--text-dim); font-weight: 600; font-family: var(--num); }
.kpi.sk .v { width: 60%; height: 30px; }

/* secondary stat strip */
.strip { border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s-4); border: 1px solid var(--hairline); }
.strip .stat { background: color-mix(in srgb, var(--surface) 85%, transparent); }
.strip .stat .v { font-size: 17px; }

/* flow chart */
.flow { padding: 14px 18px 12px; position: relative; }
.flow svg { display: block; width: 100%; overflow: visible; }
.flow .bar { fill: url(#barg); transition: opacity var(--dur-fast) var(--ease); }
.flow .bar.hot { fill: #7da0ff; }
.flow .grid-l { stroke: var(--hairline); stroke-dasharray: 2 4; }
.flow .axis { fill: var(--text-faint); font: 500 10px var(--mono); }
.flow .hit { fill: transparent; cursor: crosshair; }
.flow-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--text-faint); font-size: 11.5px; }
.flow-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 6px; vertical-align: 0; }

/* token rows */
.tk { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.tk-main { min-width: 0; }
.tk-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; letter-spacing: -0.01em; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 440px; }
.tk-title.mono { font-size: 12.5px; font-weight: 600; }
.tk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; color: var(--text-faint); font-size: 11.5px; }
.tk-meta .meta { font-size: 11px; }
.hint { color: var(--text-faint); font-size: 11px; font-style: italic; }
.oc { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: var(--r-xs);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid; }
.oc.yes { color: #3cc47f; background: rgba(46,168,106,.12); border-color: rgba(46,168,106,.3); }
.oc.no  { color: #f0645c; background: rgba(229,83,75,.12);  border-color: rgba(229,83,75,.3); }
.oc.lbl { color: #9db6ff; background: rgba(76,125,255,.12); border-color: rgba(76,125,255,.3); text-transform: none; letter-spacing: 0; }
.mkt-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.mkt-icon { overflow: hidden; }
table.grid td { vertical-align: middle; }
table.grid td.rank { vertical-align: middle; }
td.sparkcell { width: 96px; }
td.sparkcell .nos { color: var(--text-faint); font-size: 10.5px; font-style: italic; white-space: nowrap; }
.price-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.bar-share { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bar-share .track { width: 64px; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-share .track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3a63ff, #7da0ff); }
tr.mine { background: rgba(76,125,255,.07); box-shadow: inset 2px 0 0 var(--accent); }
.ph-controls { padding: 10px 18px; border-bottom: 1px solid var(--hairline); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ph-controls .eyebrow { margin-right: 4px; }
.ph-controls .seg { min-width: 0; }
.show-m { display: none; }
.more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px;
  border-top: 1px solid var(--hairline); color: var(--text-faint); font-size: 12px; }
.more-row button { font-size: 12px; padding: 5px 12px; }
.dot.still { display: inline-block; width: 6px; height: 6px; background: var(--warn); color: var(--warn); }
.statusline .dot.still { animation: none; box-shadow: none; }
#flow, #tokens, #builders, #tape { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.banner a { color: inherit; text-decoration: underline; }
#opBanner[hidden] { display: none; }
.footer .links a { margin-right: 14px; }

/* live feed */
.feed { max-height: 980px; }
.frow { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.fside { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 1px; }
.fside.b { color: #3cc47f; background: rgba(46,168,106,.12); box-shadow: inset 0 0 0 1px rgba(46,168,106,.25); }
.fside.s { color: #f0645c; background: rgba(229,83,75,.12);  box-shadow: inset 0 0 0 1px rgba(229,83,75,.25); }
.fline { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); min-width: 0; }
.fline .who { font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.fline .q { color: var(--text); font-weight: 500; }
.fline .say { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fline .tid { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.famt { text-align: right; font-family: var(--num); font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.famt .px { display: block; color: var(--text-faint); font-weight: 500; font-size: 11px; margin-top: 2px; }
.fmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.feed-row.large { background: linear-gradient(90deg, rgba(242,201,76,.06), transparent 60%); }
.feed-foot { padding: 10px 18px; color: var(--text-faint); font-size: 11.5px; border-top: 1px solid var(--hairline); }
.rail-sticky { position: sticky; top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1280px) { .rail-sticky { position: static; } .feed { max-height: 560px; } }

/* mobile */
@media (max-width: 760px) {
  .tk-title { max-width: 240px; font-size: 13px; }
  .flow { padding: 12px 12px 10px; }
  .ph-controls { padding: 10px 14px; }
  .notes { gap: 6px; }
  .note { font-size: 11.5px; }
  .hide-m { display: none !important; }
  .statusline .sep { display: none; }
  .show-m { display: inline; }
  .ph-controls .eyebrow { display: none; }
  .tk-title { max-width: none; }
  .tk .mkt-icon { width: 28px; height: 28px; }
  .feed-row { padding: 12px 14px; }
  .more-row { padding: 10px 14px; }
  #tokens .panel-head, #tape .panel-head { flex-wrap: wrap; }
  #tokens .panel-head .spacer { display: none; }
  /* segments wrap instead of running off the edge */
  #tokTabs, #feedTabs { flex-wrap: wrap; overflow: visible; border-radius: var(--r-md); width: 100%; }
  #tokTabs button, #feedTabs button { flex: 1 1 auto; padding: 5px 10px; }
  #builders table.grid th, #builders table.grid td { padding-left: 8px; padding-right: 8px; }
  #builders .bar-share .track { display: none; }
}
@media (max-width: 520px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px 14px 12px; }
  .kpi .v { font-size: 21px; }
  .kpi .row { flex-wrap: wrap; }
  .kpi .row svg { max-width: 100%; width: 100%; height: 26px; }
  .kpi .head { gap: 8px; }
  .kpi .ktile { width: 24px; height: 24px; }
  .kpi .k { font-size: 9.5px; letter-spacing: .07em; }
  .kpi .s { font-size: 10.5px; }
  .note .txt { white-space: normal; }
}
