:root {
  /* CardMarshal brand tokens (tokens.css) under the names the app already uses. */
  --bg: var(--cm-background);
  --panel: var(--cm-surface);
  --panel-2: var(--cm-surface-raised);
  --lime: var(--cm-accent);
  --lime-ink: var(--cm-on-accent);
  --text: var(--cm-text);
  --muted: var(--cm-text-muted);
  --border: var(--cm-border-subtle);
  --red: var(--cm-critical);
  --amber: var(--cm-warning);
  --blue: var(--cm-link);
  --green: var(--cm-good);
  /* Behind card photos: a neutral matte a step darker than the page. */
  --photo-bg: color-mix(in srgb, var(--cm-background) 70%, black);
}
* { box-sizing: border-box; }
/* Links read on the dark background (the browser default blue doesn't). */
a { color: var(--blue); }
a:visited { color: var(--blue); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--cm-font-ui); }
/* Counts and prices line up in columns (brand: tabular figures). */
table { font-variant-numeric: tabular-nums; }
/* Codes people read off: SKUs, cert numbers (brand: JetBrains Mono for identifiers). */
#ed-sku, #cd-certs, .mono { font-family: var(--cm-font-mono); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; background: var(--cm-surface); border: 1px solid var(--cm-border); border-radius: var(--cm-radius-control); padding: 7px 9px;
}
/* Keyboard focus (brand): a 2px lime ring, 2px clear of the control; text fields show it whenever focused. */
:focus-visible { outline: var(--cm-border-focus) solid var(--cm-focus-ring); outline-offset: var(--cm-border-focus-offset); }
input:focus, select:focus, textarea:focus { outline: var(--cm-border-focus) solid var(--cm-focus-ring); outline-offset: 0; }
/* On a lime control the ring needs a dark inner edge to show. */
.btn.primary:focus-visible, .home-action.primary:focus-visible { box-shadow: inset 0 0 0 2px var(--cm-on-accent); }
/* Buttons on a card photo sit in a clipped box: keep their ring inside so it shows. */
.star:focus-visible, .share-btn:focus-visible, .ccard .ccheck:focus-visible { outline-offset: -2px; }
/* Placeholders are prompts, never values: keep them faint and italic so they can't pass for real text. */
::placeholder { color: var(--muted); opacity: 0.6; font-style: italic; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.hint { color: var(--muted); font-size: 12px; }
.error-text { color: var(--red); font-size: 13px; white-space: pre-wrap; }
.ok-text { color: var(--lime); }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { display: block; height: 28px; width: auto; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--panel-2); color: var(--text); }
.env { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .1em; padding: 4px 10px; border-radius: 999px; }
.env.sandbox { background: var(--cm-status-pending-fill); color: var(--cm-status-pending-text); }
.env.production { background: var(--cm-status-error-fill); color: var(--cm-status-error-text); }
.env.small { margin-left: 8px; }

main { padding: 20px 24px 60px; max-width: 1400px; margin: 0 auto; }

.dropzone {
  display: block; border: 2px dashed var(--border); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer;
}
.dropzone.over, .dropzone:hover { border-color: var(--lime); }
.dropzone .hint { display: block; margin-top: 4px; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.chip.active { border-color: var(--lime); color: var(--lime); }
.chip b { margin-left: 4px; font-weight: 600; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.btn { background: var(--cm-surface); border: 1px solid var(--cm-border); border-radius: var(--cm-radius-control); padding: 7px 14px; cursor: pointer; white-space: nowrap; transition: background-color var(--cm-motion-hover) var(--cm-motion-enter), border-color var(--cm-motion-hover) var(--cm-motion-enter); }
.btn:hover:not(:disabled) { background: var(--cm-surface-raised); }
.btn:active:not(:disabled) { background: var(--cm-selection); }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--cm-accent-border); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--cm-accent-hover); }
.btn.primary:active:not(:disabled) { background: var(--cm-accent-pressed); }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
/* Links styled as buttons (Export CSV, Pick list) read like the buttons beside them. */
a.btn { display: inline-block; color: var(--text); text-decoration: none; font: inherit; line-height: normal; }
a.btn.small { font-size: 12px; }
a.btn.primary { color: var(--lime-ink); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; position: relative; }
.tile:hover { border-color: color-mix(in srgb, var(--cm-accent) 50%, transparent); }
.tile.selected { outline: 2px solid var(--lime); }
.tile img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; background: var(--photo-bg); display: block; }
.tile .sel { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; }
.tile .info { padding: 8px 10px 10px; }
.tile .t { font-size: 12.5px; line-height: 1.3; height: 3.9em; overflow: hidden; }
.tile .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.tile .price { color: var(--lime); font-weight: 600; }
.tile .err { color: var(--red); font-size: 11px; margin-top: 4px; max-height: 3em; overflow: hidden; }

.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); text-transform: capitalize; }
.pill.review { background: var(--cm-status-pending-fill); color: var(--cm-status-pending-text); }
.pill.ready, .pill.confirmed { background: var(--cm-status-ready-fill); color: var(--cm-status-ready-text); }
.pill.listed { background: var(--cm-status-live-fill); color: var(--cm-status-live-text); }
.pill.error { background: var(--cm-status-error-fill); color: var(--cm-status-error-text); }
.pill.sold { background: var(--cm-status-sold-fill); color: var(--cm-status-sold-text); }
.pill.ended { background: var(--cm-status-ended-fill); color: var(--cm-status-ended-text); }
.pill.identifying, .pill.listing { background: var(--cm-surface-raised); color: var(--text); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; max-width: 860px; }
.panel h2 { margin: 0 0 10px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin: 12px 0; }
.form-grid label, label.wide { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-grid label.wide { grid-column: 1 / -1; }
.pkg-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 6px; }
.pkg-default { margin: 10px 0 14px; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.steps { padding-left: 0; list-style: none; }
.steps li { margin: 10px 0; }
.status-line { margin: 4px 0; }
.ok { color: var(--lime); }
.no { color: var(--red); }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--muted); }

dialog { width: min(1180px, 96vw); max-height: 94vh; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.editor { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; padding: 18px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.photos img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; background: var(--photo-bg); border-radius: 8px; }
.photos .btn, .photos .identify { grid-column: 1 / -1; }
.identify { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 10px; }
.identify b { color: var(--text); }
.identify .raw { margin-top: 8px; }
.identify .warn, .identify .warn b { color: var(--amber); }
.identify pre { max-height: 320px; overflow: auto; margin: 6px 0 0; font-size: 11px; white-space: pre-wrap; word-break: break-word; }
.ed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ed-head .pill { margin-right: 4px; }
.price-check { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 2px 0 10px; }
.price-check a { color: var(--blue); }

/* Price guide */
.price-guide { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 13px; }
.price-guide:empty { display: none; }
.pg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0; }
.pg-row select { width: auto; }
.pg-recent summary { cursor: pointer; color: var(--muted); margin-top: 4px; }
.pg-recent ul { margin: 6px 0 0; padding-left: 18px; }
.pg-recent a { color: var(--text); }

/* Auto-save */
.autosave { margin-right: auto; white-space: nowrap; }
.autosave.ok { color: var(--lime); }
.autosave.bad { color: var(--red); }
.pending { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--cm-warning) 12%, transparent); color: var(--amber); font-size: 13px; }
.lookup { margin: 2px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lookup #ed-lookup-results { flex-basis: 100%; }
.lookup #ed-lookup-results:empty { display: none; }
/* Lookup confidence meter (2026-11-24): three bars and the word, at the end of the lookup row; tap for the details. */
.conf-slot { margin-left: auto; }
.conf-slot:empty { display: none; }
.conf-meter { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; }
.conf-meter:hover { border-color: currentColor; }
.conf-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.conf-bars span { width: 4px; border-radius: 1px; background: var(--border); }
.conf-bars span:nth-child(1) { height: 6px; }
.conf-bars span:nth-child(2) { height: 10px; }
.conf-bars span:nth-child(3) { height: 14px; }
.conf-meter.conf-high { color: var(--lime); }
.conf-meter.conf-medium { color: var(--amber); }
.conf-meter.conf-low { color: var(--red); }
.conf-meter .conf-bars span.on { background: currentColor; }
.price-check .pc-label { color: var(--muted); font-size: 13px; }
.lookup .hint { margin-left: 8px; }
.lookup-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.lookup-results .btn { text-align: left; white-space: normal; }
.lookup-msg { font-size: 12px; margin-top: 6px; color: var(--lime); }
.lookup-msg.bad { color: var(--red); }
.checks { display: flex; gap: 18px; margin: 6px 0 12px; }
.ed-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; }
.ed-actions a { color: var(--blue); margin-right: auto; }

.wide-panel { max-width: none; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.report-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.report-table .num { white-space: nowrap; }
/* Number and money columns (and Card #) sit in the middle of the cell; everything else stays on the left. */
.report-table th.num, .report-table td.num, .ckl-table th.num, .ckl-table td.num { text-align: center; }
.report-table a { color: var(--text); text-decoration: none; }
.report-table a:hover { color: var(--blue); text-decoration: underline; }

/* Live listings table */
.live-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.live-toolbar input[type="search"] { flex: 1 1 260px; }
.live-toolbar select { width: auto; }
.price-range { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.price-range input { width: 80px; }
.col-menu { position: relative; }
.col-menu summary { list-style: none; cursor: pointer; }
.col-menu summary::-webkit-details-marker { display: none; }
.col-menu > div { position: absolute; right: 0; z-index: 5; margin-top: 6px; padding: 10px 12px; min-width: 200px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.pager { justify-content: flex-end; }
.pager select { width: auto; }
.table-scroll { overflow-x: auto; }
.live-table { table-layout: fixed; }
.live-table th { position: relative; vertical-align: middle; }
.live-table td { overflow-wrap: anywhere; }
.col-resizer { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; }
.col-resizer::after { content: ""; position: absolute; top: 25%; right: 3px; height: 50%; border-right: 1px solid var(--border); }
.col-resizer:hover::after, body.resizing .col-resizer::after { border-color: var(--lime); }
body.resizing { cursor: col-resize; user-select: none; }
/* Plain tables with a resize edge (Market prices, checklists); fixed-cols once a column has been dragged. */
th.sizeable-th { position: relative; padding-right: 14px; }
th.sizeable-th .col-resizer { touch-action: none; }
@media (pointer: coarse) { th.sizeable-th .col-resizer { width: 18px; } th.sizeable-th { padding-right: 22px; } }
table.fixed-cols { table-layout: fixed; }
table.fixed-cols td { overflow-wrap: anywhere; overflow: hidden; }
/* A column dragged narrow wraps or clips its contents instead of drawing over the next one. */
table.fixed-cols td.num { white-space: normal; }
.mk-table.fixed-cols td.mk-card { min-width: 0; }
.mk-table.fixed-cols .mk-price { max-width: calc(100% - 12px); }
.live-table th.sortable { cursor: pointer; user-select: none; padding-right: 14px; }
.live-table th.sortable:hover, .live-table th.active { color: var(--text); }
.live-table .sort-arrow { color: var(--muted); font-size: 11px; }
/* Header names stay on one line at one height (columns are sized to fit them; see headerWidth). */
.live-table th, .live-table th.num { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.live-table tbody tr:hover { background: color-mix(in srgb, var(--cm-text) 3%, transparent); }
.vals { display: flex; flex-wrap: wrap; gap: 4px; }
.val { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.val b { color: var(--muted); font-weight: 500; margin-left: 4px; }
button.val { color: var(--text); cursor: pointer; }
button.val:hover { border-color: var(--lime); }
.fix-btn { margin: 2px 4px 0 0; color: var(--amber); }

/* Fix item specific dialog */
#fix { max-width: 640px; width: 100%; }
.fix-h { font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.fix-list { display: flex; flex-direction: column; gap: 6px; }
.fix-other input[type="text"] { width: auto; flex: 1; margin-left: 4px; }
.fix-other { display: flex; align-items: center; }
.fix-preview { margin-top: 14px; }
.fix-sample { margin: 8px 0 0; padding-left: 18px; max-height: 180px; overflow-y: auto; font-size: 12px; }
.fix-sample a { color: var(--text); }

/* Background fix status bar (Live listings) */
.fix-banner { position: relative; z-index: 4; margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); font-size: 13px; }
.fb-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 28px 4px 0; }
.fb-row + .fb-row { border-top: 1px solid var(--border); }
.fb-row.done b { color: var(--lime); }
.fb-row.warn b { color: var(--amber); }
.fb-row details { width: 100%; }
.fb-row summary { cursor: pointer; color: var(--muted); }
.fb-close { position: absolute; top: 2px; right: 0; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--lime); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flag { color: var(--amber); font-size: 12px; margin-top: 4px; }
.bad { color: var(--red); }
.live-thumb { width: 40px; height: 54px; object-fit: contain; background: var(--photo-bg); border-radius: 3px; }
#bulk { width: min(760px, 96vw); }
.bulk { padding: 18px; }
.bulk h2 { margin: 0; font-size: 16px; margin-right: auto; }

@media (max-width: 800px) {
  .editor { grid-template-columns: 1fr; }
  main { padding: 16px; }
}

/* ---------- Live listings: store banner ---------- */
.store-banner { margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.store-banner:empty { display: none; }
.banner-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.banner-head h2 { margin: 0; margin-right: auto; font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.top-sellers { margin-top: 10px; line-height: 1.7; }
.top-sellers a { color: var(--text); }
.health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.health-chip { border: 1px solid color-mix(in srgb, var(--cm-warning) 50%, transparent); background: color-mix(in srgb, var(--cm-warning) 10%, transparent); color: var(--amber); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.health-chip:hover { background: color-mix(in srgb, var(--cm-warning) 20%, transparent); }
.sync-full summary { cursor: pointer; margin-top: 10px; }
.sync-full[open] summary { margin-bottom: 8px; }

/* ---------- Live listings: filters, selection ---------- */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips-row:empty { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--cm-accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--cm-accent) 40%, transparent); font-size: 12px; }
.filter-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; }
.filter-chip button:hover { color: var(--text); }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--cm-info) 12%, transparent); border: 1px solid color-mix(in srgb, var(--cm-info) 40%, transparent); }
.selbar b { margin-right: auto; }
.live-table .sel-col { text-align: center; }
.live-table .sel-col input { width: auto; }
.live-table tbody tr.selected { background: color-mix(in srgb, var(--cm-info) 8%, transparent); }
.col-filter-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 11px; }
.col-filter-btn:hover, .col-filter-btn.on { color: var(--lime); }

