/* ============================================================
   POSTS — the month card's strip (posts/_summary), on the Posts page
   ============================================================ */

.posts-summary { margin-bottom: 24px; }
.posts-strip .ledger-day { cursor: default; }
/* A day something shipped. Flat rather than shaded by count — the run is the point. */
.posts-strip .ledger-day.is-rated { --fill: var(--accent); }
/* With a daily goal, each day is a stack of pills, one per post the goal asks for,
   filled from the top as posts go out. A met day's number lights too. */
.posts-summary .ledger-strip.is-summary .ledger-day.has-goal {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 4px;
  height: auto;
  background: none;
  box-shadow: none;
}
/* Tall enough that seven a day still read as segments (about 6px each). */
.posts-pills { display: flex; flex-direction: column; gap: 2px; height: 54px; border-radius: 3px; }
.posts-pill { flex: 1 1 0; min-height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
.posts-pill.is-filled { background: var(--accent); }
.ledger-day.is-future .posts-pill:not(.is-filled) { background: rgba(255, 255, 255, 0.03); }
/* Dated but not published yet: an outlined pill after the filled ones, red once its day
   has passed — the same red the Publish rows keep for overdue posts. */
.posts-pill.is-planned,
.ledger-day.is-future .posts-pill.is-planned { background: none; box-shadow: inset 0 0 0 1px var(--accent); }
.posts-pill.is-planned.is-overdue { box-shadow: inset 0 0 0 1px var(--danger-bright); }
.posts-strip .ledger-day.is-planned { box-shadow: inset 0 0 0 1.5px var(--accent); }
.posts-strip .ledger-day.is-planned.is-overdue { box-shadow: inset 0 0 0 1.5px var(--danger-bright); }
.ledger-day.is-today .posts-pills { outline: 1.5px solid var(--text-1); outline-offset: 1px; }
.posts-day-num { color: var(--text-3); font-size: var(--fs-9); line-height: 1; text-align: center; }
.ledger-day.is-met .posts-day-num { color: var(--accent); }
/* Pulled posts still fill their slot, striped: it went out, then came down. Posts pushed
   to the next day because the ones before did well fill the day they left in a darker
   green. Both come after the day's plain pills. */
.posts-pill.is-filled.is-pulled {
  background: repeating-linear-gradient(-45deg, var(--accent) 0 2px, color-mix(in srgb, var(--accent) 30%, transparent) 2px 4px);
}
.posts-pill.is-filled.is-pushed { background: color-mix(in srgb, var(--accent) 55%, #000); }
/* A favorite (starred) post that went out: gold. */
.posts-pill.is-filled.is-favorite { background: var(--gold-bright); }
/* A time marked missed in the Posts Lab: nothing went out. Red, in its place; not counted. */
.posts-pill.is-missed, .ledger-day.is-future .posts-pill.is-missed { background: var(--danger-bright); }
.posts-day-foot { display: flex; align-items: center; justify-content: center; gap: 3px; }
/* The Posts Lab's strip: posts brainstormed that day above its stack, red short of the
   goal, green at it. Every day keeps the row, empty ahead of today, so the stacks stay level. */
.posts-idea-count { height: 12px; color: var(--text-3); font-size: var(--fs-9); font-weight: 700; line-height: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.posts-idea-count.is-short { color: var(--danger-bright); }
.posts-idea-count.is-met { color: var(--accent-bright); }
/* Under the day's number: whether that day's likes guess was right. Hung below it, so the
   numbers stay evenly spaced and the stacks level. */
.posts-day-foot:has(.posts-guess-mark) { position: relative; }
.posts-guess-mark { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; font-size: 8px; line-height: 1; }
.posts-summary .ledger-strip:has(.posts-guess-mark) { padding-bottom: 10px; }
.posts-guess-mark.is-right { color: var(--accent-bright); }
.posts-guess-mark.is-wrong { color: var(--danger-bright); }
/* Posts beyond the day's goal: a dot each under the full stack. The row is kept on every
   day, empty or not, so the stacks stay level. */
.posts-extras { display: flex; justify-content: center; gap: 2px; height: 3px; margin-top: -1px; }
.posts-extra-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
/* A weekly goal: the week's days as usual, with a bar of segments beneath. A monthly
   goal: one bar under the strip. */
.posts-strip .ledger-week.has-goal { flex-wrap: wrap; row-gap: 5px; }
.posts-bar { display: flex; gap: 2px; height: 6px; }
.posts-strip .posts-bar { flex: 1 0 100%; }
.posts-bar .posts-pill { min-height: 0; }
.posts-month-bar { margin-top: 8px; }
.posts-month-bar .posts-bar { height: 8px; }
@media (max-width: 720px) {
  .posts-day-num { display: none; }
  /* The summary fits a phone: its counts wrap under the month, the strip drops its day
     numbers (the cells keep their colour), and the goal stays folded to its chip. */
  .posts-summary .ledger-summary-top { flex-wrap: wrap; row-gap: 6px; }
  .posts-summary .ledger-summary-stats { text-align: left; }
  .posts-summary.ledger-summary .ledger-strip.is-summary .ledger-day { font-size: 0; }

}

/* The month navigator, at the summary's size rather than a page title's. */
.posts-summary .ledger-summary-top { align-items: center; }
.posts-month-nav { flex-shrink: 0; gap: 2px; white-space: nowrap; }
.posts-summary .ledger-summary-stats { text-align: right; }
.posts-month-nav .ledger-nav-btn { width: 24px; height: 24px; border-color: transparent; font-size: var(--fs-10); }
.posts-month-nav .ledger-nav-btn:hover { border-color: var(--border); }
.posts-month-nav .ledger-month-label { min-width: 0; height: 24px; padding: 0 8px; font-size: var(--fs-13); }
.posts-month-nav .ledger-month-menu { right: auto; left: 0; }
.posts-month-today { margin-left: 6px; color: var(--text-3); font-size: var(--fs-11); text-decoration: none; }
.posts-month-today:hover { color: var(--accent-bright); }

/* The column is a writing measure, so the summary's day numbers are tighter here than on
   the wider index pages. */
.posts-summary .ledger-strip.is-summary { gap: 4px; }
.posts-summary .ledger-strip.is-summary .ledger-week { gap: 1px; }
.posts-summary .ledger-strip.is-summary .ledger-day { height: 24px; font-size: var(--fs-9); }

/* ============================================================
   POSTS — character counts and the form footer
   ============================================================ */

/* Against X's limit: amber close to it, red past it (posts_lab/_char_count, _row_text). */
.post-length.is-near { color: var(--gold-bright); }
.post-length.is-over { color: var(--danger-bright); font-weight: 600; }
/* Cancel is a link in the footer, not a bordered button. */
button.task-form-footer-link { border: none; background: none; font: inherit; cursor: pointer; }

.is-unset { opacity: 0.25; }

/* ---------- Show pages ---------- */
/* Everything here is built from the shared tokens so every show page (tasks, categories,
   areas, trackers, journals, posts, sections) reads as part of the app rather than
   as a one-off: cards share the home columns' surface and sheen,
   and every interactive piece gets real :hover / :focus-visible states. */
.show-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  --status-complete: var(--accent);
  --status-neutral: var(--gold);
  --status-failed: var(--danger-bright);
  --status-none: var(--surface-3);
}

.show-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  font-size: var(--fs-13);
  color: var(--text-3);
}
.show-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.show-back:hover { background: var(--surface-2); border-color: var(--border); color: var(--text-1); }
.show-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem; min-width: 0; }
.show-crumbs a { color: var(--text-2); text-decoration: none; }
.show-crumbs a:hover { color: var(--text-1); text-decoration: underline; }
.show-crumbs a.is-parent { color: var(--text-2); font-weight: 500; }
.show-crumb-sep { color: var(--text-3); }

.show-card {
  background-color: var(--surface-card);
  background-image: var(--sheen);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  /* Picked up by the shared deadline-history band so it lines up with the card body. */
  --band-pad-x: 20px;
  --band-divider: none;
}
.show-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid var(--border-panel);
}
.show-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.show-card-title i { color: var(--text-3); }
.show-spacer { flex: 1; }
.show-card-body { padding: 16px 20px 20px; }

