:root {
  color-scheme: light;
  --milk: #eeeee7;
  --milk-light: #fafaf5;
  --milk-deep: #dfdfd6;
  --panel: rgba(249, 249, 244, 0.78);
  --ink: #213633;
  --ink-soft: #445651;
  --muted: #78817c;
  --line: rgba(33, 54, 51, 0.13);
  --line-strong: rgba(33, 54, 51, 0.25);
  --project-blue: #bfd2e2;
}

* { box-sizing: border-box; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html, body { width: 100%; min-height: 100%; }
html { background: var(--milk); }
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 252, 0.96), transparent 38%),
    linear-gradient(145deg, var(--milk-light), var(--milk) 60%, var(--milk-deep));
}
button { color: inherit; font: inherit; touch-action: manipulation; }
button, input, select, textarea { font-family: inherit; }

.app-frame { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
.render-view, .settings-view {
  position: absolute;
  inset: 0;
  min-width: 0;
  transition: transform 220ms ease, opacity 180ms ease;
}
.render-view { z-index: 2; opacity: 1; transform: translateY(0); }
.settings-view { z-index: 1; opacity: 0; transform: translateY(7%); pointer-events: none; }
.workspace-mode-settings .render-view { opacity: 0; transform: translateY(-7%); pointer-events: none; }
.workspace-mode-settings .settings-view { z-index: 3; opacity: 1; transform: translateY(0); pointer-events: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  min-height: 82px;
  padding: 18px 18px 10px 20px;
}
.brand-plate, .brand-mark, .topbar-actions { display: flex; align-items: center; }
.brand-plate { align-self: stretch; gap: 14px; height: 54px; padding: 0 12px; }
.brand-mark { gap: 12px; min-width: 0; }
.topbar-actions { flex: 0 0 auto; gap: 3px; padding-right: 8px; }
.brand-home-link { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; }
.brand-bird {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(20%) sepia(18%) saturate(673%) hue-rotate(122deg) brightness(92%) contrast(90%);
  opacity: .94;
}
.brand-name { font-size: clamp(1.32rem, 2.05vw, 1.82rem); font-weight: 700; line-height: 1; }
.header-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.header-icon-button:hover, .header-icon-button:focus-visible, .header-icon-button[aria-expanded="true"] {
  outline: none;
  border-color: var(--line);
  background: rgba(255,255,252,.56);
}
.menu-lines, .menu-lines::before, .menu-lines::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}
.menu-lines { position: relative; }
.menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
.menu-lines::before { top: -7px; }
.menu-lines::after { top: 7px; }

.render-stage {
  height: calc(100dvh - 82px);
  overflow: auto;
  padding: clamp(12px, 2.3vw, 26px) clamp(14px, 3vw, 34px) 82px;
  scrollbar-width: thin;
}
.calendar-shell {
  width: min(1440px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(18px, 2.5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(33,54,51,.07), inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(14px);
}
.calendar-shell.is-timeline-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.calendar-shell.is-timeline-view .calendar-heading { flex: 0 0 auto; }
.calendar-heading, .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.calendar-heading h1, .panel-head h2 { margin: 4px 0 0; font-size: 1.18rem; line-height: 1.2; }
.label { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.year-label { color: var(--ink-soft); font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
.calendar-heading-actions { display: flex; align-items: center; gap: 14px; }
.topbar-icon-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
}
.export-control { position: relative; }
.topbar-action-icon {
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}
.topbar-export-icon {
  mask-image: url("https://api.iconify.design/uil/export.svg");
  -webkit-mask-image: url("https://api.iconify.design/uil/export.svg");
}
.export-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: min(310px, calc(100vw - 28px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f7f1;
  box-shadow: 0 16px 38px rgba(33,54,51,.17);
}
.export-menu[hidden] { display: none; }
.export-menu button {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.export-menu button:hover,
.export-menu button:focus-visible {
  outline: none;
  background: rgba(33,54,51,.06);
}
.export-menu button > span:last-child { display: grid; gap: 2px; }
.export-menu strong { font-size: .8rem; }
.export-menu small { color: var(--muted); font-size: .68rem; }
.file-format-badge {
  display: grid;
  place-items: center;
  min-height: 29px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,252,.72);
  color: var(--ink-soft);
  font-size: .59rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.lesson-signals-toggle { color: var(--muted); }
.lesson-signals-toggle:hover,
.lesson-signals-toggle:focus-visible {
  color: var(--ink);
}
.lesson-signals-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  font-size: 1.05rem;
  line-height: 1;
}
.lesson-signals-toggle.is-active {
  border-color: rgba(74,110,82,.42);
  background: rgba(198,215,189,.58);
  color: var(--ink);
}
.lesson-signals-toggle.has-audio-error { border-color: rgba(163,59,50,.5); color: #8f332b; }
.calendar-heading-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.calendar-view-switcher {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.42);
}
.calendar-view-switcher button {
  min-height: 31px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
}
.calendar-view-switcher button:hover, .calendar-view-switcher button:focus-visible { outline: none; color: var(--ink); }
.calendar-view-switcher button[aria-pressed="true"] { background: rgba(255,255,252,.9); color: var(--ink); font-weight: 700; box-shadow: 0 1px 4px rgba(33,54,51,.08); }
.calendar-date-navigation {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.42);
}
.calendar-date-navigation[hidden] { display: none; }
.calendar-date-navigation button {
  min-width: 31px;
  min-height: 31px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .72rem;
  cursor: pointer;
}
.calendar-date-navigation button:hover,
.calendar-date-navigation button:focus-visible {
  outline: none;
  background: rgba(255,255,252,.9);
  color: var(--ink);
}
.year-calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: clamp(10px, 1.5vw, 18px);
  margin-top: 22px;
}
.month {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,252,.44);
}
.month h2 { margin: 0 0 11px; font-size: .93rem; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.weekday { padding-bottom: 5px; color: var(--muted); font-size: .64rem; font-weight: 700; text-transform: uppercase; }
.day {
  display: grid;
  place-items: center;
  min-height: 25px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: .73rem;
  font-variant-numeric: tabular-nums;
}
.day.is-weekend {
  background: var(--chalk-green, #c6d7bd);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(87,116,91,.18);
}
.day.is-holiday {
  background: var(--chalk-green, #c6d7bd);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(87,116,91,.18);
}
.day.is-public-holiday {
  background: #aebfa5;
  box-shadow: inset 0 0 0 1px rgba(70, 100, 75, .26);
}
.day.is-project {
  background: var(--project-blue);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(70,105,132,.2);
}
.day.is-holiday.is-project {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--chalk-green, #c6d7bd) 0%,
    var(--chalk-green, #c6d7bd) 50%,
    var(--project-blue) 50%,
    var(--project-blue) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(70, 96, 103, .2);
}
.day.is-holiday.is-project::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 160%;
  background: rgba(70, 96, 103, .2);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg);
}
.day.has-calendar-entry {
  background: var(--day-color-a);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(70, 96, 103, .2);
}
.day.has-calendar-entry.has-overlap {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--day-color-a) 0%,
    var(--day-color-a) 50%,
    var(--day-color-b) 50%,
    var(--day-color-b) 100%
  );
}
.day.has-calendar-entry.has-overlap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 160%;
  background: rgba(70, 96, 103, .2);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg);
}
.day.is-empty { visibility: hidden; }

