/* ============================================================
   MAKEOVER PASS — "billion-dollar" home page refinement
   Day cards, editorial date headers, refined controls.
   Appended last; !important used only to beat inline styles.
   ============================================================ */

/* ---------- Daily column: each day becomes a card ---------- */
.daily-column .day-section {
  background: var(--surface-card);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  padding: 6px 14px 12px;
  /* No side margin: the category cards run edge to edge in their scroller, so a
     3px inset here made the day cards sit off the scrollbar while the category
     ones sat flush. The card's outer shadow blurs 34px, far past 3px, so the
     inset was never protecting it from the column's overflow-x: hidden. */
  margin: 0 0 26px;
  /* Glass like the month calendar above it (.schedule-calendar-panel): --surface-card
     carried at 72% over the page ground, its three-edge inset rim, and only its slight
     contact shadow at rest. The wash is not the calendar's angled one - on a panel this
     tall that lit the top-left corner and bottom edge brighter than the old opaque card -
     but a straight-down one at about half --sheen's strength, so the day card sits
     darker than it did. No backdrop-filter - behind a day card there is only the page
     and its wash, which blur leaves unchanged, and a selected month is 30+ of these in
     a column that already fights for scroll frames. */
  background-color: rgba(6, 6, 8, 0.72);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.016), rgba(255, 255, 255, 0.004));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.075),
              inset 1px 0 0 rgba(255, 255, 255, 0.022),
              inset 0 -1px 0 rgba(255, 255, 255, 0.018),
              0 1px 2px rgba(0, 0, 0, 0.4);
}
.daily-column .day-section table {
  margin-bottom: 0.9rem !important;
}

/* Editorial date header: small caps flanked by hairlines */
.daily-column .date-separator::before,
.daily-column .date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  align-self: center;
  background: linear-gradient(90deg, transparent, var(--border-strong));
  margin-right: 12px;
  min-width: 24px;
}
.daily-column .date-separator::after {
  background: linear-gradient(90deg, var(--border-strong), transparent);
  margin-right: 0;
  margin-left: 12px;
}
.daily-column .date-separator .date-dropdown-trigger {
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f0f0f2;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-fast);
}

.daily-column tr.completed-task .task-title-link {
  text-decoration-color: rgba(255, 255, 255, 0.3) !important;
}
/* A finished priority is a win, so it settles to a lighter, calmer gold under the same
   soft strike as every other done row, rather than full gold struck through in gold,
   which read as olive on the tinted rows. (!important: the colour is inline, from
   TasksHelper#task_title_color.) */
tr.completed-task .task-title-link.is-priority {
  color: #e9d58a !important;
  text-decoration-color: rgba(255, 255, 255, 0.3) !important;
}