.show-hero { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.show-hero-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0.75rem 1rem; }
.show-title {
  flex: 1 1 18rem;
  min-width: 0;
  margin: 0;
  font-size: var(--fs-24);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-1);
  overflow-wrap: anywhere;
}
.show-title-icon { margin-right: 0.4em; color: var(--show-accent, var(--text-2)); }
.show-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
/* Phones: the title gets the full width and the actions, labels kept, drop to a row of
   their own under it — squeezed beside it, "Read 20 pages" broke in two and the buttons
   lost their words. A source pill keeps just its title. */
@media (max-width: 600px) {
  .show-hero-row { flex-direction: column; align-items: stretch; }
  .show-title { flex: none; font-size: var(--fs-20); }
  .show-actions { flex-wrap: wrap; }
  .meta-pill-extra { display: none; }
  /* A page whose actions are just Edit and ⋯ (a tracker) keeps them beside the title. */
  .show-hero-row.is-inline-actions { flex-direction: row; flex-wrap: nowrap; align-items: center; }
  .show-hero-row.is-inline-actions .show-title { flex: 1 1 auto; min-width: 0; }
  .show-hero-row.is-inline-actions .show-actions { flex: none; flex-wrap: nowrap; }
}
.show-actions form { margin: 0; }
.show-actions .mark-completed-btn { display: inline-flex; width: auto; height: 32px; padding: 0 12px; }

