/* Shared surfaces and type for the clinical workspace. Print layouts own their paper styles. */
@media screen {
  :root { --ink:#203a35; --text:#253733; --muted:#52645f; --forest:#234a42; --forest-hover:#183a33; --line:#d1dcd5; --bg:#f5f7f4; --radius:8px; --shadow:none; }
  .main .panel { border-radius:8px; box-shadow:none; }
  .main .page-header h1 { line-height:1.08; letter-spacing:-.035em; }
  .sidebar .brand { gap:12px; }
  .sidebar .brand-mark { display:none; }
  .sidebar .brand strong,.moo-wordmark { text-transform:none; font:italic 600 38px/.98 Georgia,serif; letter-spacing:-.076em; color:#213e37; }
  .sidebar .brand small { margin-top:5px; }
  .navigation a[aria-current="page"] { box-shadow:inset 3px 0 var(--forest); }
  .main .button { border-radius:6px; }
  .access-page { width:min(100%,28rem); margin:clamp(30px,7vh,80px) auto; border:0; background:transparent; box-shadow:none; }
  .access-masthead { display:flex; align-items:baseline; gap:14px; padding-bottom:18px; margin-bottom:30px; border-bottom:2px solid #234a42; color:var(--muted); font-size:14px; }
  .access-page h1 { margin:0 0 8px; font:600 clamp(30px,5vw,42px)/1.12 system-ui,sans-serif; letter-spacing:-.05em; color:var(--ink); }
  .access-intro { margin:0 0 26px; color:var(--muted); line-height:1.5; }
  .access-form { gap:16px; }
  .access-form .field, .access-remember { margin:0; }
  .access-form input:not([type=checkbox]),.access-form select { background:white; min-height:46px; border:1px solid #82978c; border-radius:5px; font-size:16px; }
  .access-form .button { min-height:46px; font-size:16px; }
  .access-remember label { display:flex; align-items:center; gap:9px; cursor:pointer; min-height:32px; }
  .access-remember input { flex:0 0 18px; width:18px; height:18px; accent-color:var(--forest); }
  .access-remember .field-help { margin:0 0 0 27px; }
  .access-note { font-size:14px; color:var(--muted); margin:14px 0 0; }
  .access-alternate { margin-top:22px; padding-top:10px; border-top:1px solid var(--line); display:grid; justify-items:start; }
  .access-alternate a,.work-all { display:inline-flex; align-items:center; min-height:44px; text-underline-offset:3px; }
  .shift-heading { align-items:flex-end; gap:12px; }
  .shift-heading .shift-date { font-size:15px; margin:0 0 5px; color:var(--muted); }
  .shift-notice { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:14px 18px; margin-bottom:24px; background:#e7efea; border-left:3px solid var(--forest); }
  .shift-notice p { margin:2px 0 0; }
  .shift-layout { display:grid; grid-template-columns:minmax(0, 2.5fr) minmax(190px,1fr); gap:clamp(22px,4vw,52px); align-items:start; }
  .shift-worklist,.shift-tools { min-width:0; }
  .shift-worklist header,.shift-tools h2 { border-top:2px solid var(--ink); padding:14px 0 4px; margin:0; }
  .shift-worklist header { display:flex; align-items:baseline; gap:10px; }
  .shift-layout h2 { font-size:21px; line-height:1.25; letter-spacing:-.025em; margin:0; }
  .queue-number { font-size:15px; font-variant-numeric:tabular-nums; color:var(--muted); }
  .work-caption { color:var(--muted); font-size:14px; margin:0 0 12px; }
  .shift-worklist ul { list-style:none; margin:0; padding:0; }
  .work-row,.work-empty { border-top:1px solid var(--line); padding:12px 2px; }
  .work-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:15px; align-items:center; color:var(--ink); text-decoration:none; }
  .work-item { display:flex; align-items:center; gap:.6rem; border-top:1px solid var(--line); }
  .work-item .work-row { flex:1; min-width:0; border-top:0; }
  .work-remove { display:inline-flex; align-items:center; min-height:44px; padding:0 .4rem; font-size:.875rem; }
  .work-row:hover,.work-row:focus-visible { background:#eaf0eb; }
  .work-row strong,.work-treatment,.work-meta>span { display:block; overflow-wrap:anywhere; }
  .work-meta { display:grid; justify-items:end; gap:3px; color:var(--muted); font-size:13px; }
  .work-treatment { margin-top:3px; color:var(--muted); }
  .work-all { margin-top:5px; }
  .shift-tools a,.review-tally { display:flex; gap:10px; justify-content:space-between; align-items:center; min-height:44px; padding:8px 0; margin:0; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; }
  .shift-tools a:hover { text-decoration:underline; }
  .shift-tools a span { font-size:13px; color:var(--muted); }
  .visit-finder { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin:15px 0 4px; }
  .visit-finder .field { min-width:min(100%,250px); margin:0; flex:1; }
  [data-history-tools][hidden],[data-history-visit][hidden] { display:none; }
  .visit-history summary { padding:12px 18px; cursor:pointer; min-height:44px; border-top:1px solid var(--line); }
  .template-directory { border-top:2px solid var(--forest); }
  .finder-heading,.finder-tabs,.finder-status { display:flex; align-items:center; flex-wrap:wrap; gap:6px 18px; }
  .finder-heading { justify-content:space-between; }
  .finder-heading h1 { margin:0; }
  .finder-heading a,.finder-tabs a,.finder-status a { display:inline-flex; align-items:center; min-height:44px; text-underline-offset:4px; }
  .finder-tabs { border-bottom:1px solid var(--line); margin:8px 0 16px; }
  .finder-tabs a { color:var(--muted); text-decoration:none; }
  .finder-tabs [aria-current] { color:var(--forest); font-weight:700; box-shadow:inset 0 -2px currentColor; }
  .template-finder { display:flex; align-items:flex-start; flex-wrap:wrap; gap:6px 12px; max-width:55rem; }
  .template-finder > .field { margin:0; flex:1 1 12rem; min-width:0; }
  .template-finder label { display:block; margin-bottom:5px; }
  .finder-filter,.template-finder > button { margin-top:1.5rem; }
  .finder-filter summary { min-height:44px; padding:10px 4px; cursor:pointer; color:var(--forest); }
  .finder-filter .field { margin:0 0 6px; }
  .finder-status { min-height:44px; color:var(--muted); font-size:.875rem; }
  .finder-status [hidden],.template-finder [hidden] { display:none; }
  .finder-management { margin-top:24px; scroll-margin-block:2rem; }
  .finder-management h2 { font-size:1.1rem; }
  .template-entry { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 1px; border-bottom:1px solid var(--line); }
  .template-entry[hidden] { display:none; }
  .template-entry h2 { font:600 17px/1.3 system-ui,sans-serif; margin:0; }
  .template-name { min-width:0; }
  .template-name a { display:inline-flex; align-items:center; min-height:44px; color:var(--forest); text-underline-offset:4px; overflow-wrap:anywhere; }
  .template-name p { color:var(--muted); margin:0 0 4px; font-size:13px; }
  .template-name [data-match-hint] { color:var(--ink); font-size:14px; overflow-wrap:anywhere; }
  .library-key-tip { margin-inline-start:.7em; font-size:.875em; }
  @media (hover:none), (max-width:600px) { .library-key-tip { display:none; } }
  .template-actions { display:flex; flex-wrap:wrap; gap:4px 9px; justify-content:flex-end; }
  .template-actions a { min-height:44px; padding:0 7px; display:inline-flex; align-items:center; text-underline-offset:3px; }
  .count-guidance { margin-bottom:12px; }
  .count-guidance summary { cursor:pointer; width:fit-content; padding:10px 0; }
  .count-position { display:flex; gap:12px 22px; flex-wrap:wrap; justify-content:space-between; align-items:center; border-block:1px solid var(--line); padding:14px 0; margin-bottom:14px; }
  .count-position p { margin:0 0 5px; }
  .count-position progress { width:min(100%,16rem); height:8px; accent-color:var(--forest); }
  .count-position [hidden],.actions [data-report-details][hidden] { display:none; }
}
@media screen and (max-width:760px) {
  .sidebar { padding-block:9px; }
  .sidebar .brand { min-height:44px; }
  .sidebar .brand strong { font-size:30px; }
  .sidebar .brand small { display:none; }
  .sidebar .mobile-menu[data-menu-enhanced]:not([open]) { display:none; }
  .main .shift-heading { display:flex; flex-wrap:wrap; flex-direction:row; justify-content:space-between; align-items:center; }
  .shift-layout { grid-template-columns:minmax(0,1fr); }
  .shift-heading { flex-direction:row; align-items:center; }
  .shift-heading .button { width:auto; flex:none; }
  .work-row { gap:8px; }
  .access-page { margin:20px auto; }
  .access-masthead { margin-bottom:22px; }
  .visit-finder .field { flex-basis:100%; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
}
@media screen {
  .navigation svg { stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
  .count-result { display:flex; align-items:center; justify-content:space-between; gap:6px 16px; flex-wrap:wrap; padding:12px 0; border-block:1px solid var(--line); }
  .count-result-label { display:block; color:var(--muted); font-size:13px; }
  .count-result output { color:var(--ink); font-size:22px; font-weight:650; font-variant-numeric:tabular-nums; }
  .count-result button { display:inline-flex; min-height:44px; align-items:center; padding:4px 8px; border:0; background:transparent; color:var(--forest); font:inherit; font-weight:600; text-decoration:underline; text-underline-offset:4px; cursor:pointer; }
  .count-result button[hidden] { display:none; }
  .count-result button:focus-visible,.navigation a:focus-visible { outline:3px solid var(--forest); outline-offset:-3px; }
  [data-count-card][data-complete] .count-result button[hidden] { display:inline-flex; visibility:hidden; }
  [data-count-card] :is(input,select,textarea),[data-confirm-count] { scroll-margin-block:5rem; }
}
@media print { [data-count-step] { display:none; } }

/* The approved plum/copper identity frames work; clinical data stays on quiet surfaces. */
@media screen {
  :root { --ink:#352d38; --text:#39323c; --muted:#655d68; --forest:#594052; --forest-hover:#412d3c; --line:#ddd6dc; --bg:#f7f5f6; }
  .sidebar .brand { background:linear-gradient(125deg,#392b43 0%,#684450 70%,#986951 100%); padding:22px 18px; border-radius:0 0 12px 0; margin:-4px -4px 20px; }
  .sidebar .brand strong,.sidebar .brand small { color:#fff9f3; }
  .navigation a[aria-current="page"] { background:#eee7ed; color:#493449; }
  .navigation a:hover,.work-row:hover,.work-row:focus-visible { background:#f0ebef; }
  .shift-notice { background:#eee8ed; }
  .main .page-header { border-bottom:1px solid var(--line); padding-bottom:18px; }
  .face-map { background:#fffdfb; border:1px solid var(--line); border-radius:8px; }
}
.record-map { margin:0 0 20px; break-inside:avoid; }
.record-map figcaption { font-weight:650; margin-bottom:8px; }
.face-map [data-body-view] text { fill:#65575e; font:12px system-ui,sans-serif; }
.record-map .face-map { max-height:440px; width:100%; }
[data-readonly-map] { display:grid; gap:16px; }
[data-readonly-map][hidden] { display:none; }
@media print { .record-map .face-map { max-height:330px; } }

/* Correction reminders stay visible until the chart is resubmitted. */
.correction-alert{display:flex;align-items:center;justify-content:space-between;gap:16px}
.correction-alert p{margin:4px 0 0}.correction-alert .button{flex-shrink:0}
.correction-queue{margin-bottom:24px;scroll-margin-top:24px}
.correction-item+.correction-item{border-top:1px solid var(--border,#d4ddd8);padding-top:20px}
.correction-item h3{margin:0 0 6px}.correction-item .prose,.correction-request .prose{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:600px){.correction-alert{align-items:flex-start;flex-direction:column}.correction-alert .button{width:100%}}
/* Protect retained form contents, including when printing a locked tab. */
body.workspace-locked > :not(.spa-lock-screen) { display:none !important; }
.spa-lock-screen .button { margin:6px; }
.spa-lock-screen p { max-width:36rem; }
