/* Care plan: readable hierarchy on phones and laptops. Loaded after app.css / reference-system.css. */
:root{--cp-ink:#0f172a;--cp-muted:#5b6b7c;--cp-line:#e2e8f0;--cp-green:#006da6;--cp-green-soft:#e5f0fa;--cp-amber:#b45309;--cp-amber-soft:#fff7e6;--cp-red:#b91c1c;--cp-red-soft:#fee2e2}

/* Header: the person first, the line number second, selector only when it matters */
body.ref-page .pa-header{display:block!important;padding:14px 16px 12px!important}
.pa-header #header-patient-name{font-size:26px;line-height:1.15;font-weight:800;color:var(--cp-ink);letter-spacing:-.01em}
.pa-header #header-patient-name small{display:block;font-size:14px;font-weight:500;color:var(--cp-muted);margin-top:4px;letter-spacing:0}
.pa-header .text-sm.text-slate-500{font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--cp-green)}
#patient-selector{margin-top:10px!important;font-size:15px}
#patient-selector.single-line{display:none}
#sidebar-toggle{display:none!important}

/* Summary strip: three readable tiles, nothing truncated */
#summary-cards-mobile{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 14px}
#summary-cards-mobile>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:78px;padding:10px 8px!important;border:1px solid var(--cp-line)!important;border-radius:16px!important;background:#fff}
#summary-cards-mobile [id$="-mobile"]{white-space:normal!important;text-overflow:clip!important;overflow:visible!important;line-height:1.2}
#adherence-percent-mobile,#active-meds-count-mobile{font-size:26px!important}
#wellness-status-mobile{font-size:14px!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important}
#summary-cards-mobile .text-xs{font-size:14px!important;font-weight:600;color:var(--cp-muted)}
#summary-cards.md\:grid{gap:14px}

