/* Min kalender app: mobil først, lyst/mørkt tema efter systemet. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #15171c;
  --muted: #687080;
  --line: #e2e5eb;
  --line-strong: #cfd4dc;

  --module: #0a7fc4;
  --module-bg: #e6f3fb;
  --module-text: #075d90;
  --shift: #ef7a2b;
  --shift-bg: #fff0e4;
  --shift-text: #a24a0e;
  --other: #8a90a0;
  --other-bg: #eceef2;
  --accent: #3346c9;
  --accent-soft: #e9ecfb;
  --now: #e5383b;
  --ok: #1f9d55;
  --danger: #d93636;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 8px rgba(16, 24, 40, 0.05);
  --tabbar-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --hour-h: 46px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #1a1c21;
    --surface-2: #23262d;
    --text: #eceef2;
    --muted: #9198a5;
    --line: #2a2e36;
    --line-strong: #3a3f49;

    --module: #3fa9ea;
    --module-bg: #13293a;
    --module-text: #9fd5f7;
    --shift: #ff9a52;
    --shift-bg: #36230f;
    --shift-text: #ffc796;
    --other: #7d8494;
    --other-bg: #23262d;
    --accent: #8b9bff;
    --accent-soft: #232845;
    --now: #ff5a5f;
    --ok: #3ccf7e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { width: 26px; height: 26px; color: var(--module); }
.brand h1 { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; white-space: nowrap; }
.status { margin-left: auto; min-width: 0; font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }
.status.stale .dot { background: var(--shift); }
@media (max-width: 430px) { .status-text { display: none; } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  flex: none;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pill-btn {
  border: 0;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
}
.pill-btn:disabled { opacity: 0.45; cursor: default; }

.banner {
  margin: 0 16px 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--shift-bg);
  color: var(--shift-text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.banner button { margin-left: auto; border: 0; background: var(--shift); color: #fff; font-weight: 650; padding: 6px 12px; border-radius: 999px; cursor: pointer; }

/* ---------- Layout ---------- */
.layout {
  padding: 4px max(16px, env(safe-area-inset-right)) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px) max(16px, env(safe-area-inset-left));
  max-width: 1440px;
  margin: 0 auto;
}
.app[data-tab='week'] .panel-homework,
.app[data-tab='week'] .panel-hours,
.app[data-tab='homework'] .panel-week,
.app[data-tab='homework'] .panel-hours,
.app[data-tab='hours'] .panel-week,
.app[data-tab='hours'] .panel-homework { display: none; }

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 2px 12px; }
.panel-head h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }

/* ---------- Ugenavigation ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.week-title { flex: 1; min-width: 0; text-align: center; }
.week-title h2 { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; }
.week-title p { font-size: 13.5px; }

.week-body { position: relative; touch-action: pan-y; }
.week-body.slide-left { animation: slideL 0.22s ease-out; }
.week-body.slide-right { animation: slideR 0.22s ease-out; }
@keyframes slideL { from { opacity: 0; transform: translateX(24px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(-24px); } }
@media (prefers-reduced-motion: reduce) {
  .week-body.slide-left, .week-body.slide-right { animation: none; }
}

/* ---------- Mobil: dagskort ---------- */
.days { display: grid; gap: 10px; }
.day {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  scroll-margin-top: 80px;
}
.day.today { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.day-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.day-name { font-weight: 700; font-size: 16px; }
.day-date { color: var(--muted); font-size: 14px; }
.day-badge { margin-left: auto; font-size: 12px; font-weight: 700; color: #fff; background: var(--accent); padding: 2px 9px; border-radius: 999px; }
.day.past { opacity: 0.62; }
.day.empty { padding-top: 10px; padding-bottom: 10px; }
.day.empty .day-head { margin-bottom: 0; }
.day-free { margin-left: auto; color: var(--muted); font-size: 13.5px; }
.day.today .day-free { margin-left: 0; }

.events { display: grid; gap: 6px; }
.event {
  display: grid;
  grid-template-columns: 52px 4px 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 8px 10px 8px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.event-time { font-variant-numeric: tabular-nums; font-size: 13px; line-height: 1.3; color: var(--muted); text-align: right; padding-top: 1px; }
.event-time b { display: block; color: var(--text); font-weight: 650; font-size: 14px; }
.event-bar { border-radius: 4px; background: var(--module); }
.event-main { min-width: 0; }
.event-title { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.event-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event.modul { background: var(--module-bg); }
.event.modul .event-title { color: var(--module-text); }
.event.vagt { background: var(--shift-bg); }
.event.vagt .event-bar { background: var(--shift); }
.event.vagt .event-title { color: var(--shift-text); }
.event.andet { background: var(--other-bg); }
.event.andet .event-bar { background: var(--other); }
.hw-chip.note { color: var(--muted); }
.event.ongoing { box-shadow: inset 0 0 0 1.5px var(--now); }
.hw-chip { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--module-text); }
.hw-chip.done { color: var(--ok); }
.hw-chip svg { width: 12px; height: 12px; }

/* ---------- Desktop: tidsgitter ---------- */
.grid { display: none; }

/* ---------- Lektier ---------- */
.progress { display: flex; align-items: center; gap: 12px; margin: 0 2px 14px; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--ok); transition: width 0.3s ease; }
.progress-label { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.hw-group { margin-bottom: 16px; }
.hw-group h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 4px 8px; }
.hw-group.today h3 { color: var(--accent); }
.hw-list { display: grid; gap: 8px; }
.hw-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s;
}
.hw-item input { position: absolute; opacity: 0; pointer-events: none; }
.check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  margin-top: 1px;
}
.check svg { width: 16px; height: 16px; opacity: 0; transform: scale(0.6); transition: 0.15s; }
.hw-item input:checked + .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.hw-item input:checked + .check svg { opacity: 1; transform: none; }
.hw-item input:focus-visible + .check { outline: 2px solid var(--accent); outline-offset: 2px; }
.hw-item:active .check { transform: scale(0.9); }
.hw-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.hw-subject { font-weight: 700; color: var(--module-text); }
.hw-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hw-text { margin-top: 3px; white-space: pre-line; overflow-wrap: anywhere; }
.hw-text a { color: var(--accent); }
.hw-teacher { margin-top: 4px; font-size: 13px; color: var(--muted); }
.hw-item.done { opacity: 0.55; }
.hw-item.done .hw-text { text-decoration: line-through; text-decoration-color: var(--muted); }
.hw-item.saving .check { border-style: dashed; }