/* Column value filter popover */
.col-filter { position: absolute; z-index: 30; width: 300px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.cf-head { margin-bottom: 6px; }
.cf-list { max-height: 280px; overflow-y: auto; margin: 6px 0; display: flex; flex-direction: column; gap: 2px; }
.cf-item { display: flex; gap: 6px; align-items: center; padding: 2px 0; }
.cf-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* Columns menu */
.col-menu > div { width: 280px; max-height: min(70vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
.col-menu > div > * { flex-shrink: 0; }
.cm-list { overflow-y: auto; max-height: 320px; display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.cm-group { margin-top: 6px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }

/* Bulk edit dialog */
#live-bulk { max-width: 720px; width: 100%; }
.lb-remove { align-self: end; }

/* Status bar: minimize button, and the minimized corner pill */
.fix-banner .fb-min { position: absolute; top: 8px; right: 8px; z-index: 1; }
.fix-banner .fb-row:first-of-type { padding-right: 64px; }
.fix-banner.mini { position: fixed; right: 18px; bottom: 18px; z-index: 40; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.fb-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 13px; cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4); }
.fb-pill:hover { border-color: var(--lime); }
.fb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); }
.fb-dot.warn { background: var(--amber); }

/* Awaiting shipment tile: a link to Seller Hub, amber while orders wait */
a.stat-link { color: var(--text); text-decoration: none; }
a.stat-link:hover { border-color: var(--lime); }
.stat.attention { border-color: color-mix(in srgb, var(--cm-warning) 55%, transparent); background: color-mix(in srgb, var(--cm-warning) 8%, transparent); }
.stat.attention .stat-value { color: var(--amber); }

/* Toolbar buttons match the search box and dropdowns beside them */
.live-toolbar .btn { padding: 7px 14px; font-size: inherit; line-height: inherit; color: var(--text); }
.live-toolbar .btn.primary { color: var(--lime-ink); }
/* The Columns button sits inside <details>: lay both out as flex boxes so it lines up with
   the other toolbar controls instead of sitting on the text baseline a few pixels low. */
.live-toolbar .col-menu { display: flex; align-items: center; margin: 0; }
.col-menu summary.btn { display: flex; align-items: center; margin: 0; font: inherit; line-height: inherit; color: var(--text); }
.live-toolbar .btn, .col-menu summary.btn { box-sizing: border-box; height: 36px; }

/* Columns menu: ordered list of shown columns */
.cm-shown { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; margin-bottom: 4px; }
.cm-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; border: 1px solid transparent; background: var(--bg); }
.cm-row.dragging { opacity: 0.4; }
.cm-row.drop-target, .live-table th.drop-target { border-color: var(--lime); box-shadow: inset 3px 0 0 var(--lime); }
.cm-handle { cursor: grab; color: var(--muted); user-select: none; padding: 0 2px; }
.cm-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; }
.cm-btn:hover:not(:disabled) { color: var(--text); }
.cm-btn:disabled { opacity: 0.3; cursor: default; }
.live-table th[draggable="true"] { cursor: grab; }
.live-table th.dragging { opacity: 0.4; }
/* With .col-menu as a flex box, pin its drop-down just below the button. */
.live-toolbar .col-menu > div { top: 100%; }

/* Columns menu: taller (most of the window), lists share the space, normal-size search box.
   The toolbar's "grow to fill" rule for its search box must not apply inside the menu. */
.live-toolbar .col-menu > div { width: 340px; max-height: min(80vh, 820px); overflow: hidden; }
.col-menu input[type="search"] { flex: none; width: 100%; }
.cm-shown { max-height: 34vh; flex: none; }
.cm-list { max-height: none; flex: 1 1 auto; min-height: 120px; overflow-y: auto; }

/* Duplicates */
.dup-badge { margin-top: 4px; font-size: 11px; color: var(--amber); }
.dup-warning { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--cm-warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--cm-warning) 45%, transparent); font-size: 13px; line-height: 1.6; }
.dup-warning a { color: var(--text); }
.dup-group { margin: 12px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.dup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dup-head button { margin-left: auto; }

/* ---------- Personal collection ---------- */
/* The editor shows listing fields for listing cards and collection fields for collection cards. */
#editor.collection-mode .listing-only { display: none !important; }
#editor:not(.collection-mode) .collection-only { display: none !important; }
.coll-section { margin: 4px 0 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--cm-accent) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--cm-accent) 4%, transparent); }

.stat.gain .stat-value { color: var(--lime); }
.stat.loss .stat-value { color: var(--red); }
.sport-bars { display: grid; gap: 4px; margin-top: 12px; max-width: 560px; }
.sport-bar { display: grid; grid-template-columns: 110px 1fr 90px; align-items: center; gap: 8px; font-size: 12px; }
.sport-bar .bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.sport-bar .fill { display: block; height: 100%; background: var(--lime); border-radius: 999px; }
.value-chip { border-color: color-mix(in srgb, var(--cm-accent) 45%, transparent); background: color-mix(in srgb, var(--cm-accent) 8%, transparent); color: var(--text); }

