:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #315c60;
  background: #f6fbf4;
  --day: 6px;
  --row-h: 50px;
  --label-w: 0px;
  --grid: #dceae1;
  --muted: #789597;
  --ink: #315c60;
  --surface: #ffffff;
  --surface-soft: #f2f8ef;
  --field: #e9f5df;
  --mint: #62dca9;
  --mint-deep: #168678;
  --accent: #2f80ed;
  --regional: #eb5757;
  --onsite: #f2c94c;
  --partner: #bf7a22;
  --code: #31835d;
  --ticketed: #2fbf71;
  --shadow: 0 10px 30px rgba(44, 94, 84, .08);
}

* { box-sizing: border-box; }

html { background: #f6fbf4; }

body {
  margin: 0;
  min-width: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(121, 235, 172, .20), transparent 28rem),
    radial-gradient(circle at 100% 18%, rgba(114, 220, 205, .13), transparent 24rem),
    #f6fbf4;
}

button, select, input { font: inherit; }

button, select, input, summary, a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(64, 198, 163, .30);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

main {
  width: min(100%, 1800px);
  margin: 0 auto;
  padding: 18px 24px 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.control {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .025em;
}

.control.search {
  order: -1;
  flex: 1 0 100%;
}

.controls input,
.controls select,
.controls button,
#today {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
}

.controls select,
.controls button,
#today {
  background: rgba(255,255,255,.92);
  border-color: #dbe8df;
  box-shadow: 0 2px 8px rgba(50, 100, 87, .04);
}

.controls select {
  padding: 8px 34px 8px 13px;
  cursor: pointer;
}

.controls .search input {
  width: 100%;
  min-height: 54px;
  padding: 12px 20px;
  border: 0;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(83, 159, 119, .05);
}

.controls .search input::placeholder {
  color: #6e9090;
  opacity: 1;
}

.controls button,
#today {
  padding: 8px 15px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease, border-color .12s ease;
}

.controls button:hover,
#today:hover {
  transform: translateY(-1px);
  filter: brightness(.985);
}

#today {
  background: #dff7e9;
  border-color: #c8ebd8;
  color: #216a61;
}

#zoom {
  width: 150px;
  min-height: 40px;
  padding: 0 4px;
  accent-color: var(--mint-deep);
  background: transparent;
}


.calendar-info {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.meta {
  margin-left: auto;
  text-align: right;
  font-weight: 700;
}

.legend-panel {
  position: relative;
}

.legend-panel summary {
  width: max-content;
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 7px 12px;
  border: 1px solid #dbe8df;
  border-radius: 999px;
  background: rgba(255,255,255,.84);
  color: #597779;
  font-weight: 800;
}

.legend-panel summary::-webkit-details-marker { display: none; }

.legend-panel summary::after {
  content: "⌄";
  display: inline-block;
  margin-left: 7px;
  transform: translateY(-1px);
  transition: transform .14s ease;
}

.legend-panel[open] summary::after {
  transform: rotate(180deg) translateY(1px);
}

.legend-popover {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: min(620px, calc(100vw - 48px));
  padding: 14px 15px;
  border: 1px solid #dbe8df;
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--shadow);
  z-index:20;
}

.legend,
.subtype-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.legend span,
.subtype-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subtype-legend {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid #edf3ee;
}

.subtype-legend[hidden] { display: none; }

.subtype-legend .legend-title {
  width: 100%;
  font-weight: 850;
  color: #557274;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

.swatch.regional { background: var(--regional); }
.swatch.onsite { background: var(--onsite); }
.swatch.partner { background: var(--regional); }
.swatch.code { background: var(--regional); }
.swatch.ticketed { background: var(--ticketed); }

.timeline-shell {
  position: relative;
  overflow: auto;
  min-height: 360px;
  max-height: calc(100vh - 205px);
  border: 1px solid #dce9e0;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  scrollbar-color: #bdd8cc transparent;
}

.timeline-shell::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.timeline-shell::-webkit-scrollbar-thumb {
  background: #c5ddd2;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.timeline-shell::-webkit-scrollbar-track {
  background: transparent;
}

.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}

.timeline {
  min-width: 100%;
  width: max-content;
}

.months,
.days,
.event-row {
  display: grid;
  grid-template-columns: var(--label-w) repeat(var(--days), var(--day));
}

