/* ob-today-needs.css: "Needs you" on Today (#ob-decisions-summary, ob-today-decisions.js). Tokens --ob3-* only.
   T-VISUAL-TODAY (30 Oct 2026): ONE inset grouped list with the Today row anatomy (ob-today.css): every row is two lines, the title,
   then the why with the primary action as the trailing pill. The row is a disclosure (the title button is stretched over it); opened,
   the title and why wrap in full and the secondary actions (the source link, Not now) show under the text. "N more" and the private
   row are rows of the same group; the Decisions links share one footer line. Boards: TodayStreamPhone/Tablet (v16-proposed). */

/* ---- the group ---- */
.obn-list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  background: var(--ob3-surface); border-radius: var(--ob3-today-group-radius); overflow: hidden;
}
.obn-list > li + li { border-top: 1px solid var(--ob3-today-hairline); }
.obn-card, .obn-held { position: relative; color: var(--ob3-ink); }

/* ---- the row: lead | title (line 1) / why + pill (line 2) ---- */
.obn-row {
  display: grid; grid-template-columns: var(--ob-row-lead) minmax(0, 1fr) auto; grid-template-areas: "lead title title" "lead why act";
  column-gap: var(--ob-row-gap); row-gap: 4px; align-items: center; box-sizing: border-box; min-height: var(--ob-row-min);
  padding: 8px var(--ob-row-pad); grid-template-rows: minmax(20px, auto) minmax(24px, auto);
}
.obn-ico {
  grid-area: lead; align-self: center; width: var(--ob-row-lead); height: var(--ob-row-lead); box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--ob3-sunk-deep); color: var(--ob3-muted);
}
.obn-ico[data-tone="alert"] { background: var(--ob3-alert-tint); color: var(--ob3-alert); }
.obn-ico[data-tone="good"] { background: var(--ob3-good-tint); color: var(--ob3-good); }
.obn-ico[data-tone="attention"] { background: var(--ob3-attention-tint); color: var(--ob3-attention); }
.obn-ico[data-tone="money"] { background: var(--ob3-money-tint); color: var(--ob3-money); }
.obn-ico[data-tone="accent"] { background: var(--ob3-accent-tint); color: var(--ob3-on-accent-tint); }

.obn-title {
  grid-area: title; display: block; min-width: 0; margin: 0; font-size: 15px; line-height: 20px; font-weight: var(--ob3-weight-semibold);
  color: var(--ob3-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.obn-why {
  grid-area: why; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0;
  font-size: var(--ob3-text-meta); line-height: var(--ob3-leading-meta); color: var(--ob3-muted);
}
.obn-why-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obn-why-t:empty { display: none; }
.obn-chip {
  flex: 0 0 auto; padding: 1px 8px; border-radius: var(--ob3-radius-full); background: var(--ob3-attention-tint); color: var(--ob3-ink);
  font-size: var(--ob3-text-label); line-height: var(--ob3-leading-label); font-weight: var(--ob3-weight-semibold); white-space: nowrap;
}
/* Opened: the title and why wrap in full. */
.obn-card.is-open .obn-title, .obn-card.is-open .obn-why-t { white-space: normal; overflow-wrap: anywhere; }

/* The disclosure: the title is the button; its ::after covers the row so the whole row opens it (the pill sits above). */
body.obds-app .ob-today button.obn-tx {
  grid-area: title; display: block; min-width: 0; margin: 0; padding: 0 !important; border: 0 !important; background: transparent !important;
  color: inherit !important; font: inherit; text-align: left; cursor: pointer; border-radius: 0 !important;
}
.obn-tx::after { content: ""; position: absolute; inset: 0; }
.obn-tx:focus-visible { outline: var(--ob3-focus-width) solid var(--ob3-focus); outline-offset: 2px; }
.obn-card:hover { background: var(--ob3-sunk); }

/* ---- pills: drawn 32 px high, a 44 px hit area (the ::before) ---- */
body.obds-app .ob-today .obn-btn {
  position: relative; z-index: 1; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; height: 32px; min-height: 32px;
  min-width: 44px; padding: 0 14px !important; border-radius: var(--ob3-radius-full) !important; font: inherit; font-size: 13px;
  font-weight: var(--ob3-weight-semibold); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.obn-btn::before { content: ""; position: absolute; inset: -6px -2px; }
/* The pill shares line 2 with the why: it overhangs the line by 4 px each way so the row stays 66 px. */
.obn-row > .obn-btn { grid-area: act; justify-self: end; margin: -4px 0; }
body.obds-app .ob-today .obn-btn.is-primary { background: var(--ob3-accent) !important; color: var(--ob3-on-accent) !important; border: 0 !important; }
body.obds-app .ob-today .obn-btn.is-outline { background: var(--ob3-sunk) !important; color: var(--ob3-ink) !important; border: 0 !important; }
body.obds-app .ob-today .obn-btn[disabled] { opacity: 0.55; cursor: default; }
.obn-btn:focus-visible, .obn-more:focus-visible, .obn-open-all:focus-visible, .obn-undo:focus-visible { outline: var(--ob3-focus-width) solid var(--ob3-focus); outline-offset: var(--ob3-focus-offset); }

/* ---- the detail (secondary actions), under the text ---- */
.obn-detail { padding: 0 var(--ob-row-pad) 12px var(--ob-row-text-x); }
.obn-detail[hidden] { display: none; }
.obn-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ob3-space-3) var(--ob3-space-2); }

/* ---- "N more": a row of the group, the text on the row text edge ---- */
.obn-more-row { display: flex; }
body.obds-app .ob-today button.obn-more {
  flex: 1 1 auto; display: flex; align-items: center; min-height: 44px; margin: 0; padding: 0 var(--ob-row-pad) 0 var(--ob-row-text-x) !important;
  border: 0 !important; border-radius: 0 !important; background: transparent !important; color: var(--ob3-accent-text) !important;
  font: inherit; font-size: var(--ob3-text-body-sm); font-weight: var(--ob3-weight-semibold); text-align: left; cursor: pointer;
}
body.obds-app .ob-today button.obn-more:hover { background: var(--ob3-sunk) !important; }

/* ---- the footer line: to tidy up, Open Decisions ---- */
.obn-foot { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--ob3-space-5); margin-top: 2px; }
.obn-open-all {
  display: inline-flex; align-items: center; min-height: 44px; font-size: var(--ob3-text-body-sm); font-weight: var(--ob3-weight-semibold);
  color: var(--ob3-accent-text); text-decoration: none;
}
.obn-past, .obn-partial { margin: var(--ob3-space-2) 0 0; font-size: var(--ob3-text-meta); line-height: var(--ob3-leading-meta); color: var(--ob3-muted); }

