/* NBA Card Catalog viewer — GitHub-dark palette shared with the login page. */

:root {
  --bg: #0d1117;
  --bg-panel: #161b22;
  --bg-hover: #1c2129;
  --border: #30363d;
  --text: #c9d1d9;
  --text-dim: #6e7681;
  --accent: #3fb950;
  --accent-border: #2ea043;
  --accent-glow: rgba(63, 185, 80, 0.35);
  --accent-soft: rgba(63, 185, 80, 0.12);
  --blue: #58a6ff;
  --orange: #d29922;
  --purple: #bc8cff;
  --red: #f85149;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top nav ------------------------------------------------------ */

#topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; color: var(--text);
  margin-right: 10px; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-name { letter-spacing: -0.01em; }
.topnav-links { display: flex; align-items: center; gap: 2px; }

.topnav-btn {
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 13px; font-weight: 500;
}
.topnav-btn:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.topnav-btn.active { background: var(--accent-soft); color: var(--accent); }

/* ---- omnibox ------------------------------------------------------ */

#omnibox { position: relative; margin-left: auto; width: min(380px, 40vw); }

#omni-input {
  width: 100%; padding: 7px 12px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-panel); color: var(--text);
  font-size: 13px; outline: none; font-family: inherit;
  transition: border-color 0.1s, box-shadow 0.1s;
}
#omni-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

#omni-results {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: min(560px, 92vw); max-height: 70vh; overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}
#omni-results.hidden { display: none; }

