#exportErasmusXlsxButton[hidden] { display: none !important; }

:root {
  --ink: #162b36;
  --muted: #6f8188;
  --line: #dbe4e6;
  --line-soft: #edf1f2;
  --paper: #ffffff;
  --canvas: #f3f6f5;
  --navy: #123746;
  --navy-2: #1c4b5b;
  --teal: #0f8a82;
  --teal-soft: #e4f4f1;
  --orange: #e98538;
  --orange-soft: #fff0e4;
  --red: #d85052;
  --red-soft: #fdebec;
  --yellow: #d7a42c;
  --yellow-soft: #fff6da;
  --blue: #3a73a5;
  --blue-soft: #e9f2fb;
  --purple: #765aa5;
  --purple-soft: #f0ebf8;
  --shadow: 0 14px 34px rgba(23, 55, 67, 0.10);
  --radius: 14px;
  --minute-px: 1.05px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
.weekend-bar { display:flex; gap:12px; align-items:center; padding:8px 24px; background:#e4f4f1; min-height:65px; }
.weekend-bar .field { min-width:300px; }
.weekend-bar > span { font-size:12px; max-width:480px; color:#34545c; }
body.parttime-view .workspace { height:calc(100vh - 197px); }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(circle at 82% -10%, rgba(15, 138, 130, .08), transparent 28%),
    var(--canvas);
  overflow: hidden;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.topbar {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(120deg, #102f3c 0%, #174757 72%, #116c69 125%);
  box-shadow: 0 8px 24px rgba(13, 41, 52, .18);
  position: relative;
  z-index: 20;
}

.brand, .top-actions, .commandbar, .summary-strip, .legend-row, .panel-heading,
.right-tabs, .two-cols, .form-actions, .detail-heading, .modal-head, .modal-actions {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; }
.brand-mark {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 12px;
  font: 800 15px/1 Georgia, serif;
  letter-spacing: .06em;
  background: rgba(255,255,255,.08);
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.topbar .eyebrow { color: rgba(255,255,255,.62); }
.topbar h1 { margin: 2px 0 0; font: 700 21px/1.1 Georgia, serif; letter-spacing: .01em; }
.topbar h1 span { font-weight: 400; font-style: italic; opacity: .78; }
.top-actions { gap: 8px; }

.sync-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 8px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
}
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: #eab752; box-shadow: 0 0 0 3px rgba(234,183,82,.14); }
.sync-state.saved i { background: #5bd3b1; box-shadow: 0 0 0 3px rgba(91,211,177,.14); }
.sync-state.dirty i { background: #eab752; }
.sync-state.error i { background: #ff7e80; }

.button, .icon-button, .chip, .text-button, .right-tabs button, .segmented button {
  border: 0;
  cursor: pointer;
  transition: .16s ease;
}
.button {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary { color: #fff; background: var(--teal); box-shadow: 0 5px 14px rgba(15,138,130,.22); }
.button.primary:hover { background: #0c7771; transform: translateY(-1px); }
.button.quiet { color: var(--navy); background: #edf3f3; border: 1px solid #dce6e7; }
.topbar .button.quiet { color: #fff; background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); }
.topbar .button.generate-top {
  color: #173746;
  background: #f2c65d;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.topbar .button.generate-top:hover { background: #ffda7e; transform: translateY(-1px); }
.button.quiet:hover { background: #e3ecec; }
.topbar .button.quiet:hover { background: rgba(255,255,255,.16); }
.button.wide { width: 100%; }
.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.10);
  color: inherit;
  font-size: 18px;
}
.icon-button:hover { background: rgba(255,255,255,.18); }
.icon-button.small { width: 29px; height: 29px; color: var(--navy); background: var(--line-soft); }

.commandbar {
  height: 60px;
  gap: 14px;
  padding: 9px 20px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 15;
}
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #e8eeee; }
.segmented button { padding: 7px 13px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.segmented button.active { color: #fff; background: var(--navy); box-shadow: 0 3px 8px rgba(18,55,70,.2); }

.field { display: grid; gap: 5px; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .search-field:focus-within {
  border-color: #78bdb5;
  box-shadow: 0 0 0 3px rgba(15,138,130,.09);
}
.field.compact { min-width: 130px; display: flex; align-items: center; gap: 7px; }
.field.compact > span { white-space: nowrap; }
.field.compact select { padding: 7px 28px 7px 9px; font-size: 12px; background: #f7f9f9; }
.entity-field { min-width: 260px !important; }
#roomCampusField { flex: 0 0 145px; flex-direction: column; align-items: stretch; gap: 2px; }
#roomCampusField select { padding-top: 5px; padding-bottom: 5px; }

.search-field {
  min-width: 240px;
  flex: 1;
  max-width: 430px;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #f8fafa;
}
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }

.switch { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 31px; height: 18px; padding: 2px; border-radius: 99px; background: #cbd6d7; transition: .18s; }
.switch span::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: .18s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(13px); }
.switch.block { margin-top: 14px; white-space: normal; }

.workspace {
  height: calc(100vh - 176px);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: 270px minmax(620px, 1fr) 300px;
  gap: 0;
}
.panel { background: var(--paper); min-width: 0; min-height: 0; }
.left-panel { border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.left-panel > :not(.parking-list) { flex-shrink: 0; }
.right-panel { border-left: 1px solid var(--line); overflow: hidden; }
.panel-heading { justify-content: space-between; padding: 18px 16px 12px; }
.panel-heading.small { padding: 14px 14px 8px; }
.panel-heading h2, .summary-strip h2, .detail-heading h2, .modal h2 { margin: 3px 0 0; font: 700 17px/1.2 Georgia, serif; color: var(--navy); }
.count-badge { min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 99px; padding: 0 8px; background: var(--orange-soft); color: #b55b1a; font-size: 11px; font-weight: 800; }
.parking-filters { display: flex; gap: 6px; padding: 0 14px 10px; }
.chip { padding: 5px 9px; border-radius: 99px; color: var(--muted); background: #f1f4f4; font-size: 10px; font-weight: 700; }
.chip.active { color: #fff; background: var(--navy-2); }
.parking-list { flex: 1 1 0; min-height: 0; overflow-y: scroll; overflow-x: hidden; padding: 2px 10px 14px; scrollbar-width: auto; scrollbar-gutter: stable; scrollbar-color: #77949c #edf2f3; overscroll-behavior-y: contain; touch-action: pan-y; }
.parking-list::-webkit-scrollbar { width: 14px; }
.parking-list::-webkit-scrollbar-track { background: #edf2f3; }
.parking-list::-webkit-scrollbar-thumb { background: #77949c; border: 3px solid #edf2f3; border-radius: 8px; }
.parking-list:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.panel-footer { padding: 12px; border-top: 1px solid var(--line); background: #fbfcfc; }
.stack { display: grid; gap: 7px; }
.generate-button { min-height: 38px; box-shadow: 0 7px 18px rgba(15,138,130,.18); }

.parking-card {
  margin: 7px 2px;
  padding: 10px 10px 9px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(20,53,65,.045);
  cursor: grab;
  position: relative;
}
.parking-card:hover { transform: translateY(-1px); border-color: #b9cccf; box-shadow: 0 7px 18px rgba(20,53,65,.08); }
.parking-card.selected { outline: 2px solid rgba(15,138,130,.28); }
.parking-card[data-activity="L"] { border-left-color: var(--orange); }
.parking-card[data-modality="online"] { border-left-color: var(--purple); }
.parking-card h3 { margin: 0 22px 5px 0; font-size: 12px; line-height: 1.25; }
.parking-card p { margin: 2px 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.parking-card .parking-reason { margin-top: 8px; color: #8b3b2f; }
.parking-card .mini-lock { position: absolute; right: 8px; top: 8px; color: #8b9a9e; }
.parking-card .manual-park { position: absolute; right: 8px; bottom: 7px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-size: 8px; font-weight: 850; }
.wish-badge { position: absolute; right: 5px; bottom: 5px; z-index: 3; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 900; }
.wish-badge.hard { background: var(--red); }.wish-badge.soft { color: #684b0c; background: var(--yellow); }
.parking-card .wish-badge { right: 29px; bottom: 7px; }
.staffing-gap { border-color: #d74348 !important; border-left-color: #d74348 !important; background: repeating-linear-gradient(135deg, #fff3f3, #fff3f3 7px, #ffe5e6 7px, #ffe5e6 14px) !important; }
.staffing-gap-badge { display: inline-flex; width: max-content; margin: 0 0 4px; padding: 2px 5px; border-radius: 4px; color: #fff; background: #ba2f34; font-size: 7px; line-height: 1; font-weight: 900; letter-spacing: .04em; }
.schedule-card .staffing-gap-badge { position: absolute; right: 4px; top: 4px; white-space: nowrap; }

.schedule-shell { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--canvas); }
.summary-strip { min-height: 72px; gap: 18px; padding: 12px 18px; background: rgba(255,255,255,.76); border-bottom: 1px solid var(--line); }
.summary-title { flex: 1; min-width: 180px; }
.summary-title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric { min-width: 80px; padding-left: 12px; border-left: 2px solid var(--line); }
.metric span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.metric strong { display: block; margin-top: 3px; font: 700 20px/1 Georgia, serif; }
.metric.good { border-color: var(--teal); }.metric.good strong { color: var(--teal); }
.metric.danger { border-color: var(--red); }.metric.danger strong { color: var(--red); }
.metric.warning { border-color: var(--yellow); }.metric.warning strong { color: #aa7c13; }

.legend-row { min-height: 38px; padding: 7px 16px; gap: 13px; background: #fff; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.legend-row .spacer { flex: 1; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 2px; background: var(--blue); }
.legend-dot.lab { background: var(--orange); }.legend-dot.exercise { background: var(--teal); }.legend-dot.online { background: var(--purple); }.legend-dot.locked { background: var(--ink); }
.text-button { padding: 3px; color: var(--teal); background: transparent; font-size: 10px; font-weight: 750; }

.board-view-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f8fafa; flex-shrink: 0; }
.board-view-toolbar small { color: var(--muted); font-size: 10px; }
.board-zoom-controls { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.board-zoom-controls input { width: 100px; accent-color: var(--teal); }
.board-zoom-controls output { min-width: 36px; font-variant-numeric: tabular-nums; }
.board-zoom-controls .button { min-width: 32px; font-size: 18px; padding: 3px 8px; }
.group-columns-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; cursor: pointer; }
.group-columns-toggle input { accent-color: var(--teal); }
.board-scroll { flex: 1; min-height: 0; overflow: auto; background: #fff; scrollbar-width: auto; }
.schedule-board { min-width: 720px; position: relative; background: #fff; }
.board-header {
  height: 45px;
  display: grid;
  grid-template-columns: 58px repeat(var(--day-count), minmax(128px, 1fr));
  position: sticky;
  top: 0;
  z-index: 11;
  background: #f8fafa;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 8px rgba(20,53,65,.04);
}
.day-head { display: grid; place-items: center; border-left: 1px solid var(--line); color: var(--navy); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.day-head small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.time-grid {
  height: calc(825 * var(--minute-px));
  display: grid;
  grid-template-columns: 58px repeat(var(--day-count), minmax(128px, 1fr));
  position: relative;
}
.time-gutter { position: relative; background: #fbfcfc; border-right: 1px solid var(--line); }
.time-label { position: absolute; right: 9px; transform: translateY(-6px); color: #829196; font-size: 9px; font-variant-numeric: tabular-nums; }
.day-column {
  position: relative;
  border-right: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(90 * var(--minute-px) - 1px), #dce4e5 calc(90 * var(--minute-px) - 1px), #dce4e5 calc(90 * var(--minute-px))),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(15 * var(--minute-px) - 1px), #f1f4f4 calc(15 * var(--minute-px) - 1px), #f1f4f4 calc(15 * var(--minute-px)));
}
.day-column.drop-target { background-color: rgba(15,138,130,.055); box-shadow: inset 0 0 0 2px rgba(15,138,130,.24); }
.schedule-board.group-columns { min-width: calc(58px + var(--day-count) * var(--group-day-width)); }
.group-columns .board-header { height: 78px; }
.group-columns .board-header, .group-columns .time-grid { grid-template-columns: 58px repeat(var(--day-count), minmax(0, 1fr)); }
.group-heads, .group-guides { display: grid; grid-template-columns: repeat(var(--group-count), minmax(0, 1fr)); width: 100%; }
.group-heads { align-self: end; height: 30px; border-top: 1px solid var(--line); }
.group-heads span { display: grid; place-items: center; border-left: 1px solid var(--line); font-size: 10px; text-transform: none; letter-spacing: 0; }
.group-guides { position: absolute; inset: 0; pointer-events: none; }
.group-guides span { border-left: 1px solid #cbd7dc; }
.group-columns .time-gutter { position: sticky; left: 0; z-index: 10; }
.ns-timeline .board-header, .ns-timeline .time-grid { grid-template-columns: 58px repeat(var(--day-count),var(--ns-day-width)); }
.ns-timeline .time-gutter, .ns-timeline .board-header > div:first-child { position: sticky; left: 0; z-index: 12; background: #f8fafa; }
.ns-timeline .day-column[data-day="SAT"], .ns-timeline .day-head:nth-child(2n) { border-left: 3px solid #8faeb3; }
.ns-timeline .board-header { height: 62px; }
.ns-timeline.group-columns .board-header { height: 90px; }
.ns-timeline .day-head { overflow: hidden; text-align: center; font-size: max(7px,calc(11px * var(--board-scale))); }
.ns-timeline .day-head small { font-size: max(6px,calc(9px * var(--board-scale))); }
.board-scroll { overscroll-behavior: contain; scrollbar-gutter: stable; }
.group-columns .schedule-card h3, .group-columns .schedule-card .course-title-name, .group-columns .schedule-card p { white-space: normal; }
.now-line { position: absolute; left: 58px; right: 0; height: 1px; background: var(--red); z-index: 8; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }

.schedule-card {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 4;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid #bbd1e4;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 6px 7px 5px;
  background: var(--blue-soft);
  box-shadow: 0 2px 5px rgba(27,65,82,.08);
  cursor: grab;
  user-select: none;
}
.schedule-card:hover { z-index: 8; filter: saturate(1.05); box-shadow: 0 7px 16px rgba(27,65,82,.15); }
.schedule-card.selected { z-index: 9; outline: 2px solid rgba(15,138,130,.42); }
.schedule-card.conflict { border-color: #e68082; box-shadow: 0 0 0 2px rgba(216,80,82,.18), 0 6px 16px rgba(216,80,82,.11); }
.schedule-card.warning { box-shadow: 0 0 0 2px rgba(215,164,44,.16); }
.schedule-card.locked::after { content: "◆"; position: absolute; right: 5px; top: 4px; color: rgba(22,43,54,.55); font-size: 7px; }
.schedule-card.activity-L { background: var(--orange-soft); border-color: #efc29c; border-left-color: var(--orange); }
.schedule-card.activity-C, .schedule-card.activity-P, .schedule-card.activity-S { background: var(--teal-soft); border-color: #acd8d2; border-left-color: var(--teal); }
.schedule-card.modality-online { background: var(--purple-soft); border-color: #cdbfe5; border-left-color: var(--purple); }
.schedule-card h3 { margin: 0 14px 2px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; line-height: 1.2; }
.schedule-card .course-heading, .parking-card .course-heading { display: flex; align-items: baseline; gap: 3px; }
.course-title-name { min-width: 0; }
.schedule-card .course-title-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.course-title-type { flex: 0 0 auto; white-space: nowrap; font-weight: 900; padding: 0 3px; border: 1px solid currentColor; border-radius: 3px; }
.schedule-card p { margin: 1px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #54707a; font-size: 8px; line-height: 1.25; }
.schedule-board .schedule-card h3 { font-size: calc(10px * var(--board-scale, 1)); }
.schedule-board .schedule-card p { font-size: calc(8px * var(--board-scale, 1)); }
.schedule-board { --board-shrink: min(1, var(--board-scale, 1)); }
.schedule-board .schedule-card { min-height: calc(42px * var(--board-shrink)); padding: calc(6px * var(--board-shrink)) calc(7px * var(--board-shrink)); border-left-width: calc(4px * var(--board-shrink)); border-radius: calc(8px * var(--board-shrink)); }
.schedule-board .schedule-card h3 { margin: 0 calc(14px * var(--board-shrink)) calc(2px * var(--board-shrink)) 0; }
.schedule-board .schedule-card p { margin: calc(1px * var(--board-shrink)) 0; }
.schedule-board .course-title-type { padding: 0 calc(3px * var(--board-shrink)); }
.schedule-board .time-label { font-size: max(6px, calc(9px * var(--board-shrink))); }
.schedule-board .group-heads span { overflow: hidden; font-size: max(6px, calc(10px * var(--board-shrink))); }
.schedule-card .time { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.schedule-card .timetable-notice-label, .parking-card .timetable-notice-label { color: #18486a; background: #e4f3ff; border-radius: 3px; padding: 2px 3px; font-weight: 800; }
.timetable-notice-detail { margin: 6px 0; padding: 8px; border-left: 3px solid #3577a4; border-radius: 4px; background: #e4f3ff; color: #18486a; font-size: 12px; line-height: 1.45; }
.legacy-card {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 1;
  padding: 3px 5px;
  overflow: hidden;
  border: 1px dashed #b6c0c2;
  border-radius: 5px;
  background: rgba(226,231,232,.54);
  color: #78888d;
  font-size: 7px;
  line-height: 1.2;
  pointer-events: none;
}
.legacy-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legacy-card { pointer-events: auto; box-sizing: border-box; font-size: 9px; color: #45565c; }
.legacy-actions { display: flex; align-items: center; gap: 12px; padding: 6px 18px; height: 44px; background: #f4f6f6; }
.legacy-actions .button { flex-shrink: 0; }
.week-parity-field { flex-shrink: 0; }
.week-parity-field select { width: 184px; }
.week-cycle-field { padding: 10px; border: 1px solid #a9c9c4; border-radius: 8px; background: #f4faf8; }
.week-cycle-field p { margin: 7px 0 0; font-size: 11px; line-height: 1.4; color: #52666d; }
.week-cycle-field select:disabled { opacity: .65; }
.legacy-actions span { font-size: 12px; color: #52666d; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.parttime-view .legacy-actions { display: none; }
.modal.legacy-fill-modal { width: min(1000px, 95vw); }
.legacy-fill-content { max-height: 65vh; overflow: auto; padding: 0 20px; line-height: 1.5; }
.legacy-preview-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.legacy-preview-table th, .legacy-preview-table td { padding: 8px; border-bottom: 1px solid #d8e1e3; text-align: left; vertical-align: top; }
.legacy-preview-table td p { margin: 3px 0; }
.legacy-fill-content details { margin: 16px 0; }

.room-reservation {
  position: absolute;
  left: 1px;
  right: 1px;
  z-index: 2;
  box-sizing: border-box;
  overflow: hidden;
  padding: 5px 6px;
  border: 1px solid #9ca3af;
  border-left: 4px solid #6b7280;
  background: repeating-linear-gradient(135deg, #e5e7eb 0, #e5e7eb 7px, #d9dde2 7px, #d9dde2 9px);
  color: #374151;
  font-size: 10px;
  line-height: 1.35;
  cursor: help;
}
.room-reservation strong, .room-reservation span, .room-reservation small { display: block; }
.room-reservation strong { font-variant-numeric: tabular-nums; }
.room-reservation small { font-size: 9px; }
.room-reservation:focus-visible { outline: 2px solid #374151; outline-offset: -2px; }
.room-reservation.own-reservation { background: #dcefeb; border-color: #75aca2; border-left-color: var(--teal); color: #164d49; }
.room-reservation.cohort-lesson-card {
  z-index: 3;
  left: 3px;
  right: 3px;
  border-radius: 8px;
  background: #e5e7eb;
  border-color: #b1b8c1;
  border-left-color: #6b7280;
  box-shadow: 0 1px 2px #172b3514;
  padding: calc(5px * var(--board-shrink, 1)) calc(6px * var(--board-shrink, 1));
  font-size: max(6px, calc(10px * var(--board-shrink, 1)));
}
.cohort-lesson-card .time { font-weight: 800; font-variant-numeric: tabular-nums; }
.legend-dot.external-reservation { background: #9ca3af; }
.legend-dot.own-reservation { background: var(--teal); }
.room-occupancy-legend { display: none; }
body.room-view .room-occupancy-legend { display: inline; }
body.room-view .legend-row { flex-wrap: wrap; }

.right-tabs { height: 44px; padding: 0 8px; gap: 2px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.right-tabs button { flex: 1; height: 43px; padding: 0 5px; color: var(--muted); background: transparent; border-bottom: 2px solid transparent; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.right-tabs button.active { color: var(--teal); border-bottom-color: var(--teal); }
.right-content { display: none; height: calc(100% - 44px); overflow-y: auto; }
.right-content.active { display: block; }
.conflict-list { padding: 3px 10px 18px; }
.conflict-item { margin: 8px 2px; padding: 10px; border-radius: 9px; border: 1px solid #f2c1c2; background: var(--red-soft); cursor: pointer; }
.conflict-item.warning { border-color: #ead491; background: var(--yellow-soft); }
.conflict-item.info { border-color: var(--line); background: #f5f8f8; }
.conflict-item strong { display: block; margin-bottom: 3px; color: #a53b3d; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.conflict-item.warning strong { color: #9b7015; }
.conflict-item p { margin: 0; font-size: 10px; line-height: 1.4; }
.conflict-empty { margin: 14px; padding: 20px 14px; text-align: center; border: 1px solid #b9ddd7; border-radius: 12px; background: var(--teal-soft); color: #33746e; font-size: 11px; }
.wish-preview { margin: 2px 12px 18px; padding: 13px; border: 1px solid #cbd9dc; border-radius: 12px; background: #fbfcfc; }
.wish-preview h3 { margin: 4px 0 7px; color: var(--navy); font: 700 15px/1.2 Georgia, serif; }
.wish-preview h4 { margin: 12px 0 5px; color: var(--navy); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.wish-preview p { margin: 6px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.wish-subject { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wish-status { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.wish-status.good { color: #166c65; background: var(--teal-soft); }.wish-status.soft { color: #765615; background: var(--yellow-soft); }.wish-status.hard { color: #9b383a; background: var(--red-soft); }.wish-status.neutral { color: var(--muted); background: var(--line-soft); }
.wish-row { margin: 5px 0; padding: 6px 7px; border-left: 3px solid var(--yellow); border-radius: 4px; color: #5c6870; background: #fff9e9; font-size: 9px; line-height: 1.35; }
.wish-row.hard { border-left-color: var(--red); color: #793f41; background: var(--red-soft); }
.wish-deviations { margin: 10px 0 14px; padding: 9px; border: 1px solid #e4cd91; border-radius: 8px; background: #fffdf6; overflow-wrap: anywhere; }
.wish-deviations h4 { margin: 8px 0 5px; font-size: 11px; line-height: 1.35; color: var(--navy); }
.wish-deviations .wish-row { font-size: 11px; line-height: 1.45; white-space: pre-line; }
.wish-deviations .wish-placement { margin: 0 0 7px; font-size: 11px; line-height: 1.45; color: var(--navy); }
.wish-meta { margin-top: 8px; color: #526d76; font-size: 9px; line-height: 1.4; }
.wish-notes { max-height: 130px; overflow-y: auto; white-space: pre-line; }
.teacher-wish-guide { margin: 8px 0 12px; padding: 10px; border: 1px solid #9bbfba; border-radius: 8px; background: #f4faf8; overflow-wrap: anywhere; }
.teacher-wish-guide h4 { margin: 0 0 6px; color: var(--navy); font-size: 12px; line-height: 1.4; text-transform: none; letter-spacing: 0; }
.teacher-wish-guide .wish-guide-hint, .teacher-wish-guide .wish-guide-source { margin: 5px 0; color: #526d76; font-size: 10px; line-height: 1.4; }
.wish-guide-content { max-height: 380px; overflow-y: auto; scrollbar-gutter: stable; }
.wish-guide-group { padding: 7px 0; border-top: 1px solid #d4e5e0; }
.wish-guide-group h5 { margin: 0 0 4px; color: #205952; font-size: 11px; line-height: 1.4; }
.wish-guide-group p, .wish-guide-content > p { margin: 4px 0; color: #314c52; font-size: 11px; line-height: 1.45; white-space: pre-line; }
.wish-guide-group.hard { padding: 7px; border-left: 3px solid var(--red); background: var(--red-soft); }
.wish-guide-group.hard h5, .wish-guide-group.hard p { color: #793f41; }
.teacher-agenda { margin: 10px 0; padding: 9px; border: 1px solid #cbd9dc; border-radius: 8px; background: #fff; }
.teacher-agenda h4 { margin: 0 0 5px; font-size: 12px; line-height: 1.4; text-transform: none; letter-spacing: 0; }
.teacher-agenda .wish-guide-hint { margin: 4px 0 7px; color: #526d76; font-size: 10px; line-height: 1.4; }
.teacher-agenda-list { max-height: 280px; overflow-y: auto; scrollbar-gutter: stable; }
.teacher-agenda-item { display: block; width: 100%; margin: 5px 0; padding: 8px; text-align: left; border: 1px solid #d4e5e0; border-radius: 6px; background: #f6faf9; color: #314c52; cursor: pointer; overflow-wrap: anywhere; }
.teacher-agenda-item strong, .teacher-agenda-item span, .teacher-agenda-item small { display: block; font-size: 11px; line-height: 1.45; }
.teacher-agenda-item small { color: #526d76; font-size: 10px; }
.teacher-agenda-item.parked { background: #fff9e9; border-color: #e4cd91; }
.teacher-agenda-item:hover, .teacher-agenda-item:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }

.empty-state { padding: 54px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--line-soft); color: var(--teal); font-size: 24px; }
.empty-state h3 { margin: 0; color: var(--navy); font: 700 16px Georgia, serif; }
.empty-state p { font-size: 11px; line-height: 1.5; }
.hidden { display: none !important; }
.block-form { display: grid; gap: 10px; padding: 15px; }
.room-suggestions { min-width: 0; margin: 0; padding: 10px; border: 1px solid #8aaeb0; border-radius: 8px; background: #f2f8f8; }
.room-suggestions legend { font-size: 12px; font-weight: 700; }
.room-suggestions p { margin: 5px 0 9px; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.room-suggestions summary { cursor: pointer; font-size: 12px; font-weight: 600; padding: 5px 0; }
.room-suggestions .suggestion-help, .room-suggestions small { font-size: 11px; color: #465c61; line-height: 1.4; }
.suggested-room-choices { max-height: 250px; overflow-y: auto; margin: 6px 0; }
.suggested-room-choice { display: grid; grid-template-columns: 20px 1fr; gap: 2px 5px; padding: 6px; cursor: pointer; font-size: 12px; border-radius: 4px; }
.suggested-room-choice:has(input:checked) { background: #dcefed; }
.suggested-room-choice input { grid-row: span 2; align-self: center; accent-color: #176d66; }
.suggestion-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.suggestion-actions .button { padding: 6px 8px; font-size: 11px; }
.room-suggestion-label { font-weight: 600; color: #165e59; }
.suggested-time-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) 25px; gap: 6px; align-items: end; margin: 8px 0; }
.suggested-time-row .field { min-width: 0; }
.suggested-time-row .field span { font-size: 9px; }
.suggested-time-row select, .suggested-time-row input { min-width: 0; width: 100%; padding: 7px 4px; font-size: 12px; }
.suggested-time-row .remove-suggested-time { width: 25px; height: 31px; padding: 0; font-size: 18px; }
.detail-heading { justify-content: space-between; gap: 10px; }
.detail-heading h2 { font-size: 15px; }
.lock-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #f4f7f7; cursor: pointer; font-size: 19px; }
.lock-button.active { color: #fff; background: var(--navy); }
.two-cols { gap: 8px; align-items: end; }
.two-cols > * { flex: 1; min-width: 0; }
.form-actions { justify-content: space-between; gap: 8px; margin-top: 4px; }

.source-card { margin: 14px; padding: 13px; border: 1px solid #b8dcd7; border-radius: 11px; background: var(--teal-soft); }
.source-card h3 { margin: 4px 0 7px; font: 700 15px Georgia, serif; color: var(--navy); }
.source-card p, .source-note p { margin: 0; color: #527078; font-size: 10px; line-height: 1.45; }
.source-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 14px; }
.source-stat { padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfc; }
.source-stat strong { display: block; color: var(--navy); font: 700 17px Georgia, serif; }
.source-stat span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.curriculum-audit { padding: 10px 14px 0; }
.curriculum-audit .source-note { margin: 0 0 8px; }
.audit-summary { border-left: 3px solid var(--teal); }
.audit-ok { border-left: 3px solid #4f9668; }
.audit-details { border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.audit-details summary { padding: 9px 10px; color: var(--navy); font-size: 10px; font-weight: 800; cursor: pointer; }
.audit-list { max-height: 360px; overflow: auto; padding: 0 7px 7px; }
.audit-item { margin: 5px 0; padding: 7px 8px; border-left: 3px solid #d1a43b; border-radius: 6px; background: #fff9e9; }
.audit-item.missing { border-left-color: #d05256; background: #fff1f1; }
.audit-item strong, .audit-item span, .audit-item small { display: block; }
.audit-item strong { font-size: 10px; }
.audit-item span, .audit-item small { color: var(--muted); font-size: 8px; }
.audit-item p { margin: 4px 0; font-size: 9px; line-height: 1.35; }
.source-actions { display: grid; gap: 7px; padding: 14px; }
.file-button { display: grid; place-items: center; cursor: pointer; }
.file-button input { display: none; }
.source-note { margin: 0 14px 20px; padding: 11px; border-left: 3px solid var(--orange); background: var(--orange-soft); }
.source-note strong { display: block; margin-bottom: 4px; font-size: 11px; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 11px 13px; border-radius: 10px; color: #fff; background: var(--navy); box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease; }
.toast.error { background: #a63f42; }.toast.success { background: #16746d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal { width: min(760px, calc(100vw - 40px)); border: 0; border-radius: 16px; padding: 0; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(15,42,53,.28); }
.modal::backdrop { background: rgba(12,36,45,.52); backdrop-filter: blur(2px); }
.modal form { margin: 0; }
.ns-swap-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 20px 8px; }
.ns-swap-scope { grid-column: 1 / -1; }
.ns-swap-help { margin: 4px 20px 12px; font-size: 12px; line-height: 1.5; }
.ns-swap-result { max-height: 40vh; overflow: auto; padding: 12px 20px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ns-swap-result small { display: block; }
.ns-swap-result summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
.ns-swap-accept { display: block; margin: 10px 20px; color: #8d393b; font-size: 12px; }
.modal-head { justify-content: space-between; padding: 18px 20px 13px; border-bottom: 1px solid var(--line); }
.modal-head .icon-button { color: var(--navy); background: var(--line-soft); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 20px; }
.settings-grid section { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.settings-grid section:last-child { grid-column: 1 / -1; }
.settings-grid h3 { margin: 0 0 7px; font: 700 14px Georgia, serif; color: var(--navy); }
.settings-grid p { margin: 5px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-grid code { display: block; margin: 5px 0; padding: 6px 8px; overflow: auto; border-radius: 6px; color: #28645f; background: #eef5f4; font-size: 9px; }
.modal-actions { justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.ai-content { min-height: 190px; max-height: 58vh; overflow-y: auto; padding: 18px 20px; }
.import-content { min-height: 180px; max-height: 58vh; overflow-y: auto; padding: 18px 20px; }
.generation-content { min-height: 220px; max-height: 64vh; overflow-y: auto; padding: 18px 20px; }
.generation-hero { padding: 13px; border-radius: 11px; font-size: 11px; line-height: 1.45; }
.generation-hero.good { color: #256d67; background: var(--teal-soft); }.generation-hero.bad { color: #8d393b; background: var(--red-soft); }
.generation-hero p { margin: 5px 0 0; }
.generation-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 9px; margin: 12px 0; }
.generation-stats div { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafa; }
.generation-stats span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.generation-stats strong { display: block; margin-top: 3px; color: var(--navy); font: 700 20px Georgia, serif; }
.generation-list { margin-top: 16px; }.generation-list h3 { margin: 0 0 7px; color: var(--navy); font: 700 14px Georgia, serif; }
.generation-item { display: block; width: 100%; margin: 6px 0; padding: 9px 10px; text-align: left; border: 1px solid #efc1c2; border-radius: 8px; color: var(--ink); background: var(--red-soft); }
.generation-item.soft { border-color: #ead491; background: var(--yellow-soft); }.generation-item strong, .generation-item span { display: block; }.generation-item strong { font-size: 10px; }.generation-item span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.generation-ok { margin-top: 12px; padding: 12px; border: 1px solid #b9ddd7; border-radius: 10px; color: #2f746e; background: var(--teal-soft); font-size: 10px; }
.import-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 12px 0; }
.import-stat { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #f7faf9; }
.import-stat span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.import-stat strong { display: block; margin-top: 3px; color: var(--navy); font: 700 19px Georgia, serif; }
.import-warning { margin-top: 8px; padding: 9px 11px; border-left: 3px solid var(--orange); border-radius: 6px; color: #6f5528; background: #fff7e8; font-size: 10px; line-height: 1.45; }
.import-file { color: var(--muted); font-size: 10px; }
.ai-loader { display: grid; place-items: center; min-height: 170px; color: var(--muted); font-size: 11px; }
.ai-loader::before { content: ""; width: 32px; height: 32px; margin-bottom: 12px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-summary { padding: 12px; border-radius: 10px; background: var(--teal-soft); font-size: 11px; line-height: 1.45; }
.ai-move { margin: 9px 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 10px; }
.ai-move strong { display: block; margin-bottom: 3px; color: var(--navy); }
.muted { color: var(--muted) !important; }
.schedule-card.room-pending { outline: 2px dashed #a8590b; outline-offset: -2px; }
.schedule-card .room-pending-label { color: #8b4005; font-weight: 700; white-space: normal; }

@media (max-width: 1220px) {
  .workspace { grid-template-columns: 230px minmax(600px, 1fr) 270px; }
  .entity-field { min-width: 190px !important; }
  .commandbar { gap: 8px; }
  .search-field { min-width: 150px; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .workspace { height: calc(100vh - 176px); min-height: 0; grid-template-columns: 220px minmax(620px, 1fr); }
  .right-panel { display: none; }
  .commandbar .switch { display: none; }
  .topbar .sync-state { display: none; }
}
/* Dated opening events are separate from the recurring weekly grid. */
.opening-schedule{padding:10px 14px;background:#fff7e6;color:#49320d;font-size:13px;line-height:1.4;max-height:260px;overflow:auto}
.opening-schedule p{margin:6px 0}.opening-schedule table{width:100%;border-collapse:collapse;text-align:left}
.opening-schedule td,.opening-schedule th{padding:5px 9px;border-bottom:1px solid #ded3bd;vertical-align:top}
.opening-schedule summary{cursor:pointer;font-weight:600}
.opening-schedule .opening-room-change{margin:0 0 10px;padding:10px 12px;border:2px solid #b45309;background:#ffebad;color:#7c2d12;font-size:22px;font-weight:800;line-height:1.3}
.opening-room-change span{display:block;margin-top:5px;font-size:15px;font-weight:600}
