/* Public volume views — #/volume/{SYMBOL} and #/volume/compare
 * (public volume plan §6).
 *
 * Only rules styles.css does not already paint (the shared `.btn`, `.card`
 * and data-table shells stay in charge of their own look). Colour, type,
 * spacing, radius and motion come only from tokens.css custom properties:
 * no hex, rgb()/hsl() or named colour literal lives here, and no raw length
 * equals a token value.
 *
 * Loaded by views/public-volume.js, which appends one <link> to <head> on
 * mount (a statically linked file suppresses the runtime one).
 */

.public-volume {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding-block: var(--space-5) var(--space-6);
}

.pv-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ---- header ---------------------------------------------------------------- */

.pv-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pv-back {
  align-self: flex-start;
  font-size: var(--fs-small);
  color: var(--muted);
  text-decoration: none;
}

.pv-back:hover {
  color: var(--ink);
  text-decoration: underline;
}

.pv-title {
  margin: 0;
  font-size: var(--fs-section);
  font-weight: var(--fw-semibold);
  color: var(--ink);
}

.pv-sub {
  margin: 0;
  max-width: 72ch;
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--muted);
}

/* ---- the slotting override (a view override, never a settings write) ------ */

.pv-intervals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.pv-interval {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-min);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
}

.pv-interval:hover {
  color: var(--ink);
  text-decoration: underline;
}

.pv-interval.is-active {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

/* ---- the published symbols -------------------------------------------------- */

.pv-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.pv-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-min);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
}

.pv-chip:hover {
  color: var(--ink);
  text-decoration: underline;
}

.pv-chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

/* ---- the numbers ------------------------------------------------------------ */

.pv-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.pv-table {
  width: 100%;
}

.pv-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.pv-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pv-loading {
  font-size: var(--fs-small);
  color: var(--muted);
}

/* A hidden part must REALLY disappear: the class rules above set `display`,
 * which would otherwise beat the user agent's [hidden] rule. */
.pv-head[hidden],
.pv-intervals[hidden],
.pv-chips[hidden],
.pv-cards[hidden],
.pv-table[hidden],
.pv-actions[hidden],
.pv-state[hidden] { display: none; }

/* ---- phones ------------------------------------------------------------------ */

@media (max-width: 767.98px) {
  .public-volume {
    padding-block: var(--space-4) var(--safe-bottom);
  }
}