.omni-section {
  padding: 6px 0 2px;
  border-bottom: 1px solid var(--border);
}
.omni-section:last-child { border-bottom: none; }
.omni-section-title {
  padding: 4px 14px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim);
}
.omni-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 14px; cursor: pointer; color: var(--text);
}
.omni-item:hover, .omni-item.focused { background: var(--bg-hover); text-decoration: none; }
.omni-item .primary { font-weight: 500; }
.omni-item .context { font-size: 12px; color: var(--text-dim); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.omni-item .count { margin-left: auto; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.omni-empty { padding: 12px 14px; font-size: 13px; color: var(--text-dim); }

/* ---- layout ------------------------------------------------------- */

#view { max-width: 1080px; margin: 0 auto; padding: 22px 18px 80px; }

.loading { padding: 40px; text-align: center; color: var(--text-dim); }
.error-box {
  margin: 24px 0; padding: 14px 16px;
  border: 1px solid var(--red); border-radius: var(--radius);
  color: var(--red); background: rgba(248, 81, 73, 0.08);
}

.breadcrumb { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .here { color: var(--text); }

.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.page-sub a { color: var(--text-dim); text-decoration: underline; }
.page-sub a:hover { color: var(--blue); }

.section-title {
  font-size: 15px; font-weight: 600; margin: 26px 0 10px;
  display: flex; align-items: baseline; gap: 8px;
}
.section-title .muted { font-size: 12px; font-weight: 400; color: var(--text-dim); }

/* ---- home --------------------------------------------------------- */

.hero { text-align: left; padding: 22px 0 6px; }
.hero h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.hero p { color: var(--text-dim); margin-bottom: 18px; max-width: 640px; }

.stat-row {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start;
  margin: 10px 0 8px;
}
.stat-row.left { justify-content: flex-start; }
.stat-tile {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px; min-width: 118px;
  text-align: center; cursor: pointer; color: var(--text);
}
.stat-tile:hover { border-color: var(--accent-border); text-decoration: none; }
.stat-tile .num { font-size: 20px; font-weight: 700; color: var(--accent); }
.stat-tile .lbl { font-size: 12px; color: var(--text-dim); }
.stat-tile.static { cursor: default; }
.stat-tile.static:hover { border-color: var(--border); }
.stat-tile.warn .num { color: var(--orange); }
.stat-tile .tile-note { font-size: 12px; font-weight: 500; color: var(--text-dim); }

.scope-pill {
  padding: 1px 10px; border-radius: 999px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

/* ---- PSA linkage indicators --------------------------------------- */

.badge.warn { color: var(--orange); border-color: rgba(210, 153, 34, 0.5); }
.badge.dna { color: var(--purple); border-color: rgba(188, 140, 255, 0.4); }
.badge.psa-match { color: var(--accent); border-color: var(--accent-border); }
.warn-txt { color: var(--orange); }
th.ctr, td.ctr { text-align: center; }
/* CSS-drawn checkbox (native disabled inputs render gray on Windows). */
.cb {
  position: relative; display: inline-block;
  width: 15px; height: 15px; vertical-align: middle;
  border: 1.5px solid var(--border); border-radius: 4px;
}
.cb.on { border-color: var(--accent-border); background: var(--accent-soft); }
.cb.on::after {
  content: ''; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid var(--accent); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Coverage bar (share of seeds with a pop attached). */
.cov { display: flex; align-items: center; gap: 7px; min-width: 108px; }
.cov-bar {
  flex: 0 0 68px; height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
}
.cov-fill { height: 100%; background: var(--accent); }
.cov-fill.mid { background: var(--orange); }
.cov-fill.low { background: var(--red); }
.cov-txt { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.chip.psa-set { border-color: rgba(63, 185, 80, 0.35); }

/* Deep link to psacard.com's per-spec page (/spec/psa/<id>). */
.spec-link { font-size: 11px; margin-left: 5px; white-space: nowrap; }

/* Filter chips (design page seed + spec lists): buttons restyled as chips. */
#d-seed-filter .chip, #d-spec-filter .chip { font-family: inherit; }
#d-seed-filter .chip.active, #d-spec-filter .chip.active {
  color: var(--accent); border-color: var(--accent-border);
  background: var(--accent-soft);
}

.psa-hint {
  font-size: 13px; color: var(--text); margin: 4px 0 10px;
  padding: 8px 12px; border-left: 3px solid var(--orange);
  background: rgba(210, 153, 34, 0.07);
}
.psa-hint.dim { color: var(--text-dim); border-left-color: var(--border);
  background: var(--bg-panel); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg-panel); border: 1px solid var(--border);
  font-size: 13px; color: var(--text); cursor: pointer;
}
.chip:hover { border-color: var(--accent-border); text-decoration: none; }
.chip .n { font-size: 11px; color: var(--text-dim); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.entity-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; color: var(--text);
  display: block;
}
.entity-card:hover { border-color: var(--accent-border); text-decoration: none; }
.entity-card .name { font-weight: 600; margin-bottom: 2px; }
.entity-card .meta { font-size: 12px; color: var(--text-dim); }

/* ---- tables ------------------------------------------------------- */

.tbl-wrap {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto; background: var(--bg-panel);
}
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 7px 12px; border-bottom: 1px solid rgba(48, 54, 61, 0.5); vertical-align: top; }
tr:last-child td { border-bottom: none; }
/* Zebra striping; rowlink hover below outranks it (0,2,2 vs 0,1,3). */
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--bg-hover); }

/* Products whose release date has not arrived. Their checklist is published
   but the odds matrix is not, so they legitimately have no print runs. Greyed
   rather than badged: a badge per row buries the table in noise, while the
   whole row reading faint says "nothing to see here yet" at a glance. Restored
   to full contrast on hover so the row is still readable when reached for. */
tr.unreleased td { opacity: 0.45; font-style: italic; }
tr.unreleased:hover td { opacity: 1; font-style: normal; }

/* ---- standardized table layout ------------------------------------
   Column conventions (applied per table via .t-std):
   - every column hugs its content; only .flex columns (the long text —
     product name, design name, card title) take the leftover width;
   - related columns form GROUPS opened by a .grp hairline;
   - the PSA group is additionally tinted via .psa-c. The tint is a
     background-image so it stacks on the zebra background-color; these
     rules sit AFTER the zebra rule on purpose (same specificity — the
     later background-image wins), while the rowlink hover above still
     outranks both and flattens the row to the hover color. */
table.t-std th, table.t-std td { white-space: nowrap; width: 1%; }
table.t-std th.flex, table.t-std td.flex { width: auto; white-space: normal; }
th.grp, td.grp { border-left: 1px solid var(--border); }
thead tr th.psa-c, tbody tr td.psa-c {
  background-image: linear-gradient(rgba(88, 166, 255, 0.06), rgba(88, 166, 255, 0.06));
}

/* Column-header info icon: hover for the native title tooltip. */
.info-tip {
  display: inline-block; width: 13px; height: 13px; line-height: 11px;
  border: 1px solid var(--text-dim); border-radius: 50%;
  color: var(--text-dim); text-align: center;
  font-size: 9px; font-weight: 700;
  text-transform: none; letter-spacing: 0;
  cursor: help; vertical-align: 1px;
}
.info-tip:hover { color: var(--text); border-color: var(--text); }
/* Single-number columns are centered so they read as aligned units. */
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
td select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: 12px; max-width: 320px;
}
td select:focus { border-color: var(--accent); outline: none; }
.mini-btn {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-border); border-radius: 6px;
  padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.mini-btn:hover { background: var(--accent-border); color: var(--text); }
