:root {
  --bg: #12100d;
  --panel: #1c1813;
  --panel-2: #262016;
  --line: #3a3124;
  --text: #ece3d0;
  --muted: #9b8f78;
  --gold: #e8c15a;
  --accent: #c8932f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, select { font: inherit; color: inherit; }
button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .8rem; cursor: pointer; }
button:hover { border-color: var(--accent); }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .8rem 1rem; background: linear-gradient(#241d12, var(--panel)); border-bottom: 1px solid var(--accent); }
.topbar h1 { margin: 0; font-size: 1.25rem; color: var(--gold); }
.topbar h1 small { color: var(--muted); font-weight: 400; font-size: .8rem; margin-left: .3rem; }
.prefs { display: flex; gap: .75rem; flex-wrap: wrap; }
.tz { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; }
.tz select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .5rem; max-width: 60vw; }

main { max-width: 1280px; margin: 0 auto; padding: 1rem; }
.controls { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.nav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.nav h2 { margin: 0 0 0 .5rem; font-size: 1.15rem; color: var(--gold); text-transform: capitalize; }
.views { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.views button { border: 0; border-radius: 0; background: var(--panel); }
.views button[aria-selected="true"] { background: var(--accent); color: #1a1205; font-weight: 600; }

.filter { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; margin-bottom: 1rem; }
.filter summary { cursor: pointer; font-weight: 600; }
.filter summary span { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: .4rem; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.filter-actions button { padding: .25rem .6rem; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; padding-bottom: .3rem; }
.chip { max-width: 100%; text-align: left; overflow-wrap: anywhere; hyphens: auto; display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem .25rem .3rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: .85rem; }
.chip[aria-pressed="false"] { opacity: .4; filter: grayscale(1); }
.chip[aria-pressed="true"] { border-color: var(--c, var(--accent)); }

.ico { width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%; object-fit: contain; display: inline-grid; place-items: center; background: var(--c, #444); font-size: .9rem; line-height: 1; }
.ico.sm { width: 1.25rem; height: 1.25rem; font-size: .75rem; }
.ico.lg { width: 2.2rem; height: 2.2rem; font-size: 1.3rem; }

.error { background: #4a1414; border: 1px solid #a33; color: #ffd6d6; padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; white-space: pre-wrap; }

/* ---------- Monat ---------- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.month .wd { background: var(--panel-2); padding: .4rem; text-align: center; font-size: .8rem; color: var(--muted); }
.cell { background: var(--panel); min-height: 6.5rem; padding: .3rem; display: flex; flex-direction: column; gap: .2rem; cursor: pointer; min-width: 0; }
.cell:hover { background: #221c13; }
.cell.other { opacity: .45; }
.cell.today { box-shadow: inset 0 0 0 2px var(--gold); }
.cell .dn { font-size: .8rem; color: var(--muted); }
.cell.today .dn { color: var(--gold); font-weight: 700; }
.evs { display: flex; flex-wrap: wrap; gap: .2rem; }
.ev-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .35rem .1rem .1rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 22%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); font-size: .72rem; white-space: nowrap; }
.ev-chip { max-width: 100%; }
.ev-chip .n { overflow: hidden; text-overflow: ellipsis; }
.ev-chip .t { display: none; }

/* ---------- Woche / Tag ---------- */
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .5rem; }
.daycard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .6rem; min-width: 0; }
.daycard.today { border-color: var(--gold); }
.daycard h3 { margin: 0 0 .5rem; font-size: .9rem; color: var(--muted); font-weight: 600; cursor: pointer; text-transform: capitalize; }
.daycard.today h3 { color: var(--gold); }
.row { display: flex; align-items: center; gap: .5rem; padding: .35rem .4rem; border-radius: 8px; margin-bottom: .3rem; background: color-mix(in srgb, var(--c) 18%, var(--panel-2)); border-left: 3px solid var(--c); min-width: 0; }
.row > div { min-width: 0; }
.row .nm { font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; hyphens: auto; }
.row .tm { font-size: .78rem; color: var(--muted); }
.empty { color: var(--muted); font-size: .85rem; padding: .3rem; }

.day { max-width: 720px; margin: 0 auto; }
.day .row { padding: .7rem .8rem; gap: .8rem; }
.day .nm { font-size: 1.05rem; }
.day .big { flex: none; }
.day .meta { color: var(--muted); font-size: .85rem; }
.day .big { margin-left: auto; font-size: 1.4rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (min-width: 760px) {
  .ev-chip .t { display: inline; color: var(--muted); }
  .cell { min-height: 8rem; padding: .4rem; }
}
@media (min-width: 1100px) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
  main { padding: .6rem; }
  .cell { min-height: 4.2rem; padding: .2rem; }
  .ev-chip { padding: 0; border: 0; background: none; }
  .ev-chip .n { display: none; }
  .ev-chip .ico { width: 1.15rem; height: 1.15rem; }
  .evs { gap: .15rem; }
  .month .wd { padding: .3rem 0; font-size: .7rem; }
  .views { width: 100%; }
  .views button { flex: 1; }
}
