/* Calendar proposal: small visual month + contextual day panel. */
.calendar-view { min-height: 0; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); gap: 16px; align-items: start; }
.calendar-month-pane, .calendar-side-pane { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 19px; background: #fffdf8; box-shadow: 0 8px 28px rgba(23,40,45,.045); }
.calendar-toolbar { grid-template-columns: 42px minmax(0,1fr) 42px; gap: 8px; margin-bottom: 17px; }
.calendar-toolbar h3 { font-family: var(--heading); font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 800; text-align: left; }
.calendar-nav { display: grid; place-items: center; width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 12px; background: #f5f0e5; font-size: 1.7rem; font-weight: 400; line-height: 1; }
.calendar-nav:hover { background: #e7ebd5; }
.calendar-weekdays { margin-bottom: 6px; padding: 0; font-size: .68rem; }
.calendar-grid { gap: 5px; overflow: visible; border: 0; background: transparent; border-radius: 0; }
.calendar-cell { min-height: 88px; gap: 3px; padding: 7px; border: 1px solid #e6e1d8; border-radius: 10px; background: #fff; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.calendar-cell:hover { transform: translateY(-2px); border-color: #8d9998; background: #f7faf8; }
.calendar-cell.selected { background: #e7f0ce; border-color: #1a3239; box-shadow: inset 0 0 0 1px #1a3239; }
.calendar-cell.outside { opacity: .55; background: #f6f4ee; }
.calendar-cell:focus-visible, .calendar-day-preview-trigger:focus-visible, .calendar-detail-link:focus-visible { outline: 3px solid #eb9d45; outline-offset: 2px; }
.calendar-day-number { width: 23px; height: 23px; font-size: .8rem; }
.calendar-cell-visual { display: block; width: min(100%, 78px); height: 37px; overflow: hidden; border-radius: 5px; background: #dce4e2; }
.calendar-cell-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.calendar-cell-footer { display: flex; align-items: center; justify-content: space-between; gap: 2px; width: 100%; min-height: 10px; margin-top: auto; }
.calendar-dots { margin: 0; gap: 2px; }
.calendar-dots i { width: 6px; height: 6px; }
.calendar-event-count, .calendar-cell .calendar-event-count { display: block; margin: 0; font-size: .68rem; line-height: 1; font-weight: 800; }
#calendar-legend { display: flex; flex-wrap: wrap; gap: 7px 13px; margin: 14px 0 0; font-size: .7rem; }
.calendar-side-pane { position: sticky; top: 12px; padding: 0; overflow: hidden; }
.calendar-day-events { margin: 0; padding: 18px; border: 0; border-radius: 0; background: transparent; }
.calendar-day-heading { margin: 0 0 12px; }
.calendar-day-heading h3 { font-family: var(--heading); font-size: 1.22rem; font-weight: 800; line-height: 1.15; }
.calendar-day-heading span { display: block; margin-top: 4px; font-size: .74rem; font-weight: 600; }
.calendar-day-save { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; margin: -5px -5px 0 0; padding: 0; border: 0; border-radius: 11px; color: #1c343a; background: transparent; cursor: pointer; }
.calendar-day-save:hover { background: #e8efdc; }
.calendar-day-save:disabled { opacity: .36; cursor: not-allowed; }
.calendar-day-save:focus-visible { outline: 3px solid #eb9d45; outline-offset: 2px; }
.calendar-day-save svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.calendar-day-categories { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 15px; }
.calendar-category-count { display: inline-flex; align-items: center; gap: 4px; min-height: 29px; padding: 4px 8px; border-radius: 9px; background: var(--category-color); color: #182e33; font-size: .68rem; font-weight: 700; }
.calendar-category-count b { font-size: .8rem; }
.calendar-category-count .category-icon { width: 16px; height: 16px; }
.calendar-day-list { display: grid; gap: 7px; }
.calendar-day-card { overflow: hidden; border: 1px solid #e7e3d9; border-radius: 12px; background: white; }
.calendar-day-card.expanded { border-color: #72837d; }
.calendar-day-preview-trigger { display: grid; grid-template-columns: 62px minmax(0,1fr) 15px; gap: 10px; align-items: center; width: 100%; min-height: 76px; padding: 6px 9px 6px 6px; border: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.calendar-day-preview-trigger:hover { background: #f9faf7; }
.calendar-day-thumb { display: grid; place-items: center; width: 62px; height: 64px; overflow: hidden; border-radius: 7px; background: var(--category-color); }
.calendar-day-thumb img { width: 100%; height: 100%; object-fit: cover; }
.calendar-day-placeholder .category-icon { width: 29px; height: 29px; }
.calendar-day-copy { display: grid; gap: 3px; min-width: 0; }
.calendar-day-copy strong { font-size: .81rem; line-height: 1.2; }
.calendar-day-copy small { overflow: hidden; color: #607074; font-size: .68rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.calendar-day-copy em { display: inline-flex; align-items: center; gap: 3px; justify-self: start; padding: 2px 5px; border-radius: 5px; background: var(--category-color); font-size: .61rem; font-style: normal; font-weight: 750; }
.calendar-day-copy em .category-icon { width: 13px; height: 13px; }
.calendar-card-chevron { align-self: start; font-size: 1.25rem; line-height: 1; }
.calendar-day-expanded { padding: 0 12px 12px 78px; }
.calendar-day-expanded[hidden] { display: none; }
.calendar-day-expanded p { margin: 2px 0 9px; color: #57696e; font-size: .75rem; }
.calendar-detail-link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 11px; border-radius: 8px; background: #1c343a; color: white; font-size: .72rem; font-weight: 750; text-decoration: none; }
.calendar-batch-row { display: none !important; }

@media (max-width: 1040px) {
  .calendar-layout { grid-template-columns: minmax(0,1fr) minmax(285px,.8fr); gap: 12px; }
  .calendar-month-pane { padding: 14px; }
  .calendar-cell { min-height: 73px; padding: 5px; }
  .calendar-cell-visual { height: 27px; }
}
@media (max-width: 760px) {
  .calendar-layout { display: block; }
  .calendar-month-pane { padding: 12px; border-radius: 15px 15px 0 0; }
  .calendar-side-pane { position: static; margin-top: -1px; border-radius: 0 0 15px 15px; }
  .calendar-toolbar { grid-template-columns: 38px minmax(0,1fr) 38px; margin-bottom: 9px; }
  .calendar-toolbar h3 { grid-column: 2; grid-row: 1; font-size: 1.04rem; text-align: center; }
  .calendar-nav { width: 38px; height: 38px; min-height: 38px; }
  .calendar-nav:first-child { grid-column: 1; grid-row: 1; }
  .calendar-nav:last-child { grid-column: 3; grid-row: 1; }
  .calendar-weekdays { font-size: .62rem; }
  .calendar-grid { gap: 2px; }
  .calendar-cell { align-items: center; min-height: 43px; padding: 2px; border: 0; border-radius: 7px; }
  .calendar-cell.selected { color: white; background: #1c343a; box-shadow: none; }
  .calendar-cell.outside { background: transparent; }
  .calendar-day-number { width: 22px; height: 22px; font-size: .7rem; }
  .calendar-cell.today .calendar-day-number { color: #1c343a; }
  .calendar-cell-visual, .calendar-event-count { display: none !important; }
  .calendar-cell-footer { justify-content: center; min-height: 7px; }
  .calendar-dots i { width: 4px; height: 4px; }
  #calendar-legend { display: none; }
  .calendar-day-events { padding: 16px 12px 8px; }
  .calendar-day-heading h3 { font-size: 1.02rem; }
  .calendar-day-preview-trigger { grid-template-columns: 58px minmax(0,1fr) 14px; min-height: 69px; }
  .calendar-day-thumb { width: 58px; height: 57px; }
  .calendar-day-expanded { padding-left: 74px; }
  .calendar-day-save { margin: -5px -3px 0 0; }
}
@media (max-width: 350px) {
  .calendar-month-pane { padding: 7px; }
  .calendar-cell { min-height: 39px; }
  .calendar-category-count { font-size: .61rem; }
}
@media (prefers-reduced-motion: reduce) {
  .calendar-cell { transition: none; }
}