.mini-btn:disabled { opacity: 0.5; cursor: default; }
.mini-btn:disabled:hover { background: var(--accent-soft); color: var(--accent); }
.dim { color: var(--text-dim); }
.nowrap { white-space: nowrap; }

/* Print-run provenance. No Topps document states a serial run, so most are
   recovered by inverting the pack odds: '.derived' marks a solved run that
   landed on a standard rung, '.est' an approximate copy count for a parallel
   that carries no serial at all. A plain /N is ground truth — a serial a
   human confirmed (anchor or pin) or a 1/1 by naming rule. */
.derived { border-bottom: 1px dotted var(--text-dim); }
.est { color: var(--text-dim); font-style: italic; }

/* Click-to-edit print run. Deliberately quiet until hovered — every parallel
   is editable, so a permanent affordance on each one would be louder than the
   data. */
.run-edit { cursor: text; border-radius: 3px; padding: 1px 4px; margin: -1px -4px; }
.run-edit:hover { background: var(--accent-soft); outline: 1px solid var(--accent-border); }
.run-edit.editing { background: none; outline: none; }

/* The column header opens the serial-ceiling dialog. It edits nothing in
   place, so no input affordance — just the hand cursor a clickable thing
   gets, and the header text stays exactly as it is. */
.cap-edit { cursor: pointer; }

/* The serial-ceiling dialog (opened from the print-run column header). */
.cap-form { display: flex; gap: 8px; align-items: center; }
.cap-input { width: 8em; text-align: left; font-weight: 400; }
/* One line, sized to the number it replaces: a print run is at most five
   digits, and `font: inherit` would otherwise drag the row's line-height in
   and leave the box taller than the text it sits in. */
.run-input {
  box-sizing: border-box;
  width: 6em;
  height: 1.6em;
  padding: 0 4px;
  line-height: 1.6em;
  text-align: right;
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
  background: var(--bg-hover);
  border: 1px solid var(--accent-border);
  border-radius: 3px;
  outline: none;
  appearance: none;
}
.run-input:focus { border-color: var(--accent); }
.run-input.bad { border-color: var(--orange); }

/* ---- badges / pills ---------------------------------------------- */

