/* The homepage lists (discovery.js). A trading-terminal layer on the same equinox identity:
   the colours, faces, chips, buttons, meters and horizon of style.css, set tighter.
   Nothing is loaded from here: no images, no fonts, no other stylesheet. */

.discover {
  --d-gap: 0.55rem;
  --d-card-h: 16.6rem;
  --d-row-h: 2.9rem;
  --d-small: 0.8125rem;
  --d-tiny: 0.66rem;
  --d-soft: rgba(255, 255, 255, 0.03);
  --d-line-strong: #2a303a;
  margin-top: 1.7rem;
  position: relative;
}
.discover [hidden] { display: none !important; }
.discover .sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- head: title, the two lists, the live indicator ---------- */
.d-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.d-head h2 { margin: 0; font-size: var(--step-1); letter-spacing: 0; }

/* buttons inside the lists start from nothing, not from the lime page button */
.discover .dbtn {
  background: transparent; color: var(--dim); border: 0; border-radius: 0; padding: 0; font-weight: 500;
  box-shadow: none; transform: none; font-size: inherit; line-height: inherit;
}
.discover .dbtn:hover { background: transparent; border-color: transparent; box-shadow: none; color: var(--text); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.discover .seg-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.8rem; font-size: 0.875rem; white-space: nowrap;
  border-right: 1px solid var(--line); position: relative;
  transition: color var(--ease), background var(--ease);
}
.discover .seg-btn:last-child { border-right: 0; }
.discover .seg-btn:hover { background: var(--d-soft); }
.discover .seg-btn[aria-pressed="true"] { color: var(--lime); background: var(--lime-wash); font-weight: 600; }
.discover .seg-btn:focus-visible { outline-offset: -2px; border-radius: 0; }
.seg-count { font-size: 0.72rem; color: var(--dim); min-width: 1ch; }
.seg-btn[aria-pressed="true"] .seg-count { color: var(--text); }
.seg-count:empty { display: none; }

.live {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.45rem; height: 1.6rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
}
.live-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dim); flex: none; }
.live[data-state="ok"] .live-dot { background: var(--lime); box-shadow: 0 0 0 3px rgba(200, 255, 46, 0.14); animation: d-pulse 2.6s ease-in-out infinite; }
.live[data-state="ok"] .live-word { color: var(--lime); }
.live[data-state="wait"] .live-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 194, 51, 0.14); }
.live[data-state="wait"] .live-word { color: var(--amber); }
.live-age { letter-spacing: 0; text-transform: none; min-width: 5.5ch; }
.live-age:empty { display: none; }
@keyframes d-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- the "Just launched" strip: two horizon lines and what passes between them ---------- */
.ticker-row {
  display: flex; align-items: stretch; height: 2rem; margin-top: 0.8rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgba(200, 255, 46, 0.03) 70%, rgba(255, 194, 51, 0.04) 82%, transparent);
}
.ticker-label {
  flex: none; display: inline-flex; align-items: center; padding: 0 0.8rem 0 0; margin-right: 0.8rem;
  border-right: 1px solid var(--line); color: var(--lime);
  font-family: var(--mono); font-size: var(--d-tiny); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
.ticker { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.ticker-track { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex: none; white-space: nowrap; }
.ticker-track li { padding-right: 1.6rem; }
.ticker-track.moving { animation: d-ticker 60s linear infinite; }
.ticker:hover .ticker-track.moving, .ticker:focus-within .ticker-track.moving { animation-play-state: paused; }
@keyframes d-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk-item { display: inline-flex; align-items: baseline; gap: 0.45rem; text-decoration: none; font-size: 0.78rem; color: var(--dim); }
.tk-item:hover .tk-name, .tk-item:hover .tk-sym { color: var(--lime); }
.tk-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--lime); align-self: center; flex: none; }
.tk-launched .tk-dot { background: var(--dim); }
.tk-sym { color: var(--text); font-weight: 500; }
.tk-name { color: var(--dim); max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
.tk-kind { color: var(--dim); }
.tk-age { color: var(--dim); }

/* ---------- the bar: order, search, filters, layout ---------- */
.d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; margin-top: 0.7rem; }
.d-tabs { display: flex; }
.discover .seg-tabs .seg-btn, .discover .seg-view .seg-btn { padding: 0.32rem 0.7rem; font-size: var(--d-small); }
.seg-view { margin-left: auto; }
.discover input.d-search {
  flex: 1 1 9rem; max-width: 19rem; min-width: 0; width: auto; margin: 0; height: 2rem; padding: 0 0.7rem;
  font-size: var(--d-small); border-radius: 8px; background: var(--panel);
}
.discover input.d-search::placeholder { color: #6f7884; }
.d-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; }
.d-select {
  font: inherit; font-size: var(--d-small); color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; height: 2rem; padding: 0 0.5rem; cursor: pointer; transition: border-color var(--ease);
}
.d-select:hover { border-color: var(--d-line-strong); }
.d-select:focus-visible { outline: 2px solid var(--lime); outline-offset: 0; border-color: var(--lime); }
.d-checklabel { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; font-size: var(--d-small); color: var(--dim); cursor: pointer; white-space: nowrap; }
.d-check { accent-color: var(--lime); margin: 0; width: 0.95rem; height: 0.95rem; }