/* ---------- Checkboxes: smaller, calmer, springier ---------- */
.toggle-completed {
  width: 22px;
  height: 22px;
  /* Translucent white rather than a fixed gray, so the empty box takes on the row's own
     tint: #52525b sat muddy on the purple and brown rows. */
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.03);
  transition: border-color var(--dur-fast), background-color var(--dur-fast), transform var(--dur-fast);
}
.toggle-completed:hover {
  border-color: var(--accent);
  background-color: rgba(34, 197, 94, 0.12);
  box-shadow: none;
}
.toggle-completed:active { transform: scale(0.92); }
/* The app's accent green, the same as today on the calendar, the ring and New. */
.toggle-completed:checked {
  background: #22c55e;
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
/* The tick is drawn, not typed: a "✓" character took its shape and weight from whatever
   font the device had, and sat heavy and off-centre. Two sides of a box turned 45°, sized
   off the checkbox so any size of box gets the same tick; --check-stroke thins it for a
   small one (the month calendar's pills). */
.toggle-completed:checked::after {
  content: '';
  box-sizing: border-box;
  width: 30%;
  height: 54%;
  border: solid #06130a;
  border-width: 0 var(--check-stroke, 2px) var(--check-stroke, 2px) 0;
  border-radius: 0 0 1px 0;
  transform: translate(-50%, -62%) rotate(45deg);
}

@media (hover: hover) { /* ---------- Row action cells: tinted hints, not paint buckets ---------- */
#home-container .delete-cancel-cell:hover {
  background-color: rgba(239, 68, 68, 0.13) !important;
} }
@media (hover: hover) { #home-container .delete-cancel-cell:hover .fa-solid {
  color: #f87171 !important;
} }
@media (hover: hover) { #home-container .add-cell:hover {
  background-color: rgba(77, 159, 255, 0.13) !important;
} }
@media (hover: hover) { #home-container .add-cell:hover .fa-solid {
  color: #79b8ff !important;
} }
@media (hover: hover) { /* The category show page renders the same task rows outside #home-container. */
.category-show .delete-cancel-cell:hover { background-color: rgba(239, 68, 68, 0.13); } }
@media (hover: hover) { .category-show .delete-cancel-cell:hover .fa-solid { color: #f87171 !important; } }
@media (hover: hover) { .category-show .add-cell:hover { background-color: rgba(77, 159, 255, 0.13); } }
@media (hover: hover) { .category-show .add-cell:hover .fa-solid { color: #79b8ff !important; } }

/* ---------- Mini calendar ---------- */
.calendar-day,
.cal-oom-day {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}

/* Smaller digits without shrinking the cell: transform is visual-only,
   so the cell keeps the exact layout size of the full-size digits */
.calendar-day > span,
.cal-oom-day > span {
  display: inline-block;
  transform: scale(0.9);
}
.calendar-day:active,
.cal-oom-day:active { transform: scale(0.94); }

/* Lock view ("Show locks for the month" in the day-title dropdown): each locked
   weekday's day number is replaced by the number of the order it runs — 1 is the order
   most days share. Badges are always rendered and hidden here, so the
   toggle is instant. These selectors live next to the .calendar-day > span rule
   above and repeat its child combinator on purpose: a bare .cal-lock-badge rule
   loses to it on specificity, which leaves the badges permanently visible. */
.calendar-day > span.cal-lock-badge,
.cal-oom-day > span.cal-lock-badge {
  display: none;
  /* Laid over the cell rather than placed in it: the padlock plus the number is wider than
     a date, and the grid's 1fr columns size to their content, so an in-flow badge would
     widen every column the moment the lock view came on. Out of flow it cannot move a
     thing — the hidden date underneath goes on holding the cell's exact size. */
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  gap: 1.5px;
  white-space: nowrap;
  /* Tinted, because the badge is a number standing where a date normally is — the colour
     is what tells the two apart at a glance. */
  color: #4ade80;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.calendar-day > span.cal-lock-badge > i,
.cal-oom-day > span.cal-lock-badge > i {
  font-size: 0.62em;
  opacity: 0.8;
}
/* Only a badged cell hides its date, and it hides it with visibility so the cell keeps
   being sized by it. A day with no lock — unlocked weekday, or a past day that has
   diverged from its locked order — keeps showing its date, so the lock view never leaves
   blank cells. */
/* Every day in the lock view swaps its date for a badge — a number, or a dash where there
   is no locked order — so the view reads as one column of orders with no dates mixed in.
   Hidden with visibility so each cell keeps the exact size its date gave it. */
#month-calendar-grid.show-locks .calendar-day > span:not(.cal-lock-badge),
#month-calendar-grid.show-locks .cal-oom-day > span:not(.cal-lock-badge) {
  visibility: hidden;
}
#month-calendar-grid.show-locks .calendar-day > span.cal-lock-badge,
#month-calendar-grid.show-locks .cal-oom-day > span.cal-lock-badge {
  display: flex;
}
/* A dash is an absence, so it sits back rather than reading as a value. */
#month-calendar-grid.show-locks .calendar-day > span.cal-lock-badge.is-unlocked,
#month-calendar-grid.show-locks .cal-oom-day > span.cal-lock-badge.is-unlocked {
  color: #4a4a52;
  font-weight: 400;
}

/* Lock mode (lock_mode.js): the calendar becomes the picker for where a day's order
   applies. The month nav and month grid step aside for the mode's own grid — the weeks
   from the day being locked onward, across month ends — sized like the month grid it
   replaces. The only thing on it is the lock's reach: lit cells will start in this order,
   ringed ones keep a date-of-month lock of their own, faded ones are on or before the
   cutoff and never change, and the outlined one is the day being locked. */
/* !important: both carry an inline display. */
.schedule-calendar-panel.lock-mode-on > .schedule-month-nav,
.schedule-calendar-panel.lock-mode-on > #month-calendar-grid { display: none !important; }
.lm-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.13em;
}
/* The panel centres its children, which shrank the grid to its content; stretched, the
   cells have room for a date and a lock number side by side. */
.schedule-calendar-panel.lock-mode-on > .lm-grid,
.schedule-calendar-panel.lock-mode-on > .lock-mode-bar { align-self: stretch; }
.lm-grid .cal-wd-head {
  padding: 2px;
  border-radius: 5px;
  color: var(--text-2);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast), opacity var(--dur-fast);
}
.lm-grid .cal-wd-head:hover { background: rgba(255, 255, 255, 0.06); }
.lm-grid .cal-wd-head.lm-on {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text-1);
}
/* A cell: the date in the middle, the month's name top-left on its 1st, and the lock in
   the top-right corner (lock_mode.js paintBadge). */
