:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --paper: rgba(255, 255, 255, 0.82);
  --paper-strong: rgba(255, 255, 255, 0.94);
  --ink: #171821;
  --muted: #6f7280;
  --soft: #979baa;
  --line: rgba(32, 33, 36, 0.1);
  --line-soft: rgba(32, 33, 36, 0.065);
  --violet: #5d43d7;
  --violet-2: #7a54e6;
  --blue: #2574ff;
  --cyan: #18bac8;
  --amber: #ff920e;
  --pink: #ed5f9b;
  --danger: #fa2d2d;
  --shadow: 0 20px 54px rgba(42, 43, 47, 0.08);
  --radius: 8px;
  --max: 1780px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 3% 2%, rgba(255, 241, 207, 0.72), transparent 24rem),
    radial-gradient(circle at 62% 0%, rgba(117, 84, 230, 0.11), transparent 30rem),
    radial-gradient(circle at 100% 8%, rgba(24, 186, 200, 0.1), transparent 26rem),
    linear-gradient(180deg, #fffdf9 0%, #fbfaf7 46%, #f6f5f2 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

a { color: inherit; }

.shell {
  width: min(100% - 64px, var(--max));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 253, 249, 0.72);
  backdrop-filter: blur(18px);
}

.nav {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  min-height: 86px;
  align-items: center;
  gap: 18px;
}

.brand,
.nav-center,
.nav-actions,
.panel-title-row,
.course-head,
.card-kicker,
.calendar-header,
.month-controls,
.view-controls,
.legend,
.meta-row,
.tool-panel,
.tool-actions,
.export-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  gap: 5px;
}

.brand-mark span {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, #a96cf0, #21c1c8);
}

.brand-mark span:nth-child(1) { width: 29px; }
.brand-mark span:nth-child(2) { width: 18px; }
.brand-mark span:nth-child(3) { width: 24px; }
.brand-mark span:nth-child(4) { width: 12px; }

.nav-center {
  justify-content: center;
  gap: 12px;
}

.nav-actions {
  justify-content: flex-end;
  gap: 10px;
}

.nav-button,
.report-chip,
.icon-button,
.select-button,
.today-button,
.wide-action,
.ghost-action,
.tool-actions button,
.export-actions button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  font-weight: 760;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(42, 43, 47, 0.04);
}

.nav-button,
.report-chip {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 21px;
}

.report-chip {
  border-radius: 999px;
  color: #34364f;
}

.chip-icon {
  color: #23b8ff;
  font-size: 11px;
}

.nav-button.admin,
.nav-button[aria-current="page"] {
  background: rgba(113, 75, 224, 0.08);
  color: #5236ca;
}

.nav-button.primary,
.wide-action {
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), #6f4fde);
  color: #fff;
  box-shadow: 0 14px 28px rgba(93, 67, 215, 0.22);
}

.calendar-app {
  display: grid;
  grid-template-columns: 330px minmax(500px, 1fr) 300px;
  grid-template-areas:
    "left board detail"
    "left tools tools";
  gap: 18px;
  padding: 18px 0 34px;
}

.left-rail {
  display: grid;
  grid-area: left;
  align-content: start;
  gap: 18px;
}

.calendar-board,
.detail-panel,
.rail-panel,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.rail-panel {
  padding: 22px 20px;
}

.intro-panel {
  background: rgba(255, 255, 255, 0.78);
}

.panel-title-row {
  gap: 9px;
  margin-bottom: 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.panel-title-row h1,
.rail-panel h2,
.tool-panel h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.25;
}

.intro-panel p,
.tool-panel p {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.55;
}

.wide-action,
.ghost-action {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

.petite-action {
  margin-top: 10px;
  border-color: rgba(24, 186, 200, 0.24);
  background: rgba(24, 186, 200, 0.08);
  color: #127c86;
}

.course-card {
  background:
    radial-gradient(circle at 96% 0%, rgba(117, 84, 230, 0.12), transparent 10rem),
    rgba(255, 255, 255, 0.78);
}

.course-head {
  justify-content: space-between;
  gap: 12px;
}

.course-head h2 {
  font-size: 22px;
}

.course-head span,
.card-kicker strong,
.selected-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(117, 84, 230, 0.09);
  color: #583ed1;
  font-size: 12px;
  font-weight: 820;
}

