/* ==========================================================================
   Plan zajęć — arkusz stylów
   Dwa motywy (jasny/ciemny), widoki: semestr / miesiąc / tydzień / lista
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef1f8;
  --text: #14161c;
  --text-soft: #4a5468;
  --muted: #6b7688;
  --border: #e2e6f0;
  --border-strong: #cfd6e6;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --onsite: #2563eb;
  --onsite-soft: #e8efff;
  --remote: #0d9488;
  --remote-soft: #e2f7f2;
  --danger: #dc2626;
  --today-ring: #4f46e5;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --hour-px: 56px;
  --day-min-h: 74px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b0e13;
  --surface: #141821;
  --surface-2: #191e29;
  --surface-3: #1f2531;
  --text: #e8ecf4;
  --text-soft: #b3bccc;
  --muted: #8b95a7;
  --border: #232936;
  --border-strong: #313a4b;
  --accent: #8b8bff;
  --accent-soft: #1e1f3d;
  --onsite: #6b9bff;
  --onsite-soft: rgba(59, 130, 246, .16);
  --remote: #4fd1c5;
  --remote-soft: rgba(13, 148, 136, .18);
  --today-ring: #8b8bff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

/* Sam html trzyma wysokość okna; body rośnie z treścią (inaczej padding
   dolny — miejsce na dolną nawigację — był liczony wewnątrz 100vh i ucinał
   koniec długiego planu). */
html { height: 100%; }
body { min-height: 100%; }

body {
  margin: 0;
  padding: 0 clamp(12px, 3vw, 32px) 48px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.sprite { display: none; }

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: .85em;
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 6px;
}

.subtle { color: var(--muted); font-size: 13px; }

/* ---------- Górny pasek ---------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 4px 16px;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.logo {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #4338ca);
  box-shadow: var(--shadow-md);
}
.logo svg { width: 22px; height: 22px; }

.brand-text { min-width: 0; }
.brand h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
#groupLine { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Przyciski ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn.icon-only { width: 38px; padding: 0; justify-content: center; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.tiny { height: 26px; padding: 0 8px; font-size: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.spinning svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Menu eksportu ------------------------------------------------- */

.menu { position: relative; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-list[hidden] { display: none; }
.menu-list a {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
}
.menu-list a:hover { background: var(--surface-3); text-decoration: none; }
.menu-list a small { grid-column: 2; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.menu-list a svg { grid-row: span 2; color: var(--accent); }

/* ---------- Podsumowanie -------------------------------------------------- */

.summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 2fr);
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 900px) { .summary { grid-template-columns: 1fr; } }

.next-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.next-card::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}
.next-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 650;
}
.next-body { display: flex; flex-direction: column; gap: 3px; }
.next-title { font-size: 15.5px; font-weight: 650; line-height: 1.25; }
.next-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-soft); }
.next-meta span { display: inline-flex; align-items: center; gap: 5px; }
.next-meta svg { width: 14px; height: 14px; color: var(--muted); }
.next-empty { color: var(--muted); font-size: 13.5px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 92px;
  justify-content: center;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 550; color: var(--muted); margin-left: 3px; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat.onsite .stat-value { color: var(--onsite); }
.stat.remote .stat-value { color: var(--remote); }

/* ---------- Pasek narzędzi ------------------------------------------------ */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.toolbar.stuck { border-bottom-color: var(--border); }

.toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-row.filters { gap: 8px; }

.segmented {
  display: inline-flex;
  background: var(--surface-3);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"],
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.segmented.small button { padding: 6px 11px; font-size: 13px; }

.segmented button[data-mode="stacjonarne"].active { color: var(--onsite); }
.segmented button[data-mode="zdalne"].active { color: var(--remote); }

.nav { display: inline-flex; align-items: center; gap: 6px; }
.nav[hidden] { display: none; }
.period-label {
  font-weight: 650;
  font-size: 14.5px;
  min-width: 170px;
  text-align: center;
  text-transform: capitalize;
}

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 340px;
  min-width: 160px;
}
.search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 33px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

@media (max-width: 720px) {
  .toolbar-row.filters { gap: 6px; }
  .search { flex: 1 1 100%; max-width: none; order: 5; }
  .legend { order: 6; }
  .segmented { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 520px) {
  body { padding-left: 10px; padding-right: 10px; }
  .topbar { padding-top: 12px; }
  .brand h1 { font-size: 17px; }
  .stat-value { font-size: 19px; }
  .segmented button { padding: 6px 10px; font-size: 12.5px; }
  .modal-card { padding: 16px; }
  .md-row { grid-template-columns: 1fr; gap: 2px; }
}

.legend { margin-left: auto; display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 900px) { .legend { margin-left: 0; } }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.onsite { background: var(--onsite); }
.dot.remote { background: var(--remote); }

/* ---------- Popover (przedmioty) ------------------------------------------ */

.popover { position: relative; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover[open] > summary { border-color: var(--accent); color: var(--accent); }
.popover-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  width: min(340px, 88vw);
  max-height: 60vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
}
.popover-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 8px; }
.popover-head strong { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: auto; }

.check-list { display: flex; flex-direction: column; gap: 1px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
}
.check-item:hover { background: var(--surface-3); }
.check-item input { accent-color: var(--accent); width: 15px; height: 15px; }
.check-item .swatch { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.check-item .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Siatka miesiąca ----------------------------------------------- */

.view { min-height: 320px; }

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) { .year-grid { grid-template-columns: 1fr; } }

.month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.month.single { max-width: 100%; }

.month-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px 10px;
}
.month-head h3 { font-size: 15px; font-weight: 700; text-transform: capitalize; letter-spacing: -.01em; }
.month-head .month-year { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.month-head .month-count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.dow-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0 8px 6px;
  gap: 2px;
}
.dow-row span {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  padding: 0 8px 10px;
}

.day {
  min-height: var(--day-min-h);
  border-radius: 9px;
  padding: 5px 5px 6px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  min-width: 0;
}
.day.empty { background: transparent; }
.day.weekend { background: var(--surface-3); }
.day.has-classes { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.day.today { box-shadow: inset 0 0 0 2px var(--today-ring); }
.day.clickable { cursor: pointer; }
.day.clickable:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }

.day-num {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 4px;
}
.day.today .day-num { color: var(--accent); }
.day-num .badge-count {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted);
}