.lm-cell {
  position: relative;
  padding: 17px 2px 9px;
  border-radius: 6px;
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
  transition: background-color var(--dur-fast), opacity var(--dur-fast);
}
/* The date is for finding your place; the lock is the point, so the date sits back in
   the month's shade, a step brighter where the fill would swallow it. */
.lm-num { color: var(--text-3); font-size: 1em; font-weight: 500; }
.lm-cell.lm-on .lm-num,
.lm-cell.lm-source .lm-num { color: var(--text-2); }
.lm-cell.lm-on { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--text-1); }
.lm-cell.lm-kept {
  outline: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: -2px;
}
.lm-cell.lm-past { opacity: 0.3; }
/* Filled like the lit days as well as outlined: it already runs this order, and an
   outline alone read as the one day left out. */
.lm-cell.lm-source {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--text-1);
  font-weight: 700;
  cursor: default;
}
/* Every cell's month, stacked down its left edge (S/E/P), so the run of dates never
   reads as one month. Centred on the date's line rather than the cell — the cell's top
   padding is the lock's room, so the cell's middle sat high, by the padlock. Out of flow,
   so the date stays centred. */
.lm-line { position: relative; display: block; }
.lm-mon {
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: upright;
  color: var(--text-3);
  font-size: 0.48em;
  font-weight: 600;
  letter-spacing: -0.12em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}
.lm-cell.lm-on .lm-mon,
.lm-cell.lm-source .lm-mon { color: var(--text-2); }
/* The lock the day runs now, muted; where this lock reaches, "1 → 4" in full colour. */
.lm-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  display: flex;
  align-items: center;
  gap: 2.5px;
  color: var(--text-3);
  font-size: 0.6em;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.lm-badge > i { font-size: 0.8em; opacity: 0.8; }
.lm-badge.lm-new { color: var(--text-1); font-weight: 700; }
/* The day being locked's own weekday is always included (lock_mode.js pick). */
.lm-grid:not(.lm-axis-month) .lm-fixed { cursor: default; }
.lm-grid:not(.lm-axis-month) .cal-wd-head.lm-fixed:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}
/* On the date-of-month axis the columns mean nothing, so the headers sit back. */
.lm-grid.lm-axis-month .cal-wd-head { opacity: 0.4; cursor: default; }
.lm-grid.lm-axis-month .cal-wd-head:hover { background: none; }

/* The bar above the calendar while it picks: what the lock will do, in a sentence that
   follows the picks, then Lock / Cancel. Dressed like .app-hint. Its own font-size, since
   the calendar panel sizes everything in it off a 100px em. */
