.view-switch { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: #24211e; }
.view-switch button { color: var(--muted); background: transparent; min-height: 34px; padding: 7px 12px; font-size: 12px; border-radius: 7px; }
.view-switch button[aria-pressed=true] { color: #f5f2ef; background: #4e4740; }
.shooting-date-button, .workflow-edit { padding: 3px 0; min-height: 24px; border: 0; background: transparent; text-align: left; color: #e3dcd3; font-size: 12px; font-weight: 500; justify-self: start; }
.workflow-edit { color: var(--muted); font-size: 11px; }
.stage-scheduled { background: #423c36; color: #e7e1da; }
.stage-retouch { background: #453f38; color: #efcdfa; }
.stage-complete { background: #453f39; color: #f2efeb; }
.planning-strip { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: -12px; }
.planning-strip button { background: transparent; color: var(--muted); font-size: 12px; font-weight: 400; padding: 2px 0; min-height: 26px; }
.planning-strip button:hover { color: var(--accent); }
.shooting-calendar { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 22px; }
.calendar-toolbar h2 { margin: 0; font-size: 21px; text-transform: capitalize; }
.calendar-toolbar p { margin: 5px 0 0; font-size: 12px; }
.calendar-toolbar button { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.calendar-month-picker { font-size: 11px; gap: 2px; }
.calendar-month-picker input { min-height: 36px; max-width: 170px; padding: 5px 10px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { background: #302c28; border-top: 1px solid var(--line); color: #d7ccc0; font-size: 12px; text-align: center; padding: 10px 0; }
.calendar-day { min-width: 0; min-height: 120px; padding: 7px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #201e1b; }
.calendar-day.outside .calendar-date { color: #b8ab9c; }
.calendar-day.today { background: #38332e; box-shadow: inset 0 2px #ddd5cb; }
.calendar-date { display: flex; justify-content: space-between; width: 100%; min-height: 25px; padding: 2px 3px; background: transparent; color: var(--text); font-size: 12px; }
.calendar-date span { color: #cabcab; }

.calendar-event { display: grid; gap: 3px; text-align: left; width: 100%; min-height: 0; padding: 7px; margin-top: 5px; border-radius: 6px; background: #4a433c; color: #f4f1ed; border: 1px solid #655d53; }
.calendar-event strong { font-size: 12px; font-weight: 550; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.calendar-event span, .calendar-event small { font-size: 10px; color: #e4ddd5; font-weight: 400; }
.calendar-event.has-conflict { background: #44343a; border-color: #956772; }
.calendar-event.has-conflict span { color: #ffd0d0; }
.calendar-agenda { display: none; padding: 18px; border-top: 1px solid var(--line); }
.calendar-agenda h3, .unscheduled h3 { font-size: 15px; margin: 0 0 10px; }
.agenda-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 10px; margin: 10px 0; }
.agenda-row > span { font-size: 12px; color: var(--muted); }
.unscheduled { padding: 22px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.unscheduled p { margin: 0; font-size: 12px; }
.unscheduled-project { display: flex; gap: 16px; align-items: center; justify-content: space-between; text-align: left; padding: 13px 15px; background: #322d28; color: var(--text); border: 1px solid #4e4740; font-size: 12px; }
.unscheduled-project strong { font-size: 13px; }
.unscheduled-project small { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; }
.unscheduled-project > span:last-child { color: #e5ded7; flex-shrink: 0; }
.schedule-conflict:empty, #scheduleError:empty, #createProjectError:empty { display: none; }
.schedule-conflict:not(:empty) { background: #44343a; color: #ffd0d0; padding: 12px; border: 1px solid #956772; border-radius: 9px; font-size: 13px; }
@media (max-width: 1100px) {
  .calendar-day { padding: 4px; min-height: 100px; }
  .calendar-event { padding: 5px; }
  .calendar-agenda { display: block; }
}
@media (max-width: 600px) {
  .calendar-toolbar, .unscheduled { padding: 16px; }
  .calendar-day { min-height: 65px; }
  .calendar-grid .calendar-event { min-height: 9px; height: 9px; padding: 0; background: #ddd5cb; border: 0; }
  .calendar-grid .calendar-event.has-conflict { background: #ffb3ba; }
  .calendar-grid .calendar-event > * { display: none; }
  .calendar-date { padding: 1px; min-height: 23px; font-size: 11px; }
  .calendar-date span { display: none; }
  .calendar-toolbar .toolbar { gap: 6px; }
  .calendar-month-picker { width: 100%; }
  .calendar-month-picker input { max-width: none; width: 100%; }
  .unscheduled-project { flex-wrap: wrap; gap: 8px; }
}

/* Existing projects are scheduled here; creation stays on the projects page. */
.shooting-calendar { display: flex; flex-direction: column; }
.calendar-toolbar { order: 0; }
.unscheduled { order: 1; }
.calendar-weekdays { order: 2; }
.calendar-grid { order: 3; }
.calendar-agenda { order: 4; }
.unscheduled-project { cursor: grab; touch-action: none; user-select: none; }
.unscheduled-project.is-dragging { opacity: .55; cursor: grabbing; }
.calendar-day.is-drop-target { background: #463b30; box-shadow: inset 0 0 0 2px var(--accent); }

/* Keep the waiting list beside the calendar on wide screens. */
.calendar-event { touch-action: none; user-select: none; cursor: grab; }
.calendar-event.is-dragging { opacity: .5; cursor: grabbing; }
@media (min-width: 1101px) {
  .shooting-calendar { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
  .calendar-toolbar { grid-column: 1 / -1; grid-row: 1; }
  .unscheduled { grid-column: 1; grid-row: 2 / 4; padding: 18px; max-height: 760px; overflow-y: auto; border-right: 1px solid var(--line); }
  .unscheduled-project { flex-wrap: wrap; gap: 8px; }
  .calendar-weekdays { grid-column: 2; grid-row: 2; }
  .calendar-grid { grid-column: 2; grid-row: 3; }
  .calendar-agenda { grid-column: 1 / -1; }
}

.calendar-subscription { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; }
.calendar-subscription h2 { margin: 0; }
.calendar-subscription [data-subscription-content] { display: grid; gap: 14px; min-width: 0; }
.calendar-subscription input { width: 100%; min-width: 0; font-size: 12px; }
.calendar-subscribe-link { display: inline-flex; align-items: center; min-height: 42px; padding: 10px 14px; border-radius: 10px; background: var(--accent-2); color: var(--text); border: 1px solid var(--line); text-decoration: none; }
.calendar-subscribe-link:hover { background: #4e4740; }

.schedule-editor { display: grid; gap: 16px; }
.schedule-editor [hidden] { display: none !important; }
.hold-range { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 40px; gap: 10px; align-items: end; margin-bottom: 12px; }
.hold-range input { min-width: 0; width: 100%; }
.hold-range button { padding: 8px; }
.calendar-event.is-tentative { border: 1px dashed #bb9e71; background: #393128; cursor: pointer; touch-action: auto; }
.calendar-event.is-tentative > span { color: #e4c99e; }
.calendar-day.has-hold { background: #2c2823; box-shadow: inset 0 3px #a58b64; }
