:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --outline: #e2e8f0;
  --primary: #0ea5e9;
  --primary-strong: #0284c7;
  --primary-soft: #e0f2fe;
  --accent: #6366f1;
  --motion: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --ink-color: #3e2723;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-bg-card: rgba(255, 255, 255, 0.8);
  --glass-border-card: rgba(255, 255, 255, 0.6);
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --outline: #475569;
  --primary: #38bdf8;
  --primary-strong: #7dd3fc;
  --primary-soft: rgba(56, 189, 248, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --bg-gradient: linear-gradient(135deg, #020617 0%, #0f172a 100%);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(71, 85, 105, 0.5);
  --glass-bg-card: rgba(30, 41, 59, 0.8);
  --glass-border-card: rgba(71, 85, 105, 0.5);
}

[data-theme="liquid-glass"] {
  color-scheme: dark;
  --bg: #020617;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --outline: rgba(255, 255, 255, 0.12);
  --primary: #38bdf8;
  --primary-strong: #7dd3fc;
  --primary-soft: rgba(56, 189, 248, 0.2);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --bg-gradient: radial-gradient(circle at 0% 0%, #0f172a 0%, transparent 50%),
                 radial-gradient(circle at 100% 0%, #0369a1 0%, transparent 50%),
                 radial-gradient(circle at 100% 100%, #1e1b4b 0%, transparent 50%),
                 radial-gradient(circle at 0% 100%, #0f172a 0%, transparent 50%),
                 #020617;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-bg-card: rgba(255, 255, 255, 0.07);
  --glass-border-card: rgba(255, 255, 255, 0.18);
}

[data-theme="liquid-glass"] body {
  background-size: 200% 200%;
  animation: auroraBackground 15s ease infinite;
}

@keyframes auroraBackground {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

[data-theme="liquid-glass"] .lesson__pair {
  background: #ffffff;
  color: #0f172a;
}

* { 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  animation: fadeIn 0.4s ease-out;
}

.app {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

.hero {
  padding: 32px 24px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 0;
}

.hero__branding {
  display: flex;
  align-items: center;
  gap: 24px;
  animation: slideUp 0.6s ease-out;
}

.hero__logo-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.hero__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  transition: transform var(--motion);
}

.hero__logo:hover {
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 0 20px var(--primary-soft);
}

.hero__brand {
  text-align: left;
  border-left: 1px solid var(--outline);
  padding-left: 20px;
}

.hero__line {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hero__line--secondary {
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.8;
}

.hero__content {
  z-index: 1;
}

.hero__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.hero__subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.hero__controls {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Floating Stack */
.floating-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.floating-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--outline);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--motion);
  padding: 0;
  overflow: hidden;
}

.floating-btn:hover {
  transform: translateY(-6px) scale(1.15);
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.floating-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-btn svg {
  width: 22px;
  height: 22px;
}

.poetic-mode .poetic-btn {
  background: #fbbf24;
  color: #000;
  border-color: #fbbf24;
}

.buddy-bubble {
  position: fixed;
  right: 80px;
  bottom: 128px;
  background: var(--glass-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-card);
  padding: 12px 18px;
  border-radius: 20px 20px 4px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  max-width: 260px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
  line-height: 1.5;
  border-bottom-right-radius: 4px;
}

.buddy-bubble::after {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 8px solid var(--glass-border-card);
  border-top: 8px solid transparent;
}

[data-theme="liquid-glass"] .buddy-bubble {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.hero__week-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.week-toggle {
  --active-index: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface-2);
  padding: 4px;
  border-radius: 16px;
  position: relative;
  width: 100%;
  max-width: 340px;
}

.week-toggle::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  height: calc(100% - 8px);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translateX(calc(var(--active-index) * 100%));
  transition: transform var(--motion);
}

.week-toggle__btn {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: color var(--motion);
}

.week-toggle__btn--active { 
  color: var(--text); 
}

.week-toggle__value {
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
}

.week-toggle__label {
  font-size: 10px;
  text-transform: lowercase;
  opacity: 0.7;
}

.filters {
  background: transparent;
  padding: 0 24px 24px 24px;
  margin-top: 0;
  position: relative;
  z-index: 10;
  border: none;
  box-shadow: none;
}

.week-indicator-inline {
  margin-bottom: 24px;
  margin-top: -8px;
  padding: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.filters__tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 16px;
  position: relative;
}

.tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 12px;
  padding: 8px 4px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--motion);
  min-width: 0;
}

.tab:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.tab--active {
  color: var(--primary);
  background: var(--primary-soft);
}

.tab__icon svg { width: 18px; height: 18px; stroke-width: 2.25; }

/* Secondary tabs — subtle visual separation for Sítka & Zamiyny */
.tab--secondary {
  opacity: 0.65;
}

.tab--secondary.tab--active,
.tab--secondary:hover {
  opacity: 1;
}

.filters__controls { 
  display: grid; 
  gap: 12px; 
}

.filters__label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control {
  width: 100%;
  padding: 16px 20px;
  border-radius: 16px;
  border: 2px solid var(--primary-soft);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  color: var(--primary-strong);
  font-size: 16px;
  font-family: inherit;
  font-weight: 700;
  transition: all var(--motion);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 20px;
  padding-right: 52px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.08), inset 0 2px 0 var(--glass-border);
}

.control:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}

.control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft), 0 8px 24px rgba(14, 165, 233, 0.2);
}

