:root {
  --ink: #14262d;
  --ink-soft: #496068;
  --navy: #102b35;
  --navy-light: #173d49;
  --paper: #f5f7f6;
  --white: #ffffff;
  --line: #dbe3e1;
  --cyan: #16a8a2;
  --cyan-dark: #087a76;
  --cyan-wash: #e4f6f4;
  --coral: #e66754;
  --coral-wash: #fff0ed;
  --amber: #d59624;
  --amber-wash: #fff6df;
  --green: #21875b;
  --green-wash: #e7f5ed;
  --shadow-sm: 0 4px 20px rgba(16, 43, 53, 0.025);
  --shadow: 0 12px 36px rgba(16, 43, 53, 0.07);
  --shadow-lg: 0 24px 80px rgba(4, 22, 28, 0.22);
  --shadow-float: 0 4px 12px rgba(16, 43, 53, 0.12);
  --shadow-aside: 12px 0 40px rgba(4, 22, 28, 0.2);
  --radius: 7px;
  --sidebar-width: 248px;
  --sidebar-collapsed-width: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid rgba(22, 168, 162, 0.3);
  outline-offset: 2px;
}

/* BASE shell layout (shared by every shared.js page, including Appeal).
 *
 * Restored to the original document-scroll model: .app-shell and .main use
 * min-height:100vh so the page grows with content and the DOCUMENT scrolls.
 * There is NO post-session body lock here — the body scrolls naturally once
 * the session is ready. This keeps Appeal (data-module="appeal.js") and any
 * other non-approved shared-shell page on its original behavior. The scoped
 * scroll-container overrides for the five approved workspace modules live
 * below. */
.app-shell { min-height: 100vh; }

body:not(.session-ready) { overflow: hidden; }

/* SCOPED workspace scroll model — applies ONLY to the five approved
 * authenticated workspace modules: read-rx.js, claims.js, history.js,
 * reports.js, settings.js (matched by body[data-module="..."]). Appeal
 * (data-module="appeal.js"), Admin (class="admin-body", no data-module),
 * auth pages (no shared.css), and the landing page are NOT matched and keep
 * their existing scroll behavior.
 *
 * Contract: .sidebar and .topbar are position:fixed (out of flow), so
 * .app-shell's only in-flow child is .main. .main becomes a viewport-height
 * vertical scroll container (overflow-y:auto; overflow-x:hidden) so ONLY the
 * central workspace content region scrolls; the fixed sidebar and topbar stay
 * in place while content scrolls beneath them. The body is locked once the
 * session is ready so the document itself never scrolls. position:relative on
 * .main anchors the absolute .route-status accessibility region safely inside
 * the scroll container. scroll-behavior:smooth moves the former html-level
 * smooth-scroll onto .main so the existing scrollIntoView({behavior:'smooth'})
 * calls keep their smooth feel against the new scroll container.
 *
 * Specificity: each scoped selector is (0,2,1) — body(1 element) +
 * [data-module](1 attr) + .app-shell/.main(1 class) — which outranks the base
 * .app-shell/.main rules (0,1,0) and the mobile .main rule (0,1,0). The scoped
 * .main rule deliberately sets ONLY height/overflow/position/scroll-behavior
 * (not margin/padding) so the base .main margin/padding and the mobile
 * @media (max-width:760px) .main margin/padding cascade normally on every
 * breakpoint; min-height:0 overrides the base min-height:100vh so the
 * container is exactly viewport height. */
body[data-module="read-rx.js"] .app-shell,
body[data-module="claims.js"] .app-shell,
body[data-module="history.js"] .app-shell,
body[data-module="reports.js"] .app-shell,
body[data-module="settings.js"] .app-shell { height: 100vh; min-height: 0; }

body[data-module="read-rx.js"].session-ready,
body[data-module="claims.js"].session-ready,
body[data-module="history.js"].session-ready,
body[data-module="reports.js"].session-ready,
body[data-module="settings.js"].session-ready { overflow: hidden; }

