/* ============================================================================
   The Bay · Tech Events — design system
   Deliberate cool-neutral palette with a signal-blue accent. Theme-aware.
   ============================================================================ */
:root {
  /* dark (default) */
  --bg: #0a0d12;
  --bg-grid: #0c1017;
  --elev: #10151d;
  --surface: #141b25;
  --surface-2: #1a2230;
  --border: #212b39;
  --border-strong: #2c3848;
  --text: #eef1f6;
  --text-dim: #c2cad6;
  --muted: #808b9c;
  --faint: #58627240;
  --accent: #4f9dff;
  --accent-2: #79b4ff;
  --accent-ink: #051428;
  --ring: rgba(79, 157, 255, 0.45);
  --star: #ffca45;
  --ok: #45c98d;
  --err: #f26d7d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, 0.55);

  --r-xs: 6px; --r-sm: 8px; --r-md: 11px; --r-lg: 14px; --r-pill: 999px;
  --sp: 8px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fc; --bg-grid: #f3f6fa; --elev: #ffffff; --surface: #f4f7fb; --surface-2: #eaeff6;
    --border: #e2e8f1; --border-strong: #d0d9e6; --text: #0d1218; --text-dim: #333d4b; --muted: #667284;
    --faint: #94a3b820; --accent: #2563eb; --accent-2: #1d4ed8; --accent-ink: #ffffff;
    --ring: rgba(37, 99, 235, 0.35); --star: #e0a400; --ok: #16a34a; --err: #dc2626;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06); --shadow-md: 0 8px 24px -12px rgba(16, 24, 40, 0.22);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f9fc; --bg-grid: #f3f6fa; --elev: #ffffff; --surface: #f4f7fb; --surface-2: #eaeff6;
  --border: #e2e8f1; --border-strong: #d0d9e6; --text: #0d1218; --text-dim: #333d4b; --muted: #667284;
  --faint: #94a3b820; --accent: #2563eb; --accent-2: #1d4ed8; --accent-ink: #ffffff;
  --ring: rgba(37, 99, 235, 0.35); --star: #e0a400; --ok: #16a34a; --err: #dc2626;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06); --shadow-md: 0 8px 24px -12px rgba(16, 24, 40, 0.22);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0d12; --bg-grid: #0c1017; --elev: #10151d; --surface: #141b25; --surface-2: #1a2230;
  --border: #212b39; --border-strong: #2c3848; --text: #eef1f6; --text-dim: #c2cad6; --muted: #808b9c;
  --faint: #58627240; --accent: #4f9dff; --accent-2: #79b4ff; --accent-ink: #051428;
  --ring: rgba(79, 157, 255, 0.45); --star: #ffca45; --ok: #45c98d; --err: #f26d7d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35); --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* The [hidden] attribute must always win over component display rules
   (a flex/grid class would otherwise keep a "hidden" overlay on screen). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(var(--faint) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--muted); }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: var(--r-xs); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: content-box; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--elev) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { font-size: 24px; filter: drop-shadow(0 0 10px var(--ring)); }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.brand-dot { color: var(--accent); font-weight: 400; }
.tagline { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.topbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-cta {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 9px 16px; border-radius: var(--r-pill); order: -1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 750; font-size: 13.5px;
  box-shadow: 0 3px 12px -3px var(--ring);
}
.app-cta:hover { filter: brightness(1.07); text-decoration: none; color: var(--accent-ink); }
#search {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 9px 13px; border-radius: var(--r-sm); min-width: 260px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#search::placeholder { color: var(--muted); }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.sortgroup { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.sortgroup button {
  background: transparent; border: 0; color: var(--muted); padding: 6px 11px;
  border-radius: var(--r-xs); cursor: pointer; font-size: 12.5px; font-weight: 550;
  transition: color 0.12s, background 0.12s;
}
.sortgroup button:hover { color: var(--text); }
.sortgroup button.active { background: var(--accent); color: var(--accent-ink); }
.iconbtn-lg, .btn-primary {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  height: 36px; padding: 0 12px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 13px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.iconbtn-lg { width: 36px; padding: 0; font-size: 15px; }
.iconbtn-lg:hover, .btn-primary:hover { border-color: var(--accent); color: var(--text); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-ghost {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  height: 36px; padding: 0 13px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

/* ---------------- Trip planner ---------------- */
.trip-wrap { position: relative; }
.trip-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 320px;
  background: var(--elev); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 16px;
}
.trip-panel h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.trip-panel p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.45; }
.trip-dates { display: flex; align-items: flex-end; gap: 10px; }
.trip-dates label { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.trip-dates input { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-sm); padding: 8px 9px; font-size: 13px; }
.trip-dates input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--ring); }
.trip-arrow { color: var(--muted); padding-bottom: 9px; }
.trip-actions { display: flex; gap: 8px; margin-top: 14px; }
.trip-actions .btn-primary { flex: 1; height: 38px; }

