:root{
  /* Theme tokens */
  color-scheme: dark;

  --bg:#0b0c12;
  --panel:#111325;
  --card:#15183a;
  --text:#f3f4ff;
  --muted:#b7b9d8;
  --border:rgba(255,255,255,.10);

  --accent:#6b5cff;
  --danger:#e0565b;
  --ok:#56d29b;
  --warn:#f2c94c;

  --radius:16px;
  --radius-sm:12px;
  --shadow: 0 10px 30px rgba(0,0,0,.30);

  --tap: 44px; /* minimum tap target-ish */
  --topbar-h: calc(72px + env(safe-area-inset-top));
}

/* Global resets */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
::placeholder{color:rgba(183,185,216,.7)}

/* ===== TOPBAR ===== */
.topbar{
  display:flex;
  gap:16px;
  align-items:flex-start;
  justify-content:space-between;
  padding:calc(14px + env(safe-area-inset-top)) 16px 14px;
  border-bottom:1px solid var(--border);
  position:fixed;
  top:0;
  left:0;
  right:0;
  background:var(--bg);
  z-index:100;
  box-shadow: var(--shadow);
}

.brand{display:flex;gap:12px;align-items:center;min-width:240px}
.brandText{display:flex;flex-direction:column;gap:2px}

.logo{
  width:40px;height:40px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(107,92,255,.18);
  border:1px solid rgba(107,92,255,.35);
  font-weight:900;
}

.title{font-weight:900;letter-spacing:.2px}
.subtitle{font-size:12px;color:var(--muted);max-width:520px;line-height:1.35}

/* controls */
.controls{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
  align-items:stretch;
  justify-content:flex-end;
  padding:8px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.03);
}
.controlsCard{padding:10px}
.controlsCard .controls{
  grid-template-columns: 1fr;
  padding:0;
  border:0;
  background:transparent;
}
.controlsCard .ctrl{gap:6px}

.ctrl{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted);position:relative;min-width:0}
select,input{
  min-height: var(--tap);
  background:rgba(255,255,255,.06);
  border:1px solid var(--border);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}
select:focus,input:focus,button:focus,a:focus,.daySummary:focus,.stageSummary:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(107,92,255,.25);
  border-color:rgba(107,92,255,.55);
}

button{
  min-height: var(--tap);
}

/* custom select (premium, cross-OS) */
.selectNative{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip: rect(0 0 0 0);
  border:0;
  opacity:0;
  pointer-events:none;
}

.selectWrap{
  position:relative;
  min-width: 92px;
  width:100%;
}

.selectTrigger{
  min-height: var(--tap);
  padding:10px 34px 10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-weight:700;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
}

.selectTrigger::after{
  content:"";
  position:absolute;
  right:12px;
  width:8px;height:8px;
  border-right:2px solid var(--muted);
  border-bottom:2px solid var(--muted);
  transform:rotate(45deg);
}

.selectWrap.isOpen .selectTrigger::after{transform:rotate(-135deg)}

.selectList{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  min-width:100%;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding:6px;
  display:none;
  box-shadow: var(--shadow);
  z-index:50;
  max-height: 240px;
  overflow:auto;
}

.selectWrap.isOpen .selectList{display:flex;flex-direction:column;gap:4px}

.selectOption{
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
  color:var(--text);
  cursor:pointer;
  background:transparent;
}

.selectList:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(107,92,255,.25);
  border-color:rgba(107,92,255,.55);
}

.selectOption:hover{background:rgba(255,255,255,.08)}
.selectOption.isActive,
.selectOption[aria-selected="true"]{background:rgba(107,92,255,.22); color:var(--text)}

/* pills: make them compact (fix iOS bubble look) */
.pill{
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  padding:8px 10px;
  border-radius:12px;
  font-size:12px;
  color:var(--muted);
  line-height:1.2;
  min-height: var(--tap);
  max-width: 100%;
  text-align:left;
  display:flex;
  align-items:center;
}

.pillLink{
  color:inherit;
  text-decoration:underline;
  text-underline-offset:2px;
}

/* ===== LAYOUT ===== */
.layout{
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap:14px;
  padding:calc(14px + var(--topbar-h, 72px)) calc(14px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
}

.panel{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
}

.side{display:flex;flex-direction:column;gap:12px}
.side .card{padding:12px}
.side .cardTitle{margin-bottom:8px}
.introCard{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(107,92,255,.10), rgba(255,255,255,.02));
  margin-bottom:12px;
}

