/* v36: white reminder lists, quiet hierarchy, and short, responsive motion. */
:root {
  --finesse-ease: cubic-bezier(.2, .72, .25, 1);
  --reminder-line: #eceeed;
  --reminder-secondary: #6e7771;
}

/* Limit motion to opacity and transforms; the calendar artwork stays untouched. */
.view-panel:not([hidden]) { animation: finesse-view-in 190ms var(--finesse-ease) both; }
.app-dialog[open] { animation: finesse-dialog-in 190ms var(--finesse-ease) both; }
.app-dialog[open]::backdrop { animation: finesse-backdrop-in 150ms ease-out both; }
.record-composer-panel:not([hidden]) { animation: finesse-content-in 150ms ease-out both; }
.reminder-editor:not([hidden]), .reminder-library:not([hidden]) { animation: finesse-content-in 150ms ease-out both; }
@keyframes finesse-view-in { from { opacity: .65; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes finesse-dialog-in { from { opacity: .65; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes finesse-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes finesse-content-in { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: none; } }

:is(.composer-tab, .duration-presets button, .reminder-filters button, .reminder-date-shortcuts button, .plan-complete, .plans-pager button) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 120ms var(--finesse-ease);
}
:is(.composer-tab, .duration-presets button, .reminder-filters button, .reminder-date-shortcuts button, .plan-complete, .plans-pager button):active:not(:disabled) { transform: scale(.97); }
:is(.record-list, #reminderLibraryList, .upcoming-plans-list) { overscroll-behavior: contain; }

/* Match the daily record and reminder surfaces, without nested field boxes. */
.record-dialog {
  --ink: #252b28;
  --ink-soft: #555f59;
  --muted: #7c8580;
  background: #fff;
  max-width: calc(100vw - 28px);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: #fff;
  scrollbar-color: #d9deda transparent;
  scrollbar-width: thin;
  scroll-padding-block: 24px 86px;
}
.record-dialog .dialog-header { align-items: center; margin-bottom: 22px; gap: 12px; }
.record-dialog .dialog-header > div { flex: 1; }
.record-dialog .dialog-header h2 { font-size: 20px; font-weight: 650; line-height: 1.4; }
.record-dialog .dialog-close { background: #f5f6f5; border: 0; box-shadow: none; border-radius: 50%; }
.record-dialog .reminder-new-button { flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--accent); box-shadow: none; }
.record-dialog .reminder-new-button[hidden] { display: none; }
.record-dialog .reminder-new-button svg { width: 21px; height: 21px; }
.record-dialog .composer-tabs { padding: 3px; border-radius: 10px; background: #f2f3f2; margin-bottom: 24px; }
.record-dialog .composer-tab { font-size: 14px; font-weight: 550; min-height: 40px; }
.record-dialog .composer-tab.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px #192c2310; }
.record-dialog .field { margin-bottom: 20px; gap: 5px; }
.record-dialog .field > span { color: var(--reminder-secondary); font-size: 13px; line-height: 1.5; font-weight: 450; }
.record-dialog .field input,
.record-dialog .field select,
.record-dialog .field textarea { border-color: #e2e6e3; transition: border-color 140ms ease; }
.record-dialog .field input::placeholder,
.record-dialog .field textarea::placeholder { color: #959b98; opacity: 1; }
.record-dialog .field input[type="date"],
.record-dialog .field input[type="time"] { font-variant-numeric: tabular-nums; }
.record-dialog .reminder-title-field { margin-bottom: 23px; }
.record-dialog .reminder-title-field input { font-size: 19px; font-weight: 500; min-height: 48px; height: 48px; }
.record-dialog .reminder-title-field input::placeholder { font-weight: 400; }
.record-dialog .duration-presets { gap: 8px; }
.record-dialog .duration-presets button { min-height: 40px; background: #f4f5f4; }
.record-dialog .record-current-total { color: var(--reminder-secondary); }
.record-dialog .record-details,
.record-dialog .reminder-details { border-color: var(--reminder-line); }
.record-dialog .record-details > summary,
.record-dialog .reminder-details > summary { min-height: 50px; font-size: 14px; font-weight: 450; }
.record-dialog #reminderDetailsSummary { max-width: 65%; font-size: 12px; line-height: 1.5; }
.record-dialog .reminder-details[open] { padding-bottom: 2px; }
.record-dialog .reminder-details[open] > .reminder-date-row { margin-top: 10px; }
.record-dialog .reminder-note-field { margin-bottom: 15px; }
.record-dialog .reminder-note-field textarea { min-height: 66px; height: 66px; line-height: 1.6; }
.record-dialog .reminder-switch-row { min-height: 54px; }
.record-dialog .reminder-switch-row strong { font-weight: 450; }
.record-dialog .reminder-switch-row small { color: var(--reminder-secondary); }
.record-dialog .notification-permission { color: var(--reminder-secondary); line-height: 1.55; padding-bottom: 14px; }
.record-dialog .dialog-actions { background: #fff; border-color: var(--reminder-line); margin-top: 18px; padding-top: 16px; }
.record-dialog .dialog-actions { backdrop-filter: none; -webkit-backdrop-filter: none; }
.record-dialog .dialog-actions button { min-height: 46px; border-radius: 10px; font-weight: 550; }
.app-dialog>.toast {position:sticky;bottom:0;left:auto;right:auto;width:100%;max-width:100%;margin:12px 0 0;transform:none;gap:12px;font-size:13px;box-shadow:0 3px 12px #0001;backdrop-filter:none;-webkit-backdrop-filter:none;}
.app-dialog>.toast #toastMessage {flex:1;min-width:0;}
.app-dialog>.toast #undoButton {flex-shrink:0;min-height:36px;}
.record-dialog .dialog-actions .secondary-button { background: #f4f5f4; border-color: transparent; }

.reminder-date-shortcuts { display: flex; align-items: center; gap: 8px; margin: -6px 0 20px; }
.reminder-date-shortcuts button { flex: 1; min-width: 0; min-height: 40px; padding: 7px 8px; border: 0; border-radius: 8px; color: var(--ink-soft); background: #f4f5f4; font: inherit; font-size: 13px; font-weight: 450; cursor: pointer; }
.reminder-date-shortcuts button[aria-pressed="true"] { color: var(--accent-hover); background: var(--accent-soft); font-weight: 550; }
#reminderBackButton { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; min-height: 36px; padding: 4px 0; margin-left: -5px; border: 0; border-radius: 6px; color: var(--accent); background: transparent; box-shadow: none; cursor: pointer; }
#reminderBackButton svg { width: 20px; height: 20px; flex-shrink: 0; }
#reminderBackButton[hidden] { display: none; }

/* A single white list, with a neutral search field and date headings. */
.record-dialog section.reminder-library { display: block; margin: 0; border: 0; }
.record-dialog section.reminder-library[hidden] { display: none; }
.reminder-search { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; margin: 0; padding: 0 11px; border-radius: 10px; background: #f2f3f2; color: #909793; }
.reminder-search > svg { flex: 0 0 17px; width: 17px; height: 17px; }
.reminder-search input { flex: 1; min-width: 0; width: 100%; min-height: 44px; margin: 0; padding: 8px 0; border: 0; border-radius: 0; outline: none; box-shadow: none; background: transparent; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.4; -webkit-appearance: none; appearance: none; }
.reminder-search input::placeholder { color: #8a928e; opacity: 1; }
.reminder-search input::-webkit-search-cancel-button { display: none; }
.reminder-search:focus-within { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.reminder-search input:focus-visible { outline: none; }
#clearReminderSearch { display: grid; place-items: center; flex: 0 0 34px; width: 34px; min-height: 40px; margin-right: -7px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #7d8681; cursor: pointer; }
#clearReminderSearch[hidden] { display: none; }
#clearReminderSearch svg { width: 16px; height: 16px; }
.reminder-filters { gap: 3px; padding: 3px; margin: 12px 0 8px; border-radius: 10px; background: #f2f3f2; }
.reminder-filters button { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 40px; padding: 6px; border-radius: 7px; font-size: 13px; line-height: 1.4; font-weight: 500; color: #7a827e; }
.reminder-filters button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px #192c2310; }
.reminder-filter-label { white-space: nowrap; }
.reminder-filter-count { min-width: 12px; font-size: 12px; line-height: 1.4; font-weight: 500; font-variant-numeric: tabular-nums; color: #858e88; }
.reminder-filters button[aria-pressed="true"] .reminder-filter-count { color: var(--accent); }
#reminderLibraryList { scrollbar-width: thin; scrollbar-color: #d8deda transparent; overscroll-behavior-y: contain; scroll-padding-block: 42px 16px; padding-inline: 1px; }
.record-dialog.is-browsing-reminders #reminderLibraryList { max-height: min(460px, calc(100dvh - 400px)); min-height: 72px; }
.reminder-group { margin: 0; min-width: 0; }
.reminder-group + .reminder-group { margin-top: 8px; }
.reminder-group-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 39px; margin: 0; padding: 10px 1px 7px; border-bottom: 1px solid var(--reminder-line); background: #fff; color: var(--ink-soft); font-size: 13px; font-weight: 550; line-height: 1.5; }
.reminder-group-heading > span:last-child { color: #99a09c; font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.reminder-group-heading.is-overdue { color: #a25e48; }
.reminder-library-item { align-items: flex-start; gap: 13px; margin: 0; padding: 13px 1px; border-color: var(--reminder-line); border-radius: 0; background: #fff; }
.reminder-group-heading + .reminder-library-item { border-top: 0; }
.reminder-library-item .plan-complete { margin-top: 2px; width: 24px; height: 24px; flex-basis: 24px; border-color: #bdc7c0; }
.reminder-library-item .plan-complete::before { inset: -10px -6px; }
.reminder-library-item .plan-content { gap: 2px; padding: 1px 1px 0 0; min-height: 44px; }
.reminder-library-item .plan-title { font-size: 15px; font-weight: 500; line-height: 1.5; }
.reminder-library-item .plan-when { font-size: 12px; line-height: 1.55; color: var(--reminder-secondary); }
.reminder-library-item .plan-meta { font-size: 12px; line-height: 1.5; }
.reminder-library-item .reminder-note-preview, .reminder-library-item .plan-note { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; line-height: 1.5; color: #8b938e; }
.reminder-library-item.is-completed .plan-content { opacity: .65; }
.reminder-library-item.is-completed .plan-title { opacity: 1; }
#reminderLibraryList .plans-empty { padding: 34px 12px; font-size: 14px; line-height: 1.6; color: var(--reminder-secondary); }
.reminder-empty {display:grid;justify-items:center;align-content:center;min-height:190px;gap:12px;}
.reminder-empty-mark {display:grid;place-items:center;width:42px;height:42px;border:1.5px solid #dde3df;border-radius:50%;color:#87958c;font-size:22px;}
#reminderLibraryList .reminder-empty .plans-empty {padding:0;margin:0;}

/* Sidebar rhythm follows the same list treatment, without changing its grid. */
.upcoming-plans { background: #fff; }
.upcoming-plans-header { border-bottom-color: var(--reminder-line); }
.upcoming-plans-header h2 { font-weight: 600; }
.upcoming-plans-header .icon-button { background: transparent; box-shadow: none; border: 0; }
.upcoming-plan .plan-title { font-weight: 550; }
.upcoming-plan .plan-complete { border-color: #bdc7c0; }
.plans-footer { align-items: center; }
.plans-footer .plans-view-all { font-size: 13px; color: var(--accent); }
.plans-pager { font-size: 11px; }
.calendar-layout .record-row { gap: 10px; }
.calendar-layout .record-duration { font-weight: 550; }
.calendar-layout .record-note { color: var(--reminder-secondary); line-height: 1.5; }
.calendar-layout .record-actions .icon-button { background: transparent; border-color: transparent; }

@media (hover: hover) and (pointer: fine) {
  .reminder-library-item:hover { background: #fafbf9; }
  .reminder-date-shortcuts button:hover, .duration-presets button:hover { color: var(--accent-hover); background: var(--accent-soft); }
  #clearReminderSearch:hover { color: var(--ink); }
  .record-dialog .reminder-new-button:hover, #reminderBackButton:hover { color: var(--accent-hover); }
}
@media (max-width: 640px) {
  .record-dialog {max-width:calc(100vw - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right)));}
}
@media (max-width: 540px) {
  .record-dialog { padding-inline: 20px; }
  .record-dialog .dialog-header { gap: 10px; margin-bottom: 19px; }
  .record-dialog .dialog-header h2 { font-size: 19px; }
  .record-dialog .composer-tabs { margin-bottom: 22px; }
  .record-dialog .field { margin-bottom: 18px; }
  .record-dialog .reminder-title-field { margin-bottom: 21px; }
  .record-dialog .reminder-title-field input { font-size: 18px; }
  .record-dialog .reminder-date-row { gap: 18px; }
  .record-dialog .reminder-options-row .field { gap: 4px; }
  .record-dialog .dialog-actions { padding-top: 14px; }
  .record-dialog .dialog-actions button { min-height: 48px; }
  .reminder-date-shortcuts { gap: 7px; margin-bottom: 18px; }
  .reminder-date-shortcuts button { min-height: 42px; }
  .reminder-search input { font-size: 16px; }
  .reminder-filters button { min-height: 42px; gap: 4px; padding-inline: 4px; }
  .record-dialog.is-browsing-reminders .composer-tabs { margin-bottom: 12px; }
  .record-dialog.is-browsing-reminders #reminderLibraryList { max-height: min(460px, calc(100dvh - 374px)); }
  .reminder-library-item { padding-block: 14px; }
  .reminder-group-heading { min-height: 40px; }
}
@media (max-width: 380px) {
  .reminder-filters button { font-size: 12px; gap: 3px; }
  .reminder-filter-count { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .view-panel:not([hidden]), .app-dialog[open], .app-dialog[open]::backdrop, .record-composer-panel:not([hidden]), .reminder-editor:not([hidden]), .reminder-library:not([hidden]) { animation: none; }
  :is(.composer-tab, .duration-presets button, .reminder-filters button, .reminder-date-shortcuts button, .plan-complete, .plans-pager button),
  .record-dialog .field input, .record-dialog .field select, .record-dialog .field textarea { transition: none; }
}