/* Favorites strip */
.fav-strip { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.fav-strip:empty { display: none; }
.fav-head { margin-bottom: 8px; }
.fav-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.fav-card { flex: 0 0 132px; cursor: pointer; border-radius: 8px; padding: 6px; border: 1px solid transparent; }
.fav-card:hover { border-color: var(--lime); }
.fav-card img, .fav-card .no-img { width: 120px; height: 160px; object-fit: contain; background: var(--bg); border-radius: 6px; }
.fav-name { font-size: 12px; font-weight: 600; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-meta { font-size: 11px; color: var(--muted); }
.fav-value { font-size: 13px; color: var(--lime); font-weight: 700; }

/* Collection grid */
.coll-actions { flex-wrap: wrap; }
.coll-actions #coll-count { margin-right: auto; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 12px; }
.ccard { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); cursor: pointer; display: flex; flex-direction: column; }
.ccard:hover { border-color: var(--lime); }
.ccard-img { position: relative; background: var(--photo-bg); display: flex; justify-content: center; }
.ccard-img img, .ccard-img .no-img { width: 100%; height: 220px; object-fit: contain; }
.no-img { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.star { position: absolute; top: 6px; right: 6px; border: 0; border-radius: 999px; width: 30px; height: 30px; background: rgba(0, 0, 0, 0.55); color: var(--cm-brand-ice-white); font-size: 17px; cursor: pointer; line-height: 1; }
.star.on { color: var(--amber); }
.ccard-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ccard-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.ccard-sub { font-size: 11px; }
.cbadges { display: flex; flex-wrap: wrap; gap: 4px; }
.cbadge { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--cm-border); }
.cbadge.graded { background: color-mix(in srgb, var(--cm-info) 15%, transparent); border-color: color-mix(in srgb, var(--cm-info) 50%, transparent); color: var(--blue); }
.ccard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.ccard-value { font-weight: 700; }
.gain { font-size: 12px; font-weight: 600; }
.gain.up { color: var(--lime); }
.gain.down { color: var(--red); }

/* Collection stat tiles that open a detail panel */
.stat-btn { text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.stat-btn:hover { border-color: var(--lime); }
.stat-btn.open { border-color: var(--lime); background: color-mix(in srgb, var(--cm-accent) 6%, transparent); }
.stat-caret { color: var(--muted); font-size: 11px; }
.stat-btn .stat-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.sd-section { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.sd-section.wide { grid-column: span 2; }
@media (max-width: 760px) { .sd-section.wide { grid-column: auto; } }
.sd-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.sd-row { display: grid; grid-template-columns: minmax(90px, 1.4fr) 1fr auto minmax(60px, auto); align-items: center; gap: 8px; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; }
.sd-row.clickable { cursor: pointer; }
.sd-row.clickable:hover { background: var(--panel-2); }
.sd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-bar { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.sd-bar .fill { display: block; height: 100%; background: var(--lime); border-radius: 999px; }
.sd-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.sd-sub { text-align: right; font-size: 11px; }
.sd-card { display: grid; grid-template-columns: 20px 34px 1fr auto auto; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.sd-card:hover { background: var(--panel-2); }
.sd-card img, .sd-noimg { width: 34px; height: 46px; object-fit: contain; background: var(--photo-bg); border-radius: 3px; }
.sd-rank { color: var(--muted); font-size: 11px; text-align: right; }


/* ---------- Listing groups (Add Listings) ---------- */
.groups-bar { margin-bottom: 12px; }
.groups-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.groups-head h2 { margin: 0; margin-right: auto; font-size: 17px; }
.groups-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.group-tile { flex: 0 0 230px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.group-tile:hover { border-color: var(--lime); }
.group-tile.active { border-color: var(--lime); background: color-mix(in srgb, var(--cm-accent) 7%, transparent); box-shadow: inset 0 0 0 1px var(--lime); }
.group-tile.closed { opacity: 0.6; }
.group-tile.all { flex-basis: 140px; }
.gt-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-meta, .gt-counts { font-size: 11px; }
.gt-bar { height: 5px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.gt-bar .fill { display: block; height: 100%; background: var(--lime); }
.group-header { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.gh-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gh-main h3 { margin: 0; font-size: 15px; }
.gh-actions { margin-left: auto; display: flex; gap: 6px; }
.gh-done { color: var(--lime); font-size: 13px; }
.dz-target { display: block; margin-top: 4px; color: var(--lime); }
#group-dlg, #move-dlg { max-width: 640px; width: 100%; }

.lb-end { margin-top: 10px; color: var(--red); }
.dup-actions { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.gh-profit { margin-top: 4px; font-size: 13px; }
.gh-profit .good { color: var(--green); }
.gh-profit .bad { color: var(--red); }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font: inherit; text-decoration: underline; }
.cert-row { gap: 8px; flex-wrap: wrap; align-items: center; }
.picklist-link { margin-left: 8px; font-weight: 600; }
#cd-certs { width: 100%; }

/* Checklist combo box: one field, the checklist's options drop down under it. */
.combo { position: relative; display: block; }
.combo input { padding-right: 28px; }
.combo-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.combo-panel { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.combo-opt { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.combo-opt:hover, .combo-opt.active { background: var(--panel-2); }
.combo-opt.current { color: var(--lime); }
.combo-opt.typed { border-top: 1px solid var(--border); font-style: italic; }

/* Signed-in account (hosted app) */
.account { display: flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 12px; white-space: nowrap; }

/* Pick list dialog, printable on its own */
.picklist-dlg { width: min(900px, calc(100vw - 32px)); }
.picklist-dlg .ed-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picklist-dlg .pl-actions { margin-left: auto; display: flex; gap: 6px; }
.pl-table td { vertical-align: middle; }
.pl-loc { font-weight: 600; white-space: nowrap; }
.pl-box { display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; }
@media print {
  body.printing-picklist > *:not(#picklist-dlg) { display: none !important; }
  body.printing-picklist { background: #fff; color: #000; }
  body.printing-picklist #picklist-dlg { position: static; display: block; width: 100%; max-width: none; border: 0; padding: 0; background: #fff; color: #000; box-shadow: none; }
  body.printing-picklist #picklist-dlg::backdrop { display: none; }
  body.printing-picklist .pl-actions { display: none; }
  body.printing-picklist .pl-table th, body.printing-picklist .pl-table td { color: #000; border-color: #ccc; }
}

/* ---------- Phones (narrow screens) ----------
   The page must never be wider than the screen: phones would zoom the whole page out. Wide
   tables scroll inside their own box; the header wraps onto two rows. */
@media (max-width: 700px) {
  .top { flex-wrap: wrap; gap: 6px 10px; padding: 10px 12px 0; }
  .brand img { height: 22px; }
  .env { margin-left: auto; font-size: 10px; padding: 3px 8px; }
  .account { margin-left: 0; font-size: 11px; min-width: 0; }
  .account .hint { max-width: 150px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
  .tabs { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs { justify-content: space-between; }
  .tabs button { white-space: nowrap; padding: 6px 5px; font-size: 13px; }
  main { padding: 12px 12px 60px; }
  .panel { padding: 14px 12px; }
  .store-banner { padding: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 19px; }
  .live-toolbar { flex-wrap: wrap; }
  .live-toolbar input[type="search"] { flex: 1 0 100%; }
  /* Other tables (reports, pick list, change log) scroll sideways inside themselves. */
  /* (The Add and My Collection lists keep their column widths: their box scrolls sideways instead.) */
  .report-table:not(.live-table):not(.add-table):not(.fixed-cols) { display: block; max-width: 100%; overflow-x: auto; }
  .table-scroll { -webkit-overflow-scrolling: touch; }
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .editor { padding: 12px; gap: 12px; }
  /* Grid columns may shrink below their content's width, so nothing pushes past the screen. */
  .editor > *, .editor .form-grid > * { min-width: 0; }
  .editor .photos img { max-width: 100%; height: auto; }
  .editor .ed-head { flex-wrap: wrap; row-gap: 6px; }

  /* Duplicate groups: each listing becomes a small card. */
  .dup-group { padding: 8px; }
  .dup-group table, .dup-group tbody { display: block; width: 100%; }
  .dup-row { display: grid; grid-template-columns: 64px 52px minmax(0, 1fr) auto; grid-template-areas:
      "keep img title title"
      "keep img price avail"
      "keep img watch date"
      "keep img edit edit";
    gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .dup-row td, .dup-row td.num { display: block; border: 0; padding: 0; text-align: left; }
  .dr-keep { grid-area: keep; align-self: start; }
  .dr-img { grid-area: img; }
  .dr-title { grid-area: title; overflow-wrap: anywhere; }
  .dr-price { grid-area: price; font-weight: 600; }
  .dr-avail { grid-area: avail; }
  .dr-watch { grid-area: watch; }
  .dr-date { grid-area: date; }
  .dr-edit { grid-area: edit; margin-top: 4px; }
  .dup-head { flex-wrap: wrap; }
}

.dup-qty { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 6px; }
.dup-qty input { width: 64px; padding: 4px 6px; }

/* ---------- Home ---------- */
#tab-home { max-width: 1100px; }
.home-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 22px 24px; border-radius: 14px; border: 1px solid var(--border);
  background: radial-gradient(600px 220px at 100% 0%, color-mix(in srgb, var(--cm-accent) 14%, transparent), transparent 70%), linear-gradient(135deg, var(--panel-2), var(--panel)); }
.home-logo { width: 84px; height: 84px; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5)); }
.home-eyebrow { margin: 0 0 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: var(--lime); }
.home-hello h1 { margin: 0; font-weight: var(--cm-type-display-weight); letter-spacing: var(--cm-type-display-tracking); font-size: 32px; line-height: var(--cm-type-display-line-height); }
.home-hello p { margin: 6px 0 0; }
.home-hero-links { display: flex; flex-direction: column; gap: 8px; }
.home-h { margin: 26px 0 12px; letter-spacing: -0.01em; font-size: 16px; color: var(--muted); font-weight: 650; }
.home-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.home-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.home-stat:hover { border-color: var(--lime); transform: translateY(-2px); }
.home-stat.accent { border-color: color-mix(in srgb, var(--cm-warning) 45%, transparent); }
.home-stat-label { color: var(--muted); font-size: 12px; }
.home-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.home-stat-sub { color: var(--muted); font-size: 12px; min-height: 1.2em; }
.home-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.home-action { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px 16px 22px; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(180deg, var(--panel), var(--bg)); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.home-action::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lime); } /* straight accent edge */
.home-action:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.7); }
.home-action.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.home-action.primary .home-action-sub { color: color-mix(in srgb, var(--cm-on-accent) 75%, transparent); }
.home-action-title { letter-spacing: -0.01em; font-size: 17px; font-weight: 650; }
.home-action-sub { color: var(--muted); font-size: 13px; }
.home-store-head { display: flex; align-items: baseline; justify-content: space-between; }
#tab-home .lp-cats.compact { margin-bottom: 30px; }
#tab-home .lp-cat { --navy-950: var(--photo-bg); --line: var(--border); }
@media (max-width: 700px) {
  .home-hero { grid-template-columns: auto 1fr; padding: 16px; gap: 14px; }
  .home-logo { width: 60px; height: 60px; }
  .home-hello h1 { font-size: 24px; }
  .home-hero-links { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-stat { padding: 12px; }
  .home-stat-value { font-size: 24px; }
  .home-actions { grid-template-columns: 1fr; gap: 10px; }
  .home-action { padding: 13px 14px; }
}
@media (prefers-reduced-motion: reduce) { .home-stat, .home-action { transition: none; } }

/* Title counter (eBay's 80-character limit) */
.count-warn { color: var(--amber) !important; font-weight: 600; }
.count-bad { color: var(--red) !important; font-weight: 700; }

/* Combined duplicates log */
#combine-log summary { cursor: pointer; }
.cl-table td { vertical-align: top; }
.cl-table .good { color: var(--lime); }
.cl-label { display: none; color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  /* Each log entry as a card: listing, then quantity / eBay now, ended / verified, date. */
  .cl-table { display: block; }
  .cl-table thead { display: none; }
  .cl-table tbody { display: block; }
  .cl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "kept kept" "qty now" "ended ver" "when when"; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .cl-row td, .cl-row td.num { display: block; border: 0; padding: 0; text-align: left; }
  .cl-kept { grid-area: kept; overflow-wrap: anywhere; }
  .cl-qty { grid-area: qty; } .cl-now { grid-area: now; } .cl-ended { grid-area: ended; } .cl-ver { grid-area: ver; }
  .cl-when { grid-area: when; color: var(--muted); font-size: 12px; }
  .cl-when .hint { display: inline; margin-left: 6px; }
  .cl-label { display: inline; }
}

/* eBay connect */
.connect-ok { margin: 8px 0; padding: 8px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--cm-accent) 40%, transparent); background: color-mix(in srgb, var(--cm-accent) 8%, transparent); color: var(--lime); }
.paste-fallback { margin-top: 10px; }
.paste-fallback summary { cursor: pointer; }

/* ---- My Collection: Cards / Team sets switch, team sets ---- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 14px; background: var(--panel); }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.seg button.active { background: var(--lime); color: var(--bg); }
.ts-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--cm-text) 8%, transparent); overflow: hidden; }
.ts-bar span { display: block; height: 100%; background: var(--lime); border-radius: 3px; }
.ts-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 8px; }
.ts-head h2 { margin: 0 0 2px; }
.ts-head-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-progress { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; }
.ts-progress .ts-bar { flex: 1; max-width: 360px; height: 8px; }
.ts-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ts-filters input { flex: 1; min-width: 160px; max-width: 280px; }
.ts-rows { border-top: 1px solid var(--border); }
.ts-row, .ts-pick-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.ts-row input[type="checkbox"], .ts-pick-row input[type="checkbox"] { flex: none; width: 18px; height: 18px; align-self: center; }
.ts-row.have .ts-player { color: var(--muted); }
.ts-num { flex: none; min-width: 64px; max-width: 34%; overflow-wrap: anywhere; color: var(--muted); font-variant-numeric: tabular-nums; }
.ts-player { flex: 1; min-width: 0; }
.ts-tags { display: block; font-size: 12px; font-style: italic; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Track cards' eBay link: after the player's name; under it on a phone. */
.ts-ebay { display: inline-block; margin-left: 8px; font-size: 12px; white-space: nowrap; color: var(--muted); text-decoration: none; }
.ts-ebay:hover, .ts-ebay:focus { color: var(--amber); text-decoration: underline; }
/* On a phone it goes on its own line (full width); an inline-block, as a block would inherit a Not sought card's line-through. */
@media (max-width: 600px) { .ts-ebay { display: inline-block; width: 100%; margin: 2px 0 0; } }
.ts-notes { margin-top: 12px; }
.ts-notes p { white-space: pre-wrap; margin: 4px 0 0; }
.ts-pick { max-height: 300px; overflow-y: auto; margin: 6px 0 10px; }
.ts-pick-row { cursor: pointer; }
.ts-pick-row.owned { opacity: 0.5; }
/* New Team Set picker: sections like the plain checklist sheet */
.tsn-group { margin-top: 10px; }
.tsn-group:first-child { margin-top: 0; }
.tsn-section { color: var(--lime); font-weight: 800; font-size: 16px; padding: 2px 4px; }
.tsn-types { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 8px 0; }
.tsn-cards-head { align-items: center; gap: 12px; }
/* New Team Set: sport buttons and year on one line, then the Set box with its drop-down list. */
.tsn-source { margin: 4px 0 10px; }
.tsn-source[hidden], #tsn-team-label[hidden] { display: none; }
.tsn-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.tsn-filters .seg { margin-bottom: 0; }
.tsn-pick { display: flex; align-items: center; gap: 6px; margin: 0; }
.tsn-pick select { min-width: 0; }
.tsn-set-title { display: block; margin-bottom: 4px; }
.combo { position: relative; }
.combo input { width: 100%; box-sizing: border-box; padding-right: 40px; }
.combo-btn { position: absolute; top: 0; right: 0; bottom: 0; width: 38px; border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: min(320px, 45vh); overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 35%); }
.combo-list[hidden] { display: none; }
.combo-list li { padding: 9px 10px; border-radius: 7px; cursor: pointer; overflow-wrap: anywhere; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--border); }
.combo-list li.picked { color: var(--lime); font-weight: 600; }
.combo-list li .hint { margin-left: 4px; }
.combo-list li.combo-note { cursor: default; color: var(--muted); font-size: 13px; }
.combo-list li.combo-note:hover { background: none; }
.tsn-manual { margin: 8px 0 12px; }
@media (max-width: 700px) {
  .ts-num { min-width: 52px; }
}
/* Team set tile: a printed-checklist look (white sheet, navy frame), like the team set cards collectors make. */
.ts-sheet { background: #fff; color: #1b1f2a; border: 6px solid #1a2547; border-radius: 6px; padding: 18px 22px; font-size: 16px; line-height: 1.4; }
.ts-sheet-full { max-width: 520px; margin: 6px 0 12px; }
/* The checklist on the set's page: the same layout on the page's own background. */
.ts-sheet.plain { background: none; color: var(--text); border: 0; padding: 0; font-size: 15px; }
.ts-sheet.plain .tss-group:first-child { margin-top: 0; }
.ts-sheet.plain .tss-section { color: var(--lime); font-size: 16px; }
.ts-sheet.plain .tss-card.have { color: var(--text); }
.ts-sheet.plain .tss-check { color: var(--lime); }
.tss-team { color: #1a2547; font-weight: 800; font-size: 26px; line-height: 1.15; }
.tss-set { font-weight: 800; font-size: 21px; margin: 2px 0 10px; }
.tss-group { margin-top: 10px; }
.tss-section { color: #1a2547; font-weight: 800; font-size: 17px; }
.tss-card { overflow-wrap: anywhere; }
.tss-card.have { color: #2f6b0f; }
.tss-check { font-weight: 800; margin-right: 3px; }
.tss-more { color: #5a6378; font-style: italic; margin-top: 4px; }
.ts-count { color: var(--lime); font-weight: 800; }
.ts-table td a { color: var(--text); font-weight: 600; text-decoration: none; }
.ts-tr { cursor: pointer; }
.ts-tr:hover { background: color-mix(in srgb, var(--cm-text) 3%, transparent); }
.ts-table th { white-space: nowrap; position: relative; } /* holds the column's resize edge */
.ts-table td:first-child { min-width: 240px; }
.ts-have { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.ts-have .ts-bar { width: 60px; }
.ts-status { white-space: nowrap; }
.ts-mode { margin: 4px 0 12px; }
.ts-row.skip .ts-player { color: var(--muted); text-decoration: line-through; }
.ts-reorder .ts-row { align-items: center; background: var(--bg); }
.ts-reorder .ts-player { flex: 1; min-width: 0; }
.ts-handle { flex: none; cursor: grab; touch-action: none; user-select: none; padding: 4px 8px; font-size: 18px; color: var(--muted); }
.ts-move { flex: none; display: flex; gap: 4px; }
.ts-row.dragging { opacity: 0.6; outline: 2px dashed var(--border); }
.tsd-wide { grid-column: 1 / -1; }
.ts-phone-meta, .phone-only { display: none; }
.tsd-wide textarea { width: 100%; }
@media (max-width: 700px) {
  .ts-sheet { padding: 14px 16px; font-size: 15px; }
  .tss-team { font-size: 22px; }
  .tss-set { font-size: 18px; }
  /* The list on a phone: one column (name, then the other fields on a line), sorted by the menu. */
  .ts-table th, .ts-table td:not(:first-child) { display: none; }
  .ts-table td:first-child { min-width: 0; }
  .ts-phone-meta { display: block; margin-top: 3px; font-weight: 400; }
  select.phone-only { display: block; }
}
.ts-pending { color: var(--amber); font-weight: 700; }
.ts-layout { margin: 0; }
.ts-layout button { padding: 5px 12px; }
.ts-logo { width: 40px; height: 40px; object-fit: contain; }
.ts-logo.small { width: 20px; height: 20px; }
.ts-team-cell { display: inline-flex; align-items: center; gap: 6px; }
.ts-group { margin-top: 14px; }
.ts-group-head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.ts-group-head h3 { margin: 0; font-size: 18px; }
.ts-logo-btn { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; }
.ts-logo-empty { width: 40px; height: 40px; border: 1px dashed var(--border); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
.ts-logo-remove { margin-left: auto; font-size: 12px; }
.ts-group-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); color: var(--text); font: inherit; padding: 10px 4px; cursor: pointer; }
.ts-group-row:hover { background: color-mix(in srgb, var(--cm-text) 3%, transparent); }
.ts-title { font-weight: 600; }
.ts-group-meta { font-size: 13px; }
.ts-notes { margin-top: 18px; }
.ts-notes h3 { margin: 0 0 6px; }
.ts-notes-text { width: 100%; box-sizing: border-box; font: inherit; }
.un-table td:first-child { min-width: 220px; }
#un-dlg .form-grid [hidden] { display: none; }
#un-math { margin: 0; color: var(--lime); }

/* ---- accounts: the demo account, the admin screen ---- */
body.demo .no-demo { display: none !important; }
.demo-banner { background: var(--cm-status-pending-fill); color: var(--cm-status-pending-text); padding: 8px 16px; font-size: 14px; text-align: center; }
.no-access { max-width: 520px; margin: 40px auto; }
.admin-invite { flex-wrap: wrap; gap: 8px; }
.admin-invite input[type="email"] { flex: 1 1 240px; }
.admin-invite input:not([type]) { flex: 1 1 200px; }
/* ---- listing types: lots and sets ---- */
#editor:not(.multi) .multi-only { display: none !important; }
#editor.multi .single-only { display: none !important; }
.type-row { margin-bottom: 6px; }
.ed-photos { margin-top: 10px; }
.ed-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 6px 0; }
.ed-photo { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 12px; }
.ed-photo img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 2px solid var(--border); }
.ed-photo.primary img { border-color: var(--lime); }
.ed-photo-star { color: var(--lime); font-weight: 700; }
.danger-text { color: var(--red); }
/* ---- Unopened: photos, comps ---- */
.un-name { display: inline-flex; align-items: center; gap: 8px; }
.un-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex: none; }
.un-tools { gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.un-comps { margin-bottom: 8px; }
.un-comps-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 6px 0; }

/* Team sets / Unopened summary: four tiles (two per row on phones), like My Collection's. */
.coll-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
@media (max-width: 700px) { .coll-stats { grid-template-columns: repeat(2, 1fr); } }

/* Notices for background work (e.g. an eBay update after the editor closes). */
.notices { position: fixed; inset: auto auto 16px 50%; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.notice { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel); color: var(--text); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.notice > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice.ok { border-color: var(--green); }
.notice.bad { border-color: var(--red); }

/* Add: grid / list switch and the list view */
.add-viewbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.add-viewbar .col-menu { margin-left: auto; }
.add-table th { white-space: nowrap; }
.add-table th.sortable { cursor: pointer; user-select: none; }
.add-table th.sortable:hover, .add-table th.active { color: var(--text); }
.add-table .sort-arrow { color: var(--muted); font-size: 11px; }
.add-table .sel-col { width: 36px; text-align: center; }
/* Tick boxes keep their own size (the general input style is full-width with padding, which a phone squeezes to a dot). */
.add-table .sel-col input { width: 20px; height: 20px; padding: 0; margin: 0; }
.add-table .add-title { min-width: 240px; }
.add-table .err { color: var(--red); font-size: 12px; margin-top: 2px; }
.add-row { cursor: pointer; }
.add-table .pill { white-space: nowrap; }
.add-row:hover { background: var(--panel-2); }
.add-row.selected { background: var(--panel-2); }

/* Columns menus: a grip bar along the top drags the menu anywhere on screen. */
.col-menu > div { padding-top: 24px; }
.col-menu > div::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--border); pointer-events: none; }
.col-menu > div:hover::before { background: var(--muted); }
.col-menu > div { cursor: default; }
.col-menu > div.moving { cursor: grabbing; user-select: none; }

/* Listings: the Sold out & ended view has its own columns and no filters, column menu or bulk edits. */
.sold-mode #lf-missing, .sold-mode #lf-clear, .sold-mode .col-menu, .sold-mode #live-chips, .sold-mode #live-selbar { display: none !important; }

/* Team sets, By team: group-by switch, collapsible teams, year / brand headings */
/* Team sets toolbar (Mark, 2026-11-21): status across the page; Table / By Team and Year / Brand the same width with
   + New Set in the room left; search, team, set and sort in a section that starts closed, Clear filters on the Sort line. */
.ts-status-seg { display: flex; width: 100%; box-sizing: border-box; margin: 0 0 10px; }
.ts-status-seg button { flex: 1 1 0; min-width: 0; padding: 6px 8px; }
.ts-toolbar { display: block; margin-bottom: 4px; }
/* minmax(0, 1fr): the two switches stay exactly equal even when a label is long for a narrow phone. */
.ts-view-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ts-view-row .seg { display: flex; margin: 0; box-sizing: border-box; width: 100%; }
/* Inside each switch the buttons share by label length ("By Team" needs more than "Table"). */
.ts-view-row .seg button { flex: 1 1 auto; padding: 6px 8px; white-space: nowrap; }
.ts-view-slot { min-width: 0; display: flex; align-items: center; }
#ts-groupby[hidden] { display: none; }
.ts-more { margin-top: 10px; }
.ts-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; padding: 4px 2px; }
.ts-more > summary::-webkit-details-marker { display: none; }
.ts-more > summary::before { content: "▸"; font-size: 12px; }
.ts-more[open] > summary::before { content: "▾"; }
.ts-more > summary:hover, .ts-more > summary:focus-visible { color: var(--text); }
.ts-more-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
/* flex: none: the toolbar's search rule (flex 1 1 260px) would set its height in this column. */
.ts-more-body input[type="search"] { flex: none; width: 100%; box-sizing: border-box; }
.ts-more-line { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ts-more-line select { width: 100%; min-width: 0; }
.ts-sort-line { grid-template-columns: 1fr auto; }
@media (max-width: 430px) {
  .ts-status-seg button, .ts-view-row .seg button { padding: 6px 4px; font-size: 14px; }
  .ts-view-row { gap: 6px; }
  .ts-view-row #ts-new { padding: 7px 10px; font-size: 14px; }
}
@media (max-width: 380px) {
  .ts-view-row .seg button { font-size: 13px; padding: 6px 2px; }
  .ts-view-row #ts-new { padding: 7px 8px; font-size: 13px; }
}
.ts-fold { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 2px; width: 22px; }
.ts-group-name { cursor: pointer; }
.ts-group.folded .ts-group-head { border-bottom-color: transparent; }
.ts-sub { margin: 10px 0 0 6px; }
.ts-sub-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px; color: var(--lime); font-size: 14px; border-bottom: 1px solid var(--border); }
.ts-sub .ts-group-row { padding: 7px 4px 7px 12px; }

/* My Collection: stage chips (New, Identifying, Draft, Confirmed) above the filters */
.coll-stages { margin-bottom: 10px; }

/* Editor identify panel: each service's reading with a 'Use this' button */
.reading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 4px 0; }
.reading > span { flex: 1; min-width: 0; }
.reading > .btn { flex: none; }

/* Editor: other versions of the card number (official checklists) */
.ed-versions { display: block; margin-top: 2px; }

.ed-side-tools { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: -4px; }
.photo-tools { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.ed-photo .photo-tools { display: flex; }

.crop-dlg { max-width: min(92vw, 720px); padding: 16px 18px; }
.crop-stage { position: relative; display: inline-block; margin: 10px 0; user-select: none; touch-action: none; overflow: hidden; }
.crop-stage img { display: block; max-width: min(86vw, 680px); max-height: 68vh; width: auto; height: auto; }
.crop-box { position: absolute; border: 2px solid var(--amber); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); cursor: move; }
.crop-stage { padding: 6%; background: repeating-conic-gradient(var(--cm-surface) 0 25%, var(--cm-background) 0 50%) 0 0 / 16px 16px; border-radius: 8px; }
.crop-box i { position: absolute; width: 18px; height: 18px; background: var(--amber); border-radius: 3px; }
.crop-box i[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.crop-box i[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.crop-box i[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.crop-box i[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.crop-actions { display: flex; gap: 8px; align-items: center; }
.crop-actions .spacer { flex: 1; }

.dup-title { margin-top: 6px; font-weight: 600; }
.dup-match { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0; }
.dup-match .btn { margin-left: auto; }
.merge-dlg { max-width: min(94vw, 640px); padding: 16px 18px; }
.merge-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
.merge-compare figure { margin: 0; }
.merge-compare img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; background: var(--photo-bg); border-radius: 8px; }
.merge-compare figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 0.9em; }
.merge-qty input { width: 80px; margin-left: 6px; }
.merge-effect { margin: 10px 0; }
.merge-actions { display: flex; gap: 8px; align-items: center; }
.merge-actions .spacer { flex: 1; }

.qty-step { display: inline-flex; align-items: center; gap: 4px; min-width: max-content; }
/* The card editor's Quantity: big − / + either side of the box (the browser's own tiny arrows are hidden). */
.qty-field { display: flex; align-items: center; gap: 6px; }
.qty-field input { flex: 1 1 auto; min-width: 0; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.qty-field input::-webkit-inner-spin-button, .qty-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-big { flex: none; width: 36px; height: 36px; padding: 0; border: 1.5px solid var(--muted); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.qty-big:hover:not(:disabled) { background: color-mix(in srgb, var(--cm-text) 8%, transparent); border-color: var(--text); }
.qty-big:active:not(:disabled) { background: color-mix(in srgb, var(--cm-text) 16%, transparent); }
.qty-big:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.qty-big:disabled { opacity: 0.35; cursor: default; }
/* The price row on a phone: two boxes (styles: .ed-grid.price-grid at 640px). */
@media (max-width: 640px) { .qty-field { gap: 4px; } .qty-big { width: 32px; height: 32px; font-size: 18px; } .ed-grid.price-grid .qty-field input { padding-left: 2px; padding-right: 2px; } }
.qty-num { min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; }
.qty-btn { border: 1.5px solid var(--muted); background: transparent; color: var(--text); border-radius: 7px; width: 30px; height: 30px; padding: 0; font: inherit; font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; }
@media (pointer: coarse) { .qty-btn { width: 36px; height: 36px; } }
.qty-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--cm-text) 8%, transparent); border-color: var(--text); }
.qty-btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.qty-btn:disabled { opacity: 0.35; cursor: default; }

#market-dlg { max-width: min(96vw, 980px); }
.mk-chips { margin: 8px 0; }
.mk-lists { max-height: 52vh; overflow: auto; }
.mk-table td { vertical-align: top; }
.mk-card { display: flex; gap: 8px; min-width: 260px; }
.mk-card img { width: 44px; height: 60px; object-fit: cover; border-radius: 4px; flex: none; }
.mk-price { width: 72px; }
.mk-verdict { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.85em; white-space: nowrap; }
.mk-verdict.under { background: color-mix(in srgb, var(--cm-good) 18%, transparent); color: var(--green); }
.mk-verdict.over { background: color-mix(in srgb, var(--cm-critical) 18%, transparent); color: var(--red); }
.mk-verdict.check { background: color-mix(in srgb, var(--cm-warning) 18%, transparent); color: var(--amber); }
.mk-verdict.ok { background: color-mix(in srgb, var(--cm-text) 8%, transparent); color: var(--muted); }

.share-btn { position: absolute; top: 6px; left: 6px; border: 0; border-radius: 999px; width: 30px; height: 30px; background: rgba(0, 0, 0, 0.55); color: var(--cm-brand-ice-white); font-size: 16px; cursor: pointer; line-height: 1; }
.share-dlg { max-width: min(94vw, 760px); padding: 16px 18px; }
.share-body { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 14px; margin: 10px 0; }
.share-photos { display: flex; flex-direction: column; gap: 8px; }
.share-photos img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; background: var(--photo-bg); border-radius: 8px; }
.share-text textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }
.share-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 600px) {
  .share-body { grid-template-columns: 1fr; }
  .share-photos { flex-direction: row; }
  .share-photos img { width: 45%; }
}
.share-dlg .ed-head { display: flex; justify-content: space-between; align-items: center; }

/* CardLister pop-ups */
.ui-dlg { max-width: min(92vw, 460px); padding: 20px 22px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5); }
.ui-dlg::backdrop { background: var(--cm-overlay); }
.ui-dlg.error { border-color: color-mix(in srgb, var(--cm-critical) 60%, transparent); }
.ui-title { margin: 0 0 8px; }
.ui-msg { white-space: pre-line; line-height: 1.45; }
.ui-detail { margin-top: 6px; white-space: pre-line; }
.ui-input { width: 100%; box-sizing: border-box; margin-top: 12px; }
.ui-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ui-dlg .btn.danger { background: var(--cm-brand-signal-red); border-color: var(--cm-brand-signal-red); color: var(--cm-status-error-text); font-weight: 600; }
.toast-tray { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--cm-border); color: var(--text); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); animation: toast-in 0.18s ease-out; }
.toast-x { margin-left: auto; border: 0; background: transparent; color: inherit; opacity: 0.7; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* My Collection groups / locations */
.coll-groups { margin-bottom: 10px; }
.coll-groups .group-tile { flex-basis: 180px; }
.coll-groups .new-group { border-style: dashed; }
#coll-group-header .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#coll-group-header .spacer { flex: 1; }

.coll-table .coll-total td { border-top: 2px solid var(--border); }
.coll-table td.add-title { min-width: 260px; }

/* Team sets: adding parallels */
.ts-pickbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; padding: 8px 12px; border: 1px solid var(--lime); border-radius: 10px; background: color-mix(in srgb, var(--cm-accent) 6%, transparent); }
.ts-pickbar .spacer { flex: 1; }
.ts-pick { accent-color: var(--lime); }
.tsp-dlg { max-width: min(94vw, 520px); }
.tsp-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; margin: 10px 0; padding-right: 6px; }
.tsp-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tsp-custom input { flex: 1 1 200px; }
.tsp-custom .tsp-run { flex: 0 1 150px; }