/* Mobile menu trigger */
.menuBtn{
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.menuIcon{
  width:18px;
  height:2px;
  background:currentColor;
  position:relative;
  display:block;
  border-radius:2px;
}
.menuIcon::before,
.menuIcon::after{
  content:"";
  position:absolute;
  left:0;
  width:18px;
  height:2px;
  background:currentColor;
  border-radius:2px;
}
.menuIcon::before{top:-6px}
.menuIcon::after{top:6px}
.introIcon{
  width:32px;height:32px;
  border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(107,92,255,.18);
  border:1px solid rgba(107,92,255,.35);
  font-weight:900;
  font-size:14px;
}
.introContent{display:flex;flex-direction:column;gap:6px;max-width:900px}
.introTitle{font-size:16px;font-weight:900;letter-spacing:.2px}
.introSubtitle{color:var(--text);font-size:13px;line-height:1.5}
.introOnboarding{font-size:12px}

.toolbar{display:flex;gap:10px;align-items:flex-end;margin:10px 0 14px;flex-wrap:wrap}
.toolbar .ctrl{min-width:140px}
.toolbar .searchCtrl{flex:1 1 260px}
.toolbar .searchCtrl input{width:100%}

.activeFilters{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.03);
  margin-bottom:12px;
}
.activeFiltersLabel{
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}
.filterChip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  font-size:12px;
  color:var(--text);
}
.filterChip button{
  width:var(--tap);
  height:var(--tap);
  min-width:var(--tap);
  min-height:var(--tap);
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.08);
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  line-height:1;
}

/* ===== CHANGES / SEARCH ===== */
.changesBox{margin:10px 0 14px}
.changesSummary{font-size:13px;color:var(--muted)}
.changesSummary strong{color:var(--text)}
.changesDetails{margin-top:8px}
.changesDetails summary{cursor:pointer;color:var(--text);font-weight:700}
.changesDetailsBody{margin-top:8px;display:flex;flex-direction:column;gap:10px;font-size:12px;color:var(--muted);background:rgba(255,255,255,.03);border:1px solid var(--border);border-radius:12px;padding:10px}
.changesDetailSection{display:flex;flex-direction:column;gap:6px}
.changesDetailTitle{font-size:12px;color:var(--muted)}
.changesDetailList{display:flex;flex-direction:column;gap:6px;max-height:280px;overflow:auto;padding-right:2px}
.changesDetailItem{background:rgba(255,255,255,.04);border:1px solid var(--border);border-radius:10px;padding:6px 8px;display:flex;flex-direction:column;gap:2px}
.changesDetailName{font-weight:700;color:var(--text);line-height:1.2}
.changesDetailNameText{color:var(--text)}
.changesDetailMeta{font-size:12px;color:var(--muted)}
.changesDetailLink{color:inherit;text-decoration:none}
.changesDetailLink:hover{color:var(--text);text-decoration:underline}
.changesHistory{margin-top:10px}
.changesHistoryTitle{font-size:12px;color:var(--muted);margin-bottom:6px}
.changesHistoryList{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted);max-height:200px;overflow:auto;padding-right:2px}
.changesHistoryItem{display:flex;justify-content:space-between;gap:8px;align-items:center}
.changesHistoryItem.isActive .changesHistoryBtn{color:var(--text);font-weight:700}
.changesHistoryBtn{background:none;border:0;color:inherit;padding:0;font:inherit;cursor:pointer;text-align:left}
.changesHistoryItem strong{color:var(--text)}
.changesHistoryBtn:hover{color:var(--text);text-decoration:underline}
.changesNoteBody{margin-top:0;font-size:12px;color:var(--muted)}
.changesNoteBody p{margin:0 0 8px}
.changesNoteBody ul{margin:6px 0 0 16px;padding:0}
.changesNoteBody li{margin:4px 0}
.exportRow{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.exportRow .btn{flex:1 1 auto;line-height:1.2}

.errorBox{
  margin:10px 0 14px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(224,86,91,.35);
  background:rgba(224,86,91,.10);
  color:var(--danger);
  font-size:13px;
}

.searchResults{
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.03);
  padding:6px;
  margin-bottom:12px;
  max-height:220px;
  overflow:auto;
}
.lineupAnchor{
  height:0;
  scroll-margin-top:90px;
}
.searchItem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  font-size:13px;
}
.searchItem:hover{background:rgba(255,255,255,.08)}
.searchMeta{color:var(--muted);font-size:12px}