.workspace-strip {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 1px solid var(--line);
  background: rgba(239,239,232,.94);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(16px);
}
.workspace-strip span { font-size: .78rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.workspace-strip:hover, .workspace-strip:focus-visible {
  outline: none;
  color: var(--ink);
  background: rgba(248,248,242,.96);
}
.workspace-strip-top {
  top: 0;
  bottom: auto;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: 16px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}
.settings-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 100dvh;
  overflow: hidden;
  padding: 72px 22px 22px;
}
.settings-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(33,54,51,.07), inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(14px);
}
.browser-actions-menu-shell { position: relative; }
.browser-actions-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.browser-actions-button:hover,
.browser-actions-button:focus-visible,
.browser-actions-button[aria-expanded="true"] {
  outline: none;
  border-color: var(--line);
  background: rgba(255,255,252,.58);
}
.browser-actions-dots,
.browser-actions-dots::before,
.browser-actions-dots::after {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.browser-actions-dots { position: relative; }
.browser-actions-dots::before,
.browser-actions-dots::after { content: ""; position: absolute; left: 0; }
.browser-actions-dots::before { top: -7px; }
.browser-actions-dots::after { top: 7px; }
.browser-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  display: grid;
  min-width: 170px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247,247,241,.98);
  box-shadow: 0 16px 36px rgba(33,54,51,.16);
}
.browser-actions-menu[hidden] { display: none; }
.browser-actions-menu button {
  min-height: 34px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}
