/* Local Action Plan presentation. Container width accounts for the app sidebar. */
#page-action-plan .action-plan-page { container-type: inline-size; }
#page-action-plan .topline { align-items: center; gap: 12px; padding-bottom: 0; }
#page-action-plan .action-plan-guide {
  margin: 0 0 18px; background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible;
}
#page-action-plan .action-plan-guide > summary {
  display: inline-flex; align-items: center; gap: .6em; color: #9ed0ef; padding: .45em 0;
}
#page-action-plan .action-plan-guide > summary::after {
  content: '+'; display: inline; width: auto; height: auto; background: none; border: 0; font-size: 1em;
}
#page-action-plan .action-plan-guide[open] > summary::after { content: '−'; }
#page-action-plan .action-plan-guide-body { padding: 0 0 1em; }
#page-action-plan :where(p, .record-field small, .guided-field > span, .roadmap-stage-detail) { max-inline-size: 68ch; }
#page-action-plan .clinical-stack, #page-action-plan .daily-focus-zone {
  margin: 0; padding: 0; border: 0; background: none;
}
#page-action-plan .clinical-task-list, #dashboardActions { display: grid; gap: 20px; }
#dashboardActions > :empty { display: none; }
#page-action-plan :is(.action-focus-card, .clinical-task-card) {
  min-width: 0; padding: clamp(12px, 2.2cqi, 26px); background: #0d1c27;
  border: 1px solid var(--line); border-top: 3px solid var(--action-accent); border-radius: 14px; box-shadow: none;
}
#page-action-plan .clinical-task-card.urgent { border-top-color: #ff7188; }
#page-action-plan :is(.clinical-task-card > header, .clinical-task-card > summary, .action-focus-head) {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 12px; padding: 0;
}
#page-action-plan :is(.clinical-task-card, .action-focus-head) h3 {
  margin: 0; font-size: clamp(1.25rem, 2.2cqi, 1.62rem); line-height: 1.22; letter-spacing: -.02em;
}
#page-action-plan .plan-kind, #page-action-plan .action-focus-head .action-lane {
  margin: .25em 0 0; color: var(--action-accent); text-transform: none; letter-spacing: normal;
  font-size: .9rem; font-weight: 650;
}
#page-action-plan .plan-status { display: grid; gap: .12em; font-size: .95rem; font-weight: 700; }
#page-action-plan .plan-status small { margin: 0; color: #b8cbd8; font-size: .8rem; font-weight: 500; }
#page-action-plan .clinical-task-card > summary .plan-status::after { content: 'Show task ▾'; color: #9ed0ef; font-size: .82rem; }
#page-action-plan .clinical-task-card[open] > summary .plan-status::after { content: 'Hide task ▴'; }
#page-action-plan .task-body { padding: 0; border: 0; }
#page-action-plan .plan-location {
  margin: 16px 0 12px; font-size: .9rem; font-weight: 650; color: #b8cbd8;
}
#page-action-plan .plan-work { display: grid; gap: 12px 28px; align-items: start; max-width: 66ch; }
#page-action-plan .plan-work > * { min-width: 0; }
#page-action-plan .plan-instruction :is(.task-safe-step, .action-first-step),
#page-action-plan .plan-fields :is(.action-week, .task-route-record, .plan-record-fields, .dated-record, .guided-worksheet, .action-review-form),
#page-action-plan .plan-safety .current-step-safety {
  display: block; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none;
}
#page-action-plan .plan-instruction .step-symbol { display: none; }
#page-action-plan .plan-instruction b, #page-action-plan .plan-safety b {
  display: block; text-transform: none; letter-spacing: normal; font-size: 1rem; margin: 0 0 .3em;
}
#page-action-plan .plan-instruction p, #page-action-plan .plan-safety p { margin: 0; font-size: 1rem; line-height: 1.55; }
#page-action-plan .plan-safety { padding: 12px 16px; border-left: 3px solid #589d82; background: #102831; }
#page-action-plan .urgent .plan-safety { border-color: #ff7188; background: #2c1b28; }
#page-action-plan .urgent .plan-kind, #page-action-plan .urgent .plan-instruction b { color: #ffa8b9; }
#page-action-plan .plan-safety > p { margin-top: .6em; }
#page-action-plan .plan-fields .record-field { margin: 0 0 16px; }
#page-action-plan .plan-fields :is(.guided-record-step, .action-record-context, .dated-record, .task-status) {
  margin-block: 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 0; background: none;
}
#page-action-plan .action-record-save {
  border: 0; border-top: 1px solid var(--line); background: none; border-radius: 0; padding: 14px 0;
}
#page-action-plan .action-record-save.unsaved { border-color: #edc975; }
#page-action-plan .action-record-save { display: grid; justify-items: start; gap: 8px; }
#page-action-plan .action-save-buttons { justify-content: flex-start; }
#page-action-plan :is(.guided-action-setup, .action-saved-focus, .legacy-route-confirmation, .action-stage-content, .plan-boundary, .plan-empty) { max-width: 68ch; }
#page-action-plan :is(.guided-action-setup, .setup-stage-panel, .setup-stage-panel > div, .action-setup) { min-width: 0; }
#page-action-plan .other-priorities-head h4 { margin: 0; }
#page-action-plan .action-stage-controls { max-width: 68ch; flex-wrap: wrap; }
#page-action-plan :is(.clinical-task-card, .action-focus-card, .action-unsaved-notice) { overflow-wrap: anywhere; }
#page-action-plan :is(select, textarea, button) { max-width: 100%; }
@container (min-width: 49rem) {
  #page-action-plan .plan-work.with-safety {
    max-width: none; grid-template-columns: minmax(0,66ch) minmax(15rem,36ch); justify-content: start;
  }
  #page-action-plan .plan-instruction, #page-action-plan .plan-fields { grid-column: 1; }
  #page-action-plan .plan-safety { grid-column: 2; grid-row: 1 / span 2; }
}
@container (max-width: 35rem) {
  #page-action-plan .topline { display: flex; flex-wrap: wrap; justify-content: space-between; }
  #page-action-plan :is(.clinical-task-card > header, .clinical-task-card > summary, .action-focus-head) {
    grid-template-columns: 1fr; gap: 7px;
  }
  #page-action-plan :is(.clinical-task-card > header, .clinical-task-card > summary, .action-focus-head) > .action-domain-icon { display: none; }
  #page-action-plan .plan-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45em; }
  #page-action-plan .plan-location { margin: 10px 0; }
  #page-action-plan .plan-safety { padding: 9px 12px; }
  #page-action-plan .action-stage-controls { column-gap: 6px; }
  #page-action-plan .action-unsaved-notice .btn { white-space: normal; }
}