.show-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.show-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-1); }
.show-btn:focus-visible,
.show-back:focus-visible,
.subtasks-add-row:focus-visible,
.cal-day:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.show-btn:disabled { opacity: 0.6; cursor: default; }
.show-btn.is-sm { height: 28px; padding: 0 10px; font-size: var(--fs-12); }
.show-btn.is-icon { width: 32px; padding: 0; }
.show-btn.is-icon.is-sm { width: 28px; }
.show-btn.is-danger { color: var(--text-3); border-color: transparent; }
.show-btn.is-danger:hover {
  color: var(--danger-bright);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.show-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.meta-pill {
  --pill: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--pill) 28%, transparent);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--pill) 12%, transparent);
  color: var(--pill);
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1.4;
}
.meta-pill i { font-size: var(--fs-12); opacity: 0.85; }
.meta-pill.is-recurring { --pill: var(--accent-bright); }
.meta-pill.is-priority { --pill: var(--danger-bright); }

.show-section { padding: 16px 20px 20px; border-top: 1px solid var(--border-panel); }
.show-label {
  display: block;
  margin: 0 0 10px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.show-info {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--recess);
  color: var(--text-1);
  font-size: var(--fs-14);
  line-height: 1.6;
  white-space: pre-wrap;
  border-left-color: var(--show-accent, var(--border-strong));
}
.show-info + .show-info { margin-top: 8px; }

/* Info on a task's show page is editable in place: each note is a .show-info that
   opens a textarea when clicked, and an always-present form sits below to add one. */
.task-info-box .pencil-note-item + .pencil-note-item,
.task-info-box .pencil-note-item + .task-info-form { margin-top: 8px; }
.task-info-box .pencil-note-display { cursor: pointer; }
.task-info-box .pencil-note-display:hover { border-left-color: var(--blue); }
.show-input.is-area {
  /* The global auto-expand sets an inline height from scrollHeight as you type, so the
     box grows with the text; overflow stays hidden so no scrollbar flashes mid-growth. */
  height: auto;
  min-height: 56px;
  padding: 8px 10px;
  line-height: 1.5;
  overflow-y: hidden;
  resize: vertical;
}
.task-info-form { margin-top: 8px; }
/* Scoped to [hidden] for the reason spelled out on .task-details-form below: an
   unscoped display rule here would outrank the browser's and pin the form open. */
.task-info-form[hidden] { display: none; }
/* The line under a section label that says how the section is meant to be used. */
.show-hint { margin: -6px 0 10px; font-size: var(--fs-12); color: var(--text-3); line-height: 1.4; }
/* Details is one long box rather than a row of short notes, so it starts taller. */
.show-input.is-area.is-tall { min-height: 160px; }
/* The editor sits behind the closed display, opened by the hidden attribute. A plain
   `display: block` here would outrank the browser's own [hidden] rule and leave the
   textarea showing under the text — one Details box reading as two. */
.task-details-form[hidden] { display: none; }
.task-details-display { cursor: pointer; }
.task-details-display:hover { border-left-color: var(--blue); }
/* Nothing written yet: the prompt reads as a placeholder, not as saved text. */
.task-details-display.is-empty { color: var(--text-3); font-style: italic; }
.task-details-foot { margin-top: 10px; }
/* A habit's log (tasks/_task_log): the values it's rated on as chips with a picker for
   another, then one block per recent time it happened — the date and its dots, that day's
   note under them — running edge to edge under the section's padding. */