.filters__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.filters__summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-strong);
  display: flex;
  align-items: center;
  gap: 6px;
}

.upcoming-subs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--motion);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  white-space: nowrap;
}

.upcoming-subs-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
}

.tab__label { font-size: 12px; }

.filters__controls { display: grid; gap: 8px; }

.filters__label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--md-muted);
  font-size: 12px;
}

.control {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  font-size: 14px;
}

.filters__summary {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--md-primary-strong);
}

.schedule__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.day-card {
  background: var(--glass-bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border-card);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--motion);
  animation: slideIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.day-card:nth-child(1) { animation-delay: 0.1s; }
.day-card:nth-child(2) { animation-delay: 0.15s; }
.day-card:nth-child(3) { animation-delay: 0.2s; }
.day-card:nth-child(4) { animation-delay: 0.25s; }
.day-card:nth-child(5) { animation-delay: 0.3s; }

.day-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px) scale(1.02);
  border-color: var(--primary);
}

.day-card {
  position: relative;
  overflow: hidden;
}

.day-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: skewX(-25deg);
  transition: 0.75s;
  pointer-events: none;
}

.day-card:hover::before {
  left: 150%;
}

.day-card--today {
  border-color: var(--primary);
  position: relative;
  overflow: hidden;
}

.day-card--today::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  box-shadow: 2px 0 10px var(--primary-soft);
}

.badge--today {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

.day-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.day-card__title { 
  font-size: 18px; 
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
}

.lesson {
  border-top: 1px solid var(--outline);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson:first-of-type {
  border-top: none;
  padding-top: 0;
}

.lesson--split { 
  border-top-style: dashed; 
}

.lesson__split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.lesson__column {
  border: 1px solid var(--outline);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-2);
  min-width: 0;
}

.lesson__time {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson__pair {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lesson__clock {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.lesson__subject { 
  font-size: 16px; 
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.lesson__meta {
  font-size: 13px;
  color: var(--text-muted);
  display: grid;
  gap: 6px;
}

.lesson__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lesson__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: 10px;
  color: var(--primary);
  transition: all var(--motion);
}

.lesson:hover .lesson__icon {
  background: var(--primary-soft);
  transform: rotate(-5deg) scale(1.1);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--outline);
  border-radius: 32px;
  margin-top: 24px;
  animation: fadeIn 0.8s ease-out;
}

.empty-state__icon {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--primary-soft);
  border-radius: 24px;
  color: var(--primary);
}

.empty-state__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.empty-state__text {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  max-width: 280px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.lesson__subgroup {
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}

.lesson__meta a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--motion);
}

.lesson__meta a:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .filters__tabs { grid-template-columns: repeat(2, 1fr); }
  .lesson__split { grid-template-columns: 1fr; }
  .hero { padding: 16px; border-radius: 20px; }
  .hero__header { 
    flex-direction: column; 
    gap: 16px; 
    text-align: center;
    align-items: stretch;
  }
  .hero__branding {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  .hero__logo {
    width: 80px;
    height: 80px;
  }
  .hero__brand { 
    text-align: center; 
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--outline);
    padding-top: 8px;
  }
  .hero__title { font-size: 20px; }
  
  .hero__controls {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .week-toggle {
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .schedule__grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
  }

  .hero__header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }

  .hero__title-block {
    text-align: left;
  }

  .hero__branding {
    flex: 0 0 auto;
  }

  .hero__controls {
    flex: 0 0 auto;
    margin-top: 0;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Smooth Transitions */
.hero, .filters, .schedule, .day-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.lesson:hover {
  background: var(--surface-2);
  border-radius: 12px;
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
}

/* Tab Text Responsiveness */
@media (max-width: 600px) {
  .tab__text {
    font-size: 12px;
  }
  .tab {
    padding: 10px 2px;
  }
}

.filters__label-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
}

.filters__label-current {
  color: var(--primary);
  font-weight: 700;
}

.filters__label-sep {
  opacity: 0.3;
}

.filters__controls .favorite-btn {
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--outline);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--motion);
}

