/* Coinz Market PoC styles — extends shared/theme.css with the
   "Live Pulse" layout: 1×N pack rail, per-pack chart + CTA, info
   bar with live countdown, activity-chip overlay, modal popup. */

body { padding-top: 0; }

/* ───────── page chrome ───────── */
.viewport-shell {
  margin: 0 auto; transition: max-width 0.25s ease;
  container-type: inline-size; container-name: page;
  display: flex; flex-direction: column; min-height: 100vh;
}
.site-body { display: flex; align-items: stretch; flex: 1; min-height: 0; }
.site-main { flex: 1; min-width: 0; }
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }

/* ─────────────────────────────────────────────────────────────────
   SITE HEADER (Figma 2046:11492 — Navbar)
   Deep-navy bar, full-width inside the viewport-shell. Visual-only
   chrome; nothing here is wired to behavior. Bootstrap-icons fill
   the icon slots; brand wordmark is text-styled (Open Sans 800).
   ───────────────────────────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 67px; flex-shrink: 0;
  background: var(--surface-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.hdr-icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-circle);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.hdr-icon-btn:hover { background: rgba(255, 255, 255, 0.10); }

/* Brand wordmark — white lowercase + small ".us" tail (ratified text tokens) */
.hdr-logo {
  display: inline-flex; align-items: baseline;
  padding: 0 4px 0 2px;
  font-family: var(--font-family);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  user-select: none; flex-shrink: 0;
}
.hdr-logo-mark { color: var(--text-primary); font-size: 28px; }
.hdr-logo-dot  { color: var(--text-primary); font-size: 28px; margin: 0 1px; }
.hdr-logo-tld  { color: var(--text-secondary); font-size: 14px; font-weight: 700; }

.hdr-search {
  flex: 1; max-width: 320px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: var(--surface-dark-500);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
}
.hdr-search:focus-within { outline: 2px solid var(--border-primary); }
.hdr-search > .bi { color: var(--text-secondary); font-size: 14px; }
.hdr-search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--text-primary); font-family: inherit; font-size: 13px;
}
.hdr-search input::placeholder { color: var(--text-secondary); }
.hdr-search input:focus { outline: none; }

.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.hdr-theme-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--surface-dark-500);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  font-size: 14px; line-height: 1;
}
.hdr-theme-pill .bi-sun-fill  { color: var(--gc-coin-color); }
.hdr-theme-pill .bi-moon-fill { color: var(--text-primary); opacity: 0.55; }

.hdr-balance-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-dark-500);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--text-primary); font-weight: 700; font-size: 13px;
  line-height: 1; white-space: nowrap;
}
.hdr-balance-coin {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--alert-success), var(--accent-green));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-inverted-primary); font-size: 12px; font-weight: 900;
}
.hdr-balance-amount::before { content: "$"; opacity: 0.85; margin-right: 1px; }
.hdr-balance-caret { font-size: 9px; opacity: 0.6; }

.hdr-bag-btn {
  width: 48px; height: 38px; border-radius: var(--radius-pill);
  background: var(--accent-cyan-gradient);
  border: 0; color: var(--text-on-cyan); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.hdr-bag-btn:hover { filter: brightness(1.08); }
.hdr-bag-btn:active { transform: scale(0.98); }

.hdr-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-circle);
  background: var(--surface-lightest-x3);
  border: 1px solid var(--border-light);
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
   SIDENAV (Figma 2046:11413 — Menu/Side/States)
   3 collapsible sections × icon+label rows. Section "open/close"
   chevron is visual-only — no JS toggle.
   ───────────────────────────────────────────────────────────────── */
.site-sidenav {
  width: 240px; flex-shrink: 0;
  padding: 14px 10px 32px;
  background: var(--surface-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  overflow-y: auto;
  font-family: var(--font-family);
}
.sidenav-section + .sidenav-section { margin-top: 18px; }
.sidenav-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 10px;
  color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.10em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
  user-select: none;
}
.sidenav-section-head .bi { font-size: 11px; opacity: 0.55; }

