/* LFT Monitor v4.2 — UI facelift
 *
 * Design system:
 *   - All surfaces/lines go through CSS variables so dark mode is coherent everywhere.
 *   - Type scale: 11 / 12 / 13 / 14 / 16 px. Numbers use tabular figures in tables.
 *   - Radii: 12 cards · 8 inner blocks/controls · 999 pills.
 *   - One accent (blue); gold is reserved exclusively for "MY ⭐" highlights.
 */
:root {
  --bg:        #f4f6f9;
  --card:      #ffffff;
  --surface:   #f7f9fc;            /* raised soft areas: table heads, filter bars   */
  --surface-2: #eef2f8;            /* hover tone on soft areas                      */
  --line:      #eef1f6;            /* row separators (lighter than --border)        */
  --ink:       #101828;
  --ink-soft:  #475467;
  --muted:     #667085;
  --faint:     #98a2b3;
  --border:    #e4e7ee;
  --green:     #16a34a;
  --green-soft:#e7f6ec;
  --green-ink: #15703c;
  --red:       #dc2626;
  --red-soft:  #fdecec;
  --red-ink:   #a02121;
  --blue:      #2563eb;
  --blue-soft: #e8f0fe;
  --blue-ink:  #1d4ed8;
  --amber:     #f59e0b;
  --amber-soft:#fdf3da;
  --amber-ink: #92510e;
  --gold:      #f5c711;
  --gold-soft: #fdf6d8;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 28px rgba(16, 24, 40, .10);
}
/* Dark mode — same variable names, dark values. Toggled via data-theme="dark" on <html>. */
html[data-theme="dark"] {
  --bg:        #0d1421;
  --card:      #16202f;
  --surface:   #1b2636;
  --surface-2: #223044;
  --line:      #223044;
  --ink:       #eef2f7;
  --ink-soft:  #c4cdda;
  --muted:     #94a3b8;
  --faint:     #64748b;
  --border:    #283649;
  --green-soft:#10341f;
  --green-ink: #6ee7a0;
  --red-soft:  #3c1414;
  --red-ink:   #f4a8a8;
  --blue-soft: #1c2f55;
  --blue-ink:  #93b4fd;
  --amber-soft:#3a2708;
  --amber-ink: #f3c66b;
  --gold-soft: #3a3008;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, .5);
}

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