/* My Collection: search + Add always shown; filters and actions fold away */
#coll-group-header[hidden], #coll-groups:empty { display: none !important; }
.coll-top { display: flex; gap: 8px; align-items: center; margin: 10px 0 8px; }
.coll-top #coll-q { flex: 1; min-width: 0; }
.coll-more { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.coll-more > summary { cursor: pointer; font-weight: 600; list-style: revert; }
.coll-more[open] > summary { margin-bottom: 8px; }
.coll-more .coll-filters { margin: 8px 0; }
.coll-viewbar { align-items: center; }
.coll-viewbar #coll-count { margin-right: auto; }
#coll-grid[hidden], #coll-table-wrap[hidden] { display: none !important; }
.tsp-custom .tsp-run { flex: 0 1 190px; }

/* Listings: needs attention folds away */
.attention { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.attention > summary { cursor: pointer; }
.attention[open] > summary { margin-bottom: 8px; }
.attention .health { margin: 0; }
/* Settings: exports */
.export-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.stat-value .stat-qty { font-size: 0.6em; font-weight: 600; color: var(--muted); }

/* Pop-ups: close (and the editor's prev / next) always at the top right, staying put while scrolling */
.editor .dlg-nav { grid-column: 1 / -1; position: sticky; top: 0; z-index: 6; display: flex; justify-content: flex-end; gap: 6px; margin: -18px -18px -8px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--border); }
dialog .ed-head:has(> .btn[id$="-close"]) { position: sticky; top: 0; z-index: 6; background: var(--panel); padding-top: 4px; padding-bottom: 6px; }
dialog .ed-head > .btn[id$="-close"] { margin-left: auto; flex: none; }
@media (max-width: 700px) {
  .editor .dlg-nav { margin: -12px -12px -4px; padding: 8px 10px; }
}

/* Listings: Sold view */
#live-days { display: none; }

.stat-link { cursor: pointer; }
.stat-link:hover { border-color: var(--lime); }

/* My Collection list: selected cards' bar stays in reach while scrolling. */
.coll-selbar { position: sticky; bottom: 8px; z-index: 5; background: var(--panel); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); }
.coll-selbar select { width: auto; max-width: 13em; }
.coll-table .sel-col { width: 36px; text-align: center; }
/* The Add and My Collection lists: fixed column widths (each heading's right edge resizes; the collection's headings drag to move). */
.add-table { table-layout: fixed; }
.add-table th { position: relative; padding-right: 14px; overflow: hidden; text-overflow: ellipsis; }
.add-table td { overflow-wrap: anywhere; }
.add-table td.add-title { min-width: 0; }
.add-table .col-resizer { touch-action: none; }
.live-table .col-resizer { touch-action: none; }
@media (pointer: coarse) { .live-table .col-resizer { width: 18px; } }
.coll-table th.dragging { opacity: 0.4; }
.coll-table th.drop-target { box-shadow: inset 3px 0 0 var(--lime); }
@media (pointer: coarse) { .add-table .col-resizer { width: 18px; } .add-table th { padding-right: 22px; } }
.coll-table .coll-total-n { white-space: nowrap; overflow: visible; }
.coll-table td .cbadge { white-space: nowrap; } /* the Checklist flag stays on one line */
.ccm-row { display: flex; align-items: center; gap: 4px; }
.ccm-row .check { flex: 1; min-width: 0; }
@media (pointer: coarse) { .ccm-row .cm-btn { min-width: 36px; min-height: 36px; } }
/* The tick-box heading: no room for the resize padding or an ellipsis. */
.add-table th.sel-col { padding-right: 8px; text-overflow: clip; }
@media (pointer: coarse) { .add-table th.sel-col { padding-right: 8px; } }
.coll-table .sel-col input { width: 20px; height: 20px; }
.coll-table tr.selected td { background: color-mix(in srgb, var(--cm-info) 10%, transparent); }
.selbar[hidden] { display: none !important; }

