/* Discover (/discover). Colour tokens come from static/themes.css (per theme). */

.ptabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.ptabs a { padding: 8px 0 10px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.ptabs a:hover { color: var(--text); }
.ptabs a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.pfilter { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.pfilter a { color: var(--text-2); }
.pfilter a:hover { color: var(--text); }
.pfilter a[aria-current] { color: var(--accent); font-weight: 600; }
.h2-note { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }

.dbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dbar > p { margin: 0; }
.mnav { display: flex; align-items: center; gap: 10px; }
.mnav .mtitle { margin: 0; padding: 0; border: 0; font-size: 18px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); min-width: 9.5em; text-align: center; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; }
.icon-btn[aria-disabled] { opacity: .35; }
.mtoday { font-size: 12px; }

.dfilters { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 16px; }
.dplats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.dchip { position: relative; display: inline-flex; align-items: center; height: 26px; padding: 0 9px; font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; color: var(--text-2); cursor: pointer; }
.dchip input { position: absolute; opacity: 0; pointer-events: none; }
.dchip:hover { color: var(--text); border-color: var(--muted); }
.dchip:has(input:checked) { color: var(--accent); border-color: var(--accent); background: var(--bg-3); }
.dchip:has(input:focus-visible) { outline: var(--focus-w) solid var(--focus); outline-offset: 1px; }
.dgenre select { height: 26px; font-size: 12px; }
.dfilter-note { font-size: 12px; }

/* Upcoming: month grid (desktop), month navigator + agenda (phones; desktop list view). See discover-upcoming.html */
.upc .calx { width: 100%; table-layout: fixed; border-collapse: collapse; margin-bottom: 8px; }
.calx th { padding: 6px 8px; font-size: 11.5px; font-weight: 600; text-align: left; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); }
.calx th.we { color: var(--muted); }
.calx td { position: relative; vertical-align: top; height: 112px; padding: 6px 6px 8px; border: 1px solid var(--line); background: var(--bg); }
.calx td.we { background: color-mix(in srgb, var(--bg-2) 55%, var(--bg)); }
.calx td.out { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--line) 35%, transparent) 6px 7px), var(--bg); }
.calx td.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cd-head { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; min-height: 22px; }
.cd-num { font-size: 15px; font-weight: 600; line-height: 22px; color: var(--text); }
.cd.past .cd-num, .cd:not(.has) .cd-num { color: var(--muted); font-weight: 500; }
.cd.today .cd-num { min-width: 24px; padding: 0 5px; border-radius: 3px; text-align: center; background: var(--accent); color: var(--accent-ink); }
.cd-today { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.cd-count { margin-left: auto; font-size: 11px; color: var(--muted); }
.ce-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.ce { position: relative; border-radius: 2px; }
.ce-link { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 7px; align-items: center; padding: 2px; border-radius: 2px; }
.ce.lib .ce-link { padding-right: 26px; }
.ce-link:hover { background: var(--bg-3); color: var(--text); }
.ce-link:hover .ce-title { color: var(--accent); }
.ce-cover { position: relative; display: block; width: 24px; aspect-ratio: 264 / 374; background: var(--bg-3); border-radius: 2px; overflow: hidden; box-shadow: var(--cover-edge); }
.ce-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ce-text { display: flex; flex-direction: column; min-width: 0; }
.ce-title { font-size: 12.5px; font-weight: 500; line-height: 1.25; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; hyphens: auto; }
.ce-plat { font-size: 10.5px; line-height: 1.3; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd.past .ce-cover, .cd.past .ce-title { opacity: .72; }
.ce.lib { background: color-mix(in srgb, var(--sc) 14%, transparent); box-shadow: inset 2px 0 0 var(--sc); }
.ce.lib .ce-link { padding-left: 5px; }
.ce .daction { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); }
.ce .dwant-icon { box-shadow: 0 0 0 3px var(--bg-3); }
.dwant-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 2px;
  background: var(--bg-3); color: var(--text-2); cursor: pointer; opacity: 0; }
.dwant-icon .icon { width: 12px; height: 12px; }
.ce:hover .dwant-icon, .ce:focus-within .dwant-icon, .dwant-icon:focus-visible { opacity: 1; }
.dwant-icon:hover { color: var(--s-want_to_play); }
.dstatus.compact .dicon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 2px; color: var(--sc); }
.dstatus.compact .icon { width: 13px; height: 13px; }
@media (hover: none) { .dwant-icon { opacity: 1; } }
.cd-more { margin-top: 4px; }
.cd-more > summary { display: inline-block; padding: 2px 6px; border-radius: 2px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; list-style: none; }
.cd-more > summary::-webkit-details-marker { display: none; }
.cd-more > summary:hover, .cd-more[open] > summary { color: var(--accent); background: var(--bg-3); }
.cd-pop { position: absolute; z-index: 20; top: 4px; left: 4px; width: max(calc(100% - 8px), 300px); max-height: 420px; overflow-y: auto;
  padding: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 10px 30px rgb(0 0 0 / .35); }
