/* Edufeed Termine – Stylesheet (ohne Framework, Light/Dark über CSS-Variablen) */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --text: #16191f;
  --text-2: #4b5563;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #ccfbf1;
  --accent-contrast: #ffffff;
  --danger: #b91c1c;
  --today: #0f766e;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .08);
  --shadow-lg: 0 20px 40px -12px rgb(16 24 40 / .25);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 300px;
  --topbar-h: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #151b23;
    --surface-2: #1c2330;
    --border: #2a3342;
    --text: #e6edf3;
    --text-2: #b6c2cf;
    --muted: #8b98a8;
    --accent: #2dd4bf;
    --accent-2: #5eead4;
    --accent-soft: #123b38;
    --accent-contrast: #062421;
    --danger: #f87171;
    --today: #2dd4bf;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-lg: 0 20px 50px -10px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #151b23; --surface-2: #1c2330; --border: #2a3342;
  --text: #e6edf3; --text-2: #b6c2cf; --muted: #8b98a8; --accent: #2dd4bf; --accent-2: #5eead4;
  --accent-soft: #123b38; --accent-contrast: #062421; --danger: #f87171; --today: #2dd4bf;
  --shadow: 0 1px 2px rgb(0 0 0 / .4); --shadow-lg: 0 20px 50px -10px rgb(0 0 0 / .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 550; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 17px; white-space: nowrap; }
.brand b { color: var(--accent); }
.search {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; margin-left: auto;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; color: var(--muted);
}
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search kbd { font-size: 12px; border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.avatar-btn { padding: 0 12px 0 3px; }
.relay-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px var(--surface); }
.relay-dot.ok { background: #22c55e; }
.relay-dot.partial { background: #f59e0b; }
.relay-dot.down { background: #ef4444; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 16px; border-right: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 18px;
}
.panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; font-weight: 650; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.chip .count { font-size: 11px; opacity: .7; }
.chip.static { cursor: default; }
.chip.removable::after { content: "×"; font-size: 15px; margin-left: 2px; opacity: .8; }
.author-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; cursor: pointer;
}
.author-item:hover { background: var(--surface-2); }
.author-item[aria-pressed="true"] { background: var(--accent-soft); }
.author-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.author-item .count { font-size: 12px; color: var(--muted); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none; object-fit: cover;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--c, var(--accent));
}
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); }
.sidebar-foot p { margin: 4px 0; }

/* Mini-Kalender */
.mini-cal .mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-cal .mini-head b { font-size: 14px; }
.mini-cal .icon-btn { width: 28px; height: 28px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.mini-grid .dow { color: var(--muted); font-weight: 600; padding: 2px 0; }
.mini-grid button {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 12px; color: var(--text);
}
.mini-grid button:hover { background: var(--surface-2); }
.mini-grid button.out { color: var(--muted); opacity: .55; }
.mini-grid button.today { color: var(--accent); font-weight: 800; }
.mini-grid button.selected { background: var(--accent); color: var(--accent-contrast); }
.mini-grid button.has::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent-2); }
.mini-grid button.selected.has::after { background: var(--accent-contrast); }