/* Card details: a confirmed collection card shows a summary; the form is behind Edit details. */
#editor.view-mode .fields > :not(.ed-head):not(#ed-summary):not(#ed-error) { display: none !important; }
#editor.view-mode #ed-side-tools, #editor.view-mode #ed-swap, #editor.view-mode #ed-identify,
#editor.view-mode #ed-unconfirm, #editor.view-mode #ed-share { display: none !important; }
#editor:not(.view-mode) #ed-summary { display: none !important; }
/* Confirmed: the matching aids (checklist parallels, other versions, lookups) are done with. */
#editor.confirmed-card .ed-section[data-jump="lookup"], #editor.confirmed-card #ed-checklist-info, #editor.confirmed-card #ed-versions,
#editor.confirmed-card #ed-insert-info { display: none !important; }
#editor.collection-mode #ed-title-count { display: none; }
.ed-sec { margin: 6px 0 2px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card-summary { display: flex; flex-direction: column; gap: 10px; }
.card-summary .cs-player { margin: 0; font-size: 22px; line-height: 1.2; }
.card-summary .cs-line { color: var(--muted); line-height: 1.35; }
.card-summary .cs-line b { color: var(--text); font-weight: 600; }
.card-summary .cs-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.card-summary .cs-badges:empty { display: none; }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.cs-fact { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--cm-text) 4%, transparent); border: 1px solid color-mix(in srgb, var(--cm-text) 8%, transparent); min-width: 0; }
.cs-fact dt { font-size: 12px; color: var(--muted); }
.cs-fact dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.cs-fact dd small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.cs-fact.big dd { font-size: 20px; }
.cs-notes { white-space: pre-wrap; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--cm-text) 4%, transparent); }
.cs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-actions .star-on { color: var(--amber); }
/* A link styled as a button (Recent sales ↗) stretches with the row: keep its text centred like the buttons. */
.cs-actions a.btn { display: inline-flex; align-items: center; }
@media (max-width: 700px) { #editor.view-mode[open] { min-height: 100dvh; } }

/* My Collection front: count + Add, browse switch, search, one toolbar, Manage cards. */
.coll-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.coll-head .coll-count { margin-right: auto; font-weight: 600; }
.coll-head .coll-count .hint { font-weight: 400; }
.seg.coll-browse { display: flex; width: 100%; box-sizing: border-box; margin-bottom: 10px; }
.seg.coll-browse button { flex: 1; padding: 8px 6px; }
.coll-search { width: 100%; box-sizing: border-box; margin: 2px 0 10px; }
/* "Needs review: 3 new · 5 drafts" above the cards; each count picks that stage. */
.coll-review { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; font-size: 14px; }
.coll-review .cr-label { color: var(--muted); }
.coll-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.coll-toolbar .spacer { flex: 1; }
.coll-toolbar .btn, .coll-toolbar summary.btn { box-sizing: border-box; height: 36px; margin: 0; }
.coll-toolbar select.btn { width: auto; }
.coll-toolbar .col-menu { display: flex; align-items: center; }
.coll-toolbar .col-menu > div { top: 100%; }
.coll-filter-menu > div { left: 0; right: auto; width: 300px; }
.coll-filter-pop label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.coll-filter-pop .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
#coll-filter-n:not(:empty) { margin-left: 4px; color: var(--lime); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
#coll-select.on { background: var(--lime); color: var(--bg); border-color: var(--lime); }
.coll-cat-filters { font-size: 13px; }
.coll-groups .new-cat { border-style: dashed; }
/* Select mode: tiles toggle instead of opening. */
.coll-grid.selecting .ccard { position: relative; }
.ccard .ccheck { position: absolute; top: 8px; left: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--cm-brand-ice-white); background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; color: var(--bg); font-weight: 800; }
.ccard.selected { outline: 3px solid var(--lime); outline-offset: -3px; }
.ccard.selected .ccheck { background: var(--lime); border-color: var(--lime); }
.groups-row[hidden], .group-header[hidden] { display: none !important; }
.col-menu[hidden] { display: none !important; }
.coll-toolbar details { margin: 0; padding: 0; }
.coll-toolbar summary.btn { display: flex; align-items: center; padding: 0 14px; }
.coll-toolbar #coll-select, .coll-toolbar .icon-btn { padding-top: 0; padding-bottom: 0; }
.coll-toolbar #coll-sort { width: 9.5em; max-width: 46%; }

