/* ══════════════════════════════════════════════════════════════════
   §2 THIS WEEK — v3.32.0
   Conditions strip · attention strip · lapsed tray · time-bucket headers
   · moon chip · cascade-offer row.
   Net effect: one calmer strip at top, lapsed tray for stale stuff,
   three time-bucketed sections in place of the flat weekly list.
══════════════════════════════════════════════════════════════════ */

/* — Conditions strip — */
.cond-strip {
  background: var(--bg-card); border: 1px solid var(--border-mid); border-radius: 10px;
  margin-bottom: var(--s3, 12px); overflow: hidden; box-shadow: var(--shadow-sm);
}
.cond-strip .cs-row {
  display: flex; align-items: center; gap: var(--s4, 16px);
  padding: 10px 14px; min-height: 56px;
  flex-wrap: wrap;
}
.cond-strip .cs-loc { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 220px; }
.cond-strip .cs-loc .cs-pin { font-size: 14px; line-height: 1; opacity: 0.7; flex-shrink: 0; }
.cond-strip .cs-loc .cs-loc-text { min-width: 0; flex: 1 1 auto; }
.cond-strip .cs-loc .cs-place { font-family: var(--f-body); font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cond-strip .cs-loc .cs-meta { font-family: var(--f-mono); font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cond-strip .cs-meta b { color: var(--text-secondary); font-weight: 600; }
.cond-strip .cs-mini { display: flex; gap: 4px; flex: 0 1 auto; }
.cond-strip .cs-mini .cs-day {
  min-width: 38px; padding: 4px 5px; border-radius: 6px;
  background: var(--bg-subtle); border: 1px solid var(--border-rule);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-family: var(--f-body); line-height: 1.1;
}
.cond-strip .cs-mini .cs-day.cs-conflict { background: var(--amber-tint); border-color: color-mix(in srgb, var(--amber) 32%, transparent); }
.cond-strip .cs-mini .cs-day.cs-frost    { background: var(--terra-tint); border-color: color-mix(in srgb, var(--terra) 28%, transparent); }
.cond-strip .cs-mini .cs-day.cs-today    { box-shadow: inset 0 -2px 0 var(--terra); }
.cond-strip .cs-mini .cs-day .csd-dow  { font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.cond-strip .cs-mini .cs-day .csd-ico  { font-size: 13px; line-height: 1; }
.cond-strip .cs-mini .cs-day .csd-temp { font-family: var(--f-mono); font-size: 10.5px; font-weight: 700; color: var(--text-primary); }
.cond-strip .cs-moon { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 0; }
.cond-strip .cs-moon .cs-moon-emoji { font-size: 20px; line-height: 1; }
.cond-strip .cs-moon .cs-moon-text  { min-width: 0; }
.cond-strip .cs-moon .cs-moon-name  { font-family: var(--f-body); font-size: 12px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.cond-strip .cs-moon .cs-moon-sub   { font-family: var(--f-body); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.cond-strip .cs-toggle {
  flex: 0 0 auto; margin-left: auto;
  background: none; border: 1px solid var(--border-tan); border-radius: 99px;
  font-family: var(--f-body); font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-secondary); padding: 5px 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.cond-strip .cs-toggle:hover { background: var(--bg-subtle); color: var(--text-primary); }
.cond-strip .cs-toggle.cs-why  { color: var(--amber-text); border-color: color-mix(in srgb, var(--amber) 36%, transparent); background: var(--amber-tint); }
.cond-strip .cs-toggle .cs-chev { display: inline-block; font-size: 9px; transition: transform 0.12s; }
.cond-strip.open .cs-toggle .cs-chev { transform: rotate(90deg); }
.cond-strip .cs-detail { display: none; border-top: 1px solid var(--border); padding: 14px; background: var(--bg-card); }
.cond-strip.open .cs-detail { display: block; }
.cond-strip .cs-detail .cs-auto-banner {
  background: var(--amber-tint); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  border-radius: 8px; padding: 9px 12px; font-size: 12px; color: var(--text-body);
  margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start;
}
.cond-strip .cs-detail .cs-auto-banner b { color: var(--amber-text); }
.cond-strip .cs-detail .cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .cond-strip .cs-detail .cs-grid { grid-template-columns: 1fr; } }
.cond-strip .cs-detail .cs-block { background: var(--bg-subtle); border-radius: 8px; padding: 10px 12px; }
.cond-strip .cs-detail .cs-block h4 { font-family: var(--f-body); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.cond-strip .cs-detail .cs-block .cs-line { font-size: 12px; color: var(--text-body); line-height: 1.5; }
.cond-strip .cs-detail .cs-block .cs-line + .cs-line { margin-top: 3px; }
.cond-strip .cs-detail .cs-full-fc { display: flex; gap: 5px; flex-wrap: wrap; }
.cond-strip .cs-detail .cs-full-fc .cs-fc-day {
  flex: 1 1 80px; min-width: 80px; padding: 9px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border-mid);
  display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.2;
}
.cond-strip .cs-detail .cs-full-fc .cs-fc-day.cs-conflict { border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-tint); }
.cond-strip .cs-detail .cs-full-fc .cs-fc-day.cs-frost    { border-color: color-mix(in srgb, var(--terra) 35%, transparent); background: var(--terra-tint); }
.cond-strip .cs-detail .cs-full-fc .cs-fc-day .fc-dow  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.cond-strip .cs-detail .cs-full-fc .cs-fc-day .fc-ico  { font-size: 18px; }
.cond-strip .cs-detail .cs-full-fc .cs-fc-day .fc-temp { font-family: var(--f-mono); font-size: 11.5px; font-weight: 700; color: var(--text-primary); }
.cond-strip .cs-detail .cs-full-fc .cs-fc-day .fc-pop  { font-family: var(--f-mono); font-size: 10px; color: #2563EB; font-weight: 600; }
.cond-strip .cs-detail .cs-conflict-row {
  margin-top: 12px; padding: 10px 12px; background: var(--amber-tint);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); border-radius: 8px;
  display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--text-body);
}
.cond-strip .cs-detail .cs-conflict-row .cs-cr-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.cond-strip .cs-detail .cs-conflict-row .cs-cr-actions button {
  background: var(--bg-card); border: 1px solid var(--border-mid); border-radius: 6px;
  padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--text-secondary); cursor: pointer;
}
.cond-strip .cs-detail .cs-conflict-row .cs-cr-actions button.cs-primary { background: var(--terra); color: #FAF7F2; border-color: var(--terra); }
.cond-strip.weather-unavailable .cs-mini { opacity: 0.4; pointer-events: none; }
/* When the strip is expanded, the detail panel's full 5-day forecast takes over —
   hide the compact mini cells so the same data isn't shown twice. */
.cond-strip.open .cs-mini { display: none; }

/* v3.39.0 — Internal section dividers inside .cs-detail. Each section is its own
   host div; we give them a top rule between sections so the nested content reads
   as a stack of grouped strips rather than a single mass of mixed content. The
   forecast section and the moon/biodynamic grid carry their own styling already,
   so the divider rule only renders between sections that actually have content. */
.cond-strip .cs-detail .cs-section { }
.cond-strip .cs-detail .cs-section:empty { display: none; }
/* Top divider on every non-empty section that has at least one non-empty section
   before it. General-sibling combinator (~) means empty sections in between don't
   strand the divider above a hidden section. :empty hides the section via the
   rule above, but :empty still applies in the selector match — so we need to
   require non-empty on both sides to skip past empties cleanly. */
.cond-strip .cs-detail .cs-section:not(:empty) ~ .cs-section:not(:empty) {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-rule);
}
.cond-strip .cs-detail .cs-section-h {
  font-family: var(--f-body); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
  margin: 0 0 8px 0;
}
.cond-strip .cs-detail .cs-section-h-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.cond-strip .cs-detail .cs-section-h-row .cs-section-h { margin-bottom: 0; }
.cond-strip .cs-detail .cs-goals-all {
  margin-left: auto; background: none; border: none; padding: 0;
  font-family: var(--f-body); font-size: 11px; font-weight: 600;
  color: var(--terra-text); cursor: pointer; line-height: 1;
}
.cond-strip .cs-detail .cs-goals-all:hover { color: var(--terra); }

/* Goals chip row — horizontal scroll on overflow so a long list of goals stays one line. */
.cond-strip .cs-detail .cs-goals-row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.cond-strip .cs-detail .cs-goal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  font-family: var(--f-body); font-size: 11.5px; color: var(--text-body);
  cursor: pointer; line-height: 1; max-width: 240px;
}
.cond-strip .cs-detail .cs-goal-chip:hover { background: var(--bg-card); border-color: var(--border-mid); }
.cond-strip .cs-detail .cs-goal-chip.is-gap { border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.cond-strip .cs-detail .cs-goal-chip.is-unstarted { opacity: 0.75; }
.cond-strip .cs-detail .cs-goal-chip .cs-goal-name {
  font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cond-strip .cs-detail .cs-goal-chip .cs-goal-bar {
  width: 44px; height: 4px; background: var(--bg-base); border-radius: 2px; overflow: hidden; flex-shrink: 0;
}
.cond-strip .cs-detail .cs-goal-chip .cs-goal-bar-fill {
  display: block; height: 100%; border-radius: 2px; transition: width 0.25s ease;
}
.cond-strip .cs-detail .cs-goal-chip .cs-goal-pct {
  font-family: var(--f-mono); font-size: 10px; font-weight: 700; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Forecast section keeps its conflict-row styling — just add a header. */
.cond-strip .cs-detail .cs-section-forecast .cs-section-h { margin-bottom: 8px; }

/* The Attention banner inside .cs-detail is the existing .attn-strip (rendered by
   the strip's post-render block). It looks fine as-is; we just want zero margin
   on the bottom when it's nested so the section divider handles spacing. */
.cond-strip .cs-detail .cs-section-attn .attn-strip { margin-bottom: 0; }
/* Lapsed tray and Nursery coming-up sit edge-to-edge inside the detail panel. */
.cond-strip .cs-detail .cs-section-lapsed .lapsed-tray { margin-bottom: 0; }
.cond-strip .cs-detail .cs-section-coming .ncu-strip { margin: 0; }

/* When the body has no content at all, hide the detail panel entirely — the
   collapsed row is the whole strip. */
.cond-strip.cond-strip-no-body .cs-detail { display: none; }

/* — Conditions strip responsive (§2.7) —
   The compact row sheds furniture as the viewport narrows:
     · Tablet (≤ 900px) → hide the moon subtitle ("Good for: …"). Moon name still shows.
     · Narrow (≤ 760px) → drop the moon cell entirely. Mini forecast caps at 4 days.
     · Mobile (≤ 600px) → stack vertically: location row, then mini forecast on its own row, Details on the right of the location row.
*/
@media (max-width: 900px) {
  .cond-strip .cs-moon .cs-moon-sub { display: none; }
  .cond-strip .cs-row { gap: 12px; }
}
@media (max-width: 760px) {
  .cond-strip .cs-moon { display: none; }
  .cond-strip .cs-mini .cs-day:nth-child(n+5) { display: none; }
  .cond-strip .cs-row { gap: 10px; }
}
@media (max-width: 600px) {
  /* Mobile compact: row 1 = location + Details, row 2 = horizontally-scrolling mini forecast.
     Total height stays under ~96px when collapsed. */
  .cond-strip .cs-row { flex-wrap: wrap; gap: 8px 10px; padding: 8px 10px; min-height: 0; }
  .cond-strip .cs-loc    { order: 1; flex: 1 1 auto; }
  .cond-strip .cs-toggle { order: 2; flex: 0 0 auto; margin-left: auto; align-self: center; }
  .cond-strip .cs-mini   { order: 3; flex: 0 0 100%; justify-content: flex-start; overflow-x: auto; margin-top: 0; }
  .cond-strip .cs-mini .cs-day { flex: 0 0 auto; min-width: 44px; }
  /* On mobile the strip is closer to a stacked card. Show up to 5 day-cells with horizontal scroll. */
  .cond-strip .cs-mini .cs-day:nth-child(n+5) { display: flex; }
}
@media (max-width: 480px) {
  .cond-strip .cs-row { padding: 7px 10px; }
  .cond-strip .cs-loc .cs-place { font-size: 13px; }
  .cond-strip .cs-loc .cs-meta { font-size: 10.5px; }
  .cond-strip .cs-toggle { padding: 4px 9px; font-size: 10.5px; }
}

/* — Attention strip — */
.attn-strip {
  background: var(--amber-tint); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--text-body);
  margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.attn-strip .attn-icon { font-size: 14px; line-height: 1; }
.attn-strip .attn-link { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--terra-text); cursor: pointer; background: none; border: none; }
.attn-strip .attn-link:hover { color: var(--terra); }

/* — Lapsed tray — */
.lapsed-tray { margin-bottom: 14px; border-radius: 10px; border: 1px solid var(--tan); background: var(--tan-tint); overflow: hidden; }
.lapsed-tray .lt-head {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  cursor: pointer; user-select: none;
  font-family: var(--f-body); font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.lapsed-tray .lt-head .lt-ico { font-size: 14px; opacity: 0.7; }
.lapsed-tray .lt-head .lt-chev { font-size: 9px; margin-left: auto; transition: transform 0.12s; opacity: 0.55; }
.lapsed-tray.open .lt-head .lt-chev { transform: rotate(90deg); }
.lapsed-tray .lt-head .lt-count { font-family: var(--f-mono); font-weight: 700; color: var(--text-primary); }
.lapsed-tray .lt-body { display: none; border-top: 1px solid var(--tan); background: var(--bg-card); }
.lapsed-tray.open .lt-body { display: block; }
.lapsed-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.lapsed-row:last-child { border-bottom: none; }
.lapsed-row.is-done { opacity: 0.55; }
.lapsed-row .lr-dot { width: 8px; height: 8px; border-radius: 99px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18); }
:root.dark .lapsed-row .lr-dot { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16); }
.lapsed-row .lr-name { font-family: var(--f-body); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.lapsed-row .lr-detail { font-family: var(--f-body); font-size: 11.5px; color: var(--text-muted); }
/* v3.43.0 — explicit, color-coded action label + clickable name block */
.lapsed-row .lr-name-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lapsed-row .lr-action-chip {
  font-family: var(--f-body); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 99px; white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 3px;
}
.lapsed-row .lr-open { cursor: pointer; border-radius: 6px; margin: -3px -5px; padding: 3px 5px; transition: background 0.12s; }
.lapsed-row .lr-open:hover, .lapsed-row .lr-open:focus-visible { background: var(--bg-subtle); outline: none; }
.lapsed-row .lr-open:hover .lr-name, .lapsed-row .lr-open:focus-visible .lr-name { text-decoration: underline; }
.lapsed-row .lr-chip-due {
  font-family: var(--f-body); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; background: var(--terra-tint); color: var(--terra-text); white-space: nowrap;
}
.lapsed-row .lr-chip-succession {
  font-family: var(--f-body); font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; background: var(--green-tint); color: var(--green-text); white-space: nowrap;
}
.lapsed-row .lr-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.lapsed-row .lr-actions button {
  font-family: var(--f-body); font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border-mid); background: var(--bg-card); color: var(--text-secondary);
  line-height: 1; min-height: 28px;
}
.lapsed-row .lr-did-on {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--f-body); font-size: 10.5px; color: var(--text-muted);
  padding-right: 2px;
}
.lapsed-row .lr-did-on-lbl { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.lapsed-row .lr-did-date {
  font-family: var(--f-body); font-size: 11px; font-weight: 600;
  padding: 4px 6px; border-radius: 5px;
  border: 1px solid var(--border-mid); background: var(--bg-card); color: var(--text-primary);
  line-height: 1; min-height: 28px; cursor: pointer;
  color-scheme: light dark;
}
.lapsed-row .lr-did-date:hover, .lapsed-row .lr-did-date:focus { border-color: var(--border-tan); outline: none; }
:root.dark .lapsed-row .lr-did-date { background: var(--bg-input); }
@media (max-width: 720px) {
  .lapsed-row .lr-actions { order: 5; width: 100%; margin-left: 0; margin-top: 6px; flex-wrap: wrap; }
}
.lapsed-row .lr-actions button.lr-did    { background: var(--green-tint); color: var(--green-text); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.lapsed-row .lr-actions button.lr-skip   { background: var(--bg-subtle); }
.lapsed-row .lr-actions button.lr-resched { background: var(--bg-subtle); }
.lapsed-row .lr-actions button:hover { color: var(--text-primary); border-color: var(--border-tan); }
.lapsed-row .lr-done-stamp {
  font-family: var(--f-body); font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; background: var(--green-tint); color: var(--green-text);
}
.cascade-offer {
  width: 100%; padding: 9px 14px; background: var(--amber-tint);
  border-top: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  font-size: 11.5px; color: var(--text-body); line-height: 1.4;
}
.cascade-offer b { color: var(--amber-text); }
.cascade-offer .co-actions { margin-top: 6px; display: flex; gap: 6px; }
.cascade-offer .co-actions button {
  font-family: var(--f-body); font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 5px; border: 1px solid var(--border-mid);
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
}
.cascade-offer .co-actions button.co-primary { background: var(--terra); color: #FAF7F2; border-color: var(--terra); }

/* — Time-bucket section headers — */
.tw-bucket { margin-top: 18px; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.tw-bucket:first-of-type { margin-top: 4px; }
.tw-bucket .tw-bucket-label {
  font-family: var(--f-body); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
}
.tw-bucket.tw-bucket-overdue .tw-bucket-label { color: var(--terra-text); }
.tw-bucket .tw-bucket-cnt {
  font-family: var(--f-mono); font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  background: var(--bg-subtle); color: var(--text-secondary);
}
.tw-bucket.tw-bucket-overdue .tw-bucket-cnt { background: var(--terra-tint); color: var(--terra-text); }
.tw-bucket .tw-bucket-range { font-family: var(--f-body); font-size: 11px; color: var(--text-muted); font-style: italic; margin-left: 4px; }
.tw-bucket .tw-bucket-rule { flex: 1; height: 1px; background: var(--border-rule); }

/* — Task-card moon chip (Role B addition) — */
.task-moon-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--f-body); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; background: var(--green-tint); color: var(--green-text); white-space: nowrap;
}
.task-moon-chip::before { content: '\2726'; opacity: 0.7; font-size: 9px; }