.sidenav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px;
  color: var(--text-primary); text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  line-height: 1; cursor: default;
  transition: background 0.12s ease;
}
.sidenav-item .bi {
  font-size: 18px; width: 22px; text-align: center; flex-shrink: 0;
}
.sidenav-item:hover { background: rgba(255, 255, 255, 0.16); }

/* ─────────────────────────────────────────────────────────────────
   Responsive — viewport-switcher hides chrome at narrower presets

   Thresholds chosen so the Tablet preset (max-width: 768px) trips
   the "compact" rule: sidenav + auxiliary header items hide, the
   pack cards keep their 3-column layout, and the page breathes
   instead of getting squeezed into a 528px main column.
   ───────────────────────────────────────────────────────────────── */
@container page (max-width: 900px) {
  .site-sidenav { display: none; }
  .hdr-search { display: none; }
  .hdr-theme-pill { display: none; }
}
@container page (max-width: 480px) {
  .hdr-balance-pill { display: none; }
  .site-header { gap: 8px; padding: 0 12px; }
  .hdr-logo-mark, .hdr-logo-dot { font-size: 22px; }
}

/* tab switcher */
.page-tabs { display: flex; justify-content: center; margin-bottom: 28px; }
.page-tabs-inner {
  background: var(--surface-dark-500); padding: 4px;
  border-radius: var(--radius-pill); display: inline-flex; gap: 4px;
}
.page-tab {
  background: transparent; color: var(--text-secondary);
  border: none; padding: 10px 28px; border-radius: var(--radius-pill);
  font-size: var(--text-14); font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; transition: all 0.2s ease;
  white-space: nowrap; cursor: pointer;
}
.page-tab.active {
  background: var(--surface-plain);
  color: var(--text-inverted-primary); box-shadow: var(--shadow-sm);
}

/* market title */
.market-title { text-align: center; margin-bottom: 24px; }
.market-title h1 {
  font-family: var(--third-family);
  font-size: var(--text-36); font-weight: 800;
  color: var(--text-primary); letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ───────── info bar (top, lazy-user pattern) ───────── */
.info-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
  padding: 10px 16px;
  background: var(--surface-dark-500);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  font-size: var(--text-12);
  flex-wrap: wrap;
}
.info-bar-group { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.info-bar-item { color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.info-bar-item strong { color: var(--text-primary); font-family: var(--third-family); font-weight: 700; font-variant-numeric: tabular-nums; }
/* urgent renders as an error chip (alert tokens are fills, not text on navy, OQ-7) */
.info-bar-item strong.urgent {
  color: #fff; background: var(--alert-error);
  padding: 1px 8px; border-radius: var(--radius-pill);
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.5; } }
.info-bar-trigger {
  background: rgba(0, 252, 253, 0.1);
  border: 1px solid rgba(0, 252, 253, 0.3);
  color: #00fcfd;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 5px;
}
.info-bar-trigger:hover { background: rgba(0, 252, 253, 0.2); border-color: #00fcfd; }

/* ───────── pack grid + card (1×N rail) ───────── */
.pack-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.pack-card {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 1.5fr) auto;
  grid-template-areas: "info graph cta";
  gap: 22px; align-items: center;
  position: relative; overflow: visible;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--surface-lightest), var(--surface-lighter));
  min-height: 148px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pack-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }

/* INFO column */
.vc-info { grid-area: info; display: flex; flex-direction: column; gap: 10px; }
.vc-amounts-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vc-amounts-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); font-weight: 700;
  margin-right: 4px; line-height: 1.1; display: inline-block;
}

.coin-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: var(--text-14);
}
.coin-pill .badge {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 900;
}
.coin-pill.gc { background: rgba(254, 224, 57, 0.1); color: var(--gc-coin-color); }
.coin-pill.gc .badge { background: var(--gc-coin-color); color: var(--text-inverted-primary); }
.coin-pill.sc { background: rgba(38, 255, 34, 0.1); color: var(--sc-coin-color); }
.coin-pill.sc .badge { background: var(--sc-coin-color); color: var(--text-inverted-primary); }