.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.5;
  border: 1px solid var(--border); color: var(--text-dim);
}
.badge.rc { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.badge.kind-base { color: var(--blue); border-color: rgba(88, 166, 255, 0.4); }
.badge.kind-insert { color: var(--purple); border-color: rgba(188, 140, 255, 0.4); }
.badge.kind-autograph { color: var(--orange); border-color: rgba(210, 153, 34, 0.4); }
.badge.kind-memorabilia { color: #f778ba; border-color: rgba(247, 120, 186, 0.4); }
.badge.kind-other { color: var(--text-dim); }
.badge.inactive { color: var(--red); border-color: rgba(248, 81, 73, 0.4); }
.badge.active-yes { color: var(--accent); border-color: var(--accent-border); }
.badge.base { color: var(--blue); border-color: rgba(88, 166, 255, 0.4); }
/* 'derived' membership = cross-product rows under the producer's own
   disclaimer, not source-materialized — shown dimmed. */
.badge.derived { color: var(--text-dim); border-style: dashed; opacity: 0.75; }

/* Box-type chips on product pages (plain <span>, not a link). */
.chip.box-chip { cursor: default; }
.chip.box-chip:hover { border-color: var(--border); }

/* ---- filter bar --------------------------------------------------- */

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.filter-bar select, .filter-bar input[type="text"] {
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--accent); }
/* Search boxes carry a placeholder long enough to name what they match,
   so they get a floor width instead of shrinking to the flex minimum. */
.filter-bar input.f-search { min-width: 260px; }
.filter-bar label.check {
  display: inline-flex; gap: 6px; align-items: center;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
}
.filter-bar .spacer { margin-left: auto; }
.filter-bar .result-count { font-size: 12px; color: var(--text-dim); }

/* ---- detail panels ------------------------------------------------ */

.panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
}

.kv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 22px;
}
.kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.kv .v { font-size: 14px; }
/* Wide cells: facts that need more room than one grid track. */
.kv-grid .kv.span2 { grid-column: span 2; }
.kv-grid .kv.span3 { grid-column: span 3; }

.summary-block {
  border-left: 3px solid var(--accent-border);
  padding: 8px 12px; margin: 14px 0;
  background: rgba(63, 185, 80, 0.05);
  font-size: 13px; white-space: pre-wrap;
}

code.src {
  display: block; padding: 8px 10px; margin-top: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; color: var(--text-dim);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap; word-break: break-all;
}

details.raw { margin-top: 12px; }
details.raw summary { cursor: pointer; font-size: 12px; color: var(--text-dim); }
details.raw pre {
  margin-top: 8px; padding: 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---- player bits -------------------------------------------------- */

.player-header { display: flex; gap: 20px; align-items: flex-start; }
.headshot {
  width: 130px; height: 95px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg);
}
.headshot.mini {
  width: 36px; height: 27px; border-radius: 4px; vertical-align: middle;
}

.season-group { margin-bottom: 10px; }
.season-group > summary {
  cursor: pointer; padding: 8px 12px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); font-weight: 600; font-size: 14px;
  display: flex; align-items: baseline; gap: 10px;
}
.season-group > summary .muted { font-weight: 400; font-size: 12px; color: var(--text-dim); }
.season-group[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.season-body {
  border: 1px solid var(--border); border-top: none;
  border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius);
  padding: 10px 14px 14px;
}
.product-block { margin-top: 10px; }
.product-block .pb-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.product-block .pb-title a { color: var(--text); }
.product-block .pb-title a:hover { color: var(--blue); }

.linked-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.linked-chips .chip img { align-self: center; }


/* ---- overlay ------------------------------------------------------ */

.eye-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 0 2px; vertical-align: middle;
}
.eye-btn:hover { color: var(--accent); }
.eye-btn svg { width: 16px; height: 16px; display: block; }

.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 16px 40px;
}
.overlay-box {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(760px, 100%); max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}
.overlay-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.overlay-title { font-weight: 600; font-size: 15px; flex: 1; }
.overlay-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 20px; line-height: 1; padding: 2px 6px;
}
.overlay-close:hover { color: var(--text); }
.overlay-sub { padding: 8px 16px 0; font-size: 12px; color: var(--text-dim); }
.overlay-body { padding: 12px 16px 16px; overflow-y: auto; }
.overlay-body .tbl-wrap { background: var(--bg); }

/* Odds matrix: indented member-subset rows under their parallel. */
.odds-sub td { background: rgba(255, 255, 255, 0.02); }
.odds-sub .sub-label { padding-left: 26px; color: var(--text-dim); }

/* ---- unit card page (#/card/<id>) --------------------------------- */