/* ---------- shared small pieces ---------- */
.d-label { font-size: var(--d-tiny); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.d-unit { font-family: var(--sans); font-size: var(--d-tiny); color: var(--dim); margin-left: 0.3em; letter-spacing: 0.02em; white-space: nowrap; }
.d-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.d-sym { color: var(--dim); font-size: 0.75rem; white-space: nowrap; flex: none; }
.d-dup {
  flex: none; font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber);
  border: 1px solid rgba(255, 194, 51, 0.45); border-radius: 4px; padding: 0 0.3rem; line-height: 1.5; white-space: nowrap;
}
.discover .chip { padding: 0.08rem 0.45rem; gap: 0.3rem; }
.discover .chip::before { width: 0.4rem; height: 0.4rem; }
.discover .chip-name { font-size: 0.72rem; }
.discover .chip-plain { font-size: 0.66rem; }
.d-chip { display: inline-flex; min-width: 0; overflow: hidden; border-radius: 999px; }
.is-over { color: var(--amber); }
.discover [data-tip] { cursor: help; }
.discover a [data-tip], .discover button[data-tip] { cursor: pointer; }

.d-time { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; flex: none; }
.d-time-text, .d-age { font-size: 0.72rem; color: var(--dim); white-space: nowrap; }
.miniarc { width: 1.85rem; height: 1.05rem; flex: none; overflow: visible; }
.miniarc .arc-rest { stroke-width: 1; stroke-dasharray: 1.5 2.5; }
.miniarc .arc-done { stroke-width: 1.6; }
.miniarc .sun.eclipsed { stroke-width: 1; }

