.calendar-page { width: min(calc(100% - 48px), 1240px); }
.calendar-header { margin: 0 10px 30px; }
.calendar-header h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -.05em; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 22px; align-items: start; }
.calendar-panel, .schedule-panel { border: 1px solid #e4e4e9; border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 4px 16px rgba(34,31,49,.08); }
.calendar-panel { padding: 24px; }
.calendar-toolbar { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 16px; margin-bottom: 22px; }
.calendar-toolbar h2 { margin: 0; text-align: center; font-size: 1.55rem; }
.calendar-toolbar button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); background: #fff; cursor: pointer; font-size: 1.25rem; font-weight: 900; }
.calendar-toolbar button:hover { border-color: var(--accent); background: var(--soft); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday-row { margin-bottom: 8px; color: var(--muted); text-align: center; font-size: .8rem; font-weight: 800; }
.weekday-row span:first-child { color: #dc4960; }
.weekday-row span:last-child { color: #477ac7; }
.calendar-grid { overflow: hidden; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 10px; }
.calendar-day { display: flex; flex-direction: column; gap: 5px; min-width: 0; min-height: 104px; padding: 9px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); background: #fff; text-align: left; cursor: pointer; }
.calendar-day:hover { background: #faf7ff; }
.calendar-day.is-outside { color: #aaa7b0; background: #f8f8fa; }
.calendar-day.is-selected { position: relative; z-index: 1; box-shadow: inset 0 0 0 3px var(--accent); background: #f7f2ff; }
.calendar-day.is-today .day-number { color: white; background: var(--accent); }
.day-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .9rem; font-weight: 900; }
.day-schedule { max-width: 100%; overflow: hidden; padding: 4px 6px; border-radius: 5px; color: #4d2497; background: #ece3ff; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; font-weight: 800; }
.day-more { color: var(--muted); font-size: .7rem; }
.schedule-panel { position: sticky; top: 20px; padding: 26px; }
.selected-date-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.selected-date-heading p { margin: 0 0 8px; color: var(--accent); font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.selected-date-heading h2 { margin: 0; font-size: 1.35rem; }
.schedule-form { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.schedule-form small { color: var(--muted); font-size: .82rem; font-weight: 500; }
.schedule-time-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; }
.schedule-time-range > span { padding-bottom: 18px; color: var(--muted); font-weight: 900; }
.schedule-form .primary-button { width: 100%; }
.day-schedule-list { padding-top: 22px; }
.day-schedule-list h3 { margin: 0 0 14px; font-size: 1rem; }
.day-schedule-list ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.day-schedule-list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "marker time title delete"; align-items: center; gap: 10px; padding: 12px; border-radius: 9px; background: #f7f4fc; }
.day-schedule-list li span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.day-schedule-list li > span { grid-area: marker; }
.schedule-time { grid-area: time; color: var(--accent); font-size: .82rem; font-weight: 900; }
.schedule-time.is-empty { color: var(--muted); font-weight: 600; }
.day-schedule-list li strong { grid-area: title; min-width: 0; overflow-wrap: anywhere; }
.schedule-delete { grid-area: delete; display: grid; place-items: center; justify-self: end; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 1px solid #efb0b7; border-radius: 50%; color: #c83d4b; background: #fff; cursor: pointer; }
.schedule-delete svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.schedule-delete:hover { border-color: #d95764; background: #fff3f4; }
.schedule-empty { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .schedule-panel { position: static; }
}

@media (max-width: 620px) {
  .calendar-page { width: 100%; padding: max(16px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .calendar-page .back-to-hub { margin: 0 4px 20px; }
  .calendar-header { margin: 0 4px 24px; }
  .calendar-header h1 { font-size: 2.25rem; }
  .calendar-layout { gap: 16px; }
  .calendar-panel { padding: 15px 7px; border-radius: 14px; }
  .calendar-toolbar { grid-template-columns: 42px 1fr 42px; gap: 8px; margin-bottom: 16px; }
  .calendar-toolbar h2 { font-size: 1.25rem; }
  .calendar-toolbar button { width: 42px; height: 42px; }
  .calendar-day { min-height: 76px; padding: 5px 3px; }
  .day-number { width: 26px; height: 26px; margin-inline: auto; }
  .day-schedule { width: 100%; padding: 3px; font-size: .62rem; }
  .schedule-panel { padding: 20px 16px; border-radius: 14px; }
  .schedule-form { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .schedule-form > .field { min-width: 0; }
  .schedule-time-range { grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 14px; padding: 16px; border-radius: 12px; background: #f7f4fc; }
  .schedule-time-range > .field { min-width: 0; }
  .schedule-time-range > span { display: none; }
  .schedule-time-range input[type="time"] { display: block; width: 100%; min-width: 0; max-width: 100%; inline-size: -webkit-fill-available; min-inline-size: 0; max-inline-size: 100%; }
  .day-schedule-list li { grid-template-columns: auto auto minmax(0, 1fr) 32px; gap: 8px; }
}
