/* ==========================================================================
   School calendar — styles
   Visual idea: a school exercise book. Ink-blue actions, coloured-pencil
   subjects, a highlighter swipe for today.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --paper: #F3F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEF2F8;
  --weekend: #F8FAFC;
  --hover: #F1F5FB;
  --line: #DFE5EE;
  --line-strong: #C4CEDC;

  --ink: #1C2333;
  --ink-2: #4A5468;
  --ink-3: #737F94;

  --primary: #2B4C9B;
  --primary-hover: #213C7E;
  --primary-ink: #FFFFFF;
  --primary-soft: #E3EAF8;

  --highlight: #FFE066;
  --highlight-ink: #1C2333;

  --danger: #B93A26;
  --danger-hover: #9C2F1D;
  --danger-soft: #FCEBE7;

  /* Coloured pencils, one per subject */
  --s0: #D64545;
  --s1: #E07B2E;
  --s2: #C29A12;
  --s3: #3B9457;
  --s4: #1F9A93;
  --s5: #3A6FD8;
  --s6: #7A55C4;
  --s7: #C94F92;

  --font: 'Lexend', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r-panel: 14px;
  --r-control: 10px;
  --r-chip: 4px;

  --shadow-dialog: 0 24px 64px -16px rgba(20, 28, 48, 0.38);
  --shadow-toast: 0 10px 30px -8px rgba(20, 28, 48, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161D;
    --surface: #191E27;
    --surface-2: #222936;
    --weekend: #161B23;
    --hover: #1F2531;
    --line: #2A3241;
    --line-strong: #3B4558;

    --ink: #E8ECF3;
    --ink-2: #B7C0CF;
    --ink-3: #8792A6;

    --primary: #8FA9F0;
    --primary-hover: #A8BCF4;
    --primary-ink: #0E1630;
    --primary-soft: #232F50;

    --highlight: #E9C84A;

    --danger: #F08572;
    --danger-hover: #F4A091;
    --danger-soft: #3A211D;

    --s0: #EE6B6B;
    --s1: #F0975A;
    --s2: #DDB843;
    --s3: #5DBB7A;
    --s4: #42C0B8;
    --s5: #6E98F0;
    --s6: #A285E4;
    --s7: #E57CB6;

    --shadow-dialog: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
    --shadow-toast: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  -webkit-font-smoothing: antialiased;
}

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

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

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: var(--r-control);
  background: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.btn:disabled { opacity: 0.6; cursor: default; }

.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:not(:disabled):hover { background: var(--primary-hover); }

