/* A shared, quieter rhythm for time entries and the white reminder list. */
#recordDialog {
  --entry-label: 13px;
  --entry-body: 14px;
  --entry-meta: 12px;
  --entry-line: #e9edea;
  --entry-fill: #f4f6f4;
  width: 500px;
  padding: 24px 28px;
  color: var(--ink);
  scroll-padding-block: 20px 92px;
}
#recordDialog .dialog-header { gap: 10px; margin-bottom: 16px; }
#recordDialog .dialog-header h2 { font-size: 20px; font-weight: 600; line-height: 1.4; }
#recordDialog .dialog-close,
#recordDialog #reminderBackButton { width: 40px; height: 40px; min-width: 40px; min-height: 40px; flex-basis: 40px; }
#recordDialog #newReminderButton { height: 40px; min-height: 40px; padding-inline: 12px; font-size: 13px; border-radius: 11px; }
#recordDialog .composer-tabs { margin-bottom: 20px; padding: 3px; background: #f1f3f1; }
#recordDialog .composer-tab { min-height: 40px; font-size: var(--entry-body); font-weight: 500; }
#recordDialog .field { gap: 4px; margin-bottom: 18px; }
#recordDialog .field > span,
#recordDialog :is(.duration-fields, .period-picker) legend {
  color: var(--reminder-secondary);
  font-size: var(--entry-label);
  font-weight: 450;
  line-height: 1.5;
}
#recordDialog .field :is(input, select, textarea) { min-height: 44px; font-size: 16px; border-color: #dce3de; }
#recordDialog .field :is(input, select, textarea):focus { border-color: var(--accent); }

/* Date and the existing total read as one context, above the adjustment. */
#recordDialog .record-date-context { margin-bottom: 18px; }
#recordDialog .record-date-field { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; margin: 0; border-bottom: 1px solid var(--entry-line); }
#recordDialog .record-date-field > span { flex: 0 0 auto; }
#recordDialog .record-date-field input { flex: 0 1 188px; width: 188px; border-bottom: 0; text-align: right; }
#recordDialog .record-date-field input::-webkit-date-and-time-value { text-align: right; }
#recordDialog .record-date-field input::-webkit-calendar-picker-indicator { margin-left: 8px; }
#recordDialog .record-current-total { min-height: 40px; gap: 12px; margin: 0; padding: 8px 0 0; font-size: var(--entry-meta); }
#recordDialog .record-current-total strong { font-size: var(--entry-body); font-weight: 550; line-height: 1.5; text-align: right; }
#recordDialog .adjustment-toggle { gap: 3px; margin: 0 0 18px; padding: 3px; border: 0; border-radius: 10px; background: var(--entry-fill); }
#recordDialog .adjustment-button { min-height: 40px; font-size: var(--entry-label); font-weight: 500; border-radius: 8px; }
#recordDialog .adjustment-button.is-active { border-color: transparent; box-shadow: 0 1px 4px #192c2312; }
#recordDialog .duration-fields { gap: 10px; margin: 0 0 10px; }
#recordDialog .duration-fields legend { margin-bottom: 8px; }
#recordDialog .duration-fields input { height: 56px; padding-left: 14px; border: 1px solid transparent; border-radius: 10px; background: var(--entry-fill); font-size: 24px; font-weight: 550; }
#recordDialog .duration-fields input:focus { border-color: var(--accent); background: #fff; }
#recordDialog .duration-fields label span { font-size: var(--entry-meta); }
#recordDialog .duration-separator { height: 56px; line-height: 56px; font-size: 20px; }
#recordDialog .duration-presets { gap: 8px; margin-bottom: 18px; }
#recordDialog .duration-presets button,
#recordDialog .reminder-date-shortcuts button { min-height: 40px; border: 1px solid transparent; font-size: var(--entry-label); font-weight: 450; background: var(--entry-fill); }
#recordDialog .duration-presets button[aria-pressed="true"],
#recordDialog .reminder-date-shortcuts button[aria-pressed="true"] { color: var(--accent-hover); border-color: color-mix(in srgb, var(--accent) 22%, white); background: var(--accent-soft); font-weight: 550; }