.vc-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 12px; font-weight: 900; line-height: 1;
}
.vc-tick.up   { background: var(--market-up-bg); color: var(--market-up); }
.vc-tick.down { background: var(--market-down-bg); color: #fff; }
.vc-tick.flat { background: rgba(130, 151, 189, 0.18); color: var(--text-secondary); }

.vc-pct-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
/* signal values sit in tint chips: alert tokens are fills, not text on navy (OQ-7) */
.vc-pct {
  font-family: var(--third-family); font-size: var(--text-30);
  font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums;
  padding: 2px 10px; border-radius: var(--radius-sm);
}
.vc-pct.up { color: var(--market-up); background: var(--market-up-bg); }
.vc-pct.down { color: #fff; background: var(--market-down-bg); }
.vc-pct.flat { color: var(--text-secondary); background: rgba(130, 151, 189, 0.14); }
.vc-delta { font-size: 11px; font-family: var(--third-family); font-variant-numeric: tabular-nums; color: var(--text-tertiary); }

.vc-live { font-size: var(--text-14); color: var(--text-secondary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vc-live-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); font-weight: 700;
}
.vc-live strong { font-family: var(--third-family); color: var(--text-primary); font-weight: 700; }
.vc-live .gc-total { color: var(--gc-coin-color); }
.vc-live .sc-total { color: var(--sc-coin-color); }

/* GRAPH column */
.vc-graph { grid-area: graph; width: 100%; }
.vc-graph-svg { width: 100%; height: 100px; display: block; }
.vc-graph-svg .baseline { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 3, 4; stroke-width: 1; }
.vc-graph-svg .axis-label { fill: rgba(255, 255, 255, 0.32); font-family: var(--third-family); font-size: 9px; }
.vc-graph-svg .trend-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vc-graph-svg .current-dot { filter: none; }

/* CTA column */
.vc-cta-col {
  grid-area: cta;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; min-width: 110px;
}
.vc-price { font-family: var(--third-family); font-size: var(--text-30); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cta-btn {
  background: var(--accent-cyan-gradient);
  color: var(--text-on-cyan); border: none; padding: 10px 22px;
  border-radius: var(--radius-pill); font-size: 15px;
  font-weight: 900; letter-spacing: 0.04em;
  text-transform: uppercase; min-width: 110px; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.cta-btn:hover { filter: brightness(1.08); }
.cta-btn:active { transform: scale(0.98); }
.cta-btn:disabled { opacity: 0.45; }

/* ───────── activity chip (overlay on a card) ───────── */
.card-chip {
  position: absolute; bottom: 8px; left: 50%;
  transform: translate(-50%, 8px);
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--sc-coin-color);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  font-size: 11px; font-weight: 600;
  border-radius: var(--radius-pill);
  white-space: nowrap; pointer-events: none;
  z-index: 5; opacity: 0;
  animation: card-chip-pop 3s ease forwards;
  max-width: calc(100% - 24px);
  overflow: hidden; text-overflow: ellipsis;
}
.card-chip strong { color: var(--sc-coin-color); font-weight: 700; }
.card-chip .bi { color: var(--gc-coin-color); }
@keyframes card-chip-pop {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(0.9); }
  10%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  90%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 4px) scale(0.95); }
}

/* ───────── description blurb (CORE-149: below the table) ───────── */
.market-blurb {
  margin-top: 28px;
  background: var(--surface-lightest-x2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: var(--text-secondary);
  font-size: var(--text-14); line-height: 1.55;
}
.market-blurb p + p { margin-top: 10px; }
.market-blurb strong { color: var(--text-primary); font-weight: 700; }

/* ───────── modal popup ───────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px); z-index: 9990;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  background: linear-gradient(165deg, var(--surface-lightest), var(--surface-lighter));
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  max-width: 560px; width: 100%;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.modal-card h2 {
  color: var(--text-primary);
  font-size: var(--text-24); font-weight: 600; margin-bottom: 14px;
}
.modal-card p { color: var(--text-secondary); font-size: var(--text-14); line-height: 1.55; margin-bottom: 10px; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--text-primary); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.15); }

/* ─────────────────────────────────────────────────────────────────
   DOCS PANEL — V2 Overview rendered from V2-OVERVIEW.md
   Full-screen overlay above the PoC. Prose-friendly typography on
   the existing dark brand surface. Triggered by the "Overview"
   button in #prototype-tools; closed by the × button or by
   clicking any viewport-mode button (event-coupled).
   ───────────────────────────────────────────────────────────────── */
.docs-panel {
  position: fixed; inset: 0; z-index: 9995;
  background: rgba(0, 7, 36, 0.96);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 40px 24px 96px;
}
.docs-panel[hidden] { display: none; }
.docs-panel-inner {
  max-width: 780px; margin: 0 auto;
  position: relative;
}
.docs-close {
  position: absolute; top: -8px; right: 8px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--text-primary); font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
}
.docs-close:hover { background: rgba(255, 255, 255, 0.18); }