.cd-more.end .cd-pop { left: auto; right: 4px; }
.cd-pop-head { margin: 0 0 8px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.cd-pop-head .muted { font-weight: 400; font-size: 12px; }

/* phones: month navigator */
.cal-mini { display: none; width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; margin: 0 -3px 12px; }
.cal-mini th { font-size: 11px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.cal-mini td { padding: 0; text-align: center; }
.cm-day { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; border-radius: 3px; font-size: 14px; line-height: 1.1; }
a.cm-day { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
a.cm-day:hover { border-color: var(--accent); color: var(--accent); }
.cm-day.cm-none { color: var(--muted); }
.cm-n { font-size: 10.5px; font-weight: 500; color: var(--muted); }
a.cm-day.lib { border-color: var(--s-want_to_play); box-shadow: inset 0 -3px 0 var(--s-want_to_play); }
.cal-mini td.past a.cm-day { background: transparent; color: var(--text-2); font-weight: 500; }  /* dimmed without opacity: digits keep AA contrast */
.cal-mini td.today .cm-day { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: 1; }
.cal-mini td.today .cm-n { color: var(--accent-ink); }

/* agenda */
.agenda { display: none; }
.upc-list .agenda { display: block; }
.ag-week { margin: 0 0 18px; }
.ag-week-head { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 10px 0 6px; font-size: 15px; font-weight: 600; color: var(--text); border-bottom: 2px solid var(--line); }
.ag-week-head .muted, .ag-day-head .muted { font-size: 12px; font-weight: 400; }
.ag-day { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.ag-day-head { margin: 2px 0 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.ag-day.past .ag-day-head { color: var(--text-2); }
.ag-day.today .ag-day-head time { color: var(--accent); }
.ag-day-head .cd-today { align-self: flex-start; }
.ag-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ag-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 4px 6px 4px 4px; border-radius: 2px; }
.ag-row.lib { background: color-mix(in srgb, var(--sc) 12%, transparent); box-shadow: inset 3px 0 0 var(--sc); padding-left: 9px; }
.ag-cover { position: relative; display: block; width: 40px; aspect-ratio: 264 / 374; background: var(--bg-3); border-radius: 2px; overflow: hidden; box-shadow: var(--cover-edge); }
.ag-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ag-title { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.ag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 11.5px; }
.pbadge { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 2px; font-size: 10.5px; line-height: 16px; color: var(--text-2); background: var(--bg-2); }
.ag-month { margin: 28px 0 6px; padding: 0; border: 0; font-size: 18px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.ag-jump { margin: 0 0 10px; font-size: 12.5px; text-align: right; }
.later-tba { scroll-margin-top: 70px; }
.ag-earlier { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 2px; }
.ag-earlier > summary { padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.ag-earlier > summary:hover { color: var(--text); }
.ag-earlier[open] { padding: 0 12px; }
.ag-earlier[open] > summary { padding-left: 0; padding-right: 0; }

/* cards */
.dcard .meta { flex-wrap: wrap; gap: 2px 8px; }
.dplat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }
.reasons { list-style: none; margin: 4px 0 0; padding: 0; font-size: 11.5px; line-height: 1.35; color: var(--text-2); }
.reasons li + li { margin-top: 2px; }
/* equal-height cards in a row: the actions sit on one shared baseline whatever the title/meta length */
.dcard:not(.dhidden) { display: flex; flex-direction: column; flex: 1 1 auto; }
.dactions { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.btn.dwant { height: 26px; padding: 0 8px; font-size: 12px; gap: 5px; display: inline-flex; align-items: center; }
.btn.dwant .icon { width: 12px; height: 12px; color: var(--s-want_to_play); }
.dstatus { font-size: 12px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.linkish:hover { color: var(--text); }
.dhidden { display: flex; align-items: center; min-height: 80px; border: 1px dashed var(--line); border-radius: 2px; padding: 10px; font-size: 12px; }
.dhidden p { margin: 0; }
.dexplain { max-width: 75ch; font-size: 13px; margin: 0 0 16px; }
ol.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
ol.ranked > li { counter-increment: rank; position: relative; min-width: 0; }
ol.ranked > li:not([hidden]) { display: flex; flex-direction: column; }
ol.ranked > li::before { content: counter(rank); position: absolute; z-index: 1; top: 4px; left: 4px; min-width: 20px; padding: 1px 5px; border-radius: 2px;
  background: rgb(0 0 0 / .7); color: #fff; font-size: 11px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .upc .calx, .vtoggle { display: none; }
  .cal-mini, .agenda { display: table; }
  .agenda { display: block; }
  .ag-day { grid-template-columns: 1fr; gap: 8px; }
  .ag-day-head { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  .ag-row { gap: 10px; }
  .mnav .mtitle { font-size: 16px; min-width: 8em; }
}
.dapply[hidden] { display: none; }

/* "Load more" sentinel at the end of each list (components/discover-sentinel.html, static/js/discover.js) */
.dmore { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 64px; padding: 12px 0; list-style: none; }
ol.ranked > li.dmore { counter-increment: none; }
ol.ranked > li.dmore::before { content: none; }
.dmore-btn { min-width: 160px; height: 34px; justify-content: center; }
.dmore-busy { display: none; }
.dmore-btn.htmx-request .dmore-label { display: none; }
.dmore-btn.htmx-request .dmore-busy { display: inline; }
.dmore-btn.htmx-request:disabled { opacity: 1; color: var(--text-2); cursor: progress; }  /* "Loading…" stays readable (not the faded disabled look) */
.dmore-msg { font-size: 12px; }
.dmore-msg:empty { display: none; }
.dmore-end { justify-content: center; }
.dmore-end p { margin: 0; font-size: 13px; text-align: center; }
.dmore-mark { display: none; }
@media (max-width: 760px) { .dmore-btn { width: 100%; } }
@media (max-width: 480px) { .dtabs { gap: 16px; } } /* five tabs (Lists) on a phone: less scrolling */
