.calendar {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: 22px 18px;
  background: var(--surface);
  border: 2px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cal-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-header h2 { margin: 0; font-size: 1.2rem; text-align: center; }

.cal-nav {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--pink-soft);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}
.cal-nav:focus-visible, .cal-cell:focus-visible, .cal-today:focus-visible {
  outline: 3px dashed var(--pink);
  outline-offset: 2px;
}

.cal-today {
  display: block;
  margin: 6px auto 0;
  padding: 2px 12px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--heart);
  background: transparent;
  cursor: pointer;
}

.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays { margin-top: 12px; }
.cal-weekdays span { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--text-soft); }
.cal-grid { margin-top: 6px; }

.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  aspect-ratio: 1;
  min-width: 0;
  padding: 4px 0 0;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}
.cal-cell.is-out { opacity: 0.4; }
.cal-cell.is-anni { background: #ffe4ee; }
.cal-cell.is-today .cal-num {
  color: #fff;
  background: var(--heart);
  border-radius: 999px;
  padding: 0 6px;
}
.cal-cell.is-selected { border-color: var(--heart); }
.cal-num { font-size: 0.9rem; font-weight: 700; line-height: 1.4; }
.cal-markers { font-size: 0.65rem; line-height: 1; letter-spacing: -1px; white-space: nowrap; }

.cal-day { margin-top: 16px; }
.cal-day-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cal-day-header h3 { margin: 0; font-size: 1rem; }
.cal-day-header .btn { padding: 6px 14px; font-size: 0.85rem; }

.cal-events { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.cal-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  border-left: 4px solid var(--type-color);
}
.cal-event > div { flex: 1; min-width: 0; }
.cal-event strong { display: block; overflow-wrap: anywhere; }
.cal-event p { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-soft); overflow-wrap: anywhere; }
.cal-event-icon { font-size: 1.3rem; line-height: 1.2; }
.cal-event-meta { font-size: 0.8rem; color: var(--text-soft); }
.cal-edit { padding: 4px 12px; font-size: 0.8rem; }

.cal-note { margin: 10px 0 0; font-size: 0.9rem; color: var(--text-soft); text-align: center; }
.cal-note[hidden] { display: none; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row[hidden] { display: none; }
.sheet-body select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--pink-soft);
  border-radius: 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.sheet-body label.check { display: flex; align-items: center; gap: 8px; }
.sheet-body label.check input { width: auto; accent-color: var(--heart); }
.sheet-actions .spacer { flex: 1; }
.sheet-actions .btn[hidden] { display: none; }

.calendar[hidden] { display: none; }

.cal-photos {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.cal-photos:empty { display: none; }
.cal-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--cream);
  cursor: zoom-in;
}
.cal-photo img { width: 100%; height: 100%; object-fit: cover; }
.cal-photo:focus-visible { outline: 3px dashed var(--heart); outline-offset: 2px; }