.browser-actions-menu button:hover:not(:disabled) { background: rgba(33,54,51,.06); }
.browser-actions-menu button:disabled { color: var(--muted); cursor: default; opacity: .58; }
.project-browser-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  margin-top: 18px;
  padding-right: 3px;
  overflow: auto;
  scrollbar-gutter: stable;
}
.project-browser-empty { margin: 0; padding: 18px 4px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.project-card {
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 11px;
}
.project-card:hover { background: rgba(33,54,51,.035); }
.project-card.is-active { border-color: var(--line); background: rgba(255,255,252,.48); }
.project-row {
  display: grid;
  grid-template-columns: 25px 25px minmax(0,1fr) 22px;
  gap: 7px;
  align-items: center;
  min-height: 50px;
  padding: 7px 10px;
}
.project-display-checkbox {
  appearance: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(255,255,252,.58);
  cursor: pointer;
}
.project-display-checkbox::before {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid white;
  border-left: 2px solid white;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg);
}
.project-display-checkbox:checked {
  border-color: var(--ink-soft);
  background: var(--ink-soft);
}
.project-display-checkbox:checked::before { opacity: 1; }
.project-display-checkbox:focus-visible { outline: 2px solid var(--line-strong); outline-offset: 2px; }
.tree-toggle, .folder-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
}
.tree-toggle {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tree-toggle:hover, .tree-toggle:focus-visible { outline: none; background: rgba(255,255,252,.62); color: var(--ink); }
.folder-icon {
  position: relative;
  width: 22px;
  height: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(198,215,189,.4);
}
.folder-icon::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -1px;
  width: 10px;
  height: 5px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: rgba(198,215,189,.4);
}
.project-main { min-width: 0; padding: 3px 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.project-main:focus-visible { outline: 2px solid var(--line-strong); outline-offset: 3px; border-radius: 7px; }
.project-main strong, .project-main span { display: block; }
.project-main strong { overflow: hidden; font-size: .9rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.project-main span { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.layer-list { display: grid; gap: 2px; padding: 0 10px 9px 66px; }
.layer-row {
  position: relative;
  width: 100%;
  min-height: 31px;
  padding: 7px 8px 7px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: .8rem;
  text-align: left;
  cursor: pointer;
}
.layer-row::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 9px;
  height: 1px;
  background: var(--line-strong);
}
.layer-row:hover, .layer-row:focus-visible { outline: none; background: rgba(255,255,252,.55); color: var(--ink); }
.layer-row.is-active { border-color: var(--line); background: rgba(255,255,252,.72); color: var(--ink); font-weight: 700; }
.schedule-tree-row {
  position: relative;
  width: calc(100% - 16px);
  min-height: 29px;
  margin-left: 16px;
  padding: 6px 8px 6px 23px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  text-align: left;
  cursor: pointer;
}
.schedule-tree-row::before { content: "▦"; position: absolute; left: 6px; color: var(--ink-soft); }
.schedule-tree-row:hover, .schedule-tree-row:focus-visible { outline: none; background: rgba(255,255,252,.55); color: var(--ink); }
.schedule-tree-row.is-active { border-color: var(--line); background: rgba(255,255,252,.72); color: var(--ink); font-weight: 700; }
.project-detail {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 18px;
  padding-right: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.empty-state { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.project-summary { display: grid; gap: 16px; }
.project-summary h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.project-summary p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.project-period-section {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.project-period-intro { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.project-school-year-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.project-school-year-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .7rem;
}
.project-school-year-fields input { padding-right: 9px; }
.project-period-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(33,54,51,.035);
}
.project-period-tabs button {
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
}
.project-period-tabs button:hover,
.project-period-tabs button:focus-visible { outline: none; color: var(--ink); }
.project-period-tabs button[aria-selected="true"] {
  background: rgba(255,255,252,.82);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(33,54,51,.08);
  font-weight: 700;
}
.project-period-panel {
  min-height: 60px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.3);
}
.project-period-panel[hidden] { display: none; }
.project-period-panel p { color: var(--muted); font-size: .76rem; line-height: 1.45; }
.half-year-period {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.4);
}
.half-year-period h4 { margin: 0; font-size: .8rem; }
.half-year-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.half-year-range label,
.grading-stop-row > label,
.grading-stop-grades label {
  display: grid;
  grid-template-rows: minmax(14px, auto) 40px;
  gap: 5px;
  align-content: end;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.2;
}
.half-year-range input,
.grading-stop-row input,
.grading-stop-row select {
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.72);
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
  outline: none;
}
.half-year-range input:focus,
.grading-stop-row input:focus,
.grading-stop-row select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(33,54,51,.075);
}
.grading-stop-heading {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: .76rem;
}
.grading-stop-list { display: grid; gap: 7px; }
.grading-stop-row {
  display: grid;
  grid-template-columns: minmax(140px,1fr) minmax(180px,1.2fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.5);
}
.grading-stop-grades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: end;
}
.grading-stop-delete {
  display: inline-flex;
  grid-column: auto;
  align-self: end;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 62px;
  padding: 7px 9px;
  border: 1px solid transparent;
}
.grading-stop-add { justify-self: start; }
.ab-week-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: min(320px, 100%);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(33,54,51,.035);
}
.ab-week-mode button {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .74rem;
  cursor: pointer;
}
.ab-week-mode button[aria-pressed="true"] {
  background: rgba(255,255,252,.86);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(33,54,51,.09);
  font-weight: 700;
}
.project-period-panel .ab-week-mode-hint {
  margin: 8px 0 10px;
  font-size: .7rem;
}
.ab-week-list {
  display: grid;
  gap: 5px;
  max-height: 360px;
  padding-right: 3px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.ab-week-row {
  display: grid;
  grid-template-columns: 58px minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.5);
}
.ab-week-row strong {
  color: var(--ink-soft);
  font-size: .74rem;
}
.ab-week-row > span {
  color: var(--muted);
  font-size: .69rem;
}
.ab-week-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 74px;
  min-height: 32px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(33,54,51,.045);
  color: var(--muted);
  cursor: pointer;
}
.ab-week-toggle span {
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
}
.ab-week-toggle span.is-active {
  background: var(--ink-soft);
  color: #fff;
  box-shadow: 0 1px 2px rgba(33,54,51,.16);
}
.project-period-panel .ab-week-empty { margin: 0; }
.layer-summary-grid { display: grid; gap: 8px; }
.layer-summary-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,252,.38); }
.layer-summary-card strong { display: block; font-size: .87rem; }
.layer-summary-card span { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.property-sheet { display: grid; gap: 19px; }
.property-sheet-head { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.property-sheet-head h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.property-sheet-head p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.property-section { display: grid; gap: 13px; }
.property-section h3 { margin: 0; font-size: .88rem; }
.property-list { display: grid; gap: 8px; }
.property-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(130px,.72fr) minmax(180px,1.28fr);
  gap: 14px;
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,252,.38);
  color: var(--ink-soft);
  font-size: .8rem;
}
.property-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 36px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.7);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.property-field select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(33,54,51,.075);
}
.property-field::after,
.schedule-validity label:has(select)::after,
.dialog-field:has(select)::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 17px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
  pointer-events: none;
}
.property-field::after { top: 50%; right: 24px; bottom: auto; transform: translateY(-70%) rotate(45deg); }
.property-row {
  display: grid;
  grid-template-columns: minmax(130px,.72fr) minmax(180px,1.28fr);
  gap: 14px;
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,252,.38);
}
.property-row > span { color: var(--ink-soft); font-size: .8rem; }
.property-select-shell { position: relative; display: block; }
.property-row select,
.property-row input {
  width: 100%;
  min-height: 40px;
  padding: 8px 36px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.7);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  outline: none;
}
.property-row select { appearance: none; cursor: pointer; }
.property-row select:focus,
.property-row input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(33,54,51,.075); }
.property-select-caret {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.school-year-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.property-status { min-height: 20px; margin: -4px 0 0; color: var(--muted); font-size: .76rem; }
.property-status.is-success { color: #486a4f; font-weight: 700; }
.property-status.is-error { color: #984d46; font-weight: 700; }
.secondary-button.is-save-success {
  border-color: rgba(72,106,79,.34);
  background: rgba(198,215,189,.55);
}
.secondary-button.is-save-error {
  border-color: rgba(152,77,70,.3);
  background: rgba(223,185,189,.38);
}
.holiday-load-button { justify-self: start; }
.holiday-scope-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.holiday-scope-actions .lesson-delete-button { width: auto; }
.holiday-empty-scope-tab { min-height: 38px; }
.holiday-add-scope { justify-self: start; }
.holiday-scope-tabs { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.holiday-scope-picker { margin-top: 8px; }
.holiday-result { min-height: 48px; }
.holiday-entry-list { display: grid; gap: 5px; }
.holiday-entry {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.36);
  font-size: .78rem;
  line-height: 1.35;
}
.holiday-entry strong { font-size: .8rem; }
.holiday-entry span { color: var(--muted); white-space: nowrap; }
.school-movable-day-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; align-items: end; }
.school-movable-day-row input {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.7);
  color: var(--ink);
  font: inherit;
}
.holiday-source { display: grid; gap: 5px; padding-top: 4px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.holiday-source a { color: var(--ink-soft); text-underline-offset: 3px; }
.higher-education-periods { display: grid; gap: 9px; }
.higher-education-period { margin-top: 0; }
.project-period-panel .higher-education-boundary,
.higher-education-boundary {
  margin: -3px 0 1px;
  color: var(--muted);
  font-size: .72rem;
}
.higher-education-holiday-title {
  color: var(--ink-soft);
  font-size: .76rem;
}
.trip-form { display: grid; gap: 10px; }
.trip-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trip-date-fields input { padding-right: 10px; }
.trip-add-button { justify-self: start; }
.class-trip-dialog-grid { display: grid; gap: 14px; }
.class-trip-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.event-time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.event-time-fields[hidden] { display: none; }
.trip-apply-button { justify-self: start; margin-top: 4px; }
.trip-entry-list { display: grid; gap: 7px; padding-top: 4px; }
.trip-entry {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 10px 11px 12px;
  border: 1px solid rgba(70,105,132,.22);
  border-radius: 11px;
  background: var(--project-blue);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34);
}
.trip-entry strong, .trip-entry span { display: block; }
.trip-entry strong { font-size: .86rem; }
.trip-entry span { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.trip-delete-button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  cursor: pointer;
}
.trip-delete-button:hover, .trip-delete-button:focus-visible {
  outline: none;
  border-color: var(--line);
  background: rgba(255,255,252,.68);
  color: var(--ink);
}
.schedule-add-button { justify-self: start; }
.schedule-overview-list { display: grid; gap: 8px; }
.schedule-overview-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(70,105,132,.22);
  border-radius: 11px;
  background: var(--schedule-card-color, var(--project-blue));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34);
}
.schedule-overview-card:hover,
.schedule-overview-card:focus-visible {
  outline: 2px solid rgba(33,54,51,.32);
  outline-offset: -2px;
}
.schedule-overview-card strong { font-size: .86rem; }
.schedule-overview-card span,
.schedule-overview-card small { color: var(--ink-soft); font-size: .76rem; }
.appointment-add-group,
.appointment-add-button { justify-self: start; }
.appointment-group-list { display: grid; gap: 12px; }
.appointment-group-card {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(112, 96, 139, .2);
  border-radius: 12px;
  background: color-mix(in srgb, var(--appointment-group-color, #c9c1dd) 55%, white);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.36);
}
.appointment-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.appointment-group-head h3 { margin: 0; font-size: .9rem; }
.appointment-entry-list { display: grid; gap: 7px; }
.appointment-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 9px 10px 11px;
  border: 1px solid rgba(112, 96, 139, .18);
  border-radius: 10px;
  background: var(--appointment-group-color, #c9c1dd);
}
.appointment-entry strong,
.appointment-entry span { display: block; }
.appointment-entry strong { font-size: .84rem; }
.appointment-entry span { margin-top: 4px; color: var(--ink-soft); font-size: .75rem; }
.sickness-entry-list { display: grid; gap: 8px; }
.sickness-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 10px 11px 12px;
  border: 1px solid rgba(104, 82, 78, .2);
  border-radius: 11px;
  background: #d8ccca;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
}
.sickness-entry strong,
.sickness-entry span { display: block; }
.sickness-entry strong { font-size: .86rem; }
.sickness-entry span { margin-top: 4px; color: var(--ink-soft); font-size: .76rem; }
.class-catalog-subject-list,
.class-catalog-grade-list { display: grid; gap: 10px; }
.class-catalog-subject {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(70,105,132,.22);
  border-radius: 12px;
  background: color-mix(in srgb, var(--project-blue) 58%, white);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.36);
}
.class-catalog-grade {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.48);
}
.class-catalog-grade-head,
.class-catalog-class {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.class-catalog-grade-head strong { font-size: .82rem; }
.class-catalog-class-list { display: grid; gap: 5px; }
.class-catalog-class {
  min-height: 34px;
  padding: 4px 5px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.58);
  font-size: .8rem;
}
.class-catalog-add-class { justify-self: start; }
.class-project-class-list { display: grid; gap: 13px; }
.class-project-class-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(70,105,132,.22);
  border-radius: 13px;
  background: color-mix(in srgb, var(--project-blue) 42%, white);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
}
.class-project-class-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.class-project-class-head h3 { margin: 0; font-size: .94rem; }
.class-project-class-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
}
.class-project-entry-list { display: grid; gap: 9px; }
.class-project-summary {
  display: grid;
  grid-template-columns: minmax(120px,1fr) minmax(160px,auto) minmax(90px,auto);
  align-items: center;
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.class-project-summary strong { font-size: .8rem; }
.class-project-summary:hover,
.class-project-summary:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  background: rgba(255,255,252,.62);
}
.class-project-summary strong,
.class-project-summary span { min-width: 0; margin: 0; }
.class-project-summary span:last-child { text-align: right; }
.class-project-empty { margin: 0; color: var(--muted); font-size: .76rem; }
.class-project-dialog { width: min(590px, calc(100vw - 28px)); }
.class-project-dialog-delete { width: auto; margin-right: auto; }
.class-project-dialog-duration {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.class-project-dialog-duration legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .8rem;
}
.class-project-class-picker {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,252,.38);
}
.class-project-class-picker legend { padding: 0 5px; color: var(--ink-soft); font-size: .8rem; }
.class-project-class-picker-list { display: grid; gap: 7px; }
.class-project-class-picker-row { position: relative; display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: 8px; align-items: center; }
.class-project-class-picker-row::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 92px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.class-project-class-picker-row select {
  min-height: 40px;
  padding: 8px 34px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.72);
  color: var(--ink);
  font: inherit;
  appearance: none;
}
.class-project-overview-row { grid-template-columns: minmax(120px,1fr) minmax(130px,1fr) auto auto; }
@media (max-width: 720px) {
  .class-project-overview-row { grid-template-columns: 1fr auto; }
  .class-project-overview-row strong,
  .class-project-overview-row span:nth-child(2) { grid-column: 1 / -1; }
  .class-project-class-picker-row { grid-template-columns: 1fr; }
  .class-project-class-picker-row::after { top: 20px; right: 15px; }
}
@media (max-width: 720px) {
  .class-project-class-head { align-items: flex-start; flex-direction: column; }
  .class-project-summary { grid-template-columns: minmax(95px,1fr) minmax(120px,auto) auto; }
}
.schedule-editor { display: grid; gap: 18px; min-width: 0; min-height: 0; }
.schedule-setup-notice {
  margin: 0 0 5px;
  padding: 9px 11px;
  border: 1px solid rgba(87,116,91,.18);
  border-radius: 9px;
  background: rgba(198,215,189,.28);
  color: var(--ink-soft);
  font-size: .76rem;
  line-height: 1.45;
}
.schedule-setup-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.schedule-setup-link:hover,
.schedule-setup-link:focus-visible {
  outline: none;
  text-decoration-thickness: 2px;
}
.schedule-title-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.schedule-menu-shell { position: relative; }
.schedule-menu-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.schedule-menu-button span,
.schedule-menu-button span::before,
.schedule-menu-button span::after {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.schedule-menu-button span { position: relative; }
.schedule-menu-button span::before, .schedule-menu-button span::after { content: ""; position: absolute; left: 0; }
.schedule-menu-button span::before { top: -7px; }
.schedule-menu-button span::after { top: 7px; }
.schedule-menu-button:hover, .schedule-menu-button:focus-visible, .schedule-menu-button[aria-expanded="true"] {
  outline: none;
  border-color: var(--line);
  background: rgba(255,255,252,.68);
}
.schedule-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 8;
  min-width: 190px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f7f1;
  box-shadow: 0 14px 34px rgba(33,54,51,.16);
}
.schedule-menu[hidden] { display: none; }
.schedule-menu button { position: relative; overflow: hidden; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; font-size: .82rem; text-align: left; cursor: pointer; }
.schedule-menu button:hover, .schedule-menu button:focus-visible { outline: none; background: rgba(33,54,51,.06); }
.schedule-menu-delete { --hold-progress: 0%; touch-action: none; }
.schedule-menu button.schedule-menu-delete.is-hold-active,
.schedule-menu button.schedule-menu-delete.is-hold-ready {
  background:
    linear-gradient(
      90deg,
      rgba(196,105,95,.66) 0%,
      rgba(196,105,95,.66) var(--hold-progress),
      transparent var(--hold-progress),
      transparent 100%
    ),
    rgba(33,54,51,.06);
}
.schedule-validity { display: grid; grid-template-columns: minmax(220px, 360px); gap: 8px; }
.schedule-validity label { position: relative; display: grid; gap: 6px; color: var(--ink-soft); font-size: .76rem; }
.schedule-validity select {
  width: 100%;
  min-height: 39px;
  padding: 7px 36px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.68);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.schedule-validity select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(33,54,51,.075); }