/* ===== WEEKEND TABS ===== */
.weekendTabs{
  display:flex;
  gap:8px;
  margin:6px 0 12px;
}
.tabBtn{
  border:1px solid var(--border);
  border-radius:999px;
  padding:8px 12px;
  font-weight:900;
  font-size:12px;
  background:rgba(255,255,255,.04);
  color:var(--muted);
  cursor:pointer;
  min-height: var(--tap);
}
.tabBtn.isActive{
  background:rgba(107,92,255,.20);
  border-color:rgba(107,92,255,.45);
  color:var(--text);
}

.weekendPanel{display:none}
.weekendPanel.isActive{display:block}

.weekendHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:8px 0 10px;
}
.weekendTitle{font-weight:900;font-size:18px}
.weekendMeta{color:var(--muted);font-size:12px;margin-bottom:8px}

/* ===== GROUPING ===== */
.dayGroup{
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.03);
}
.dayGroup + .dayGroup{margin-top:10px}
.dayGroup summary{list-style:none}
.dayGroup summary::-webkit-details-marker{display:none}
.daySummary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  cursor:pointer;
  min-height:44px;
  background:rgba(107,92,255,.08);
  border-bottom:1px solid var(--border);
}
.daySummaryMain{
  display:flex;
  align-items:baseline;
  gap:10px;
}
.dayTitle{font-weight:900;font-size:15px}
.dayCount{font-size:12px;color:var(--muted)}
.daySummaryMeta{
  display:flex;
  align-items:center;
  gap:10px;
}
.dayLink{font-size:12px;color:var(--accent)}
.dayChevron{
  width:10px;height:10px;
  border-right:2px solid var(--muted);
  border-bottom:2px solid var(--muted);
  transform:rotate(45deg);
  transition:transform .2s ease;
}
.dayGroup[open] .dayChevron{transform:rotate(-135deg)}
.dayBody{
  padding:12px 12px 14px;
  display:grid;
  gap:10px;
}

.stageGroup{
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.02);
}
.stageGroup summary{list-style:none}
.stageGroup summary::-webkit-details-marker{display:none}
.stageSummary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  cursor:pointer;
  min-height:44px;
}
.stageSummaryMain{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.stageTitle{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.6px;
  color:var(--muted);
  font-weight:700;
}
.stageGenre{
  font-size:11px;
  color:var(--muted);
  border:1px solid var(--border);
  border-radius:999px;
  padding:2px 8px;
  background:rgba(255,255,255,.04);
}
.stageCount{font-size:12px;color:var(--muted)}
.stageChevron{
  width:8px;height:8px;
  border-right:2px solid var(--muted);
  border-bottom:2px solid var(--muted);
  transform:rotate(45deg);
  transition:transform .2s ease;
}
.stageGroup[open] .stageChevron{transform:rotate(-135deg)}
.stageBody{
  padding:12px 10px 12px;
}
.slotList{display:flex;flex-direction:column}
.slot.isTarget{
  outline:2px solid rgba(107,92,255,.7);
  box-shadow:0 0 0 4px rgba(107,92,255,.25);
}

/* ===== LIST / ACT ===== */
.list{display:flex;flex-direction:column;gap:10px}

.act{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  margin-bottom:16px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
}

.act:hover{background:rgba(255,255,255,.06)}
.actName{font-weight:900;font-size:18px}
.actNameLink{color:var(--text);text-decoration:none}
.actNameLink:hover{text-decoration:underline}
.actNameLink:focus-visible{outline:2px solid rgba(107,92,255,.7);outline-offset:2px;border-radius:4px}
.actMeta{color:var(--muted);font-size:12px;margin-top:4px}

.badges{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
  min-width: 180px;
}

.badge{
  grid-area:badge;
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--muted);
  font-weight:900;
  white-space:nowrap;
}
.badge.ok{border-color:rgba(86,210,155,.35);color:var(--ok);background:rgba(86,210,155,.10)}
.badge.warn{border-color:rgba(242,201,76,.35);color:var(--warn);background:rgba(242,201,76,.10)}
.badge.bad{border-color:rgba(224,86,91,.35);color:var(--danger);background:rgba(224,86,91,.10)}

