/* Reminders (reminders.js): the view, a project's Reminders section, the Home done box, and
   the in-page alert. Tokens: tokens.css; rules: DESIGN.md. The person's ink for their own
   actions, household green for shared, danger only for overdue. */

.rm { max-width: 760px; }
.rm-i { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rm-i.big { width: 20px; height: 20px; }
.rm-head { margin-bottom: var(--s5); }
.rm-lede { margin: 0; color: var(--ink-2); }

/* quick add, with what it understood underneath */
.rm-add { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s2) var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); margin-bottom: var(--s5); }
.rm-add:focus-within { border-color: var(--me); box-shadow: 0 0 0 3px var(--me-wash); }
.rm-add-plus { color: var(--ink-3); font-size: var(--step-1); }
.rm-add input { border: 0; padding: 8px 0; background: none; outline: none; width: 100%; font: inherit; color: var(--ink); }
.rm-preview { grid-column: 2 / -1; margin: 0; min-height: 0; font-size: var(--step--1); color: var(--ink-2); display: flex; align-items: center; gap: var(--s2); }
.rm-preview:empty { display: none; }
.rm-preview .rm-i { color: var(--me); }
.btn.sm { padding: 6px 12px; font-size: var(--step--1); }

.rm-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.rm-tabs { display: flex; gap: var(--s1); }
.rm-tabs a { display: inline-flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3) var(--s3); text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rm-tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--me); }
.rm-tabs a:hover { color: var(--ink); }
.rm-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: var(--step--1); font-weight: 600; font-variant-numeric: tabular-nums; }
.rm-filters { display: flex; gap: var(--s2); padding-bottom: var(--s2); }
.rm-filters select { width: auto; padding: 6px 10px; font-size: var(--step--1); }
.rm-late-note { margin: 0 0 var(--s3); color: var(--danger); font-size: var(--step--1); font-weight: 600; }
.rm-empty { display: flex; align-items: center; gap: var(--s2); color: var(--ink-2); padding: var(--s4) 0; margin: 0; }
.rm-empty .rm-i { color: var(--ink-3); width: 16px; height: 16px; }

/* rows */
.rm-list { list-style: none; margin: 0 0 var(--s5); padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.rm-list.in-project { margin-bottom: var(--s3); }
.rm-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: 10px var(--s3) 10px var(--s4); }
.rm-row + .rm-row { border-top: 1px solid var(--line); }
.rm-check, .hm-rcheck { width: 24px; height: 24px; margin-top: 1px; display: grid; place-items: center; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.rm-check span, .hm-rcheck span { width: 20px; height: 20px; border-radius: 50%; border: 1.8px solid var(--ink-3); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.rm-check:hover span, .hm-rcheck:hover span { border-color: var(--me); background: var(--me-wash); }
.rm-row.done .rm-check span { background: var(--me); border-color: var(--me); }
.rm-row.done .rm-check span::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--surface); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.rm-body { min-width: 0; }
.rm-title { display: block; border: 0; background: none; padding: 2px 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.rm-title:hover { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.rm-row.done .rm-title { color: var(--ink-3); text-decoration: line-through; }
.rm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); margin-top: 2px; font-size: var(--step--1); color: var(--ink-2); }
.rm-when { font-variant-numeric: tabular-nums; }
.rm-when.late { color: var(--danger); font-weight: 600; }
.rm-rep, .rm-proj, .rm-who { display: inline-flex; align-items: center; gap: 4px; }
.rm-proj { color: var(--ink-2); text-decoration: none; }
.rm-proj:hover { color: var(--ink); text-decoration: underline; }
.rm-who { color: var(--k, var(--ink-2)); font-weight: 500; }
.rm-who.shared { color: var(--shared); }
.rm-notes { margin: 4px 0 0; font-size: var(--step--1); color: var(--ink-3); white-space: pre-wrap; }
.rm-more { position: relative; display: inline-flex; }
.rm-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-chip); background: none; color: var(--ink-3); cursor: pointer; }
.rm-icon:hover, .rm-icon[aria-expanded="true"] { background: var(--sunk); color: var(--ink); }
.rm-more .rm-icon .rm-i { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.rm-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; min-width: 210px; padding: 6px; display: grid; gap: 1px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); box-shadow: var(--lift); }
.rm-menu[hidden] { display: none; }
.rm-menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--r-chip); cursor: pointer; color: var(--ink); white-space: nowrap; font: inherit; }
.rm-menu button:hover, .rm-menu button:focus-visible { background: var(--sunk); }
.rm-menu button.danger { color: var(--danger); }

