:root {
  --bg: #0f1117;
  --panel: #161a23;
  --panel2: #1d222e;
  --line: #2a3040;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #7aa2f7;
  --accent2: #9ece6a;
  --parity: #e0af68;
  --danger: #f7768e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, "Inter", sans-serif;
}
a { color: var(--accent); }

header {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
h1 { font-size: 18px; margin: 0; }
.sub { color: var(--muted); font-size: 13px; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button, select {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font: inherit; cursor: pointer;
}
button:hover { border-color: var(--accent); }
.weeknav { display: flex; }
.weeknav button { border-radius: 0; border-right-width: 0; }
.weeknav button:first-child { border-radius: 8px 0 0 8px; }
.weeknav button:last-child { border-radius: 0 8px 8px 0; border-right-width: 1px; }

.ghost-toggle { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; cursor: pointer; }

#weeklabel {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 18px 0 18px; font-size: 14px;
}
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12px; color: var(--parity); }
.muted { color: var(--muted); font-size: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 12px 18px 20px;
}
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.day {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; min-height: 120px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dayhead { display: flex; justify-content: space-between; align-items: baseline; }
.dayhead h3 { margin: 0; font-size: 14px; }
.dayhead .muted { font-size: 12px; }

.lesson {
  background: var(--panel2); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 8px 10px; position: relative;
}
.lesson.seminar { border-left-color: #bb9af7; }
.lesson.laborator { border-left-color: var(--accent2); }
.lesson.altweek { opacity: 0.42; }
.lesson .l-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 14px; }
.lesson .l-time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lesson .l-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lesson .l-badge { font-size: 11px; color: var(--parity); border: 1px solid var(--parity); border-radius: 999px; padding: 0 6px; }

footer { padding: 8px 18px 20px; }
#legend { padding: 0 18px 16px; color: var(--muted); font-size: 12px; }