.filters__controls .favorite-btn--active {
  background: #fbbf24;
  color: #000;
  border-color: #fbbf24;
}


/* Poetic Mode Overrides */
.poetic-mode {
  --ink-color: #3e2723;
}

[data-theme="light"].poetic-mode {
  --bg: #f4ece4;
  --surface: #fdfaf6;
  --surface-2: #f7f1e9;
  --text: #3e2723;
  --text-muted: #795548;
  --outline: #d7ccc8;
  --primary: #8d6e63;
  --primary-strong: #5d4037;
  --primary-soft: #efebe9;
  --bg-gradient: linear-gradient(to bottom, #f4ece4, #e8dcd0),
                 url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

[data-theme="liquid-glass"].poetic-mode {
  /* Keep liquid glass vibrant colors but adapt typography and some sepia accents */
  --bg-gradient: radial-gradient(circle at 0% 0%, #2b1810 0%, transparent 50%),
                 radial-gradient(circle at 100% 0%, #5d4037 0%, transparent 50%),
                 radial-gradient(circle at 100% 100%, #1e1b4b 0%, transparent 50%),
                 radial-gradient(circle at 0% 100%, #3e2723 0%, transparent 50%),
                 #020617;
  --ink-color: #ffd180;
  --text: #fff8e1;
  --text-muted: rgba(255, 248, 225, 0.7);
  --outline: rgba(255, 248, 225, 0.15);
}

[data-theme="liquid-glass"].poetic-mode .lesson__pair {
  background: var(--ink-color);
  color: #3e2723;
}

.poetic-mode body {
  background-blend-mode: multiply;
}

.poetic-mode .hero__title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.poetic-mode .day-card {
  background: var(--surface);
  border: 1px solid #c0b0a0;
  box-shadow: 2px 2px 0 #d0c0b0, 0 10px 20px rgba(0,0,0,0.05);
  border-radius: 4px;
}

.poetic-mode .badge {
  background: #efebe9;
  color: #5d4037;
  border: 1px solid #d7ccc8;
  border-radius: 0;
  font-family: serif;
}

.poetic-mode .lesson__pair {
  background: #3e2723;
  border-radius: 0;
}

/* Buddy React Animations */
.buddy-btn {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.buddy-btn:hover {
  animation: buddyTilt 0.6s infinite ease-in-out alternate;
}

@keyframes buddyTilt {
  0% { transform: translateY(-6px) scale(1.15) rotate(-5deg); }
  100% { transform: translateY(-6px) scale(1.15) rotate(5deg); }
}

.buddy-btn--wink img {
  filter: brightness(1.2) contrast(1.1);
}

/* Substitutions Tab Cards */
.lesson__column--substitution-tab {
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.05);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

[data-theme="dark"] .lesson__column--substitution-tab {
  background: rgba(245, 158, 11, 0.1);
}
.skeleton-lesson {
  padding: 16px 0;
  border-top: 1px solid var(--outline);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 16px;
  width: 100%;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--medium { width: 70%; }

.skeleton-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.skeleton-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Live Mode */
.lesson {
  position: relative;
}

.lesson--past {
  opacity: 0.55;
  filter: grayscale(1);
}

.lesson--live::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--primary-soft);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 11px;
  font-weight: 800;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.live-pulse {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.lesson__progress {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  margin: 12px 0 8px;
  overflow: hidden;
}

.lesson__progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 1s linear;
}

.lesson--window {
  border: 1px dashed var(--outline);
  border-top-style: dashed;
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background: transparent;
}

.lesson__window-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.lesson__window-icon {
  font-size: 18px;
}
/* Room Grid */
.room-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.room-grid__lesson {
  background: var(--glass-bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-sm);
  transition: all var(--motion);
}

.room-grid__lesson:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.room-grid__lesson-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--outline);
}

.room-grid__lesson-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-grid__section {
  margin-top: 12px;
}

.room-grid__section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.05em;
}

.room-grid__section-title--small {
  margin-top: 16px;
  font-size: 10px;
  opacity: 0.8;
  border-top: 1px dashed var(--outline);
  padding-top: 8px;
  margin-bottom: 12px;
}

.room-grid__rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--motion);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.room-badge--busy {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.room-badge--free {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}

.room-badge:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.room-badge--busy:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.room-badge--free:hover {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

.room-badge--pc {
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
}

.room-badge--pc svg {
  vertical-align: middle;
  margin-right: 2px;
  opacity: 0.9;
}

.room-badge--gym {
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
}

.room-badge--gym svg {
  vertical-align: middle;
  margin-right: 2px;
  opacity: 0.9;
}

/* ─── Scroll Reveal ────────────────────────────────────────────────────────── */

@keyframes scrollReveal {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.schedule-reveal {
  animation: scrollReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ─── Ink Blot ───────────────────────────────────────────────────────────────── */

.ink-blot {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--ink-color);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  filter: blur(2px);
  opacity: 0.7;
  transform: scale(0);
  animation: ink-spread 2s ease-out forwards;
}

@keyframes ink-spread {
  0% {
    transform: scale(0);
    opacity: 0.8;
  }
  20% {
    transform: scale(1.5) rotate(15deg);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }
  100% {
    transform: scale(3) rotate(30deg);
    opacity: 0;
  }
}

/* ─── Candle Progress ───────────────────────────────────────────────────────── */

.candle-progress {
  position: relative;
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
  overflow: visible;
  margin-top: 8px;
}

.candle-progress__bar {
  height: 100%;
  background: var(--ink-color);
  border-radius: 3px;
  position: relative;
  transition: width 0.3s ease;
}

.candle-progress__flame {
  position: absolute;
  right: -5px;
  top: -12px;
  width: 10px;
  height: 14px;
  background: #f59e0b;
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 10px #f59e0b, 0 0 20px #fbbf24;
  animation: flame-flicker 0.1s infinite alternate;
}

@keyframes flame-flicker {
  0% { transform: scale(1) rotate(-1deg); opacity: 0.8; }
  100% { transform: scale(1.1) rotate(1deg); opacity: 1; }
}
/* ── Week Indicator ─────────────────────────────────────────────────── */
.week-indicator {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.4s ease-out;
}

.week-indicator__text strong {
  color: var(--primary-strong);
}

/* ── Substitution Badges ───────────────────────────────────────────── */
.sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  white-space: nowrap;
}

/* For group view: orange "ЗАМІНА" */
.sub-badge--group {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
  animation: subPulse 2.5s ease-in-out infinite;
}

/* For teacher (replaced): red "ПАРА ЗАМІНЕНА" */
.sub-badge--cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Full-width cancelled badge */
.sub-badge--wide {
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
}

/* For substitute teacher: green "ЗАМІНА" */
.sub-badge--substitute {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

@keyframes subPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.15); }
  50% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.4); }
}

/* Substitution column styling */
.lesson__column--substitution {
  border-color: rgba(245, 158, 11, 0.4) !important;
  background: rgba(245, 158, 11, 0.05) !important;
}

.lesson__column--cancelled {
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.04) !important;
}