.btn--ghost { border-color: var(--line-strong); background: var(--surface); }
.btn--ghost:not(:disabled):hover { background: var(--surface-2); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:not(:disabled):hover { background: var(--danger-hover); }
@media (prefers-color-scheme: dark) { .btn--danger { color: #1A0D0A; } }

.btn--text {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.btn--text:not(:disabled):hover { background: var(--surface-2); color: var(--ink); }
.btn--text.is-danger:not(:disabled):hover { background: var(--danger-soft); color: var(--danger); }
.btn--text svg { width: 16px; height: 16px; }

.btn--icon { width: 40px; padding: 0; }
.btn--small { min-height: 32px; padding: 0 12px; font-size: 0.875rem; }
.btn--compact { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Loading bar
   -------------------------------------------------------------------------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  overflow: hidden;
  z-index: 40;
}
.progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  animation: progress 1.1s ease-in-out infinite;
}
@keyframes progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 28px 14px;
}
.topbar__title { flex: 1; min-width: 0; }
.topbar__nav { display: flex; align-items: center; gap: 6px; }

.month-label {
  font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.month-summary {
  min-height: 1.4em;
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px 28px;
}

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */

.calendar {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 140px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  background: var(--danger-soft);
  color: var(--danger);
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}
.banner p { flex: 1; }

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.weekdays span {
  padding: 10px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
}

.grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: opacity 0.15s;
}
.grid[aria-busy="true"].is-empty { opacity: 0.55; }

.week {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 116px;
}
.week + .week { border-top: 1px solid var(--line); }

.cell { display: flex; min-width: 0; border-left: 1px solid var(--line); }
.cell:first-child { border-left: 0; }
.cell--weekend { background: var(--weekend); }

.day {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 8px 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.day:hover { background: var(--hover); }
.day:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.cell--selected .day {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.day__num {
  position: relative;
  isolation: isolate;
  align-self: flex-start;
  padding: 0 4px;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}
.cell--outside .day { color: var(--ink-3); }
.cell--outside .day__list { opacity: 0.6; }

/* Today: a highlighter swipe behind the date */
.cell--today .day__num { font-weight: 600; color: var(--highlight-ink); }
.cell--today .day__num::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12% -3px 6% -3px;
  background: var(--highlight);
  border-radius: 3px 7px 4px 8px;
  transform: rotate(-4deg) skewX(-6deg);
}

.day__list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 2px 6px;
  border-left: 3px solid var(--c);
  border-radius: var(--r-chip);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  font-size: 0.75rem;
  line-height: 1.35;
}
.chip time {
  flex: none;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.chip__subject {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
}
.day__more {
  padding-left: 9px;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.day__dots { display: none; }

/* --------------------------------------------------------------------------
   Day panel
   -------------------------------------------------------------------------- */

.day-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.day-panel:focus { outline: none; }

.day-panel__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.day-title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.day-count {
  min-height: 1.4em;
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.lessons { margin: 0; padding: 0; list-style: none; }

.lesson {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 2px 14px;
  padding: 16px 18px 12px;
}
.lesson + .lesson { border-top: 1px solid var(--line); }
.lesson::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  height: 40px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--c);
}

.lesson__time {
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.lesson__start { font-weight: 600; }
.lesson__end { font-size: 0.8125rem; color: var(--ink-3); }

.lesson__subject {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.lesson__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.lesson__meta svg { width: 15px; height: 15px; color: var(--ink-3); }

.lesson__notes {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.875rem;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lesson__actions {
  grid-column: 2;
  display: flex;
  gap: 4px;
  margin: 8px 0 0 -10px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px 44px;
  text-align: center;
  color: var(--ink-2);
}
.empty svg { width: 64px; height: 64px; stroke-width: 1.5; color: var(--line-strong); }
.empty__hint { font-size: 0.875rem; color: var(--ink-3); }

.day-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 18px;
  color: var(--ink-3);
}

.skeleton-line {
  height: 14px;
  margin: 18px;
  border-radius: 6px;
  background: var(--surface-2);
}
.skeleton-line:nth-child(2) { width: 70%; }
.skeleton-line:nth-child(3) { width: 45%; }

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
}
.dialog--small { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(16, 22, 36, 0.45); }
.dialog[open] { animation: dialog-in 0.18s ease-out; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.dialog__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 22px;
}
.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px -8px 0 0;
}
.dialog h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.dialog__actions .btn { min-width: 96px; }

.confirm-text { color: var(--ink-2); }
.confirm-summary {
  margin-top: -6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.875rem;
}

/* Form fields */
.row { display: grid; gap: 12px; }
.row--when { grid-template-columns: 1.4fr 1fr 1fr; }
.row--two { grid-template-columns: 1fr 1fr; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.opt { margin-left: 4px; font-weight: 400; color: var(--ink-3); }

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 1rem; /* 16px prevents iOS zoom */
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field--invalid input,
.field--invalid textarea { border-color: var(--danger); }
.field--invalid input:focus,
.field--invalid textarea:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.field__error { font-size: 0.8125rem; color: var(--danger); }
.field__error:empty { display: none; }

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: var(--r-control);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: var(--shadow-toast);
  animation: toast-in 0.2s ease-out;
}
.toast--out { opacity: 0; transition: opacity 0.25s; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 0 20px 20px; }
  .topbar { padding: 18px 20px 12px; }
  .week { min-height: 100px; }
  .chip time { display: none; }
}

/* --------------------------------------------------------------------------
   Mobile: compact month with dots, agenda for the selected day below
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  body { font-size: 15px; }

  .topbar { flex-wrap: wrap; padding: 14px 14px 10px; }
  .topbar__title { order: 1; }
  .topbar__add { order: 2; min-height: 40px; padding: 0 14px; }
  .topbar__nav { order: 3; width: 100%; justify-content: space-between; }
  .topbar__nav #today-btn { flex: 1; margin: 0 6px; }

  .layout { grid-template-columns: 1fr; gap: 12px; padding: 0 10px 24px; }

  .calendar { min-height: 0; }

  .weekdays span { padding: 8px 0; text-align: center; font-size: 0.75rem; }

  .week { min-height: 0; }
  .cell { border-left: 0; }
  .cell--weekend { background: transparent; }

  .day {
    align-items: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 2px 7px;
    border-radius: 10px;
  }
  .cell--selected .day { box-shadow: inset 0 0 0 2px var(--primary); }
  .day__num { align-self: center; font-size: 0.9375rem; }
  .day__list { display: none; }

  .day__dots {
    display: flex;
    gap: 3px;
    justify-content: center;
    height: 6px;
  }
  .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

  .day-panel { position: static; max-height: none; overflow: visible; }
  .day-panel__head { position: static; padding: 16px 16px 12px; }
  .lesson { padding: 14px 16px 10px; }

  /* Dialog becomes a bottom sheet */
  .dialog,
  .dialog--small {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }
  .dialog__inner { padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0)); }
  .dialog[open] { animation-name: sheet-in; }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

  .row--when { grid-template-columns: 1fr 1fr; }
  .row--when .field--date { grid-column: 1 / -1; }
  .row--two { grid-template-columns: 1fr; }

  .dialog__actions .btn { flex: 1; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .progress span { width: 100%; animation: none; opacity: 0.6; }
  .spinner { animation: none; border-right-color: currentColor; opacity: 0.6; }
}