.task-log-select { width: auto; min-width: 160px; }
.task-log-wrap { margin: 0; }
/* Sized by its dots, not squeezed to the card: on a phone the wrap scrolls it sideways. */
.show-table.task-log-table { table-layout: auto; }
.show-table.task-log-table td { padding-top: 8px; padding-bottom: 8px; vertical-align: top; }
.show-table.task-log-table tbody tr:first-child td { border-top: 1px solid var(--border-panel); }
.show-table.task-log-table tbody:first-of-type tr:first-child td { border-top: none; }
.show-table.task-log-table thead + tbody tr:first-child td { border-top: none; }
@media (hover: hover) { .show-table.task-log-table tbody tr:hover td { background: none; } }
.show-table.task-log-table th:not(:first-child), .task-log-dots { text-align: center; }
.show-table.task-log-table .task-log-date { width: 1%; white-space: nowrap; color: var(--text-2); line-height: 22px; }
.task-log-dots { white-space: nowrap; }
.show-table.task-log-table tr.task-log-note-row td { border-top: none; padding-top: 0; }
.show-table.task-log-table .task-log-note-cell { white-space: normal; text-align: left; }
.task-log-date-btn, .task-log-note-text {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.task-log-date-btn { color: var(--text-2); }
.task-log-date-btn:hover { color: var(--text-1); text-decoration: underline; text-underline-offset: 3px; }
.task-log-note-text {
  display: block;
  color: var(--text-1);
  font-size: var(--fs-13);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task-log-note-text:hover { color: var(--blue); }
/* A line of each note, the picked day's in full (task_show_controller.js marks it). */
.task-log-day:not(.is-picked) .task-log-note-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; white-space: normal; color: var(--text-2); }
.task-log-day.is-picked .task-log-date-btn { color: var(--text-1); font-weight: 600; }
.show-table.task-log-table .task-log-note-add-cell { width: 1%; padding-left: 0; text-align: right; }
.task-log-note-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-3);
  font-size: var(--fs-12);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--dur-fast), color var(--dur-fast);
}
.task-log-day:hover .task-log-note-add, .task-log-note-add:focus-visible { opacity: 1; }
.task-log-note-add:hover { color: var(--text-1); }
.task-log-note-add[hidden] { display: none; }
.show-table.task-log-table tfoot td { border-top: 1px solid var(--border-panel); font-variant-numeric: tabular-nums; font-weight: 500; text-align: center; }
.show-table.task-log-table tfoot td:first-child { text-align: left; }

/* The day picked on a task's calendar (tasks/_occurrence_panel): its date, its dots, its
   note — under the legend, set off as a recess of the card. */
.task-occurrence-frame { display: block; margin-top: 16px; }
.task-occurrence {
  padding: 14px 16px 16px;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  background: var(--recess);
}
.task-occurrence-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.task-occurrence-date { font-size: var(--fs-14); font-weight: 600; color: var(--text-1); }
.task-occurrence-status { font-size: var(--fs-12); color: var(--text-3); }
.task-occurrence-ratings { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 12px; }
.task-occurrence-rating { display: flex; align-items: center; gap: 10px; }
.task-occurrence-rating-name { font-size: var(--fs-13); }
.task-occurrence-hint { margin: 0 0 12px; font-size: var(--fs-12); color: var(--text-3); }
.task-occurrence-note { margin: 0; }
.task-occurrence-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.task-occurrence-saved { font-size: var(--fs-12); color: var(--text-3); }
/* The note waits closed: its text opens it, or with none, "+ Note" in the calendar's key. */
.task-occurrence-head { align-items: center; }
.task-occurrence-note[hidden] { display: none; }
/* The form's ✕ in the panel's top-right corner, only while the form's open; Save alone
   on the right beneath. */
.task-occurrence-cancel { margin-left: auto; }
.task-occurrence:not(:has(.task-occurrence-note:not([hidden]), .task-occurrence-rate[data-empty]:not([hidden]))) .task-occurrence-cancel { display: none; }
.task-occurrence-rate[hidden] { display: none; }
.task-occurrence-rate-pick { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.task-occurrence-rate-pick .task-occurrence-hint { margin: 0; white-space: nowrap; }
.task-occurrence-rate-pick select { flex: 0 1 auto; width: auto; min-width: 0; max-width: 260px; }
/* A value's ×, to stop rating on it: there on hover (or focus), like the log's pens. */
.task-occurrence-unrate-form { display: inline-flex; margin: 0; }
.task-occurrence-unrate {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--text-3); font-size: var(--fs-10); cursor: pointer; opacity: 0;
  transition: opacity var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.task-occurrence-rating:hover .task-occurrence-unrate, .task-occurrence-unrate:focus-visible { opacity: 1; }
.task-occurrence-unrate:hover { background: var(--surface-2); color: var(--text-1); }
@media (hover: none) { .task-occurrence-unrate { opacity: 1; } }
.task-occurrence-rate-pick.is-more { margin-top: -4px; }
.task-occurrence-actions { justify-content: flex-end; }
/* A day with nothing to show — ratings and note closed, no note written — draws no panel. */
.task-occurrence:not(:has(.task-occurrence-rate:not([hidden]), .task-occurrence-note:not([hidden])))  { display: none; }
.task-occurrence-frame:has(> .task-occurrence:not(:has(.task-occurrence-rate:not([hidden]), .task-occurrence-note:not([hidden])))) { margin-top: 0; }
/* Nothing under the date (no ratings, note closed): no gap left below it. */
.task-occurrence-head:has(+ .task-occurrence-note[hidden]:last-child),
.task-occurrence-rate:has(+ .task-occurrence-note[hidden]:last-child) > :last-child { margin-bottom: 0; }
.task-occurrence-saved .fa-check { color: var(--accent); margin-right: 3px; }
turbo-frame[busy] .task-occurrence { opacity: 0.6; transition: opacity var(--dur-fast); }
/* The held-back benefits sit behind this; it goes away once they are shown. */
/* A task's benefits: the + beside the label, small and borderless, and "Show more" under
   the list as quiet text, lined up with the benefits' own text (past their 3px edge and
   14px padding) rather than with the edge of their cards. */
.task-benefits-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.task-benefits-head .show-label { margin: 0; }
.task-benefits-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-3); font-size: var(--fs-11); cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.task-benefits-toggle:hover { background: var(--surface-2); color: var(--text-1); }
.task-benefits-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; color: var(--text-1); }
.task-benefits-foot { margin-top: 6px; padding-left: 17px; }
/* Nothing held back (or all of it shown): no foot, rather than an empty gap. */
.task-benefits-foot:not(:has(.task-benefits-more)) { display: none; }
.task-benefits-more { padding: 2px 0; border: 0; background: none; color: var(--text-3); font: inherit; font-size: var(--fs-12); cursor: pointer; }
.task-benefits-more:hover { color: var(--text-1); }
.task-benefits-more:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; color: var(--text-1); }
.task-info-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 6px; }
.task-info-actions.is-end { justify-content: flex-end; }