.card-layout { display: flex; gap: 16px; align-items: stretch; margin-bottom: 4px; }
.card-facts { flex: 1; min-width: 0; }

.card-images { display: flex; gap: 10px; flex-shrink: 0; }
.img-ph {
  width: 132px; aspect-ratio: 63 / 88;         /* physical card ratio */
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--bg-panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 12px; color: var(--text-dim); text-align: center;
}
@media (max-width: 720px) {
  .card-layout { flex-direction: column; }
  .card-images { justify-content: center; }
}

.mkt-panel { padding: 12px 14px 10px; }
.mkt-chart { position: relative; margin-top: 6px; }
.mkt-empty { padding: 28px 10px; text-align: center; color: var(--text-dim); font-size: 13px; }

.mkt-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 2px 2px; font-size: 12px; }
.lgd { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.lgd-key {
  display: inline-block; width: 14px; height: 3px; border-radius: 2px;
  vertical-align: middle;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text-dim); font-size: 12px; font-family: inherit;
}
.fchip:hover { color: var(--text); border-color: var(--text-dim); }
.fchip.active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

.mkt-tooltip {
  position: absolute; z-index: 20; pointer-events: none;
  min-width: 190px; max-width: 300px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  padding: 8px 10px; font-size: 12px;
}
.tt-head { font-weight: 600; margin-bottom: 6px; }
.tt-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.tt-key { width: 12px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.tt-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-lab { color: var(--text-dim); }
.tt-foot { margin-top: 6px; color: var(--text-dim); font-size: 11px; }

/* Sales-history filters: always available, so the chart click is only a
   shortcut into the same From/To pair. */
.sales-filters { margin: 8px 0 12px; gap: 8px 14px; }
.sales-filters .fld {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
}
.sales-filters select, .sales-filters input[type="date"] {
  padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text); font-size: 12px; font-family: inherit;
  color-scheme: dark; outline: none;
}
.sales-filters select:focus, .sales-filters input:focus { border-color: var(--accent); }
.sales-filters .fchip { padding: 5px 12px; }