/* Kropki przedmiotów — widok zwarty na wąskich ekranach */
.dots { display: none; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.dots i.more {
  width: auto; height: auto;
  border-radius: 4px;
  background: transparent !important;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  font-style: normal;
}

@media (max-width: 760px) {
  .day .chips { display: none; }
  .day .dots { display: flex; }
  .day { min-height: 50px; padding: 4px; border-radius: 8px; }
  .month.large { --day-min-h: 50px; }
  .day-num .badge-count { display: none; }
  .days { gap: 3px; padding: 0 6px 8px; }
  .dow-row { padding: 0 6px 4px; }
  .dow-row span { font-size: 9.5px; }
}

.chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* ---------- Karta zajęć (chip) -------------------------------------------- */

.chip {
  --subject-color: var(--accent);
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 0 6px;
  align-items: stretch;
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: var(--onsite-soft);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: filter .12s, transform .08s, box-shadow .12s;
  position: relative;
}
.chip::before {
  content: "";
  grid-row: 1 / -1;
  background: var(--subject-color);
  border-radius: 7px 0 0 7px;
}
.chip-body { padding: 4px 6px 4px 2px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chip:hover { filter: brightness(.97); box-shadow: var(--shadow-sm); }
.chip:active { transform: scale(.995); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.chip.mode-zdalne {
  background: var(--remote-soft);
  border: 1px dashed color-mix(in srgb, var(--remote) 55%, transparent);
}
.chip.mode-zdalne::before { background: var(--remote); }

.chip-time {
  font-weight: 700;
  font-size: 10.5px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip-subject {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.chip-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-soft);
  min-width: 0;
}
.chip-form {
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .03em;
  padding: 0 3px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.chip-room {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-room svg { width: 10px; height: 10px; }
.chip.mode-zdalne .chip-room { color: var(--remote); }

.chip.more {
  display: block;
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-align: center;
  padding: 2px;
  border-radius: 6px;
}
.chip.more::before { display: none; }

/* Wariant zwarty — jedna linia (widok semestru) */
.chip.compact .chip-body { padding: 2px 5px 2px 2px; }
.chip.compact .chip-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.chip.compact .chip-time { font-size: 9.5px; flex: 0 0 auto; }
.chip.compact .chip-subject {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  font-size: 10px;
  font-weight: 600;
  min-width: 0;
  flex: 1 1 auto;
}
.chip.compact .chip-room {
  flex: 0 0 auto;
  font-size: 9px;
  color: var(--muted);
  font-weight: 650;
}
.chip.compact.mode-zdalne .chip-room { color: var(--remote); }

/* Semestr — miesiące jeden pod drugim (pełna szerokość = czytelne zajęcia) */
.year-grid.single-col { grid-template-columns: 1fr; }
.year-grid.single-col .day { min-height: 84px; }

/* ---------- Zjazdy -------------------------------------------------------- */

.zjazdy { display: flex; flex-direction: column; gap: 12px; }

.zjazd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.zjazd-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.zjazd-no {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
}
.zjazd-head h3 { font-size: 14.5px; font-weight: 700; }
.zjazd-stats { margin-left: auto; font-size: 12px; color: var(--muted); }
.zjazd-stats b { font-weight: 700; }
.zjazd-stats b.onsite { color: var(--onsite); }
.zjazd-stats b.remote { color: var(--remote); }

.zjazd-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
}
.zj-day { padding: 10px 12px 12px; }
.zj-day + .zj-day { border-left: 1px solid var(--border); }
@media (max-width: 720px) {
  .zj-day + .zj-day { border-left: 0; border-top: 1px solid var(--border); }
}
.zj-day h4 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 7px;
  font-size: 12.5px;
  font-weight: 650;
  text-transform: capitalize;
  color: var(--text-soft);
}
.zj-day h4 .dm { margin-left: auto; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.zc {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 3px 0 0 var(--subject-color, var(--accent));
  transition: background .12s, border-color .12s;
}
.zc:hover { background: var(--surface-3); border-color: var(--border-strong); }
.zc:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.zc.mode-zdalne { border-style: dashed; }
.zc-time { font-size: 11px; font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.zc-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.zc-subject { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-meta {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.zc-room {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--onsite-soft);
  color: var(--onsite);
  white-space: nowrap;
}
.zc-room.remote { background: var(--remote-soft); color: var(--remote); }

/* Chipy w widoku miesiąca — większe */
.month.large { --day-min-h: 132px; }
.month.large .chip { font-size: 11.5px; }
.month.large .chip-time { font-size: 11px; }

/* ---------- Widok tygodnia ------------------------------------------------ */

.week {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.week-scroll {
  overflow: auto;
  max-height: clamp(420px, 72vh, 860px);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.week-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.week-scroll::-webkit-scrollbar-track { background: transparent; }
.week-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid transparent;
  border-radius: 9px;
  background-clip: content-box;
}

.wk-head {
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(90px, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 8px 16px -14px rgba(0, 0, 0, .55);
}
.wk-head .wk-day {
  padding: 8px 6px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  border-left: 1px solid var(--border);
}
.wk-head .wk-day strong { display: block; font-size: 13.5px; color: var(--text); font-weight: 700; }
.wk-head .wk-day.today strong { color: var(--accent); }
.wk-head .wk-day.weekend { background: var(--surface-3); }
.wk-head .wk-corner { }

.wk-body {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  position: relative;
}
/* Kolumna godzin i narożnik zostają przy przewijaniu w poziomie,
   żeby przy wąskim oknie nie tracić osi czasu. */
.wk-hours {
  position: sticky;
  left: 0;
  z-index: 4;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.wk-hour-label {
  position: absolute;
  right: 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
  font-weight: 600;
}
.wk-head .wk-corner {
  position: sticky;
  left: 0;
  z-index: 6;
  background: var(--surface-2);
}
.wk-cols {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  position: relative;
}
.wk-col { position: relative; border-left: 1px solid var(--border); }
.wk-col.weekend { background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.wk-col.today { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.wk-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed var(--border);
  pointer-events: none;
}
.wk-line.hour { border-top-style: solid; border-top-color: color-mix(in srgb, var(--border) 80%, transparent); }

.wk-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 7px;
  padding: 3px 5px 3px 7px;
  font-size: 10.5px;
  line-height: 1.25;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  text-align: left;
  color: var(--text);
  background: var(--onsite-soft);
  box-shadow: inset 3px 0 0 var(--subject-color, var(--onsite));
  font-family: inherit;
}
.wk-event.mode-zdalne {
  background: var(--remote-soft);
  border: 1px dashed color-mix(in srgb, var(--remote) 50%, transparent);
  box-shadow: inset 3px 0 0 var(--remote);
}
.wk-event:hover { filter: brightness(.97); box-shadow: inset 3px 0 0 var(--subject-color, var(--onsite)), var(--shadow-sm); }
.wk-event .e-time { font-weight: 700; font-size: 10px; color: var(--text-soft); display: block; }
.wk-event .e-subject { font-weight: 650; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wk-event .e-room { color: var(--text-soft); font-size: 9.5px; display: block; margin-top: 1px; }
.wk-event.mode-zdalne .e-room { color: var(--remote); font-weight: 600; }

/* Krótkie zajęcia (np. 45 min) — chowamy salę, żeby nic nie było ucięte */
.wk-event.short { padding: 2px 4px 2px 6px; }
.wk-event.short .e-time { font-size: 9.5px; }
.wk-event.short .e-subject { -webkit-line-clamp: 2; }
.wk-event.short .e-room { display: none; }

.wk-empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- Widok listy --------------------------------------------------- */

.list { display: flex; flex-direction: column; gap: 12px; }
.list-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.list-day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.list-day-head .date { font-weight: 700; font-size: 14px; }
.list-day-head .tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-soft);
}
.list-day-head .tag.remote { background: var(--remote-soft); color: var(--remote); }
.list-day-head .tag.onsite { background: var(--onsite-soft); color: var(--onsite); }
.list-day-head .spacer { margin-left: auto; font-size: 12px; color: var(--muted); }

.list-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 10px 14px;
  align-items: start;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  background: none;
  border-left: 0; border-right: 0; border-bottom: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--subject-color, transparent);
}
.list-row:first-of-type { border-top: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.list-row .time small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.list-row .info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-row .subj { font-weight: 650; font-size: 13.5px; }
.list-row .meta { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12px; color: var(--text-soft); }
.list-row .meta span { display: inline-flex; align-items: center; gap: 4px; }
.list-row .meta svg { width: 13px; height: 13px; color: var(--muted); }
.list-row .room-badge {
  align-self: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--onsite-soft);
  color: var(--onsite);
  white-space: nowrap;
}
.list-row .room-badge.remote { background: var(--remote-soft); color: var(--remote); }
@media (max-width: 620px) {
  .list-row { grid-template-columns: 74px 1fr; }
  .list-row .room-badge { grid-column: 2; justify-self: start; }
}

/* ---------- Modal --------------------------------------------------------- */

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 20, .55); backdrop-filter: blur(3px); animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: pop .18s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 8px; border: 0;
  background: var(--surface-3); color: var(--text-soft);
  display: grid; place-items: center; cursor: pointer;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.md-mode {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; margin-bottom: 10px;
}
.md-mode.onsite { background: var(--onsite-soft); color: var(--onsite); }
.md-mode.remote { background: var(--remote-soft); color: var(--remote); }
.md-mode svg { width: 13px; height: 13px; }

.md-title { font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; padding-right: 28px; }
.md-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.md-rows { margin-top: 16px; display: flex; flex-direction: column; gap: 1px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.md-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 9px 12px; background: var(--surface-2); font-size: 13.5px; }
.md-row:nth-child(even) { background: var(--surface); }
.md-row dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.md-row dd { margin: 0; font-weight: 550; word-break: break-word; }

.md-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.md-note {
  margin-top: 14px; padding: 10px 12px;
  background: color-mix(in srgb, var(--remote) 10%, transparent);
  border-radius: 9px; font-size: 12.5px; color: var(--text-soft);
}

/* Dzień — lista w modalu */
.day-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.day-item {
  display: grid; grid-template-columns: 86px 1fr; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; text-align: left; font: inherit; color: var(--text); width: 100%;
  box-shadow: inset 3px 0 0 var(--subject-color, var(--accent));
}
.day-item:hover { background: var(--surface-3); }
.day-item .t { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.day-item .n { font-weight: 650; font-size: 13.5px; }
.day-item .r { font-size: 12px; color: var(--text-soft); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* ---------- Szkielet / stany --------------------------------------------- */

.skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sk-month {
  height: 280px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border: 1px solid var(--border);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 64px 20px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty-state svg { width: 34px; height: 34px; color: var(--muted); }
.empty-state h3 { font-size: 16px; }
.empty-state p { color: var(--muted); font-size: 13.5px; max-width: 420px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 550;
  box-shadow: var(--shadow-lg); z-index: 200; max-width: 90vw;
}
.toast[hidden] { display: none; }

/* ---------- Stopka -------------------------------------------------------- */

.footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-soft);
}

/* Element ukrywany atrybutem [hidden] nadpisuje display z klas (np. .btn, .sheet-action) */
[hidden] { display: none !important; }

/* Instrukcja „dodaj do pulpitu” */
.help-steps {
  margin: 16px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
}
.help-steps b { color: var(--text); }
.help-icon { display: inline-flex; vertical-align: -3px; margin: 0 2px; }
.help-icon svg { width: 16px; height: 16px; color: var(--accent); }

/* ==========================================================================
   Wersje planu
   ========================================================================== */

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.version-pill svg { width: 15px; height: 15px; }
.version-pill:hover { border-color: var(--accent); color: var(--accent); }

.version-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 42%, transparent);
  font-size: 13px;
  flex-wrap: wrap;
}
.version-banner[hidden] { display: none; }
.version-banner svg { width: 16px; height: 16px; flex: 0 0 auto; color: #b45309; }
.version-banner .btn { margin-left: auto; }

.version-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
  padding: 9px 12px;
  background: var(--surface-2);
  border-radius: 10px;
}
.version-meta b { color: var(--text-soft); font-weight: 700; }

.version-list { display: flex; flex-direction: column; gap: 8px; }

.version-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.version-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.version-item:hover { background: var(--surface-3); }
.version-item.current { background: var(--accent-soft); }

.vi-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vi-date {
  font-size: 13.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 7px;
  font-variant-numeric: tabular-nums;
}
.vi-badge {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
.vi-sub { font-size: 11.5px; color: var(--muted); }
.vi-diff { margin-left: auto; display: flex; gap: 6px; font-size: 11.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.d-add { color: #059669; }
.d-del { color: #dc2626; }
.d-chg { color: #d97706; }
.d-none { color: var(--muted); font-weight: 500; }

.vi-changes { border-top: 1px solid var(--border); }
.vi-changes summary {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
}
.vi-changes ul { list-style: none; margin: 0; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 5px; }
.vi-changes li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 2px 8px;
  font-size: 11.5px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--surface);
}
.chg-type { grid-column: 1; grid-row: 1; font-weight: 800; text-transform: uppercase; font-size: 9px; letter-spacing: .04em; padding-top: 2px; }
.chg-added .chg-type { color: #059669; }
.chg-removed .chg-type { color: #dc2626; }
.chg-changed .chg-type { color: #d97706; }
.chg-subject { grid-column: 2; grid-row: 1; font-weight: 600; }
.chg-date { grid-column: 2; grid-row: 2; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.chg-text { grid-column: 2; grid-row: 3; color: var(--muted); }

/* ==========================================================================
   Układ mobilny (mobile first) — do 760 px
   ========================================================================== */

.mobile-only { display: none; }

@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .topbar-actions.mobile-only { display: flex; }

  body {
    padding: 0 12px calc(88px + env(safe-area-inset-bottom));
    font-size: 15.5px;
  }

/* --- nagłówek --- */
  .topbar {
    padding: calc(10px + env(safe-area-inset-top)) 0 10px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  .brand { gap: 10px; }
  .logo { width: 38px; height: 38px; border-radius: 11px; }
  .logo svg { width: 19px; height: 19px; }
  .brand h1 { font-size: 17px; }
  #groupLine { font-size: 11.5px; }
  .topbar-actions.mobile-only { gap: 6px; flex: 0 0 auto; }
  .version-pill { height: 34px; padding: 0 9px; font-size: 11.5px; }
  .topbar-actions .btn.icon-only { width: 34px; height: 34px; }

/* --- karta „następne zajęcia” --- */
  .summary { margin-bottom: 6px; }
  .next-card { min-height: 0; padding: 10px 12px; gap: 4px; }
  .next-label { font-size: 10px; }
  .next-title { font-size: 14.5px; }
  .next-meta { font-size: 11.5px; gap: 2px 10px; }
  .next-meta svg { width: 12px; height: 12px; }

  /* --- pasek tygodnia --- */
  .m-weekbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 2px;
    margin: 0 -12px;
    padding: 6px 8px;
    background: color-mix(in srgb, var(--bg) 68%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid transparent;
  }
  .m-weekbar.scrolled { border-bottom-color: var(--border); }

  .m-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .m-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0 5px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    min-height: 56px;
    transition: background .12s, transform .08s;
  }
  .m-date:active { transform: scale(.96); }
  .m-date .dow { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
  .m-date .dnum { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
  .m-date.today .dnum { color: var(--accent); }
  .m-date.has:not(.active) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
  .m-date.active { background: var(--accent); box-shadow: var(--shadow-md); }
  .m-date.active .dow, .m-date.active .dnum { color: #fff; }
  .mdots { display: flex; gap: 2px; height: 5px; align-items: center; }
  .mdots i { width: 4px; height: 4px; border-radius: 50%; display: block; }
  .m-date.active .mdots i { background: #fff !important; }

  .m-arrow {
    width: 32px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    color: var(--muted);
    border-radius: 10px;
    cursor: pointer;
  }
  .m-arrow:active { background: var(--surface-3); }
  .m-arrow svg { width: 16px; height: 16px; }

  /* --- agenda dnia --- */
  .m-agenda { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
  .m-agenda-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 2px 4px;
  }
  .m-agenda-head strong {
    display: block;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -.01em;
    text-transform: capitalize;
  }
  .m-agenda-head > div > span { font-size: 12.5px; color: var(--muted); }
  .m-agenda-meta { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
  .m-agenda-meta b { color: var(--text); font-size: 13.5px; }

  .chip-today {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    padding: 5px 11px;
    border-radius: 999px;
    cursor: pointer;
  }

  .mcard {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 16px;
    gap: 10px;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: inset 4px 0 0 var(--subject-color, var(--accent)), var(--shadow-sm);
    font: inherit;
    color: var(--text);
    min-height: 66px;
    cursor: pointer;
    transition: transform .08s, background .12s;
  }
  .mcard:active { transform: scale(.985); }
  .mcard.mode-zdalne { border-style: dashed; }

  .mcard-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
  .mcard-time b { font-size: 15px; font-weight: 750; line-height: 1.1; }
  .mcard-time i { font-style: normal; font-size: 11.5px; color: var(--muted); }

  .mcard-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .mcard-subject {
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .mcard-meta { display: flex; gap: 5px; flex-wrap: wrap; }
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
  }
  .pill svg { width: 11px; height: 11px; }
  .pill.form { background: var(--surface-3); color: var(--text-soft); }
  .pill.room { background: var(--onsite-soft); color: var(--onsite); }
  .pill.remote { background: var(--remote-soft); color: var(--remote); }
  .mcard-lecturer {
    font-size: 11.5px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mcard-chevron { width: 16px; height: 16px; color: var(--border-strong); }

  .m-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 16px;
    text-align: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    font-size: 14px;
  }
  .m-empty svg { width: 28px; height: 28px; opacity: .6; }

  .m-jump { display: flex; gap: 8px; margin-top: 6px; }
  .m-jump .btn { flex: 1; justify-content: center; font-size: 12px; height: 40px; }
  .m-jump .btn svg { width: 14px; height: 14px; }

/* --- miesiąc (mobile) --- */
  .m-monthnav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 10px;
  }
  .m-monthnav > span {
    font-size: 15px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    text-transform: capitalize;
  }
  .m-month-count {
    display: block;
    font-style: normal;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    text-transform: none;
    margin-top: 1px;
  }
  .m-month .month-head { display: none; }
  .m-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--muted);
  }
  .m-legend span { display: inline-flex; align-items: center; gap: 5px; }
  .m-legend i { width: 8px; height: 8px; border-radius: 50%; }

  /* --- dolna nawigacja --- */
  .mobile-nav.mobile-only {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    border: 0;
    border-radius: 11px;
    background: none;
    font: inherit;
    font-size: 10px;
    font-weight: 650;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 2px;
  }
  .mobile-nav button svg { width: 20px; height: 20px; }
  .mobile-nav button[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); }

/* --- arkusz filtrów --- */
  .sheet.mobile-only {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 120;
    align-items: flex-end;
  }
  .sheet.mobile-only[hidden] { display: none; }
  .sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 20, .5); backdrop-filter: blur(2px); }
  .sheet-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92vh;
    overflow: hidden;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 6px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: var(--shadow-lg);
    animation: sheetUp .22s cubic-bezier(.2, .9, .3, 1);
  }
  @keyframes sheetUp { from { transform: translateY(28px); opacity: .5; } }
  .sheet-grab {
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
    margin: 6px auto 10px;
    cursor: pointer;
  }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .sheet-head h2 { font-size: 17px; font-weight: 750; }
  .sheet-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: var(--surface-3);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .sheet-body { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 2px; }
  .field { display: flex; flex-direction: column; gap: 7px; }
  .field-label {
    font-size: 10.5px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
  }
  .field-row { display: flex; align-items: center; gap: 8px; }
  .field-row .field-label { margin-right: auto; }
  .sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sheet-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    min-height: 46px;
  }
  .sheet-action svg { width: 17px; height: 17px; color: var(--accent); }
  .sheet-done {
    width: 100%;
    margin-top: 12px;
    height: 48px;
    flex: 0 0 auto;
    justify-content: center;
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
  }
  .sheet-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; text-align: center; }

  .subject-list { max-height: 34vh; overflow: auto; }

  /* --- modal na telefonie --- */
  .modal { padding: 0; align-items: flex-end; }
  .modal-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .md-title { font-size: 17px; }
  .md-row { grid-template-columns: 1fr; gap: 2px; }
  .md-row dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  .day-item { grid-template-columns: 74px 1fr; }
}

/* ==========================================================================
   Wybór motywu (popover + siatka w arkuszu)
   ========================================================================== */

.theme-list { padding: 8px; min-width: 250px; }

.theme-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.theme-opt:hover { background: var(--surface-3); }
.theme-opt.active { background: var(--accent-soft); }

.tp-swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}
.tp-auto { background: linear-gradient(135deg, #ffffff 0 49%, #1b1f27 51% 100%); }
.tp-light { background: linear-gradient(180deg, #ffffff, #e9eef8); }
.tp-dark { background: linear-gradient(180deg, #262c39, #0b0e13); }
.tp-glass {
  background:
    radial-gradient(90% 70% at 12% -10%, rgba(88, 132, 210, .85) 0%, transparent 70%),
    radial-gradient(80% 60% at 100% 4%, rgba(126, 104, 196, .55) 0%, transparent 72%),
    radial-gradient(70% 60% at 0% 92%, rgba(40, 120, 132, .45) 0%, transparent 72%),
    linear-gradient(160deg, #111828, #090b12);
}
[data-theme="glass"] .tp-swatch { border-color: rgba(255, 255, 255, .28); }

/* Kafelek „Wydajność szkła” — pokazuje, która warstwa jest aktywna */
.tp-perf {
  position: relative;
  background: linear-gradient(165deg, #141a26, #090d14);
}
.tp-perf::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%);
}
.tp-perf[data-tier="lite"]::after {
  border-color: rgba(255, 255, 255, .16);
  background: none;
}
.theme-perf .tp-text small { text-transform: none; }

.tp-text { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.tp-text small { font-weight: 400; font-size: 11px; color: var(--muted); }
.tp-check { margin-left: auto; width: 16px; height: 16px; color: var(--accent); opacity: 0; }
.theme-opt.active .tp-check { opacity: 1; }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-grid .theme-opt {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
}
.theme-grid .tp-swatch { width: 100%; height: 34px; border-radius: 9px; }
.theme-grid .tp-check { display: none; }
.theme-grid .theme-opt.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.theme-grid .tp-text { font-size: 12.5px; }
.theme-grid .tp-text small { font-size: 10.5px; }

.install-btn { background: var(--accent); border-color: transparent; color: #fff; }
.install-btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; color: #fff; }
.install-btn svg { stroke: currentColor; }

/* ==========================================================================
   LIQUID GLASS — materiał wg Apple (iOS 26 / macOS Tahoe, wariant ciemny)

   Odtworzone trzy warstwy optyczne z oryginału:
     1. REFRAKCJA  — jasna krawędź o zmiennej grubości; światło „załamuje się”
                     na krawędzi szkła (jasna góra, przygaszone boki, refleks
                     odbitego światła na dole),
     2. SPECULAR   — refleks u góry, przesuwający się za kursorem,
     3. FILL       — przyciemnione i nasycone tło pod szkłem (blur + saturate).

   Do tego zachowanie: kontrolki „materializują się”, uginają się pod palcem
   i podświetlają od środka — jak w iOS 26.

   WYDAJNOŚĆ — najważniejsza decyzja tego pliku:
   backdrop-filter mają WYŁĄCZNIE elementy warstwy nawigacji (paski, arkusze,
   menu, przyklejony nagłówek tygodnia). Powierzchnie treści (miesiąc, tydzień,
   lista, karty) leżą na gładkiej tapecie, więc rozmycie i tak byłoby pod nimi
   niewidoczne, a kosztuje GPU przy każdym przewinięciu. Zostaje ~7 warstw
   rozmycia zamiast kilkudziesięciu — na słabszym telefonie to różnica między
   rwaniem a płynnością. Patrz html[data-glass="lite"] na końcu sekcji.
   ========================================================================== */

html[data-theme="glass"] {
  color-scheme: dark;
  background: #05070d;

  /* --- paleta bazowa (z niej korzysta reszta arkusza) --- */
  --bg: transparent;
  --surface: rgba(255, 255, 255, .055);
  --surface-2: rgba(255, 255, 255, .035);
  --surface-3: rgba(255, 255, 255, .075);
  --text: #eef2fb;
  --text-soft: #c3cce0;
  --muted: #8b96ac;
  --border: rgba(255, 255, 255, .13);
  --border-strong: rgba(255, 255, 255, .24);
  --accent: #7aa6dd;
  --accent-soft: rgba(122, 166, 221, .16);
  --onsite: #86a9d4;
  --onsite-soft: rgba(134, 169, 212, .14);
  --remote: #74bfb4;
  --remote-soft: rgba(116, 191, 180, .14);
  --today-ring: #7aa6dd;

  /* --- geometria: promienie koncentryczne (zewnętrzny = wewnętrzny + odstęp) --- */
  --lg-r-panel: 20px;
  --lg-r-item: 14px;
  --lg-r-ctl: 12px;

  /* --- wypełnienia szkła (jedyne, co animujemy przy hover/press) --- */
  --lg-fill: rgba(255, 255, 255, .042);
  --lg-fill-item: rgba(255, 255, 255, .038);
  --lg-fill-ctl: rgba(255, 255, 255, .062);
  --lg-fill-hover: rgba(255, 255, 255, .10);

  /* --- krawędź: jasna góra (refrakcja) + ciemniejszy dół (odbicie) --- */
  --lg-edge: rgba(255, 255, 255, .14);
  --lg-rim:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 2px 3px -2px rgba(255, 255, 255, .36),
    inset 0 -1px 0 rgba(255, 255, 255, .06),
    inset 1px 0 0 rgba(255, 255, 255, .07),
    inset -1px 0 0 rgba(255, 255, 255, .07);
  --lg-rim-ctl:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 2px 4px -2px rgba(255, 255, 255, .30),
    inset 0 -1px 0 rgba(255, 255, 255, .06);

  /* --- cień: blisko i miękko, jak w iOS (nie rozlany) --- */
  --lg-drop: 0 1px 1px rgba(0, 0, 0, .30), 0 12px 28px -16px rgba(0, 0, 0, .80);
  --lg-drop-ctl: 0 1px 1px rgba(0, 0, 0, .35), 0 6px 14px -10px rgba(0, 0, 0, .80);

  /* --- refleks górny (statyczny gradient, malowany raz) --- */
  --lg-sheen: radial-gradient(120% 100% at 22% -28%, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 58%);

  /* --- rozmycie: tylko warstwa nawigacji --- */
  --lg-blur-nav: blur(24px) saturate(180%) brightness(1.06);
  --lg-blur-panel: blur(20px) saturate(160%);
  --lg-blur-scrim: blur(12px) saturate(120%);

  --shadow-sm: 0 1px 1px rgba(0, 0, 0, .30), 0 4px 12px -6px rgba(0, 0, 0, .55);
  --shadow-md: 0 12px 28px -16px rgba(0, 0, 0, .80);
  --shadow-lg: 0 40px 90px -36px rgba(0, 0, 0, .95);

  /* sprężystka Apple: szybki start, lekkie przestrzelenie */
  --lg-ease: cubic-bezier(.32, .94, .34, 1.16);
  --lg-dur: .19s;
}

html[data-theme="glass"] body { background: transparent; color: var(--text); }

/* --------------------------------------------------------------------------
   Tapeta. Jedna warstwa position:fixed — malowana raz, przewijanie jej nie
   rusza. Ziarno (feTurbulence) rozbija pasy na tanich matrycach 6-bitowych,
   które przy ciemnych gradientach widać gołym okiem.
   -------------------------------------------------------------------------- */

html[data-theme="glass"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E"),
    radial-gradient(120% 90% at 12% -10%, rgba(88, 132, 210, .46) 0%, rgba(88, 132, 210, 0) 62%),
    radial-gradient(92% 72% at 100% 6%, rgba(126, 104, 196, .32) 0%, rgba(126, 104, 196, 0) 66%),
    radial-gradient(110% 82% at 80% 98%, rgba(96, 78, 150, .28) 0%, rgba(96, 78, 150, 0) 68%),
    radial-gradient(92% 72% at 2% 90%, rgba(40, 120, 132, .26) 0%, rgba(40, 120, 132, 0) 68%),
    linear-gradient(160deg, #111828 0%, #0f1522 40%, #111120 70%, #090b12 100%);
  background-size: 140px 140px, auto, auto, auto, auto, auto, cover;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}

/* ==========================================================================
   POWIERZCHNIE (duże tafle) — bez rozmycia, tylko światło i cień
   ========================================================================== */

html[data-theme="glass"] :is(
  .next-card, .stat, .month, .zjazd, .week, .list-day,
  .empty-state, .version-block
) {
  background-color: var(--lg-fill);
  background-image: var(--lg-sheen);
  border: 1px solid var(--lg-edge);
  border-radius: var(--lg-r-panel);
  box-shadow: var(--lg-rim), var(--lg-drop);
}

/* ==========================================================================
   WARSTWA NAWIGACJI — tu rozmycie naprawdę pracuje (treść przewija się pod nią)
   ========================================================================== */

html[data-theme="glass"] :is(.sheet-card, .modal-card, .menu-list, .popover-panel) {
  background-color: rgba(255, 255, 255, .07);
  background-image: var(--lg-sheen);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: var(--lg-blur-panel);
  backdrop-filter: var(--lg-blur-panel);
  box-shadow: var(--lg-rim), var(--lg-drop), 0 30px 70px -30px rgba(0, 0, 0, .9);
}

html[data-theme="glass"] .topbar {
  background-color: rgba(255, 255, 255, .035);
  background-image: var(--lg-sheen);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--lg-rim), 0 10px 26px -20px rgba(0, 0, 0, .9);
}

/* na telefonie nie wolno zgubić odstępu na notcha */
@media (max-width: 760px) {
  html[data-theme="glass"] .topbar {
    padding: calc(9px + env(safe-area-inset-top)) 11px 9px;
    border-radius: 16px;
  }
}

html[data-theme="glass"] .mobile-nav.mobile-only {
  left: 10px;
  right: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  padding: 6px 6px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-top: 1px solid rgba(255, 255, 255, .13);
  border-radius: 26px;
  background-color: rgba(255, 255, 255, .075);
  background-image: var(--lg-sheen);
  -webkit-backdrop-filter: var(--lg-blur-nav);
  backdrop-filter: var(--lg-blur-nav);
  box-shadow: var(--lg-rim), 0 -2px 8px rgba(0, 0, 0, .25), 0 18px 40px -18px rgba(0, 0, 0, .95);
}

/* Rozpuszczanie treści pod dolną belką (scroll edge effect) */
html[data-theme="glass"] .mobile-nav.mobile-only::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: 100%;
  height: 26px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(5, 7, 13, .55), rgba(5, 7, 13, 0));
}

html[data-theme="glass"] .m-weekbar {
  background-color: rgba(255, 255, 255, .07);
  background-image: var(--lg-sheen);
  -webkit-backdrop-filter: var(--lg-blur-panel);
  backdrop-filter: var(--lg-blur-panel);
  border-bottom: 1px solid rgba(255, 255, 255, .11);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px -18px rgba(0, 0, 0, .95);
}

/* Pasek narzędzi jest przyklejony, więc treść przewija się pod nim.
   W szkle musi mieć własne tło — bazowe liczyło kolor z --bg, a to w tym
   motywie jest przezroczyste (pasek byłby dziurą w tapetę).
   Stoi 8px od góry i ma zaokrąglone wszystkie narożniki, jak pływający
   pasek w iOS 26 — dzięki temu nie ma ostrej krawędzi na przewijanej treści. */
html[data-theme="glass"] .toolbar {
  top: 8px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .10);
  background-color: rgba(10, 14, 22, .55);
  background-image: var(--lg-sheen);
  -webkit-backdrop-filter: var(--lg-blur-panel);
  backdrop-filter: var(--lg-blur-panel);
  box-shadow: var(--lg-rim), 0 14px 34px -26px rgba(0, 0, 0, .95);
  transition: background-color .2s ease;
}

/* Przyklejony nagłówek tygodnia: prawdziwe szkło zamiast kryjącej łaty.
   Zajęcia przechodzą pod spodem i rozmywają się — to właśnie scroll edge
   effect z iOS. W trybie lite (niżej) wracamy do jednolitego koloru. */
html[data-theme="glass"] .wk-head,
html[data-theme="glass"] .wk-head .wk-corner {
  background-color: rgba(10, 14, 24, .66);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
html[data-theme="glass"] .wk-hours {
  border-right-color: rgba(255, 255, 255, .08);
  background: rgba(10, 14, 22, .88);
}

/* ==========================================================================
   KONTROLKI — jedna szklana skóra dla wszystkich przycisków
   ========================================================================== */

/* UWAGA na specyficzność: :is() bierze wagę najcięższego argumentu, więc
   każdy złożony selektor w tej liście podnosi wagę CAŁEJ reguły i cicho
   przebija późniejsze poprawki dla pojedynczych klas. Dlatego złożone
   selektory (.chip.more, .list-day-head .tag, .day-num .badge-count) mają
   własną regułę niżej, a nie miejsce w tej liście. */
html[data-theme="glass"] :is(
  .btn, .version-pill, .m-date, .m-arrow, .mobile-nav button,
  .sheet-action, .sheet-close, .modal-close, .menu-list a, .theme-opt,
  .check-item, .version-item, .chip-today, .popover > summary,
  .chip-form, .pill, .md-mode
) {
  background-color: var(--lg-fill-ctl);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, .02) 54%, rgba(255, 255, 255, 0) 100%);
  border: 1px solid var(--lg-edge);
  box-shadow: var(--lg-rim-ctl), var(--lg-drop-ctl);
  color: #e9eefb;
  transition: background-color var(--lg-dur) ease, border-color var(--lg-dur) ease,
              box-shadow var(--lg-dur) ease, transform .12s var(--lg-ease);
}

/* ta sama skóra dla plakietek o złożonym selektorze */
html[data-theme="glass"] :is(.list-day-head .tag, .day-num .badge-count),
html[data-theme="glass"] .chip.more {
  background-color: var(--lg-fill-ctl);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, .02) 54%, rgba(255, 255, 255, 0) 100%);
  border: 1px solid var(--lg-edge);
  box-shadow: var(--lg-rim-ctl), var(--lg-drop-ctl);
  color: #e9eefb;
}

/* Specular wędrujący za kursorem — tylko tam, gdzie jest wskaźnik precyzyjny */
@media (hover: hover) and (pointer: fine) {
  html[data-theme="glass"] :is(
    .btn, .m-date, .m-arrow, .mobile-nav button, .segmented button,
    .sheet-action, .sheet-close, .modal-close, .menu-list a, .theme-opt, .chip-today
  ) {
    position: relative;
    overflow: hidden;
  }
  html[data-theme="glass"] :is(
    .btn, .m-date, .m-arrow, .mobile-nav button, .segmented button,
    .sheet-action, .sheet-close, .modal-close, .menu-list a, .theme-opt, .chip-today
  )::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity .22s ease;
    background: radial-gradient(
      140px circle at var(--lg-x, 50%) var(--lg-y, -30%),
      rgba(255, 255, 255, .22),
      rgba(255, 255, 255, 0) 68%
    );
  }
  html[data-theme="glass"] :is(
    .btn, .m-date, .m-arrow, .mobile-nav button, .segmented button,
    .sheet-action, .sheet-close, .modal-close, .menu-list a, .theme-opt, .chip-today
  ):hover::after { opacity: 1; }

  html[data-theme="glass"] :is(
    .btn, .version-pill, .m-date, .m-arrow, .mobile-nav button,
    .sheet-action, .sheet-close, .modal-close, .menu-list a, .theme-opt,
    .check-item, .version-item, .chip-today, .popover > summary
  ):hover {
    background-color: var(--lg-fill-hover);
    border-color: rgba(255, 255, 255, .24);
    box-shadow: var(--lg-rim-ctl), 0 8px 18px -10px rgba(0, 0, 0, .85);
  }
  html[data-theme="glass"] .list-day-head .tag:hover {
    background-color: var(--lg-fill-hover);
    border-color: rgba(255, 255, 255, .24);
  }
}

/* Ugięcie pod palcem — sprężystka, nie liniowy zoom */
html[data-theme="glass"] :is(
  .btn, .m-arrow, .mobile-nav button, .m-date, .sheet-action, .sheet-close,
  .modal-close, .chip, .zc, .mcard, .list-row, .day-item, .chip-today
):active {
  transform: scale(.965);
  transition-duration: .06s;
}

html[data-theme="glass"] :is(.btn, .mcard, .list-row, .m-date, .chip):focus-visible {
  outline: 2px solid #7aa6dd;
  outline-offset: 2px;
}

/* --- przyciski --- */
html[data-theme="glass"] .btn { color: #e9eefb; font-weight: 600; }
html[data-theme="glass"] .btn:hover { color: #ffffff; }
html[data-theme="glass"] .btn.ghost {
  background-color: rgba(255, 255, 255, .03);
  background-image: none;
  border-color: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}
html[data-theme="glass"] .btn.icon-only { color: #d7e0f2; }
html[data-theme="glass"] .btn[disabled] { opacity: .5; }

/* Jedyne zabarwione szkło: podstawowe akcje. Przygaszone, nie „niebieski guzik”. */
html[data-theme="glass"] .install-btn,
html[data-theme="glass"] .sheet-done {
  background-color: rgba(122, 166, 221, .30);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 60%);
  border-color: rgba(170, 205, 255, .34);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .40),
    inset 0 2px 4px -2px rgba(255, 255, 255, .30),
    0 10px 24px -14px rgba(58, 120, 255, .75);
}
html[data-theme="glass"] :is(.install-btn, .sheet-done):hover {
  background-color: rgba(138, 182, 236, .40);
  border-color: rgba(190, 218, 255, .48);
  color: #ffffff;
}

/* typ w selektorze wyrównuje wagę z regułą-zbiornikiem wyżej (tam typ „button”
   siedzi w :is()), dzięki czemu te dwa kolory naprawdę wygrywają */
html[data-theme="glass"] button.version-pill { color: #cfd8ec; }

/* --- segmenty (taby) --- */
html[data-theme="glass"] .segmented {
  background-color: rgba(255, 255, 255, .035);
  background-image: none;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 255, 255, .05);
}
html[data-theme="glass"] .segmented button {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #a9b4c9;
}
html[data-theme="glass"] .segmented button:hover { color: #e9eefb; }
html[data-theme="glass"] .segmented button.active,
html[data-theme="glass"] .segmented button[aria-selected="true"] {
  background-color: rgba(255, 255, 255, .11);
  background-image: var(--lg-sheen);
  color: #ffffff;
  box-shadow: var(--lg-rim-ctl), 0 4px 10px -8px rgba(0, 0, 0, .9);
}

/* --- pola tekstowe --- */
html[data-theme="glass"] .search input {
  background-color: rgba(255, 255, 255, .05);
  background-image: none;
  border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 255, 255, .06);
  color: #eef2fb;
}
html[data-theme="glass"] .search input:focus {
  border-color: rgba(150, 190, 240, .48);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35), 0 0 0 3px rgba(122, 166, 221, .18);
}
html[data-theme="glass"] .search input::placeholder { color: #7f8aa1; }

/* --- checkboxy --- */
html[data-theme="glass"] .check-item { cursor: pointer; }
html[data-theme="glass"] .check-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  margin: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 3px 8px -6px rgba(0, 0, 0, .9);
  position: relative;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
html[data-theme="glass"] .check-item input[type="checkbox"]:checked {
  background: linear-gradient(180deg, #9dbedd, #6b93c4);
  border-color: rgba(180, 212, 245, .60);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 5px 12px -8px rgba(58, 120, 255, .8);
}
html[data-theme="glass"] .check-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: no-repeat center / 12px 12px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E");
}
html[data-theme="glass"] .check-item input[type="checkbox"]:focus-visible {
  outline: 2px solid #7aa6dd;
  outline-offset: 2px;
}

/* --- menu, popover --- */
html[data-theme="glass"] .menu-list a { text-decoration: none; }
html[data-theme="glass"] .menu-list a small { color: #93a0b8; }
html[data-theme="glass"] .menu-list a svg { color: #a9c6e6; }
html[data-theme="glass"] .theme-opt.active {
  background-color: rgba(122, 166, 221, .18);
  background-image: var(--lg-sheen);
  border-color: rgba(160, 200, 245, .35);
  box-shadow: var(--lg-rim-ctl), 0 8px 20px -14px rgba(58, 120, 255, .7);
}
html[data-theme="glass"] .tp-check { color: #c8d8ea; }
html[data-theme="glass"] .popover-head strong { color: #8b96ac; }
html[data-theme="glass"] .popover-panel { border-radius: 16px; }

/* ==========================================================================
   TREŚĆ — chipy, karty, wiersze. Bez rozmycia: leżą na gładkiej tapecie,
   więc blur byłby niewidoczny, a kosztował GPU przy każdym przewinięciu.
   ========================================================================== */

html[data-theme="glass"] :is(.chip, .mcard, .zc, .list-row, .wk-event, .day-item) {
  background-color: var(--lg-fill-item);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .055) 0%, rgba(255, 255, 255, 0) 62%);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 16px -14px rgba(0, 0, 0, .9);
  transition: background-color var(--lg-dur) ease, border-color var(--lg-dur) ease,
              box-shadow var(--lg-dur) ease, transform .12s var(--lg-ease);
}

@media (hover: hover) {
  html[data-theme="glass"] :is(.chip, .mcard, .zc, .list-row, .day-item):hover {
    background-color: rgba(255, 255, 255, .085);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 10px 22px -16px rgba(0, 0, 0, .95);
  }
}

/* --- kalendarz: dni --- */
html[data-theme="glass"] .day { background-color: rgba(255, 255, 255, .022); background-image: none; border-radius: 10px; }
html[data-theme="glass"] .day.weekend { background-color: rgba(255, 255, 255, .012); }
html[data-theme="glass"] .day.has-classes {
  background-color: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 14px -14px rgba(0, 0, 0, .9);
}
html[data-theme="glass"] .day.has-classes:hover {
  background-color: rgba(255, 255, 255, .085);
  border-color: rgba(255, 255, 255, .18);
}
html[data-theme="glass"] .day.today {
  box-shadow: inset 0 0 0 2px #7aa6dd, 0 0 0 4px rgba(122, 166, 221, .16);
}
html[data-theme="glass"] .month-head h3 { color: #eef2fb; }
html[data-theme="glass"] .dow-row span { color: #7f8aa1; }
html[data-theme="glass"] .day-num { color: #9aa5bb; }
html[data-theme="glass"] .day.today .day-num { color: #9dc4f2; }
html[data-theme="glass"] .day-num .badge-count { color: #c3cce0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }

/* --- chipy zajęć --- */
html[data-theme="glass"] .chip {
  border-color: rgba(255, 255, 255, .10);
  color: #e9eefb;
}
html[data-theme="glass"] .chip.mode-zdalne {
  background-color: rgba(116, 191, 180, .16);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 60%);
  border-color: rgba(116, 191, 180, .32);
}
html[data-theme="glass"] .chip.mode-zdalne:hover { background-color: rgba(116, 191, 180, .24); }
html[data-theme="glass"] .chip::before { opacity: .45; }
html[data-theme="glass"] .chip-time { color: #c9d3e8; }
html[data-theme="glass"] span.chip-form { color: #dfe6f5; }
html[data-theme="glass"] .chip.compact .chip-room { color: #93a0b8; }
html[data-theme="glass"] .chip.more { color: #93a0b8; }

/* --- karty zajęć (mobile) --- */
html[data-theme="glass"] .mcard { border-color: rgba(255, 255, 255, .11); }
html[data-theme="glass"] .mcard.mode-zdalne {
  background-color: rgba(116, 191, 180, .15);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 60%);
  border-color: rgba(116, 191, 180, .30);
}
html[data-theme="glass"] .mcard-time i { color: #8b96ac; }
html[data-theme="glass"] .mcard-lecturer { color: #93a0b8; }
html[data-theme="glass"] .mcard-chevron { color: rgba(255, 255, 255, .30); }

html[data-theme="glass"] .pill.form { background-color: rgba(255, 255, 255, .10); color: #dfe6f5; }
html[data-theme="glass"] .pill.room { background-color: rgba(255, 255, 255, .08); color: #dbe2f0; border-color: rgba(255, 255, 255, .13); }
html[data-theme="glass"] .pill.remote { background-color: rgba(116, 191, 180, .16); color: #9ad9cf; border-color: rgba(116, 191, 180, .30); }

/* --- zjazdy --- */
html[data-theme="glass"] .zc { border-color: rgba(255, 255, 255, .10); }
html[data-theme="glass"] .zc-meta { color: #8b96ac; }
html[data-theme="glass"] .zc-room { background-color: rgba(255, 255, 255, .08); color: #dbe2f0; border: 1px solid rgba(255, 255, 255, .13); }
html[data-theme="glass"] .zc-room.remote { background-color: rgba(116, 191, 180, .16); color: #9ad9cf; border-color: rgba(116, 191, 180, .28); }
html[data-theme="glass"] .zjazd-stats { color: #8b96ac; }

/* --- lista --- */
html[data-theme="glass"] .list-row { border-color: rgba(255, 255, 255, .08); }
html[data-theme="glass"] .list-row .meta { color: #9aa5bb; }
html[data-theme="glass"] .list-row .room-badge { background-color: rgba(255, 255, 255, .08); color: #dbe2f0; border: 1px solid rgba(255, 255, 255, .13); }
html[data-theme="glass"] .list-row .room-badge.remote { background-color: rgba(116, 191, 180, .16); color: #9ad9cf; border-color: rgba(116, 191, 180, .28); }
html[data-theme="glass"] .list-day-head .tag { color: #c3cce0; }
html[data-theme="glass"] .list-day-head .tag.remote { background-color: rgba(116, 191, 180, .16); color: #9ad9cf; border-color: rgba(116, 191, 180, .28); }
html[data-theme="glass"] .list-day-head .tag.onsite { background-color: rgba(255, 255, 255, .08); color: #c9d3e4; border-color: rgba(255, 255, 255, .12); }

/* --- widok tygodnia --- */
html[data-theme="glass"] .wk-event {
  border-color: rgba(255, 255, 255, .10);
  color: #e9eefb;
}
html[data-theme="glass"] .wk-event.mode-zdalne {
  background-color: rgba(116, 191, 180, .17);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 60%);
  border-color: rgba(116, 191, 180, .34);
}
html[data-theme="glass"] .wk-event .e-time { color: #c9d3e8; }
html[data-theme="glass"] .wk-event .e-room { color: #93a0b8; }
html[data-theme="glass"] .wk-event.mode-zdalne .e-room { color: #9ad9cf; }
html[data-theme="glass"] .wk-head .wk-day { color: #8b96ac; border-left-color: rgba(255, 255, 255, .07); }
html[data-theme="glass"] .wk-head .wk-day strong { color: #eef2fb; }
html[data-theme="glass"] .wk-col.weekend { background: rgba(255, 255, 255, .015); }
html[data-theme="glass"] .wk-col.today { background: rgba(122, 166, 221, .07); }
html[data-theme="glass"] .wk-line { border-top-color: rgba(255, 255, 255, .06); }
html[data-theme="glass"] .wk-line.hour { border-top-color: rgba(255, 255, 255, .10); }
html[data-theme="glass"] .wk-hour-label { color: #7f8aa1; }

/* --- pasek tygodnia i nawigacja mobilna --- */
html[data-theme="glass"] .m-date { color: #8b96ac; }
html[data-theme="glass"] .m-date .dnum { color: #eef2fb; }
html[data-theme="glass"] .m-date.has:not(.active) { border-color: rgba(255, 255, 255, .13); }
html[data-theme="glass"] .m-date.active {
  background-color: rgba(122, 166, 221, .34);
  background-image: var(--lg-sheen);
  border-color: rgba(170, 205, 255, .40);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .40),
    0 8px 20px -12px rgba(58, 120, 255, .8);
}
html[data-theme="glass"] .m-date.active .dow,
html[data-theme="glass"] .m-date.active .dnum { color: #ffffff; }

html[data-theme="glass"] .mobile-nav button {
  color: #96a1b7;
  background-color: transparent;
  background-image: none;
  border-color: transparent;
  box-shadow: none;
}
html[data-theme="glass"] .mobile-nav button[aria-selected="true"] {
  background-color: rgba(255, 255, 255, .13);
  background-image: var(--lg-sheen);
  border-color: rgba(255, 255, 255, .14);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30), 0 4px 12px -8px rgba(0, 0, 0, .9);
}
html[data-theme="glass"] .mobile-nav button[aria-selected="true"] svg { color: #d5e2f0; }

/* --- arkusz i modal --- */
html[data-theme="glass"] .modal-backdrop,
html[data-theme="glass"] .sheet-backdrop {
  background: rgba(4, 6, 11, .58);
  -webkit-backdrop-filter: var(--lg-blur-scrim);
  backdrop-filter: var(--lg-blur-scrim);
}
html[data-theme="glass"] .modal-card,
html[data-theme="glass"] .sheet-card {
  border-color: rgba(255, 255, 255, .17);
  border-radius: var(--lg-r-panel);
}
html[data-theme="glass"] .sheet-card { border-radius: 26px 26px 0 0; }
html[data-theme="glass"] .sheet-grab { background: rgba(255, 255, 255, .22); }
html[data-theme="glass"] .sheet-action { color: #e9eefb; }
html[data-theme="glass"] .sheet-action svg { color: #a9c6e6; }
html[data-theme="glass"] .sheet-note,
html[data-theme="glass"] .field-label { color: #8b96ac; }
html[data-theme="glass"] .check-item .count { color: #7f8aa1; }

html[data-theme="glass"] .md-rows { border-color: rgba(255, 255, 255, .12); }
html[data-theme="glass"] .md-row { background: rgba(255, 255, 255, .035); }
html[data-theme="glass"] .md-row:nth-child(even) { background: rgba(255, 255, 255, .06); }
html[data-theme="glass"] .md-row dt { color: #8b96ac; }
html[data-theme="glass"] .md-sub { color: #9aa5bb; }
html[data-theme="glass"] .md-mode.onsite { background-color: rgba(255, 255, 255, .08); color: #dbe2f0; border: 1px solid rgba(255, 255, 255, .13); }
html[data-theme="glass"] .md-mode.remote { background-color: rgba(116, 191, 180, .16); color: #9ad9cf; border: 1px solid rgba(116, 191, 180, .28); }
html[data-theme="glass"] .md-note { background: rgba(116, 191, 180, .09); color: #b9e9e2; }
html[data-theme="glass"] .day-item { border-color: rgba(255, 255, 255, .10); }

/* --- komunikaty i historia --- */
html[data-theme="glass"] .version-banner {
  background-color: rgba(255, 168, 76, .14);
  background-image: var(--lg-sheen);
  border: 1px solid rgba(255, 190, 100, .28);
  box-shadow: var(--lg-rim);
  color: #ffe1b8;
}
html[data-theme="glass"] .version-banner svg { color: #ffb64d; }

html[data-theme="glass"] .toast {
  background-color: rgba(255, 255, 255, .13);
  background-image: var(--lg-sheen);
  border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: var(--lg-blur-panel);
  backdrop-filter: var(--lg-blur-panel);
  color: #f4f7ff;
  box-shadow: var(--lg-rim), 0 18px 44px -18px rgba(0, 0, 0, .95);
}

html[data-theme="glass"] .stat-value { color: #eef2fb; }
html[data-theme="glass"] .stat.onsite .stat-value { color: #a9c6e6; }
html[data-theme="glass"] .stat.remote .stat-value { color: #8ccfc4; }
html[data-theme="glass"] .next-meta span { color: #b9c3d8; }
html[data-theme="glass"] .subtle { color: #8b96ac; }
html[data-theme="glass"] code { background: rgba(255, 255, 255, .08); color: #dfe6f5; }
html[data-theme="glass"] .version-meta { background: rgba(255, 255, 255, .04); color: #9aa5bb; }
html[data-theme="glass"] .version-block { background-color: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .09); }
html[data-theme="glass"] .version-item.current {
  background-color: rgba(122, 166, 221, .16);
  background-image: var(--lg-sheen);
  border-color: rgba(160, 200, 245, .32);
}
html[data-theme="glass"] .vi-changes li { background: rgba(255, 255, 255, .04); }
html[data-theme="glass"] .vi-badge { background: #4f7cb8; }
html[data-theme="glass"] .empty-state { border-color: rgba(255, 255, 255, .13); }

/* Pasek koloru przedmiotu. UWAGA: .wk-event jest position:absolute w kolumnie
   tygodnia — nie wolno go tu przestawiać na relative, inaczej top:Npx liczy się
   od pozycji w przepływie i zajęcia zjeżdżają w dół zamiast trzymać godzinę. */
html[data-theme="glass"] :is(.mcard, .zc, .list-row, .day-item) { position: relative; }

html[data-theme="glass"] :is(.mcard, .zc, .list-row, .wk-event, .day-item)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: inherit;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--subject-color, var(--accent));
  opacity: .45;
  pointer-events: none;
}
html[data-theme="glass"] .wk-event::before { display: none; }
html[data-theme="glass"] .wk-event { border-left: 3px solid color-mix(in srgb, var(--subject-color, var(--accent)) 45%, transparent); }

/* ==========================================================================
   ZACHOWANIE — elementy „materializują się” przy wejściu w widok
   ========================================================================== */

/* Narożniki ciągłe (superelipsa) — Apple nie używa zwykłych łuków okręgu.
   Tylko tam, gdzie promień jest mniejszy od połowy boku; pigułki zostają
   pigułkami. Bez wsparcia w przeglądarce nic się nie psuje. */
@supports (corner-shape: squircle) {
  html[data-theme="glass"] :is(
    .month, .zjazd, .week, .list-day, .next-card, .stat, .version-block,
    .mcard, .zc, .list-row, .day, .day-item, .sheet-card, .modal-card,
    .menu-list, .popover-panel, .topbar, .toolbar, .mobile-nav.mobile-only,
    .btn, .segmented, .segmented button, .search input, .theme-opt
  ) {
    corner-shape: squircle;
  }
}

@keyframes lg-materialize {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html[data-theme="glass"] :is(.month, .zjazd, .week, .list-day, .sheet-card, .modal-card) {
    animation: lg-materialize .26s cubic-bezier(.2, .9, .3, 1.05) both;
  }
}

/* ==========================================================================
   WYDAJNOŚĆ — pomijanie renderowania tego, czego nie widać

   Semestr to 5 miesięcy po ~35 komórek, lista to 19 dni po kilka–kilkanaście
   wierszy. content-visibility:auto sprawia, że przeglądarka w ogóle nie liczy
   układu ani nie maluje paneli poza ekranem — przewijanie długiej strony
   kosztuje wtedy tyle, co widok, a nie cały semestr.
   ========================================================================== */

html[data-theme="glass"] :is(.month, .zjazd, .list-day) {
  content-visibility: auto;
  contain-intrinsic-size: auto 280px;
}
html[data-theme="glass"] .month { contain-intrinsic-size: auto 560px; }

/* ==========================================================================
   DOSTĘPNOŚĆ — systemowe ustawienia zmieniają szkło, nie psują układu
   ========================================================================== */

@media (prefers-reduced-transparency: reduce) {
  html[data-theme="glass"] :is(.month, .zjazd, .week, .list-day, .stat, .next-card,
                               .sheet-card, .modal-card, .menu-list, .popover-panel,
                               .topbar, .toolbar, .mobile-nav.mobile-only, .m-weekbar, .toast) {
    background-color: #0b0f17;
    background-image: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  html[data-theme="glass"] .wk-head { background-color: #0a0e16; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html[data-theme="glass"] :is(.chip, .mcard, .zc, .list-row, .wk-event, .day-item, .btn) {
    background-color: #121826;
    background-image: none;
  }
}

@media (prefers-contrast: more) {
  html[data-theme="glass"] {
    --lg-edge: rgba(255, 255, 255, .26);
    --lg-fill: rgba(255, 255, 255, .07);
    --lg-fill-item: rgba(255, 255, 255, .065);
    --lg-fill-ctl: rgba(255, 255, 255, .10);
    --text: #ffffff;
    --text-soft: #e2e8f4;
    --muted: #aab4c8;
  }
}

/* ==========================================================================
   WYDAJNOŚĆ — tryb lekki (html[data-glass="lite"])

   Włączany automatycznie na słabym sprzęcie (deviceMemory / rdzenie / sonda
   FPS przy przewijaniu) albo ręcznie z menu motywu. Zmienia tylko to, co
   naprawdę kosztuje: promień rozmycia, liczbę warstw cienia i animacje.
   Wygląd zostaje — zostaje krawędź, refleks i przezroczystość.
   ========================================================================== */

html[data-glass="lite"][data-theme="glass"] {
  --lg-blur-nav: blur(9px) saturate(140%);
  --lg-blur-panel: blur(9px) saturate(130%);
  --lg-blur-scrim: blur(4px);
  --lg-drop: 0 1px 1px rgba(0, 0, 0, .28), 0 6px 14px -12px rgba(0, 0, 0, .7);
  --lg-drop-ctl: 0 1px 1px rgba(0, 0, 0, .3);
  --lg-sheen: none;
}

html[data-glass="lite"][data-theme="glass"] :is(
  .chip, .mcard, .zc, .list-row, .wk-event, .day-item, .btn, .m-date,
  .mobile-nav button, .sheet-action, .menu-list a, .theme-opt
) {
  background-image: none;
}

html[data-glass="lite"][data-theme="glass"] .wk-head,
html[data-glass="lite"][data-theme="glass"] .wk-head .wk-corner {
  background-color: #0a0e16;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-glass="lite"][data-theme="glass"] .modal-backdrop,
html[data-glass="lite"][data-theme="glass"] .sheet-backdrop {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(4, 6, 11, .72);
}

html[data-glass="lite"][data-theme="glass"] :is(.month, .zjazd, .week, .list-day, .sheet-card, .modal-card) {
  animation: none;
}

/* Bez backdrop-filter (starsze Firefoxy) — szkło zostaje, brakuje rozmycia */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme="glass"] :is(.sheet-card, .modal-card, .menu-list, .popover-panel,
                               .mobile-nav.mobile-only, .m-weekbar) {
    background-color: rgba(12, 16, 24, .92);
  }
  html[data-theme="glass"] .wk-head,
  html[data-theme="glass"] .wk-head .wk-corner { background-color: #0a0e16; }
}

/* ---------- Druk ---------------------------------------------------------- */

@media print {
  :root { --shadow-sm: none; --shadow-md: none; }
  body { background: #fff; padding: 0; font-size: 11px; }
  /* content-visibility pomija to, czego nie widać — na wydruku musi zniknąć,
     inaczej dalsze miesiące wychodzą jako puste prostokąty */
  .month, .list-day, .zjazd { content-visibility: visible !important; }
  .topbar-actions, .toolbar, .footer .subtle, .modal, .toast, .next-card, .legend { display: none !important; }
  .summary { grid-template-columns: 1fr; }
  .stat { border: 1px solid #ddd; box-shadow: none; }
  .view { display: block !important; }
  .list-day { break-inside: avoid; page-break-inside: avoid; box-shadow: none; }
  .chip { box-shadow: none !important; }
  a { color: inherit; text-decoration: none; }
}