/* Width variants. Category pages carry two task columns and need the room; a journal
   entry is prose and reads best on a short measure. */
/* Two widths for show pages: 880 for one record, and the 1040 content width the wide
   ledger pages use (.ledger-page.is-wide) for a category or a shared list. */
.show-page.is-wide { max-width: 1072px; }

/* Area identity. A page whose record belongs to an area of interest sets
   --show-accent to that area's accent; the hero picks it up as a top edge and the
   title icon, progress fills and quotes follow. Unset, everything falls back to the
   neutral tokens, so a record with no area looks like any other show page. */
.show-card.has-accent { box-shadow: inset 0 3px 0 var(--show-accent), var(--shadow-card); }

.meta-pill.is-success { --pill: var(--accent-bright); }
.meta-pill.is-gold { --pill: var(--gold-bright); }
.meta-pill.is-muted { --pill: var(--text-3); }
a.meta-pill { text-decoration: none; transition: background var(--dur-fast), border-color var(--dur-fast); }
a.meta-pill:hover { background: color-mix(in srgb, var(--pill) 20%, transparent); border-color: color-mix(in srgb, var(--pill) 45%, transparent); }
.meta-pill strong { font-weight: 700; }

.show-btn.is-active { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-1); }
.show-btn.is-success { color: var(--accent-bright); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.show-btn.is-success:hover { color: var(--accent-bright); border-color: var(--accent); background: var(--accent-soft); }
.show-actions .show-btn + form,
.show-actions form + .show-btn { margin: 0; }
.show-btn-group { display: inline-flex; align-items: center; gap: 0.25rem; }

/* Stat tiles: the headline figures a record is judged by. */
.show-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.show-stat {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  background: var(--recess);
}
.show-stat.has-status { border-left: 3px solid var(--stat-status, var(--border-strong)); }
.show-stat-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.show-stat-value {
  font-size: var(--fs-24);
  font-weight: 600;
  line-height: 1.2;
  color: var(--stat-color, var(--text-1));
  font-variant-numeric: tabular-nums;
}
.show-stat-value.is-empty { font-size: var(--fs-16); font-weight: 500; color: var(--text-3); }
.show-stat-unit { margin-left: 0.2em; font-size: var(--fs-14); font-weight: 400; color: var(--text-3); }
.show-stat-sub { margin-top: 4px; font-size: var(--fs-12); color: var(--text-3); line-height: 1.45; }

/* Progress bars */
.show-progress + .show-progress { margin-top: 14px; }
.show-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 6px; font-size: var(--fs-13); color: var(--text-2); }
.show-progress-head span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; }
.show-progress-track { height: 6px; border-radius: var(--radius-xl); background: var(--surface-2); overflow: hidden; }
.show-progress-fill { height: 100%; border-radius: inherit; background: var(--progress-color, var(--show-accent, var(--accent))); transition: width var(--dur-slow); }

/* Chips: links out to related records (an area's categories, a section's subsections). */
.show-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.show-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-xl);
  background: var(--surface-row);
  color: var(--text-1);
  font-size: var(--fs-13);
  text-decoration: none;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.show-chip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.show-chip i, .show-chip .icon-image { color: var(--chip-accent, var(--text-2)); }