/* ---- states: failed (never drawn as empty) and empty ---- */
.obn-state { box-sizing: border-box; border-radius: var(--ob3-today-group-radius); background: var(--ob3-surface); color: var(--ob3-ink); }
.obn-state.is-failed { padding: var(--ob3-space-4); background: var(--ob3-sunk); }
.obn-state.is-failed .obn-why { display: block; margin-top: 2px; }
.obn-state-t { margin: 0; font-size: 15px; line-height: 20px; font-weight: var(--ob3-weight-semibold); }
.obn-state.is-failed .obn-btn { margin-top: var(--ob3-space-3); }
.obn-state.is-failed + .obn-list { margin-top: var(--ob3-space-3); }
.obn-held .obn-title, .obn-state .obn-row .obn-title { font-size: var(--ob3-text-body-sm); }

/* ---- one status line: a settled write, a refusal, or the 10 s Undo ---- */
.obn-note { display: flex; align-items: center; gap: var(--ob3-space-3); min-height: 44px; margin: var(--ob3-space-2) 0 0; font-size: var(--ob3-text-body-sm); line-height: var(--ob3-leading-body-sm); color: var(--ob3-ink); }
.obn-note-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.obn-note-n { flex: 0 0 auto; color: var(--ob3-muted); }
body.obds-app .ob-today .obn-undo { min-height: 44px; min-width: 44px; padding: 0 var(--ob3-space-2) !important; background: transparent !important; border: 0 !important; color: var(--ob3-ink) !important; font: inherit; font-size: var(--ob3-text-body-sm); font-weight: var(--ob3-weight-semibold); text-decoration: underline; cursor: pointer; }

/* Until the five reads answer the section is empty: hold the room the rows will take (3 on the phone, 5 from 900 px), so the column does
   not grow under the reader. */
#ob-decisions-summary:empty { min-height: calc(3 * 60px); }
@media (min-width: 900px) { #ob-decisions-summary:empty { min-height: calc(5 * 60px); } }
.obn-warn { margin: 0 0 var(--ob3-space-2); font-size: var(--ob3-text-meta); line-height: var(--ob3-leading-meta); color: var(--ob3-muted); }

/* A column under 300 px (font scale 2 on a phone): the row STACKS. The icon tile goes, the title takes the full width and wraps whole,
   the why is one line under it and the pill sits below on the text edge, never wrapping its label. */
@container obcol (max-width: 300px) {
  .obn-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "why" "act"; }
  .obn-row > .obn-ico { display: none; }
  .obn-title, .obn-held .obn-title { white-space: normal; overflow: visible; overflow-wrap: break-word; }
  .obn-row > .obn-btn { justify-self: start; margin: 6px 0 2px; max-width: 100%; }
  .obn-more-row .obn-more, .obn-foot-row > .obn-foot { padding-left: var(--ob-row-pad) !important; }
}

