@charset "UTF-8";

:root {
 color-scheme: light;
 --paper: #f3f7f9;
 --surface: #ffffff;
 --ink: #152d44;
 --text: #30465a;
 --muted: #53697b;
 --line: #dce5eb;
 --teal: #006b78;
 --teal-dark: #005462;
 --teal-light: #e5f2f5;
 --orange: #ab5e24;
 --purple: #676f99;
 --radius: 24px;
 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
 font-synthesis: none;
 text-rendering: optimizeLegibility;
 -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: 30px; }
body { margin: 0; background: var(--paper); color: var(--text); font-size: 16px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, label.button { cursor: pointer; }
button { line-height: 1.3; }
a { color: var(--teal); text-underline-offset: 4px; }
a:hover { color: #11283e; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #ab5e24; outline-offset: 4px; }
svg { flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); }
h1 { max-width: 860px; font-size: clamp(42px, 5.1vw, 66px); font-weight: 680; letter-spacing: -.065em; line-height: 1.04; }
h2 { font-size: 26px; font-weight: 640; letter-spacing: -.045em; line-height: 1.2; }
h3 { font-size: 16px; font-weight: 620; line-height: 1.4; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 20; transform: translateY(-180%); padding: 10px 20px; border-radius: 8px; color: white; background: var(--teal); }
.skip-link:focus { transform: translateY(0); color: white; }

.site-header { max-width: 1380px; min-height: 108px; margin: 0 auto; padding: 22px 52px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 25px; font-weight: 750; letter-spacing: -1px; line-height: 1.2; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; background: var(--ink); border-radius: 16px 16px 16px 5px; }
.brand-mark svg { width: 31px; height: 31px; fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.brand-caption { display: block; margin-top: 5px; color: var(--muted); font-size: 14px; font-weight: 450; letter-spacing: .3px; }
.main-nav { display: flex; gap: 30px; margin-left: auto; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 550; }
.main-nav a:first-child { color: var(--ink); }
.main-nav a:hover { color: var(--teal); text-decoration: underline; }
.local-badge { display: flex; align-items: center; gap: 7px; margin-left: 25px; color: var(--teal); font-size: 14px; font-weight: 550; background: #ecf2f6; padding: 7px 11px; border-radius: 30px; white-space: nowrap; }
.storage-dot { width: 6px; height: 6px; background: #5b788d; border-radius: 50%; flex-shrink: 0; }
.page-shell { max-width: 1280px; margin: 0 auto; padding: 48px 36px 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 650; letter-spacing: 1.3px; line-height: 1.5; text-transform: uppercase; }
.page-heading .eyebrow { margin-bottom: 12px; font-size: 14px; letter-spacing: 1.3px; }
.page-intro { margin-top: 18px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.demo-button { align-self: flex-end; margin-bottom: 5px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 48px; padding: 12px 17px; border: 1px solid transparent; border-radius: 13px; font-size: 15px; font-weight: 650; text-decoration: none; }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: #ffffff; background: var(--teal); border-color: var(--teal); }
.button-primary:hover { color: white; background: var(--teal-dark); border-color: var(--teal-dark); }
.button-secondary { background: var(--surface); color: var(--teal); border-color: #a5bbc8; }
.button-secondary:hover { background: #eaf2f7; border-color: #6f96ab; }
.button-quiet { background: transparent; color: var(--teal); border-color: transparent; }
.button-quiet:hover { background: var(--teal-light); }
.button-small { min-height: 37px; font-size: 14px; padding: 8px 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.summary-card { padding: 20px 24px; border: 0; border-radius: 18px; background: var(--surface); }
.summary-card:first-child { background: #eaf2f7; }
.summary-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #496277; font-size: 14px; font-weight: 500; }
.summary-icon { display: grid; place-items: center; width: 30px; height: 30px; color: #53738a; background: transparent; border-radius: 8px; }
.summary-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.summary-value { color: var(--ink); font-size: 39px; font-weight: 620; line-height: 1.2; letter-spacing: -1.4px; margin: 10px 0 5px; font-variant-numeric: tabular-nums; }
.summary-value small, .summary-value span { font-size: 15px; font-weight: 450; letter-spacing: 0; }
.summary-caption { color: var(--muted); font-size: 14px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(320px,1fr); gap: 22px; align-items: start; }
.overview-column, .entry-column { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.card { min-width: 0; padding: 28px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 25px #17375006; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.card-heading .eyebrow { margin-bottom: 6px; }
.section-description { font-size: 14px; color: var(--muted); line-height: 1.7; }
.date-field { flex-shrink: 0; }
.timeline-controls { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 19px; }
.timeline-controls .date-field > span { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 600; color: var(--muted); }
.timeline-controls .button { min-height: 43px; }
.date-field input { max-width: 148px; padding: 8px 9px; font-size: 14px; background: #f3f7fa; }
.at-time-summary { margin-top: 10px; color: var(--muted); font-size: 14px; }
.at-time-summary:empty { display: none; }
.at-time-summary h3 { font-size: 14px; margin-bottom: 8px; }
.at-time-summary ul { margin: 0; padding-left: 18px; }
.at-time-summary li + li { margin-top: 8px; }
#stock-section { margin-top: 24px; }
#stock-section:empty { display: none; }
.timeline-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 24px 0 20px; font-size: 14px; color: var(--muted); }
.timeline-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-dot.opioid { background: var(--teal); }
.legend-dot.nsaid { background: var(--orange); }
.legend-dot.other { background: var(--purple); }
.timeline { min-height: 180px; padding: 8px 0 12px; }
.timeline-row { display: grid; grid-template-columns: minmax(85px, 115px) minmax(0,1fr); gap: 12px; align-items: center; min-height: 56px; }
.timeline-label { color: var(--ink); font-size: 14px; font-weight: 570; overflow-wrap: anywhere; }
.timeline-label small { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; font-weight: 400; }
.timeline-track { position: relative; min-height: 40px; border-bottom: 1px solid #e3ebf0; background: linear-gradient(to right, #e7eef2 1px, transparent 1px); background-size: 25% 100%; }
.dose-marker { position: absolute; top: 50%; width: 12px; height: 12px; transform: translate(-50%,-50%); border: 2px solid var(--surface); border-radius: 50%; background: var(--teal); color: var(--teal); box-shadow: 0 0 0 1px currentColor; padding: 0; }
.dose-marker.nsaid, .dose-marker[data-category="nsaid"] { background: var(--orange); color: var(--orange); }
.dose-marker.other, .dose-marker.unknown, .dose-marker[data-category="other"], .dose-marker[data-category="unknown"] { background: var(--purple); color: var(--purple); }
.now-line { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #758c9d; pointer-events: none; }
.timeline-axis, .time-axis, .timeline-hours { display: flex; justify-content: space-between; margin-left: 127px; padding-top: 12px; color: var(--muted); font-size: 14px; }
.timeline .empty-state { min-height: 160px; }
.small-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding-top: 17px; border-top: 1px solid #e3ebf0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.small-note svg { margin-top: 1px; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.small-section-title { font-size: 14px; letter-spacing: -.15px; margin: 0 0 10px 2px; }
#combination-notices { display: grid; gap: 10px; }
#combination-notices:empty { min-height: 10px; }
.notice, .combination-notice, .info-notice, .warning-notice { padding: 17px 19px; border: 0; border-left: 3px solid #8dabbe; border-radius: 4px 14px 14px 4px; background: #edf3f7; color: #3c566a; font-size: 14px; }
.notice p, .combination-notice p { margin-top: 4px; }
.notice h3, .combination-notice h3, .notice strong { color: inherit; font-size: 14px; }
.notice.warning, .notice.caution, .warning-notice, .combination-notice.warning { background: #f7eee0; border-color: #e5d5b9; color: #75512a; }
.notice.danger, .notice.urgent, .combination-notice.danger { background: #faeee8; border-color: #e5c6b7; color: #843d30; }
.notice ul, .combination-notice ul { margin: 7px 0 0; padding-left: 18px; }
.subtle-tag { padding: 5px 9px; border-radius: 6px; background: #edf3f6; color: var(--muted); font-size: 14px; white-space: nowrap; }
.pain-chart { min-height: 180px; padding-top: 17px; }
.pain-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.pain-chart text { font-family: inherit; fill: var(--muted); font-size: 14px; }
.pain-chart .empty-state { min-height: 165px; }
.pain-form { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 17px; }
.pain-form > .button { margin-top: 2px; }
.dose-card { border-top: 4px solid var(--teal); padding-top: 24px; border-top-right-radius: 34px; }
.dose-card h2 { font-size: 26px; }
.dose-card .section-description { margin-bottom: 21px; }
.form-field { min-width: 0; margin-bottom: 20px; }
.form-field label { display: block; color: var(--ink); margin-bottom: 6px; font-size: 14px; font-weight: 610; }
.optional { font-weight: 400; color: var(--muted); margin-left: 4px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid #b9cad5; border-radius: 10px; background: #ffffff; color: var(--ink); font-size: 16px; line-height: 1.4; }
input:hover, select:hover, textarea:hover { border-color: #809caf; }
input::placeholder, textarea::placeholder { color: #687b8b; opacity: 1; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #a34330; }
textarea { resize: vertical; min-height: 78px; }
select { padding-right: 24px; }
input[type="datetime-local"] { font-size: 14px; }
.form-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.amount-row { grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); }
.amount-row .form-field { margin-bottom: 6px; }
.field-help { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 6px; }
.unit-help { margin: 0 0 17px; }
.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.form-actions .button { width: 100%; min-height: 46px; }
.profile-card { background: #eaf1f6; padding: 24px; box-shadow: none; }
.profile-card h2 { font-size: 16px; margin-bottom: 15px; }
.profile-card .form-field { margin-bottom: 0; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form input { flex: 1; width: 0; }
.inline-form .button { flex-shrink: 0; }
.empty-state { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; padding: 32px 20px; color: var(--muted); font-size: 14px; background: #f3f7fa; border: 0; border-radius: 18px; }
.empty-state svg { color: #718c9e; width: 32px; height: 32px; }
.empty-state h3, .empty-state strong { color: #415f75; font-size: 14px; }
.empty-state p { max-width: 370px; }
.journal-section { margin-top: 24px; padding-bottom: 18px; }
.data-actions { display: flex; align-items: center; gap: 5px; }
.import-label { position: relative; overflow: hidden; }
.import-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.import-label:focus-within { outline: 3px solid #ab5e24; outline-offset: 3px; }
.journal-list { margin-top: 22px; }
.journal-list .empty-state { min-height: 130px; }
.journal-item, .journal-entry, .entry { display: flex; align-items: flex-start; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); font-size: 14px; }
.journal-item:first-child, .journal-entry:first-child, .entry:first-child { border-top: 0; }
.journal-item > div, .journal-entry > div, .entry > div { min-width: 0; }
.journal-item h3, .journal-entry h3, .entry h3 { font-size: 14px; }
.entry-content, .journal-content { flex: 1; }
.entry-time, .journal-time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-meta, .journal-meta, .entry-note { color: var(--muted); font-size: 14px; }
.entry-note { margin-top: 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.entry-actions, .journal-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }
.journal-list button { color: var(--teal); border: 1px solid var(--line); border-radius: 7px; background: transparent; min-height: 36px; padding: 7px 10px; font-size: 14px; }
.journal-list button:hover { background: var(--teal-light); }
.journal-list .delete-button, .journal-list .danger { color: #8c4434; }
.badge, .category-badge, .entry-tag { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 5px; font-size: 14px; background: var(--teal-light); color: var(--teal); }
.badge.nsaid, .category-badge.nsaid { color: #865326; background: #f4ebdc; }
.badge.other, .badge.unknown, .category-badge.other, .category-badge.unknown { color: #675d78; background: #eeebf3; }
.storage-note { display: flex; align-items: center; gap: 8px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.knowledge-section { margin-top: 53px; margin-bottom: 42px; }
.knowledge-heading { max-width: 700px; }
.knowledge-heading .eyebrow { margin-bottom: 7px; }
.knowledge-heading h2 { font-size: 27px; margin-bottom: 11px; }
.knowledge-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; margin-top: 27px; }
.knowledge-item { position: relative; padding: 0 5px 0 36px; }
.knowledge-number { position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 24px; height: 24px; background: #e6eef4; border-radius: 50%; color: #41637c; font-size: 14px; font-weight: 650; }
.knowledge-item h3 { margin-bottom: 9px; font-size: 14px; letter-spacing: -.15px; }
.knowledge-item p { font-size: 14px; color: var(--muted); line-height: 1.8; }
.drug-facts { margin-top: 27px; }
.drug-facts:empty { display: none; }
.drug-facts h2 { font-size: 20px; margin-bottom: 16px; }
.drug-facts h3 { font-size: 14px; margin-bottom: 7px; }
.drug-facts > article, .drug-fact, .fact-card { background: var(--surface); border: 0; border-left: 3px solid #b1c5d3; border-radius: 4px 14px 14px 4px; padding: 20px; margin-bottom: 14px; font-size: 14px; }
.drug-facts p + p { margin-top: 8px; }
.drug-facts a { font-size: 14px; }
.drug-facts ul { padding-left: 18px; font-size: 14px; }
.knowledge-footnotes { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.knowledge-footnotes p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.knowledge-footnotes strong { font-weight: 650; color: #3d5c73; }
.site-footer { max-width: 1240px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; padding: 22px 36px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-brand { color: var(--teal); text-decoration: none; font-size: 14px; font-weight: 650; letter-spacing: -.35px; }
.site-footer p { margin-right: auto; }
.status-message:empty, .error-message:empty { display: none; }
.status-message, .error-message, .undo-banner { margin: 0 0 18px; padding: 13px 16px; border-radius: 10px; background: #e8f1f6; border: 1px solid #cadce7; font-size: 14px; }
.error-message { background: #faeee8; border-color: #deb9aa; color: #843d30; }
.undo-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

@media (min-width: 1400px) {
 .site-header { padding-left: 76px; padding-right: 76px; }
 .page-shell { padding-top: 50px; }
}

@media (max-width: 1000px) {
 .site-header { padding-left: 30px; padding-right: 30px; }
 .local-badge { display: none; }
 .page-shell { padding-left: 25px; padding-right: 25px; }
 .workspace-grid { grid-template-columns: minmax(0,1.45fr) minmax(300px,1fr); gap: 17px; }
 .card { padding: 21px; }
 .card-heading { gap: 10px; }
 .card-heading h2 { font-size: 24px; }
 .timeline-card .card-heading { align-items: flex-start; flex-direction: column; }
 .date-field input { min-height: 36px; }
 .summary-card { padding: 16px 18px; }
 .summary-card-top { font-size: 14px; }
 .summary-icon { display: none; }
 .timeline-row { grid-template-columns: minmax(70px,90px) minmax(0,1fr); gap: 9px; }
 .timeline-axis, .time-axis, .timeline-hours { margin-left: 99px; }
 .pain-form .form-row { grid-template-columns: 1fr; gap: 0; }
 .knowledge-grid { gap: 20px; }
}

@media (max-width: 760px) {
 .site-header { flex-wrap: wrap; gap: 20px; padding: 20px 22px 16px; }
 .brand { font-size: 22px; }
 .main-nav { margin-left: 0; gap: 24px; width: 100%; }
 .main-nav a { font-size: 14px; }
 .page-shell { padding: 30px 18px 0; }
 .page-heading { align-items: flex-start; margin-bottom: 25px; }
 .page-heading .eyebrow { font-size: 14px; }
 h1 { font-size: 43px; max-width: 520px; }
 .page-intro { font-size: 14px; }
 .demo-button { align-self: flex-end; flex-shrink: 0; }
 .summary-grid { gap: 10px; }
 .summary-card { padding: 15px 12px; }
 .summary-card-top { min-height: 35px; align-items: flex-start; line-height: 1.45; }
 .summary-value { font-size: 29px; margin-top: 5px; }
 .summary-caption { font-size: 14px; line-height: 1.5; }
 .workspace-grid { grid-template-columns: 1fr; }
 .entry-column { display: grid; grid-template-columns: 1fr; }
 .timeline-card .card-heading { flex-direction: row; }
 .pain-form .form-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
 .knowledge-grid { grid-template-columns: 1fr; gap: 24px; }
 .knowledge-item h3 { font-size: 15px; }
 .knowledge-item p { font-size: 14px; }
 .knowledge-footnotes { grid-template-columns: 1fr; gap: 14px; }
 .journal-section { margin-top: 20px; }
 .site-footer { margin: 0 18px; padding: 20px 0; flex-wrap: wrap; gap: 8px 20px; }
 .site-footer p { order: 3; flex-basis: 100%; }
 .site-footer > span { margin-left: auto; }
}

@media (max-width: 480px) {
 .page-heading { flex-direction: column; gap: 18px; }
 .demo-button { align-self: flex-start; margin-bottom: 0; }
 h1 { font-size: 39px; }
 .page-intro { font-size: 14px; }
 .summary-grid { grid-template-columns: 1fr; gap: 9px; }
 .summary-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 12px; padding: 13px 16px; }
 .summary-card-top { min-height: 0; font-size: 14px; align-items: center; }
 .summary-value { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; font-size: 27px; }
 .summary-caption { margin-top: 3px; grid-column: 1; }
 .card { padding: 23px 18px; border-radius: 20px; }
 .timeline-card .card-heading { flex-direction: column; }
 .timeline-legend { gap: 13px; }
 .timeline-label { font-size: 14px; }
 .timeline-row { grid-template-columns: 74px minmax(0,1fr); }
 .timeline-axis, .time-axis, .timeline-hours { margin-left: 83px; }
 .form-row, .pain-form .form-row { grid-template-columns: 1fr; gap: 0; }
 .amount-row { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 12px; }
 .journal-section > .card-heading { align-items: flex-start; flex-direction: column; }
 .data-actions { margin-top: 2px; }
 .journal-item, .journal-entry, .entry { flex-wrap: wrap; gap: 7px 12px; }
 .entry-actions, .journal-actions { width: 100%; margin-left: 0; margin-top: 6px; }
 .knowledge-heading h2 { font-size: 24px; }
 .knowledge-section { margin-top: 36px; }
 .undo-banner { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
 *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
 body { background: white; font-size: 14px; }
 .site-header, .main-nav, .demo-button, .entry-column, .pain-form, .data-actions, .entry-actions, .journal-actions, .site-footer, .status-message, .error-message, .undo-banner { display: none !important; }
 .page-shell { max-width: none; padding: 0; }
 .workspace-grid { display: block; }
 .card { break-inside: avoid; box-shadow: none; margin-bottom: 16px; }
 .knowledge-grid { gap: 16px; }
 .page-heading { margin-bottom: 20px; }
 .summary-card { background: white; }
 a { color: inherit; }
}

/* Shared components and readable type across the diary, stock and plan modules. */
.primary, .secondary, .text-button { min-height:48px; border:1px solid var(--line); border-radius:9px; padding:10px 14px; font-size:14px; color:var(--teal); background:var(--surface); }
.primary { color:white; background:var(--teal); border-color:var(--teal); }
.field { margin-bottom:16px; }
.field label { display:block; color:var(--ink); font-weight:550; }
.field small { display:block; margin-top:5px; color:var(--muted); font-size: 14px; }
.actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.muted { color:var(--muted); font-size:14px; line-height:1.65; }
p,li { overflow-wrap:anywhere; }
body { font-size:16px; }
.section-description,.at-time-summary,.field-help,.small-note,.knowledge-item p,.knowledge-footnotes p,.storage-note,.summary-caption,.notice,.drug-facts > article { font-size:14px; }
.form-field label,input,select,textarea,input[type="datetime-local"],.button,.main-nav a { font-size:14px; }
.button,.journal-list button { min-height:48px; }
.at-time-summary h3,.notice h3,.notice strong { font-size:15px; }
.at-time-summary li { margin-block:14px; }
.timeline-row.timeline-axis { display:grid; margin-left:0; padding:0; min-height:34px; }
.timeline-axis .timeline-track { background:none; border:0; min-height:24px; }
.timeline-label { font-size: 14px; }
.dose-marker,.dose-marker[data-category] { background:transparent; border:0; box-shadow:none; }
.dose-marker::after { content:''; width:12px; height:12px; border-radius:50%; background:currentColor; display:block; margin:auto; }
#stock-section,#plan-section { margin-top:28px; }
#stock-section > h2 { margin-bottom:12px; }
#stock-section > p { margin-bottom:12px; }
#stock-section form { max-width:760px; }
#stock-section .card { margin-block:15px; }
#plan-section form { max-width:760px; }
#plan-section .entry-actions { margin-left:0; }
#summary-pain-date { display:block; color:var(--muted); font-size: 14px; }
.notice.review { background:#fbf0df; border-color:#e3c79d; color:#754f21; }
.demo-mode .site-header { border-bottom:3px solid #bd8748; }
.demo-mode #storage-status { color:#754f21; font-weight:700; }
dialog { border:1px solid var(--line);border-radius:16px;padding:28px;max-width:min(92vw,600px);color:var(--text);background:var(--surface); }
dialog::backdrop { background:#122a4580; }
dialog p { margin:16px 0; }
dialog button { margin-right:10px; }
@media(max-width:520px){ .main-nav {gap:14px;flex-wrap:wrap;} .summary-card {display:block;} .summary-value {margin-top:8px;} .timeline-axis .timeline-track span{font-size: 14px!important;} }
@media print { #stock-section form,#plan-section form,#plan-section button,#stock-section button {display:none!important;} }

/* The same reading order serves keyboard, mobile and desktop navigation. */
.header-navigation { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-left: auto; }
.main-nav { margin: 0; gap: 8px; }
.main-nav a { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 18px; border-radius: 9px; color: var(--ink); font-size: 16px; }
.main-nav a:hover { background: #e9f2f7; text-decoration: none; }
.secondary-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; }
.secondary-nav a { display: inline-flex; align-items: center; min-height: 34px; color: var(--muted); font-size: 14px; text-decoration: none; }
.secondary-nav a:hover { text-decoration: underline; }
.local-badge { margin-left: 0; max-width: 210px; white-space: normal; border-radius: 10px; background: #eaf0f4; color: #4b626d; line-height: 1.45; }
.local-badge .storage-dot { background: #608293; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 24px; }
.quick-actions .button { min-height: 46px; padding-inline: 18px; }
.quick-actions .button-primary > span { font-size: 23px; font-weight: 400; line-height: 1; }
.dose-quick-title { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.dose-quick-button { font-size: 14px; padding: 8px 12px; }
.dose-quick-button[aria-pressed="true"] { background: #e4eff5; border-color: #4483a0; color: #204e64; }
.dose-unit-helper { padding: 18px; border: 0; border-radius: 16px; background: #eaf4f8; }
.dose-direct-toggle { font-size: 14px; line-height: 1.5; }
.dose-unit-equivalence { min-height: 2.8em; margin-top: 8px; color: #254e63; }
.workspace-grid { grid-template-areas: 'overview entry'; }
.entry-column { grid-area: entry; }
.overview-column { grid-area: overview; }
#entry-section, #history-section, #stock-section, #plan-section, #journal, #knowledge, #pain-form { scroll-margin-top: 20px; }
.medicine-mapping { min-width: 0; margin: 24px 0 20px; padding: 18px 16px 0; border: 0; border-top: 1px solid #dce6eb; border-radius: 0; background: transparent; }
.medicine-mapping legend { padding: 0 6px; color: var(--muted); font-size: 14px; font-weight: 550; }
.medicine-mapping .form-field label { font-weight: 500; }
.medicine-mapping .form-row { grid-template-columns: 1fr; gap: 0; }
.date-field input { font-size: 16px; max-width: none; min-height: 48px; }
.timeline-controls .date-field > span { font-size: 14px; }
.timeline-label, .timeline-label small, .timeline-axis .timeline-track span { font-size: 14px !important; }
.timeline-row { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr); }
.dose-marker { min-width: 28px; min-height: 36px; }
.pain-chart text { font-size: 18px; }
.pain-chart text[x="10"] { text-anchor: end; transform: translateX(18px); }
.pain-chart { padding-bottom: 10px; }
.field small { font-size: 14px; }

@media (max-width: 1100px) {
 .site-header { flex-wrap: wrap; gap: 14px 24px; }
 .local-badge { display: flex; margin-left: auto; }
 .header-navigation { order: 3; width: 100%; margin: 0; }
}
@media (max-width: 760px) {
 body { padding-bottom: 112px; }
 .site-header { padding: 18px; gap: 12px; }
 .brand-caption { font-size: 14px; letter-spacing: 0; }
 .local-badge { max-width: none; width: 100%; padding: 7px 10px; }
 .header-navigation { align-items: flex-start; }
 .secondary-nav { justify-content: flex-start; gap: 0 18px; }
 .main-nav { position: fixed; z-index: 10; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 6px; padding: 9px 12px; padding-bottom: max(9px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid #d6e2e9; background: var(--surface); box-shadow: 0 -4px 16px #183a590c; }
 .main-nav a { min-height: 46px; padding: 8px 4px; font-size: 16px; font-weight: 600; }
 .main-nav a:first-child { color: #005866; background: #e5f0f6; }
 .page-shell { padding-top: 24px; }
 .page-heading { gap: 14px; margin-bottom: 23px; }
 .quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
 .quick-actions .button-primary { grid-column: 1 / -1; }
 .quick-actions .button { padding-inline: 10px; }
 .workspace-grid { grid-template-areas: 'entry' 'overview'; }
 .entry-column { gap: 16px; }
 .form-field input, .form-field select, .form-field textarea { font-size: 16px; }
 .summary-grid { gap: 9px; }
 .summary-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 12px; }
 .summary-value { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; }
 .summary-card-top { font-size: 14px; min-height: 0; }
 .summary-caption { grid-column: 1; margin: 0; }
 .pain-chart text { font-size: 26px; }
}
@media print {
 body { padding-bottom: 0; }
 .quick-actions, .header-navigation { display: none !important; }
}