.show-chip.is-muted { color: var(--text-3); }

/* List rows inside a card, edge to edge. */
.show-list { list-style: none; margin: 0; padding: 0; }
.show-list-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 11px 20px;
  border-top: 1px solid var(--border-panel);
  color: var(--text-1);
  text-decoration: none;
  transition: background var(--dur-fast);
}
.show-list > li:first-child > .show-list-item,
.show-list > .show-list-item:first-child { border-top: none; }
@media (hover: hover) { a.show-list-item:hover { background: rgba(255, 255, 255, 0.025); } }
a.show-list-item:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.show-list-title { min-width: 0; font-size: var(--fs-14); overflow-wrap: anywhere; }
.show-list-sub { min-width: 0; flex: 1; font-size: var(--fs-13); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-list-aside { flex: none; margin-left: auto; font-size: var(--fs-12); color: var(--text-3); }

.show-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--text-3);
  font-size: var(--fs-13);
  text-align: center;
}
.show-empty i { font-size: var(--fs-20); opacity: 0.6; }

/* Tables: a card body wraps them in .show-table-wrap so a narrow screen scrolls
   the table rather than the page. */
.show-table-wrap { overflow-x: auto; }
.show-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
/* A tracker's entries (trackers/show): a notable reading's bookmark beside its date, a
   target not yet logged marked Planned, and the way to the readings older than a fortnight. */
.tracker-entry-notable { margin-left: 0.4rem; color: var(--gold); font-size: var(--fs-11); }
.tracker-entry-planned { margin-right: 0.45rem; padding: 1px 7px; border: 1px solid rgba(77, 159, 255, 0.4); border-radius: 999px; color: var(--blue); font-size: var(--fs-11); font-weight: 500; vertical-align: 1px; }
.tracker-entries-more { margin: 10px 16px 14px; }
.show-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-panel);
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-3);
  white-space: nowrap;
}
.show-table td { padding: 10px 14px; border-top: 1px solid var(--border-panel); color: var(--text-1); vertical-align: middle; }
.show-table tbody tr:first-child td { border-top: none; }
.show-table th:first-child, .show-table td:first-child { padding-left: 20px; }
.show-table th:last-child, .show-table td:last-child { padding-right: 20px; }
@media (hover: hover) { .show-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); } }
.show-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.show-table .is-center { text-align: center; }
.show-table .is-muted { color: var(--text-3); }
.show-table input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; vertical-align: middle; color-scheme: dark; }
.show-table tr.is-editing td { background: var(--recess); }

/* Inline forms (a tracker's new-entry and edit-entry rows). */
.show-form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.show-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 150px; min-width: 0; }
.show-field.is-auto { flex: none; }
.show-field-label {
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.show-input {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--recess);
  color: var(--text-1);
  font-family: inherit;
  font-size: var(--fs-14);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.show-input:hover { border-color: var(--field-optional-hover); }
.show-input:focus { outline: none; border-color: var(--field-optional-border); box-shadow: var(--field-optional-ring); }
.show-check { display: inline-flex; align-items: center; gap: 0.45rem; height: 32px; color: var(--text-2); font-size: var(--fs-13); cursor: pointer; }
.show-check input { width: 16px; height: 16px; margin: 0; cursor: pointer; color-scheme: dark; }
.show-btn.is-solid { font-weight: 600; }
.show-btn.is-solid:hover { border-color: transparent; color: #0b0b0d; }

/* Two columns with a divider, stacking on a phone. */
.show-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.show-cols > * { min-width: 0; padding: 16px 20px 20px; }
.show-cols > * + * { border-left: 1px solid var(--border-panel); }
@media (max-width: 900px) {
  .show-cols { grid-template-columns: 1fr; }
  .show-cols > * + * { border-left: none; border-top: 1px solid var(--border-panel); }
}
.show-col-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 32px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-panel);
}
.show-col-title { font-size: var(--fs-14); font-weight: 600; color: var(--text-1); }
.show-col-title a { color: var(--text-1); text-decoration: none; }
.show-col-title a:hover { text-decoration: underline; }

.show-subhead { display: flex; align-items: center; gap: 0.5rem; margin: 18px 0 8px; padding-left: 0.75rem; }
.show-subhead-title { font-size: var(--fs-14); font-weight: 600; color: var(--text-1); text-decoration: none; }
a.show-subhead-title:hover { text-decoration: underline; }

/* Status colours for rule scoring and goal state, in one place. */

.show-card-body + .show-card-body { border-top: 1px solid var(--border-panel); }