/* a project's Reminders section */
.pj-reminders .rm-add { margin-bottom: 0; }

/* Home: done box beside a reminder in Coming up */
.hm-agenda li.hm-has-check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; padding-left: var(--s3); }
.hm-agenda li.hm-has-check .hm-entry { padding-left: var(--s2); }
.hm-rslot { width: 24px; }
.hm-entry.late .hm-when { color: var(--danger); font-weight: 600; }

/* edit dialog */
.rm-dialog { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--ink); padding: var(--s5); width: min(520px, 94vw); box-shadow: var(--lift); }
.rm-dialog::backdrop { background: rgb(29 29 27 / .24); }
.rm-form { display: grid; gap: var(--s3); }
.rm-form h2 { margin: 0 0 var(--s1); }
.rm-field { display: grid; gap: 4px; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.rm-field small { font-weight: 400; color: var(--ink-3); }
.rm-field input, .rm-field select, .rm-field textarea { font: inherit; font-size: var(--step-0); font-weight: 400; color: var(--ink); width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.rm-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.rm-share { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: var(--s2) var(--s3) var(--s3); display: grid; gap: var(--s2); margin: 0; }
.rm-share legend { font-size: var(--step--1); font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.rm-share label { display: flex; align-items: center; gap: var(--s2); }
.rm-share[disabled] { opacity: .6; }
.rm-note { margin: 0; font-size: var(--step--1); color: var(--ink-3); }
.rm-foot { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }

/* in-page alert while the console is open */
.rm-alerts { position: fixed; top: var(--s4); right: var(--s4); z-index: 60; display: grid; gap: var(--s2); width: min(380px, calc(100vw - 2 * var(--s4))); }
.rm-alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: var(--s3) var(--s3) var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--me); border-radius: var(--r-ctl); box-shadow: var(--lift); animation: rm-in .2s ease-out; }
.rm-alert > .rm-i { color: var(--me); margin-top: 2px; }
.rm-alert-body { display: grid; gap: 2px; min-width: 0; }
.rm-alert-body strong { overflow-wrap: anywhere; }
.rm-alert-body span { font-size: var(--step--1); color: var(--ink-2); }
.rm-alert-actions { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); }
@keyframes rm-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .rm-alert { animation: none; } }

@media (max-width: 640px) {
  .rm-two { grid-template-columns: 1fr; }
  .rm-bar { align-items: stretch; }
  .rm-filters { width: 100%; }
  .rm-filters label { flex: 1; }
  .rm-filters select { width: 100%; }
}

/* Add appears once something is typed (Enter adds too). */
.rm-add:has(input:placeholder-shown) .rm-add-go { visibility: hidden; }

/* the Reminders page (reminders.js renderReminders): every to-do on the calendar, by when */
.rm .rm-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.rm .rm-head h1 { margin: 0; }
.rm-sec { margin-bottom: var(--s5); }
.rm-sec > h2, .rm-donesec > summary { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s2); font-size: var(--step-0); font-weight: 600; color: var(--ink); }
.rm-sec > h2.late { color: var(--danger); }
.rm-donesec > summary { cursor: pointer; color: var(--ink-2); list-style: none; width: fit-content; padding: 4px 0; }
.rm-donesec > summary::-webkit-details-marker { display: none; }
.rm-donesec > summary::before { content: "›"; display: inline-block; width: 10px; color: var(--ink-3); transition: transform .15s; }
.rm-donesec[open] > summary::before { transform: rotate(90deg); }
.rm-sec .rm-list { margin: 0; }
.rmp { align-items: center; padding-block: 8px; }
.rmp .cal-check { width: 24px; height: 24px; }
.rmp .cal-check span { width: 18px; height: 18px; border-width: 1.8px; }
.rmp .cal-check[aria-checked="true"] span::after { width: 8px; height: 4px; border-width: 2px; }
.rmp.done .rm-title { color: var(--ink-3); text-decoration: line-through; }
.rmp .rm-meta { gap: 2px var(--s3); }
.rm-ctx { color: var(--ink-3); }
.rmp [data-row-more] { opacity: 0; }
.rmp:hover [data-row-more], .rmp:focus-within [data-row-more], .rmp [data-row-more][aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .rmp [data-row-more] { opacity: 1; } }
.rmp [data-row-more] .rm-i { width: 18px; height: 18px; fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: reduce) { .rm-donesec > summary::before { transition: none; } }
