/* v8.18 — iPhone edit sheet containment & quiet diary-book calendar colors.
   Preserve the existing functionality, data model and Notion synchronization. */

/* Safari native date/time controls have large intrinsic widths; minmax(0,1fr)
   and explicitly shrinkable children prevent them from pushing the sheet wide. */
#modalLayer.modal-layer {
  inset:0!important;
  width:100%!important;
  max-width:100vw!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  padding:0!important;
  overscroll-behavior:contain!important;
}
#modalLayer .modal-card {
  box-sizing:border-box!important;
  width:100%!important;
  max-width:min(590px,100vw)!important;
  min-width:0!important;
  max-height:calc(100dvh - env(safe-area-inset-top,0px) - 10px)!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  padding:22px 18px calc(16px + env(safe-area-inset-bottom,0px))!important;
  border-radius:16px 16px 0 0!important;
  background:var(--folio-page,#faf9f7)!important;
  color:#35332f!important;
}
#modalLayer .modal-header,#modalLayer .modal-description,
#modalLayer #entryForm,#modalLayer #entryTimeRow,
#modalLayer .field,#modalLayer .modal-actions {
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
}
#modalLayer .modal-description {overflow-wrap:anywhere!important;color:#88847e!important;}
#modalLayer .field-row {
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  column-gap:10px!important;
  min-width:0!important;
  width:100%!important;
}
#modalLayer .field-row>.field {min-width:0!important;width:100%!important;}
#modalLayer input:not([type=checkbox]),
#modalLayer select,#modalLayer textarea {
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  font-size:16px!important; /* prevent Safari automatic focus zoom */
  line-height:1.3!important;
  background:#fffefd!important;
  color:#343330!important;
  border:1px solid #c9c5be!important;
  border-radius:5px!important;
}
#modalLayer input[type=date],#modalLayer input[type=time] {
  min-width:0!important;
  width:100%!important;
  min-height:43px!important;
  padding:8px 7px!important;
  font-variant-numeric:tabular-nums!important;
}
#modalLayer .field-footnote {color:#85817b!important;overflow-wrap:anywhere!important;}
#modalLayer .modal-actions {flex-wrap:wrap!important;justify-content:flex-end!important;gap:7px!important;}
#modalLayer .modal-actions .soft-btn {max-width:100%!important;min-width:0!important;white-space:normal!important;}
@media (max-width:380px) {
  #modalLayer .field-row {grid-template-columns:minmax(0,1fr)!important;row-gap:0!important;}
  #modalLayer .modal-card {padding-left:14px!important;padding-right:14px!important;}
}

/* Restrained, low-saturation paper inks. Distinguish calendars by a thin edge,
   not saturated card fills; preserve Events vs outlined Items distinction. */
:root {
  --event-ink:#44413b;
  --event-caption:#78746d;
}
.time-block.event-card,.all-day-item.event-card {
  background:#efeee9!important;
  color:var(--event-ink)!important;
  border:1px solid #dbd8d0!important;
  border-left:4px solid #a49d90!important;
  box-shadow:none!important;
}
.time-block.event-card .item-type,
.all-day-item.event-card .item-type {
  color:var(--event-caption)!important;
  opacity:1!important;
}
.time-block.event-card .block-title,
.all-day-item.event-card .all-text {color:var(--event-ink)!important;}
.time-block.event-card .block-time {color:#817d76!important;}
/* default calendar — stone gray */
.time-block.event-card.calendar-primary,.all-day-item.event-card.calendar-primary {
  background:#eeefed!important;border-color:#d7d9d5!important;border-left-color:#929b96!important;
}
/* 일정 — warm taupe */
.time-block.event-card.calendar-schedule,.all-day-item.event-card.calendar-schedule {
  background:#f0ede8!important;border-color:#ddd8d0!important;border-left-color:#a69a8b!important;
}
/* 여행 — quiet sand */
.time-block.event-card.calendar-travel,.all-day-item.event-card.calendar-travel {
  background:#f1eee6!important;border-color:#dfd9cc!important;border-left-color:#b5a48b!important;
}
/* 수면 — dusted slate-lilac */
.time-block.event-card.calendar-sleep,.all-day-item.event-card.calendar-sleep {
  background:#efedf0!important;border-color:#dcd9df!important;border-left-color:#a69eac!important;
}
/* Monthly entries use the same palette: don't reintroduce mint there. */
.month-entry {background:#f0ede8!important;color:#555149!important;border-radius:2px!important;
  border-left:2px solid #a69a8b!important;}
.month-entry.calendar-primary {background:#eeefed!important;border-left-color:#929b96!important;}
.month-entry.calendar-schedule {background:#f0ede8!important;border-left-color:#a69a8b!important;}
.month-entry.calendar-travel {background:#f1eee6!important;border-left-color:#b5a48b!important;}
.month-entry.calendar-sleep {background:#efedf0!important;border-left-color:#a69eac!important;}