.lock-mode-bar {
  margin: 0 0 8px; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 10px;
  background: linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)), var(--surface-pop);
  color: var(--text-2); font-size: var(--fs-12); font-weight: 400; line-height: 1.5; text-align: left;
  text-transform: none; letter-spacing: normal;
  animation: unplaced-caption-in var(--dur-base) ease-out;
}
/* The key under the lock grid (lock_mode.js buildKey): what the corner numbers mean. */
.lm-key {
  align-self: stretch;
  margin: 8px 2px 0;
  color: var(--text-3);
  font-size: var(--fs-11);
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
}
.lm-key i { font-size: 0.85em; margin-right: 2px; }
.lmb-head { display: flex; align-items: center; gap: 8px; color: var(--text-1); font-size: var(--fs-13); font-weight: 600; }
.lmb-head i { color: var(--accent); font-size: var(--fs-11); }
.lmb-range { margin-left: auto; color: var(--text-3); font-size: var(--fs-11); font-weight: 400; }
.lmb-seg { display: inline-flex; gap: 2px; margin: 8px 0 6px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); }
.lmb-seg button {
  padding: 2px 10px; border: none; border-radius: 999px; background: none;
  color: var(--text-3); font: inherit; cursor: pointer;
}
.lmb-seg button.is-active { background: var(--surface-3); color: var(--text-1); }
.lmb-text { margin: 0; }
.lmb-text strong { color: var(--text-1); font-weight: 600; }
/* What the lock would replace (lock_mode.js overwriteNote). */
.lmb-note { display: flex; gap: 6px; margin: 6px 0 0; color: var(--text-1); }
.lmb-note[hidden] { display: none; }
.lmb-note i { margin-top: 3px; color: var(--text-3); font-size: var(--fs-11); }
.lmb-extra { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lmb-extra[hidden], .lmb-chip[hidden] { display: none; }
.lmb-chip {
  padding: 2px 9px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px;
  background: none; color: var(--text-2); font: inherit; cursor: pointer;
}
.lmb-chip.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.lmb-clear { border-color: rgba(217, 138, 138, 0.35); color: #d98a8a; }
.lmb-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.lmb-actions button { padding: 4px 14px; border: none; border-radius: 999px; font: inherit; cursor: pointer; }
.lmb-cancel { background: none; color: var(--text-3); }
.lmb-cancel:hover { color: var(--text-1); }
.lmb-lock { background: var(--accent); color: #06130a; font-weight: 600; }
.lmb-lock:disabled { opacity: 0.4; cursor: default; }

/* ---------- Categories column ---------- */
/* Soft drop shadow under each category card (wrapper has no bg of its own) */
#categories-list > div.handle {
  filter: drop-shadow(0 9px 22px rgba(0, 0, 0, 0.45));
  transition: filter var(--dur-base) ease;
}

/* ============================================================
   HOME INSPIRATION — the one card in the categories column before the day's review
   (calendars/_home_inspiration): a line at a time, set like the inspirations board
   (INSPIRATIONS below), with arrows and dots to move through a few.
   ============================================================ */
.home-insp {
  position: relative;
  margin: 1.3rem 0 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  background-color: var(--surface-card);
  background-image: var(--sheen);
  box-shadow: inset 0 1px 0 var(--inset-light), var(--shadow-card);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.home-insp:hover { border-color: var(--border-strong); }
.home-insp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A pinned line wears the board's gold top edge. */
.home-insp.is-pinned { box-shadow: inset 0 2px 0 var(--gold-bright), var(--shadow-card); }
.home-insp-slide { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 1.15rem 1.25rem 0.35rem; animation: home-insp-in var(--dur-base) ease; }
.home-insp-slide[hidden] { display: none; }
@keyframes home-insp-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .home-insp-slide { animation: none; } }
.home-insp-slide.has-image { padding-top: 0; }
.home-insp-image { display: block; margin: 0 -1.25rem; }
.home-insp-image img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.home-insp-quote {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
  color: var(--text-1);
  font-family: Newsreader, Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  text-wrap: pretty;
}
.home-insp-quote:hover { color: #fff; }
.home-insp-quote.is-short { font-size: 22px; line-height: 1.3; }
.home-insp-quote.is-medium { font-size: 18px; }
.home-insp-quote.is-long { font-size: 15.5px; line-height: 1.5; }
.home-insp-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.home-insp-tag { color: var(--text-3); font-size: var(--fs-12); text-decoration: none; }
.home-insp-tag:hover { color: #93c5fd; }
.home-insp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0.55rem 0.75rem 0.6rem 1.25rem; }
.home-insp-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.home-insp-label:hover { color: var(--text-2); }
.home-insp.is-pinned .home-insp-label i { color: var(--gold-bright); }
.home-insp-nav { display: flex; align-items: center; gap: 2px; }
.home-insp-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-3);
  font-size: var(--fs-11);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.home-insp-arrow:hover { background: var(--hairline); color: var(--text-1); }
.home-insp-dots { display: inline-flex; gap: 4px; padding: 0 2px; }
.home-insp-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); transition: background-color var(--dur-fast), width var(--dur-fast); }
.home-insp-dot.is-on { width: 12px; border-radius: 3px; background: var(--text-2); }
/* None yet: a dashed card to add the first. */
.home-insp-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.3rem 0 1.25rem;
  padding: 1.1rem 1.25rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-3);
  font-family: Newsreader, Georgia, serif;
  font-size: 17px;
  text-decoration: none;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.home-insp-empty i { font-size: var(--fs-13); }
.home-insp-empty:hover { border-color: var(--accent); color: var(--accent-bright); }

/* ---------- Sidebar ---------- */
/* The row itself paints nothing; its links light as pills (see "after X's"). The
   radius is kept: rail mode still paints an active row background below. */
#app-sidebar > ul:first-of-type > li {
  border-radius: var(--radius-md);
}