body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background:  var(--bg);
  color:       var(--ink);
  font-size:   14px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.hd {
  background:    #101727;
  color:         #fff;
  padding:       10px 24px;
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  gap:           16px;
  position:      sticky;
  top:           0;
  z-index:       100;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.hd .brand     { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width:           32px;
  height:          32px;
  flex-shrink:     0;
  border-radius:   9px;
  background:      linear-gradient(135deg, #2563eb, #1d4ed8);
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  color:           #fff;
}
.brand-mark svg  { width: 18px; height: 18px; }
.hd h1           { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.hd h1 span      { color: #93b4fd; }
.hd .ver {
  font-size:     10px;
  font-weight:   600;
  color:         #aab4c4;
  background:    rgba(255, 255, 255, .09);
  padding:       2px 7px;
  border-radius: 999px;
  margin-left:   8px;
  vertical-align: 2px;
}
.actions   { display: flex; gap: 6px; align-items: center; }
.last-scan {
  font-size:     12.5px;
  color:         #aab4c4;
  white-space:   nowrap;
  margin-right:  8px;
  font-weight:   500;
}
.btn-icon {
  background:    transparent;
  color:         #c2cad6;
  width:         34px;
  height:        34px;
  padding:       0;                       /* override .btn padding — 8px/16px left only 2px for the icon */
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  cursor:        pointer;
  border:        none;
  border-radius: 8px;
  transition:    background .15s, color .15s;
}
.btn-icon svg    { width: 17px; height: 17px; flex-shrink: 0; }
.btn-icon svg[hidden] { display: none; }    /* [hidden] has no UA rule for inline SVG */
.btn-icon:hover  { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  padding:       8px 16px;
  border:        none;
  border-radius: 8px;
  font-size:     13px;
  font-weight:   600;
  font-family:   inherit;
  cursor:        pointer;
  transition:    background .15s, opacity .15s, transform .05s, border-color .15s;
}
.btn:active     { transform: scale(.98); }
.btn:disabled   { opacity: .55; cursor: not-allowed; transform: none; }
.btn-b          { background: var(--blue);  color: #fff; }
.btn-b:hover    { background: #1d4ed8; }
.btn-g          { background: var(--green); color: #fff; }
.btn-g:hover    { background: #15803d; }
.btn-s {
  background: var(--card);
  color:      var(--ink-soft);
  border:     1px solid var(--border);
  font-size:  12px;
  padding:    6px 12px;
}
.btn-s:hover    { background: var(--surface); border-color: var(--faint); }
.btn-tiny       { padding: 4px 10px; font-size: 11px; border-radius: 6px; }

/* ---------- Search + sort toolbar ---------- */
.other-toolbar {
  max-width: 1280px;
  margin:    16px auto 0;
  padding:   0 24px;
  display:   flex;
  gap:       10px;
  align-items: center;
}
.other-toolbar[hidden] { display: none; }
.other-search {
  flex:          1;
  padding:       10px 14px 10px 40px;
  font-size:     14px;
  font-family:   inherit;
  color:         var(--ink);
  border:        1px solid var(--border);
  border-radius: 10px;
  box-shadow:    var(--shadow-xs);
  background:    var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 14px center;
}
.other-search::placeholder { color: var(--faint); }
.other-search:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.sort-select {
  padding:       10px 12px;
  font-size:     13px;
  font-family:   inherit;
  border:        1px solid var(--border);
  border-radius: 10px;
  background:    var(--card);
  box-shadow:    var(--shadow-xs);
  color:         var(--ink);
  cursor:        pointer;
  min-width:     210px;
}

/* Primary All / Live status filter — segmented toggle */
.status-seg {
  display:       inline-flex;
  flex-shrink:   0;
  border:        1px solid var(--border);
  border-radius: 10px;
  overflow:      clip;
  background:    var(--card);
  box-shadow:    var(--shadow-xs);
}
.status-seg .seg-btn {
  border:      none;
  background:  transparent;
  color:       var(--muted);
  font:        inherit;
  font-size:   13px;
  font-weight: 600;
  padding:     10px 16px;
  cursor:      pointer;
  transition:  background .15s, color .15s;
}
.status-seg .seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.status-seg .seg-btn:hover       { background: var(--surface); }
.status-seg .seg-btn.active      { background: var(--blue); color: #fff; }
.status-seg .seg-btn[data-status="live"].active { background: var(--green); }
.status-seg .seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* Bulk-listing 🏠 Home-matches toggle */
.bl-filter-bar   { display: flex; align-items: center; gap: 8px; margin: 9px 0 5px; }
.bl-home-toggle  {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 600; line-height: 1;
  border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.bl-home-toggle:hover { border-color: var(--green); color: var(--ink); }
.bl-home-toggle.on    { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }

/* ---------- Main layout ---------- */
.ct      { max-width: 1280px; margin: 0 auto; padding: 14px 24px 90px; }
.muted   { color: var(--muted); font-weight: 400; font-size: 12px; }
.hint    { color: var(--faint); font-weight: 400; }

.empty {
  background:    var(--card);
  border:        1px dashed var(--border);
  padding:       44px 24px;
  border-radius: 12px;
  text-align:    center;
  color:         var(--muted);
}
.empty .empty-icon { font-size: 38px; margin-bottom: 8px; line-height: 1; }
.empty h2          { font-size: 16px; color: var(--ink-soft); margin: 4px 0 6px; }
.empty p           { font-size: 13.5px; line-height: 1.5; }
.empty-soft {
  margin:     16px 0;
  padding:    10px 14px;
  text-align: center;
  color:      var(--muted);
  font-size:  13px;
}

/* ---------- LTG Market Data: button on each card + modal ---------- */
.btn-market {
  flex-shrink:   0;
  border:        1px solid var(--border);
  background:    var(--card);
  border-radius: 8px;
  padding:       5px 9px;
  font-size:     14px;
  cursor:        pointer;
  margin-left:   8px;
  transition:    background .12s, border-color .12s;
}
.btn-market:hover { background: var(--blue-soft); border-color: var(--blue); }
.lm-tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.lm-tab {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.lm-tab:hover  { border-color: var(--faint); color: var(--ink-soft); }
.lm-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.lm-note { font-size: 12px; color: var(--muted); }
.lm-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.lm-toolbar .filter-input { min-width: 180px; }
.lm-table-wrap th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.lm-table-wrap th.th-sort:hover { color: var(--ink); background: var(--surface-2); }
.lm-table-wrap th.th-r { text-align: right; }
.lm-table-wrap { max-height: 56vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.lm-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lm-table-wrap th { position: sticky; top: 0; background: var(--surface); }
.lm-row-mine td { background: var(--gold-soft); }
.lm-mine { font-size: 10px; font-weight: 700; background: var(--gold); color: #4a3a05; padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.lm-low  { font-size: 10px; font-weight: 700; background: var(--green-soft); color: var(--green-ink); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.lm-th   { cursor: pointer; user-select: none; white-space: nowrap; }
.lm-scope { display: inline-flex; border: 1px solid var(--border, rgba(127,127,127,.35)); border-radius: 8px; overflow: hidden; }
.lm-scope-btn { background: none; border: none; padding: 5px 12px; cursor: pointer; font-size: 12.5px; color: inherit; }
.lm-scope-btn.active { background: var(--green); color: #fff; }
.lst-rowbtns { display: inline-flex; gap: 2px; margin-left: 4px; }
.lst-rowbtn  { background: none; border: none; cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 6px; opacity: .5; }
.lst-rowbtn:hover { opacity: 1; background: rgba(127,127,127,.15); }
.lst-rowbtn.lst-rule.on { opacity: 1; }

/* ---------- "Not yet on LFT" badge on a synthetic (just-created) ⭐ row ---------- */
.not-synced {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber-ink);
  vertical-align: 1px;
}

/* ---------- Event-search modal (Phase 2) ---------- */
#eventSearchModal .other-search { width: 100%; margin: 4px 0 12px; }
.es-results { max-height: 56vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.es-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.es-row:last-child { border-bottom: none; }
.es-row:hover { background: var(--surface); }
.es-row .es-main { flex: 1; min-width: 0; }
.es-row .es-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.es-row .btn-tiny { flex-shrink: 0; }
.es-mine { font-size: 10.5px; color: var(--green-ink); background: var(--green-soft); padding: 1px 7px; border-radius: 999px; margin-left: 6px; }

/* ---------- Bulk listing ---------- */
.es-results .bl-row { cursor: pointer; }
.bl-row .bl-check { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--blue); cursor: pointer; }
.bl-selected-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 12px 0 2px; padding: 9px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--blue) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--border));
  font-size: 13px;
}
.bl-sel-count { font-weight: 600; flex-shrink: 0; }
.bl-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.bl-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 6px 2px 10px; font-size: 11.5px; color: var(--ink-soft); max-width: 240px;
}
.bl-chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-chip button { border: none; background: none; cursor: pointer; color: var(--faint); font-size: 12px; line-height: 1; padding: 0 2px; }
.bl-chip button:hover { color: var(--red); }
.bl-form-note { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.bl-progress { margin-top: 10px; }
.bl-summary { font-size: 13px; padding: 8px 0; }
.bl-summary strong { color: var(--green-ink); }
.bl-fail { font-size: 12px; color: var(--red-ink); margin-top: 4px; }

/* Bulk post-upload report (success/fail per match + retry-failed) */
.bl-report { margin-top: 10px; }
.bl-report-head { display: flex; gap: 14px; align-items: center; font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.bl-rep-okn { color: var(--green-ink); }
.bl-rep-failn { color: var(--red-ink); }
.bl-report-list { display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; padding-right: 2px; }
.bl-rep-row { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 7px; font-size: 12.5px; }
.bl-rep-ok { background: var(--green-soft); }
.bl-rep-fail { background: var(--red-soft); }
.bl-rep-ic { font-weight: 800; flex: 0 0 auto; }
.bl-rep-ok .bl-rep-ic { color: var(--green-ink); }
.bl-rep-fail .bl-rep-ic { color: var(--red-ink); }
.bl-rep-name { flex: 1 1 auto; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-rep-tag { flex: 0 0 auto; color: var(--green-ink); font-size: 11px; font-weight: 700; }
.bl-rep-msg { flex: 0 1 auto; color: var(--red-ink); font-size: 11px; max-width: 52%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#vgBlRetry { margin-top: 12px; }
.bl-report-done { margin-top: 10px; color: var(--green-ink); font-weight: 700; }

/* Bulk confirm — chips listing every selected match */
.bl-confirm-matches { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; max-height: 150px; overflow-y: auto; }
.bl-confirm-chip { background: var(--surface-2); border-radius: 6px; padding: 3px 8px; font-size: 11.5px; font-weight: 600; }

/* ---------- Add-listing modal ---------- */
.al-grid { display: flex; gap: 12px; }
.al-autoprice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.al-autoprice-head { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.al-market { margin-top: 16px; }
.al-market-cols { display: flex; gap: 12px; margin-top: 8px; }
.al-market-col { flex: 1; min-width: 0; }
.al-col-title { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.al-market-body .lm-table-wrap { max-height: 30vh; }
.al-market-body table { font-size: 11.5px; }
.al-market-body th, .al-market-body td { padding: 6px 8px; }
#addListingModal .modal-box { width: 860px; }
.al-grid .al-col { flex: 1; min-width: 0; }
#addListingModal .modal-box { width: 560px; }

/* Required-field highlight (Or 2026-07-06): a bold RED asterisk + a soft red tint on the field itself.
   Mark a field required by adding class `req` to its .al-col wrapper (label + input are siblings), or
   `req` to an inline <label> (with a <span class="req-star">*</span> after its text). Theme vars adapt
   in dark mode. Optional fields keep the faint `.hint` "(optional)". Applied uniformly across all forms. */
.al-col.req > label::after { content: " *"; color: var(--red); font-weight: 800; }
.req-star { color: var(--red); font-weight: 800; margin-left: 2px; }
.al-col.req input, .al-col.req select,
label.req input, label.req select {
  border-color: var(--red);
  background: var(--red-soft);
}
.al-col.req input:focus, .al-col.req select:focus,
label.req input:focus, label.req select:focus { border-color: var(--red); }
.evt-section-label .al-add-btn { margin-left: 10px; text-transform: none; letter-spacing: 0; vertical-align: 1px; }
.btn-del { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 3px 7px; }
.btn-del:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }

/* ---------- Partial-market note (SSR-embedded listings, not full API) ---------- */
.partial-note {
  margin:        8px 16px 0;
  padding:       8px 12px;
  font-size:     12px;
  line-height:   1.4;
  color:         var(--amber-ink);
  background:    var(--amber-soft);
  border-radius: 8px;
}
.partial-note.ltg { color: var(--blue-ink); background: var(--blue-soft); }

/* ---------- Date groups (Today / Tomorrow / This week / …) — framed, color-coded sections ---------- */
.date-group {
  margin:        28px 0 0;
  border:        1px solid var(--border);
  border-radius: 14px;
  background:    color-mix(in srgb, var(--surface) 55%, var(--bg));
  overflow:      clip;                                /* clip (not hidden) — keeps sticky event headers viewport-bound */
  box-shadow:    var(--shadow-xs);
}
.date-group:first-child { margin-top: 6px; }
.date-group-header {
  display:        flex;
  align-items:    center;
  gap:            9px;
  padding:        11px 16px;
  font-size:      13px;
  font-weight:    800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color:          var(--ink);
  background:     var(--card);
  border-bottom:  1px solid var(--border);
  border-left:    5px solid var(--blue);              /* accent bar — recolored per tier below */
}
.date-group-header .dgh-icon  { font-size: 16px; line-height: 1; }
.date-group-header .dgh-label { flex: 0 0 auto; }
.date-group-header .dgh-count {
  margin-left:    auto;                               /* push the count to the right edge */
  background:     var(--surface-2);
  color:          var(--muted);
  border:         1px solid var(--border);
  font-size:      11px;
  font-weight:    700;
  padding:        2px 10px;
  border-radius:  999px;
  letter-spacing: 0;
}
.date-group-body { display: flex; flex-direction: column; gap: 14px; padding: 10px; }
.date-group-body .other-event { margin-bottom: 0; }   /* spacing handled by the flex gap */

/* Today — urgent red */
.date-group.is-today {
  border-color: color-mix(in srgb, var(--red) 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 22%, transparent), var(--shadow-sm);
}
.date-group-header.is-today { background: var(--red-soft); color: var(--red-ink); border-left-color: var(--red); }
.date-group-header.is-today .dgh-count { background: var(--red); color: #fff; border-color: transparent; }

/* Tomorrow — amber */
.date-group.is-soon { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.date-group-header.is-soon { background: var(--amber-soft); color: var(--amber-ink); border-left-color: var(--amber); }
.date-group-header.is-soon .dgh-count { background: var(--amber); color: #3a2708; border-color: transparent; }

/* ---------- Event cards ---------- */
.other-event {
  background:    var(--card);
  border-radius: 12px;
  margin-bottom: 10px;
  /* clip (NOT hidden): keeps the rounded-corner clipping without creating a scroll
     container, so position:sticky inside still sticks to the viewport. */
  overflow:      clip;
  border:        1px solid var(--border);
  box-shadow:    var(--shadow-xs);
  transition:    box-shadow .18s ease, transform .18s ease, border-color .18s ease, margin-bottom .2s;
}
.other-event:not(.open):hover {
  box-shadow:   var(--shadow-sm);
  transform:    translateY(-1px);
  border-color: color-mix(in srgb, var(--blue) 28%, var(--border));
  cursor:       pointer;
}
/* Open card = clearly framed: crisp 2px-looking blue ring (border + 1px shadow ring,
   so the layout doesn't shift) + lifted shadow + extra gap from the next card. */
.other-event.open {
  border-color:  var(--blue);
  box-shadow:    0 0 0 1px var(--blue), var(--shadow-md);
  margin-bottom: 28px;
}
/* Listing-centric cards — each event is a clearly framed, elevated unit so the eye reads
   the boundaries between events at a glance. (The card isn't clickable as a whole — only
   its rows are — so no pointer/lift on hover, just a gentle edge highlight.) */
.other-event.listing-centric {
  border-radius: 14px;
  border:        1px solid color-mix(in srgb, var(--ink) 22%, var(--border));
  box-shadow:    var(--shadow-sm);
}
.other-event.listing-centric:hover {
  transform:    none;
  cursor:       default;
  border-color: color-mix(in srgb, var(--blue) 32%, var(--border));
  box-shadow:   var(--shadow-md);
}
.other-head {
  padding:     12px 16px;
  display:     flex;
  align-items: center;
  gap:         13px;
  cursor:      pointer;
  transition:  background .15s;
}
.other-head:hover             { background: var(--surface); }
.other-event.open .other-head {
  background:    color-mix(in srgb, var(--blue) 5%, var(--card));
  border-bottom: 1px solid var(--border);
  /* Sticky below the page header — offsets are MEASURED into --hd-h by
     updateStickyVars(), never hardcoded (see the 2026-06 hidden-row bug). */
  position:      sticky;
  top:           var(--hd-h, 48px);
  z-index:       20;
}
.other-event.open .other-head:hover { background: color-mix(in srgb, var(--blue) 9%, var(--card)); }
.other-head .arrow {
  font-size:   9px;
  color:       var(--faint);
  transition:  transform .2s;
  flex-shrink: 0;
}
.other-event.open .other-head .arrow { transform: rotate(90deg); }
.other-head .other-info   { flex: 1; min-width: 0; }
.other-head .other-name   { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.other-head .other-league { font-size: 12px; font-weight: 500; color: var(--muted); margin: 1px 0; display: flex; align-items: center; gap: 5px; }
.other-head .other-meta   { font-size: 12px; color: var(--faint); }
.league-glyph             { font-size: 11px; opacity: .9; }
.flag-img {
  width:         18px;
  height:        13px;
  flex-shrink:   0;
  object-fit:    cover;
  border-radius: 2px;
  box-shadow:    0 0 0 1px rgba(0, 0, 0, .12);
  vertical-align: -2px;
}

/* ---------- Listing-centric view: static event header + expandable listing rows ---------- */
/* The event header no longer toggles — it's a sticky label above its always-visible rows. */
.other-head.static {
  cursor:        default;
  position:      sticky;
  top:           var(--hd-h, 48px);
  z-index:       20;
  /* A distinct title bar so the top of each event reads clearly as its header. */
  background:    color-mix(in srgb, var(--blue) 9%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, var(--border));
}
.other-head.static:hover { background: color-mix(in srgb, var(--blue) 9%, var(--surface)); }

.evt-listings { display: flex; flex-direction: column; gap: 8px; padding: 7px 8px 9px; }

/* The checkbox that selects a listing for a bulk action (sizing + accent; spacing via .lst-sec-wrap). */
.lst-check { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }

.lst-status { display: inline-flex; cursor: pointer; }
.lst-status:hover .pill { filter: brightness(1.06); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 25%, transparent); }
/* A 6px state dot makes status pre-attentive (scoped to listing rows — global pills unchanged). */
.lst-status .pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; }
.lst-status .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.lst-status .pill-live::before   { background: var(--green); }
.lst-status .pill-paused::before { background: var(--amber); }
.lst-status .pill-empty::before  { background: var(--green); opacity: .45; }

.lst-cat { min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lst-cat small { margin-left: 6px; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }

.lst-qty   { justify-self: end; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lst-qty b { font-weight: 600; color: var(--ink-soft); }

.lst-price { justify-self: end; display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lst-price .cur  { font-size: 10.5px; font-weight: 600; color: var(--faint); }
.lst-price .amt  { font-size: 14px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.lst-price .lock { align-self: center; margin-left: 1px; font-size: 11px; }

.lst-pos {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--muted);
}
.lst-pos .sep   { margin: 0 1px; font-weight: 400; color: var(--faint); }
.lst-pos .delta { font-weight: 500; opacity: .85; }
.lst-pos.lead     { background: var(--green-soft); color: var(--green-ink); }
.lst-pos.undercut { background: var(--red-soft);   color: var(--red-ink); }
.lst-pos.undercut .sep { color: color-mix(in srgb, var(--red-ink) 60%, transparent); }
.lst-pos.neutral  { background: var(--surface-2); color: var(--muted); }
.lst-pos.muted    { background: transparent; color: var(--faint); font-weight: 500; padding-inline: 0; }

/* ---------- viagogo-style listings TABLE: Section · Delivery · Avail · Sell-as · Price · Status ---------- */
.lst-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.lst-table thead th {
  text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--faint); padding: 2px 12px 6px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.lst-table thead th.lst-td-avail { text-align: right; }
.lst-tr { cursor: pointer; }
.lst-tr > td { padding: 7px 12px; vertical-align: middle; border-top: 1px solid var(--border); }
.lst-tr:hover > td        { background: color-mix(in srgb, var(--blue) 5%, transparent); }
.lst-tr.open  > td        { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.lst-tr.row-selected > td { background: color-mix(in srgb, var(--blue) 9%, var(--card)); box-shadow: inset 3px 0 0 var(--blue); }
.lst-tr.row-paused        { opacity: .58; }
.lst-tr.row-empty .lst-price .amt { color: var(--faint); }
.lst-sec-wrap, .lst-price-wrap, .lst-status-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.lst-tr .arrow { font-size: 9px; color: var(--faint); transition: transform .18s ease; flex: none; }
.lst-tr.open .arrow { transform: rotate(90deg); }
.lst-td-avail  { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }
.lst-td-del, .lst-td-sellas, .lst-td-seating { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lst-del-btn:hover { background: var(--red-soft); }
/* ✏️ edit-fields flash — a brief highlight so the eye lands on the just-opened Options editor */
.lst-detail.flash-edit { animation: lstEditFlash 1.2s ease-out 1; }
@keyframes lstEditFlash { 0% { background: var(--green-soft); } 100% { background: transparent; } }
.lst-detail-tr > td { padding: 0; }

/* Expanded detail: options (left) + the category's competitor market (right). */
.lst-detail {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(210px, 1fr) 1.7fr; gap: 16px;
  padding: 12px 14px; border-top: 1px dashed var(--border);
  background: var(--surface);
}
.lst-detail-col   { min-width: 0; }
.lst-detail-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 9px; }
/* Options laid out HORIZONTALLY (auto-fit grid, label above value) to save vertical space. */
.lst-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 10px 16px; align-items: start; }
.lst-opt  { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 13px; min-width: 0; }
.lst-opt > label { width: auto; color: var(--faint); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.lst-opt .price-cell, .lst-opt .editable-cell, .lst-opt .price-cell-locked { display: inline-block; padding: 2px 8px; border-radius: 6px; max-width: 100%; }
/* Listing action buttons — minimal icon-only style, identical to FTN's row buttons. */
.lst-opt .lst-gear, .lst-opt .lst-del {
  background: none; border: none; cursor: pointer; font-size: 15px; line-height: 1;
  padding: 1px 4px; border-radius: 5px; opacity: .6; transition: opacity .12s, background .12s;
}
.lst-opt .lst-gear:hover, .lst-opt .lst-del:hover { opacity: 1; }
.lst-opt .lst-gear.has-rule { opacity: 1; background: var(--green-soft); }

/* Per-row Market Data: the competing listings in the listing's category (from the scan). */
.lst-mkt-cat { font-weight: 600; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.lst-mkt-cnt { font-weight: 500; font-size: 10.5px; color: var(--faint); text-transform: none; letter-spacing: 0; }
.lst-mkt-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lst-mkt-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--faint); padding: 3px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lst-mkt-table td { padding: 4px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); font-variant-numeric: tabular-nums; }
.lst-mkt-table tbody tr:last-child td { border-bottom: none; }
.lst-mkt-table .r, .lst-mkt-table th.r { text-align: right; }
.lst-mkt-table .c, .lst-mkt-table th.c { text-align: center; width: 22px; padding-left: 0; padding-right: 0; }
.lst-mkt-table tr.lm-row-mine td { background: var(--gold-soft); font-weight: 600; }
.lst-mkt-table tr.lm-row-mine td.c { box-shadow: inset 3px 0 0 var(--gold); }
html[data-theme="dark"] .lst-mkt-table tr.lm-row-mine td { background: #3a3008; color: #f3d96b; }
.lst-mkt-table tr.threat td.c { color: var(--red); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--red) 45%, transparent); }
.lst-market-empty { font-size: 12.5px; color: var(--muted); padding: 8px 4px; }

body.compact .lst-detail { padding: 9px; gap: 11px; }
@media (max-width: 760px) {
  .lst-detail { grid-template-columns: 1fr; }
}

/* Alert strip on a card whose listing was undercut */
.other-event.not-cheapest::before {
  content:       "Not cheapest — a competitor undercut you";
  display:       block;
  background:    var(--red-soft);
  color:         var(--red-ink);
  padding:       6px 12px;
  font-size:     11.5px;
  font-weight:   600;
  text-align:    center;
  letter-spacing: .02em;
}
.match-error {
  padding:    12px 16px;
  background: var(--red-soft);
  color:      var(--red-ink);
  font-size:  12px;
}

/* ---------- Team logo badge ---------- */
.team-logo {
  width:           36px;
  height:          36px;
  flex-shrink:     0;
  border-radius:   50%;
  background:      var(--surface);
  border:          1px solid var(--border);
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  font-size:       12px;
  font-weight:     700;
  color:           var(--muted);
  overflow:        hidden;
}
.team-logo.has-img { background: #fff; }
.team-logo img     { width: 100%; height: 100%; object-fit: contain; padding: 2px; }

/* ---------- Countdown chip ---------- */
.evt-countdown {
  flex-shrink:   0;
  background:    var(--blue-soft);
  color:         var(--blue-ink);
  font-weight:   600;
  font-size:     12.5px;
  padding:       6px 12px;
  border-radius: 999px;
  white-space:   nowrap;
  font-variant-numeric: tabular-nums;
}
.evt-countdown.is-today {
  background: var(--red-soft);
  color:      var(--red-ink);
  border:     1px solid color-mix(in srgb, var(--red) 30%, transparent);
  animation:  todayPulse 2.4s ease-in-out infinite;
}
.evt-countdown.is-soon { background: var(--amber-soft); color: var(--amber-ink); }
.evt-countdown .badge-today,
.evt-countdown .badge-tomorrow {
  display:        inline-block;
  margin-right:   6px;
  padding:        1px 6px;
  border-radius:  4px;
  color:          #fff;
  font-weight:    700;
  font-size:      10px;
  letter-spacing: .5px;
}
.evt-countdown .badge-today    { background: var(--red); }
.evt-countdown .badge-tomorrow { background: var(--amber); }
@keyframes todayPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 30%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 0%, transparent); }
}
.row-spacer { flex: 1; }

/* Tracking star */
.track-star {
  flex-shrink: 0;
  font-size:   20px;
  line-height: 1;
  cursor:      pointer;
  color:       color-mix(in srgb, var(--faint) 55%, transparent);
  transition:  color .15s, transform .1s;
}
.track-star:hover { color: var(--amber); transform: scale(1.12); }
.track-star.on    { color: var(--gold); }

/* ---------- Section label + separators inside an open card ---------- */
.evt-section-label {
  padding:        12px 16px 6px;
  font-size:      11px;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color:          var(--faint);
}
.evt-divider { height: 8px; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evt-gap     { height: 6px; }

/* ---------- Tables (shared) ---------- */
table {
  width:           100%;
  border-collapse: collapse;
  font-size:       13px;
  background:      var(--card);
}
thead th {
  background:      var(--surface);
  padding:         9px 14px;
  text-align:      left;
  font-weight:     600;
  font-size:       11px;
  text-transform:  uppercase;
  letter-spacing:  .06em;
  color:           var(--muted);
  border-bottom:   1px solid var(--border);
  white-space:     nowrap;
}
tbody td {
  padding:       10px 14px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td      { border-bottom: none; }
tbody tr:hover td           { background: var(--surface); }
tbody tr.row-empty td       { color: var(--faint); }
tbody tr.row-selected td    { background: var(--blue-soft); }

/* Market table: numbers right-aligned (cols: ⭐ Block Price Qty Seating Shipping Seller) */
.cat-body th:nth-child(3), .cat-body td:nth-child(3),
.cat-body th:nth-child(4), .cat-body td:nth-child(4) { text-align: right; }
.cat-body td:nth-child(3) { font-weight: 600; }

/* My-listings table: Qty(5) + Price(6) right-aligned */
.my-table-wrap th:nth-child(5), .my-table-wrap td:nth-child(5),
.my-table-wrap th:nth-child(6), .my-table-wrap td:nth-child(6) { text-align: right; }
.my-table-wrap td:nth-child(6) { font-weight: 600; }

.my-table-wrap {
  margin:        4px 16px 16px;
  border:        1px solid var(--border);
  border-radius: 10px;
  overflow:      hidden;
  background:    var(--card);
}

/* ---------- Pills & chips ---------- */
.pill {
  display:       inline-block;
  padding:       3px 10px;
  border-radius: 999px;
  font-size:     11px;
  font-weight:   600;
  letter-spacing: .02em;
}
.pill-live   { background: var(--green-soft); color: var(--green-ink); }
.pill-paused { background: var(--amber-soft); color: var(--amber-ink); }
.pill-empty  { background: var(--surface-2);  color: var(--muted); }
.pill-mine   { background: var(--gold);       color: #4a3a05; }
.pill-rule   { background: var(--blue-soft);  color: var(--blue-ink); }

.pill-live { position: relative; }
.pill-live::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: livePulse 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in srgb, var(--green) 45%, transparent); }
  70%  { box-shadow: 0 0 0 6px color-mix(in srgb, var(--green)  0%, transparent); }
  100% { box-shadow: 0 0 0 0   color-mix(in srgb, var(--green)  0%, transparent); }
}

.chip-sellas {
  display:        inline-block;
  padding:        2px 9px;
  border-radius:  999px;
  font-size:      11px;
  font-weight:    600;
  white-space:    nowrap;
}
.chip-sellas-singles  { background: var(--amber-soft); color: var(--amber-ink); }
.chip-sellas-pairs    { background: var(--green-soft); color: var(--green-ink); }
.chip-sellas-fullset  { background: var(--blue-soft);  color: var(--blue-ink); }
.chip-sellas-avoid    { background: var(--gold-soft);  color: var(--amber-ink); }
.chip-sellas-other    { background: var(--surface-2);  color: var(--ink-soft); }

.price-delta {
  display:        inline-block;
  margin-left:    6px;
  font-size:      10px;
  font-weight:    700;
  vertical-align: middle;
}
.price-delta.up   { color: var(--red); }
.price-delta.down { color: var(--green); }
.price-delta.flat { color: var(--faint); }

/* ---------- Stats strip ---------- */
.stats {
  display:       grid;
  grid-template-columns: repeat(5, 1fr);
  background:    var(--card);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding:    12px 16px 14px;
  text-align: center;
}
.stat + .stat { border-left: 1px solid var(--line); }
.stat .label {
  font-size:      10.5px;
  color:          var(--faint);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight:    600;
  margin-bottom:  3px;
}
.stat .value {
  font-size:   18px;
  font-weight: 700;
  color:       var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat .value.mine { color: var(--blue); }
.stat .value.good { color: var(--green); }

/* ---------- Per-event filter bar ---------- */
.evt-filters {
  display:       flex;
  flex-wrap:     wrap;
  gap:           14px;
  align-items:   center;
  padding:       10px 16px;
  background:    var(--surface);
  border-bottom: 1px solid var(--line);
}
.filter-group { display: flex; align-items: center; gap: 5px; }
.filter-label {
  font-size:      10.5px;
  color:          var(--faint);
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right:   3px;
}
.chip {
  background:    var(--card);
  border:        1px solid var(--border);
  padding:       5px 13px;
  border-radius: 999px;
  font-size:     12px;
  font-family:   inherit;
  cursor:        pointer;
  font-weight:   600;
  color:         var(--muted);
  transition:    .15s;
}
.chip:hover  { border-color: var(--faint); color: var(--ink-soft); }
.chip-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.filter-input {
  border:        1px solid var(--border);
  padding:       5px 10px;
  border-radius: 7px;
  font-size:     12px;
  font-family:   inherit;
  width:         76px;
  background:    var(--card);
  color:         var(--ink);
}
.filter-input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.evt-filters .filter-num { width: 76px; }

/* ---------- Category accordions ---------- */
.cats { padding: 10px 16px 16px; }
.cat {
  margin-top:    8px;
  border:        1px solid var(--border);
  border-radius: 10px;
  overflow:      clip;                       /* clip, not hidden — sticky-safe */
  background:    var(--card);
}
.cat-head {
  padding:     10px 14px;
  display:     flex;
  align-items: center;
  gap:         10px;
  cursor:      pointer;
  font-size:   13.5px;
  font-weight: 600;
  background:  var(--card);
  transition:  background .12s;
}
.cat-head:hover  { background: var(--surface); }
/* Open category = framed like the open card, one step subtler (visual hierarchy). */
.cat.open {
  border-color: color-mix(in srgb, var(--blue) 60%, var(--border));
  box-shadow:   0 0 0 1px color-mix(in srgb, var(--blue) 35%, transparent), var(--shadow-sm);
}
.cat.open .cat-head {
  border-bottom: 1px solid var(--line);
  background:    color-mix(in srgb, var(--blue) 4%, var(--card));
  /* Sticks right below the page header + this card's (stuck) event head. */
  position:      sticky;
  top:           calc(var(--hd-h, 48px) + var(--eh, 56px));
  z-index:       5;
}
.cat-head .arrow {
  font-size:  9px;
  color:      var(--faint);
  transition: transform .2s;
}
.cat.open .cat-head .arrow { transform: rotate(90deg); }
.cat-name { flex: 1; min-width: 0; }
.cat-meta { font-size: 12px; color: var(--muted); font-weight: 400; display: flex; align-items: center; gap: 14px; }
.cat-listings-badge {
  background:    var(--blue-soft);
  color:         var(--blue-ink);
  font-weight:   700;
  font-size:     11.5px;
  padding:       3px 10px;
  border-radius: 999px;
  white-space:   nowrap;
}
.cat-meta-item  { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cat-meta-label { font-weight: 600; color: var(--faint); font-size: 11px; }
.cat-body  { display: none; }
.cat.open .cat-body { display: block; }

/* MINE row in the market table — gold accent. Explicit padding so the row can never
   collapse due to other rules (see the 2026-06 hidden-row bug). Scoped to .cat-body
   so it never leaks into the MY-LISTINGS table at the top of the card. */
.cat-body tbody tr.mine td {
  background:   var(--gold-soft);
  font-weight:  600;
  color:        #4a3a05;
  padding:      10px 14px;
  line-height:  1.4;
}
.cat-body tbody tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.cat-body tbody tr.mine:hover td               { background: color-mix(in srgb, var(--gold) 22%, var(--card)); }
html[data-theme="dark"] .cat-body tbody tr.mine td       { background: #3a3008; color: #f3d96b; }
html[data-theme="dark"] .cat-body tbody tr.mine:hover td { background: #4a3d0c; }

/* ---------- Inline cell editing (my-listings table) ---------- */
.status-cell { cursor: pointer; }
.status-cell:hover .pill { filter: brightness(1.06); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 25%, transparent); }
.price-cell, .editable-cell {
  cursor:        cell;
  border-bottom: 1px dashed transparent;
}
.price-cell { cursor: text; }
.price-cell:hover, .editable-cell:hover {
  background:          color-mix(in srgb, var(--blue) 7%, var(--card)) !important;
  border-bottom-color: var(--blue);
}
.price-cell-locked {
  cursor:    not-allowed;
  color:     var(--muted);
  font-size: 12.5px;
}
.price-edit-input {
  width:         90px;
  padding:       4px 8px;
  font-size:     13px;
  font-family:   inherit;
  font-weight:   600;
  border:        2px solid var(--blue);
  border-radius: 6px;
  background:    var(--card);
  color:         var(--ink);
  outline:       none;
}
.cell-edit-select {
  padding:       4px 8px;
  font-size:     13px;
  font-family:   inherit;
  border:        2px solid var(--blue);
  border-radius: 6px;
  background:    var(--card);
  color:         var(--ink);
  outline:       none;
  min-width:     130px;
}

/* Checkbox column */
.row-select       { width: 30px; padding-left: 14px; }
.row-select input { transform: scale(1.15); cursor: pointer; accent-color: var(--blue); }

/* ---------- Toasts ---------- */
.toasts {
  position:       fixed;
  bottom:         20px;
  right:          20px;
  z-index:        300;
  display:        flex;
  flex-direction: column;
  gap:            10px;
  pointer-events: none;
}
.toast {
  background:     var(--card);
  color:          var(--ink);
  padding:        11px 16px;
  border-radius:  10px;
  box-shadow:     var(--shadow-md);
  border:         1px solid var(--border);
  border-left:    4px solid var(--blue);
  font-size:      13px;
  min-width:      240px;
  max-width:      400px;
  pointer-events: auto;
  animation:      toast-in .25s ease-out;
}
.toast.ok       { border-left-color: var(--green); }
.toast.error    { border-left-color: var(--red); }
.toast.warn     { border-left-color: var(--amber); }
.toast.loading  { border-left-color: var(--blue); }
/* A clickable toast hints it's an action: pointer cursor + a subtle lift on hover. */
.toast.clickable { cursor: pointer; }
.toast.clickable::after { content: '›'; float: right; margin-left: 8px; opacity: .55; font-weight: 700; }
.toast.clickable:hover  { box-shadow: var(--shadow-lg, var(--shadow-md)); filter: brightness(1.02); }
.toast.fade-out { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in  { from { transform: translateX(40px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
@keyframes toast-out { from { transform: translateX(0);    opacity: 1 } to { transform: translateX(40px); opacity: 0 } }

/* ---------- Scheduler badge ---------- */
.sched-badge {
  background:    var(--green);
  color:         #fff;
  font-size:     11px;
  font-weight:   700;
  padding:       4px 10px;
  border-radius: 999px;
  white-space:   nowrap;
  margin-right:  2px;
}
.sched-badge[hidden] { display: none; }

/* ---------- Modals ---------- */
.modal {
  position:        fixed;
  inset:           0;
  background:      rgba(13, 20, 33, .55);
  backdrop-filter: blur(2px);
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         200;
}
.modal[hidden] { display: none; }
.modal-box {
  background:    var(--card);
  border-radius: 14px;
  padding:       22px 24px;
  width:         440px;
  max-width:     92vw;
  max-height:    85vh;
  overflow-y:    auto;
  box-shadow:    var(--shadow-md);
  border:        1px solid var(--border);
}
.modal-wide   { width: 760px; }
.modal-box h3 { margin-bottom: 14px; font-size: 15px; letter-spacing: -.01em; }
.modal-box label {
  display:        block;
  font-size:      11px;
  font-weight:    600;
  color:          var(--muted);
  margin:         12px 0 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.modal-box label .hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight:    400;
  color:          var(--faint);
  font-size:      11px;
}
.modal-box input, .modal-box select {
  width:         100%;
  padding:       8px 12px;
  border:        1px solid var(--border);
  border-radius: 8px;
  font-size:     13px;
  font-family:   inherit;
  background:    var(--card);
  color:         var(--ink);
}
.modal-box input:focus, .modal-box select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.modal-actions {
  display:         flex;
  align-items:     center;
  justify-content: flex-end;
  gap:             8px;
  margin-top:      20px;
}
.modal-spacer { flex: 1; }
.rule-meta {
  background:    var(--surface);
  padding:       10px 12px;
  border-radius: 8px;
  font-size:     12px;
  color:         var(--ink-soft);
  margin-bottom: 8px;
}
.rule-meta strong { color: var(--ink); }
.rule-toggle {
  display:        flex !important;
  align-items:    center;
  gap:            8px;
  margin-top:     14px !important;
  font-size:      13px !important;
  color:          var(--ink) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.rule-toggle input { width: auto !important; accent-color: var(--blue); }

/* ---------- History modal ---------- */
.history-toolbar {
  display:     flex;
  gap:         10px;
  align-items: center;
  margin:      12px 0;
  flex-wrap:   wrap;
}
.history-toolbar .filter-input { width: auto; min-width: 140px; padding: 6px 10px; font-size: 13px; }
.history-toolbar #histSearch   { flex: 1; min-width: 180px; }
.history-toolbar #histCsv      { text-decoration: none; }
.history-list {
  max-height:    60vh;
  overflow-y:    auto;
  border:        1px solid var(--border);
  border-radius: 10px;
}
.history-row {
  display:               grid;
  grid-template-columns: 130px 90px 1fr 140px;
  gap:                   12px;
  padding:               8px 12px;
  border-bottom:         1px solid var(--line);
  font-size:             13px;
  align-items:           center;
}
.history-row:last-child       { border-bottom: none; }
.history-row:nth-child(even)  { background: var(--surface); }
.history-row .h-ts            { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-row .h-action        { font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: .04em; }
.history-row.auto .h-action   { color: var(--green-ink); }
.history-row.manual .h-action { color: var(--blue-ink); }
.history-row .h-evt           { color: var(--ink); }
.history-row .h-evt small     { color: var(--muted); font-size: 11px; }
.history-row .h-change        { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.history-row .h-change .old   { color: var(--muted); text-decoration: line-through; margin-right: 6px; font-weight: 400; }

/* Price-trend chart */
.hist-chart {
  margin:        4px 0 12px;
  padding:       14px 16px;
  border:        1px solid var(--border);
  border-radius: 10px;
  background:    var(--card);
}
.hist-chart .chart-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.hist-chart svg          { display: block; width: 100%; height: 160px; }
.hist-chart .chart-axis  { stroke: var(--border); stroke-width: 1; }
.hist-chart .chart-line  { stroke: var(--blue); stroke-width: 2; fill: none; }
.hist-chart .chart-dot   { fill: var(--blue); }
.hist-chart .chart-tick  { font-size: 10px; fill: var(--muted); font-family: inherit; }

/* ---------- Reprice results ---------- */
.reprice-list { max-height: 60vh; overflow-y: auto; }
.reprice-row {
  display:       flex;
  align-items:   center;
  gap:           10px;
  padding:       8px 12px;
  border-bottom: 1px solid var(--line);
  font-size:     12px;
}
.reprice-row .reprice-icon        { font-size: 15px; width: 24px; text-align: center; }
.reprice-row .reprice-text        { flex: 1; }
.reprice-row .reprice-text strong { color: var(--ink); }
.reprice-row.repriced   { background: var(--green-soft); }
.reprice-row.cheapest   { background: color-mix(in srgb, var(--green-soft) 50%, var(--card)); }
.reprice-row.at_minimum { background: var(--amber-soft); }
.reprice-row.no_data    { background: var(--surface); color: var(--muted); }
.reprice-row.failed     { background: var(--red-soft); }

/* ---------- Bulk actions bar ---------- */
.bulk-bar {
  position:      fixed;
  bottom:        24px;
  left:          50%;
  transform:     translateX(-50%);
  z-index:       250;
  display:       flex;
  align-items:   center;
  gap:           10px;
  padding:       10px 18px;
  background:    #1b2436;
  color:         #fff;
  border-radius: 12px;
  box-shadow:    var(--shadow-md);
}
.bulk-bar[hidden]         { display: none; }
.bulk-count               { font-weight: 700; margin-right: 8px; font-size: 13px; }
.bulk-bar .btn-tiny       { background: rgba(255,255,255,.16); color: #fff; border: none; }
.bulk-bar .btn-tiny:hover { background: rgba(255,255,255,.28); }

/* ---------- Paused-events archive ---------- */
.archive-bar {
  margin:          22px 0 12px;
  padding:         12px 18px;
  border-radius:   10px;
  background:      var(--card);
  border:          1px dashed var(--border);
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  gap:             10px;
  cursor:          pointer;
  user-select:     none;
  font-size:       13px;
  color:           var(--muted);
  transition:      background .15s, border-color .15s;
}
.archive-bar:hover          { background: var(--surface); border-color: var(--faint); }
.archive-bar .archive-title { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-weight: 500; }
.archive-bar .arrow         { display: inline-block; transition: transform .15s; font-size: 11px; color: var(--muted); }
.archive-bar.open .arrow    { transform: rotate(90deg); }
.archive-bar strong         { color: var(--ink); font-weight: 600; }
.archive-cards              { opacity: .8; transition: opacity .15s; }
.archive-cards:hover        { opacity: 1; }
.archive-cards .other-event { background: color-mix(in srgb, var(--card) 75%, var(--bg)); }

/* ---------- Skeleton loaders ---------- */
.skeleton-wrap { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.skeleton-card {
  height:        62px;
  border-radius: 12px;
  background:    linear-gradient(90deg,
                  var(--card) 0%,
                  color-mix(in srgb, var(--card) 70%, var(--border)) 50%,
                  var(--card) 100%);
  background-size: 200% 100%;
  animation:     skeletonShimmer 1.4s linear infinite;
  border:        1px solid var(--border);
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Row flash on price change ---------- */
@keyframes priceFlashKf {
  0%   { background-color: var(--amber-soft); }
  50%  { background-color: var(--green-soft); }
  100% { background-color: transparent; }
}
tr.price-flash { animation: priceFlashKf 1.6s ease-out 1; }

/* ---------- Compact mode ---------- */
body.compact .hd               { padding: 6px 20px; }
body.compact .other-toolbar    { margin-top: 10px; }
body.compact .ct               { padding: 8px 20px 60px; }
body.compact .other-head       { padding: 9px 13px; }
body.compact .other-event      { margin-bottom: 6px; }
body.compact .team-logo        { width: 28px; height: 28px; font-size: 10px; }
body.compact .other-name       { font-size: 13.5px; }
body.compact .other-league     { font-size: 11px; }
body.compact .other-meta       { font-size: 11px; }
body.compact .stat             { padding: 8px 10px 9px; }
body.compact .stat .value      { font-size: 15px; }
body.compact .my-table-wrap td,
body.compact .my-table-wrap th { padding: 6px 9px; font-size: 12px; }
body.compact .cat-head         { padding: 8px 12px; font-size: 12.5px; }
body.compact tbody td          { padding: 7px 12px; }

/* ---------- Threat rows — competitors strictly cheaper than my listing ---------- */
.cat-body tbody tr.threat td               { background: color-mix(in srgb, var(--red) 5%, var(--card)); }
.cat-body tbody tr.threat td:first-child   { color: var(--red); font-size: 10px; box-shadow: inset 3px 0 0 color-mix(in srgb, var(--red) 45%, transparent); }
.cat-body tbody tr.threat:hover td         { background: color-mix(in srgb, var(--red) 9%, var(--card)); }

/* ---------- Position chip on a category head ("#2 of 9") ---------- */
.pos-chip {
  display:       inline-block;
  margin-left:   8px;
  padding:       2px 8px;
  border-radius: 999px;
  font-size:     11px;
  font-weight:   700;
  background:    var(--amber-soft);
  color:         var(--amber-ink);
  vertical-align: 1px;
}
.pos-chip.pos-first { background: var(--green-soft); color: var(--green-ink); }

/* ---------- Trend button on a category head ---------- */
.btn-trend {
  border:        1px solid var(--border);
  background:    var(--card);
  border-radius: 7px;
  padding:       2px 8px;
  font-size:     12px;
  cursor:        pointer;
  line-height:   1.4;
  transition:    background .12s, border-color .12s;
}
.btn-trend:hover { background: var(--blue-soft); border-color: var(--blue); }

/* ---------- Sortable column headers ---------- */
.th-sort         { cursor: pointer; user-select: none; }
.th-sort:hover   { color: var(--ink); background: var(--surface-2); }

/* ---------- Profit chip (price − cost, when a cost is set on the rule) ---------- */
.profit-chip {
  display:       inline-block;
  margin-left:   6px;
  padding:       2px 7px;
  border-radius: 999px;
  font-size:     11px;
  font-weight:   700;
  font-variant-numeric: tabular-nums;
}
.profit-chip.pos { background: var(--green-soft); color: var(--green-ink); }
.profit-chip.neg { background: var(--red-soft);   color: var(--red-ink); }

/* ---------- Reprice result rows: new safety statuses ---------- */
.reprice-row.at_max  { background: var(--blue-soft); }
.reprice-row.guard   { background: var(--red-soft); font-weight: 600; }
/* Large jump that was applied because a min-price floor is in place — noteworthy, not blocked. */
.reprice-row.bigjump { background: var(--amber-soft); }
.bigjump-note        { color: var(--amber-ink); font-weight: 600; font-size: 12px; white-space: nowrap; }
/* Brief attention pulse when the guard toast scrolls a blocked row into view. */
.reprice-row.flash   { animation: guard-flash 1.6s ease-out; }
@keyframes guard-flash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  20%      { box-shadow: 0 0 0 3px var(--red); }
  60%      { box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 50%, transparent); }
}
.reprice-row.optimal { background: color-mix(in srgb, var(--green-soft) 50%, var(--card)); }
.reprice-row.at_min  { background: var(--amber-soft); }

/* ---------- Responsive — narrow windows ---------- */
@media (max-width: 900px) {
  .hd             { padding: 8px 14px; gap: 8px; }
  .last-scan      { display: none; }
  .hd .ver        { display: none; }
  .other-toolbar  { flex-wrap: wrap; padding: 0 12px; }
  .sort-select    { min-width: 0; flex: 1; }
  .ct             { padding: 12px 12px 90px; }
  .other-head     { flex-wrap: wrap; }
  .evt-countdown  { font-size: 11px; padding: 4px 9px; }
  .stats          { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .stat + .stat   { border-left: none; }
  .stat           { border-top: 1px solid var(--line); }
  .cat-meta .cat-meta-item { display: none; }      /* keep count badge + trend, drop Range/Avg */
}

/* ---------- Dark-mode specifics ---------- */
html[data-theme="dark"] .hd            { background: #0a101c; border-bottom-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .team-logo.has-img { background: #e8ecf2; }
html[data-theme="dark"] .pill-mine     { color: #3a3008; }
html[data-theme="dark"] .bulk-bar      { background: #2a3850; }
html[data-theme="dark"] .btn-trend     { background: var(--surface); }

/* MULTI-ARENA position chips (LFT, 2026-07-02): one labeled mini-chip per block size the listing sells */
.lst-pos-multi { display: inline-flex; gap: 3px; vertical-align: middle; }
.lst-pos-size  { display: inline-block; margin-right: 3px; padding: 0 4px; border-radius: 5px;
                 background: rgba(15, 23, 42, .10); font-size: 9px; font-weight: 800;
                 text-transform: uppercase; letter-spacing: .3px; opacity: .8; }

/* ==== FTN design ports (Or 2026-07-02): fonts, bold headers, emphasis, colored date groups ==== */
/* Bigger reading font + bold table headers */
.lst-table { font-size: 14px; }
.lst-table th { font-weight: 800; }
.other-name { font-size: 16.5px; }
/* Emphasis: category, quantity, price pop at a glance */
.lst-cat { font-weight: 700; }
.lst-td-avail b { font-size: 13.5px; font-weight: 800; }
.lst-price .amt { font-weight: 800; font-size: 14px; }
/* Min-price tag under the price (the rule's floor, visible at a glance) */
.lst-price-stack { display: inline-flex; flex-direction: column; align-items: flex-start; vertical-align: middle; }
.lst-min-tag { font-size: 9.5px; font-weight: 600; color: var(--muted); line-height: 1.25; white-space: nowrap; }
/* Away-team crest right after the away team's name — UNIFORM size, centered to the text line */
.other-name { display: flex; align-items: center; gap: 8px; }
.other-name .team-logo, .other-name .team-logo.has-img {
  width: 20px; height: 20px; min-width: 20px; flex-shrink: 0;
  font-size: 8px; margin-left: 0; vertical-align: middle;
}
/* Colored date-group headers: today=red, tomorrow=yellow, this week=green, rest=blue family */
.date-group-header.is-today     { background: var(--red-soft);   color: var(--red-ink); }
.date-group-header.is-soon      { background: var(--amber-soft); color: var(--amber-ink); }
.date-group-header.is-week      { background: var(--green-soft); color: var(--green-ink); }
.date-group-header.is-month     { background: color-mix(in srgb, #3b82f6 16%, var(--card));
                                  color: color-mix(in srgb, #2563eb 80%, var(--ink)); }
.date-group-header.is-nextmonth { background: color-mix(in srgb, #6366f1 16%, var(--card));
                                  color: color-mix(in srgb, #4f46e5 80%, var(--ink)); }
.date-group-header.is-later     { background: color-mix(in srgb, #06b6d4 14%, var(--card));
                                  color: color-mix(in srgb, #0e7490 80%, var(--ink)); }
.date-group-header.is-other     { background: var(--surface); }

/* Block column (Or 2026-07-02: FTN-style column order — Category · Block · Qty · Sell-As · Seating) */
.lst-td-block { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* Slightly smaller league flag (Or 2026-07-02; the crest-size bump was reverted at his request) */
.other-head .other-league .flag-img { width: 15px; height: 11px; }
.other-head .other-league .league-glyph { font-size: 10px; }

/* Min-price tag — larger, readable (Or 2026-07-02: 9.5px was far too small) */
.lst-min-tag { font-size: 12px; font-weight: 700; }

/* Pulsing LIVE dot on the status pill (Or 2026-07-03) — LFT + StubHub alike */
.lst-status .pill-live::before {
  animation: liveDotPulse 1.6s ease-in-out infinite;
}
@keyframes liveDotPulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); }
  50%      { opacity: .55; box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent); }
}

/* ==== Countdown + date-line refresh (Or 2026-07-03, all platforms) ==== */
/* Elegant countdown pill: soft blue gradient, tabular numbers; TODAY/TOMORROW overrides stay */
.evt-countdown {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 12%, var(--card)),
                                       color-mix(in srgb, var(--blue) 4%, var(--card)));
  border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--border));
  color: color-mix(in srgb, var(--blue) 72%, var(--ink));
  font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .2px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
/* Prominent date line — was barely visible */
.other-head .other-meta { font-size: 12.5px; color: var(--ink-soft); }
.evt-date-str { font-weight: 800; color: var(--ink); font-size: 13px; letter-spacing: .1px; white-space: nowrap; }

/* Rank-tone backgrounds for position chips (Or 2026-07-03): #1 green · #2–5 amber · #6+ red */
.pos-t-green { background: var(--green-soft) !important; color: var(--green-ink) !important; }
.pos-t-amber { background: var(--amber-soft) !important; color: var(--amber-ink) !important; }
.pos-t-red   { background: var(--red-soft)   !important; color: var(--red-ink)   !important; }
/* Emphasized minimum-price tag — gold pill so a set floor is obvious */
.lst-min-tag { color: var(--amber-ink); background: var(--amber-soft); border-radius: 5px; padding: 0 5px; }

/* Post-create report dialog — clean, table-based summary (Or 2026-07-03) */
.cr-box { max-width: 480px; }
.cr-title { margin: 0 0 3px; }
.cr-sub { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.cr-config { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; align-items: center;
             padding: 11px 14px; margin: 0 0 12px; border-radius: 11px;
             background: var(--surface, rgba(127,127,127,.06)); border: 1px solid var(--border); font-size: 12.5px; }
.cr-cfg-k { color: var(--muted); font-weight: 600; }
.cr-cfg-v { text-align: right; color: var(--ink); font-weight: 700; }
.cr-table-wrap { max-height: 42vh; overflow: auto; border: 1px solid var(--border); border-radius: 11px; margin: 0 0 14px; }
.cr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cr-table thead th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 9px 13px;
                     font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
                     color: var(--muted); background: var(--surface, var(--card)); border-bottom: 1px solid var(--border); }
.cr-table td { padding: 9px 13px; border-top: 1px solid var(--border); }
.cr-ev { font-weight: 600; color: var(--ink); }
.cr-table th.cr-st, .cr-table td.cr-st { text-align: right; white-space: nowrap; }
.cr-ok { color: var(--green-ink); font-weight: 700; }
.cr-fail { color: var(--red-ink); font-weight: 700; }
.cr-actions { flex-wrap: wrap; gap: 6px; }

/* Pre-create bulk confirm: numbered match table with dates (Or 2026-07-03) */
.bl-confirm-tbl-wrap { max-height: 36vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0 4px; }
.bl-confirm-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bl-confirm-tbl thead th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 7px 11px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); background: var(--surface, var(--card)); border-bottom: 1px solid var(--border); }
.bl-confirm-tbl td { padding: 6px 11px; border-top: 1px solid var(--border); }
.bl-confirm-tbl td.num { color: var(--muted); font-weight: 700; width: 28px; }
.bl-confirm-tbl td:first-child + td { font-weight: 600; }
.bl-confirm-tbl td:last-child { white-space: nowrap; color: var(--muted); }