.date-range {
  margin: 12px 0 20px;
  color: #565a69;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
  color: #27293b;
  font-size: 13px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 67, 215, 0.09);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #456cff, #2a8dff);
}

.course-nav {
  display: grid;
  gap: 8px;
}

.course-nav a,
.course-nav button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #30334a;
  cursor: pointer;
  font: inherit;
  font-weight: 720;
  text-decoration: none;
  text-align: left;
}

.course-nav a.active,
.course-nav button:hover {
  background: rgba(117, 84, 230, 0.08);
  color: #543acf;
}

.next-card {
  background: rgba(255, 255, 255, 0.92);
}

.card-kicker {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
}

.next-card h2 {
  margin-bottom: 10px;
  color: #4b35d2;
}

.next-card p {
  margin-bottom: 10px;
  color: #1f2130;
  font-weight: 760;
  line-height: 1.55;
}

.next-card time {
  color: var(--muted);
}

.tip-card {
  background:
    linear-gradient(135deg, rgba(234, 244, 255, 0.8), rgba(255, 255, 255, 0.86)),
    radial-gradient(circle at 100% 0%, rgba(93, 67, 215, 0.12), transparent 10rem);
}

.tip-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #3162dc;
}

.tip-card p {
  margin-bottom: 22px;
  color: #222535;
  line-height: 1.7;
}

.ghost-action {
  background: rgba(255, 255, 255, 0.68);
  color: #4f38cc;
}

.calendar-board {
  grid-area: board;
  min-width: 0;
  padding: 20px 20px 22px;
}

.calendar-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.month-controls,
.view-controls {
  gap: 12px;
}

.month-controls h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.25;
}

.month-controls h2 span {
  color: #303245;
  font-size: 16px;
  font-weight: 520;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  font-size: 31px;
  line-height: 1;
}

.select-button,
.today-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
}

.select-button[aria-pressed="true"] {
  border-color: rgba(93, 67, 215, 0.28);
  background: rgba(93, 67, 215, 0.09);
  color: #4f38cc;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.calendar-grid.week-view .day-cell {
  min-height: 430px;
}

.weekday {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  color: #202331;
  font-size: 13px;
  font-weight: 820;
}

.day-cell {
  position: relative;
  min-height: 116px;
  padding: 13px 10px 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.34);
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell.faded .day-number {
  color: #9ba0aa;
}

