/* ===== GP History page — shared across v2/v3 themes ===== */

.gp-history-page .gp-hist-subnav {
  display: flex;
  justify-content: center;
}
.gp-hist-back {
  color: var(--text-dim, #8892a8);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.18s ease;
}
.gp-hist-back:hover { color: var(--gold-bright, #f5d96a); }

/* Donate button in the GP-history header. The main theme positions the
   donate button with `margin-right: 25px` to clear an ad-banner that isn't
   rendered on this page, and on very narrow screens it can end up hugging
   the Back-to-portal link. Override for this page only. */
.gp-hist-donate {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .gp-history-page .site-header .header-inner {
    column-gap: 14px;
  }
  .gp-history-page .gp-hist-donate {
    margin-right: 0;
    padding: 6px 14px;
    font-size: 11px;
  }
}
@media (max-width: 540px) {
  .gp-history-page .site-header .header-inner {
    grid-template-columns: auto 1fr auto;
    column-gap: 12px;
  }
  .gp-history-page .site-logo { height: 34px; }
  .gp-history-page .gp-hist-subnav { justify-self: center; }
  .gp-history-page .gp-hist-back { font-size: 11px; letter-spacing: 0.03em; }
}

.gp-hist-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gp-hist-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gp-hist-title {
  font-family: var(--font-display, serif);
  font-size: 26px;
  letter-spacing: 0.06em;
  color: var(--gold-bright, #f5d96a);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.gp-hist-coin {
  width: 28px; height: 28px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(245, 217, 106, 0.35));
}
.gp-hist-sub {
  color: var(--text-dim, #a8adbd);
  max-width: 820px;
  line-height: 1.55;
}
.gp-hist-sub strong { color: var(--gold-bright, #f5d96a); font-weight: 600; }

/* Stats grid — seven cards on a single desktop row. We force exactly 7
   equal columns with `minmax(0, 1fr)` so long values like "$1.506" or
   "-28.70%" never push a card off the line. Card internals are compact
   so this all holds down to ~900px; below that we stack to 4, then 2. */
.gp-hist-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.gp-hist-stat {
  background: linear-gradient(180deg, rgba(30,30,34,0.75) 0%, rgba(12,12,14,0.8) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;      /* allow flex/grid children to shrink below content size */
  overflow: hidden;  /* defense-in-depth if a label ever runs long */
}
.gp-hist-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim, #8890a0);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-hist-stat-value {
  font-family: var(--font-body, 'Source Sans 3', sans-serif);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright, #f5d96a);
  letter-spacing: -0.01em;
  white-space: nowrap;     /* price + pct must never wrap inside a card */
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-hist-stat-value.is-buyer { color: #67e8f9; }
.gp-hist-stat-value.is-seller { color: #f5d96a; }
.gp-hist-stat-value.is-up   { color: #22c55e; }
.gp-hist-stat-value.is-down { color: #ef4444; }
.gp-hist-stat-note {
  font-size: 10px;
  color: var(--text-dim, #8890a0);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .gp-hist-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .gp-hist-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Chart controls */
.gp-hist-chart-section {
  background: linear-gradient(180deg, #1a1a1d 0%, #08080a 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gp-hist-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  align-items: center;
  justify-content: space-between;
}
.gp-hist-control-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gp-hist-control-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim, #8890a0);
  margin-right: 6px;
  font-weight: 600;
}
.gp-hist-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text, #d8d0c0);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}
.gp-hist-btn:hover {
  border-color: rgba(245, 217, 106, 0.45);
  color: var(--gold-bright, #f5d96a);
}
.gp-hist-btn.is-active {
  background: linear-gradient(180deg, rgba(245, 217, 106, 0.18) 0%, rgba(168, 134, 40, 0.16) 100%);
  border-color: rgba(245, 217, 106, 0.55);
  color: #fde68a;
  box-shadow: 0 0 8px rgba(245, 217, 106, 0.25);
}
.gp-hist-legend {
  font-size: 11px;
  color: var(--text-dim, #8890a0);
  display: inline-flex;
  gap: 14px;
  align-items: center;
}
.gp-hist-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}
.gp-hist-legend-dot.is-up   { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.gp-hist-legend-dot.is-down { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }

/* Chart wrapper */
.gp-hist-chart-wrap {
  position: relative;
  width: 100%;
  height: 460px;
  background: #050506;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  overflow: hidden;
  cursor: crosshair;
}
.gp-hist-chart { width: 100%; height: 100%; display: block; }
.gp-hist-chart-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim, #8890a0);
  font-size: 13px;
  letter-spacing: 0.05em;
  pointer-events: none;
  background: rgba(5,5,6,0.85);
}

/* Hover tooltip (OHLC readout) */
.gp-hist-tooltip {
  position: absolute;
  display: none;
  min-width: 180px;
  background: rgba(18, 18, 22, 0.96);
  border: 1px solid rgba(245, 217, 106, 0.28);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-body, 'Source Sans 3', sans-serif);
  color: var(--text, #d8d0c0);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  pointer-events: none;
  z-index: 3;
  font-variant-numeric: tabular-nums;
}
.gp-hist-tooltip .tt-date {
  font-size: 11px;
  color: var(--gold-bright, #f5d96a);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}
.gp-hist-tooltip .tt-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
  padding: 2px 0;
}
.gp-hist-tooltip .tt-row span { color: var(--text-dim, #8890a0); font-size: 11px; }
.gp-hist-tooltip .tt-row strong { font-weight: 600; color: var(--text, #d8d0c0); }
.gp-hist-tooltip .tt-row strong.is-up   { color: #22c55e; }
.gp-hist-tooltip .tt-row strong.is-down { color: #ef4444; }
.gp-hist-tooltip .tt-row.tt-sub {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255,255,255,0.1);
}

.gp-hist-chart-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 6px; color: var(--text-dim, #8890a0);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Seed adjustment panel */
.gp-hist-adjust {
  margin-top: 6px;
  background: rgba(12,12,14,0.7);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 10px 14px;
}
.gp-hist-adjust summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--gold-bright, #f5d96a);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  list-style: none;
}
.gp-hist-adjust summary::-webkit-details-marker { display: none; }
.gp-hist-adjust summary::before {
  content: "+ ";
  color: var(--text-dim, #8890a0);
  margin-right: 2px;
}
.gp-hist-adjust[open] summary::before { content: "\2212 "; }
.gp-hist-adjust summary small {
  color: var(--text-dim, #8890a0);
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 8px;
  font-size: 11px;
}
.gp-hist-adjust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 20px;
  margin-top: 12px;
}
.gp-hist-adjust-row { display: flex; flex-direction: column; gap: 4px; }
.gp-hist-adjust-row label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim, #8890a0);
  font-weight: 600;
}
.gp-hist-adjust-value {
  color: var(--gold-bright, #f5d96a);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.gp-hist-adjust-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold-bright, #f5d96a);
}
.gp-hist-adjust-row small {
  color: var(--text-dim, #8890a0);
  font-size: 11px;
  line-height: 1.4;
}
.gp-hist-adjust-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px dashed rgba(255,255,255,0.07);
  padding-top: 12px;
}
.gp-hist-adjust-hint {
  font-size: 11px;
  color: var(--text-dim, #8890a0);
}

/* Sources */
.gp-hist-sources {
  background: linear-gradient(180deg, #141417 0%, #0a0a0c 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 18px 20px;
}
.gp-hist-h2 {
  font-family: var(--font-display, serif);
  font-size: 16px;
  color: var(--gold-bright, #f5d96a);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.gp-hist-sources p { color: var(--text-dim, #a8adbd); line-height: 1.55; margin-bottom: 10px; }
.gp-hist-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px 18px;
}
.gp-hist-sources-list li { font-size: 13px; }
.gp-hist-sources-list a { color: #67e8f9; }
.gp-hist-sources-list a:hover { color: #a5f3fc; text-decoration: underline; }
.gp-hist-sources-list em { color: var(--text-dim, #8890a0); font-style: normal; font-size: 11px; margin-left: 4px; }

/* Table */
.gp-hist-table-section {
  background: linear-gradient(180deg, #141417 0%, #0a0a0c 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 18px 20px 22px;
}
.gp-hist-table-wrap {
  overflow-x: auto;
  max-height: 440px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.04);
}
.gp-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text, #d8d0c0);
}
.gp-hist-table th {
  position: sticky; top: 0;
  background: #111114;
  color: var(--gold-bright, #f5d96a);
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gp-hist-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.gp-hist-table tr:hover td { background: rgba(255,255,255,0.025); }
.gp-hist-table td.is-up   { color: #22c55e; }
.gp-hist-table td.is-down { color: #ef4444; }

.src-chip {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.src-chip.src-live  { background: rgba(34,197,94,0.15);  color: #22c55e;  border: 1px solid rgba(34,197,94,0.35); }
.src-chip.src-seed  { background: rgba(100,116,139,0.15);color: #94a3b8; border: 1px solid rgba(100,116,139,0.35); }

/* Disclaimer */
.gp-hist-disclaimer {
  font-size: 11px;
  color: var(--text-dim, #8890a0);
  max-width: 720px;
  margin: 6px auto 0;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .gp-hist-chart-wrap { height: 340px; }
  .gp-hist-title { font-size: 20px; }
  .gp-hist-controls { flex-direction: column; align-items: flex-start; gap: 12px; }
}