.trip-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 14%, var(--elev)), var(--elev));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: var(--r-lg);
  padding: 12px 16px; margin-bottom: 16px;
}
.trip-info { display: flex; align-items: center; gap: 12px; }
.trip-emoji { font-size: 22px; }
.trip-text { display: flex; flex-direction: column; gap: 1px; }
.trip-text strong { font-size: 14px; letter-spacing: -0.01em; }
.trip-range { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.trip-banner-actions { display: flex; gap: 8px; }
.trip-banner-actions .btn-ghost { height: 32px; padding: 0 11px; font-size: 12.5px; }

/* ---------------- Itinerary bar ---------------- */
.itinerary-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--elev); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  padding: 11px 16px; margin-bottom: 14px;
}
.itin-info { display: flex; align-items: center; gap: 12px; }
.itin-emoji { font-size: 20px; }
.itin-info strong { font-size: 14px; letter-spacing: -0.01em; }
.itin-sub { display: block; font-size: 12.5px; color: var(--muted); }
.itin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.itin-actions .btn-ghost, .itin-actions .btn-primary { height: 34px; padding: 0 12px; font-size: 12.5px; }
.itinerary-bar.empty { background: var(--bg-grid); border-style: dashed; }
.itinerary-bar.empty .itin-sub { max-width: 680px; line-height: 1.4; }
.itin-conflict { color: var(--err); font-weight: 700; }
.btn-ghost.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

/* in-trip + conflict emphasis on cards */
.card.in-trip { box-shadow: inset 3px 0 0 var(--star), var(--shadow-sm); }
.card.has-conflict { box-shadow: inset 3px 0 0 var(--err), var(--shadow-sm); }
.badge.conflict { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--err) 40%, transparent); }

/* curator layer — human-picked events get a gold accent + a clickable ✦ credit */
.card.curated { border-color: color-mix(in srgb, var(--star) 42%, var(--border)); background:
  linear-gradient(90deg, color-mix(in srgb, var(--star) 7%, var(--surface)), var(--surface) 120px); }
.card.curated:hover { border-color: color-mix(in srgb, var(--star) 60%, var(--border-strong)); }
a.badge.curated, span.badge.curated {
  background: color-mix(in srgb, var(--star) 20%, transparent); color: var(--star);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--star) 45%, transparent);
  display: inline-flex; align-items: center; gap: 3px;
}
a.badge.curated { text-decoration: none; }
a.badge.curated:hover { background: color-mix(in srgb, var(--star) 32%, transparent); box-shadow: inset 0 0 0 1px var(--star); }
.foot-curators { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--text-dim); margin-top: 2px; }
.foot-curators .foot-star { color: var(--star); font-weight: 700; }
.foot-curators a { color: var(--star); font-weight: 650; }

/* curator spotlight — credited, linked-back callout above the feed */
.curator-spotlight {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 18px; margin-bottom: 16px; border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--star) 38%, var(--border));
  background: linear-gradient(122deg, color-mix(in srgb, var(--star) 13%, var(--elev)), var(--elev) 62%);
  box-shadow: var(--shadow-sm);
}
.curator-spotlight .cs-mark {
  font-size: 22px; line-height: 1; color: var(--star); flex: none; margin-top: 1px;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--star) 45%, transparent));
}
.cs-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cs-title { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -0.01em; }
.cs-title a { color: var(--star); }
.cs-title a:hover { text-decoration: underline; }
.cs-blurb { color: var(--text-dim); font-size: 13px; line-height: 1.45; max-width: 62ch; }
.cs-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.cs-cta {
  border: 1px solid color-mix(in srgb, var(--star) 55%, transparent);
  background: color-mix(in srgb, var(--star) 16%, transparent);
  color: var(--star); font-weight: 650; font-size: 12.5px; padding: 5px 12px;
  border-radius: var(--r-pill); cursor: pointer; transition: background 0.15s ease;
}
.cs-cta:hover { background: color-mix(in srgb, var(--star) 26%, transparent); }
.cs-cta.alt { background: transparent; }
.cs-cta.alt:hover { background: color-mix(in srgb, var(--star) 14%, transparent); }
.cs-link { font-weight: 650; font-size: 12.5px; color: var(--star); white-space: nowrap; }
.cs-link:hover { text-decoration: underline; }
.cs-note { color: var(--muted); font-size: 12.5px; }
.cs-cta.open { background: color-mix(in srgb, var(--star) 30%, transparent); }