/* ---------- Main / Toolbar ---------- */
.main { min-width: 0; padding: 16px 20px 40px; outline: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.nav-group { display: flex; align-items: center; gap: 6px; }
#range-label { font-size: 22px; font-weight: 700; margin-left: 8px; letter-spacing: -.01em; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-weight: 550; color: var(--text-2); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.active-filters:empty { display: none; }
.loading-bar { height: 3px; border-radius: 3px; overflow: hidden; background: var(--surface-2); margin-bottom: 10px; }
.loading-bar span { display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; border-radius: 3px; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Monatsansicht ---------- */
.month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.month-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.month-dow div { padding: 8px 10px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(118px, 1fr); }
.day {
  min-width: 0; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.day:nth-child(7n) { border-right: 0; }
.day.out { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.day.out .day-num { color: var(--muted); }
.day.weekend { background: color-mix(in srgb, var(--surface-2) 35%, transparent); }
.day-num {
  align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; border: 0; background: transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2);
}
.day-num:hover { background: var(--surface-2); }
.day.today .day-num { background: var(--today); color: var(--accent-contrast); }
.pill {
  display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0;
  padding: 2px 6px; border-radius: 6px; border: 0; cursor: pointer; text-align: left; font-size: 12.5px; line-height: 1.35;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--text);
  border-left: 3px solid var(--c);
}
.pill:hover { background: color-mix(in srgb, var(--c) 24%, transparent); }
.pill .t { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11.5px; flex: none; }
.pill .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.allday { background: var(--c); color: #fff; border-left-color: transparent; }
.pill.allday:hover { filter: brightness(1.08); }
.more { border: 0; background: none; font-size: 12px; color: var(--muted); cursor: pointer; text-align: left; padding: 1px 6px; font-weight: 600; }
.more:hover { color: var(--accent); }

/* ---------- Wochenansicht ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 320px; display: flex; flex-direction: column; overflow: hidden; }
.week-col.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.week-head { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 6px; }
.week-head .dow { text-transform: uppercase; font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .05em; }
.week-head .num { font-size: 20px; font-weight: 750; }
.week-col.today .num { color: var(--accent); }
.week-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.week-card {
  display: block; width: 100%; text-align: left; cursor: pointer; border: 0; border-radius: 8px;
  padding: 7px 9px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-left: 3px solid var(--c);
}
.week-card:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.week-card .time { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.week-card .title { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.week-empty { color: var(--muted); font-size: 13px; padding: 4px; }

/* ---------- Listenansicht ---------- */
.agenda { display: flex; flex-direction: column; gap: 22px; max-width: 980px; }
.agenda-month { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 0 -8px; }
.agenda-day { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; }
.date-badge {
  position: sticky; top: calc(var(--topbar-h) + 12px); align-self: start;
  display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.date-badge .dow { font-size: 12px; font-weight: 650; text-transform: uppercase; color: var(--muted); }
.date-badge .num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.date-badge .mon { font-size: 12px; color: var(--text-2); }
.date-badge.today { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.date-badge.today .dow, .date-badge.today .mon { color: inherit; opacity: .85; }
.agenda-events { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); cursor: pointer; text-align: left; width: 100%; position: relative; overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.card:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--border)); transform: translateY(-1px); }
.card { transition: transform .12s, border-color .12s; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { width: 15px; height: 15px; }
.card h3 { overflow-wrap: anywhere; font-size: 16.5px; line-height: 1.3; margin: 4px 0; font-weight: 680; }
.card p { margin: 0; color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.card-foot .by { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-right: 6px; }
.card-foot .avatar { width: 20px; height: 20px; font-size: 9px; }
.tag { font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.card-img { width: 112px; height: 84px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.load-more { align-self: center; }
.empty {
  display: grid; place-items: center; text-align: center; gap: 8px;
  padding: 60px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty svg { width: 40px; height: 40px; stroke-width: 1.5; }
.skeleton { height: 92px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border: 1px solid var(--border); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Dialoge ---------- */
.dialog {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border);
  border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgb(8 12 20 / .5); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 19px; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field textarea, .row input {
  font-weight: 400; font-size: 15px; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%;
}
.field input:focus, .field textarea:focus, .row input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; gap: 8px; }

.dialog-event { width: min(760px, calc(100vw - 24px)); }
.ev-hero { position: relative; aspect-ratio: 21 / 8; background: var(--surface-2) center / cover no-repeat; border-bottom: 1px solid var(--border); }
.ev-hero.noimg { aspect-ratio: auto; height: 10px; background: var(--c); border: 0; }
.ev-close { position: absolute; top: 10px; right: 10px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(6px); z-index: 2; }
.ev-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.ev-title { overflow-wrap: anywhere; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; padding-right: 36px; }
.ev-facts { display: grid; gap: 10px; }
.ev-fact { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 15px; }
.ev-fact svg { color: var(--accent); margin-top: 1px; }
.ev-fact .sub { font-size: 13px; color: var(--muted); }
.ev-summary { font-size: 16px; color: var(--text-2); margin: 0; font-weight: 500; }
.ev-desc { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.ev-desc p { margin: 0 0 .8em; }
.ev-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-author { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
.ev-author .who { flex: 1; min-width: 0; }
.ev-author .who b { display: block; }
.ev-author .who span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rsvp { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.rsvp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rsvp-head h3 { font-size: 15px; }
.rsvp-faces { display: flex; flex-wrap: wrap; gap: 4px; }
.rsvp-faces .avatar { width: 28px; height: 28px; box-shadow: 0 0 0 2px var(--surface); }
.ev-tech { font-size: 12px; color: var(--muted); }
.ev-tech summary { cursor: pointer; }
.ev-tech code { display: block; padding: 8px; margin-top: 6px; border-radius: 6px; background: var(--surface-2); overflow-wrap: anywhere; font-size: 11.5px; }

.relay-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.relay-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.relay-list .url { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.relay-list .st { font-size: 12px; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot.open { background: #22c55e; }
.status-dot.connecting { background: #f59e0b; animation: pulse 1s infinite; }
.status-dot.error, .status-dot.closed { background: #ef4444; }
@keyframes pulse { 50% { opacity: .35; } }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { pointer-events: auto; max-width: 480px; padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.noscript { padding: 20px; text-align: center; }

/* ---------- Responsive ---------- */
.only-mobile { display: none; }
@media (max-width: 1100px) {
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --topbar-h: 56px; }
  .only-mobile { display: inline-grid; }
  .hide-mobile { display: none !important; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand span { display: none; }
  .search { margin-left: 0; min-width: 0; padding: 0 10px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn { padding: 0 9px; }
  .avatar-btn { padding: 0 3px !important; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 40; top: 0; left: 0; height: 100vh; width: min(320px, 86vw);
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgb(8 12 20 / .45); z-index: 30; }
  .main { padding: 12px 16px 32px; }
  #range-label { font-size: 18px; }
  .month-grid { grid-auto-rows: minmax(84px, 1fr); }
  .day { padding: 3px; }
  .pill { padding: 1px 4px; font-size: 11px; }
  .pill .t { display: none; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .week-col { min-height: 0; }
  .agenda-day { grid-template-columns: 54px minmax(0, 1fr); gap: 10px; }
  .date-badge .num { font-size: 21px; }
  .card { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .card-img { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .ev-body { padding: 16px; }
  .ev-title { font-size: 20px; }
}
@media (max-width: 560px) {
  .toolbar { gap: 8px; }
  .toolbar .nav-group:first-child { width: 100%; }
  .month-dow div { padding: 6px 2px; text-align: center; font-size: 10.5px; }
  .pill.allday, .pill { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .sidebar, .toolbar, .active-filters { display: none !important; }
  .layout { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}