.schedule-week {
  display: grid;
  grid-template-columns: 82px repeat(5, minmax(92px, 1fr));
  max-height: calc(100dvh - 300px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,252,.28);
}
.render-schedule-week { max-height: none; margin-top: 22px; }
.combined-day-view {
  display: grid;
  grid-template-columns: 82px minmax(220px, 1fr);
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,252,.28);
}
.combined-schedule-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  color: var(--muted);
  font-size: .86rem;
  text-align: center;
}
.combined-timeline {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 22px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,252,.28);
}
.timeline-header,
.timeline-body {
  display: grid;
  grid-template-columns: var(--timeline-columns);
  min-width: 760px;
}
.timeline-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 6;
  border-bottom: 1px solid var(--line);
  background: #f2f2eb;
}
.timeline-corner,
.timeline-day-head {
  min-height: 40px;
  padding: 12px 7px 9px;
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
}
.timeline-corner { color: var(--muted); }
.timeline-day-head {
  display: grid;
  align-content: center;
  gap: 3px;
  border-left: 1px solid var(--line);
}
.timeline-day-date { display: block; }
.timeline-day-holiday {
  display: block;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.timeline-day-holiday.is-public-holiday { color: #506653; }
.timeline-axis,
.timeline-day-column {
  position: relative;
  height: 100%;
}
.timeline-body {
  flex: 0 0 var(--timeline-body-height, 840px);
  height: var(--timeline-body-height, 840px);
  min-height: 0;
}
.timeline-axis { background: #f2f2eb; }
.timeline-hour-mark {
  position: absolute;
  right: 7px;
  color: var(--ink-soft);
  font-size: .68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
}
.timeline-current-time {
  position: absolute;
  right: 5px;
  left: 5px;
  z-index: 4;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(255,255,252,.72);
  pointer-events: none;
  transform: translateY(-50%);
}
.timeline-day-column {
  border-left: 1px solid var(--line);
}
.timeline-day-column.is-holiday {
  background: rgba(105, 112, 109, .12);
}
.timeline-day-column.is-public-holiday { background: rgba(94, 125, 91, .2); }
.holiday-entry.is-public-holiday { background: rgba(174,191,165,.42); }
.timeline-hour-guide {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
.timeline-lesson-card {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  min-height: 0;
  text-align: left;
  cursor: pointer;
}
.timeline-lesson-card:has(.live-phase:not([hidden])) {
  padding-bottom: var(--live-phase-reserved-height, 3.4rem);
}
.timeline-lesson-card:hover, .timeline-lesson-card:focus-visible { outline: 2px solid rgba(33,54,51,.42); outline-offset: -2px; }
.lesson-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.lesson-card-heading > span { flex: 0 0 auto; font-size: .78rem; font-weight: 700; }
.timeline-lesson-card strong { flex: 0 0 auto; }
.timeline-lesson-card small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-phase {
  position: absolute;
  right: 6px;
  bottom: 5px;
  left: 6px;
  z-index: 3;
  display: grid;
  gap: 3px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(255,255,252,.76);
  pointer-events: none;
  contain: layout paint;
}
.live-phase[hidden] { display: none; }
.live-phase-copy {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  font-size: .66rem;
  font-variant-numeric: tabular-nums;
}
.live-phase-remaining { flex: 0 0 auto; color: var(--ink-soft); }
.live-phase-current { color: var(--ink); font-weight: 700; }
.live-phase-progress {
  display: flex;
  gap: 2px;
  align-items: end;
  overflow: hidden;
  min-width: 0;
}
.live-phase-progress.is-dense { gap: 1px; }
.live-phase-segment {
  display: grid;
  gap: 2px;
  flex-basis: 0;
  overflow: visible;
  min-width: 2px;
}
.live-phase-segment-label {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: .66rem;
  line-height: 1.08;
  text-align: center;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--phase-label-lines, 1);
}
.live-phase-segment.is-label-hidden .live-phase-segment-label { visibility: hidden; }
.live-phase-segment-track {
  position: relative;
  display: block;
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(33,54,51,.16);
}
.live-phase-segment-track::before {
  display: block;
  width: var(--segment-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--ink-soft);
  content: "";
}
.live-phase-segment.is-current .live-phase-segment-label { color: var(--ink); font-weight: 700; }
.live-phase-segment.is-current .live-phase-segment-track { box-shadow: inset 0 0 0 1px rgba(33,54,51,.32); }
@media (prefers-contrast: more) {
  .live-phase { background: rgba(255,255,252,.94); }
  .live-phase-segment-track { background: rgba(33,54,51,.3); }
  .live-phase-segment-track::before { background: var(--ink); }
  .live-phase-segment.is-current .live-phase-segment-track { box-shadow: inset 0 0 0 2px var(--ink); }
}
.timeline-project-card { border-style: solid; }
.timeline-project-card strong { font-size: .84rem; white-space: normal; }
.timeline-appointment-card { border-style: solid; }
.timeline-appointment-card strong { font-size: .84rem; white-space: normal; }
.render-schedule-cell { cursor: default; }
.render-schedule-cell:hover { background: transparent; }
.schedule-week-corner, .schedule-day-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 38px;
  padding: 12px 6px 8px;
  border-bottom: 1px solid var(--line);
  background: #f2f2eb;
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
}
.schedule-week-corner { left: 0; z-index: 3; color: var(--muted); }
.schedule-time {
  position: sticky;
  left: 0;
  z-index: 1;
  min-height: 62px;
  padding: 7px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f2f2eb;
  color: var(--muted);
  font-size: .67rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.schedule-time strong, .schedule-time span { display: block; }
.schedule-time strong { color: var(--ink-soft); font-size: .67rem; }
.schedule-time span { margin-top: 3px; font-size: .61rem; }
.schedule-time.is-break { min-height: 38px; background: #e9e9e2; }
.schedule-cell {
  min-height: 62px;
  padding: 3px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.schedule-cell:hover, .schedule-cell:focus-visible { outline: none; background: rgba(198,215,189,.2); }
.schedule-break-cell {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(33,54,51,.035);
  color: var(--muted);
  font-size: .65rem;
}
.lesson-card {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 2px;
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(70,105,132,.22);
  border-radius: 7px;
  background: var(--lesson-color, var(--project-blue));
  color: var(--ink);
}
.lesson-card.is-epochal { border-style: dashed; }
.lesson-card strong { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.lesson-card small { font-size: .72rem; line-height: 1.32; }
.lesson-card-room.is-missing { color: #a84f49; font-weight: 700; }
.schedule-week.schedule-editor-timeline {
  display: block;
  max-height: calc(100dvh - 300px);
  overflow: auto;
}
.schedule-editor-week-header,
.schedule-editor-week-body {
  display: grid;
  grid-template-columns: 82px repeat(var(--schedule-editor-days, 5), minmax(92px, 1fr));
  min-width: 680px;
}
.schedule-editor-week-header {
  position: sticky;
  z-index: 8;
  top: 0;
}
.schedule-editor-week-body {
  height: var(--schedule-editor-height);
  min-height: 420px;
}
.schedule-editor-axis,
.schedule-editor-day {
  position: relative;
  height: 100%;
}
.schedule-editor-axis { background: #f2f2eb; }
.schedule-editor-day { border-left: 1px solid var(--line); }
.schedule-editor-timeline .schedule-time,
.schedule-editor-timeline .schedule-cell,
.schedule-editor-timeline .schedule-break-cell {
  position: absolute;
  min-height: 0;
  margin: 0;
}
.schedule-editor-timeline .schedule-time {
  right: 0;
  left: 0;
  z-index: 2;
  overflow: hidden;
  border-right: 0;
}
.schedule-editor-timeline .schedule-time.is-break {
  display: grid;
  place-items: center;
  padding: 0 3px;
  line-height: 1;
}
.schedule-editor-timeline .schedule-time.is-break strong {
  font-size: .58rem;
  line-height: 1;
}
.schedule-editor-timeline .schedule-time.is-break span { display: none; }
.schedule-editor-timeline .schedule-cell,
.schedule-editor-timeline .schedule-break-cell {
  right: 0;
  left: 0;
  width: 100%;
  border-right: 0;
}
.schedule-editor-timeline .schedule-cell { z-index: 1; }
.schedule-editor-timeline .schedule-break-cell {
  z-index: 1;
  overflow: hidden;
  padding: 0 2px;
  line-height: 1;
}
.schedule-editor-lesson-card {
  position: absolute;
  z-index: 4;
  min-height: 0;
}
.lesson-dialog { width: min(560px, calc(100vw - 28px)); }
.lesson-dialog-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(33,54,51,.035);
}
.lesson-dialog-tabs button {
  flex: 1 1 0;
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.lesson-dialog-tabs button[aria-selected="true"] {
  background: rgba(255,255,252,.82);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(33,54,51,.08);
  font-weight: 700;
}
.lesson-dialog-tabs button[hidden],
.lesson-tab-panel[hidden] { display: none; }
.lesson-tab-panel { min-width: 0; }
.lesson-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lesson-dialog-wide { grid-column: 1 / -1; }
.lesson-teaching-form { align-items: start; }
.lesson-form-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: min(320px, 100%);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(33,54,51,.04);
}
.lesson-form-choice[hidden] { display: none; }
.lesson-form-choice button {
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .72rem;
  cursor: pointer;
}
.lesson-form-choice button[aria-pressed="true"] {
  background: var(--ink-soft);
  color: #fff;
  box-shadow: 0 1px 3px rgba(33,54,51,.16);
  font-weight: 700;
}
.lesson-day-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.lesson-day-field legend {
  margin-bottom: 7px;
  padding: 0;
  color: var(--muted);
  font-size: .8rem;
}
.lesson-day-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-day-buttons button {
  min-width: 42px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.55);
  color: var(--ink-soft);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}
.lesson-day-buttons button:hover,
.lesson-day-buttons button:focus-visible {
  outline: none;
  border-color: var(--line-strong);
}
.lesson-day-buttons button[aria-pressed="true"] {
  border-color: rgba(74,110,82,.42);
  background: rgba(198,215,189,.58);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.44);
}
.schedule-active-days .lesson-day-buttons button:is([data-schedule-day="6"], [data-schedule-day="7"])[aria-pressed="false"] {
  border-color: rgba(33,54,51,.1);
  background: rgba(33,54,51,.07);
  color: rgba(33,54,51,.45);
  box-shadow: none;
}
.schedule-active-days {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.schedule-active-days legend {
  margin-bottom: 7px;
  padding: 0;
  color: var(--ink-soft);
  font-size: .76rem;
}
.schedule-active-days .lesson-day-buttons button[aria-disabled="true"] {
  cursor: not-allowed;
}
.schedule-active-days-status {
  min-height: 1.1em;
  margin: 6px 0 0;
}
.lesson-color-field {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: .8rem;
}
.lesson-color-field legend { margin-bottom: 7px; padding: 0; }
.lesson-color-palette { display: flex; flex-wrap: wrap; gap: 10px; }
.lesson-color-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(33,54,51,.18);
  border-radius: 50%;
  background: var(--swatch-color);
  cursor: pointer;
}
.lesson-color-swatch:hover,
.lesson-color-swatch:focus-visible,
.lesson-color-swatch.is-active {
  outline: 2px solid rgba(33,54,51,.42);
  outline-offset: 2px;
}
.lesson-color-swatch.is-active { box-shadow: inset 0 0 0 3px rgba(255,255,252,.72); }
.lesson-statistics { display: grid; gap: 11px; }
.lesson-statistics-note {
  margin: 0;
  color: var(--muted);
  font-size: .71rem;
  line-height: 1.35;
  text-align: center;
}
.lesson-statistics-note span { padding: 0 4px; color: var(--line-strong); }
.lesson-stat-year-progress { display: grid; gap: 7px; padding: 15px 3px 5px; }
.lesson-stat-year-track {
  position: relative;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(33,54,51,.08);
  box-shadow: inset 0 1px 2px rgba(33,54,51,.08);
}
.lesson-stat-year-elapsed,
.lesson-stat-half-segment,
.lesson-stat-stop-range { position: absolute; top: 0; bottom: 0; }
.lesson-stat-year-elapsed { left: 0; z-index: 1; border-radius: 999px 0 0 999px; background: rgba(74,104,89,.58); }
.lesson-stat-half-segment { z-index: 2; border-right: 2px solid rgba(255,255,252,.9); border-left: 1px solid rgba(255,255,252,.55); }
.lesson-stat-stop-range { z-index: 3; background: rgba(177,75,68,.7); }
.lesson-stat-today-marker,
.lesson-stat-stop-marker { position: absolute; z-index: 5; top: -4px; bottom: -4px; width: 2px; transform: translateX(-1px); pointer-events: none; }
.lesson-stat-today-marker { background: var(--ink); }
.lesson-stat-today-marker::before {
  content: "Heute";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  color: var(--ink-soft);
  font-size: .59rem;
  font-weight: 700;
  transform: translateX(-50%);
}
.lesson-stat-today-marker.is-start-edge::before { left: 0; transform: none; }
.lesson-stat-today-marker.is-end-edge::before { right: 0; left: auto; transform: none; }
.lesson-stat-stop-marker { background: #93423d; }
.lesson-stat-year-labels { position: relative; height: 16px; color: var(--ink-soft); font-size: .65rem; font-weight: 700; }
.lesson-stat-year-labels span { position: absolute; text-align: center; white-space: nowrap; }
.lesson-stat-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,252,.52);
}
.lesson-stat-card > span { color: var(--muted); font-size: .75rem; }
.lesson-stat-card > strong { font-size: 1.22rem; }
.lesson-stat-card > small { color: var(--ink-soft); font-size: .75rem; line-height: 1.45; }
.lesson-stat-card.is-unavailable { background: rgba(33,54,51,.025); }
.lesson-stat-hero {
  gap: 2px;
  padding: 17px 18px;
  border-color: rgba(153,72,65,.2);
  background: linear-gradient(135deg, rgba(230,216,168,.34), rgba(255,255,252,.62));
}
.lesson-stat-hero > span { color: #77524e; font-weight: 700; }
.lesson-stat-hero > strong { margin-top: 2px; font-size: 2rem; line-height: 1.08; letter-spacing: -.035em; }
.lesson-stat-hero > small { margin-top: 5px; }
.lesson-stat-hero > small:empty { display: none; }
.lesson-stat-hero.is-unavailable { border-color: var(--line); background: rgba(33,54,51,.025); }
.lesson-stat-compact {
  grid-template-columns: minmax(105px,.8fr) auto minmax(145px,1.2fr);
  align-items: baseline;
  gap: 8px 12px;
  padding: 11px 13px;
}
.lesson-stat-compact > strong { font-size: 1rem; white-space: nowrap; }
.lesson-stat-compact > small { text-align: right; }
@media (max-width: 520px) {
  .lesson-stat-compact { grid-template-columns: 1fr auto; }
  .lesson-stat-compact > small { grid-column: 1 / -1; text-align: left; }
}
.lesson-progress-settings { display: grid; gap: 12px; }
.lesson-progress-intro { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.lesson-phase-list { display: grid; gap: 7px; }
.lesson-phase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.48);
}
.lesson-phase-row > input,
.lesson-phase-duration input {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.72);
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
}
.lesson-phase-duration {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}
.lesson-phase-duration input { border-radius: 8px 0 0 8px; }
.lesson-phase-duration span {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: .68rem;
}
.dialog-field select {
  width: 100%;
  min-height: 43px;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.72);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  appearance: none;
}
.dialog-field:has(select) { position: relative; }
.dialog-field:has(select)::after {
  top: 38px;
  bottom: auto;
  transform: translateY(-70%) rotate(45deg);
}
.project-dialog.schedule-display-dialog {
  width: min(860px, calc(100vw - 28px));
  max-width: none;
}
.dialog-intro { margin: 7px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.display-default-fields {
  display: grid;
  grid-template-columns: minmax(480px, 1.4fr) minmax(230px, .6fr);
  gap: 10px;
}
.display-default-fields > label,
.display-default-fields > .display-default-group {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.42);
  color: var(--ink-soft);
  font-size: .76rem;
}
.display-default-fields > .display-default-group {
  grid-template-columns: minmax(145px,.7fr) minmax(290px,1.3fr);
}
.display-default-fields > label {
  grid-template-columns: minmax(92px,1fr) minmax(105px,.72fr);
}
.display-day-range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.display-day-range label { display: grid; grid-template-columns: auto 1fr; gap: 5px; align-items: center; color: var(--muted); font-size: .68rem; }
.display-day-range input {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.72);
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
}
.display-number-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.72);
}
.display-number-field input {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px 5px 7px 9px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
}
.display-number-field > span { padding-right: 9px; color: var(--muted); font-size: .68rem; }
.display-default-note { margin: -12px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.display-row-list { display: grid; gap: 7px; max-height: min(52vh, 480px); overflow: auto; padding-right: 3px; }
.display-row-item {
  display: grid;
  grid-template-columns: 62px minmax(130px,1fr) 108px 108px auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.42);
}
.display-row-item.is-break { background: rgba(33,54,51,.035); }
.display-row-item.has-time-conflict { color: #a33b32; }
.display-row-item.has-time-conflict .display-row-kind { color: #a33b32; }
.display-row-item.has-time-conflict input { border-color: rgba(163,59,50,.5); color: #a33b32; }
.display-row-kind { color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.display-row-item input {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.7);
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
}
.display-row-delete { padding: 7px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .72rem; cursor: pointer; }
.display-row-delete:hover, .display-row-delete:focus-visible { outline: none; background: rgba(33,54,51,.06); color: var(--ink); }
.display-add-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.project-dialog {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7f7f1;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(33,54,51,.2);
}
.project-dialog::backdrop { background: rgba(33,54,51,.18); backdrop-filter: blur(3px); }
.project-dialog form { display: grid; gap: 17px; padding: 22px; }
.project-dialog h2 { margin: 4px 0 0; font-size: 1.12rem; line-height: 1.25; }
.calendar-export-dialog { width: min(620px, calc(100vw - 28px)); }
.calendar-export-presets { display: grid; gap: 7px; }
.calendar-export-presets label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.38);
  cursor: pointer;
}
.calendar-export-presets label:has(input:checked) {
  border-color: var(--line-strong);
  background: rgba(198,215,189,.3);
}
.calendar-export-presets input { margin: 3px 0 0; accent-color: var(--ink); }
.calendar-export-presets label > span { display: grid; gap: 3px; }
.calendar-export-presets strong { font-size: .82rem; }
.calendar-export-presets small { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.calendar-export-choices {
  display: grid;
  gap: 13px;
  max-height: min(43vh, 380px);
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,252,.28);
}
.calendar-export-choices[hidden] { display: none; }
.calendar-export-choice-group { display: grid; gap: 6px; }
.calendar-export-choice-group h3 { margin: 0; color: var(--ink-soft); font-size: .74rem; }
.calendar-export-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255,255,252,.5);
  color: var(--ink-soft);
  font-size: .76rem;
  cursor: pointer;
}
.calendar-export-choice input { margin: 0; accent-color: var(--ink); }
.dialog-field { display: grid; gap: 7px; color: var(--muted); font-size: .8rem; }
.dialog-field[hidden] { display: none; }
.dialog-field input {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.72);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  outline: none;
}
.dialog-field input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(33,54,51,.075); }
.import-project-dialog { width: min(520px, calc(100vw - 28px)); }
.import-project-dialog input[type="file"] {
  min-height: 48px;
  padding: 7px;
  cursor: pointer;
}
.import-project-dialog input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,252,.72);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.dialog-actions button[hidden] { display: none; }
.secondary-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,252,.48);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.secondary-button:hover, .secondary-button:focus-visible { outline: none; border-color: var(--line-strong); background: rgba(255,255,252,.78); }
.secondary-button.primary-action {
  border-color: var(--line-strong);
  background: rgba(255,255,252,.72);
  box-shadow: 0 1px 2px rgba(33,54,51,.06);
  font-weight: 700;
}
.lesson-delete-button {
  position: relative;
  width: 100%;
  overflow: hidden;
  --hold-progress: 0%;
  touch-action: none;
}
.lesson-delete-button[hidden] { display: none; }
.lesson-delete-button.is-hold-active,
.lesson-delete-button.is-hold-ready {
  border-color: rgba(163,59,50,.34);
  background:
    linear-gradient(
      90deg,
      rgba(196,105,95,.66) 0%,
      rgba(196,105,95,.66) var(--hold-progress),
      transparent var(--hold-progress),
      transparent 100%
    ),
    rgba(255,255,252,.56);
}

