/* ob-plan-goals.css (R7-T1): the Plan Goals shell and the atoms every R7 module shares. Tokens only (--ob3-*, Paper and
   Graphite through the themed roles); no raw hex. Breakpoints match ob-plan-core.js and Android: phone <= 599px,
   tablet 600 to 1199px, desktop >= 1200px. T5 owns the two-pane grid for tablet and desktop (layout rules only).
   Frozen sizes (v3.8 decision 15): a row action pill is 104 x 44, a section action 184 x 44, a pill never grows
   (copy shortens, the box does not); every tap target is at least 44 px; the Min/Full toggle is 44 px high. */

#obp-goals { min-width: 0; color: var(--ob3-ink); }
#obp-goals[hidden] { display: none; }
#obp-goals .obpg-head { margin-bottom: var(--ob3-space-3); }
#obp-goals .obpg-banner:empty { display: none; }
#obp-goals .obpg-banner { margin-bottom: var(--ob3-space-3); }
#obp-goals .obpg-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ob3-space-4); align-items: start; min-width: 0; }
#obp-goals .obpg-list, #obp-goals .obpg-detail { min-width: 0; }
#obp-goals .obpg-detail:empty { display: none; }
#obp-goals .obpg-sheet[hidden] { display: none; }
#obp-goals .obpg-sub:empty { display: none; }

/* Shared atoms. */
.obpg-card { background: var(--ob3-surface); border: 1px solid var(--ob3-line); border-radius: var(--ob3-radius-card); padding: var(--ob3-space-4); box-sizing: border-box; min-width: 0; color: var(--ob3-ink); }
.obpg-tap { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; font: inherit; cursor: pointer; }
.obpg-pill {
  box-sizing: border-box; width: 104px; min-width: 104px; max-width: 104px; height: 44px; padding: 0 var(--ob3-space-2);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border: 1px solid var(--ob3-line); border-radius: var(--ob3-radius-full); background: var(--ob3-surface); color: var(--ob3-ink);
  font: inherit; font-size: var(--ob3-text-body-sm); font-weight: var(--ob3-weight-semibold); cursor: pointer;
}
.obpg-section-action {
  box-sizing: border-box; width: 184px; min-width: 184px; max-width: 184px; height: 44px; padding: 0 var(--ob3-space-3);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border: 1px solid var(--ob3-line); border-radius: var(--ob3-radius-full); background: var(--ob3-surface); color: var(--ob3-ink);
  font: inherit; font-size: var(--ob3-text-body-sm); font-weight: var(--ob3-weight-semibold); cursor: pointer;
}
.obpg-pill:disabled, .obpg-section-action:disabled, .obpg-tap:disabled { opacity: 0.55; cursor: not-allowed; }
.obpg-pill:focus-visible, .obpg-section-action:focus-visible, .obpg-tap:focus-visible { outline: var(--ob3-focus-ring); }
.obpg-muted { color: var(--ob3-muted); font-size: var(--ob3-text-meta); line-height: var(--ob3-leading-meta); }
.obpg-queued { color: var(--ob3-muted); font-size: var(--ob3-text-meta); }
.obpg-note { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ob3-space-2) var(--ob3-space-3); min-height: 44px; padding: var(--ob3-space-2) var(--ob3-space-3); background: var(--ob3-surface); border: 1px solid var(--ob3-line); border-radius: var(--ob3-radius-card); color: var(--ob3-ink); font-size: var(--ob3-text-body-sm); }

/* The Plan header on the Goals view (title, Day / Goals chips, action hosts): the Day / Week / Month control belongs to those views only. */
body[data-obp-view="goals"] #obp-head .obp-seg { display: none; }

/* R7-T5: the two-pane layout. Tablet (600 to 1199) and desktop (>= 1200) put the list beside the detail (boards PlanGoalsTablet,
   PlanGoals); a phone keeps the push (ob-plan-goals-detail.css hides the list while a goal is selected). The list never hides on a
   wider screen, so a selected goal is always reachable from the list beside it. data-obpg-layout is set by ob-plan-goals-core.js. */