/* Row utility icons (cancel ×, add +) stay ghosted until the row is hovered */
#home-container .task-row .delete-cancel-cell i,
#home-container .task-row .add-cell i,
#home-container .block-cancel-row .add-task-button i {
  opacity: 0.28;
  transition: opacity var(--dur-fast);
}
@media (hover: hover) {
  #home-container .task-row:hover .delete-cancel-cell i,
  #home-container .task-row:hover .add-cell i,
  #home-container .block-cancel-row:hover .add-task-button i {
    opacity: 1;
  }
}

/* Block groups: vibrant solid hairline with an inset glow to make the enclosure pop */
.daily-column .block-group-row {
  border-left: 3px solid var(--block-border-color, #5b9cf6) !important;
  border-right: 3px solid var(--block-border-color, #5b9cf6) !important;
  box-shadow: inset 3px 0 10px -5px rgba(91, 156, 246, 0.55),
              inset -3px 0 10px -5px rgba(91, 156, 246, 0.55) !important;
}
.daily-column .block-group-row.group-end,
.daily-column .block-group-row.group-end td {
  border-bottom: 3px solid var(--block-border-color, #5b9cf6) !important;
}
.daily-column .block-task {
  border-top: 3px solid var(--block-border-color, #5b9cf6) !important;
  box-shadow: inset 0 3px 10px -5px rgba(91, 156, 246, 0.55) !important;
}

/* Two blocks touching: drop the upper block's bottom border so the shared hairline is the
   lower block's top border, tinted with the incoming area of interest. Needed because the
   schedule tables use border-collapse: collapse, and a 3px-vs-3px tie resolves in favor of
   the upper row — which would otherwise paint the boundary in the outgoing block's color. */
.block-group-row.group-end:has(+ tr.block-task),
.block-group-row.group-end:has(+ tr.block-task) td {
  border-bottom: none !important;
}

/* ...and draw that shared hairline as a 3px inset shadow along the top of the lower row's
   cells instead, its collapsed top border dropped. The collapsed border stopped short at
   both ends (the corner squares belong to the upper row's side borders, so the line was
   capped in the outgoing block's colour); this one runs the full width, the side borders'
   own top ends included, in the incoming block's colour. It used to be an overlay on
   positioned cells, and Safari draws a positioned cell's share of the table's borders on
   a layer of its own, unevenly. */
.daily-column tr.group-end + tr.block-task,
.daily-column tr.group-end + tr.block-task > td {
  border-top: none !important;
}
.daily-column .day-table tr.group-end + tr.block-task > td,
.daily-column tr.group-end + tr.block-task > td {
  /* !important: the row-gap rules below (.day-table … > td) match these cells as closely. */
  box-shadow: inset 0 3px 0 var(--block-border-color, #5b9cf6) !important;
}
.daily-column .day-table tr.group-end + tr.block-task.block-enclosure-ghost > td,
.daily-column tr.group-end + tr.block-task.block-enclosure-ghost > td {
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--block-border-color, #5b9cf6) 40%, #1a1a1e) !important;
}

/* Cancelled-block enclosure preserved client-side on completed members: fade the border
   to match the ghosted header/footer rows (which dim via row opacity). */
.daily-column .block-group-row.block-enclosure-ghost {
  border-left-color: color-mix(in srgb, var(--block-border-color, #5b9cf6) 40%, #1a1a1e) !important;
  border-right-color: color-mix(in srgb, var(--block-border-color, #5b9cf6) 40%, #1a1a1e) !important;
  box-shadow: inset 3px 0 10px -5px rgba(91, 156, 246, 0.16),
              inset -3px 0 10px -5px rgba(91, 156, 246, 0.16) !important;
}
.daily-column .block-group-row.block-enclosure-ghost.group-end,
.daily-column .block-group-row.block-enclosure-ghost.group-end td {
  border-bottom-color: color-mix(in srgb, var(--block-border-color, #5b9cf6) 40%, #1a1a1e) !important;
}
.daily-column .block-task.block-enclosure-ghost {
  border-top-color: color-mix(in srgb, var(--block-border-color, #5b9cf6) 40%, #1a1a1e) !important;
  box-shadow: inset 0 3px 10px -5px rgba(91, 156, 246, 0.16) !important;
}
/* The day-title padlock. One rule for both states — the open one is built in JS
   (task_drag.js) and the closed one server-side (calendars/_day_lock_saved), and they
   replace each other in place, so any difference in size, colour or spacing would read
   as the date title twitching. The open state carries this on its <a> wrapper and the
   closed state on the <i> itself; the glyph inherits either way. */
/* The second selector overrides the date-title styling above (15px, near-white): the
   closed padlock shares the .date-dropdown-trigger binding to stay clickable, but it
   must not inherit the title's size or colour along with it.
   The gap to the title is padding, not margin: the two open the same dropdown, and a
   margin left a dead strip between them where the pointer dropped back to an arrow. */
.day-lock-icon,
.daily-column .date-separator .day-lock-icon {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  padding-left: 6px;
  font-size: var(--fs-12);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: #777;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--dur-fast);
}
/* The date title and the padlock beside it are one control — same dropdown, either half
   — so there is one hover rule for the pair, on the wrapper that holds both, and both go
   to the same white. Every per-element :hover on them was removed: two elements lighting
   to two different colours on two different triggers is what read as flicker when the
   cursor crossed from one to the other.
   text-decoration is restated because the open padlock is an <a>, and the global
   `a:hover {text-decoration: underline}` (0,1,1) outranks .day-lock-icon's reset. */
.date-title-line:hover .date-dropdown-trigger,
.date-title-line:hover .day-lock-icon {
  color: #fff;
  text-decoration: none;
}
/* The day card's own foot: a rule above it rather than a box of its own, so it reads as
   the day's summary, not a widget below it. */
.day-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 10px 0;
  margin: 0.5rem 0 0.25rem;
  border-top: 1px solid #2d2d33;
}
.day-footer svg { display: block; }
.day-footer-ring {
  display: flex;
  align-items: center;
  gap: 6px;
}
.day-footer-total-count {
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.day-footer-divider {
  width: 1px;
  align-self: stretch;
  background-color: #383840;
}
.day-footer-breakdown {
  display: flex;
  align-items: center;
  gap: 8px;
}
.day-footer-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.day-footer-chip i { font-size: var(--fs-9); }
.day-footer-chip--onetime i { color: #4a9edd; }
.day-footer-chip--recurring i { color: #a78bfa; }
/* No habits yet: one plain count, "1 of 2 done", in place of the fraction and its
   habits / one-offs breakdown (User#simple_day_footer?). */
.day-footer-simple-count { display: none; font-size: var(--fs-12); font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.day-footer.is-simple .day-footer-total-count,
.day-footer.is-simple .day-footer-divider,
.day-footer.is-simple .day-footer-breakdown { display: none; }
.day-footer.is-simple .day-footer-simple-count { display: inline; }


/* Daily rule/value rows rendered in the schedule column below the task list */
.day-rule-row,
.day-value-row {
  height: 36px;
  transition: background-color var(--dur-fast) ease;
}
@media (hover: hover) {
  .day-rule-row:hover,
  .day-value-row:hover {
    background-color: rgba(255, 255, 255, 0.035);
  }
}
.day-item-icon-cell {
  box-sizing: border-box;
  padding: 0.45rem 0 0.45rem 0.5rem;
  vertical-align: middle;
}
.day-item-title-cell {
  box-sizing: border-box;
  padding: 0.45rem 0 0.45rem 0.4rem;
  vertical-align: middle;
  text-align: left;
}
/* A rule, value or thing's name takes the row's width and wraps to a second line before
   it's cut — "Phone stays out of the …" was clipped with half the row empty. The review
   tables give the name every pixel the icon and dials don't use (34px | rest | 150px). */
.day-item-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
/* The rating key's sample dots (the review's one-time hint). */
.rating-key { white-space: nowrap; }
.rating-key i { display: inline-block; width: 9px; height: 9px; margin: 0 4px 0 2px; border: 2px solid var(--k); border-radius: 50%; vertical-align: -1px; }
.day-item-dots-cell {
  box-sizing: border-box;
  vertical-align: middle;
  text-align: right;
  white-space: nowrap;
}
.day-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}
.day-item-chip {
  background-color: #374151;
  color: #9ca3af;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  font-size: var(--fs-10);
  font-weight: 500;
  white-space: nowrap;
}
.review-cadence-glyph { cursor: help; }
/* Beside a self-scoring rule or value's name (AutoExplanationHelper#auto_mark); the hover
   says what it reads and the figures each status takes. */
.auto-mark { flex: 0 0 auto; color: var(--text-3); font-size: var(--fs-10); line-height: 1; cursor: help; }
.auto-mark:hover { color: var(--accent); }

/* The schedule's day tables (calendars/_task_schedule): the day's tasks, and under them its
   ratings (.is-compact). */
.day-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 2rem; }
.day-table.is-compact { width: 98%; margin-bottom: 0.5rem; }
/* A 1px gap between one task and the next, so a run of the same area reads as its tasks
   rather than one slab of colour: the day panel's own colour (.day-section, rgba(6, 6, 8, 0.72)
   over the black page), so it reads as space, not a shade. Drawn as an inset shadow on the
   cells (the tint is the row's): it takes no height, so no row moves and drag-and-drop lands
   as it did. */
.daily-column .day-table tr.task-row:has(+ tr.task-row) > td { box-shadow: inset 0 -1px 0 rgb(4, 4, 6); }
/* None inside a block, so its tasks read as one enclosure, nor along its bottom, which its
   own border draws. The block's side glow is the row's shadow, not the cells', so it stays. */
.daily-column .day-table tr.block-group-row:has(+ tr.block-group-row) > td,
.daily-column .day-table tr.task-row.block-group-row.group-end:is(tr) > td { box-shadow: none; }

/* ---- Home for a long history: folded subcategory lists; the calendar key ---- */
.categories-column tr.is-folded-row { display: none; }
.cat-more-row td { padding: 4px 0 8px; text-align: center; }
.cat-more-btn {
  padding: 4px 12px; border: 1px dashed var(--border-strong); border-radius: 999px; background: none; cursor: pointer;
  color: var(--text-2); font-size: var(--fs-12);
}
.cat-more-btn:hover { color: var(--text-1); border-color: var(--text-3); }
.mini-cal-key {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 8px 0 0;
  color: var(--text-3); font-size: 10px; line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  max-width: 230px;
  margin-inline: auto;
}
.mini-cal-key span { display: inline-flex; align-items: center; gap: 4px; }
.mini-cal-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.mini-cal-key i.is-good { background: rgba(34, 197, 94, 0.5); }
.mini-cal-key i.is-soso { background: rgba(249, 115, 22, 0.45); }
.mini-cal-key i.is-rough { background: rgba(239, 68, 68, 0.5); }
.mini-cal-key i.is-open { background: var(--surface-3); }
/* The mini calendar's key: just under its box, only while the calendar is hovered. */
.schedule-calendar-panel { position: relative; }
.schedule-calendar-panel > .mini-cal-key {
  position: absolute; top: calc(100% + 6px); left: 50%; z-index: 5; width: max-content; max-width: none;
  margin: 0; transform: translateX(-50%); white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s ease, visibility 0.12s;
}
.schedule-calendar-panel:hover > .mini-cal-key { opacity: 1; visibility: visible; }
@media (hover: none) { .schedule-calendar-panel > .mini-cal-key { display: none; } }
/* A subtask's "⌘: Parent" in the schedule's icon cell: on a phone, just the icon. */
@media (max-width: 640px) { .subtask-parent-rest { display: none; } }

/* ---- Home polish ---- */
/* The footer reads "13 of 37 done"; the habits' own count was that number again, so it
   goes, and the one-off count shows only when the day has one-offs. */
.day-footer .day-footer-total-count { display: none; }
.day-footer .day-footer-simple-count { display: inline; }
.day-footer .day-footer-chip--recurring { display: none; }
.day-footer.no-onetime .day-footer-divider,
.day-footer.no-onetime .day-footer-breakdown { display: none; }
.day-footer-chip-label { color: var(--text-3); font-weight: 500; }

/* The journal's row: "Journal:" and the entry on one line, four lines in all, then it stops.
   The entry's grey here too, so the clamp's "…" reads as part of the entry. */
.journal-inline-line {
  color: #6c757d;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}

/* Which of several same-named habits a row is ("Work 2"), beside its title. */
.task-name-hint { margin-left: 0.4rem; color: var(--text-3); font-size: var(--fs-11); }
/* A task page's benefits: "Show more" under the list (the + is by the label). */
.task-benefits-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.task-benefits-foot:empty { display: none; }
.show-btn[hidden] { display: none; }
.task-benefits-foot { align-items: center; }

/* Plan tomorrow (after Sleep): up to three of what's waiting, or a new one. */
.plan-tomorrow-already { display: flex; gap: 8px; align-items: baseline; margin: 0 0 12px; color: var(--text-3); font-size: var(--fs-12); }
.plan-tomorrow-list { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; padding: 0; list-style: none; }
.plan-tomorrow-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--text-1); font-size: var(--fs-13); cursor: pointer; }
@media (hover: hover) { .plan-tomorrow-option:hover { background: var(--surface-2); } }
.plan-tomorrow-option input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.plan-tomorrow-option:has(input:disabled) { opacity: 0.45; cursor: default; }
.plan-tomorrow-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-tomorrow-tag { flex-shrink: 0; padding: 1px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-3); font-size: var(--fs-11); }
.plan-tomorrow-tag.is-priority { border-color: rgba(212, 184, 74, 0.45); color: #d4b84a; }
.plan-tomorrow-tag.is-overdue { border-color: rgba(239, 68, 68, 0.4); color: #f87171; }
.plan-tomorrow-empty { margin: 0 0 12px; color: var(--text-3); font-size: var(--fs-13); }
.plan-tomorrow-skip { padding: 8px 12px; border: none; background: none; color: var(--text-3); font: inherit; font-size: var(--fs-13); cursor: pointer; }
.plan-tomorrow-skip:hover { color: var(--text-1); }
.plan-tomorrow-submit { padding: 9px 16px; border: none; border-radius: var(--radius-md); background: var(--accent); color: #04110a; font: inherit; font-size: var(--fs-13); font-weight: 600; cursor: pointer; }


/* ==========================================================================
   FIRST-TASK FOCUS — a new account's "one thing today" as the whole page
   (task_form_button.js, enterFirstTaskFocus). Everything but the day and its
   form dims; it fades back when the task is saved or the moment is left.
   ========================================================================== */
body.first-task-focus #categories,
body.first-task-focus .daily-column .calendar-row,
body.first-task-focus .daily-column .home-reveal-bar,
body.first-task-focus .daily-column [class$="-past-days"],
body.first-task-focus .daily-column [class$="-future-days"],
body.first-task-focus .dashboard-corner,
body.first-task-focus #app-sidebar,
body.first-task-focus .mobile-header,
body.first-task-focus .mobile-footer {
  opacity: 0.14;
  filter: saturate(0.3);
  transition: opacity 0.5s ease, filter 0.5s ease;
}
body.first-task-fading #categories,
body.first-task-fading .daily-column .calendar-row,
body.first-task-fading .daily-column .home-reveal-bar,
body.first-task-fading .daily-column [class$="-past-days"],
body.first-task-fading .daily-column [class$="-future-days"],
body.first-task-fading .dashboard-corner,
body.first-task-fading #app-sidebar,
body.first-task-fading .mobile-header,
body.first-task-fading .mobile-footer {
  transition: opacity 0.7s ease, filter 0.7s ease;
}
/* The form itself lifts a little off the dimmed page. */
.new-task-form-row.is-first-task .task-form-card { transition: box-shadow 0.5s ease; }
body.first-task-focus .new-task-form-row.is-first-task .task-form-card {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.32), 0 24px 60px -24px rgba(34, 197, 94, 0.35);
}
@media (prefers-reduced-motion: reduce) {
  body.first-task-focus *, body.first-task-fading * { transition: none !important; }
}

/* An account with no categories: the shared empty panel, spaced like a category card. */
.home-empty-categories { margin-top: 21px; }
/* Plan tomorrow's ticks in the app's own style (a task row's box), not the browser's
   white square. */
.plan-tomorrow-option input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; position: relative; display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--border-strong); border-radius: 5px;
  background: transparent; cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast);
}
.plan-tomorrow-option input[type="checkbox"]:hover { border-color: var(--accent); }
.plan-tomorrow-option input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent); }
.plan-tomorrow-option input[type="checkbox"]:checked::after {
  content: ''; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid #04140a; border-bottom: 2px solid #04140a; transform: rotate(-45deg);
}
.plan-tomorrow-option input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* A day's rules drag into the Home schedule order (schedule_rules_controller); the icon
   is the obvious place to grab, since the title opens the rule and the dials rate it. */
[data-controller~="schedule-rules"] .day-rule-row .day-item-icon-cell { cursor: grab; }
[data-controller~="schedule-rules"] .day-rule-row.ledger-ghost { opacity: 0.4; }

/* Home's journal box starts two lines tall and grows as it's written in (jd-autogrow,
   journal_draft.js), rather than opening as a third of a phone screen. */
.daily-column .jd-form-entry.jd-autogrow { min-height: calc(2 * 1.35em + 20px); }

/* The repeat mark on a recurring row (a habit with no reading yet, a place with no spot
   picked): smaller and fainter than the title's text, there without drawing the eye.
   Readings and picked spots keep their own size. */
.task-row .dynamic-aspect > .fa-rotate,
.task-row .place-day:not(.is-set) > .fa-rotate { font-size: 0.8em; opacity: 0.7; vertical-align: middle; position: relative; top: -0.5px; }