.docs-content {
  background: var(--surface-lighter);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 40px 44px 36px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px; line-height: 1.65;
}
.docs-content > :first-child { margin-top: 0; }
.docs-content > :last-child  { margin-bottom: 0; }

.docs-content h1 {
  font-size: var(--text-24); font-weight: 600;
  margin: 0 0 18px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.docs-content h2 {
  font-size: 20px; font-weight: 700;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.docs-content h3 {
  font-size: 16px; font-weight: 700;
  margin: 22px 0 6px;
  color: var(--text-primary);
}
.docs-content p { margin: 0 0 12px; }
.docs-content ul, .docs-content ol { margin: 6px 0 16px; padding-left: 22px; }
.docs-content li { margin-bottom: 6px; }
.docs-content li > p { margin-bottom: 4px; }
.docs-content strong { color: var(--text-primary); font-weight: 700; }
.docs-content em { color: var(--text-primary); font-style: italic; }
.docs-content a {
  color: var(--link-color); text-decoration: none;
  border-bottom: 1px dashed rgba(38, 255, 34, 0.4);
  transition: border-color 0.15s ease;
}
.docs-content a:hover { border-bottom-style: solid; }
.docs-content hr {
  border: 0; border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin: 28px 0;
}
.docs-content code {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1px 6px; border-radius: var(--radius-sm);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  color: #00fcfd;
}
.docs-content blockquote {
  border-left: 3px solid #00fcfd;
  padding: 4px 16px;
  margin: 14px 0;
  color: var(--text-secondary);
  background: rgba(0, 252, 253, 0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Tables: clean readable grid, V1↔V2 comparison fits naturally */
.docs-content table {
  width: 100%; border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 14px;
}
.docs-content th, .docs-content td {
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 10px 14px;
  text-align: left; vertical-align: top;
}
.docs-content th {
  background: var(--surface-dark-500);
  color: var(--text-primary); font-weight: 700;
  font-size: 13px;
}
.docs-content tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }

/* Narrower phone formatting */
@media (max-width: 600px) {
  .docs-panel { padding: 24px 14px 64px; }
  .docs-content { padding: 28px 22px 24px; font-size: 14px; }
  .docs-content h1 { font-size: 24px; }
  .docs-content h2 { font-size: 17px; }
  .docs-close { top: -4px; right: 0; width: 32px; height: 32px; font-size: 18px; }
}

/* ───────── responsive (container-based) ───────── */
@container page (max-width: 720px) {
  .pack-card {
    grid-template-columns: 1fr;
    grid-template-areas: "info" "graph" "cta";
    gap: 14px; padding: 18px; min-height: auto;
  }
  .vc-cta-col {
    flex-direction: row; justify-content: space-between;
    align-items: center; width: 100%; min-width: 0;
  }
  .vc-graph-svg { height: 80px; }
  .vc-pct { font-size: var(--text-24); }
}
@container page (max-width: 600px) {
  .market-title h1 {
    font-size: var(--text-24); letter-spacing: 0;
    white-space: normal; line-height: 1.15;
  }
  .page-tab { padding: 9px 16px; font-size: 11px; }
  .card-chip { font-size: 10px; padding: 4px 10px; }
  .info-bar {
    flex-direction: column; align-items: stretch;
    border-radius: var(--radius-lg);
    padding: 12px 14px; gap: 8px;
  }
  .info-bar-group { flex-direction: column; align-items: flex-start; gap: 6px; }
  .info-bar-trigger { align-self: flex-start; }
  .modal-card { padding: 22px 18px 18px; }
  .modal-card h2 { font-size: var(--text-24); }
}