/* inline favorites bar */
.inlineFavoritesBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:8px 0 12px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.04);
}
.inlineToggle{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.inlineToggleBtn{
  min-height:40px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-weight:800;
  font-size:12px;
  cursor:pointer;
}
.inlineToggleBtn.isActive{
  background:rgba(107,92,255,.25);
  border-color:rgba(107,92,255,.45);
}
.inlineProgress{color:var(--muted);font-size:12px;font-weight:700}

/* rating bar (explicit options instead of cycle click) */
.ratingSelect{
  grid-area:rating;
  display:inline-flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* segmented rating controls */
.ratingSegmented{
  display:inline-flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.ratingSegBtn{
  min-height:40px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-weight:900;
  font-size:11px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.ratingSegBtn:hover{background:rgba(255,255,255,.08)}
.ratingSegBtn .ratingEmoji{font-size:15px;line-height:1}
.ratingSegBtn .segLabel{font-size:11px;color:var(--muted)}
.ratingSegBtn.isActive{
  border-color:rgba(107,92,255,.6);
  background:rgba(107,92,255,.18);
  box-shadow:0 0 0 2px rgba(107,92,255,.2), 0 0 14px rgba(107,92,255,.35);
}
.ratingSegBtn[data-rate="liked"].isActive{
  border-color:rgba(86,210,155,.6);
  background:rgba(86,210,155,.16);
  box-shadow:0 0 0 2px rgba(86,210,155,.2), 0 0 14px rgba(86,210,155,.35);
}
.ratingSegBtn[data-rate="maybe"].isActive{
  border-color:rgba(242,201,76,.7);
  background:rgba(242,201,76,.16);
  box-shadow:0 0 0 2px rgba(242,201,76,.2), 0 0 14px rgba(242,201,76,.35);
}
.ratingSegBtn[data-rate="disliked"].isActive{
  border-color:rgba(224,86,91,.7);
  background:rgba(224,86,91,.16);
  box-shadow:0 0 0 2px rgba(224,86,91,.2), 0 0 14px rgba(224,86,91,.35);
}
.ratingSegBtn[data-rate="unrated"].isActive{
  border-color:rgba(255,255,255,.4);
  background:rgba(255,255,255,.12);
  box-shadow:0 0 0 2px rgba(255,255,255,.12), 0 0 10px rgba(255,255,255,.2);
}

.playRow{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:6px;
}
.playBtn{
  min-height: var(--tap);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-weight:900;
  font-size:11px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.playBtn:hover{background:rgba(255,255,255,.10)}
.playIcon{font-size:12px;line-height:1}
.playMoreBtn{
  min-height: var(--tap);
  width: var(--tap);
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
}
.playMoreBtn:hover{background:rgba(255,255,255,.10)}
.playMoreIcon{font-size:18px;line-height:1}
.playMenu{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:220px;
  padding:10px;
  border-radius:12px;
  background:rgba(12,14,24,.96);
  border:1px solid var(--border);
  box-shadow:0 18px 40px rgba(0,0,0,.35);
  margin-left:8px;
}
.playMenuTitle{font-size:12px;color:var(--muted);margin-bottom:4px}
.playMenuLink,.playMenuDefault{
  font-size:12px;
  text-decoration:none;
  color:var(--text);
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:10px;
  padding:6px 10px;
  text-align:left;
}
.playMenuLink:hover,.playMenuDefault:hover{background:rgba(255,255,255,.08)}

.ratingChip{
  min-height: var(--tap);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-weight:900;
  font-size:11px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.ratingChip .ratingEmoji{font-size:15px;line-height:1}
.ratingChip .ratingLabel{font-size:11px;color:var(--muted)}
.ratingChip:hover{background:rgba(255,255,255,.08)}
.ratingChip.isActive{
  border-color:rgba(107,92,255,.6);
  background:rgba(107,92,255,.18);
  box-shadow:0 0 0 2px rgba(107,92,255,.2), 0 0 14px rgba(107,92,255,.35);
}
.ratingChip[data-rate="liked"].isActive{
  border-color:rgba(86,210,155,.6);
  background:rgba(86,210,155,.16);
  box-shadow:0 0 0 2px rgba(86,210,155,.2), 0 0 14px rgba(86,210,155,.35);
}
.ratingChip[data-rate="maybe"].isActive{
  border-color:rgba(242,201,76,.7);
  background:rgba(242,201,76,.16);
  box-shadow:0 0 0 2px rgba(242,201,76,.2), 0 0 14px rgba(242,201,76,.35);
}
.ratingChip[data-rate="disliked"].isActive{
  border-color:rgba(224,86,91,.7);
  background:rgba(224,86,91,.16);
  box-shadow:0 0 0 2px rgba(224,86,91,.2), 0 0 14px rgba(224,86,91,.35);
}
.ratingChip[data-rate="unrated"].isActive{
  border-color:rgba(255,255,255,.4);
  background:rgba(255,255,255,.12);
  box-shadow:0 0 0 2px rgba(255,255,255,.12), 0 0 10px rgba(255,255,255,.2);
}

.rbtn:active,.btn:active{transform:translateY(1px)}

/* ===== CARDS ===== */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
}
.cardTitle{font-weight:900;margin-bottom:10px}
.muted{color:var(--muted);font-size:13px;line-height:1.4}

.favHeader{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.favHeader .cardTitle{margin-bottom:0}
.favCountPill{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  line-height:1.1;
}
.favCountPill.isActive{
  background:rgba(107,92,255,.25);
  border-color:rgba(107,92,255,.45);
}
.favPlanNote{margin-bottom:10px}
.favEmpty{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,.03);
  display:flex;
  flex-direction:column;
  gap:10px;
}
.favEmptyText{font-size:13px;line-height:1.5}
.favEmptyTip{font-size:12px}
.favEmptyLink{
  background:none;
  border:0;
  padding:0;
  margin:0;
  color:var(--muted);
  text-align:left;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  min-height:var(--tap);
  font:inherit;
}
.favEmptyLink:hover{color:var(--accent);text-decoration:underline}
.favEmptyLink:focus-visible{
  outline:none;
  color:var(--accent);
  text-decoration:underline;
  box-shadow:0 0 0 3px rgba(107,92,255,.25);
  border-radius:10px;
  padding:0 6px;
}
.favEmptyPreview{
  border:1px dashed var(--border);
  border-radius:12px;
  padding:10px;
  background:rgba(255,255,255,.02);
  color:var(--muted);
  font-size:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.favEmptyPreviewTitle{color:var(--text);font-weight:700}
.favEmptyPreviewDay{color:var(--muted);font-weight:600}
.favEmptyPreviewList{display:flex;flex-direction:column;gap:4px}

.btn{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  min-height: var(--tap);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  font-weight:900;
}
.btn.isDisabled{
  opacity:.6;
  pointer-events:none;
}
.btn.primary{background:rgba(107,92,255,.22);border-color:rgba(107,92,255,.35)}
.side .card .btn{width:100%}
.side .card .btn,
.side .card .btn.primary{
  font-size:13px;
  font-weight:800;
  letter-spacing:.2px;
  background:rgba(255,255,255,.06);
  border-color:var(--border);
}

.favList{display:flex;flex-direction:column;gap:10px}
.favItem{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,.04);
  cursor:pointer;
  user-select:none;
  -webkit-user-select:none;
  caret-color:transparent;
}
.favItem:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(107,92,255,.25);
  border-color:rgba(107,92,255,.55);
}
.favItemTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.favRemoveBtn{
  min-height:var(--tap);
  padding:6px 8px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.favRemoveBtn:hover{color:var(--text);background:rgba(255,255,255,.08)}
.favRemoveBtn:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(107,92,255,.25);
  border-color:rgba(107,92,255,.55);
}
.footerLinks{display:flex;gap:12px;justify-content:flex-start;color:var(--muted);font-size:13px;flex-wrap:wrap}
.privacyNote{margin-top:8px;font-size:12px;line-height:1.5}
.buildStamp{margin-top:6px;font-size:11px;letter-spacing:.02em}

/* Mobile menu overlay & sheet */
.menuOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:60;
  touch-action:none;
}
.menuSheet{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  background:var(--panel);
  border-top-left-radius:18px;
  border-top-right-radius:18px;
  border:1px solid var(--border);
  border-bottom:none;
  padding:10px 14px calc(16px + env(safe-area-inset-bottom));
  max-height:calc(100dvh - 16px);
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  transform:translateY(100%);
  transition:transform .25s ease;
  z-index:70;
  box-shadow:var(--shadow);
}
.menuSheet.isOpen{transform:translateY(0)}
.menuHandle{
  width:44px;
  height:4px;
  border-radius:999px;
  background:rgba(255,255,255,.15);
  margin:2px auto 10px;
}
.menuHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.menuTitle{font-weight:900}
.menuClose{
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.menuGroup{margin:10px 0}
.menuGroupTitle{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
  margin-bottom:6px;
}
.menuSubTitle{
  font-size:12px;
  color:var(--muted);
  margin:8px 0 6px;
}
.menuDayLinks{display:flex;flex-direction:column;gap:6px}
.menuItem{
  min-height:44px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  font-weight:800;
  text-align:left;
  cursor:pointer;
}
.menuItem.isSub{font-weight:700}
.menuEmpty{color:var(--muted);font-size:12px}

/* Toasts and update banner */
.toast{
  position:fixed;
  left:50%;
  bottom:16px;
  transform:translateX(-50%) translateY(6px);
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(20,22,40,.95);
  color:var(--text);
  font-size:12px;
  font-weight:700;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  box-shadow:var(--shadow);
  z-index:50;
}
.toast.isVisible{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

.updateBanner{
  position:fixed;
  left:50%;
  bottom:16px;
  transform:translateX(-50%) translateY(6px);
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(20,22,40,.95);
  color:var(--text);
  font-size:12px;
  font-weight:700;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  box-shadow:var(--shadow);
  z-index:80;
}
.updateBanner.isVisible{
  opacity:1;
  transform:translateX(-50%) translateY(0);
  pointer-events:auto;
}
.updateBannerText{
  color:var(--text);
}

.playOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  display:none;
  z-index:90;
}
.playOverlay.isOpen{display:block}
.playPanel{
  position:fixed;
  min-width:220px;
  max-width:280px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  box-shadow:var(--shadow);
}
.playOverlay.isSheet .playPanel{
  left:0;
  right:0;
  bottom:0;
  top:auto;
  max-width:none;
  border-radius:16px 16px 0 0;
  padding:14px;
}
.playPanelTitle{
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
}
.playPanelList{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.playRowItem{
  display:flex;
  align-items:center;
  gap:8px;
}
.playLink{
  flex:1 1 auto;
  min-height: var(--tap);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  font-weight:800;
  text-decoration:none;
}
.playLink:hover{background:rgba(255,255,255,.10)}
.playDefaultBtn{
  min-height: var(--tap);
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--muted);
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
  font-size:11px;
}
.playDefaultBtn.isActive{
  border-color:rgba(107,92,255,.6);
  color:var(--text);
  background:rgba(107,92,255,.18);
}

body.menuOpen{
  overflow:hidden;
  position:fixed;
  width:100%;
  touch-action:none;
}

/* ===== LEGAL ===== */
.legalLayout{
  max-width: 980px;
  margin: 18px auto 28px;
  padding: 0 16px;
}
.legalPanel{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  line-height:1.6;
}
.legalPanel h1{margin-top:0}

/* ===== MOBILE ===== */
@media (max-width: 980px){
  .layout{grid-template-columns: 1fr}
  .subtitle{max-width: unset}

  .topbar{align-items:flex-start}
  .brand{min-width: unset}
  .controls{gap:10px;grid-template-columns: repeat(3, minmax(0, 1fr))}
  .toolbar .ctrl{min-width:unset;width:100%}
  .toolbar select, .toolbar input{width:100%}
  .act{
    flex-direction:column;
    align-items:flex-start;
  }

  .badges{
    align-items:flex-start;
    min-width: unset;
    width: 100%;
  }

  .inlineFavoritesBar{
    flex-direction:column;
    align-items:flex-start;
  }

  .ratingBar{
    justify-content:flex-start;
  }

  .ratingSegmented{justify-content:flex-start}

  .pill{max-width: 100%;}
}

@media (max-width: 720px){
  .topbar{padding:calc(12px + env(safe-area-inset-top)) 12px 12px;gap:10px}
  .controls{width:100%;grid-template-columns:1fr;justify-content:flex-start}
  .controls .ctrl{width:100%}
  .layout{padding:calc(10px + var(--topbar-h, 72px)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left))}
  .panel{padding:12px}
  .weekendHeader{flex-direction:column;align-items:flex-start}
  .weekendHeader .ctrl{width:100%}
  .weekendTabs{flex-wrap:wrap}
  .tabBtn{flex:1 1 auto;text-align:center}
  .ratingSelect{width:100%}
  .ratingChip{padding:6px}
  .ratingLabel{display:none}
  .ratingSegmented{width:100%}
  .ratingSegBtn{flex:1 1 auto;justify-content:center}
  .ratingSegBtn .segLabel{display:none}
}