.months {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 32px;
  background: #f1f8ef;
  border-bottom: 1px solid var(--grid);
}

.days {
  position: sticky;
  top: 32px;
  z-index: 7;
  height: 28px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--grid);
}

.corner {
  position: sticky;
  left: 0;
  z-index: 12;
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: inherit;
}

.month {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: 10px;
  border-left: 1px solid var(--grid);
  color: #58787a;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .025em;
  white-space: nowrap;
  overflow: hidden;
}

.day {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(220,234,225,.52);
  color: #8aa1a1;
  font-size: 9px;
}

.day.weekend {
  background: rgba(232,243,233,.55);
}

.day.today {
  background: #d9f5e6;
  color: #1e756a;
  font-weight: 900;
}

.event-row {
  position: relative;
  height: var(--row-h);
  border-bottom: 1px solid #edf3ee;
}

.row-grid {
  grid-column: 2 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(var(--days), var(--day));
}

.cell {
  border-left: 1px solid rgba(220,234,225,.34);
}

.cell.weekend {
  background: rgba(244,248,244,.74);
}

.cell.today {
  background: rgba(98,220,169,.115);
}

.bar {
  grid-row: 1;
  z-index: 3;
  align-self: center;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  position: relative;
  display: block;
  background: var(--accent);
  color: #fff;
  text-align: left;
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
  overflow: visible;
  clip-path: inset(0 round 13px);
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    0 2px 5px rgba(29, 78, 71, .13);
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}

.bar-label {
  position: sticky;
  left: 10px;
  display: block;
  width: min(520px, calc(100% - 8px), calc(100vw - 34px));
  height: 30px;
  margin: 4px 0;
  padding: 0 8px;
  overflow: hidden;
  line-height: 15px;
  white-space: normal;
  overflow-wrap: break-word;
}

.bar.regional { background: var(--regional); }
.bar.onsite { background: var(--onsite); color: #284b4e; }
.bar.partner { background: var(--regional); }
.bar.code { background: var(--regional); }
.bar.ticketed { background: var(--ticketed); }

.bar.expired {
  background: #a7b6b3;
  color: #fff;
  opacity: .66;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.13),
    0 1px 3px rgba(29,78,71,.08);
}

.bar.future {
  background: #a7b6b3;
  color: #fff;
  opacity: .78;
  border: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(29,78,71,.08);
}

.bar.future.global { border-color: var(--accent); }
.bar.future.regional,
.bar.future.partner,
.bar.future.code { border-color: var(--regional); }
.bar.future.onsite { border-color: var(--onsite); }
.bar.future.ticketed { border-color: var(--ticketed); }

.bar:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
}

.bar.expired:hover {
  filter: brightness(.95);
  opacity: .80;
}

.bar.future:hover {
  filter: brightness(.97);
  opacity: .92;
}

.access-badges,
.bonus-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.access-badges { margin: 0 0 16px; }
.bonus-badges { margin: -8px 0 16px; }

.access-badge,
.bonus-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.access-badge {
  background: #edf4f0;
  color: #476b6c;
}