/* curator archive — a curator's recent (past) picks, expandable + labeled */
.curator-archive {
  margin: -8px 0 16px; padding: 2px 6px 8px; border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--star) 24%, var(--border));
  background: color-mix(in srgb, var(--star) 5%, var(--elev));
}
.ca-head { display: flex; align-items: center; gap: 10px; padding: 9px 10px 7px; }
.ca-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--star);
  border: 1px solid color-mix(in srgb, var(--star) 45%, transparent); padding: 1px 7px; border-radius: var(--r-pill);
}
.ca-note { color: var(--muted); font-size: 12px; }
.ca-more { margin-left: auto; color: var(--star); font-weight: 650; font-size: 12px; white-space: nowrap; }
.ca-more:hover { text-decoration: underline; }
.ca-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; }
.ca-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 6px 10px; border-radius: var(--r-sm); color: var(--text-dim);
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); text-decoration: none;
}
.ca-row:hover { background: color-mix(in srgb, var(--star) 9%, transparent); color: var(--text); }
.ca-date { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--star); font-weight: 650; }
.ca-title { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-venue { font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
@media (max-width: 640px) {
  .ca-row { grid-template-columns: 46px 1fr; }
  .ca-venue { display: none; }
}

/* conflict on the share/print card */
.sc-warn { color: #dc2626; font-weight: 800; font-size: 11px; }
.sc-conflict .sc-time { color: #dc2626; }

/* travel/gap connectors between itinerary events */
.connector { display: flex; align-items: center; gap: 8px; margin: -2px 0 8px 32px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.connector .conn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); flex: none; }
.connector.warn { color: var(--star); } .connector.warn .conn-dot { background: var(--star); }
.connector.bad { color: var(--err); font-weight: 600; } .connector.bad .conn-dot { background: var(--err); }
.sc-conn { font-size: 11.5px; color: #667284; margin: 1px 0 5px 90px; font-variant-numeric: tabular-nums; }
.sc-conn.warn { color: #c47f0e; } .sc-conn.bad { color: #dc2626; font-weight: 700; }
.conn-food { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-left: 4px; }
.conn-food:hover { text-decoration: underline; }

/* per-card links */
.card-links { display: flex; gap: 14px; margin-top: 9px; }
.cardlink { font-size: 12px; color: var(--muted); font-weight: 600; }
.cardlink:hover { color: var(--accent); text-decoration: none; }

/* ---------------- Share / print card ---------------- */
.share-modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center;
  overflow: auto; padding: 32px 16px;
}
.share-box { width: min(560px, 100%); }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.share-actions .btn-primary, .share-actions .btn-ghost { height: 38px; }

.share-card { background: #fff; color: #0d1218; border-radius: 16px; padding: 28px 30px; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6); font-family: var(--sans); }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 2px solid #eef1f6; }
.sc-head-left { display: flex; align-items: center; gap: 14px; }
.sc-qr { text-align: center; flex: none; }
.sc-qr svg { display: block; border-radius: 6px; border: 1px solid #edf0f4; }
.sc-qr-lbl { font-size: 8.5px; color: #8a94a3; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.sc-logo { font-size: 30px; }
.sc-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.sc-sub { font-size: 14px; color: #667284; font-weight: 600; margin-top: 2px; }
.sc-day { margin-top: 16px; }
.sc-dayhdr { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #2563eb; padding-bottom: 6px; border-bottom: 1px solid #edf0f4; margin-bottom: 8px; }
.sc-ev { display: grid; grid-template-columns: 78px 1fr; gap: 12px; padding: 6px 0; }
.sc-time { font-weight: 700; color: #2563eb; font-size: 13px; font-variant-numeric: tabular-nums; }
.sc-evname { font-weight: 650; font-size: 14.5px; line-height: 1.3; }
.sc-evloc { font-size: 12.5px; color: #667284; margin-top: 1px; }
.sc-foot { margin-top: 20px; padding-top: 14px; border-top: 2px solid #eef1f6; font-weight: 800; color: #2563eb; text-align: center; }

@media print {
  body { background: #fff !important; background-image: none !important; }
  .topbar, .sources-health, .layout, #itinerary-bar, .trip-banner { display: none !important; }
  .share-modal { position: static !important; display: block !important; background: none !important; padding: 0 !important; backdrop-filter: none !important; }
  .share-actions { display: none !important; }
  .share-box { width: auto !important; }
  .share-card { box-shadow: none !important; }
}

/* ---------------- Sources health ---------------- */
.sources-health {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 22px;
  background: var(--bg-grid); border-bottom: 1px solid var(--border);
}
.health-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px 10px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 0 transparent; }
.dot.ok { background: var(--ok); box-shadow: 0 0 6px -1px var(--ok); }
.dot.error { background: var(--err); box-shadow: 0 0 6px -1px var(--err); }

/* ---------------- Layout ---------------- */
.layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); align-items: start; }
.sidebar {
  position: sticky; top: var(--topbar-h, 68px); align-self: start; height: calc(100vh - var(--topbar-h, 68px));
  overflow-y: auto; padding: 18px 16px 40px; border-right: 1px solid var(--border); background: var(--bg-grid);
}
.filter-block { margin-bottom: 22px; }
.filter-block + .filter-block { border-top: 1px solid var(--border); padding-top: 20px; }
.filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.filter-block h3 { margin: 0 0 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.filter-head h3 { margin: 0; }
.clearbtn { background: none; border: 0; color: var(--muted); font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: var(--r-xs); }
.clearbtn:hover { color: var(--accent); }

.chips { display: flex; flex-direction: column; gap: 3px; }
.chip {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: var(--r-sm);
  cursor: pointer; user-select: none; border: 1px solid transparent; transition: background 0.12s, border-color 0.12s;
}
.chip:hover { background: var(--surface); }
.chip.active { background: var(--surface-2); border-color: var(--border-strong); }
.chip .cdot { width: 9px; height: 9px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.chip .clabel { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chip .ccount { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chip.active .ccount { color: var(--text-dim); }

.date-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.date-chips button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 12.5px; font-weight: 550;
  transition: all 0.12s;
}
.date-chips button:hover { border-color: var(--border-strong); color: var(--text); }
.date-chips button.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.custom-dates { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.custom-dates label { font-size: 10px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.custom-dates input { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-sm); padding: 6px 8px; }

.slider-row { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.slider-row output { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; color: var(--text-dim); font-size: 13px; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------------- Main / list ---------------- */
.main { padding: 18px 24px 80px; min-height: calc(100vh - 105px); }
.summary { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.day-group { margin-bottom: 26px; }
.day-header {
  position: sticky; top: var(--topbar-h, 68px); z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0 8px; margin-bottom: 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.01em; color: var(--text);
  background: var(--bg);
}
.day-header::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.card {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: start;
  background: var(--elev); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 13px 15px; margin-bottom: 8px; box-shadow: var(--shadow-sm);
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card.hidden-flag { opacity: 0.45; }
.card .time { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 650; font-size: 13px; padding-top: 1px; letter-spacing: -0.01em; }
.card .time small { display: block; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.card .time .allday { color: var(--muted); font-weight: 600; }
.card .body { min-width: 0; }
.card .body h4 { margin: 0 0 5px; font-size: 15px; font-weight: 650; line-height: 1.34; letter-spacing: -0.01em; }
.card .body h4 a { color: var(--text); }
.card .body h4 a:hover { color: var(--accent); text-decoration: none; }
.card .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.card .meta .src-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: var(--r-pill); }
.card .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.badge { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); letter-spacing: 0.01em; }
.badge.free { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); }
.badge.price { background: var(--surface-2); color: var(--text-dim); font-weight: 600; }
.badge.score { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent); font-variant-numeric: tabular-nums; }
.card .actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.iconbtn {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--r-sm); width: 31px; height: 29px; cursor: pointer; font-size: 14px; line-height: 1;
  display: grid; place-items: center; transition: all 0.12s;
}
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); }
.iconbtn.starred { color: var(--star); border-color: color-mix(in srgb, var(--star) 55%, var(--border)); background: color-mix(in srgb, var(--star) 12%, var(--surface)); }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty p:first-child { font-size: 16px; color: var(--text-dim); font-weight: 600; }

/* ---------------- Footer / API ---------------- */
.site-foot {
  grid-column: 1 / -1; border-top: 1px solid var(--border); background: var(--bg-grid);
  padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 8px;
  color: var(--muted); font-size: 13px;
}
.site-foot .foot-brand { color: var(--text-dim); }
.site-foot .foot-brand strong { color: var(--text); }
.site-foot .logo { filter: drop-shadow(0 0 8px var(--ring)); }
.foot-api { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.foot-label { color: var(--muted); font-weight: 600; }
.foot-api a { color: var(--accent); font-weight: 600; font-family: var(--mono); font-size: 12.5px; }
.foot-note { font-size: 12px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .card:hover { transform: none; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .day-header { top: 0; }
  #search { min-width: 0; flex: 1 1 100%; }
  .card { grid-template-columns: 74px minmax(0, 1fr); }
  .card .actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}