.spark { display: block; width: 100%; height: 2.1rem; }
.spark-line { fill: none; stroke: var(--dim); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark.up .spark-line { stroke: var(--lime); }
.spark.down .spark-line { stroke: var(--red); }
.spark-zero { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.bars { display: block; width: 100%; height: 2rem; }
.bar-col { fill: var(--line); }
.bar-col.on { fill: var(--lime); }

.flash, .flash-up, .flash-down { animation: d-flash 900ms ease-out; border-radius: 3px; }
.flash-down { animation-name: d-flash-down; }
@keyframes d-flash { 0% { background: rgba(200, 255, 46, 0.3); } 100% { background: transparent; } }
@keyframes d-flash-down { 0% { background: rgba(255, 77, 46, 0.3); } 100% { background: transparent; } }
.slide-in { animation: d-slide 340ms ease-out; }
@keyframes d-slide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- cards ---------- */
.d-body { margin-top: 0.7rem; }
.dcards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--d-gap); grid-template-columns: repeat(auto-fill, minmax(min(16.5rem, 100%), 1fr)); }
.dcard {
  position: relative; min-width: 0; height: var(--d-card-h); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.dcard:hover, .dcard:focus-within { border-color: rgba(200, 255, 46, 0.45); box-shadow: 0 8px 28px -14px rgba(200, 255, 46, 0.35); }
.dcard:hover { transform: translateY(-2px); }
.dcard-main {
  display: flex; flex-direction: column; gap: 0.5rem; height: 100%; padding: 0.7rem 0.8rem 0.75rem; text-decoration: none; border-radius: var(--radius);
}
.dcard-main:focus-visible { outline-offset: -1px; border-radius: var(--radius); }
.dc-top { display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; height: 1.4rem; }
.dc-top .d-name { font-size: 1rem; }
.dc-rank { margin-left: auto; padding-left: 0.4rem; font-size: 0.72rem; color: var(--dim); flex: none; }
.dc-rank::before { content: "#"; opacity: 0.6; }
.dc-rank:empty { display: none; }
.dc-sub { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; height: 1.5rem; min-width: 0; }
.dc-lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; height: 1.9rem; margin-top: 0.15rem; white-space: nowrap; }
.dc-lead-main { display: inline-flex; align-items: baseline; min-width: 0; }
.dc-lead-side { display: inline-flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; line-height: 1.15; flex: none; }
.dc-lead-side .d-unit { margin-left: 0; }
.dc-big { font-size: 1.3rem; font-weight: 700; line-height: 1; color: var(--text); letter-spacing: -0.01em; }
.dc-usd { margin-left: 0.5em; font-size: 0.72rem; }
.dc-fill, .dc-change { font-size: 0.9rem; font-weight: 500; }
.dcard .d-meter { margin: 0.1rem 0 0; flex: none; }
.dc-bars { flex: none; height: 1.5rem; opacity: 0.75; }
.dc-spark { flex: none; height: 2.1rem; }
.dc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem 0.6rem; margin-top: auto; padding-top: 0.55rem; border-top: 1px solid var(--line); }
.d-stat { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.d-val { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }

/* the quick look: takes the place of the card's lower part while the card is pointed at or focused */
.quick {
  position: absolute; left: -1px; right: -1px; bottom: -1px; top: 3.85rem; z-index: 2;
  display: flex; flex-direction: column; gap: 0.3rem; padding: 0.55rem 0.8rem 0.7rem;
  background: #10130f; border: 1px solid rgba(200, 255, 46, 0.45); border-top-color: var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  opacity: 0; visibility: hidden; transition: opacity 140ms ease-out, visibility 0s linear 140ms; cursor: pointer;
}
.dcard:focus-within .quick { opacity: 1; visibility: visible; transition: opacity 140ms ease-out, visibility 0s; }
@media (hover: hover) {
  .dcard:hover .quick { opacity: 1; visibility: visible; transition: opacity 140ms ease-out 260ms, visibility 0s linear 260ms; }
}
.q-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.q-headval { font-size: 0.7rem; color: var(--dim); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.q-spark { height: 2rem; flex: none; }
.quick .bars { flex: none; }
.q-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; min-width: 0; }
.q-val { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.discover .q-go { margin-top: auto; padding: 0.32rem 0.8rem; text-align: center; font-size: 0.875rem; border-radius: 8px; }

/* ---------- table ---------- */
.dtablewrap { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--d-small); }
.dtable-open { min-width: 56rem; }
.dtable-launched { min-width: 64rem; }
.dtable th {
  text-align: right; font-weight: 500; white-space: nowrap; padding: 0 0.42rem; height: 2.1rem;
  border-bottom: 1px solid var(--line); background: #0b0d10;
}
.dtable th:first-child { border-top-left-radius: var(--radius); }
.dtable th:last-child { border-top-right-radius: var(--radius); }
.dtable th.left, .dtable td.left { text-align: left; }
.discover .th-sort, .th-plain {
  font-family: var(--sans); font-size: var(--d-tiny); letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim);
  display: inline-flex; align-items: center; gap: 0.2rem; height: 2.1rem;
}
.discover .th-sort.on { color: var(--lime); }
.th-arrow { font-size: 0.5rem; display: inline-block; }
.th-arrow:empty { display: none; }
.dtable td {
  text-align: right; white-space: nowrap; padding: 0 0.42rem; height: var(--d-row-h); border-bottom: 1px solid var(--line); vertical-align: middle;
  transition: background var(--ease);
}
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover td { background: var(--d-soft); }
.dtable tbody tr:hover td.c-rank { box-shadow: inset 2px 0 0 var(--lime); }
.dtable td.c-rank, .dtable th.c-rank { text-align: left; color: var(--dim); padding-left: 0.7rem; padding-right: 0.2rem; }
.dtable td.c-go, .dtable th.c-go { padding-right: 0.6rem; }
.dtable td.c-rank .num { font-size: 0.75rem; }
.dtable td.c-name, .dtable th.c-name { position: sticky; left: 0; z-index: 1; background: var(--panel); }
.dtable th.c-name { background: #0b0d10; }
.dtable tbody tr:hover td.c-name { background: #131619; }
.dt-link { display: inline-flex; align-items: baseline; gap: 0.45rem; text-decoration: none; max-width: 11.5rem; min-width: 0; overflow: hidden; vertical-align: middle; }
.dt-link:hover .d-name { color: var(--lime); }
.dtable .d-time-text { color: var(--text); font-size: var(--d-small); }
.dtable .d-age { color: var(--text); font-size: var(--d-small); }
.dt-usd { display: block; font-size: 0.68rem; line-height: 1.2; }
.dt-usd:empty { display: none; }
.dt-note { display: block; margin: 0; line-height: 1.2; }
.dt-note:empty { display: none; }
.dt-over { color: var(--amber); font-size: 0.7rem; margin-left: 0.4rem; }
.dt-over:empty { display: none; }
.dt-spark { width: 5rem; height: 1.7rem; }
.dtable td.c-spark { width: 5.9rem; }
.discover .dt-go { padding: 0.2rem 0.55rem; font-size: 0.75rem; border-radius: 6px; white-space: nowrap; }
.discover .dt-go:hover { border-color: var(--lime); color: var(--lime); }
.dtable td.c-go { width: 1%; }

/* ---------- loading, empty, more ---------- */
.dcard.skel { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.8rem; }
.dcard.skel:hover { transform: none; border-color: var(--line); box-shadow: none; }
.skel-bar { display: block; height: 0.8rem; border-radius: 4px; background: linear-gradient(90deg, #14171c 0%, #1b1f26 50%, #14171c 100%); background-size: 200% 100%; animation: d-shimmer 1.6s linear infinite; }
.skel-bar.tall { height: 1.9rem; }
.skel-bar.w40 { width: 40%; } .skel-bar.w60 { width: 60%; } .skel-bar.w70 { width: 70%; } .skel-bar.w80 { width: 80%; } .skel-bar.w100 { width: 100%; margin-top: auto; }
.skel-row td { text-align: left; }
.skel-row .skel-bar { width: 100%; }
@keyframes d-shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
.d-empty { margin-top: 0; min-height: 8rem; display: flex; flex-direction: column; justify-content: center; }
.d-empty-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.d-more { margin: 0.7rem 0 0; max-width: none; text-align: center; }
.discover .d-more button { padding: 0.35rem 0.9rem; font-size: var(--d-small); border-radius: 8px; }
.more-count { color: var(--dim); }
.more-count::before { content: "("; } .more-count::after { content: ")"; }

.d-foot { margin: 0.2rem 0 0; max-width: none; font-size: 0.78rem; }
.d-body + .d-more + .d-foot, .d-more + .d-foot { margin-top: 0.8rem; }
.d-fold { margin-top: 0.9rem; }
.d-fold > summary { padding-top: 0.6rem; padding-bottom: 0.6rem; font-size: var(--d-small); font-weight: 500; color: var(--dim); }
dl.facts.tight.d-legend { grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 0.35rem 1.2rem; }
.d-legend dd { color: var(--dim); }
.d-legend dt { color: var(--text); }
.d-legend dt.d-legend-head { grid-column: 1 / -1; color: var(--lime); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.5rem; }
.d-legend dd.d-legend-head { display: none; }
.d-fold .priceline { margin-top: 0.9rem; }

/* ---------- tooltip ---------- */
.dtip {
  position: fixed; z-index: 30; max-width: min(18rem, calc(100vw - 16px)); pointer-events: none;
  background: #12151a; border: 1px solid var(--d-line-strong); border-radius: 6px; padding: 0.45rem 0.6rem;
  font-size: 0.75rem; line-height: 1.4; color: var(--text); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
  overflow-wrap: anywhere;
}

/* ---------- narrower screens ---------- */
@media (max-width: 60rem) {
  .d-tabs { flex: 1 1 100%; }
  .seg-tabs { display: flex; width: 100%; }
  .discover .seg-tabs .seg-btn { flex: 1; justify-content: center; }
  .discover input.d-search { max-width: none; }
}
@media (max-width: 36rem) {
  .d-head h2 { flex: 1; }
  .seg-group { order: 3; display: flex; width: 100%; }
  .discover .seg-group .seg-btn { flex: 1; justify-content: center; }
  .live { margin-left: 0; }
  .discover input.d-search { flex: 1 1 100%; }
  .d-filters { flex: 1 1 100%; }
  .d-select { flex: 1; min-width: 0; }
  .d-checklabel { flex: 1 1 100%; order: 3; }
  .seg-view { margin-left: 0; display: flex; width: 100%; }
  .discover .seg-view .seg-btn { flex: 1; justify-content: center; }
  .dcards { grid-template-columns: minmax(0, 1fr); }
  dl.facts.tight.d-legend { grid-template-columns: 1fr; gap: 0; }
  dl.facts.d-legend dd { margin-bottom: 0.6rem; }
  .ticker-label { padding-right: 0.6rem; margin-right: 0.6rem; }
  .dt-link { max-width: 8.5rem; }
}

/* ---------- people who turn animations off: nothing moves, nothing flashes ---------- */
@media (prefers-reduced-motion: reduce) {
  .dcard:hover { transform: none; }
  .ticker { overflow-x: auto; }
  .ticker-track.moving { animation: none !important; transform: none; }
  .flash, .flash-up, .flash-down, .slide-in, .skel-bar, .live-dot { animation: none !important; }
}

/* the moving strip fades at both edges instead of being cut */
.ticker { -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.4rem, #000 calc(100% - 1.4rem), transparent); mask-image: linear-gradient(90deg, transparent, #000 1.4rem, #000 calc(100% - 1.4rem), transparent); }