.sales-title { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- player/team NBA sections ------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.award-chip {
  display: inline-block; padding: 4px 11px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg-panel); color: var(--text); white-space: nowrap;
}
.award-chip.major { border-color: var(--accent-border); background: var(--accent-soft); }
.award-chip b { color: var(--accent); margin-left: 2px; }
.placeholder {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--text-dim); font-size: 13px;
}
.empty-note { color: var(--text-dim); font-size: 13px; padding: 6px 2px 10px; }
/* Compact pager, right-aligned inside a .section-title flex row. */
.pager-mini { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 400; }
.pager-btn {
  padding: 2px 10px; border-radius: 6px; line-height: 1.5;
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text); font-size: 12px; cursor: pointer; font-family: inherit;
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent-border); }
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.pager-info { color: var(--text-dim); font-size: 12px; }
.news-item { padding: 9px 2px; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-item > a { font-size: 13px; font-weight: 600; }
.news-meta { font-size: 11px; margin-top: 2px; }
.news-excerpt { font-size: 12px; margin-top: 3px; }
/* Championship season: gild the whole standings row. Selector matches
   the even-row striping's specificity so the gold wins on those rows. */
tbody tr.row-champ td { background: rgba(212, 175, 55, 0.10); }
tbody tr.row-champ td:first-child { box-shadow: inset 3px 0 0 rgba(212, 175, 55, 0.65); }
.po-champ { color: #d4af37; font-weight: 600; }
.wl-w { color: var(--accent); font-weight: 600; }
.wl-l { color: var(--red); font-weight: 600; }
.badge.po { color: var(--purple); border-color: var(--purple); }

/* sales-log pin dialog */
.pin-form label { display: block; margin: 8px 0; }
.pin-form .pin-title { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.pin-form .pin-key { width: 22em; max-width: 100%; }
.pin-form .pin-actions { margin-top: 10px; }
.pin-form .pin-note { width: 28em; max-width: 100%; }
.ticket-tabs { margin: 0 0 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.ticket-tabs .mini-btn.active { font-weight: 600; text-decoration: underline; }


/* ==== design system additions: inputs, buttons, cards ================== */

.input {
  display: block; width: 100%; box-sizing: border-box;
  padding: 9px 12px; font: inherit; font-size: 14px;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--text-dim); opacity: .8; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-sm { padding: 6px 10px; font-size: 13px; width: 200px; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .04em; }
.field-hint { display: block; font-size: 12px; margin-top: 6px; text-align: right; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text); margin: 4px 0 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text); background: var(--bg-hover);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  text-decoration: none; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: #262c36; border-color: #444c56; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { background: var(--bg-hover); border-color: var(--border); }
.btn-primary { color: #0a0e13; background: var(--accent); border-color: var(--accent-border); }
.btn-primary:hover { background: #46c55a; border-color: var(--accent-border); }
.btn-primary:disabled:hover { background: var(--accent); }
.btn-danger { color: var(--red); background: rgba(248, 81, 73, .08); border-color: rgba(248, 81, 73, .5); }
.btn-danger:hover { background: rgba(248, 81, 73, .18); border-color: var(--red); }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google:hover { background: #f4f6f8; border-color: #c6cad0; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.g-logo { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.form-msg { min-height: 18px; margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.form-msg.inline { margin: 0 0 0 10px; }

.card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 4px 20px 6px; margin-bottom: 18px;
}
.card-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); padding: 14px 0 6px; }
.card-danger { border-color: rgba(248, 81, 73, .35); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 0; border-top: 1px solid var(--border); }
.row-main { min-width: 0; }
.row-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.row-form { padding: 4px 0 14px; border-top: 1px dashed var(--border); }
.row-form .field { max-width: 360px; }
.row-actions { display: flex; align-items: center; gap: 8px; }

/* ==== auth pages ======================================================== */

.auth-wrap { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.auth-card {
  width: 100%; max-width: 400px; padding: 30px 32px 26px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 13px; font-weight: 600;
  margin-bottom: 22px; }
.auth-brand:hover { text-decoration: none; color: var(--text); }
.auth-brand-mark { width: 34px; height: 34px; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.auth-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.auth-form .btn-block { margin-top: 4px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--text-dim);
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-turnstile { margin: 2px 0 14px; display: flex; justify-content: center; min-height: 0; }
.auth-turnstile:empty { display: none; }
.auth-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-dim); text-align: center; }
.auth-error { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(248, 81, 73, .5);
  border-radius: 6px; color: var(--red); background: rgba(248, 81, 73, .08); font-size: 13px; }
.otp-input { text-align: center; font-size: 26px; letter-spacing: .5em; padding: 12px; margin-bottom: 14px;
  font-variant-numeric: tabular-nums; }

.pw-block { margin: -6px 0 14px; }
.pw-meter { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pw-bar { height: 100%; transition: width .15s; }
.pw-bar.weak { background: var(--red); } .pw-bar.fair { background: var(--orange); }
.pw-bar.good { background: #e3b341; } .pw-bar.strong { background: var(--accent); }
.pw-label { font-size: 11px; color: var(--text-dim); margin-top: 5px; }
.pw-label .weak { color: var(--red); } .pw-label .fair { color: var(--orange); }
.pw-label .good { color: #e3b341; } .pw-label .strong { color: var(--accent); }
.pw-rules { list-style: none; padding: 0; margin: 6px 0 0; font-size: 11px; color: var(--text-dim);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.pw-rules li::before { content: "\25CB  "; } .pw-rules li.ok { color: var(--accent); } .pw-rules li.ok::before { content: "\25CF  "; }

/* ==== top bar: profile menu ============================================ */

#account-slot { margin-left: 10px; display: flex; align-items: center; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-border); cursor: pointer; font-family: inherit;
}
.avatar:hover { box-shadow: 0 0 0 3px var(--accent-glow); }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; cursor: default; }
.avatar-lg:hover { box-shadow: none; }
.profile-menu { position: relative; }
.menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 240px; display: none;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55); padding: 6px; z-index: 60;
}
.profile-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.profile-menu:hover .menu-dropdown, .profile-menu.open .menu-dropdown, .profile-menu:focus-within .menu-dropdown { display: block; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-name { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.menu-email { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px;
  color: var(--text); font: inherit; font-size: 13px; background: none; border: 0; cursor: pointer; }
.menu-item:hover { background: var(--bg-hover); text-decoration: none; }
.menu-sep { border-top: 1px solid var(--border); margin: 6px 0; }
.local-pill { font-size: 12px; color: var(--text-dim); padding: 4px 10px; border: 1px dashed var(--border); border-radius: 999px; }

/* ==== account area ===================================================== */

.account-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 6px; }
.account-nav { position: sticky; top: 70px; }
.account-who { display: flex; align-items: center; gap: 12px; padding: 4px 10px 16px; }
.account-who-text { min-width: 0; }
.account-who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-who-email { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px;
  color: var(--text-dim); font-weight: 500; font-size: 13px; }
.account-nav-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.account-nav-item.active { background: var(--accent-soft); color: var(--accent); }
.account-title { font-size: 20px; font-weight: 700; margin: 4px 0 16px; letter-spacing: -0.01em; }
.account-main .ticket-tabs { margin-bottom: 12px; }
@media (max-width: 760px) {
  .account-layout { grid-template-columns: 1fr; gap: 12px; }
  .account-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .account-who { width: 100%; }
  .brand-name { display: none; }
}

/* Sign-in pages stand alone: the bar goes, the card takes the viewport. */
body.auth-page #topnav { display: none; }
body.auth-page .auth-wrap { min-height: calc(100vh - 44px); }

/* ==== phone widths ===================================================== */

.icon-btn {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid transparent;
  background: none; color: var(--text-dim); cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

@media (max-width: 640px) {
  #topnav { padding: 8px 10px; gap: 4px; }
  .brand { margin-right: 2px; gap: 0; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { display: none; }
  /* the section links take what is left and scroll sideways if needed,
     so the search and the avatar always stay on screen */
  .topnav-links { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
  .topnav-links::-webkit-scrollbar { display: none; }
  .topnav-btn { padding: 5px 9px; font-size: 13px; white-space: nowrap; }
  /* search collapses to an icon; opening it lays the input over the bar */
  #omnibox { width: auto; margin-left: 2px; flex: none; }
  .icon-btn { display: inline-flex; }
  #omnibox:not(.open) #omni-input { display: none; }
  #omnibox.open { position: absolute; left: 8px; right: 8px; top: 7px; width: auto; z-index: 61;
    display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 8px; }
  #omnibox.open .icon-btn { color: var(--accent); }
  #omnibox.open #omni-input { display: block; flex: 1; padding: 8px 12px; }
  #omni-results { left: 0; right: 0; width: auto; max-height: 60vh; }
  #account-slot { margin-left: 2px; flex: none; }
  .local-pill { display: none; }
  .avatar { width: 30px; height: 30px; font-size: 11px; }
  .menu-dropdown { width: 220px; }

  #view { padding: 14px 12px 60px; }
  .hero { padding: 22px 0 4px; }
  .hero h1 { font-size: 22px; }
  .page-title { font-size: 19px; }
  .stat-row { gap: 8px; }
  .stat-tile { flex: 1 1 calc(33.333% - 8px); min-width: 96px; padding: 10px 8px; }
  .stat-tile .num { font-size: 17px; }
  th, td { padding: 7px 8px; font-size: 13px; }
  th { font-size: 10px; }
  .kv-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 14px; }
  .sales-filters { display: flex; flex-wrap: wrap; }
  .overlay-box { width: calc(100vw - 20px); max-width: none; margin: 10px; }
  .pin-form .pin-key, .pin-form .pin-note { width: 100%; }
  .auth-wrap { padding: 12px; min-height: calc(100vh - 100px); }
  .auth-card { padding: 22px 18px 20px; }
  .account-layout { margin-top: 0; }
  .account-nav-item { padding: 6px 10px; }
  .row { flex-wrap: wrap; }
  .row-side { width: 100%; justify-content: flex-start; }
  .row-side .input-sm { width: 100%; }
}
@media (max-width: 640px) {
  /* headings that carry an inline note: the note drops to its own line */
  .section-title { flex-wrap: wrap; row-gap: 2px; }
  .section-title .muted { flex-basis: 100%; }
}
@media (max-width: 640px) {
  /* search results: name on one line, context below it */
  .omni-item { flex-wrap: wrap; row-gap: 2px; }
  .omni-item .primary { flex: 1 1 auto; }
  .omni-item .context { flex-basis: 100%; white-space: normal; }
}
@media (max-width: 640px) {
  /* iOS zooms into any field under 16px on focus: keep every field at 16px */
  #omni-input, .input, .run-input, select, input[type="text"], input[type="email"],
  input[type="password"], input[type="date"], input[type="search"], textarea { font-size: 16px; }
  #omnibox.open #omni-input { font-size: 16px; }
  #omni-results { max-height: min(55vh, 420px); }
  .omni-item .primary { font-size: 15px; }

  /* Wide tables scroll sideways inside their frame; the first column
     stays pinned so a row keeps its name, and the edges shade to say
     there is more to the side. */
  .tbl-wrap {
    background:
      linear-gradient(90deg, var(--bg-panel) 30%, rgba(22, 27, 34, 0)) left / 40px 100% no-repeat local,
      linear-gradient(-90deg, var(--bg-panel) 30%, rgba(22, 27, 34, 0)) right / 40px 100% no-repeat local,
      linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)) left / 16px 100% no-repeat scroll,
      linear-gradient(-90deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)) right / 16px 100% no-repeat scroll,
      var(--bg-panel);
  }
  .tbl-wrap table { background: transparent; }
  .t-std th:first-child, .t-std td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--bg-panel);
    box-shadow: 1px 0 0 var(--border);
  }
  .t-std tbody tr:nth-child(even) td:first-child { background: #181d25; }
  .t-std td.flex, .t-std th.flex { min-width: 150px; }

  /* the two busiest tables drop columns that repeat or rarely matter */
  .products-tbl th:nth-child(2), .products-tbl td:nth-child(2),
  .products-tbl th:nth-child(3), .products-tbl td:nth-child(3) { display: none; }
  .designs-tbl th:nth-child(2), .designs-tbl td:nth-child(2),
  .designs-tbl th:nth-child(7), .designs-tbl td:nth-child(7) { display: none; }
  .sales-tbl th:nth-child(4), .sales-tbl td:nth-child(4),
  .sales-tbl th:nth-child(5), .sales-tbl td:nth-child(5),
  .sales-tbl th:nth-child(7), .sales-tbl td:nth-child(7) { display: none; }
  .sales-tbl td.sales-title { white-space: normal; max-width: 220px; min-width: 180px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sales-tbl th:first-child, .sales-tbl td:first-child { min-width: 92px; }
  .sales-tbl td:first-child { white-space: normal; font-size: 12px; }
}

/* ==== admin tooling: present in the markup, shown only to admins ======== */
body:not(.is-admin) .admin-only { display: none !important; }
body:not(.is-admin) #c3d-manage { display: none !important; }
body:not(.is-admin) .run-edit, body:not(.is-admin) .cap-edit { pointer-events: none; cursor: default; }
body:not(.is-admin) .designs-tbl th:nth-child(7), body:not(.is-admin) .designs-tbl td:nth-child(7) { display: none; }
body:not(.is-admin) details.raw { display: none; }

/* ==== pager (one style everywhere) ====================================== */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 2px; }
.pager-top { padding-top: 0; }
.pager-bottom { padding-bottom: 0; }
.paging { opacity: .6; }