/* Optional fields share the same disclosure and summary treatment. */
#recordDialog :is(.record-details, .reminder-details) { margin: 0; padding: 0; border-color: var(--entry-line); }
#recordDialog :is(.record-details, .reminder-details) > summary { gap: 10px; min-height: 48px; margin-bottom: 0; font-size: var(--entry-body); font-weight: 450; }
#recordDialog :is(.record-details, .reminder-details) > summary > span:first-child { flex-shrink: 0; }
#recordDialog :is(#recordDetailsSummary, #reminderDetailsSummary) { flex: 1; min-width: 0; max-width: none; font-size: var(--entry-meta); color: var(--reminder-secondary); font-weight: 400; line-height: 1.5; text-align: right; overflow-wrap: anywhere; }
#recordDialog .record-details > summary::after { flex: 0 0 6px; margin-left: 2px; margin-right: 5px; }
#recordDialog .record-details[open] > summary { margin-bottom: 8px; }
#recordDialog .record-start-toggle { min-height: 44px; gap: 10px; font-size: var(--entry-body); font-weight: 450; }
#recordDialog .record-start-toggle input { width: 18px; height: 18px; }
#recordDialog .period-picker { margin-top: 14px; }
#recordDialog .period-options { margin-top: 7px; border: 0; background: var(--entry-fill); }
#recordDialog .period-option { min-height: 40px; font-size: var(--entry-label); font-weight: 500; }
#recordDialog .period-option.is-active { border-color: transparent; box-shadow: 0 1px 4px #192c2312; }
#recordDialog .record-note-field { margin-top: 18px; margin-bottom: 6px; }

/* Keep scheduling and notifications together before optional details. */
#recordDialog .reminder-title-field { margin-bottom: 20px; }
#recordDialog .reminder-title-field input { height: 48px; font-size: 18px; font-weight: 500; }
#recordDialog .reminder-date-row { gap: 20px; }
#recordDialog .reminder-date-row .field { min-width: 0; margin-bottom: 14px; }
#recordDialog .reminder-date-shortcuts { gap: 8px; margin: -2px 0 14px; }
#recordDialog .reminder-switch-row { min-height: 52px; gap: 14px; }
#recordDialog .reminder-switch-row strong { font-size: var(--entry-body); font-weight: 450; }
#recordDialog .reminder-switch-row small { margin-top: 3px; font-size: var(--entry-meta); }
#recordDialog #notificationPermission { align-items: center; flex-wrap: nowrap; gap: 12px; margin: 0; padding: 2px 0 14px; font-size: var(--entry-meta); line-height: 1.55; }
#recordDialog .notification-permission-copy { flex: 1 1 0; }
#recordDialog #requestNotificationButton { flex: 0 0 auto; min-height: 44px; padding: 9px 11px; border-radius: 9px; font-size: var(--entry-label); }
#recordDialog .reminder-details { margin-top: 4px; }
#recordDialog .reminder-details[open] > .reminder-date-row { margin-top: 8px; }
#recordDialog .reminder-options-row .field { flex-direction: column; align-items: stretch; gap: 4px; border: 0; }
#recordDialog .reminder-options-row .field:focus-within { box-shadow: none; }
#recordDialog .reminder-options-row select { flex: auto; width: 100%; text-align: left; border-bottom: 1px solid #dce3de; }
#recordDialog .reminder-note-field { margin: 2px 0 10px; }
#recordDialog .reminder-note-field textarea { height: 62px; min-height: 62px; line-height: 1.6; }
#recordDialog .reminder-delete-button { min-height: 44px; margin-top: 4px; font-size: var(--entry-label); }

