/* — the board: the todo list on the left, the selected todo's thread always on the right — */
.board { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); column-gap: 56px; }
.board__pane { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; height: 20px; padding-right: 12px; flex: none; }

.thread__crumb { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.06em; }
.thread__crumb-strong { font-weight: 400; color: var(--text); }
.thread__heading { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-right: 12px; flex: none; }
.thread__heading:hover .icon-btn--quiet { opacity: 1; }
/* Mark done and ⋮ sit together at the bar's right; ⋮ opens the todo's menu, which is the account menu's
   frame and items (main.css), placed under its button. */
.thread__actions { position: relative; display: flex; align-items: center; gap: 8px; }
.thread__done-btn { display: inline-flex; align-items: center; color: var(--text-3); }
.thread__done-btn:hover { color: var(--text); }
.thread__remind { color: var(--text-4); }
.thread__remind:hover, .thread__remind--set { color: var(--text); }
.thread__more { color: var(--text-4); }
.thread__more:hover, .thread__more[aria-expanded="true"] { color: var(--text); }
.thread-menu { top: 28px; width: 200px; }
.thread__title { margin: 0; height: 24px; font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }

/* The thread title is the rename field: it looks like the heading until it has focus. */
.title-form { flex: 1 1 auto; min-width: 0; }
.title-form__input { width: 100%; height: 24px; border: none; outline: none; background: transparent; padding: 0; font: inherit; color: var(--text); text-overflow: ellipsis; cursor: text; }
.title-form__input:focus { text-decoration: underline dotted var(--text-4); text-underline-offset: 6px; text-decoration-thickness: 1px; }
.thread__comments { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: 24px; padding-right: 12px; display: flex; flex-direction: column; gap: 20px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.thread__comments::-webkit-scrollbar { width: 4px; }
.thread__comments::-webkit-scrollbar-track { background: transparent; }
.thread__comments::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.thread__empty { margin: auto; font-size: 13px; color: var(--text-4); text-align: center; }
.thread__empty-title { color: var(--text-3); }
.thread__empty-sub { margin-top: 4px; }

.thread__join { margin-left: auto; margin-right: 12px; }

/* — settings modal: a narrow column of plain sections, like the rest of the board — */
/* — settings: All todos' frame, narrower (640 wide, fixed height, label + ✕ on top), then numbered sections
     that fold, headed like the list's own labels. The number starts on the frame's edge, under
     "Settings", in a todo row's position column (44px + 14px); a section's rows start where its name
     does. Each row names a setting and says what it does on the left; its value and controls sit on
     the right. Space separates, not lines. — */
.settings { position: relative; max-width: 640px; width: 100%; height: min(680px, calc(100vh - var(--overlay-top) - 24px)); display: flex; flex-direction: column; background: var(--bg); padding: 8px 0; }
.settings__body { margin-top: 24px; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 12px; counter-reset: settings;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.settings__notice { margin: 0 0 16px 58px; font-size: 13px; line-height: 20px; color: var(--text); }

.settings__group { counter-increment: settings; }
.settings__group + .settings__group { margin-top: 16px; }
.settings__summary { display: flex; align-items: center; height: 36px; cursor: pointer; list-style: none; }
.settings__summary::-webkit-details-marker { display: none; }
.settings__heading { margin: 0; line-height: 20px; font-weight: 400; }
.settings__heading::before { content: counter(settings, decimal-leading-zero); display: inline-block; width: 58px; }
.settings__summary:hover .settings__heading, .settings__group[open] .settings__heading { color: var(--text-3); }
.settings__chevron { margin-left: auto; color: var(--text-4); transition: transform 0.15s ease; }
.settings__group[open] .settings__chevron { transform: rotate(180deg); }
.settings__summary:hover .settings__chevron { color: var(--text); }
.settings__group[open] { padding-bottom: 8px; }

.settings__row { display: flex; align-items: center; gap: 32px; padding: 12px 0 12px 58px; }
.settings__row--top { align-items: flex-start; }
.settings__about { flex: 1 1 0; max-width: 220px; min-width: 0; }  /* names and explains; the right side holds only values */
.settings__label { font-size: 13.5px; line-height: 20px; color: var(--text); }
.settings__hint { margin-top: 2px; font-size: 12.5px; line-height: 18px; color: var(--text-4); }
.settings__control { flex: none; margin-left: auto; display: flex; align-items: center; gap: 16px; }
.settings__control--stack { flex: 0 0 300px; min-width: 0; flex-direction: column; align-items: stretch; gap: 0; }
.settings__select { appearance: none; -webkit-appearance: none; height: 20px; margin: 0; font: inherit; font-size: 13.5px; color: var(--text); background: transparent; border: none;
  padding: 0; text-align: right; text-align-last: right; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
.settings__add { align-self: flex-end; margin-top: 4px; }
.settings__add:first-child { margin-top: 0; }  /* alone in the column (a guest): level with the label */

/* A connected calendar: one plain line, the provider's mark, the account and two quiet actions. Listed means connected. */
.calendar-pill { display: flex; align-items: center; gap: 10px; height: 32px; }
.calendar-pill__mark { flex: none; }
.calendar-pill__email { flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-pill__open, .calendar-pill__remove { flex: none; color: var(--text-4); }
.calendar-pill__open:hover, .calendar-pill__remove:hover { color: var(--text); }
.calendar-pill--lost .calendar-pill__email { color: var(--text-4); }
.calendar-pill__reconnect { flex: none; display: inline-flex; align-items: center; height: 20px; color: var(--text); }

.settings__row--key { padding: 8px 0 8px 58px; }
.settings__row--key .settings__label { color: var(--text-3); }  /* a reference list, quieter than settings */
.settings__keys { display: flex; gap: 6px; flex: none; margin-left: auto; }
.settings__keys kbd { min-width: 16px; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

@media (max-width: 760px) {
  .settings__heading::before { width: 32px; }
  .settings__notice { margin-left: 32px; }
  .settings__row { padding-left: 32px; }
  .settings__row--key { padding-left: 32px; }
  .settings__row { flex-wrap: wrap; gap: 12px; }
  .settings__control--stack { flex-basis: 100%; }
}

/* — Timeline: one modal, two tabs — Past (every todo, the most recently closed first)
     and Scheduled. The same width and header for both, so switching never jumps. — */
.timeline__bar { display: flex; align-items: center; gap: 18px; flex: none; }
.timeline__title { margin-right: auto; }
.timeline__tabs { display: flex; align-items: center; gap: 10px; }
.timeline__tab { height: 24px; padding: 0; background: none; border: none; cursor: pointer; font-size: 13px; color: var(--text-4); text-underline-offset: 5px; }
.timeline__tab:hover { color: var(--text); }
.timeline__tab.is-on { color: var(--text); font-weight: 600; text-decoration: underline solid 1px; }
.timeline__dot { color: var(--text-4); font-size: 12px; }

/* — Past: the review — */
/* Fixed height: switching between the table and a thread never moves anything above it. */
.timeline { height: min(680px, calc(100vh - var(--overlay-top) - 24px)); }  /* both tabs share one frame: switching never moves it */
.review { position: relative; max-width: 720px; width: 100%; display: flex; flex-direction: column; gap: 24px; background: var(--bg); padding: 8px 0; }


.review__body { margin-top: 24px; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.review__table-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 12px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.review__table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.review__th { position: sticky; top: 0; background: var(--bg); text-align: left; font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 0 8px; white-space: nowrap; }
.review__num { width: 32px; color: var(--text-4); }
.review__table td.review__meta--right { width: 56px; }
.review__table td.review__action { width: 72px; }
.review__th--right, .review__meta--right { text-align: right; padding-right: 16px; }
.review__row:hover .review__title { color: var(--text); }
.review__open { max-width: 100%; background: none; border: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review__open:hover { color: var(--text); text-decoration: underline dotted; text-underline-offset: 4px; }
.review__title { height: 36px; font-size: 13.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; padding-right: 16px; }
.review__meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.review__action { text-align: right; }
.review__actions { display: inline-flex; align-items: center; gap: 6px; }
.review__row:hover .icon-btn--quiet { opacity: 1; }
.review__empty { font-size: 13px; color: var(--text-4); padding: 8px 0; }
.review-thread { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 20px; }
.review-thread__bar { display: flex; align-items: center; justify-content: space-between; padding-right: 12px; }
.review-thread__head { display: flex; flex-direction: column; gap: 12px; }
.review-thread__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.review-thread__comments { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 12px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
/* the rail of days: one thin line of dates, scrolling sideways, today at the right end */
.review-rail { display: flex; align-items: center; height: 28px; border-bottom: 1px solid var(--border); }
.review-rail__days { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.review-rail__days::-webkit-scrollbar { display: none; }
.review-rail__step { flex: none; width: 20px; height: 28px; padding: 0; background: none; border: none; cursor: pointer; color: var(--text-4); font-size: 15px; line-height: 1; }
.review-rail__step:hover { color: var(--text); }
.review-rail__month { flex: none; padding: 0 6px 0 10px; font-family: var(--font-mono); font-size: 10px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.06em; }
.review-rail__day { position: relative; flex: none; width: 28px; height: 28px; padding: 0; background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--text-4); opacity: 0.5; }
.review-rail__day.has-done { color: var(--text-2); opacity: 1; }
.review-rail__day:hover { color: var(--text); opacity: 1; }
.review-rail__day.is-on { color: var(--text); opacity: 1; font-weight: 600; }
.review-rail__day.is-on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 1px; background: var(--text); }  /* sits on the rail's line */
.review__day-title { margin: 20px 0 8px; color: var(--text-2); }
.review__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 760px) {
  .board { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 40px; }
  .board__pane { height: auto; }
  .thread__comments { overflow: visible; }
}