/* My Collection: + Add cards and Manage panels; categories and groups as a clean list. */
.coll-head #coll-manage-btn { margin-left: auto; }
.coll-head .coll-count { margin-right: 0; }
.count-badge { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--bg); color: var(--lime); font-size: 13px; line-height: 20px; text-align: center; }
.count-badge[hidden] { display: none; }
.coll-panel { margin-bottom: 12px; padding: 12px; border: 1px solid var(--lime); border-radius: 12px; background: color-mix(in srgb, var(--cm-accent) 4%, transparent); display: flex; flex-direction: column; gap: 12px; }
.coll-panel[hidden] { display: none !important; }
.coll-panel-head { display: flex; align-items: center; gap: 8px; }
.coll-panel-head b { font-size: 16px; }
.coll-step { display: flex; gap: 10px; align-items: flex-start; }
.coll-step .step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: var(--bg); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; margin-top: 2px; }
.coll-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.coll-step-body .dropzone { width: 100%; box-sizing: border-box; margin: 0; }
.coll-add-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.manage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.manage-btn { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
.manage-btn:hover { border-color: var(--lime); }
.manage-btn .hint { font-size: 12px; }
.browse-list { display: flex; flex-direction: column; margin-bottom: 8px; }
.browse-list[hidden] { display: none !important; }
.browse-row { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.browse-row:hover { background: color-mix(in srgb, var(--cm-text) 3%, transparent); }
.browse-row .br-thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; background: color-mix(in srgb, var(--cm-text) 6%, transparent); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.browse-row .br-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.browse-row .br-text { flex: 1; min-width: 0; }
.browse-row .br-name { font-weight: 700; font-size: 17px; }
.browse-row .br-name .hint { font-weight: 400; }
.browse-row .br-sub { font-size: 13px; }
.browse-row .br-go { color: var(--muted); font-size: 22px; }
.browse-row.add .br-thumb { border: 1px dashed var(--border); background: none; font-size: 24px; color: var(--muted); }
.browse-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.browse-head .back { padding-left: 8px; }
.browse-head .bh-name { font-size: 18px; font-weight: 700; }
#coll-cards-area[hidden] { display: none !important; }
.coll-panel-head .spacer, .browse-head .spacer { flex: 1; }

/* Collection header: value large with the card count under it; pill buttons with a round icon. */
.coll-head { align-items: center; flex-wrap: wrap; }
.coll-head .coll-count { display: flex; flex-direction: column; gap: 0; margin-right: auto; }
.cc-value { font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.cc-cards { font-size: 13px; color: var(--muted); font-weight: 500; }
.coll-head .coll-count .filter-chip { margin-top: 4px; align-self: flex-start; }
.coll-head #coll-manage-btn { margin-left: 0; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 5px 16px 5px 5px; height: auto; font-weight: 700; }
.pill-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--cm-text) 10%, transparent); }
.btn.primary .pill-ic { background: rgba(0, 0, 0, 0.14); }
.pill-ic svg { width: 18px; height: 18px; }
#coll-manage-btn.active { border-color: var(--lime); }
.pill-btn .count-badge { margin-left: 0; }
/* Favorites fold up to a single line. */
.fav-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fav-strip.closed .fav-head { margin-bottom: 0; }
.fav-chev { width: 14px; color: var(--muted); }
@media (max-width: 600px) {
  .coll-head .coll-count { width: 100%; margin-bottom: 4px; }
  .coll-head .pill-btn { flex: 1; justify-content: flex-start; }
}
.fav-chev { font-size: 16px; }