.day-number {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin: -4px 0 -2px -4px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #0f111a;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.day-number:hover,
.day-number:focus-visible,
.day-number[aria-expanded="true"] {
  border-color: rgba(93, 67, 215, 0.22);
  background: rgba(117, 84, 230, 0.08);
  box-shadow: 0 5px 14px rgba(93, 67, 215, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.day-cell.saturday .day-number {
  color: var(--blue);
}

.day-cell.sunday .day-number,
.day-cell.holiday .day-number {
  color: var(--danger);
}

body.show-weekends .day-cell.saturday {
  background: rgba(37, 116, 255, 0.035);
}

body.show-weekends .day-cell.sunday {
  background: rgba(237, 95, 155, 0.045);
}

.day-cell.today {
  background:
    linear-gradient(180deg, rgba(37, 116, 255, 0.055), rgba(255, 255, 255, 0.34)),
    rgba(255, 255, 255, 0.34);
}

.day-cell.today .day-number {
  min-width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 820;
}

.day-cell.today .day-number:hover,
.day-cell.today .day-number:focus-visible,
.day-cell.today .day-number[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.75);
  background: #1b65e8;
  box-shadow: 0 6px 16px rgba(37, 116, 255, 0.28);
}

.date-action-menu {
  position: fixed;
  z-index: 70;
  width: min(260px, calc(100vw - 16px));
  padding: 12px;
  border: 1px solid rgba(93, 67, 215, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(38, 34, 69, 0.18);
  backdrop-filter: blur(16px);
}

.date-action-menu[hidden],
.date-action-options[hidden],
.quick-task-form[hidden],
[data-memo-form][hidden] {
  display: none;
}

.date-action-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 10px;
}

.date-action-heading strong {
  color: #25283a;
  font-size: 14px;
}

.date-action-heading span {
  color: var(--muted);
  font-size: 11px;
}

.date-action-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.date-action-options button {
  min-height: 38px;
  padding: 0 10px;
  border-color: transparent;
  background: rgba(117, 84, 230, 0.06);
  color: #3d3481;
  font-size: 12px;
  font-weight: 760;
  text-align: left;
}

.date-action-options button:hover,
.date-action-options button:focus-visible {
  border-color: rgba(93, 67, 215, 0.16);
  background: rgba(117, 84, 230, 0.11);
  outline: none;
}

.quick-task-form {
  display: grid;
  gap: 10px;
}

.quick-task-form label {
  display: grid;
  gap: 5px;
}

.quick-task-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.quick-task-form input,
.quick-task-form select,
.quick-task-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.quick-task-form select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #555a6c 50%) calc(100% - 18px) 16px / 6px 6px no-repeat,
    linear-gradient(135deg, #555a6c 50%, transparent 50%) calc(100% - 13px) 16px / 6px 6px no-repeat,
    #fff;
}

.quick-task-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.quick-task-row button {
  min-height: 38px;
  padding: 0 16px;
  border-color: transparent;
  background: var(--violet);
  color: #fff;
}

.memo-submit-row {
  grid-template-columns: 1fr auto;
}

.event-popup {
  position: fixed;
  z-index: 70;
  width: min(290px, calc(100vw - 16px));
  padding: 16px;
  border: 1px solid rgba(93, 67, 215, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(38, 34, 69, 0.18);
  backdrop-filter: blur(16px);
}

.event-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.event-popup-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-popup-label > span:first-child {
  color: #222533;
  font-size: 13px;
  font-weight: 820;
}

.event-popup-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.8);
  color: #35384a;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.event-popup h3 {
  margin: 0 0 14px;
  color: #11131d;
  font-size: 16px;
  line-height: 1.4;
  word-break: keep-all;
}

.event-popup-meta {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.event-popup-actions {
  display: flex;
  gap: 8px;
}

.event-popup-actions .wide-action,
.event-popup-actions .ghost-action,
.event-popup-actions .danger-action {
  flex: 1;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  margin-bottom: 0;
}

.edit-danger-row {
  display: flex;
  gap: 8px;
}

.edit-danger-row .danger-action {
  flex: 1;
}

.event {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  margin-top: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(117, 84, 230, 0.11);
  color: #4e38c5;
  cursor: pointer;
  text-align: left;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.event:hover,
.event.active {
  background: rgba(117, 84, 230, 0.16);
  box-shadow: 0 10px 22px rgba(93, 67, 215, 0.12);
  transform: translateY(-1px);
}

.event strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event time {
  display: none;
  margin-top: 6px;
  color: #7d8090;
  font-size: 12px;
}

body.compact-events .event {
  margin-top: 10px;
  min-height: 28px;
  padding: 0 9px;
}

body.compact-events .event time {
  display: none;
}

.event.holiday-event {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  background: rgba(237, 95, 155, 0.13);
  color: #df5a79;
  font-size: 12px;
  font-weight: 780;
}

.event.petite-event {
  background: rgba(24, 186, 200, 0.12);
  color: #127c86;
}

.event.petite-event:hover,
.event.petite-event.active {
  background: rgba(24, 186, 200, 0.18);
  box-shadow: 0 10px 22px rgba(24, 186, 200, 0.12);
}

.event.memo-event {
  background: rgba(245, 167, 36, 0.13);
  color: #94600b;
}

.event.memo-event:hover,
.event.memo-event.active {
  background: rgba(245, 167, 36, 0.2);
  box-shadow: 0 10px 22px rgba(245, 167, 36, 0.13);
}

.event.todo-event {
  background: rgba(37, 116, 255, 0.11);
  color: #1d5bd7;
}

.event.todo-event:hover,
.event.todo-event.active {
  background: rgba(37, 116, 255, 0.17);
  box-shadow: 0 10px 22px rgba(37, 116, 255, 0.12);
}

.event.todo-event.review {
  background: rgba(117, 84, 230, 0.12);
  color: #4f38cc;
}

.event.todo-event.assignment {
  background: rgba(250, 45, 45, 0.1);
  color: #c83c51;
}

.event.todo-event.university-exam {
  background: rgba(24, 186, 200, 0.13);
  color: #127c86;
}

.event.todo-event.completed {
  opacity: 0.5;
}

.event.todo-event.completed strong {
  text-decoration: line-through;
}

.todo-completed-label {
  color: #4caf50;
  font-weight: 500;
}

.legend {
  gap: 22px;
  margin-top: 20px;
  color: #383b4e;
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.lesson { background: var(--violet); }
.dot.petite { background: var(--cyan); }
.dot.memo { background: var(--amber); }
.dot.exam { background: var(--cyan); }
.dot.assignment { background: var(--amber); }
.dot.holiday { background: var(--pink); }

.detail-panel {
  grid-area: detail;
  min-width: 0;
  padding: 54px 20px 24px;
  border-left-color: rgba(32, 33, 36, 0.06);
}

.selected-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.selected-top span:first-child {
  color: #222533;
  font-size: 17px;
  font-weight: 760;
}

.selected-detail h2 {
  margin-bottom: 28px;
  color: #11131d;
  font-size: 22px;
  line-height: 1.45;
  word-break: keep-all;
}

.detail-meta {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
}

.meta-row {
  gap: 11px;
  color: #303342;
  font-size: 15px;
}

.meta-icon {
  display: inline-grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(32, 33, 36, 0.12);
  border-radius: 7px;
  background: rgba(245, 247, 250, 0.9);
  color: #5b6472;
  font-size: 14px;
}

.detail-panel .wide-action {
  margin-bottom: 26px;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.detail-actions .wide-action {
  margin-bottom: 0;
}

.detail-actions .danger-action {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
}

.detail-actions .ghost-action {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  padding: 0 12px;
}

.divider {
  height: 1px;
  margin: 0 0 26px;
  background: var(--line-soft);
}

.upcoming h2 {
  margin-bottom: 22px;
  font-size: 14px;
}

.upcoming-list {
  display: grid;
  gap: 0;
  margin-bottom: 20px;
}

.upcoming-item {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
}

.upcoming-item:last-child {
  margin-bottom: 0;
}

.upcoming-item strong {
  display: block;
  margin-bottom: 7px;
  color: #4f38cc;
  font-size: 14px;
}

.upcoming-item time {
  display: block;
  margin-bottom: 6px;
  color: #6c707c;
}

.upcoming-item p {
  margin: 0;
  color: #282b37;
  font-weight: 680;
  line-height: 1.45;
}

.empty-message {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 20, 28, 0.28);
  backdrop-filter: blur(10px);
}

.schedule-modal {
  width: min(100%, 760px);
  max-height: min(820px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(18, 20, 28, 0.22);
}

.schedule-modal form {
  display: flex;
  max-height: inherit;
  min-height: 0;
  flex-direction: column;
}

.syllabus-modal {
  width: min(100%, 1180px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head p {
  margin: 0 0 6px;
  color: #553bd0;
  font-size: 13px;
  font-weight: 820;
}

.modal-head h2 {
  margin: 0;
  font-size: 23px;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #35384a;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.schedule-list {
  display: grid;
  max-height: calc(min(720px, 100vh - 48px) - 86px);
  overflow-y: auto;
  padding: 10px;
}

.schedule-row {
  border-bottom: 1px solid var(--line-soft);
}

.schedule-row:last-child {
  border-bottom: 0;
}

.schedule-row button {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 170px;
  width: 100%;
  gap: 16px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.schedule-row button:hover,
.schedule-row.active button {
  background: rgba(117, 84, 230, 0.08);
}

.schedule-row span {
  color: #553bd0;
  font-size: 13px;
  font-weight: 820;
}

.schedule-row strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-row time {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.schedule-row.expanded {
  background: rgba(117, 84, 230, 0.04);
}

.schedule-row-toggle {
  cursor: pointer;
}

.schedule-row-form {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line-soft);
}

.schedule-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.schedule-edit-grid label {
  display: grid;
  gap: 5px;
}

.schedule-edit-grid label span {
  color: #424657;
  font-size: 12px;
  font-weight: 820;
}

.schedule-edit-grid input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.schedule-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.schedule-edit-actions .danger-action {
  margin-right: auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.schedule-edit-actions .ghost-action,
.schedule-edit-actions .wide-action {
  width: auto;
  min-height: 36px;
  min-width: 70px;
  padding: 0 14px;
  font-size: 13px;
}

.edit-modal form {
  margin: 0;
}

.edit-form-body {
  display: grid;
  gap: 15px;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px;
}

.syllabus-body {
  grid-template-columns: minmax(360px, 0.86fr) minmax(420px, 1.14fr);
  align-items: stretch;
  gap: 20px;
}

.syllabus-input-pane,
.syllabus-preview-pane {
  display: grid;
  min-height: 0;
}

.syllabus-input-pane {
  align-content: start;
  gap: 15px;
}

.syllabus-preview-pane {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid rgba(32, 33, 36, 0.08);
}

.edit-form-body label {
  display: grid;
  gap: 7px;
}

.edit-form-body label span {
  color: #424657;
  font-size: 13px;
  font-weight: 820;
}

.edit-form-body input,
.edit-form-body textarea,
.edit-form-body select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.edit-form-body select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #555a6c 50%) calc(100% - 18px) 19px / 6px 6px no-repeat,
    linear-gradient(135deg, #555a6c 50%, transparent 50%) calc(100% - 13px) 19px / 6px 6px no-repeat,
    rgba(255, 255, 255, 0.86);
}

.edit-form-body input[type="file"] {
  padding: 10px 12px;
}

.edit-form-body textarea {
  min-height: 240px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}

.edit-form-body input:focus,
.edit-form-body textarea:focus,
.edit-form-body select:focus {
  outline: none;
  border-color: rgba(93, 67, 215, 0.42);
  box-shadow: 0 0 0 3px rgba(93, 67, 215, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.edit-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.weekday-checks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.weekday-checks legend {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: #424657;
  font-size: 13px;
  font-weight: 820;
}

.weekday-checks label {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: #383b4e;
  font-weight: 820;
}

.weekday-checks input {
  width: 14px;
  height: 14px;
  accent-color: var(--violet);
}

.petites-weekday-checks {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.petites-weekday-checks input {
  accent-color: var(--cyan);
}

.setting-checks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 249, 255, 0.74);
}

.setting-checks legend {
  margin-bottom: 2px;
  color: #424657;
  font-size: 13px;
  font-weight: 820;
}

.setting-checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #383b4e;
  font-size: 14px;
  font-weight: 760;
}

.setting-checks input {
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
}

.fixed-time-category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 2px;
  color: #383b4e;
  font-size: 14px;
  font-weight: 760;
}

.fixed-time-category-row select {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid #d1d5e8;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #383b4e;
  accent-color: var(--violet);
}

.modal-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(32, 33, 36, 0.07);
  background: rgba(255, 255, 255, 0.94);
}

.modal-actions .ghost-action,
.modal-actions .wide-action {
  width: auto;
  min-width: 150px;
  padding: 0 18px;
}

.split-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
}

.danger-action {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(226, 72, 92, 0.22);
  border-radius: 8px;
  background: rgba(255, 246, 248, 0.92);
  color: #c83c51;
  cursor: pointer;
  font-weight: 820;
}

.danger-action:hover {
  border-color: rgba(226, 72, 92, 0.34);
  background: rgba(255, 237, 241, 0.96);
}

.holiday-form {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.holiday-form label {
  display: grid;
  gap: 7px;
}

.holiday-form span {
  color: #424657;
  font-size: 13px;
  font-weight: 820;
}

.holiday-form input {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.holiday-form .wide-action {
  width: auto;
  min-width: 110px;
  padding: 0 16px;
}

.syllabus-helper {
  display: grid;
}

.syllabus-helper .ghost-action {
  width: 100%;
  min-height: 48px;
  min-width: 0;
  padding: 0 14px;
  border-color: rgba(93, 67, 215, 0.22);
  background: rgba(93, 67, 215, 0.08);
  color: #4f38cc;
}

.syllabus-preview-head {
  display: grid;
  gap: 6px;
}

.syllabus-preview-head strong {
  color: #181a25;
  font-size: 16px;
}

.syllabus-preview-head span {
  color: #696d7d;
  font-size: 13px;
  line-height: 1.5;
}

.syllabus-preview {
  display: grid;
  gap: 16px;
  max-height: none;
  min-height: 430px;
  overflow: auto;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 249, 255, 0.78);
}

.syllabus-preview:empty {
  display: none;
}

.syllabus-preview-month {
  display: grid;
  gap: 8px;
}

.syllabus-preview-month h3 {
  margin: 0;
  color: #181a25;
  font-size: 15px;
}

.syllabus-preview-weekdays,
.syllabus-preview-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.syllabus-preview-weekdays span {
  display: grid;
  min-height: 28px;
  place-items: center;
  color: #555a6c;
  font-size: 12px;
  font-weight: 820;
}

.syllabus-preview-calendar {
  overflow: hidden;
  border: 1px solid rgba(32, 33, 36, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.syllabus-preview-day {
  min-height: 92px;
  padding: 7px;
  border-right: 1px solid rgba(32, 33, 36, 0.06);
  border-bottom: 1px solid rgba(32, 33, 36, 0.06);
  background: rgba(255, 255, 255, 0.5);
}

.syllabus-preview-day:nth-child(7n) {
  border-right: 0;
}

.syllabus-preview-day.outside {
  background: rgba(248, 249, 255, 0.46);
}

.syllabus-preview-day.outside .syllabus-preview-day-top > span {
  color: #a2a6b4;
}

.syllabus-preview-day.holiday .syllabus-preview-day-top > span,
.syllabus-preview-day:nth-child(7n + 1) .syllabus-preview-day-top > span {
  color: var(--danger);
}

.syllabus-preview-day-top {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 5px;
}

.syllabus-preview-day-top > span {
  color: #303342;
  font-size: 12px;
  font-weight: 820;
}

.syllabus-preview-day-top small {
  overflow: hidden;
  max-width: 64px;
  color: #df5a79;
  font-size: 10px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.syllabus-preview-event,
.syllabus-preview-excluded {
  display: grid;
  gap: 4px;
  padding: 7px;
  border-radius: 7px;
}

.syllabus-preview-event {
  background: rgba(117, 84, 230, 0.12);
  color: #4f38cc;
}

.syllabus-preview-event strong,
.syllabus-preview-event span,
.syllabus-preview-event small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.syllabus-preview-event strong {
  font-size: 11px;
}

.syllabus-preview-event span {
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.syllabus-preview-event small {
  color: #6e61c8;
  font-size: 10px;
  font-weight: 760;
}

.syllabus-preview-event button,
.syllabus-preview-excluded button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(93, 67, 215, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
  color: #4f38cc;
  cursor: pointer;
  font-size: 11px;
  font-weight: 780;
}

.petites-preview-calendar .syllabus-preview-day {
  min-height: 154px;
}

.petite-draft-card {
  display: grid;
  gap: 7px;
  margin-top: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(24, 186, 200, 0.22);
  border-radius: 7px;
  background: rgba(24, 186, 200, 0.09);
  color: #126f79;
}

.petite-draft-card label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.petite-draft-card label span {
  color: #126f79;
  font-size: 10px;
  font-weight: 820;
}

.petite-draft-card input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 0 7px;
  border: 1px solid rgba(24, 186, 200, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #17212a;
  font-size: 11px;
}

.petite-draft-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.petite-draft-card button {
  min-height: 28px;
  border: 1px solid rgba(226, 72, 92, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: #bd4354;
  cursor: pointer;
  font-size: 11px;
  font-weight: 820;
}

.syllabus-preview-excluded {
  border: 1px dashed rgba(237, 95, 155, 0.38);
  background: rgba(237, 95, 155, 0.08);
  color: #df5a79;
  font-size: 11px;
  font-weight: 820;
}

.syllabus-preview-excluded button {
  border-color: rgba(237, 95, 155, 0.25);
  color: #c44769;
}

.holiday-list {
  display: grid;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px 10px;
}

.holiday-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.holiday-row:last-child {
  border-bottom: 0;
}

.holiday-row strong,
.holiday-row time {
  display: block;
}

.holiday-row strong {
  margin-bottom: 5px;
  color: #222533;
  font-size: 15px;
}

.holiday-row time {
  color: var(--muted);
  font-size: 13px;
}

.holiday-row button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(250, 45, 45, 0.16);
  border-radius: 8px;
  background: rgba(250, 45, 45, 0.06);
  color: #bb3a4d;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 820;
}

.bottom-tools {
  display: grid;
  grid-area: tools;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
  margin-top: 0;
  min-width: 0;
}

.tool-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  min-height: 112px;
  min-width: 0;
  align-items: center;
  gap: 18px;
  padding: 22px 30px;
  box-shadow: 0 16px 40px rgba(42, 43, 47, 0.06);
}

.tool-panel > div:first-child {
  min-width: 0;
}

.tool-panel p {
  margin-bottom: 0;
  max-width: 360px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.tool-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(142px, 1fr));
  gap: 8px;
  justify-content: stretch;
  min-width: 0;
}

.tool-actions button {
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  white-space: nowrap;
}

.export-panel {
  grid-template-columns: minmax(160px, 1fr) minmax(0, auto);
}

.export-actions {
  gap: 10px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.export-actions button {
  display: grid;
  width: clamp(52px, 4.8vw, 61px);
  height: clamp(52px, 4.8vw, 61px);
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.64);
  color: #363948;
  font-size: 13px;
}

.export-actions button:first-child span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #2c8cff 0 45%, #34a853 45% 65%, #fbbc04 65% 82%, #ea4335 82%);
  color: #fff;
  font-weight: 900;
}

.export-actions button:nth-child(2) span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(180deg, #f45d52 0 36%, #fff 36%);
  color: #2d3140;
  font-weight: 900;
}

.tiny-icon {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: currentColor;
}

.calendar-symbol {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.calendar-symbol::before {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 4px;
  height: 2px;
  background: currentColor;
  content: "";
}

.list-symbol::before,
.list-symbol::after {
  position: absolute;
  left: 1px;
  width: 13px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
  content: "";
}

.list-symbol::before { top: 2px; }
.list-symbol::after { top: 12px; box-shadow: none; }

.check-symbol {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.check-symbol::before {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 7px;
  height: 4px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  content: "";
  transform: rotate(-45deg);
}

.gear-symbol {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.gear-symbol::before {
  position: absolute;
  inset: 4px;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.open-symbol {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.open-symbol::before {
  position: absolute;
  right: -2px;
  top: 2px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
}

@media (max-width: 1350px) {
  .shell { width: min(100% - 36px, var(--max)); }

  .nav {
    grid-template-columns: 210px minmax(0, 1fr) auto;
  }

  .calendar-app {
    grid-template-columns: 330px minmax(0, 1fr);
    grid-template-areas:
      "left board"
      "left detail"
      "tools tools";
  }

  .detail-panel {
    padding-top: 24px;
  }
}

@media (max-width: 980px) {
  .nav {
    grid-template-columns: 1fr;
    padding: 14px 0;
  }

  .nav-center,
  .nav-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .calendar-app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "board"
      "detail"
      "tools";
  }

  .left-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tip-card {
    order: -1;
  }

  .calendar-header,
  .tool-panel {
    align-items: flex-start;
  }

  .tool-panel {
    grid-template-columns: 1fr;
  }

  .bottom-tools {
    grid-template-columns: 1fr;
  }

  .export-actions {
    padding-left: 0;
    border-left: 0;
  }

  .tool-actions,
  .export-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, var(--max)); }

  .nav-button,
  .report-chip {
    min-height: 40px;
    padding: 0 13px;
    font-size: 13px;
  }

  .left-rail {
    grid-template-columns: 1fr;
  }

  .calendar-board {
    padding: 16px 14px;
    overflow-x: auto;
  }

  .calendar-grid {
    min-width: 720px;
  }

  .calendar-grid.week-view {
    min-width: 720px;
  }

  .day-cell {
    min-height: 104px;
  }

  .calendar-grid.week-view .day-cell {
    min-height: 240px;
  }

  .legend {
    flex-wrap: wrap;
  }

  .tool-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .tool-actions button {
    width: 100%;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .schedule-row button {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .schedule-row time {
    text-align: left;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .syllabus-body {
    grid-template-columns: 1fr;
  }

  .syllabus-preview-pane {
    padding-left: 0;
    border-left: 0;
  }

  .syllabus-preview {
    min-height: 320px;
  }

  .weekday-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .ghost-action,
  .modal-actions .wide-action {
    width: 100%;
  }

  .split-actions {
    grid-template-columns: 1fr;
  }

  .split-actions span {
    display: none;
  }

  .danger-action {
    width: 100%;
  }

  .syllabus-helper {
    align-items: stretch;
  }

  .syllabus-helper .ghost-action {
    width: 100%;
  }

  .syllabus-preview-row {
    grid-template-columns: 1fr;
  }

  .holiday-form {
    grid-template-columns: 1fr;
  }

  .holiday-form .wide-action {
    width: 100%;
  }
}