/* T-VISUAL-TODAY review: only the FIRST row's action is the filled pill; the others are tonal (same size, same trailing x), so the
   rows do not compete. The Decisions links are the group's quiet last row, on the row text edge. */
body.obds-app .ob-today .obn-list > .obn-card ~ .obn-card .obn-row > .obn-btn.is-primary { background: var(--ob3-accent-tint) !important; color: var(--ob3-on-accent-tint) !important; }
.obn-foot-row { display: flex; }
.obn-foot-row > .obn-foot { flex: 1 1 auto; margin: 0; padding: 0 var(--ob-row-pad) 0 var(--ob-row-text-x); }
.obn-foot-row .obn-open-all { font-size: var(--ob3-text-meta); }
/* T-NEEDS-CONTEXT (30 Oct 2026): a row with context reads WHAT (the title) / LINK · WHY (the meta line). The pill moves up beside the
   title so the meta line has the full text width; only the title's tail may end in an ellipsis. The link and the why are never cut:
   they wrap (the server keeps them short: lib/needs-context.js LINK_MAX / WHY_MAX). */
.obn-card.has-ctx .obn-row { grid-template-areas: "lead title act" "lead why why"; }
.obn-card.has-ctx .obn-row > .obn-btn { margin: -6px 0 -6px var(--ob3-space-2); align-self: start; }
/* Beside the pill the title may take a second line (the WHAT is the content), then its tail ends in an ellipsis. */
.obn-card.has-ctx .obn-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
.obn-card.has-ctx.is-open .obn-title { display: block; -webkit-line-clamp: unset; }
.obn-card.has-ctx .obn-why { flex-wrap: wrap; align-items: baseline; column-gap: 0; row-gap: 0; }
.obn-link { min-width: 0; color: var(--ob3-ink); font-weight: var(--ob3-weight-semibold); overflow-wrap: anywhere; }
.obn-card.has-ctx .obn-why-t { white-space: normal; overflow: visible; overflow-wrap: anywhere; display: inline; -webkit-line-clamp: unset; }
.obn-low { display: inline-flex; align-items: center; min-height: 32px; font-size: var(--ob3-text-meta); color: var(--ob3-muted); }
/* PLAN IT (31 Oct 2026): a tonal pill in the row's menu and an in-row panel (day, optional time and estimate, one confirm). */
body.obds-app .ob-today .obn-btn.is-tonal { background: var(--ob3-accent-tint) !important; color: var(--ob3-on-accent-tint) !important; border: 0 !important; }
.obn-planit { display: flex; flex-direction: column; gap: var(--ob3-space-3); margin-top: var(--ob3-space-3); padding: var(--ob3-space-3); border-radius: 12px; background: var(--ob3-sunk); }
.obn-planit-t { margin: 0; font-size: var(--ob3-text-meta); line-height: var(--ob3-leading-meta); color: var(--ob3-muted); }
.obn-planit-days { display: flex; flex-wrap: wrap; gap: var(--ob3-space-2); }
body.obds-app .ob-today .obn-chipbtn.is-on { background: var(--ob3-accent) !important; color: var(--ob3-on-accent) !important; }
.obn-planit-row { display: flex; flex-wrap: wrap; gap: var(--ob3-space-3); }
.obn-planit-f { display: flex; flex-direction: column; gap: 4px; font-size: var(--ob3-text-meta); color: var(--ob3-muted); }
.obn-planit input, .obn-planit select { min-height: 44px; box-sizing: border-box; padding: 0 10px; border-radius: 10px; border: 1px solid var(--ob3-line); background: var(--ob3-surface); color: var(--ob3-ink); font: inherit; }
.obn-planit > .obn-btn { align-self: flex-start; }
/* The dot trails the link, so a wrapped meta line never starts with it. */
.obn-link:has(+ .obn-why-t:not(:empty))::after { content: "\00b7"; margin: 0 6px; font-weight: 400; color: var(--ob3-muted); }
.obn-chip + .obn-link { margin-left: 6px; }
.obn-chip.is-after { margin-left: 8px; }
@container obcol (max-width: 300px) {
  .obn-card.has-ctx .obn-row { grid-template-areas: "title" "why" "act"; }
  .obn-card.has-ctx .obn-row > .obn-btn { margin: 6px 0 2px; }
}
/* T-VISUAL-TODAY review: from 900 px the why may take two lines beside the pill rather than being cut off. */
@media (min-width: 900px) {
  .obn-why { align-items: flex-start; }
  .obn-why-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
/* The footer row is drawn 32 px high; each link keeps a 44 px hit area (its ::after overhang). */
.obn-foot-row .obn-open-all { position: relative; min-height: 32px; }
.obn-foot-row .obn-open-all::after { content: ""; position: absolute; inset: -6px -4px; }
@media (min-width: 900px) { .obn-why:has(.obn-chip) .obn-why-t { -webkit-line-clamp: 1; } }
