/* Mobile editor reaches the viewport edge. Safe-area space scrolls with the
   fields rather than forming an opaque footer over the end of the note. */
@media (max-width: 767px) {
  .calendar-event-form.ios-reference-event-form {
    height: calc(100dvh - max(env(safe-area-inset-top),24px));
    max-height: calc(100dvh - max(env(safe-area-inset-top),24px));
    padding-bottom: 0;
  }
  .ios-reference-event-form .ios-reference-event-fields {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Desktop dialogs use the available height while keeping the actions fixed. */
@media (min-width: 1024px) {
  html body #sheetRoot .sheet-backdrop > .sheet.calendar-event-form.ios-reference-event-form {
    overflow: clip;
    height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
  }
}

/* Keep the saved tag visible between the time and the event text in every layout. */
html body #app .calendar-event > .accent-line {
  display: block;
  width: 3px;
  min-height: 38px;
  height: auto;
  align-self: stretch;
  border-radius: 4px;
}

/* One date-wheel geometry for calendar events and calculator period fields. */
html body .ios-date-wheel-backdrop .ios-date-wheel.ios-event-date-wheel:not(.ios-calendar-month-wheel) {
  padding: 6px 14px calc(14px + env(safe-area-inset-bottom));
  border-radius: 22px;
}
html body .ios-date-wheel-backdrop .ios-event-date-wheel header { min-height: 46px; }
html body .ios-date-wheel-backdrop .ios-event-date-wheel header strong { font-size: calc(15px * var(--ui-font-scale, 1)); }
html body .ios-date-wheel-backdrop .ios-event-date-wheel header button { font-size: calc(14px * var(--ui-font-scale, 1)); }
html body .ios-date-wheel-backdrop .ios-event-date-wheel .ios-date-wheel-columns { height: 248px; }
html body .ios-date-wheel-backdrop .ios-event-date-wheel .ios-date-wheel-column { height: 248px; padding-top: 100px; padding-bottom: 100px; }
html body .ios-date-wheel-backdrop .ios-event-date-wheel .ios-date-wheel-selection { top: 100px; height: 48px; }
html body .ios-date-wheel-backdrop .ios-event-date-wheel .ios-date-wheel-option { height: 48px; line-height: 48px; font-size: clamp(calc(16px * var(--ui-font-scale, 1)),calc(4.6vw * var(--ui-font-scale, 1)),calc(18px * var(--ui-font-scale, 1))); }
html body .ios-date-wheel-backdrop .ios-event-date-wheel .ios-date-wheel-option.selected { font-size: clamp(calc(20px * var(--ui-font-scale, 1)),calc(5.8vw * var(--ui-font-scale, 1)),calc(23px * var(--ui-font-scale, 1))); }