.menu-overlay { position: fixed; inset: 0; z-index: 30; background: rgba(33,54,51,.13); backdrop-filter: blur(2px); }
.menu-overlay[hidden] { display: none; }
.side-menu {
  position: fixed;
  z-index: 31;
  inset: 0 auto 0 0;
  width: min(420px, calc(100vw - 28px));
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(246,246,239,.97);
  box-shadow: 24px 0 70px rgba(33,54,51,.15);
  transform: translateX(-100%);
  transition: transform 180ms ease;
}
.side-menu.is-open { transform: translateX(0); }
.side-menu-inner { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.side-menu-head { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.side-menu-head strong { display: block; margin-top: 4px; }
.menu-close-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,252,.55);
  cursor: pointer;
}
.side-menu-list { display: grid; gap: 8px; overflow: auto; }
.side-menu-list details { border: 1px solid transparent; border-radius: 10px; }
.side-menu-list details[open] { border-color: var(--line); background: rgba(255,255,252,.48); }
.side-menu-list summary { padding: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.side-menu-list summary::-webkit-details-marker { display: none; }
.side-menu-list p { margin: 0; padding: 0 12px 14px; color: var(--ink-soft); font-size: .9rem; line-height: 1.5; }
.project-choice-list { display: grid; gap: 6px; padding: 0 12px 14px; }
.project-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.project-choice:hover, .project-choice[aria-current="page"] { border-color: var(--line); background: rgba(255,255,252,.58); }
.project-choice[aria-current="page"]::after { content: "✓"; color: var(--ink-soft); font-weight: 700; }

@media (max-width: 980px) {
  .year-calendar { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .settings-stage { overflow: auto; grid-template-columns: 1fr; }
  .settings-panel { min-height: 380px; }
}
@media (max-width: 680px) {
  .topbar { padding-right: 10px; padding-left: 12px; }
  .brand-plate { padding: 0 5px; gap: 8px; }
  .brand-home-link, .brand-bird { width: 44px; height: 44px; }
  .brand-name { font-size: 1.36rem; }
  .render-stage { padding: 10px 10px calc(78px + env(safe-area-inset-bottom, 0px)); }
  .calendar-shell { padding: 15px; border-radius: 16px; }
  .calendar-shell.is-timeline-view { height: 100%; }
  .calendar-heading { align-items: stretch; flex-direction: column; }
  .calendar-heading-controls { align-items: flex-start; }
  .calendar-heading-actions { align-items: flex-start; justify-content: space-between; }
  .year-calendar { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
  .month { padding: 10px 7px; }
  .day { min-height: 22px; font-size: .68rem; }
  .settings-stage { padding: 66px 8px 10px; gap: 10px; }
  .settings-panel { min-height: 330px; border-radius: 14px; padding: 16px; }
  .property-row,
  .property-field { grid-template-columns: 1fr; gap: 7px; }
  .property-field::after { top: auto; right: 24px; bottom: 21px; transform: rotate(45deg); }
  .project-school-year-fields { grid-template-columns: 1fr; }
  .project-period-tabs { grid-template-columns: 1fr 1fr; }
  .half-year-range,
  .grading-stop-row { grid-template-columns: 1fr; }
  .grading-stop-row .grading-stop-delete { grid-column: 1; justify-self: end; }
  .ab-week-row { grid-template-columns: 52px 1fr; }
  .ab-week-toggle { grid-column: 1 / -1; width: 100%; }
  .trip-date-fields { grid-template-columns: 1fr; }
  .class-trip-date-fields { grid-template-columns: 1fr; }
  .event-time-fields { grid-template-columns: 1fr; }
  .schedule-validity, .lesson-dialog-grid { grid-template-columns: 1fr; }
  .lesson-dialog-wide { grid-column: auto; }
  .display-default-fields { grid-template-columns: 1fr; }
  .display-default-fields > .display-default-group,
  .display-default-fields > label { grid-template-columns: 1fr; }
  .display-row-item { grid-template-columns: 58px 1fr 1fr; }
  .display-row-item input[type="text"] { grid-column: 2 / -1; }
  .display-row-delete { grid-column: 3; }
  .project-dialog form { gap: 15px; padding: 18px; }
  .holiday-entry:not(.class-project-summary) {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .holiday-entry:not(.class-project-summary) span { white-space: normal; }
  .combined-timeline.is-day-timeline {
    --live-phase-reserved-height: 4.65rem;
    --phase-label-lines: 2;
  }
  .is-day-timeline .live-phase {
    right: 5px;
    bottom: 5px;
    left: 5px;
    gap: 4px;
    max-height: calc(var(--live-phase-reserved-height) - 8px);
    padding: 5px 6px;
  }
  .is-day-timeline .live-phase-copy {
    min-height: 13px;
    font-size: .7rem;
  }
  .is-day-timeline .live-phase-progress {
    align-items: stretch;
    min-height: 32px;
  }
  .is-day-timeline .live-phase-segment {
    align-content: end;
    min-width: 0;
  }
  .is-day-timeline .live-phase-segment-label {
    min-height: 20px;
    font-size: .62rem;
  }
  .is-day-timeline .live-phase-segment-track {
    width: var(--segment-relative-width, 100%);
    min-width: 3px;
    height: 6px;
    justify-self: start;
  }
}
@media (max-width: 420px) {
  .year-calendar { grid-template-columns: 1fr; }
  .project-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .project-dialog form { padding: 16px; }
  .dialog-actions { align-items: stretch; }
  .dialog-actions .secondary-button { flex: 1 1 auto; }
  .dialog-actions .class-project-dialog-delete { flex-basis: 100%; margin-right: 0; }
}
@media (max-width: 1100px), (max-height: 780px) {
  .combined-timeline.is-day-timeline {
    --phase-label-lines: 2;
  }
  .combined-timeline.is-day-timeline .timeline-lesson-card {
    --live-phase-reserved-height: var(--responsive-live-phase-height, 4.65rem);
  }
  .combined-timeline.is-day-timeline .timeline-header,
  .combined-timeline.is-day-timeline .timeline-body { min-width: 0; }
  .is-day-timeline .live-phase {
    right: 5px;
    bottom: 5px;
    left: 5px;
    gap: 4px;
    max-height: calc(var(--live-phase-reserved-height) - 8px);
    padding: 5px 6px;
  }
  .is-day-timeline .live-phase-copy {
    min-height: 13px;
    font-size: .7rem;
  }
  .is-day-timeline .live-phase-progress {
    display: grid;
    gap: 4px;
    align-items: stretch;
    min-height: 0;
  }
  .is-day-timeline .live-phase-segment {
    grid-template-columns: minmax(56px, .28fr) minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    min-width: 0;
  }
  .is-day-timeline .live-phase-segment-label {
    visibility: visible;
    min-height: 0;
    font-size: .66rem;
    line-height: 1.15;
    text-align: left;
  }
  .is-day-timeline .live-phase-segment.is-label-hidden .live-phase-segment-label { visibility: visible; }
  .is-day-timeline .live-phase-segment-track {
    width: var(--segment-relative-width, 100%);
    min-width: 3px;
    height: 6px;
    justify-self: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