/* One segmented control for the page tabs */
nav[role="tablist"]{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:0!important;padding:4px;background:#e9eef3;border-radius:14px;margin:0 0 14px!important}
nav[role="tablist"] .relative{display:contents}
nav[role="tablist"] .pa-chip{width:100%;justify-content:center;border:0!important;border-radius:11px!important;padding:11px 6px!important;font-size:14px;font-weight:700;background:transparent!important;color:#334155!important;box-shadow:none!important;transition:background .15s}
nav[role="tablist"] .pa-chip.bg-slate-900,nav[role="tablist"] .pa-chip[aria-selected="true"]{background:#fff!important;color:var(--cp-green)!important;box-shadow:0 1px 3px rgba(15,23,42,.14)!important}
nav[role="tablist"] #tab-dropdown{grid-column:1/-1;position:static!important;margin-top:6px!important;display:none}
nav[role="tablist"] #tab-dropdown:not(.hidden){display:block}
nav[role="tablist"] #tab-more-badge{position:static!important;display:inline-block;margin-left:4px;vertical-align:middle}

/* Plan list card */
#section-items{border-radius:18px;overflow:hidden}
#section-items .pa-card-header{padding:14px 16px 10px!important;gap:12px!important}
#section-items .pa-card-header>div:first-child{align-items:flex-start}
#section-items .pa-tab{font-size:15px;font-weight:700;padding:6px 0}
#add-instruction-btn{border-radius:12px!important;padding:12px 16px!important;font-weight:700;font-size:15px;min-height:46px}
#section-items .pa-card-header>div:last-child{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:8px;padding:10px 0 2px!important;border-top:1px solid var(--cp-line)!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}
#section-items .pa-card-header>div:last-child::-webkit-scrollbar{display:none}
#section-items .pa-card-header>div:last-child>span{display:none}
.status-tab{flex:none;font-size:13px!important;padding:8px 14px!important;border-radius:999px!important;font-weight:600;white-space:nowrap}
.status-tab.bg-slate-900{background:var(--cp-green)!important}
#section-items .pa-card-body{padding:12px 12px 16px!important;background:#f8fafc}

/* Banners: one line each, quiet */
#interactions-banner-expanded{margin:12px 12px 0!important;padding:10px 12px!important;border-radius:12px!important}
#interactions-banner-expanded .text-sm{font-size:14px!important}
#pending-alert{padding:10px 12px!important;border-radius:12px!important;font-size:14px!important;margin-bottom:12px!important}

/* Medication cards */
.cp-item{display:block;padding:14px 16px 12px!important;border-radius:16px!important;border:1px solid var(--cp-line)!important;background:#fff!important}
.cp-item.cp-attention{border-color:#f5d38a!important;background:#fffdf5!important}
.cp-item .cp-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.cp-item .cp-name{flex:1 1 auto;min-width:0;font-size:17px;font-weight:700;color:var(--cp-ink);line-height:1.3;overflow-wrap:break-word}
.cp-item .cp-dose{font-size:15px;color:#1e293b;margin-top:4px;line-height:1.4}
.cp-item .cp-reminder{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin-top:8px;font-size:13px;font-weight:600;color:#475569;line-height:1.3}
.cp-item .cp-reminder svg{width:18px;height:18px;flex:none}
/* chk #47 A long reminder line stays beside its icon instead of leaving the icon alone on a line. */
.cp-item .cp-reminder>span:only-of-type{flex:1 1 0;min-width:0}
.cp-item .cp-reminder.is-on{color:var(--cp-green)}
.cp-item .cp-reminder.is-off{color:#64748b}
.cp-item .cp-reminder.is-warn,.cp-item .cp-reminder.is-prn{color:var(--cp-amber)}
.cp-item .cp-time{font-size:12px;font-weight:700;color:var(--cp-green);background:var(--cp-green-soft);padding:3px 8px;border-radius:999px;line-height:1.2}
.cp-item .cp-reminder.is-off .cp-time{color:#64748b;background:#eef2f6}
.cp-item .cp-meta{font-size:14px;color:var(--cp-muted);margin-top:8px}
.cp-status{flex:none;display:inline-flex;align-items:center;padding:5px 11px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.02em;white-space:nowrap;line-height:1.2}
.cp-status.approved{background:#dcfce7;color:#166534}
.cp-status.needs_review,.cp-status.draft{background:var(--cp-amber-soft);color:var(--cp-amber)}
.cp-status.rejected{background:var(--cp-red-soft);color:var(--cp-red)}
.cp-status.archived{background:#e2e8f0;color:#475569}
.cp-group-title{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--cp-muted);margin:6px 4px 8px}
details.cp-archive{margin-top:14px}
details.cp-archive>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border:1px dashed #cbd5e1;border-radius:14px;font-weight:700;color:#475569;font-size:14px}
details.cp-archive>summary::-webkit-details-marker{display:none}
details.cp-archive>summary::after{content:"Show";font-size:14px;color:var(--cp-green)}
details.cp-archive[open]>summary::after{content:"Hide"}
details.cp-archive .cp-item{opacity:.85;margin-top:10px}

/* Laptop and desktop */
@media(min-width:1024px){
  body.ref-page main.flex-1{padding:24px 32px!important}
  .pa-main-content{max-width:1040px;margin:0 auto}
  body.ref-page .pa-header{padding:18px 32px 14px!important}
  .pa-header #header-patient-name{font-size:30px}
  nav[role="tablist"]{max-width:560px}
  #summary-cards>*{border-radius:18px!important}
  #section-items .pa-card-header>div:last-child{padding-top:12px!important}
  .cp-item{padding:16px 20px!important}
  .cp-item .cp-name{font-size:18px}
}
/* #135 What a card waiting for review needs from you; status chips are full-size tap targets that wrap. */
.cp-next{margin-top:6px;font-size:14px;font-weight:600;color:#9a3412}
.status-tab{min-height:44px;font-size:14px!important;padding:8px 14px!important}
.status-tab.bg-slate-900{color:#ffffff!important} /* #135 the selected chip was ink on green */
/* #134 The header's "Care Plan" + name is the page's h1 and keeps its look; tabs and section chips are 44px to tap. */
h1.cp-page-title{margin:0;font-size:inherit!important;font-weight:inherit;line-height:inherit;letter-spacing:inherit}
.pa-chip,.pa-tab{min-height:44px!important}
/* #668 The dialogs' close button is a 44px target on a phone (it measured 17 by 26). */
@media (max-width:700px){.pa-modal-close{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}}
/* #25 Missing and guessed values, field messages next to the field, the new card's highlight, and the reason
   Approve is off, written under the buttons. */
.cp-missing{color:#b91c1c;font-weight:700}
/* chk #37 "Dose missing: add it" is a link-style button into Edit; an item link that can't open says why. */
button.cp-add-it{background:none;border:0;padding:4px 0;margin:-4px 0;font:inherit;font-weight:700;color:#b91c1c;text-decoration:underline;text-underline-offset:2px;cursor:pointer;text-align:left;min-height:32px}
button.cp-add-it:hover{color:#991b1b}
button.cp-add-it:focus-visible{outline:2px solid #b91c1c;outline-offset:2px;border-radius:4px}
.cp-load-error{display:grid;gap:12px;justify-items:start;padding:14px 16px;border:1px solid #fecaca;background:#fef2f2;color:#7f1d1d;border-radius:12px;font-size:16px;line-height:1.45}
.cp-guess{padding:10px 12px;border:1px solid #fcd34d;background:#fffbeb;color:#92400e;border-radius:10px;font-size:14px;line-height:1.4}
.cp-field-error{margin-top:6px;font-size:14px;font-weight:600;color:#b91c1c}
.pa-input[aria-invalid="true"]{border-color:#dc2626!important;box-shadow:0 0 0 2px rgba(220,38,38,.15)}
.cp-item.cp-just-added{outline:3px solid #0f766e;outline-offset:2px;box-shadow:0 0 0 6px rgba(15,118,110,.15)!important;transition:outline-color .3s}
#detail-modal .pa-modal-footer{flex-wrap:wrap}
.cp-approve-reason{flex-basis:100%;margin:8px 0 0;font-size:14px;font-weight:600;color:#9a3412;text-align:right}
/* #25 Toasts sit above the page's own header and below it on a phone, so they can be read. */
#toast-root{z-index:2147483000!important}
@media (max-width:768px){#toast-root{top:calc(env(safe-area-inset-top,0px) + 84px)!important;left:12px!important;right:12px!important}#toast-root .toast{font-size:15px}.cp-approve-reason{text-align:left}}
#results-content{max-height:none!important;overflow:visible!important}
/* #18 Expired prescriptions, the "still taking it?" question, the call schedule, family status and unsaved changes. */
.cp-status.expired{background:var(--cp-red-soft);color:var(--cp-red)}
.cp-item .cp-expired{margin-top:6px;font-size:14px;font-weight:600;color:var(--cp-red)}
.cp-item .cp-ask,.cp-item-ask .cp-ask{margin-top:10px;padding:10px 12px;border:1px solid #fcd34d;background:#fffbeb;border-radius:12px;font-size:14px;font-weight:600;color:#92400e}
.cp-item .cp-ask-buttons,.cp-item-ask .cp-ask-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.cp-item .cp-ask-buttons .pa-btn,.cp-item-ask .cp-ask-buttons .pa-btn{min-height:44px}
.cp-schedule{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.cp-schedule-row{display:flex;flex-wrap:wrap;gap:4px 12px;padding:10px 12px;border:1px solid var(--cp-line);border-radius:12px;background:#fff;font-size:15px;color:var(--cp-ink)}
.cp-schedule-row.is-wellness{background:#f8fafc}
.cp-schedule-when{font-weight:700;color:var(--cp-green);min-width:150px}
.cp-warn{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border:1px solid #fca5a5;background:var(--cp-red-soft);color:#7f1d1d;border-radius:12px;font-size:14px;line-height:1.4;margin-bottom:10px}
.cp-warn a{display:inline-flex;align-items:center;min-height:44px;font-weight:700;color:#7f1d1d;text-decoration:underline}
.cp-people{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.cp-person{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border:1px solid var(--cp-line);border-radius:12px;background:#fff;font-size:14px;color:#334155}
.cp-person strong{color:var(--cp-ink);font-size:15px}
.cp-person-status[data-tone="ok"]{color:var(--cp-green);font-weight:600}
.cp-person-status[data-tone="todo"]{color:var(--cp-amber);font-weight:600}
.cp-person-note{color:var(--cp-red);font-weight:700}
.cp-dirty{font-size:14px;font-weight:600;color:var(--cp-amber)}
#ms-cancel:disabled,#np-cancel:disabled{opacity:.5;cursor:default}
#detail-content .font-medium{overflow-wrap:anywhere;min-width:0}
/* #27 Date range chips: the chosen one is filled green with a check; date boxes wide enough for mm/dd/yyyy and the icon. */
.cp-range-chip{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:8px 14px;border-radius:999px;border:1px solid #cbd5e1;background:#fff;color:#334155;font-size:14px;font-weight:600;cursor:pointer}
.cp-range-chip:hover{border-color:var(--cp-green)}
.cp-range-chip[aria-pressed="true"]{background:var(--cp-green)!important;border-color:var(--cp-green);color:#fff!important}
.cp-range-chip[aria-pressed="true"]::before{content:"\2713";font-weight:800}
.cp-date-input{width:auto;min-width:11.5rem;min-height:44px;font-size:15px;padding:8px 10px}
/* #27 History rows: plain sentences, full names, times that don't wrap. */
.cp-history-summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 12px;font-size:15px;color:#334155}
.cp-history-summary:empty{display:none}
.cp-hclear{display:inline-flex;align-items:center;gap:4px;min-height:36px;padding:4px 12px;border-radius:999px;background:var(--cp-green-soft);color:var(--cp-green);border:1px solid #b7dccd;font-size:14px;font-weight:700;cursor:pointer}
.cp-hexplain{flex-basis:100%;margin:6px 0 0;font-size:14px;line-height:1.45;color:#475569}
.cp-hday{font-size:14px;font-weight:700;color:#475569;margin:0 2px 8px}
.cp-hrow{border:1px solid var(--cp-line);border-radius:12px;background:#fff;font-size:15px;color:var(--cp-ink)}
.cp-hrow>summary,.cp-hrow.is-wellness{display:flex;align-items:flex-start;gap:10px;padding:12px 14px}
.cp-hrow>summary{cursor:pointer;list-style:none}
.cp-hrow>summary::-webkit-details-marker{display:none}
.cp-hrow.is-taken{border-color:#bbe5cf;background:#f3fbf7}
.cp-hrow.is-missed{border-color:#f7c4c4;background:#fff6f6}
.cp-hrow.is-alert{border-color:#f5d38a;background:#fffbeb}
.cp-hrow.is-concern{border-color:#f5d38a}
.cp-hicon{flex:none;width:20px;text-align:center;font-weight:800;line-height:1.4}
.cp-hrow.is-taken .cp-hicon{color:var(--cp-green)}
.cp-hrow.is-missed .cp-hicon{color:var(--cp-red)}
.cp-hrow.is-alert .cp-hicon{color:var(--cp-amber)}
.cp-hmain{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.cp-hname{font-weight:700;overflow-wrap:anywhere;line-height:1.35}
.cp-hsub{color:#475569;font-size:14px}
.cp-htag{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:12px;font-weight:600;vertical-align:middle}
.cp-hfound{color:#92400e;font-size:14px;font-weight:600}
.cp-hquote{color:#334155;font-size:14px;font-style:italic}
.cp-hlink{align-self:flex-start;min-height:36px;padding:4px 0;font-size:15px;font-weight:600;color:#0e6aa8;text-decoration:underline;background:none;border:0;cursor:pointer}
.cp-hsteps{margin:0;padding:0 14px 12px 44px;list-style:disc;font-size:14px;line-height:1.5;color:#334155}
.cp-hrow>.cp-hexplain,.cp-hrow>div{margin:0 14px 12px 44px}
/* #26 Remove choices, the photo check box, and the Undo toast. */
.cp-remove-choices{border:0;margin:0;padding:0;display:grid;gap:10px}
.cp-remove-choice{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid #d7dee7;border-radius:10px;cursor:pointer}
.cp-remove-choice:has(input:checked){border-color:#0f766e;background:#f0fdfa}
.cp-remove-choice input{margin-top:4px;width:18px;height:18px;flex:none}
.cp-remove-choice strong{display:block;color:#0f172a}
.cp-remove-help{display:block;font-size:14px;color:#475569;margin-top:2px}
.pa-recovery-actions{display:flex;flex-wrap:wrap;gap:8px}
.pa-recovery .pa-recovery-actions button{margin:0}
.pa-recovery-photo{display:block;max-width:100%;max-height:260px;object-fit:contain;margin:0 0 12px;border-radius:6px;background:#fff}
.cp-undo-toast{display:flex;align-items:center;gap:14px}
/* chk #40 Undo never breaks mid-word and is a full-size tap target. */
.cp-undo{font-weight:700;text-decoration:underline;color:#065f46;padding:4px 6px;flex:none;white-space:nowrap;min-height:44px;min-width:44px}
/* #29 The adherence line under the tiles, the Doctor summary next to + Add to Plan, duplicate and Search notes,
   filter counts, and long names that wrap (after a "/" first) in cards, Search and the item window. */
.cp-tiles-note{margin:-4px 2px 16px!important;font-size:14px;line-height:1.45;color:#475569}
.cp-tiles-note:empty{display:none}
.cp-plan-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#doctor-summary-btn{border-radius:12px!important;padding:12px 16px!important;font-weight:700;font-size:15px;min-height:46px}
.cp-item .cp-duplicate{margin-top:6px;font-size:14px;font-weight:600;color:#9a3412}
.cp-item .cp-older{margin-top:6px;font-size:14px;color:#64748b}
.cp-history-older-note{margin-top:12px;font-size:15px;color:#475569;text-align:center}
.cp-item .cp-why{margin-top:6px;font-size:14px;color:#475569}
.status-tab .cp-count{font-weight:500;opacity:.85}

/* #30 Keyboard: cards are buttons with a visible focus ring. Phones: one "Show" control instead of the chips, compact
   tiles and the two plan buttons side by side, so the list starts on the first screen. */
.cp-item:focus-visible{outline:3px solid var(--cp-green);outline-offset:2px}
.cp-show{display:none}
@media (max-width:640px){.status-tab{display:none!important}
.cp-show{display:flex;align-items:center;gap:8px;width:100%;font-size:15px;font-weight:600;color:#334155}
.cp-show select{flex:1 1 auto;min-height:44px;padding:8px 12px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;font-size:15px;font-weight:600;color:var(--cp-ink)}
#summary-cards-mobile{gap:8px;margin-bottom:10px}
#summary-cards-mobile>button{min-height:60px;padding:6px 6px!important;border-radius:14px!important}
#adherence-percent-mobile,#active-meds-count-mobile{font-size:21px!important}
/* chk #49 Tile labels and the note stay at 14 px on phones, for weak eyes. */
#wellness-status-mobile{font-size:14px!important}
#summary-cards-mobile .text-xs{font-size:14px!important;line-height:1.25}
.cp-tiles-note{font-size:14px;margin-bottom:10px!important}
.cp-plan-actions{flex-wrap:nowrap;width:100%}
.cp-plan-actions .pa-btn,.cp-plan-actions #add-instruction-btn{flex:1 1 auto;font-size:14px!important;padding:10px 10px!important;min-height:44px;white-space:nowrap}}
/* #30 round 4: on phones the three tiles and the adherence note fold into one tap-to-open line. */
.cp-tiles-toggle{display:none}
@media (max-width:640px){.cp-tiles-toggle{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;margin-bottom:10px;padding:10px 14px;background:#fff;border:1px solid var(--cp-line);border-radius:14px;text-align:left;font-size:15px;line-height:1.35;color:var(--cp-ink)}
#cp-tiles-summary{flex:1 1 auto;min-width:0}
.cp-tiles-more{flex:none;font-weight:700;color:var(--cp-green);text-decoration:underline}
#instructions-content:not(.cp-tiles-open) #summary-cards-mobile,#instructions-content:not(.cp-tiles-open) #adherence-detail{display:none!important}
#cp-tiles-summary{font-size:14px}
main:has(#instructions-content){padding-top:12px!important}
#instructions-content{margin-top:0!important}
#interactions-banner-expanded{margin:8px 12px 0!important;padding:8px 10px!important}
#interactions-banner-expanded #interaction-checked{font-size:12px!important;line-height:1.35}
#interactions-banner-expanded>.mt-1{display:none}
#interactions-banner-expanded>.flex{row-gap:4px!important}
#interactions-banner-expanded button{min-height:40px!important;padding-top:4px!important;padding-bottom:4px!important}}
.cp-item .cp-name,.cp-item .cp-dose,#search-results .cp-item{overflow-wrap:anywhere}
#detail-title,#detail-content{overflow-wrap:anywhere;min-width:0}
#search-results .cp-item{margin-top:10px}
.cp-item .cp-row{align-items:flex-start}
/* #28 The wellness tile shows the whole outcome ("No answer about their health"): it wraps, never clipped over its caption. */
#summary-cards-mobile #wellness-status-mobile{display:block;-webkit-line-clamp:unset;overflow:visible!important}

/* #31 Tap-to-expand explanations under the tabs, the Care tools as cards, and as links in More. */
.cp-explain{margin:-22px 0 0!important;font-size:14px;color:#334155}
#cp-explain~section{margin-top:8px!important}
#cp-explain~.cp-tools{margin-top:20px!important}
.cp-explain>summary{display:inline-flex;align-items:center;min-height:44px;cursor:pointer;font-weight:700;color:var(--cp-green);text-decoration:underline}
.cp-explain dl{margin:4px 0 8px;padding:12px 14px;background:#fff;border:1px solid var(--cp-line);border-radius:12px}
.cp-explain dl>div{padding:6px 0;border-bottom:1px solid #eef2f6}
.cp-explain dl>div:last-child{border-bottom:0}
.cp-explain dt{font-weight:700;color:var(--cp-ink)}
.cp-explain dd{margin:2px 0 0;line-height:1.45}
.cp-explain>a{display:inline-flex;align-items:center;min-height:44px;font-weight:600;color:var(--cp-green);text-decoration:underline}
.cp-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cp-tools a{display:flex;flex-direction:column;gap:4px;padding:16px;background:#fff;border:1px solid var(--cp-line);border-radius:14px;color:var(--cp-ink);text-decoration:none;min-height:44px}
.cp-tools a:hover{border-color:var(--cp-green);box-shadow:0 1px 4px rgba(15,23,42,.08)}
.cp-tools a:focus-visible{outline:3px solid var(--cp-green);outline-offset:2px}
.cp-tools strong{font-size:16px;color:var(--cp-green)}
.cp-tools span{font-size:14px;line-height:1.45;color:#475569}
.tab-dropdown-link{display:flex;align-items:center;min-height:44px;padding:.5rem 1rem;font-size:1rem;color:var(--cp-green);font-weight:600;text-decoration:underline;border-top:1px solid #eef2f6}
@media (max-width:640px){.cp-tools{grid-template-columns:1fr}}
/* chk #36 An expired item that is still called: its window shows the card's line above the same question; the Current
   view points to it; each sub-tab shows how many of its items wait for review. */
.cp-item-ask .cp-expired{font-size:15px;font-weight:600;color:var(--cp-red);margin-bottom:6px}
.cp-still-called{margin:0 0 12px;padding:10px 14px;border:1px solid #fcd34d;background:#fffbeb;border-radius:12px;font-size:15px;font-weight:600;color:#92400e}
.cp-still-called .cp-link{background:none;border:0;padding:4px 0;min-height:24px;white-space:nowrap;font:inherit;color:inherit;text-decoration:underline;cursor:pointer}
.pa-tab .cp-tab-review{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;margin-left:6px;padding:0 6px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:13px;font-weight:700;vertical-align:middle}
.pa-tab .cp-tab-review[hidden]{display:none}
/* chk #47 Time buttons big enough to tap: remove-time x and the quick times are at least 44 px. */
.cp-time-remove{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;font-size:20px;line-height:1;border-radius:999px;background:transparent}
.cp-time-remove:hover,.cp-time-remove:focus-visible{background:rgba(29,78,216,.12)}
.cp-time-preset{min-height:44px;display:inline-flex;align-items:center}
/* 684 (T3#1, #2) One call-check question: the question, a small note, then Keep / Stop. */
.cp-ask-check .cp-ask-text{display:block;font-size:15px;line-height:1.4;color:#78350f}
.cp-ask-check .cp-ask-note{display:block;margin-top:4px;font-size:14px;font-weight:500;color:#92400e}
/* 684 (T3#3) Photos nothing could be read from, explained together. */
.cp-unread{margin:10px 0;padding:14px;border:1px solid #fcd34d;background:#fffbeb;border-radius:14px}
.cp-unread-title{margin:0;font-size:16px;font-weight:700;color:#78350f}
.cp-unread-text{margin:6px 0 0;font-size:14px;line-height:1.45;color:#92400e}
.cp-unread-list{margin:10px 0 0;padding:0;list-style:none;display:grid;gap:8px}
.cp-unread-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:#fff;border:1px solid #fde68a;border-radius:12px}
.cp-unread-label{font-size:14px;font-weight:600;color:var(--cp-ink)}
.cp-unread-actions{display:flex;flex-wrap:wrap;gap:8px}
.cp-unread .pa-btn{min-height:44px}
.cp-unread-all{margin-top:10px}
/* 684 (T3#5) A medicine's older entries, folded under its newest one. */
.cp-fold{margin-bottom:10px}
.cp-fold>.cp-item{margin-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}
details.cp-older-list{border:1px solid var(--cp-line);border-top:0;border-radius:0 0 14px 14px;background:#f8fafc}
details.cp-older-list>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;padding:8px 14px;font-size:14px;font-weight:600;color:var(--cp-muted)}
details.cp-older-list ul{margin:0;padding:0 14px 10px;list-style:none;display:grid;gap:2px}
.cp-older-entry{width:100%;min-height:40px;text-align:left;padding:6px 8px;border-radius:8px;font-size:14px;color:#334155;background:transparent}
.cp-older-entry:hover,.cp-older-entry:focus-visible{background:#eef2f6}
/* 684 (T3#6) Speech-to-text answers: "Heard as", plain grey, not a quote; a doubtful one is quieter still. */
.cp-heard{display:block;font-style:normal;color:#475569;font-size:14px}
.cp-heard .cp-heard-label{font-weight:600;color:var(--cp-muted)}
.cp-heard.is-unsure{color:#64748b}
.cp-heard-note{display:block;margin-top:2px;font-size:13px;color:#64748b}
.cp-wanswer{padding:8px 10px;border-left:3px solid #cbd5e1;background:#fff;border-radius:0 8px 8px 0}
/* 684 (T3#7) The phone summary, one short line each. */
.cp-sum-line{display:block}
.cp-sum-line+.cp-sum-line{margin-top:2px}
details.cp-older-list>summary{justify-content:space-between;list-style:none}
details.cp-older-list>summary::-webkit-details-marker{display:none}
details.cp-older-list>summary::after{content:"Show";color:var(--cp-green);text-decoration:underline}
details.cp-older-list[open]>summary::after{content:"Hide"}
/* 684 round 2 (R3#4) Alarms on their own phone, under Calls on the schedule. */
.cp-phone-alarm{margin-top:12px;padding:10px 14px;border:1px solid var(--cp-line);border-radius:12px;background:#f8fafc;font-size:15px;line-height:1.45;color:#334155}
.cp-phone-alarm[hidden]{display:none}
.cp-phone-alarm[data-tone="ok"]{border-color:#a7f3d0;background:#ecfdf5;color:#064e3b}
.cp-phone-alarm a{display:inline-flex;align-items:center;min-height:44px;font-weight:700;color:#006da6;text-decoration:underline}
/* 684 round 2 (R3#3) "3 to review", not a bare number that reads as a total. */
.pa-tab .cp-tab-review{white-space:nowrap}
/* 684 round 2 (R3#6) The list says it is loading until the medicines arrive. */
.cp-list-loading{display:flex;align-items:center;gap:12px;padding:24px 8px;color:#475569;font-size:15px}
.cp-list-loading .pa-spinner{width:24px;height:24px;margin:0}
/* Codex round (2026-11-28, 13): a view-only member reads the Care plan; the controls that change it are not shown
   (care-plan.js showViewOnly). The notice is Settings' own sentence. */
.cp-readonly{margin:0;padding:12px 14px;border:1px solid var(--cp-line);border-radius:12px;background:#fff;color:#334155;font-size:15px;line-height:1.45}
.cp-readonly[hidden]{display:none!important}
body.cp-view-only :is(#add-instruction-btn,#detail-edit,#detail-archive,#detail-restore,#detail-approve,#detail-reject,#detail-approve-reason,#item-test-reminder-btn,#item-test-reminder-status,#ms-save,#ms-cancel,#test-reminder-btn,#test-followup-btn,#test-wellness-btn,#generate-interaction-report,#acknowledge-interactions-btn,.cp-ask-check,.cp-item-ask,.cp-add-it,.pa-recovery-actions,[onclick^="markMedicationTaken"],[onchange^="scheduleFollowupCall"]){display:none!important}
/* Codex round (2026-11-28, 15): an item's own switch, the paused line with the way back on, and how the two relate. */
.cp-switch-paused{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-top:10px;padding:10px 12px;border:1px solid #fcd34d;background:#fffbeb;color:#92400e;border-radius:10px;font-size:14px;line-height:1.4}
.cp-switch-link{min-height:44px;padding:0 2px;font-weight:700;color:var(--cp-green);text-decoration:underline;background:none;border:0;cursor:pointer}
.cp-switch-both{margin:8px 0 0;font-size:13px;line-height:1.4;color:var(--cp-muted)}
/* Live checks (2026-11-29, C2, C3, C5): why an item can't have reminder calls, said before anyone presses; what the last
   change did, under the switch; and the switch while a change is being saved. */
.cp-switch-cannot{margin:8px 0 0;font-size:14px;line-height:1.45;color:#334155}
.cp-switch-note{margin:8px 0 0;font-size:14px;line-height:1.4;font-weight:600;color:#166534}
.cp-switch-note[data-tone="error"]{color:#b91c1c}
.cp-switch-note[data-tone="busy"]{font-weight:500;color:#475569}
.cp-switch-note:empty{display:none}
.cp-switch[aria-busy="true"]{opacity:.6;cursor:wait}
/* C7: what Wellness Alerts still covers while the Wellness question is off. */
.cp-wellness-note{margin-top:4px;font-size:12px;line-height:1.4;color:#92400e}
.cp-wellness-note[hidden]{display:none}
/* Codex round (2026-11-28, 50 and 6): what saving starts, above the one save button; the review's How often question. */
.cp-save-ask{margin-top:12px;padding:12px 14px;border:1px solid var(--cp-line);border-radius:12px;background:#f8fafc;font-size:14px;line-height:1.45;color:#334155}
.cp-save-ask:empty{display:none}
.cp-save-ask p+p{margin-top:4px}
.cp-save-ask-title{font-weight:700;color:var(--cp-ink)}
.cp-how-often select{max-width:320px}
/* Codex round (2026-11-28): the last 7 days per medicine at the top of History. */
.cp-week{margin-bottom:12px;padding:12px 14px;border:1px solid var(--cp-line);border-radius:12px;background:#fff}
.cp-week[hidden]{display:none!important}
.cp-week-title{font-size:15px;font-weight:700;color:var(--cp-ink);margin:0 0 6px}
.cp-week-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.cp-week-list li{display:flex;flex-wrap:wrap;gap:2px 10px;font-size:15px;color:#334155}
.cp-week-list strong{color:var(--cp-ink);min-width:140px;overflow-wrap:anywhere}
.cp-week-note{margin:8px 0 0;font-size:13px;line-height:1.4;color:var(--cp-muted)}