/* Calendar */
.show-cal-month { margin-right: 0.25rem; font-size: var(--fs-14); font-weight: 600; color: var(--text-1); }
.show-cal-nav { display: flex; align-items: center; gap: 0.25rem; }
.show-cal-weekdays,
.show-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.show-cal-grid { row-gap: 4px; }
.show-cal-weekdays { margin-bottom: 6px; }
.show-cal-weekdays span {
  padding: 4px 0;
  text-align: center;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cal-day {
  position: relative;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: var(--fs-14);
  font-variant-numeric: tabular-nums;
  user-select: none;
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
button.cal-day { cursor: pointer; }
.cal-day.is-scheduled { background: var(--accent-soft); color: var(--accent-bright); font-weight: 600; }
.cal-day.is-scheduled:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.cal-day.is-secondary { color: var(--text-1); }
.cal-day.is-secondary:hover,
.cal-day.is-cancelled:hover { background: var(--surface-2); }
.cal-day.is-secondary::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--text-2);
}
.cal-day.is-cancelled { color: var(--text-3); text-decoration: line-through; }
.cal-day.is-done { color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.cal-day.is-done:hover { background: var(--accent-soft); }
.cal-day.is-selected,
.cal-day.is-selected:hover { font-weight: 700; }
.cal-day.is-selected.is-today { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7); }

.show-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-panel);
  font-size: var(--fs-12);
  color: var(--text-3);
}
.show-cal-legend > span { display: inline-flex; align-items: center; gap: 0.45rem; }
.show-cal-swatch {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
}
.show-cal-swatch.is-scheduled { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.show-cal-swatch.is-secondary::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--text-2); }
.show-cal-swatch.is-cancelled { color: var(--text-3); text-decoration: line-through; }
.show-cal-swatch.is-done { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
/* A category's month: open days a quiet grey ring, finished days solid green, so the
   done ones stand out (the two greens read as one block). */
.category-show .cal-day.is-scheduled,
.category-show .show-cal-swatch.is-scheduled { background: none; color: var(--text-1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
.category-show .cal-day.is-scheduled:hover { background: rgba(255, 255, 255, 0.06); }
.category-show .cal-day.is-done,
.category-show .show-cal-swatch.is-done { background: color-mix(in srgb, var(--accent) 78%, transparent); color: #fff; box-shadow: none; }
.category-show .cal-day.is-done:hover { background: var(--accent); }
.category-show .cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent-bright); }
.category-show .cal-day.is-today.is-done { box-shadow: inset 0 0 0 2px #fff; }

/* Subtask columns */
/* Stretch, not start, so the divider runs the full height of the taller column. */
#subtasks-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: stretch; }
#subtasks-column-date { border-left: 1px solid var(--border-panel); padding-left: 1.5rem; }
@media (max-width: 640px) {
  #subtasks-columns { grid-template-columns: 1fr; }
  #subtasks-column-date { border-left: none; padding-left: 0; }
}
/* A subtask showing in the date column reads as "already placed", so its row in the
   All column fades — same cue the home page gives scheduled tasks in the categories column. */
#subtasks-list [data-subtask-id].in-date-column { opacity: 0.5; }
#subtasks-columns [data-subtask-id] { border-radius: var(--radius-xs); transition: background var(--dur-fast); }
#subtasks-columns [data-subtask-id]:hover { background: rgba(255, 255, 255, 0.025); }
/* No subtasks yet: just the Add row — no empty columns, no date column. The head stays
   only while there is something to paste. Lifts as soon as a row arrives. */
#subtasks-columns:not(:has([data-subtask-id])) { display: block; }
#subtasks-columns:not(:has([data-subtask-id])) #subtasks-column-date,
#subtasks-columns:not(:has([data-subtask-id])) .subtasks-col-head:not(:has(#paste-subtasks-btn:not([hidden]))) { display: none; }

.subtasks-col-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 30px;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-panel);
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-2);
}
/* Pinned right and out of flow, so the title and count center on the column itself
   rather than on whatever space the buttons leave. Bottom matches the head's
   padding-bottom so the buttons line up with the title, not the divider. */