#page-action-plan #dashboardActions { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }
#page-action-plan .plan-instruction .plan-reason { margin-top: .6em; color: #b8cbd8; }
#page-action-plan .action-record-save button:disabled { opacity: .65; }
#page-action-plan .action-stage-controls { justify-content: space-between; }
#page-action-plan .guided-action-setup :is(.setup-stage-panel,.action-setup,.confidence-panel,.setup-boundary) {
  padding: 10px 0; border: 0; box-shadow: none; background: none;
}
#page-action-plan .guided-action-setup .setup-stage-panel { display: block; }
#page-action-plan .guided-action-setup .setup-stage-icon { display: none; }

#page-action-plan .plan-overview-links { display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; margin:4px 0; }
#page-action-plan .plan-overview-links a { color:#9ed0ef; font-size:.94rem; text-underline-offset:3px; }
#page-action-plan .plan-overview-links [hidden], #page-action-plan .plan-entry-state:empty { display:none; }
#page-action-plan #planImmediate:not(:empty) { display:grid; gap:12px; margin:0 0 16px; }
#page-action-plan #planImmediate .plan-work { margin-top:12px; }
#page-action-plan #planImmediate .plan-fields:empty { display:none; }
#page-action-plan .urgent-record { max-width:68ch; border-block:1px solid var(--line); padding:10px 0; }
#page-action-plan .urgent-record > summary { cursor:pointer; color:#9ed0ef; font-weight:650; }
#page-action-plan .action-unsaved-notice { display:grid; gap:6px; margin:0; padding:10px 14px; max-width:68ch; }
#page-action-plan .draft-item { display:flex; align-items:center; gap:8px 16px; flex-wrap:wrap; }
#page-action-plan .draft-item .btn { padding:6px 10px; }
#page-action-plan .action-unsaved-notice small { margin:0; }
#page-action-plan #actionFocusChooser { max-width:68ch; }
#page-action-plan #actionFocusChooser ul { list-style:none; padding:0; margin:8px 0 16px; }
#page-action-plan #actionFocusChooser li { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; padding:12px 0; border-bottom:1px solid var(--line); }
#page-action-plan #actionFocusChooser li div { display:flex; flex-wrap:wrap; gap:6px; }
#page-action-plan .walk-save-summary { display:grid; gap:4px; color:#d3e8f2; }

#page-action-plan .plan-records-link { display: inline-block; color: #9ed0ef; padding-block: 5px; text-underline-offset: .18em; }
#planSavedRecords { max-inline-size: 68ch; min-inline-size: 0; padding: 12px 16px; border-inline-start: 2px solid var(--line); overflow-wrap: anywhere; }
#planSavedRecords h4 { margin: 0 0 8px; }
#planSavedRecords .saved-entry-list { display: grid; gap: 12px; }
#planSavedRecords dt { font-weight: 650; }
#planSavedRecords dd { margin: 2px 0 0; white-space: pre-wrap; }
#page-action-plan .action-record-save :is(b,.walk-save-summary):empty { display: none; }
#page-action-plan .walk-check-count { margin-block: 4px; }

#page-action-plan .step-secondary { max-inline-size: 66ch; margin-block-start: 12px; min-inline-size: 0; }
#page-action-plan .step-reference-links { display: flex; gap: 0 16px; flex-wrap: wrap; align-items: center; }
#page-action-plan .step-reference-links a,
#page-action-plan :is(.step-detail,.step-secondary .action-plan-options) > summary {
  box-sizing: border-box; inline-size: fit-content; max-inline-size: 100%; min-block-size: 44px;
  padding: 10px 4px; color: #9ed0ef; line-height: 1.5; overflow-wrap: anywhere; cursor: pointer;
}
#page-action-plan .step-reference-links a { text-underline-offset: 3px; }
#page-action-plan .step-secondary .action-plan-options, #page-action-plan .step-detail {
  margin: 0; padding: 0; border: 0; background: transparent; max-inline-size: 66ch;
}
#page-action-plan .step-detail > :is(p,ul) { margin-block: 0 12px; }
#page-action-plan .step-secondary .btn { inline-size: fit-content; white-space: normal; }
#page-action-plan .followup-field small[hidden] { display: none; }
#page-action-plan .followup-field small[id^="followup-needed-"] { color: #edc975; }
#page-action-plan .plan-fields .action-stage-controls { margin: 0; justify-content: flex-start; }
#page-action-plan .topline > a.btn { text-decoration: none; }