body[data-module="read-rx.js"] .main,
body[data-module="claims.js"] .main,
body[data-module="history.js"] .main,
body[data-module="reports.js"] .main,
body[data-module="settings.js"] .main { height: 100vh; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; scroll-behavior: smooth; }

.session-state { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; gap: 8px; padding: 24px; background: var(--paper); color: var(--ink); text-align: center; }
.session-state strong { font-size: 16px; }
.session-state span { color: var(--ink-soft); font-size: 13px; }
.session-state button { min-height: 40px; margin: 8px auto 0; padding: 0 16px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); font-weight: 600; }
.session-state[hidden] { display: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  background: var(--navy);
  color: #dce9e9;
  transition: width .22s ease;
}

.brand {
  display: flex;
  height: 80px;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-logo { display: block; width: 170px; height: auto; }

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  color: #65dbd5;
}

.brand-mark::before, .brand-mark::after {
  position: absolute;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  content: "";
}

.brand-mark::after { transform: rotate(90deg); }
.brand-name { color: white; font-size: 20px; font-weight: 700; letter-spacing: 0; }
.brand-name span { color: #65dbd5; }

.nav-label, .eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.nav-label { margin: 28px 24px 10px; color: #78939a; }
.nav-list { display: grid; gap: 5px; padding: 0 12px; }

.nav-link {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  padding: 0 12px;
  border-radius: 5px;
  color: #acc1c5;
  font-weight: 500;
  transition: background .18s ease, color .18s ease;
}

.nav-link:hover { background: rgba(255,255,255,.07); color: white; }
.nav-link.active { background: var(--navy-light); color: white; }
.nav-link.active::before { position: absolute; inset: 9px auto 9px -12px; width: 3px; background: #57d2cc; content: ""; }
.nav-link svg { width: 18px; height: 18px; }

.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 40;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--navy);
  box-shadow: var(--shadow-float);
  transform: translate(50%, -50%);
  transition: background .18s ease, color .18s ease;
}
.sidebar-toggle:hover { background: var(--cyan-wash); color: var(--cyan-dark); }
.sidebar-toggle svg { width: 16px; height: 16px; }

.topbar {
  position: fixed;
  inset: 0 0 auto var(--sidebar-width);
  z-index: 20;
  display: flex;
  height: 80px;
  align-items: center;
  gap: 20px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  transition: inset .22s ease, left .22s ease;
}

.mobile-menu { display: none; }

.search-wrap { position: relative; width: min(520px, 50vw); }
.search-wrap > svg { position: absolute; top: 50%; left: 14px; width: 18px; transform: translateY(-50%); color: #72888e; }
.global-search { width: 100%; height: 43px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9f8; color: var(--ink); }
.global-search:focus { border-color: var(--cyan); background: white; outline: none; box-shadow: 0 0 0 3px rgba(22,168,162,.1); }

.search-results {
  position: absolute;
  top: 51px;
  left: 0;
  display: none;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}
.search-results.open { display: block; }
.search-result { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #edf1f0; }
.search-result:hover { background: #f5f9f8; }
.search-result:last-child { border-bottom: 0; }
.search-result small { color: var(--ink-soft); }
.search-empty { padding: 20px; color: var(--ink-soft); text-align: center; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-button { position: relative; display: grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.icon-button:hover { background: #edf3f2; }
.icon-button svg { width: 19px; }
.notification-count { position: absolute; top: 2px; right: 1px; display: grid; min-width: 17px; height: 17px; padding: 0 4px; place-items: center; border: 2px solid white; border-radius: 10px; background: var(--coral); color: white; font: 9px "IBM Plex Mono", monospace; }

.profile-button { display: flex; align-items: center; gap: 10px; margin-left: 8px; padding: 5px 7px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; }
.profile-button:hover { background: #edf3f2; }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--navy); color: white; font-size: 12px; font-weight: 700; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { color: var(--ink-soft); font-size: 11px; }

.popover { position: fixed; z-index: 50; display: none; width: 310px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.popover.open { display: block; }
.notification-popover { top: 68px; right: 110px; }
.profile-popover { top: 68px; right: 24px; width: 220px; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 15px; border-bottom: 1px solid var(--line); }
.popover-head button { border: 0; background: none; color: var(--cyan-dark); font-size: 12px; }
.notification-item { padding: 13px 15px; border-bottom: 1px solid #edf1f0; }
.notification-item.unread { border-left: 3px solid var(--cyan); background: #f7fbfa; }
.notification-item p { margin: 0 0 3px; font-size: 13px; font-weight: 600; }
.notification-item small { color: var(--ink-soft); }
.notification-actions { display: flex; gap: 8px; margin-top: 8px; }
.notification-actions .dose-response { display: inline-flex; align-items: center; gap: 6px; }
.notification-actions .dose-response svg { width: 14px; height: 14px; }
.dose-completed { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.dose-completed svg { width: 14px; height: 14px; }
.dose-completed.completed-taken { background: var(--green-wash); color: var(--green); }
.dose-completed.completed-not-taken { background: var(--coral-wash); color: #b54a3b; }
.profile-menu-link { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 13px; }
.profile-menu-link:hover { background: #f4f8f7; }
.profile-menu-link svg { width: 16px; }

/* BASE .main (shared by every shared.js page, including Appeal). The page
 * grows with content and the document scrolls. The scoped scroll-container
 * override for the five approved workspace modules is defined above (near
 * .app-shell); it adds height:100vh + overflow-y:auto + position:relative +
 * scroll-behavior:smooth only for those modules, without touching margin/
 * padding so the desktop base and the mobile @media cascade both apply. */
.main { min-height: 100vh; margin-left: var(--sidebar-width); padding: 112px 34px 48px; }
.main { transition: margin-left .22s ease; }
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .main { margin-left: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .topbar { inset: 0 0 auto var(--sidebar-collapsed-width); }
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .brand-logo { display: none; }
body.sidebar-collapsed .nav-link { justify-content: center; gap: 0; padding: 0; }
body.sidebar-collapsed .brand { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-list { padding: 0 8px; }
.page { width: min(1420px, 100%); margin: 0 auto; }
/* Workspace SPA route status region: visually silent but announced to assistive
 * technology so route content changes are perceivable without a full reload. */
.route-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 7px; color: var(--cyan-dark); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); font-weight: 600; line-height: 1.08; letter-spacing: 0; }
h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
h3 { margin: 0; font-size: 15px; }
.page-heading p:not(.eyebrow) { max-width: 590px; margin: 10px 0 0; color: var(--ink-soft); }
.date-stamp { color: var(--ink-soft); font: 12px "IBM Plex Mono", monospace; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.panel-header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 20px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid transparent; border-radius: 5px; font-weight: 600; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; }
.button-primary { background: var(--navy); color: white; }
.button-primary:hover { background: var(--navy-light); }
.button-accent { background: var(--cyan-dark); color: white; }
.button-secondary { border-color: var(--line); background: white; color: var(--ink); }
.button-danger { background: var(--coral-wash); color: #a74031; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }

.field { display: grid; gap: 7px; }
.field label { color: #314950; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfdad8; border-radius: 4px; background: white; color: var(--ink); }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(22,168,162,.1); }
.field input:disabled { background: #edf1f0; color: #718388; }
.field-hint { color: var(--ink-soft); font-size: 11px; }
.field-error { display: none; color: #b74536; font-size: 11px; }
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--coral); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }

.badge { display: inline-flex; min-height: 25px; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 20px; font: 11px "IBM Plex Mono", monospace; white-space: nowrap; }
.badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.badge-approved, .badge-verified { background: var(--green-wash); color: var(--green); }
.badge-declined { background: var(--coral-wash); color: #b54a3b; }
.badge-pending, .badge-review { background: var(--amber-wash); color: #966813; }
.badge-info { background: var(--cyan-wash); color: var(--cyan-dark); }

.dropzone { position: relative; display: grid; min-height: 220px; padding: 30px; place-items: center; border: 1px dashed #9eb4b4; border-radius: var(--radius); background: #f8fbfa; text-align: center; transition: border .18s ease, background .18s ease; }
.dropzone.dragging { border-color: var(--cyan); background: var(--cyan-wash); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 14px; place-items: center; border-radius: 50%; background: var(--cyan-wash); color: var(--cyan-dark); }
.dropzone-icon svg { width: 23px; }
.dropzone h3 { margin-bottom: 6px; }
.dropzone p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.dropzone .button { margin-top: 16px; }

.file-card { display: none; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: white; text-align: left; }
.file-card.visible { display: flex; }
.file-icon { display: grid; width: 39px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 4px; background: var(--coral-wash); color: var(--coral); }
.file-meta { min-width: 0; flex: 1; }
.file-meta strong, .file-meta small { display: block; }
.file-meta strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { margin-top: 2px; color: var(--ink-soft); }
.file-actions { display: flex; gap: 5px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric { padding: 18px; border-top: 2px solid var(--line); background: white; }
.metric.accent { border-color: var(--cyan); }
.metric.warn { border-color: var(--coral); }
.metric-label { color: var(--ink-soft); font-size: 12px; }
.metric-value { display: block; margin-top: 8px; font: 600 28px "IBM Plex Mono", monospace; letter-spacing: 0; }
.metric-detail { color: var(--ink-soft); font-size: 11px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f7f9f8; color: #62767b; font: 600 10px "IBM Plex Mono", monospace; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #e8eeec; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
.mono { font-family: "IBM Plex Mono", monospace; }

.empty-state { display: grid; min-height: 240px; padding: 30px; place-items: center; color: var(--ink-soft); text-align: center; }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 10px; color: #8fa5aa; }
.empty-state p { margin: 0; }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: grid; width: min(370px, calc(100vw - 32px)); gap: 9px; }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 5px; background: white; box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast.error { border-left-color: var(--coral); }
.toast svg { width: 18px; flex: 0 0 auto; color: var(--cyan-dark); }
.toast.error svg { color: var(--coral); }
.toast p { margin: 0; font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 20px; background: rgba(8,28,34,.52); backdrop-filter: blur(3px); }
.modal-backdrop.open { display: grid; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: var(--radius); background: white; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1020px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .profile-copy { display: none; }
}

@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-aside); }
  .topbar { left: 0; height: 68px; padding: 0 14px; gap: 10px; }
  .mobile-menu { display: grid; flex: 0 0 auto; }
  .search-wrap { width: auto; flex: 1; }
  .profile-button { display: none; }
  .sidebar-toggle { display: none; }
  body.sidebar-collapsed .main { margin-left: 0; }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-width); }
  body.sidebar-collapsed .topbar { inset: 0 0 auto 0; left: 0; }
  body.sidebar-collapsed .nav-label { display: block; }
  body.sidebar-collapsed .nav-link span { display: inline; }
  body.sidebar-collapsed .brand-logo { display: block; }
  body.sidebar-collapsed .nav-link { justify-content: flex-start; gap: 13px; padding: 0 12px; }
  body.sidebar-collapsed .brand { justify-content: flex-start; padding: 0 24px; }
  body.sidebar-collapsed .nav-list { padding: 0 12px; }
  .notification-popover { top: 62px; right: 12px; width: calc(100vw - 24px); }
  .main { margin-left: 0; padding: 92px 16px 34px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading p:not(.eyebrow) { font-size: 13px; }
  .date-stamp { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .panel-header, .panel-body { padding-left: 15px; padding-right: 15px; }
  .modal-footer { flex-wrap: wrap; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .topbar-actions { gap: 0; }
  .global-search::placeholder { color: transparent; }
}

/* Reduced-motion suppression for the shared shell is driven ONLY by the root
 * class `rx-reduced-motion` (set synchronously by motion-preference.js from
 * the RESOLVED RxVerify preference), never by the OS-only prefers-reduced-
 * motion media query. This mirrors css/page-transitions.css and keeps the
 * shared shell in lockstep with the SPA + full-document controllers:
 *   - Always animate (default): the class is absent even when Windows/OS
 *     animations are disabled, so shell motion (button transforms, dropzone,
 *     toast, mobile sidebar slide) animates normally. The OS query is
 *     deliberately ignored — the shell works whether or not Windows
 *     animations are enabled.
 *   - Reduced motion (opt-in): the class is present even when the OS allows
 *     motion, so the shell transitions/animations collapse.
 * This rule is scoped to the shared shell's own motion selectors only — it is
 * NOT a global `*` transition-duration collapse, so it CANNOT override
 * #pageContent's 300ms SPA fade (owned by css/page-transitions.css) or any
 * other page-scoped transition. The previous global `*` rule here collapsed
 * every transition on the page, which overrode the 300ms SPA fade for Windows
 * users in default Always mode. There is intentionally NO
 * `@media (prefers-reduced-motion: reduce)` block here. */
html.rx-reduced-motion .button,
html.rx-reduced-motion .dropzone,
html.rx-reduced-motion .toast,
html.rx-reduced-motion .sidebar,
html.rx-reduced-motion .sidebar-toggle,
html.rx-reduced-motion .topbar,
html.rx-reduced-motion .main {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
}

/* --- Drug interaction panels (DDInter, shared across read-rx / claims /
 * history) ---
 * Advisory output block rendered by three page modules with identical markup:
 * a heading row, a list of severity-tagged pairs, and an attribution line
 * (CC BY-NC-SA obligation carried in the visible UI). Severity reuses the
 * shared badge palette: major → badge-declined, moderate → badge-pending,
 * minor/unknown → badge-info. The muted/checking variants intentionally carry
 * no red error styling — a failed check is degraded output, never a failure
 * of the medication flow itself. */
.interactions-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.interactions-heading { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.interactions-heading svg { width: 15px; height: 15px; color: var(--coral); }
.interactions-muted { background: var(--paper); border-style: dashed; }
.interactions-checking .interactions-note { display: flex; align-items: center; gap: 8px; }
.interactions-checking .interactions-note svg { width: 14px; height: 14px; animation: rx-spin 1s linear infinite; }
.interactions-note { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.interactions-none { color: var(--green); }
.interaction-list { display: grid; gap: 8px; }
.interaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--paper);
  border-left: 3px solid var(--line);
}
/* Narrow-width hardening: monospace drug-pair strings ("Acetylsalicylic acid
 * + Warfarin") must never overflow the panel or collide with the severity
 * badge. min-width:0 lets the flex item shrink below its content; wrapping
 * breaks anywhere (long unbroken monospace words) and keeps the badge on its
 * own line only when the pair genuinely cannot fit. */
.interaction-item.severity-major { border-left-color: var(--coral); background: var(--coral-wash); }
.interaction-item.severity-moderate { border-left-color: var(--amber); background: var(--amber-wash); }
.interaction-item.severity-minor { border-left-color: var(--cyan); }
.interaction-item.severity-unknown { border-left-color: var(--line); }
.interaction-pair { font: 600 12.5px "IBM Plex Mono", monospace; color: var(--ink); min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.interaction-item .badge { flex: 0 0 auto; }
.interactions-attribution { font-size: 10.5px; color: var(--ink-soft); opacity: 0.8; margin: 0; }
@keyframes rx-spin { to { transform: rotate(360deg); } }
/* History detail modal variant: the panel content is nested inside a
 * .detail-item so it inherits the modal's label row; only the list rows
 * themselves need styling beyond the shared rules above. */
.interactions-detail { display: grid; gap: 8px; }
.interactions-detail .interaction-list { margin: 0; }