/* The list has one search surface and light, readable filters. */
#recordDialog.is-browsing-reminders .composer-tabs { margin-bottom: 16px; }
#recordDialog .reminder-search { min-height: 44px; background: #f2f4f2; }
#recordDialog .reminder-filters { gap: 4px; margin: 10px 0 6px; padding: 3px 0; border-bottom: 1px solid var(--entry-line); border-radius: 0; background: transparent; }
#recordDialog .reminder-filters button { gap: 6px; min-height: 40px; font-size: var(--entry-label); font-weight: 450; }
#recordDialog .reminder-filters button[aria-pressed="true"] { color: var(--accent-hover); background: var(--accent-soft); box-shadow: none; font-weight: 550; }
#recordDialog .reminder-filter-count { font-size: var(--entry-meta); }
#recordDialog .reminder-group + .reminder-group { margin-top: 12px; }
#recordDialog .reminder-group-heading { min-height: 40px; gap: 12px; padding: 12px 1px 8px; border-bottom: 0; font-size: var(--entry-label); font-weight: 550; }
#recordDialog .reminder-group-heading > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#recordDialog .reminder-group-heading > span:last-child { flex-shrink: 0; font-size: var(--entry-meta); }
#recordDialog .reminder-library-item { gap: 14px; padding: 12px 1px; border-color: var(--entry-line); }
#recordDialog .reminder-library-item .plan-complete { margin-top: 1px; }
#recordDialog .reminder-library-item .plan-content { gap: 4px; padding-top: 0; }
#recordDialog .reminder-library-item .plan-title { font-size: 15px; line-height: 1.5; font-weight: 500; }
#recordDialog .reminder-library-item :is(.plan-meta, .plan-note) { font-size: var(--entry-meta); line-height: 1.5; }
#recordDialog .reminder-library-item .plan-note { color: var(--reminder-secondary); }
#recordDialog #reminderLibraryList { scroll-padding-block: 44px 16px; }

/* One clear action row. Status messages never cover form controls. */
#recordDialog .dialog-actions { gap: 10px; margin: 16px 0 0; padding: 14px 0 0; bottom: 0; border-color: var(--entry-line); background: #fff; }
#recordDialog .dialog-actions button { min-height: 46px; font-size: var(--entry-body); font-weight: 500; border-radius: 10px; }
#recordDialog .dialog-actions .primary-button { box-shadow: 0 2px 5px #24402e16; }
#recordDialog .dialog-actions .quiet-button { color: var(--ink-soft); background: var(--entry-fill); }
#recordDialog:not(.is-browsing-reminders) > .toast { position: static; }

.calendar-side .day-panel .record-actions { gap: 2px; }
.calendar-side .day-panel .record-actions .icon-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.calendar-side .day-panel .record-row { padding-block: 12px; }

@media (hover: hover) and (pointer: fine) {
  #recordDialog .duration-presets button:not([aria-pressed="true"]):hover,
  #recordDialog .reminder-date-shortcuts button:not([aria-pressed="true"]):hover {
    color: var(--accent-hover);
    background: var(--accent-soft);
  }
}

@media (max-width: 640px) {
  #recordDialog { width: calc(100vw - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right))); padding: 20px 20px max(16px, env(safe-area-inset-bottom)); }
  #recordDialog .dialog-header h2 { font-size: 18px; }
  #recordDialog .composer-tab { font-size: 13px; }
  #recordDialog .dialog-header { margin-bottom: 14px; }
  #recordDialog .reminder-date-row { gap: 16px; }
  #recordDialog .dialog-actions { margin-top: 14px; padding-top: 12px; }
  #recordDialog .dialog-actions button { min-height: 46px; }
  #recordDialog .reminder-library-item .plan-title { font-size: 14px; }
}
@media (max-width: 360px) {
  #recordDialog { padding-inline: 16px; }
  #recordDialog .reminder-date-row { gap: 12px; }
  #recordDialog .dialog-header { gap: 6px; }
  #recordDialog #newReminderButton { padding-inline: 10px; }
  #recordDialog .reminder-filters button { gap: 4px; padding-inline: 4px; font-size: 12px; }
  #recordDialog #notificationPermission { flex-wrap: wrap; gap: 8px; }
  #recordDialog .notification-permission-copy { flex-basis: 100%; }
}
@media (max-height: 600px) {
  #recordDialog { padding-top: 16px; }
  #recordDialog .dialog-header { margin-bottom: 12px; }
  #recordDialog .composer-tabs { margin-bottom: 16px; }
}