.subtasks-col-head-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.subtasks-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.subtasks-count:empty { display: none; }
.subtasks-today-badge {
  padding: 1px 7px;
  border-radius: var(--radius-xl);
  background: rgba(34, 197, 94, 0.14);
  color: var(--accent-bright);
  font-size: var(--fs-11);
  font-weight: 600;
}
.subtasks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-13);
}
.subtasks-empty i { font-size: var(--fs-20); opacity: 0.6; }
.subtasks-add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: var(--fs-13);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.subtasks-add-row:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* The post form's field labels in the small capitals every other popup's labels use. */
.post-form-label { display: block; margin-bottom: 6px; color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
/* No subtasks: the card itself steps back to a lone "+ Add subtask" — no heading strip,
   no frame — drawn as a full-width dashed bar with its words centred, a shade brighter
   than the rows' own add bar, so it reads as the way in rather than a stray link. The
   card comes back as soon as a row arrives. */
/* A section's posts: each with where it stands. */
.section-post-stage { flex-shrink: 0; margin-left: auto; font-size: var(--fs-11); }
.section-post-stage.is-published { border-color: rgba(34, 197, 94, 0.4); color: var(--accent-bright); }
.section-post-stage + .show-list-aside { margin-left: 10px; }
/* A post's page: the post in reading type as the main thing, its card's head just Edit. */
.post-preview > .show-card-head { padding-block: 8px; border-bottom: none; background: none; }
.post-preview .post-preview-body { padding-top: 4px; }
.post-preview .post-preview-text { color: var(--text-1); font-size: var(--fs-18); line-height: 1.55; white-space: pre-wrap; }
.post-preview .post-preview-topic { margin: 0 0 8px; font-size: var(--fs-22); }
.post-preview .post-preview-meta { margin-top: 16px; }
.post-preview .post-preview-length { margin-left: auto; opacity: 0.7; }
.post-preview .post-preview-length.is-over { color: var(--danger-bright); opacity: 1; }
/* The original it quotes or replies to: a box of its own over my version, tinted as the
   form's "Quote or reply to…" is. */
.post-preview-original { margin: 0 0 4px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--border-panel)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--blue) 5%, transparent); }
.post-preview-original figcaption { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.04em; }
.post-preview-original figcaption i { font-size: var(--fs-10); }
.post-preview-original-link { margin-left: auto; color: var(--text-3); font-weight: 400; letter-spacing: 0; text-decoration: none; }
.post-preview-original-link:hover { color: var(--text-1); text-decoration: underline; }
.post-preview-original blockquote { margin: 8px 0 0; color: var(--text-2); font-size: var(--fs-14); line-height: 1.55; white-space: pre-wrap; }
/* Notes to self: quiet, under the post, for me not the reader. */
.post-preview-notes { padding: 10px 12px; border-left: 2px solid var(--border-strong); color: var(--text-2); font-size: var(--fs-13); line-height: 1.5; white-space: pre-wrap; }
.post-preview-notes-label { display: block; margin-bottom: 2px; color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
/* An image or video still to add, in the amber the Posts page's rows use for it. */
.post-preview-meta li.is-needs { border-color: color-mix(in srgb, var(--warn-bright) 40%, transparent); color: var(--warn-bright); }
.post-preview-meta li.is-needs i { color: inherit; }
/* A post's Edit popup: the Posts page's form at the popup's width. */
.post-edit-modal { width: min(600px, 100%); }
.show-chip-count { margin-left: 2px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--text-3); font-size: var(--fs-10); font-variant-numeric: tabular-nums; }

/* The edit form's text box starts at a few lines and grows; this keeps it from starting cramped. */
.post-content-input.jd-autogrow { min-height: 110px; }

/* New post as a page of its own (posts/new): the Posts page's form at a readable width,
   under the way back. */
.post-new-page { max-width: 720px; }
.post-new-page .show-topbar { margin-bottom: 14px; }
.post-new-page .lab-quick.task-form-card { margin: 0; }

/* No subtasks yet: one quiet line over the add row, not a tall empty panel. */
#subtasks-list .subtasks-empty { flex-direction: row; justify-content: flex-start; gap: 8px; min-height: 0; padding: 4px 2px 10px; font-size: var(--fs-13); }
#subtasks-list .subtasks-empty i { font-size: var(--fs-14); }
/* With no subtasks, the add row inside the card says it alone. */
#subtasks-list .subtasks-empty { display: none; }

/* The month chart, readable at a glance: days gone by draw their empty pills clearly
   enough to count against, days to come stay faint, and a day's idea count sits in its
   own grey above it rather than floating. */
.posts-summary .ledger-day.has-goal:not(.is-future) .posts-pill:not(.is-filled):not(.is-planned) { background: rgba(255, 255, 255, 0.14); }
.posts-summary .ledger-day.has-goal.is-future .posts-pill:not(.is-filled):not(.is-planned) { background: rgba(255, 255, 255, 0.05); }
.posts-summary .posts-idea-count { color: var(--text-2); }
.posts-summary .posts-idea-count.is-short { color: var(--danger-bright); }

/* Brainstorm for an account with no posts yet: the rest of today's goal in one quiet line. */
.lab-goal-rest { padding: 8px 0 2px; color: var(--text-3); font-size: var(--fs-12); list-style: none; text-align: center; }