.access-badge.global { background: #e8eeff; }
.access-badge.regional { background: #e8f6ec; }
.access-badge.onsite { background: #fff4c7; }
.access-badge.partner { background: #f7ecdc; }
.access-badge.code { background: #e3f2eb; }
.access-badge.ticketed { background: #fbe7eb; }

.bonus-badge {
  border: 1px solid #dce8e2;
  background: #eef5f1;
  color: #476668;
}

.bonus-badge.stardust { background:#f5ecfa; }
.bonus-badge.candy,
.bonus-badge.candy_xl { background:#fff0e8; }
.bonus-badge.xp { background:#e9f3ff; }

dialog {
  width: min(620px, calc(100vw - 40px));
  padding: 28px;
  border: 1px solid rgba(206,226,216,.92);
  border-radius: 26px;
  background: #fbfffb;
  color: var(--ink);
  box-shadow: 0 26px 90px rgba(24, 69, 64, .28);
}

dialog::backdrop {
  background: rgba(20, 48, 47, .46);
  backdrop-filter: blur(3px);
}

dialog h2 {
  margin: 5px 42px 18px 0;
  color: #315c60;
  line-height: 1.18;
}

.eyebrow {
  margin: 0;
  color: #729091;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

dialog .close {
  position: absolute;
  top: 14px;
  right: 15px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e8f4e5;
  color: #4d7273;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 9px 14px;
  font-size: 14px;
}

dt {
  color: var(--muted);
  font-weight: 750;
}

dd { margin: 0; }

.source-link {
  color: #177e73;
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.secondary-action,
.restore-hidden-event {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid #d6e5dd;
  border-radius: 999px;
  background: #f6fbf7;
  color: #496c6d;
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.secondary-action:hover,
.restore-hidden-event:hover {
  filter: brightness(.97);
}

.secondary-action:disabled {
  opacity: .5;
  cursor: default;
}

.dialog-help {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.hidden-events-list {
  display: grid;
  gap: 8px;
  max-height: min(420px,55vh);
  overflow: auto;
}

.hidden-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf3ee;
}

.hidden-event-info {
  min-width: 0;
  display: grid;
  gap: 3px;
  font-size: 13px;
}

.hidden-event-info strong { overflow-wrap: anywhere; }

.hidden-event-info span,
.hidden-empty {
  color: var(--muted);
  font-size: 12px;
}

.hidden-empty { margin: 4px 0; }

footer {
  padding: 18px 28px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 0; }

.update-status {
  margin-bottom: 5px;
  color: #597678;
  font-weight: 750;
}

.disclaimer { opacity: .88; }

@media (prefers-color-scheme: dark) {
  :root {
    color: #e7f5f2;
    background: #101d1d;
    --grid: #29403e;
    --muted: #9bb6b3;
    --ink: #e4f4f1;
    --surface: #172727;
    --surface-soft: #1b2d2c;
    --field: #203735;
    --shadow: 0 12px 34px rgba(0,0,0,.22);
  }

  html { background: #101d1d; }

  body {
    background:
      radial-gradient(circle at 8% 0%, rgba(72,190,145,.13), transparent 28rem),
      radial-gradient(circle at 100% 18%, rgba(66,167,159,.10), transparent 24rem),
      #101d1d;
  }

  .controls .search input {
    background: #203735;
    color: #e7f5f2;
    box-shadow: inset 0 0 0 1px rgba(130,204,171,.06);
  }

  .controls .search input::placeholder { color: #9ab3af; }

  .controls select,
  .controls button,
  #today,
  .legend-panel summary {
    background: #192b2a;
    border-color: #29413f;
    color: #d9eeea;
  }

  #today {
    background: #1e433a;
    border-color: #285348;
    color: #c9f1df;
  }

  
  .legend-popover {
    background: rgba(23,39,39,.98);
    border-color: #29413f;
  }

  .subtype-legend { border-top-color: #29413f; }
  .subtype-legend .legend-title { color: #c6dcda; }

  .timeline-shell {
    background: rgba(23,39,39,.97);
    border-color: #29413f;
  }

  .months { background: #1a2e2c; }

  .days {
    background: rgba(23,39,39,.98);
  }

  .month { color: #b8d1ce; }
  .day { color: #94adaa; }
  .day.weekend { background: rgba(28,48,46,.72); }

  .day.today {
    background: #234f43;
    color: #d9f8ea;
  }

  .event-row { border-bottom-color: #263b39; }
  .cell.weekend { background: rgba(19,35,34,.46); }
  .cell.today { background: rgba(90,217,166,.10); }

  .bar.expired {
    background: #5f706d;
    color: #e4f1ef;
    opacity: .67;
  }

  .bar.future {
    background: #5f706d;
    color: #e4f1ef;
    opacity: .80;
  }

  dialog {
    background: #172727;
    color: #e7f5f2;
    border-color: #2a4240;
  }

  dialog h2 { color: #e7f5f2; }

  dialog .close {
    background: #213b38;
    color: #cbe4df;
  }

  .secondary-action,
  .restore-hidden-event {
    background: #1b302e;
    border-color: #2b4542;
    color: #dbece9;
  }

  .hidden-event-row { border-bottom-color: #29413f; }
  .update-status { color: #bfd5d2; }
  .source-link { color: #78d8c4; }
}

@media (max-width: 760px) {
  main {
    padding: 12px 8px 0;
  }

  .controls {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 9px;
    padding: 0 4px;
    margin-bottom: 8px;
  }

  .control.search {
    grid-column: 1 / -1;
  }

  .controls .search input {
    min-height: 52px;
  }

  .control,
  .controls button {
    min-width: 0;
  }

  .controls input,
  .controls select,
  .controls button {
    width: 100%;
    min-width: 0;
    font-size: 16px;
  }

  .control > span:not(.sr-only) {
    padding-left: 5px;
    font-size: 10px;
  }

  .category-control {
    grid-column: 2;
  }

  .zoom-control {
    grid-column: 1 / -1;
  }

  #zoom {
    width: 100%;
  }

  .calendar-info {
    padding: 0 4px;
  }

  .legend-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    margin-top: 7px;
  }

  .meta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timeline-shell {
    width: 100%;
    min-height: 330px;
    max-height: calc(100dvh - 286px);
    border-radius: 20px;
  }

  .bar-label {
    left: 8px;
    width: min(520px, calc(100% - 8px), calc(100vw - 26px));
    padding-left: 7px;
    padding-right: 7px;
  }

  dialog {
    width: calc(100vw - 20px);
    padding: 24px 18px;
    border-radius: 24px;
  }

  dialog h2 { margin-right: 40px; }

  dl {
    grid-template-columns: 86px minmax(0,1fr);
    gap: 8px 10px;
  }

  footer {
    padding: 18px 12px 28px;
  }
}

@media (max-width: 430px) {
  .controls button {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 14px;
  }

  .calendar-info {
    font-size: 11px;
  }

  .legend-panel summary {
    padding: 6px 10px;
  }
}

/* Schema v4 detail presentation */
.ticket-dot{display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:999px;background:var(--ticketed);box-shadow:0 0 0 2px rgba(255,255,255,.72);vertical-align:1px}
.access-badge.subtype{background:#edf4f0}
.detail-section{margin-top:20px;padding-top:16px;border-top:1px solid #e7f0ea}
.detail-section[hidden]{display:none}
.detail-section h3{margin:0 0 10px;color:#557274;font-size:12px;letter-spacing:.035em;text-transform:uppercase}
.detail-section>p{margin:0;line-height:1.55;font-size:14px}
.detail-list{display:grid;gap:8px}
.detail-card{padding:10px 12px;border:1px solid #dfeae4;border-radius:14px;background:#f7fbf8}
.detail-card strong{display:block;font-size:13px}
.detail-card ul{margin:6px 0 0;padding-left:18px;color:#607d7d;font-size:12px;line-height:1.45}
.detail-card p{margin:5px 0 0;color:#6f8b8c;font-size:11px;line-height:1.45}
.source-list{display:flex;flex-wrap:wrap;gap:8px}
.source-list .source-link{display:inline-flex;align-items:center;min-height:34px;padding:7px 10px;border-radius:999px;background:#edf8f3;font-size:12px}
@media (prefers-color-scheme:dark){
  .detail-section{border-top-color:#29413f}.detail-section h3{color:#c6dcda}
  .detail-card{background:#1b302e;border-color:#2b4542}.detail-card ul,.detail-card p{color:#aac1be}
  .source-list .source-link{background:#1c3833}
}
@media (max-width:430px){.detail-card ul{padding-left:16px}}


/* Active obtainable sidebar */
main{width:min(100%,2100px)}
.calendar-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;align-items:start}
.calendar-column{min-width:0}
.obtainables-sidebar{position:sticky;top:18px;max-height:calc(100vh - 36px);overflow:auto;padding:16px;border:1px solid #dce9e0;border-radius:22px;background:rgba(255,255,255,.96);box-shadow:var(--shadow);scrollbar-color:#bdd8cc transparent}
.obtainables-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.obtainables-head h2{margin:2px 0 0;font-size:18px;line-height:1.1}
.obtainables-head .eyebrow{margin:0}
.sidebar-action,.hide-obtainable,.restore-hidden-obtainable{min-height:32px;padding:5px 9px;border:1px solid #d6e5dd;border-radius:999px;background:#f6fbf7;color:#496c6d;font:inherit;font-size:11px;font-weight:780;cursor:pointer}
.sidebar-action:hover,.hide-obtainable:hover,.restore-hidden-obtainable:hover{filter:brightness(.97)}
.obtainables-help{margin:9px 0 3px;color:var(--muted);font-size:11px;line-height:1.4}
.obtainables-meta{margin:0 0 10px;color:#607f80;font-size:10px;font-weight:800}
.obtainables-list{display:grid;gap:8px}
.obtainable-row{padding:10px;border:1px solid #dfeae4;border-radius:14px;background:#f7fbf8}
.obtainable-row-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.obtainable-row-head>div{min-width:0}
.obtainable-row strong{display:block;margin-top:2px;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
.obtainable-kind{display:block;color:#819b9a;font-size:9px;font-weight:850;letter-spacing:.06em;text-transform:uppercase}
.hide-obtainable{flex:none;min-height:26px;padding:3px 7px;font-size:9px}
.obtainable-flags{margin:5px 0 0;color:#668181;font-size:10px}
.obtainable-events{margin:7px 0 0;padding-left:17px;color:#6a8585;font-size:10px;line-height:1.45}
.obtainables-empty{margin:12px 2px;color:var(--muted);font-size:11px;line-height:1.45}
@media (prefers-color-scheme:dark){
  .obtainables-sidebar{background:rgba(23,39,39,.97);border-color:#29413f}
  .obtainable-row{background:#1b302e;border-color:#2b4542}
  .sidebar-action,.hide-obtainable,.restore-hidden-obtainable{background:#1b302e;border-color:#2b4542;color:#dbece9}
  .obtainable-flags,.obtainable-events{color:#aac1be}
}
@media (max-width:1100px){
  .calendar-layout{grid-template-columns:1fr}
  .obtainables-sidebar{position:static;max-height:none}
}

/* Legend in the primary control row */
.controls .legend-panel{align-self:end}
.controls .legend-panel summary{
  min-height:40px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 15px;
  border:1px solid #dbe8df;
  border-radius:999px;
  background:rgba(255,255,255,.92);
  color:var(--ink);
  box-shadow:0 2px 8px rgba(50,100,87,.04);
  font-weight:750;
}
.controls .legend-panel summary::after{
  content:"";
  width:7px;
  height:7px;
  margin-left:1px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transform-origin:center;
  transition:transform .14s ease;
}
.controls .legend-panel[open] summary::after{
  transform:rotate(225deg) translate(-1px,-1px);
}
.controls .legend-popover{
  top:calc(100% + 7px);
  left:0;
}
@media (prefers-color-scheme:dark){
  .controls .legend-panel summary{
    background:#192b2a;
    border-color:#29413f;
    color:#d9eeea;
  }
}
@media (max-width:760px){
  .controls .legend-panel{width:100%}
  .controls .legend-panel summary{width:100%;justify-content:center;font-size:16px}
  .controls .legend-popover{position:fixed;left:12px;right:12px;width:auto;top:auto;margin-top:7px}
}

/* Calendar status + disclaimer placement */
.calendar-status{
  margin-left:auto;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  gap:6px 12px;
  text-align:right;
}
.calendar-status .meta{margin-left:0}
.calendar-status .update-status{
  margin:0;
  color:var(--muted);
  font-weight:700;
}
.calendar-disclaimer{
  margin:8px 4px 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
  text-align:left;
}
@media (max-width:760px){
  .calendar-status{min-width:0;gap:4px 8px}
  .calendar-status .meta,
  .calendar-status .update-status{font-size:11px}
  .calendar-disclaimer{margin-left:4px;margin-right:4px}
}

/* Unified calendar toolbar */
.calendar-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:8px 16px;
  margin-bottom:10px;
}
.calendar-toolbar .controls{
  flex:1 1 620px;
  margin-bottom:0;
}
.calendar-toolbar .calendar-info{
  flex:0 0 auto;
  min-height:40px;
  margin:0 0 0 auto;
  padding:0;
}
.calendar-toolbar .calendar-status{
  white-space:nowrap;
}
@media (max-width:760px){
  .calendar-toolbar{
    display:block;
    margin-bottom:8px;
  }
  .calendar-toolbar .controls{
    margin-bottom:6px;
  }
  .calendar-toolbar .calendar-info{
    width:100%;
    min-height:0;
    padding:0 4px;
  }
  .calendar-toolbar .calendar-status{
    justify-content:flex-end;
    white-space:normal;
  }
}