.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state .big { font-size: 34px; margin-bottom: 6px; }
.empty-state strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }

/* ---------- Timer ---------- */
.months { display: grid; gap: 12px; }
.month {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.month-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.month-name { font-weight: 700; font-size: 16px; }
.month-tag { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; }
.month-hours { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.month-hours .num { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--shift-text); }
.month-hours .unit { font-size: 16px; color: var(--muted); font-weight: 600; }
.month-sub { color: var(--muted); font-size: 14px; }
.month .progress { margin: 12px 0 0; }
.month .progress-fill { background: var(--shift); }
.month details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.month summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 6px; }
.month summary::-webkit-details-marker { display: none; }
.month summary svg { width: 14px; height: 14px; transition: transform 0.2s; }
.month details[open] summary svg { transform: rotate(90deg); }
.shift-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.shift-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.shift-list li:last-child { border-bottom: 0; }
.shift-list .when { font-variant-numeric: tabular-nums; }
.shift-list .h { font-weight: 650; font-variant-numeric: tabular-nums; }
.shift-list li.done .when { color: var(--muted); }
.shift-list .note { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Skeleton ---------- */
.skeleton-list { display: grid; gap: 10px; }
.skeleton { height: 76px; border-radius: var(--radius); margin-bottom: 10px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.error-box { padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.error-box strong { display: block; margin-bottom: 4px; }
.error-box button { margin-top: 10px; }

/* ---------- Bundnavigation ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.tab svg { width: 25px; height: 25px; }
.tab[aria-current='page'] { color: var(--accent); }
.tab-badge {
  position: absolute;
  top: 5px;
  left: calc(50% + 8px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 550;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* ---------- Detaljeark (bundark på mobil, dialog på PC) ---------- */
.sheet {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
}
.sheet[open] { animation: sheetUp 0.24s cubic-bezier(0.2, 0.9, 0.3, 1); }
.sheet::backdrop { background: rgba(10, 12, 18, 0.42); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.sheet-inner { position: relative; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-grabber { width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; box-shadow: none; background: var(--surface-2); }
.sheet-close svg { width: 16px; height: 16px; }
.sheet-kind { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 10px; border-radius: 999px; background: var(--module-bg); color: var(--module-text); }
.sheet-kind.vagt { background: var(--shift-bg); color: var(--shift-text); }
.sheet-content h2 { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; margin: 8px 44px 14px 0; }
.sheet-rows { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px; }
.sheet-rows dt { color: var(--muted); font-size: 14px; }
.sheet-rows dd { margin: 0; font-weight: 550; }
.sheet-rows dd.note { font-weight: 450; white-space: pre-line; overflow-wrap: anywhere; }
.sheet-kind.andet { background: var(--other-bg); color: var(--text); }
.sheet-hw h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 8px; }
.sheet-hw .hw-item { box-shadow: none; background: var(--surface-2); }
@media (min-width: 900px) {
  .sheet { margin: auto; border-radius: 22px; }
  .sheet-grabber { display: none; }
  .sheet-inner { padding: 22px 24px 24px; }
}
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }

/* ---------- Login ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
body.logged-out .app { display: none; }
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 24px);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 22px 24px;
  display: grid;
  gap: 12px;
  text-align: center;
}
.login-logo { width: 64px; height: 64px; margin: 0 auto 2px; border-radius: 16px; }
.login-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.login-card > p { margin-bottom: 6px; }
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}
.login-btn svg { width: 22px; height: 22px; flex: none; }
.login-btn.primary, .login-form .login-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.login-btn:disabled, .login-btn.busy { opacity: 0.6; cursor: progress; }
.login-btn:active { transform: scale(0.98); }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-form { display: grid; gap: 8px; text-align: left; }
.login-form label { font-size: 14px; font-weight: 600; color: var(--muted); }
.login-form input[type='password'] {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 17px; /* >= 16px, så iPhone ikke zoomer ind */
}
.login-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: 14px; font-weight: 550; text-align: left; }
.small { font-size: 13px; }

/* ---------- Konto-ark ---------- */
.account-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 18px 0 8px; }
.passkey-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.passkey-list li div { display: grid; gap: 2px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.link-btn { border: 0; background: none; font: inherit; font-weight: 650; color: var(--accent); cursor: pointer; padding: 6px; }
.danger { color: var(--danger) !important; }
.pill-btn.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.pill-btn.danger-fill { background: var(--danger); color: #fff; }
.account .pill-btn { height: 40px; }

/* =================== PC / bred skærm =================== */
@media (min-width: 900px) {
  :root { --tabbar-h: 0px; }
  body { font-size: 14.5px; }
  .tabbar { display: none; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto 1fr;
    gap: 20px 24px;
    align-items: start;
    padding: 4px 24px 32px;
  }
  .app .panel { display: block !important; }
  .panel-week { grid-column: 1; grid-row: 1 / span 2; }
  .panel-homework { grid-column: 2; grid-row: 1; }
  .panel-hours { grid-column: 2; grid-row: 2; }
  .panel-head h2 { font-size: 19px; }
  .toast { bottom: 24px; }

  .week-nav { justify-content: flex-start; }
  .week-title { flex: 0 1 auto; text-align: left; order: -1; margin-right: auto; }
  .week-title h2 { font-size: 24px; }

  .days { display: none; }
  .grid {
    display: grid;
    grid-template-columns: 52px repeat(7, minmax(0, 1fr));
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .grid-corner { border-bottom: 1px solid var(--line); }
  .grid-head {
    padding: 10px 8px 8px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
  .grid-head .wd { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .grid-head .dn { display: inline-grid; place-items: center; min-width: 32px; height: 32px; margin-top: 2px; padding: 0 6px; border-radius: 999px; font-size: 18px; font-weight: 700; }
  .grid-head.today .wd { color: var(--accent); }
  .grid-head.today .dn { background: var(--accent); color: #fff; }
  .grid-head.weekend { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

  .grid-hours { position: relative; }
  .grid-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .grid-col {
    position: relative;
    border-left: 1px solid var(--line);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-h) - 1px), var(--line) calc(var(--hour-h) - 1px), var(--line) var(--hour-h));
  }
  .grid-col.weekend { background-color: color-mix(in srgb, var(--surface-2) 45%, transparent); }
  .grid-col.today { background-color: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
  .g-event {
    position: absolute;
    left: 3px;
    right: 3px;
    overflow: hidden;
    padding: 4px 7px;
    border-radius: 8px;
    border-left: 3px solid var(--module);
    background: var(--module-bg);
    color: var(--module-text);
    font-size: 12.5px;
    line-height: 1.25;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    font-family: inherit;
  }
  .g-event:hover { filter: brightness(0.97); }
  .g-event.vagt { border-left-color: var(--shift); background: var(--shift-bg); color: var(--shift-text); }
  .g-event.andet { border-left-color: var(--other); background: var(--other-bg); color: var(--text); }
  .g-event b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .g-event .t { font-variant-numeric: tabular-nums; opacity: 0.85; }
  .g-event .s { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .g-event .hw { position: absolute; top: 4px; right: 5px; width: 14px; height: 14px; }
  .g-event.short .s { display: none; }
  .g-event.tiny { padding-top: 1px; padding-bottom: 1px; }
  .g-event.tiny .t { display: none; }
  .now-line { position: absolute; left: -1px; right: 0; height: 2px; background: var(--now); z-index: 3; pointer-events: none; }
  .now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }

  .panel-homework, .panel-hours { position: relative; }
  .hw-item { padding: 10px 12px; }
  .month-hours .num { font-size: 34px; }
}

@media (min-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 400px; }
  :root { --hour-h: 52px; }
}