/* Visually hidden, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Holidays and recurring classes
   ========================================================================== */

:root {
  --hatch: color-mix(in srgb, var(--ink-3) 16%, transparent);
  --hatch-strong: color-mix(in srgb, var(--ink-3) 24%, transparent);
}

/* Closed days are crossed through with pencil hatching */
.cell--holiday .day {
  background-image: repeating-linear-gradient(135deg, var(--hatch) 0 1.5px, transparent 1.5px 8px);
}

.day__holiday {
  max-width: 100%;
  padding: 1px 6px;
  border-radius: var(--r-chip);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  align-self: flex-start;
}

.chip--off { opacity: 0.55; }
.chip--off .chip__subject { text-decoration: line-through; }
.cell--holiday .dot { opacity: 0.35; }

/* Day panel: closed banner */
.closed {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 18px 4px;
  padding: 12px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(135deg, var(--hatch-strong) 0 1.5px, transparent 1.5px 9px);
}
.closed__title { font-weight: 600; }
.closed__name,
.closed__dates { font-size: 0.875rem; color: var(--ink-2); }
.closed__actions { display: flex; gap: 2px; margin: -4px 0 0; }

.lesson--off .lesson__subject { text-decoration: line-through; color: var(--ink-3); }
.lesson--off .lesson__start { color: var(--ink-3); }
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-2);
  vertical-align: 2px;
  text-decoration: none;
}

.panel-foot {
  padding: 6px 12px 12px;
  border-top: 1px solid var(--line);
}
.panel-foot .btn--text { width: 100%; justify-content: flex-start; }

/* Class form: repeat */
.repeat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface-2);
}
.repeat__body { display: flex; flex-direction: column; gap: 12px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }

fieldset.field { margin: 0; padding: 0; border: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }

.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.wd { position: relative; }
.wd input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wd span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
.wd input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.wd input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.wd input:disabled + span { opacity: 0.6; }
.field--invalid .wd span { border-color: var(--danger); }

.repeat__preview { font-size: 0.875rem; color: var(--ink-2); }
.repeat__preview:empty { display: none; }

.series-info {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  font-size: 0.875rem;
  color: var(--ink);
}
.series-info svg { margin-top: 1px; color: var(--primary); }

/* Confirm: choices */
.choices { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  cursor: pointer;
}
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* Holidays list */
.dialog__intro { font-size: 0.9375rem; color: var(--ink-2); max-width: 60ch; }
.holiday-list { min-height: 64px; }
.hlist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.hitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.hitem__name { font-weight: 500; }
.hitem__dates { font-size: 0.875rem; color: var(--ink-3); }
.hitem__actions { display: flex; flex: none; gap: 2px; }
.hitem--past .hitem__name { color: var(--ink-3); }
.hlist__heading { margin: 18px 0 6px; font-size: 0.875rem; font-weight: 500; color: var(--ink-3); }
.holiday-list .empty { padding: 20px 8px; }
.holiday-list .day-status { padding: 16px 0; }

.row--two-fixed { grid-template-columns: 1fr 1fr; }

@media (max-width: 1100px) {
  .topbar__holidays svg { display: none; }
}

@media (max-width: 760px) {
  .day__holiday { display: none; }
  .topbar__holidays { padding: 0 12px; margin-left: 6px; }
  .closed { margin: 12px 16px 4px; }
  .weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .wd span { width: 100%; min-width: 0; padding: 0; font-size: 0.8125rem; }
  .hitem { align-items: flex-start; }
}