.lesson__column--substitute {
  border-color: rgba(34, 197, 94, 0.35) !important;
  background: rgba(34, 197, 94, 0.05) !important;
}

/* ── Upcoming Substitutions Panel ─────────────────────────────────── */
.upcoming-subs {
  background: var(--glass-bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(245, 158, 11, 0.1);
  animation: slideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.upcoming-subs__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.upcoming-subs__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.upcoming-subs__close {
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--motion);
}

.upcoming-subs__close:hover {
  background: var(--surface);
  color: var(--text);
}

.upcoming-subs__loading {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.upcoming-subs__empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 12px 0;
}

.upcoming-subs__date-group {
  margin-bottom: 16px;
}

.upcoming-subs__date-header {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #d97706;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(245, 158, 11, 0.3);
}

.upcoming-subs__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--outline);
}

.upcoming-subs__item:first-child {
  border-top: none;
}

.upcoming-subs__pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 90px;
}

.upcoming-subs__details {
  flex: 1;
  min-width: 0;
}

.upcoming-subs__group {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-strong);
  letter-spacing: 0.04em;
}

.upcoming-subs__subject {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0;
}

.upcoming-subs__teachers {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.upcoming-subs__original {
  text-decoration: line-through;
  opacity: 0.7;
}

.upcoming-subs__arrow {
  color: #16a34a;
  font-weight: 600;
}

.upcoming-subs__room {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.upcoming-subs__room a {
  color: var(--primary);
  text-decoration: none;
}


/* ── Favorites ────────────────────────────────── */
.favorite-btn {
  background: var(--surface);
  border: 1px solid var(--outline);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--motion);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.favorite-btn:hover {
  background: var(--surface-2);
  color: #fbbf24;
  border-color: #fbbf24;
  transform: translateY(-1px);
}

.favorite-btn--active {
  color: #fbbf24 !important;
  border-color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.05) !important;
}

.favorite-btn--active svg {
  fill: #fbbf24;
  animation: starPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.filters__summary-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.filters__summary {
  flex: 1;
  min-width: 0;
}

.filters__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--outline);
}