#obp-goals[data-obpg-layout="tablet"] .obpg-body,
#obp-goals[data-obpg-layout="desktop"] .obpg-body { grid-template-columns: minmax(300px, 355px) minmax(0, 1fr); gap: var(--ob3-space-4); }
#obp-goals[data-obpg-layout="desktop"] .obpg-body { grid-template-columns: minmax(340px, 422px) minmax(0, 1fr); }
#obp-goals[data-obpg-layout="tablet"] .obpg-detail,
#obp-goals[data-obpg-layout="desktop"] .obpg-detail {
  position: sticky; top: var(--ob3-space-3); max-height: calc(100vh - 2 * var(--ob3-space-3)); overflow-y: auto; overscroll-behavior: contain;
  box-sizing: border-box; background: var(--ob3-surface); border: 1px solid var(--ob3-line); border-radius: var(--ob3-radius-card); padding: var(--ob3-space-4);
}
/* Nothing selected: the pane stays (so the list does not jump width) and says what it is for. */
#obp-goals[data-obpg-layout="tablet"] .obpg-detail:empty,
#obp-goals[data-obpg-layout="desktop"] .obpg-detail:empty { display: flex; align-items: center; justify-content: center; min-height: 240px; }
#obp-goals[data-obpg-layout="tablet"] .obpg-detail:empty::before,
#obp-goals[data-obpg-layout="desktop"] .obpg-detail:empty::before { content: "Pick a goal to see it here."; color: var(--ob3-muted); font-size: var(--ob3-text-body-sm); }
/* The board's wide detail has no Back arrow (the list is beside it); a phone keeps it. */
#obp-goals[data-obpg-layout="tablet"] .obpg-detail [data-act="back"],
#obp-goals[data-obpg-layout="desktop"] .obpg-detail [data-act="back"] { display: none; }
/* Phone, goal pushed: the shell's empty top bar (theme toggle only) goes too, so the detail header sits at the board's y=28 instead of ~100 px down. */
@media (max-width: 599px) {
  .obds-canvas:has(#obp-goals[data-obpg-layout="phone"][data-obpg-selected]) .obds-topbar { display: none; }
}

/* R7: the Plan header on Goals shows New goal only; Day, Week and Month keep Paste invite and New event. */
body[data-obp-view="goals"] #obp-act-invite, body[data-obp-view="goals"] #obp-act-new { display: none; }
body:not([data-obp-view="goals"]) #obp-act-goal { display: none; }

/* N2 (PG-014), board PlanGoalsPhone: on the Goals view the "+" sits at the right of the title row (Plan, Day / Goals, "+") instead of wrapping to a row of
   its own under "Plan" at 476 px. The row is wide enough at 360 too (see the 380 px tightening in ob-plan-quick.css). */
@media (max-width: 599px) {
  body[data-obp-view="goals"] #obp-head .obp-head-row > .obp-viewbar { flex: 0 0 auto; margin-left: auto; width: auto; }
  body[data-obp-view="goals"] #obp-head .obp-viewbar .obp-head-actions { width: auto; }
  body[data-obp-view="goals"] #obp-head .obp-chips { margin-left: 0; }
  body[data-obp-view="goals"] #obp-head .obpdc-chip { margin-left: auto; }
}
/* N2, boards PlanGoalsTablet and PlanGoals: "Today's N · done · carried · History" is the head of the LIST column, as wide as that column (the History link
   at the column's right edge), not a row across the whole page above the detail pane. */
#obp-goals[data-obpg-layout="tablet"] .obpg-head { max-width: 355px; }
#obp-goals[data-obpg-layout="desktop"] .obpg-head { max-width: 422px; }

/* Parity (30 Oct 2026): the Goals view's header action is the same round "+" as the other Plan views (its name stays in aria-label) */
body[data-obp-view="goals"] #obp-act-goal .obpe-act { box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--ob3-radius-full); font-size: 22px; line-height: 1; }
body[data-obp-view="goals"] #obp-act-goal .obpe-act .obpe-act-t { display: none; }
:root[data-theme] body[data-obp-view="goals"] #obp-act-goal .obpe-act { background: var(--ob3-accent) !important; color: var(--ob3-on-accent) !important; border-color: transparent !important; }