/* Card summary v2: header with Prev / Next / Close beside it, value panel, a spec sheet of details. */
@media (min-width: 801px) {
  #editor.view-mode .editor { position: relative; }
  #editor.view-mode .editor .dlg-nav { position: absolute; top: 18px; right: 18px; margin: 0; padding: 0; background: none; border: 0; }
  #editor.view-mode .fields > .ed-head { padding-right: 240px; min-height: 36px; }
}
.card-summary { gap: 12px; }
.card-summary .cs-player { font-size: 28px; letter-spacing: -0.01em; }
.card-summary .cs-line { font-size: 16px; color: var(--text); opacity: 0.85; margin-top: -6px; }
.cs-money { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.cs-value { flex: 1 1 200px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--cm-accent) 14%, transparent), color-mix(in srgb, var(--cm-accent) 3%, transparent)); border: 1px solid color-mix(in srgb, var(--cm-accent) 35%, transparent); }
.cs-amount { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--lime); }
.cs-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cs-mini { flex: 0 1 140px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--cm-text) 4%, transparent); border: 1px solid color-mix(in srgb, var(--cm-text) 8%, transparent); }
.cs-mini-amount { font-size: 20px; font-weight: 700; margin-top: 4px; }
.cs-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cs-spec-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 4px; }
.cs-spec { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid color-mix(in srgb, var(--cm-text) 8%, transparent); border-radius: 12px; overflow: hidden; }
.cs-row { padding: 10px 14px; border-bottom: 1px solid color-mix(in srgb, var(--cm-text) 6%, transparent); min-width: 0; }
.cs-row:nth-child(odd) { border-right: 1px solid color-mix(in srgb, var(--cm-text) 6%, transparent); }
.cs-row dt { font-size: 12px; color: var(--muted); }
.cs-row dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 330px) { .cs-spec { grid-template-columns: 1fr; } .cs-row:nth-child(odd) { border-right: 0; } }
.cs-actions .btn.primary { padding-left: 18px; padding-right: 18px; }
.coll-head .coll-count { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.cc-cards { font-size: 18px; font-weight: 600; }

/* Add tab, laid out like My Collection. */
#add-cards-area[hidden] { display: none !important; }
.add-stages { margin-bottom: 10px; }
.add-selbar { gap: 6px; }
.add-selbar b { margin-right: auto; }
.browse-row.closed { opacity: 0.6; }
.browse-row .br-bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--border); overflow: hidden; max-width: 220px; }
.browse-row .br-bar span { display: block; height: 100%; background: var(--lime); }
.browse-row .br-mark { flex: none; width: 56px; height: 56px; border-radius: 10px; background: color-mix(in srgb, var(--cm-text) 6%, transparent); display: flex; align-items: center; justify-content: center; font: 700 15px/1 var(--font-sans, inherit); color: var(--muted); }
.browse-row .br-mark b { color: var(--text); font-size: 18px; }
@media (max-width: 600px) { .add-stages { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .add-stages .chip { flex: none; } }

/* Inventory: all listings with stock state. */
.rs-title { font-weight: 600; margin: 0 0 4px; }
.ed-checklist-card { display: block; margin-top: 4px; }
.ed-checklist-card b { color: var(--text); }
.ed-checklist-card .good { color: var(--green); }
.ed-checklist-card .link-btn { margin-left: 6px; }
/* The other versions of the card number are in the Parallel and Insert drop-downs; no list here. */
#ed-versions { display: none !important; }

/* Group header: one line plus a short sales line. */
.gh-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gh-row h3 { margin: 0; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-row .spacer { flex: 1; }
.gh-row .back { flex: none; width: 36px; padding: 0; font-size: 18px; }
.gh-menu > div { right: 0; left: auto; top: 100%; width: 220px; }
.gh-menu summary.btn { font-size: 18px; line-height: 1; padding: 0 12px; }
.gh-profit { margin-top: 6px; font-size: 14px; }
.gh-profit .gh-cost { margin-left: 10px; }

/* Listings: All / Ended show the stock list instead of the active-listings table. */

.lst-head { margin-bottom: 10px; }

/* Listings: one table for All / Active / Ended. */
.banner-sync { white-space: nowrap; }
.sold-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.sold-bar[hidden] { display: none !important; }
.sold-bar select { width: auto; }
.live-table tr.out td:not(:first-child):not(:nth-child(2)) { opacity: 0.62; }
.live-table tr.out .live-thumb { filter: grayscale(0.7); }
.live-table .pill.out { background: var(--cm-status-pending-fill); color: var(--cm-status-pending-text); }
.live-table .pill.active { background: var(--cm-status-live-fill); color: var(--cm-status-live-text); }
/* Spreadsheet-style headers: tap for sort and filter. */
.live-table th.menu-head, .coll-table th.menu-head { cursor: pointer; user-select: none; }
.live-table th.menu-head:hover, .coll-table th.menu-head:hover { color: var(--text); }
.live-table th .head-caret, .coll-table th .head-caret { color: var(--muted); font-size: 11px; }
.live-table th.filtered, .coll-table th.filtered { color: var(--lime); box-shadow: inset 0 -2px 0 var(--lime); }
.live-table th .head-filter, .coll-table th .head-filter { display: inline-flex; margin-left: 4px; vertical-align: middle; }
.live-table th .head-filter svg, .coll-table th .head-filter svg { width: 12px; height: 12px; }
#col-filter .cf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#col-filter .cf-close { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 6px; }
#col-filter .cf-sorts { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
#col-filter .cf-sort { text-align: left; background: none; border: 0; color: var(--text); padding: 8px 6px; border-radius: 8px; cursor: pointer; font: inherit; }
#col-filter .cf-sort:hover { background: var(--panel-2, color-mix(in srgb, var(--cm-text) 6%, transparent)); }
#col-filter .cf-sort.on { color: var(--lime); font-weight: 600; }
#col-filter .cf-group { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 2px 0 6px; }
#col-filter .cf-quick { display: flex; gap: 14px; margin: 6px 2px; }
#col-filter.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 75vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 1000; box-shadow: 0 -12px 40px rgba(0, 0, 0, .45); }
#col-filter.sheet .cf-list { max-height: 40vh; }
#col-filter.sheet .cf-sort, #col-filter.sheet .cf-item { min-height: 40px; }

/* Run Standard Lookup: suggested changes to tick and apply. */
.relookup { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2, color-mix(in srgb, var(--cm-text) 3%, transparent)); }
.rl-rows { display: flex; flex-direction: column; gap: 4px; }
.rl-row { display: grid; grid-template-columns: auto 92px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.rl-field { color: var(--muted); font-size: 13px; }
.rl-old { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.rl-arrow { color: var(--muted); }
.rl-new { color: var(--lime); overflow-wrap: anywhere; }
.rl-notes { font-size: 13px; color: var(--amber); display: flex; flex-direction: column; gap: 4px; }
.rl-sources { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.rl-sources li.ok b { color: var(--text); }
.lookup-msg.ok { color: var(--lime); }
@media (max-width: 640px) { .rl-row { grid-template-columns: auto minmax(0, 1fr); } .rl-row .rl-old, .rl-row .rl-arrow { display: none; } .rl-row .rl-new { grid-column: 2; } }

/* Card editor: title with quick checks; lookup details folded at the bottom. */
.title-block { display: flex; flex-direction: column; gap: 4px; }
.title-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.qc-strip { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.qc { display: inline-flex; align-items: center; font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-family: inherit; white-space: nowrap; }
.qc.ok { color: var(--green); border-color: color-mix(in srgb, var(--cm-good) 35%, transparent); }
.qc.warn { color: var(--amber); border-color: color-mix(in srgb, var(--cm-warning) 45%, transparent); }
/* A long warning ("1991 Topps All-Star" isn't a set in 2025 Topps Series 2 Baseball) wraps inside the editor on a
   phone instead of running off its edge (verifier 2026-11-21). */
.qc { max-width: 100%; }
.qc.warn { white-space: normal; line-height: 1.25; text-align: left; }
/* Fields Ready to List needs: a dot before the name; amber outline while empty. */
#editor label.req { position: relative; }
#editor label.req::before { content: ""; position: absolute; left: -9px; top: 0.45em; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
#editor .req-empty { outline: 2px solid var(--amber); outline-offset: 1px; }
button.qc { cursor: pointer; }
button.qc:hover { background: var(--panel-2, color-mix(in srgb, var(--cm-text) 6%, transparent)); }
.lookup-details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.lookup-details[hidden] { display: none !important; }
.lookup-details > summary { cursor: pointer; font-size: 13px; color: var(--text); }
.lookup-details[open] > summary { margin-bottom: 8px; }
.lookup-details .identify { background: none; padding: 0; }

/* Help tips: a small ? that opens a short explanation (instead of long hints under fields). */
.help-tip { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--muted); font: 600 11px/1 inherit; cursor: pointer; vertical-align: middle; }
.help-tip:hover, .help-tip[aria-expanded="true"] { color: var(--text); border-color: var(--muted); }
.help-pop { position: absolute; z-index: 1100; max-width: min(320px, calc(100vw - 24px)); padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); font-size: 13px; line-height: 1.45; }
.help-pop[hidden] { display: none !important; }
.help-pop b { display: block; margin-bottom: 4px; }
.help-pop p { margin: 4px 0 0; color: var(--muted); }

/* Card editor sections: Card, Condition, Price, (Value), eBay listing, Storage, Notes. */
.ed-section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.ed-section:first-of-type { border-top: 0; margin-top: 4px; padding-top: 0; }
.ed-section[hidden] { display: none !important; }
.ed-section > .ed-sec { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ed-section .form-grid { margin: 8px 0; }
.ed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed-grid > label { min-width: 0; }
.ed-grid input, .ed-grid select { width: 100%; min-width: 0; box-sizing: border-box; }
/* The editor's drop-downs are as tall as the text boxes beside them (Mark 2026-11-23: Condition was shorter than
   Manufacturer; Safari draws its own select at a fixed height and ignores padding): our own arrow instead. */
#editor select { -webkit-appearance: none; appearance: none; line-height: inherit; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a96a8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 8px; }
/* Every box below the card details looks like the Card section's (2026-11-24): full width in its cell, and on a
   phone 16 px text (iPhone Safari zooms into anything smaller) with the same side padding. */
#editor .form-grid input, #editor .form-grid select { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 640px) {
  #editor input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), #editor select, #editor textarea { font-size: 16px; }
  #editor .form-grid input:not([type="checkbox"]), #editor .feat-add input { padding-left: 10px; padding-right: 10px; }
  #editor select { padding-left: 10px; }
}
/* Tick boxes keep their size (full width hid the "Graded" label next to it). */
.ed-grid input[type="checkbox"] { width: auto; }
@media (max-width: 640px) {
  .ed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ed-grid .span2-phone { grid-column: span 2; }
}
.ed-fold { margin: 8px 0; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.ed-fold > summary { cursor: pointer; font-size: 13px; color: var(--text); }
.ed-fold[open] > summary { margin-bottom: 6px; }
.ed-fold textarea { width: 100%; box-sizing: border-box; }
/* The pinned bar: card ID, status and save state on the left; Prev / Next / close on the right. */
.editor .dlg-nav { align-items: center; flex-wrap: wrap; row-gap: 6px; }
.dlg-id { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; }
.dlg-id .pill { margin: 0; }
#ed-pending:not([hidden]) { position: sticky; top: 52px; z-index: 5; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }

/* Editor actions (Ready to List…) on a second line of the pinned bar, on the right. */
.dlg-actions { flex-basis: 100%; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.dlg-actions:not(:has(> :not([hidden]))) { display: none; }
#ed-pending:not([hidden]) { top: var(--ed-nav-h, 52px); }
/* Price & Value (Mark 2026-11-23, order 2026-11-24): your price/value, quantity and the finish button → what eBay says (a quiet panel). */
.pv-ebay { margin: 12px 0 4px; padding: 12px 14px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.pv-ebay-head { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
/* The number, its source (wraps in the middle) and Use it on one row. */
.pv-sugg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; min-height: 32px; }
.pv-sugg > .hint:only-child { grid-column: 1 / -1; }
.pv-sugg .pv-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.pv-sugg .pv-src { font-size: 13px; }
.pv-sugg .pv-use { grid-column: 3; }
.pv-checked { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 8px; font-size: 13px; }
#ed-value-info.warn { color: var(--amber); }
.pv-ebay .price-check { margin: 0 0 4px; font-size: 13px; }
/* The Price Guide folds out inside the panel: a divider, not a box in a box. */
.pv-ebay .ed-fold { margin: 6px -14px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 8px 14px; }
.pv-ebay .price-guide { margin: 0; padding: 0; border: 0; background: none; }
#ed-value-info:empty { display: none; }
/* Value · Quantity · the finish button straight across, all the same height (Mark 2026-11-24): the button sits at the
   bottom of its grid cell, level with the boxes beside it (their labels sit above them). */
.ed-grid.price-grid { align-items: end; }
.ed-grid.price-grid input { height: 36px; box-sizing: border-box; }
.pv-finish { display: flex; align-items: flex-end; min-width: 0; }
.pv-finish .btn { width: 100%; height: 36px; padding: 0 14px; font-size: 15px; white-space: nowrap; }
.pv-finish:not(:has(> :not([hidden]))) { display: none; }
/* A narrow fields column (a tablet held upright: ~400 px beside the photos) can't fit three across: value · quantity,
   the button under them, as on a phone (code review 2026-11-24). */
.ed-section:has(> .price-grid) { container-type: inline-size; container-name: pv; }
/* A container's last margin no longer merges with the next section's: keep the usual gap above Features. */
.ed-section:has(> .price-grid) .pv-ebay { margin-bottom: 0; }
@container pv (max-width: 500px) {
  .ed-grid.price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-grid.price-grid .pv-finish { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  /* Under value and quantity on a phone (three don't fit at 375 px with − / +), full width, same height. */
  .ed-grid.price-grid .pv-finish { grid-column: 1 / -1; }
  .ed-grid.price-grid input, .pv-finish .btn { height: 40px; }
  .ed-grid.price-grid .qty-field input { width: 0; }
  .pv-sugg .pv-use { padding: 7px 16px; font-size: 14px; }
}
/* Package: Length · Width · Height across, then Weight · Type (every width). */
#editor .ed-grid.pkg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#editor .ed-grid.pkg-grid .pkg-type { grid-column: span 2; }
/* Notes: a label of its own; the label's line reads as the notes' heading. */
.ed-notes { margin: 8px 0; }
.ed-notes textarea { width: 100%; box-sizing: border-box; }

/* The card's details in pairs on phones (Mark 2026-11-23): Year · Set, Sport · Team, Card # · Player, Insert across
   the row, Parallel · Serial #, Manufacturer · Condition. 16 px text: iPhone Safari zooms the page into anything
   smaller when it's tapped. */
@media (max-width: 640px) {
  .ed-grid.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ed-grid.card-grid .ed-wide-phone { grid-column: 1 / -1; }
  .ed-grid.card-grid input, .ed-grid.card-grid select { padding-left: 10px; padding-right: 10px; font-size: 16px; }
  .ed-grid.card-grid select { padding-right: 30px; } /* room for the drop-down's arrow */
  .ed-grid.card-grid .combo input { padding-right: 34px; }
  .ed-grid.card-grid .combo-toggle { padding: 8px 10px; font-size: 16px; }
  /* Drop-down rows big enough for a finger. */
  .card-grid .combo-opt { padding: 11px 12px; font-size: 15px; min-height: 40px; box-sizing: border-box; align-items: center; }
  .card-grid .combo-panel { max-height: min(320px, 50vh); }
  /* A field moved up for its list stops under the editor's pinned bar. */
  .card-grid > label { scroll-margin-top: calc(var(--ed-nav-h, 52px) + 12px); }
}
/* A hidden field in the details (Franchise unless Sport is Entertainment) stays hidden: labels in a form grid are
   flex boxes, which overrode the hidden attribute. */
.ed-grid > [hidden] { display: none !important; }
/* A label's text and its checklist mark (✓ matches the checklist, ⚠ check it). */
.card-grid .lbl { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.ck-mark { font-size: 12px; font-weight: 700; line-height: 1; cursor: help; }
.ck-mark:empty { display: none; }
.ck-mark.ok { color: var(--green); }
.ck-mark.warn { color: var(--amber); }
/* Graded and Autograph ticks side by side; each opens its own fields. */
.ed-ticks { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 4px 0 8px; }
.ed-ticks label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-size: 15px; color: var(--text); min-height: 36px; }
.grading.off, .signing.off { display: none !important; }

@media (max-width: 640px) {
  .ed-grid.price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ed-grid.price-grid input { padding-left: 10px; padding-right: 10px; font-size: 16px; }
}
/* Checklist notes under Insert / Parallel stay one line (full text on hover), so rows stay even. */
.card-grid #ed-checklist-info, .card-grid #ed-insert-info { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* …except a note with a button ("It's in 2026 Topps Series 2 …", "Use it"): it wraps so it can be read and tapped. */
.card-grid #ed-insert-info:has(button) { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

/* Ready to List (and Back to Draft / Re-list) at the right end of the title line, above Rebuild. */
.title-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.title-actions:not(:has(> :not([hidden]))) { display: none; }

/* Graded row: grader, grade and cert only when Graded is ticked; a slab replaces Condition. */
#editor.graded-on label:has(> #f-condition) { display: none; }
.ed-grid label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
/* Favorite in the card grid beside Condition: at the boxes' height, level with them. */
#editor .ed-grid.card-grid label.fav-toggle { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; align-self: end; min-height: 40px; font-size: 15px; color: var(--text); white-space: nowrap; }
#editor .ed-grid.card-grid label.fav-toggle input { width: 18px; height: 18px; flex: none; margin: 0; }
/* Description previews: what buyers will read. */
.desc-preview { white-space: pre-wrap; font: 13px/1.5 inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 6px 0 10px; max-height: 240px; overflow: auto; }
.desc-preview:empty { display: none; }
.tpl-preview { margin: 4px 0 12px; }

/* Listings: Edit and Relist are one size, so the action column is the same width in every view. */
.live-table .act-btn { width: 64px; padding-left: 0; padding-right: 0; justify-content: center; text-align: center; }

/* Manage > Groups */
.grp-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.grp-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.grp-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.grp-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Checklists tab */
.ckl-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ckl-top h2 { margin: 0; }
.ckl-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ckl-filters select { flex: 1 1 110px; min-width: 0; }
/* The Sort box needs room for "Sort by release date (newest)": on a phone it wraps to its own line beside Clear filters. */
.ckl-filters #ckl-sort { flex: 1 1 240px; }
.ckl-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ckl-row .br-go { color: var(--muted); font-size: 20px; }
.ckl-mn { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; width: auto; margin: 0 0 10px; }
.ckl-mn input { width: auto; margin: 0; }
.ckl-sections { display: flex; flex-direction: column; gap: 8px; }
.ckl-sec { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; scroll-margin-top: 96px; } /* below the pinned top bar when scrolled to */
.ckl-sec summary { cursor: pointer; padding: 4px 0; }
.ckl-pars { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ckl-pars-box { margin: 8px 0; }
.ckl-pars-box > summary { color: var(--muted); font-size: 14px; }
.ckl-par { font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; }
.ckl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
/* Reported issues: a flag per card row, the report rows and their status pills. */
.ckl-flag-col { width: 32px; text-align: center; }
.ckl-ebay { display: inline-block; margin-left: 8px; font-size: 12px; white-space: nowrap; color: var(--muted); text-decoration: none; }
@media (max-width: 600px) { .ckl-ebay { display: block; margin: 2px 0 0; } }
.ckl-ebay:hover, .ckl-ebay:focus { color: var(--amber); text-decoration: underline; }
.ckl-flag { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; }
.ckl-flag:hover, .ckl-flag:focus { color: var(--amber); }
.ckl-top #ckl-reports-btn { margin-left: auto; }
.ckl-report-filters { margin: 8px 0 12px; }
.ckl-report-row { align-items: center; gap: 10px; }
.ckl-report-row .ckl-row-main { min-width: 0; }
.ckl-report-row .ckl-row-main .hint { overflow-wrap: anywhere; }
.pill.report-new { background: var(--cm-status-pending-fill); color: var(--cm-status-pending-text); }
.pill.report-accepted { background: var(--cm-status-live-fill); color: var(--cm-status-live-text); }
.pill.report-fixed { background: var(--cm-status-sold-fill); color: var(--cm-status-sold-text); }
.pill.report-rejected, .pill.report-duplicate { background: var(--cm-status-ended-fill); color: var(--cm-status-ended-text); }
.ckl-report-dlg { max-width: 520px; }
.ckl-report-dlg p { overflow-wrap: anywhere; }
.ckl-report-history { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; color: var(--muted); }
.ckl-ed-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ckl-ed-field .ui-input { margin-top: 0; }
.ckl-ed-field select { align-self: flex-start; }
.ckl-card-actions { flex-wrap: wrap; }
#ckl-pop { width: min(96vw, 900px); max-height: 90vh; padding: 0 16px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); overflow-y: auto; box-sizing: border-box; }
#ckl-pop::backdrop { background: var(--cm-overlay); }
.ckl-pop-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 0; background: var(--panel); }
.ckl-pop-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ckl-pop .ckl-sec, #ckl-pop .coll-search { scroll-margin-top: 64px; }
#ckl-pop-body { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 600px) {
  #ckl-pop { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  /* Phone: the whole checklist name on the first line (wrapping) beside ✕; "Open in Checklists tab" below it. */
  .ckl-pop-head { flex-wrap: wrap; }
  .ckl-pop-head b { flex: 1 1 calc(100% - 64px); white-space: normal; overflow-wrap: anywhere; }
  #ckl-pop-close { order: 1; }
  #ckl-pop-full { order: 2; }
}
.ckl-table-wrap { overflow-x: auto; max-width: 100%; }
.ckl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ckl-table th, .ckl-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ckl-table tr.mn td { background: color-mix(in srgb, var(--cm-accent) 7%, transparent); }
.ckl-table tr.focus td { background: color-mix(in srgb, var(--cm-accent) 22%, transparent); }
.qc.link { cursor: pointer; color: var(--text); }
#ed-set-note { color: var(--amber); font-size: 12px; }

/* Stage workflow: a batch's progress (Identifying / Listing N of M) above the stage chips. */
.stage-progress { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; font-size: 13px; }
.stage-progress .sp-text { min-width: 0; }
.stage-progress .ts-bar { flex: 1 1 120px; max-width: 360px; height: 8px; }
.stage-progress.done .sp-text { color: var(--lime); }

/* A checklist of only some teams' cards (spec v1.4). */
.ckl-teams { margin: 4px 0 0; color: var(--amber); font-size: 14px; overflow-wrap: anywhere; }

/* Editor photo boxes: a button that opens the photo pop-up. While a card's photo loads, the box shows its own
   dark background (never the previous card's photo). */
.ed-photo-btn { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; min-width: 0; }
.ed-photo-btn img.loading { visibility: hidden; }
.ed-photo-btn:has(img.loading) { background: var(--photo-bg); border-radius: 8px; }
.ed-photo-grid .ed-photo-open { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
/* The photo pop-up: as large as fits the screen. */
#photo-pop { width: min(96vw, 900px); max-height: 94vh; padding: 0 12px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); box-sizing: border-box; overflow: hidden; }
#photo-pop::backdrop { background: color-mix(in srgb, var(--cm-background) 85%, transparent); }
.photo-pop-head { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.photo-pop-head #photo-pop-count { flex: 1; min-width: 0; }
.photo-pop-body { display: flex; align-items: center; justify-content: center; gap: 6px; }
#photo-pop-img { display: block; max-width: 100%; max-height: calc(94vh - 70px); min-width: 0; flex: 1 1 auto; object-fit: contain; border-radius: 8px; background: var(--photo-bg); }
.photo-pop-nav { flex: none; font-size: 20px; padding: 6px 10px; }
@media (max-width: 600px) {
  #photo-pop { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  #photo-pop-img { max-height: calc(100dvh - 120px); }
  .photo-pop-body { position: relative; height: calc(100dvh - 64px); }
  .photo-pop-nav { position: absolute; top: 50%; transform: translateY(-50%); opacity: 0.85; }
  #photo-pop-prev { left: 4px; }
  #photo-pop-next { right: 4px; }
}

/* My Collection: progress and status under the header, whether or not a panel is open; no space when idle. */
.coll-activity { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; min-width: 0; }
.coll-activity:not(:has(#coll-progress:not([hidden]))):has(#coll-status:empty) { display: none; }
#coll-status { overflow-wrap: anywhere; }
#coll-status:empty { display: none; }
#coll-progress[hidden] { display: none; }

/* Checklists: six sports and All (spec 1.6): the sport tabs wrap onto a second row on a phone instead of
   squeezing ("Entertainment" stays readable). */
#ckl-sports { flex-wrap: wrap; justify-content: center; border-radius: 18px; row-gap: 2px; }
#ckl-sports button { flex: 0 0 auto; min-width: 0; white-space: nowrap; padding: 8px 14px; }
#ckl-sports .seg-break { flex-basis: 100%; height: 0; }

/* Collection: a card not matched to a checklist on file (amber), or not checked by a teams-only one (grey). */
.cbadge.match-warn { background: color-mix(in srgb, var(--cm-warning) 15%, transparent); border-color: color-mix(in srgb, var(--cm-warning) 55%, transparent); color: var(--amber); }
.cbadge.match-muted { color: var(--muted); }
.chip.warn-chip { border-color: color-mix(in srgb, var(--cm-warning) 55%, transparent); color: var(--amber); }
.chip.warn-chip.active { background: color-mix(in srgb, var(--cm-warning) 15%, transparent); }
/* Settings › CardSight switch and status; the Home notice while it's paused. */
.cardsight-control { margin: 6px 0 4px 22px; }
.cardsight-control .switch-row { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.warn-text { color: var(--amber); }

/* Card editor: More features (chips + add row); wraps at phone width. */
.more-features { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.feat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.feat-chips:empty { display: none; }
.feat-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 12px; max-width: 100%; overflow-wrap: anywhere; }
.feat-x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; min-width: 32px; min-height: 32px; cursor: pointer; }
.feat-x:hover { color: var(--text); }
.feat-add { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.feat-add select, .feat-add input { flex: 1 1 auto; min-width: 0; max-width: 420px; }
.feat-add [hidden] { display: none; }

/* Features: the yes/no boxes stay in the page for the rest of the app, not shown; Suggested chips. */
.checks.feat-boxes { display: none; }
.feat-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.feat-suggest[hidden] { display: none; }
.feat-sug { background: none; border: 1px dashed var(--border); border-radius: 999px; padding: 4px 12px; color: var(--muted); min-height: 32px; cursor: pointer; }
.feat-sug:hover { color: var(--text); border-color: var(--lime); }

/* Every table's Clear filters button: the same look everywhere; greyed out while nothing is filtered. */
.btn.clear-filters { white-space: nowrap; }
.btn.clear-filters:disabled { opacity: 0.45; cursor: default; }
.ckl-release-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0; }
.ckl-release-tools .ckl-mn { margin: 0; }
.ckl-release-top { margin: 8px 0 10px; }
/* Team sets and Unopened: sized columns on a computer; on a phone one column, so no Columns menu. */
.ts-table.sized { table-layout: fixed; }
.ts-table.sized td:first-child { min-width: 0; }
.ts-table.sized td { overflow-wrap: anywhere; }
@media (max-width: 700px) { #ts-cols-menu, #un-cols-menu { display: none; } }
.col-menu[hidden] { display: none !important; }
#ts-cols-menu > div, #un-cols-menu > div { width: 280px; max-height: min(70vh, 520px); overflow-y: auto; }

/* The editor's jump bar (2026-11-24): a row of section links on the pinned top bar; the section in view is lit. */
.ed-jump { flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; }
.ed-jump::-webkit-scrollbar { display: none; }
.ed-jump:empty, #editor.view-mode .ed-jump { display: none; }
.ed-jump a { flex: none; padding: 5px 10px; border-radius: 999px; font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.ed-jump a:hover { color: var(--text); background: color-mix(in srgb, var(--cm-text) 6%, transparent); }
.ed-jump a[aria-current] { color: var(--text); background: color-mix(in srgb, var(--cm-text) 10%, transparent); font-weight: 600; }
.ed-jump a:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }
/* A section jumped to stops just under the pinned bar. */
#editor .ed-section[data-jump] { scroll-margin-top: calc(var(--ed-nav-h, 52px) + 8px); }
@media (max-width: 640px) { .ed-jump { justify-content: space-between; } .ed-jump a { padding: 6px 8px; font-size: 14px; } }

/* ---------- Phone layout (design review 1, 2026-11-26) ---------- */
@media (max-width: 700px) {
  /* Add and My Collection: two cards across, shorter photos, titles up to three lines. */
  .grid, .coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile img { aspect-ratio: auto; height: 190px; }
  .tile .info { padding: 6px 8px 8px; }
  .tile .t { font-size: 12px; height: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .tile .sel { width: 24px; height: 24px; top: 6px; left: 6px; }
  .ccard-img img, .ccard-img .no-img { height: 160px; }
  .ccard-body { padding: 6px 8px 8px; }
  .ccard-title { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
/* Phone: the Listings table's checkboxes are bigger to tap (the table itself is as on a computer, sliding sideways). */
@media (max-width: 640px) { .live-table .sel-col input { width: 22px; height: 22px; } }
@media (min-width: 641px) {
  /* Long tables on a computer: the headings stay just under the top bar while the table scrolls with the page
     (--head-off is set as the page scrolls; app.js pinTableHeads). */
  .live-table thead th, .coll-table thead th { position: sticky; top: var(--head-off, 0px); z-index: 3; background: var(--panel); }
}
