/* The public site's frame (2026-11-07): the side menu (templates/_site_side.html), the page beside it at the full width
   of the window, and the views (one screen each) that the home page and the pages for doctors, labs and EMR
   integration are made of. Behaviour: static/elabs-shell.js. Pages keep their own styles for what is inside a view. */
:root {
    --sx-w: 260px; --sx-bar-h: 58px;
    --sx-blue: #0e7490; --sx-blue-d: #155e75; --sx-blue-50: #ecfeff; --sx-blue-100: #cffafe;
    --sx-green: #8BC34A; --sx-green-d: #4f8a1c; --sx-green-50: #f1f8e8;
    --sx-ink: #0c1a2a; --sx-text: #3a4a5c; --sx-muted: #637387; --sx-line: #e4eaf1;
    --sx-bg: #f7f9fb; --sx-hover: #edf1f5;
    --sx-pad: clamp(16px, 2.6vw, 44px);
}

/* ---------- The side menu ---------- */
.sx-side, .sx-bar { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.4; }
.sx-side *, .sx-bar * { box-sizing: border-box; }
.sx-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040; width: var(--sx-w); display: flex; flex-direction: column;
           background: var(--sx-bg); border-right: 1px solid var(--sx-line); }
.sx-head { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 20px; }
.sx-logo { display: inline-flex; align-items: center; }
.sx-logo img { display: block; height: 28px; width: auto; max-width: 100%; }
.sx-close { display: none; }
.sx-track { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.sx-panel { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px 12px 14px; overflow-y: auto;
            overscroll-behavior: contain; scrollbar-width: thin; visibility: hidden; opacity: 0; transform: translateX(100%);
            transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s, visibility 0s 0.26s; }
.sx-panel[data-panel="root"] { transform: translateX(-100%); }
.sx-side[data-panel="root"] .sx-panel[data-panel="root"],
.sx-side[data-panel="patients"] .sx-panel[data-panel="patients"],
.sx-side[data-panel="doctors"] .sx-panel[data-panel="doctors"],
.sx-side[data-panel="labs"] .sx-panel[data-panel="labs"] { visibility: visible; opacity: 1; transform: none;
                                                            transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s, visibility 0s; }
.sx-i { display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 7px 10px; border-radius: 9px; border: 0; background: none;
        font: 500 0.9rem/1.25 'Inter', system-ui, sans-serif; color: var(--sx-text); text-decoration: none; text-align: left; cursor: pointer;
        transition: background 0.12s, color 0.12s; }
.sx-i > i:first-child { flex: none; width: 20px; text-align: center; font-size: 1.02rem; color: var(--sx-muted); transition: color 0.12s; }
.sx-i > span { flex: 1 1 auto; min-width: 0; }
.sx-i:hover, .sx-i:focus-visible { background: var(--sx-hover); color: var(--sx-ink); }
.sx-i:hover > i:first-child { color: var(--sx-ink); }
.sx-i.on { background: #fff; color: var(--sx-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(12, 26, 42, 0.06), inset 0 0 0 1px var(--sx-line); }
.sx-i.on > i:first-child { color: var(--sx-blue); }
.sx-car, .sx-ext { flex: none; margin-left: auto; font-size: 0.72rem; color: #94a3b8; }
/* The section the visitor is in, marked in the main list (seen after Back) */
.sx-has.cur { background: var(--sx-blue-50); color: var(--sx-blue-d); font-weight: 600; }
.sx-has.cur > i:first-child, .sx-has.cur .sx-car { color: var(--sx-blue); }
.sx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sx-i:hover .sx-car { color: var(--sx-ink); transform: translateX(2px); transition: transform 0.15s; }
.sx-gap { flex: none; height: 1px; margin: 8px 10px; background: var(--sx-line); }
.sx-back { display: inline-flex; align-items: center; gap: 0.45rem; align-self: flex-start; margin: 0 0 4px; padding: 6px 10px; border: 0; border-radius: 8px;
           background: none; font: 600 0.8rem/1 'Inter', system-ui, sans-serif; color: var(--sx-muted); cursor: pointer; }
.sx-back:hover, .sx-back:focus-visible { background: var(--sx-hover); color: var(--sx-ink); }
.sx-back i { font-size: 0.9rem; transition: transform 0.15s; }
.sx-back:hover i { transform: translateX(-2px); }
.sx-title { display: flex; align-items: center; gap: 0.6rem; padding: 4px 10px 10px; font-size: 0.98rem; font-weight: 700; color: var(--sx-ink); letter-spacing: -0.01em; }
.sx-title i { color: var(--sx-blue); }
/* minmax(0, 1fr): the column stays the menu's width, so a long email can't widen it past the menu (2026-11-12) */
.sx-foot { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px; border-top: 1px solid var(--sx-line); }
.sx-ask { width: 100%; }
.sx-ask > i:first-child { color: var(--sx-blue); }
.sx-ask[aria-expanded="true"] { background: var(--sx-blue-50); color: var(--sx-blue-d); }
.sx-i > .sx-ask-new { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sx-green); box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.25); }
.sx-ask.seen .sx-ask-new { display: none; }
.sx-sign { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--sx-text); text-decoration: none;
           border: 1px solid var(--sx-line); background: #fff; transition: border-color 0.12s, background 0.12s; }
.sx-sign:hover { border-color: #c6d4e2; color: var(--sx-ink); }
.sx-sign > i { flex: none; width: 20px; text-align: center; font-size: 1rem; color: var(--sx-blue); }
.sx-sign b { display: block; font-size: 0.84rem; font-weight: 700; color: var(--sx-ink); }
.sx-sign small { display: block; font-size: 0.75rem; color: var(--sx-muted); }
.sx-sign.on { border-color: var(--sx-blue); box-shadow: inset 0 0 0 1px var(--sx-blue); }
/* The person signed in to order their own tests, with Sign out; the cart's count on Tests and prices */
.sx-me > span:not(.sx-av) { flex: 1 1 auto; min-width: 0; }
.sx-me b, .sx-me small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sx-blue-50); color: var(--sx-blue-d); font-size: 0.8rem; font-weight: 800; }
.sx-me form { margin: 0; flex: none; }
.sx-out { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--sx-muted); cursor: pointer; display: grid; place-items: center; }
.sx-out:hover { background: #fef2f2; color: #b91c1c; }
.sx-i .pt-cart-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin: 0;
                       border-radius: 999px; background: var(--sx-blue); color: #fff; font-size: 0.7rem; font-weight: 700; }
/* What to do next, by the list that is open: only the entries for that list show */
.sx-side .sx-for { display: none; }
.sx-side[data-panel="root"] .f-root, .sx-side[data-panel="patients"] .f-patients,
.sx-side[data-panel="doctors"] .f-doctors, .sx-side[data-panel="labs"] .f-labs { display: flex; }
.sx-sign.sx-cta { background: var(--sx-green-50); border-color: #d6ebc0; }
.sx-sign.sx-cta:hover { border-color: #b5d98f; }
.sx-sign.sx-cta > i { color: var(--sx-green-d); }
.sx-sign.sx-portal { background: var(--sx-blue); border-color: var(--sx-blue); }
.sx-sign.sx-portal:hover { background: var(--sx-blue-d); border-color: var(--sx-blue-d); }
.sx-sign.sx-portal > i, .sx-sign.sx-portal b { color: #fff; }
.sx-sign.sx-portal small { color: rgba(255, 255, 255, 0.82); }
.sx-legal { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; padding: 6px 4px 0; }
.sx-legal a { font-size: 0.76rem; color: var(--sx-muted); text-decoration: none; }
.sx-legal a:hover, .sx-legal a[aria-current] { color: var(--sx-blue-d); text-decoration: underline; text-underline-offset: 3px; }
.sx-copy { margin: 0; padding: 0 4px; font-size: 0.75rem; color: #64748b; }
.sx-bar, .sx-scrim { display: none; }
.sx-side :focus-visible, .sx-bar :focus-visible { outline: 3px solid rgba(14, 116, 144, 0.4); outline-offset: 1px; }

/* A short screen: the menu's items and sign-in a little tighter, so the lists stay in view */
@media (min-width: 961px) and (max-height: 780px) {
    .sx-head { height: 56px; }
    .sx-i { min-height: 32px; padding-top: 4px; padding-bottom: 4px; }
    .sx-gap { margin: 5px 10px; }
    .sx-title { padding-bottom: 6px; }
    .sx-back { margin-bottom: 2px; }
    .sx-sign { padding: 6px 10px; }
    .sx-sign small { display: none; }
    .sx-foot { gap: 5px; padding: 10px 12px; }
}

/* The page beside the menu, at the full width of the window */
body.sx { padding-left: var(--sx-w); }
.sx-main { display: block; min-width: 0; }

/* A phone or a narrow window: a slim bar on top, the menu slides in from the left */
@media (max-width: 960px) {
    body.sx { padding-left: 0; }
    .sx-bar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 10px; height: var(--sx-bar-h); padding: 0 12px;
              background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
              border-bottom: 1px solid var(--sx-line); }
    .sx-bar .sx-logo img { height: 24px; }
    .sx-bar-in { margin-left: auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--sx-line); border-radius: 10px;
                 background: #fff; color: var(--sx-blue-d); font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
    .sx-burger { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; font-size: 1.5rem; color: var(--sx-ink); cursor: pointer; }
    .sx-burger:hover { background: var(--sx-hover); }
    .sx-side { width: min(300px, 86vw); transform: translateX(-102%); transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: none; }
    .sx-side.open { transform: none; box-shadow: 0 24px 60px rgba(12, 26, 42, 0.28); }
    .sx-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; font-size: 1.05rem; color: var(--sx-muted); cursor: pointer; }
    .sx-close:hover { background: var(--sx-hover); color: var(--sx-ink); }
    .sx-scrim { position: fixed; inset: 0; z-index: 1035; display: block; background: rgba(12, 26, 42, 0.38); opacity: 0; transition: opacity 0.2s; }
    .sx-scrim.show { opacity: 1; }
    .sx-scrim[hidden] { display: none; }
    .sx-i { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
    .sx-panel, .sx-side, .sx-scrim, .sx-i, .sx-car, .sx-back i { transition: none !important; }
}
@media print { .sx-side, .sx-bar, .sx-scrim { display: none !important; } body.sx { padding-left: 0; } }

/* ---------- Views: one screen each, one at a time ---------- */
.vw { display: flex; flex-direction: column; gap: clamp(14px, 2.4vh, 26px); min-height: 100vh; min-height: 100dvh;
      padding: clamp(20px, 3.4vh, 40px) var(--sx-pad) clamp(20px, 3.4vh, 40px); scroll-margin-top: 0; }
/* Before the script runs: the default view only (a view named in the address is shown by the page's boot style);
   without a script every view shows, one after another */
html.js:not(.vw-ready) .vw:not(.vw-default) { display: none; }
html.vw-ready .vw:not(.on) { display: none; }
html.vw-ready .vw.on { animation: vw-in 0.22s ease both; }
@keyframes vw-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html.vw-ready .vw.on { animation: none; } }
.vw h1[tabindex="-1"]:focus, .vw h2[tabindex="-1"]:focus { outline: none; }
@media (max-width: 960px) { .vw { min-height: calc(100vh - var(--sx-bar-h)); min-height: calc(100dvh - var(--sx-bar-h)); } }

/* A view's header: what it is on the left, what to do on the right */
.vh { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 28px; }
.vh > div:first-child { min-width: 0; flex: 1 1 520px; }
.vh-k { display: inline-flex; align-items: center; gap: 0.45rem; margin-bottom: 0.45rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em;
        text-transform: uppercase; color: var(--sx-blue); }
.vh h1, .vh h2 { margin: 0; font-size: clamp(1.45rem, 2.05vw, 2.1rem); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; color: var(--sx-ink); }
.vh p { margin: 0.5rem 0 0; max-width: 78ch; font-size: 1rem; line-height: 1.55; color: var(--sx-muted); }
.vh-act { display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* A part that takes the rest of the screen (the map) */
.vw-fill { flex: 1 1 auto; min-height: 420px; }
/* Grids that use the full width */
.vg { display: grid; gap: clamp(12px, 1.4vw, 18px); grid-template-columns: repeat(var(--c, 3), minmax(0, 1fr)); }
.vg-2 { --c: 2; } .vg-3 { --c: 3; } .vg-4 { --c: 4; }
@media (max-width: 1200px) { .vg-4 { --c: 2; } }
@media (max-width: 1000px) { .vg-3 { --c: 2; } }
@media (max-width: 680px) { .vg-2, .vg-3, .vg-4 { --c: 1; } }

/* Tabs across the top of a page whose views are not in the side menu (EMR integration) */
.vt { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 10px var(--sx-pad) 0;
      background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--sx-line); }
.vt::-webkit-scrollbar { display: none; }
.vt a { flex: none; padding: 0.55rem 0.9rem 0.7rem; border-bottom: 2px solid transparent; font: 600 0.88rem/1 'Inter', system-ui, sans-serif;
        color: var(--sx-muted); text-decoration: none; white-space: nowrap; }
.vt a:hover { color: var(--sx-ink); }
.vt a.on { color: var(--sx-blue-d); border-bottom-color: var(--sx-blue); }
.vt + .vw, .vt ~ .vw { min-height: calc(100vh - 46px); }
@media (max-width: 960px) { .vt { top: var(--sx-bar-h); } }
