.worker-med-round { overflow: hidden; border: 1px solid #cbd5e1; border-radius: .75rem; background: #fff; }
.worker-med-round > h3 { padding: .55rem 1rem; border-bottom: 1px solid #e2e8f0; }
.worker-med-row { display: block; padding: .7rem 1rem; border-bottom: 1px solid #e2e8f0; }
.worker-med-row:last-child { border-bottom: 0; }
.worker-med-row .btn-worker { min-height: 2.5rem; }
.worker-med-row article > p, .worker-med-row article > details { margin-top: .25rem; }
.worker-completed-rounds, .worker-prn-row { border: 1px solid #cbd5e1; border-radius: .75rem; background: #fff; padding: .8rem 1rem; }
.worker-completed-rounds > summary { cursor: pointer; font-weight: 700; color: #475569; }
@media (max-width: 420px) { .worker-med-row { padding: .45rem .75rem; } }

/* Shared mobile checklist: selection, evidence/time, one confirmation. */
.medication-screen { max-width: 44rem; margin: 0 auto; color: #0f172a; }
.medication-screen > * + * { margin-top: 1rem; }
.medication-back { display: inline-flex; align-items: center; min-height: 44px; color: #475569; font-weight: 600; }
.medication-date { color: #475569; font-size: 1.05rem; }
.medication-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; }
.medication-tabs a { min-height: 48px; padding: 12px 8px; text-align: center; font-weight: 600; color: #475569; }
.medication-tabs a[aria-current=page] { color: white; background: #016de4; }
.medication-heading { font-size: 1.5rem; line-height: 1.3; font-weight: 700; }
.medication-screen .medication-round { margin-top: 1.5rem; }
.medication-round > h3 { font-size: 1.125rem; font-weight: 600; padding: .5rem 0; }
.medication-checklist { border-top: 1px solid #e2e8f0; margin-top: 1rem; }
.medication-checklist-item { border-bottom: 1px solid #e2e8f0; padding: .75rem 0; }
.medication-check-row { display: flex; align-items: center; gap: 14px; min-height: 56px; cursor: pointer; }
.medication-check-row input { height: 26px; width: 26px; flex: 0 0 26px; accent-color: #016de4; }
.medication-check-row strong { font-size: 1.05rem; }
.medication-dose { display: block; color: #475569; line-height: 1.4; margin-top: 3px; }
.medication-instructions { margin-left: 40px; color: #475569; font-size: .875rem; }
.medication-instructions summary { cursor: pointer; padding: 6px 0; }
.medication-selection { margin: 1rem 0; color: #475569; }
.medication-photo-field { margin-top: 1.5rem; }
.medication-photo-field > p { color: #475569; margin: .3rem 0 .75rem; }
.medication-photo-field input { width: 100%; min-height: 48px; padding: 8px 0; }
.medication-photo-preview { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.medication-photo-preview[hidden] { display: none; }
.medication-photo-preview img { width: 45%; max-height: 150px; object-fit: contain; border-radius: 6px; }
.medication-text-button { display: block; color: #016de4; min-height: 44px; text-align: left; font-weight: 600; }
.medication-confirm { margin-top: 1rem; }
.medication-time { background: #f1f5f9; padding: 12px; border-radius: 6px; }
.medication-time > span { font-size: .875rem; color: #475569; }
.medication-time summary { font-size: 1.05rem; color: #016de4; font-weight: 600; cursor: pointer; min-height: 32px; }
.medication-help { font-size: .8rem; color: #475569; margin: .5rem 0; }
.medication-disclosure { border-top: 1px solid #e2e8f0; margin-top: 1rem; }
.medication-disclosure > summary { padding: 14px 0; min-height: 48px; font-weight: 600; cursor: pointer; }
.medication-preparation-summary { background: #f5eff8; color: #6c5295; padding: 12px; border-radius: 6px; margin: .5rem 0; }
.medication-preparation-summary > summary { cursor: pointer; min-height: 32px; font-weight: 600; }
.medication-record { color: #0f172a; padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.medication-record h4 { font-weight: 600; }
.medication-record p { margin: 6px 0; }
.medication-evidence { display: block; width: 100%; max-width: 340px; max-height: 240px; object-fit: contain; margin: .75rem 0; }
.medication-complete { padding: 1.5rem 0; }
.medication-complete h2 { font-size: 1.5rem; font-weight: 700; }
.medication-complete p { margin: .75rem 0 1.5rem; color: #475569; }
.medication-complete a + a { margin-top: 12px; }
.medication-unprepared { padding: 1rem 0; border-bottom: 1px solid #e2e8f0; color: #475569; }
.medication-history-link { display: inline-flex; min-height: 44px; padding: 10px 8px 10px 0; color: #016de4; font-weight: 600; }
.medication-error { padding: 1rem; background: #fff1f2; border: 1px solid #fda4af; border-radius: 6px; color: #881337; }
.medication-empty { padding: 1.5rem 0; color: #475569; }
.medication-batch-form > .field-label, .medication-reprepare-form > .field-label { margin-top: .75rem; }
.medication-screen :focus-visible { outline: 3px solid #016de4; outline-offset: 3px; }
@media (max-width: 380px) { .medication-check-row { gap: 10px; } .medication-tabs a { font-size: .875rem; } }
body:has(.medication-screen) { background: #fff; }
.medication-screen .medication-day-tabs { margin-top: 12px; }
.medication-screen > .medication-date { margin-top: 6px; }
.medication-screen .medication-round { margin-top: 1rem; }
.medication-screen .medication-checklist-item { padding: .5rem 0; }
.medication-screen .medication-photo-field input::file-selector-button { background: #eef6ff; border: 1px solid #016de4; border-radius: 6px; color: #0058bb; padding: 12px; cursor: pointer; }
.medication-photo-field:has(.medication-photo-preview:not([hidden])) > .medication-help { display: none; }
.medication-details-label { display: block; color: #016de4; font-weight: 500; margin-top: 4px; }
body:has(.medication-screen) .worker-main { padding-top: 8px; padding-bottom: 100px; min-height: calc(100vh - 49px); }
.medication-screen > .w-title { margin-top: 2px; }
.medication-screen .medication-checklist-item { position: relative; padding-right: 70px; }
.medication-screen .medication-instructions { position: absolute; right: 0; top: 12px; margin-left: 0; }
.medication-screen .medication-instructions summary { min-height: 44px; display: flex; align-items: center; }
.medication-screen .medication-instructions[open] { position: static; margin-left: 40px; }
.medication-screen .medication-instructions[open] p { padding-bottom: 8px; }
.medication-screen .medication-checklist-item:has(.medication-instructions[open]) { padding-right: 0; }

/* Focused rounds: one action at a time, with records on their own page. */
.medication-focused [hidden] { display: none !important; }
.medication-focused { max-width: 38rem; }
.medication-focused .medication-round-caption { margin-top: .3rem; font-weight: 600; color: #475569; }
.medication-focused .medication-action-hint { color: #475569; }
.medication-focused .medication-round-card { padding: 1rem; border: 1px solid #dbe3ed; border-radius: 12px; background: #fff; }
.medication-card-heading { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.medication-card-heading h3 { font-size: 1.4rem; font-weight: 700; }
.medication-round-state { font-size: .85rem; color: #334155; background: #f1f5f9; border-radius: 5px; padding: .3rem .5rem; }
.medication-card-count { color: #64748b; margin: .25rem 0 1rem; }
.medication-card-actions { display: flex; gap: .75rem; }
.medication-card-actions:empty { display: none; }
.medication-card-actions > a { flex: 1; }
.medication-focused .medication-round-card .medication-history-link { display: flex; justify-content: center; padding: .65rem 0 0; }
.medication-menu-link { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-top: 1px solid #dbe3ed; color: #005fca; font-weight: 600; padding: .75rem 0; }
.medication-menu-link::after { content: "›"; font-size: 1.35rem; margin-left: .75rem; }
.medication-focused .medication-checklist-item { padding: .75rem 0; }
.medication-directions { margin: .5rem 0 0 40px; color: #475569; font-size: .9rem; }
.medication-step { color: #475569; font-size: .9rem; font-weight: 600; margin: 1rem 0 .5rem; }
.medication-selected-summary { list-style: none; padding: .75rem 1rem; background: #f1f5f9; border-radius: 8px; }
.medication-selected-summary li + li { margin-top: .5rem; }
.medication-focused .medication-time { margin-top: 1rem; }
.medication-time [data-medication-time-target=summary] { display: flex; justify-content: space-between; align-items: center; }
.medication-time .medication-text-button { display: inline-flex; align-items: center; }
.medication-focused .field-label { display: block; margin-top: .75rem; }
.medication-focused .btn-worker, .medication-focused .btn-worker-secondary { width: 100%; min-height: 48px; }
.medication-ready-note { color: #475569; font-size: .9rem; }
.medication-event-group { margin-top: 1rem; padding: 1rem; border: 1px solid #dbe3ed; border-radius: 10px; }
.medication-event-group h3 { font-size: 1.05rem; font-weight: 700; }
.medication-event-group ul { margin-top: .75rem; }
.medication-event-group li { padding: .35rem 0; }
.medication-event-group .medication-evidence { max-height: 190px; }
.medication-record-links { display: flex; flex-wrap: wrap; gap: .75rem; }
.medication-focused:has([data-medication-batch-target=selectionStep][hidden]) .medication-action-hint { display: none; }

/* Dose state tags and the give-screen action row. */
.medication-dose-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.medication-dose-list li { display: flex; align-items: center; gap: .75rem; min-height: 36px; padding: 4px 0; border-top: 1px solid #f1f5f9; font-size: .95rem; }
.medication-dose-tag { flex: none; display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; border: 1px solid; font-size: .8rem; white-space: nowrap; }
.medication-dose-tag-ready { border-color: #7dd3fc; background: #f0f9ff; color: #0369a1; }
.medication-dose-tag-todo { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.medication-dose-tag-done { border-color: #6ee7b7; background: #ecfdf5; color: #065f46; }
.medication-dose-tag-warn { border-color: #fda4af; background: #fff1f2; color: #9f1239; }
.medication-check-row .medication-dose-tag { align-self: flex-start; margin-top: 2px; }
.medication-confirm-row { display: flex; gap: .75rem; margin-top: 1rem; }
.medication-confirm-row .medication-confirm { flex: 1 1 0; margin-top: 0; }
