/*
    Online lab report: the public pages a patient opens from an SMS link or with the numbers on the bill
    (Views/My, docs/ONLINE_LAB_REPORT.md). Mobile first (checked at 375 px), no framework, prefix olr-.
*/
:root {
    --olr-bg: #f3f6f9;
    --olr-card: #ffffff;
    --olr-ink: #17212b;
    --olr-soft: #5b6877;
    --olr-line: #dfe5ec;
    --olr-main: #0b6b7a;
    --olr-main-dark: #08535f;
    --olr-warn-bg: #fff4e5;
    --olr-warn-line: #f0b961;
    --olr-warn-ink: #6b4100;
    --olr-info-bg: #e9f5f7;
    --olr-info-line: #9fd0d8;
    --olr-info-ink: #0b4f5a;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.olr {
    margin: 0;
    min-height: 100vh;
    background: var(--olr-bg);
    color: var(--olr-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Mangal", "Kalimati", sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

/* ── top: hospital and language ─────────────────────────────────────────── */
.olr-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--olr-card);
    border-bottom: 1px solid var(--olr-line);
}
.olr-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.olr-logo {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--olr-info-bg);
    color: var(--olr-main);
    font-weight: 700;
    font-size: 20px;
}
.olr-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.olr-brand-text { display: flex; flex-direction: column; min-width: 0; }
.olr-brand-name { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.olr-brand-sub { color: var(--olr-soft); font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.olr-lang {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--olr-line);
    border-radius: 999px;
    color: var(--olr-main);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: #fff;
}
.olr-lang:hover, .olr-lang:focus-visible { border-color: var(--olr-main); }

/* ── page ───────────────────────────────────────────────────────────────── */
.olr-main { width: 100%; max-width: 560px; margin: 0 auto; padding: 16px; }
.olr-card {
    background: var(--olr-card);
    border: 1px solid var(--olr-line);
    border-radius: 14px;
    padding: 20px 18px 22px;
}
.olr-h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; }
.olr-sub { margin: 0 0 16px; color: var(--olr-soft); }

.olr-label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 15px; }
.olr-input {
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    border: 1px solid #b9c3cf;
    border-radius: 10px;
    background: #fff;
    color: var(--olr-ink);
    font: inherit;
    font-size: 18px;
    letter-spacing: .02em;
}
.olr-input:focus { outline: 3px solid rgba(11, 107, 122, .25); border-color: var(--olr-main); }
.olr-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; color: var(--olr-soft); font-size: 15px; min-height: 32px; }
.olr-check input { width: 20px; height: 20px; accent-color: var(--olr-main); }

.olr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 16px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--olr-main);
    color: #fff;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.olr-btn:hover, .olr-btn:focus-visible { background: var(--olr-main-dark); }
.olr-btn:focus-visible { outline: 3px solid rgba(11, 107, 122, .35); outline-offset: 2px; }
.olr-btn[disabled] { opacity: .7; cursor: progress; }

.olr-link { display: inline-block; margin-top: 16px; color: var(--olr-main); font-weight: 600; }

/* ── facts of the report ────────────────────────────────────────────────── */
.olr-facts { margin: 12px 0 4px; padding: 0; border: 1px solid var(--olr-line); border-radius: 10px; overflow: hidden; }
.olr-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.olr-facts > div + div { border-top: 1px solid var(--olr-line); }
.olr-facts dt { color: var(--olr-soft); flex: 0 0 auto; }
.olr-facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* ── messages ───────────────────────────────────────────────────────────── */
.olr-note { margin: 16px 0 0; padding: 12px 14px; border: 1px solid; border-radius: 10px; }
.olr-note p { margin: 0; }
.olr-note p + p { margin-top: 8px; }
.olr-note-warn { background: var(--olr-warn-bg); border-color: var(--olr-warn-line); color: var(--olr-warn-ink); }
.olr-note-info { background: var(--olr-info-bg); border-color: var(--olr-info-line); color: var(--olr-info-ink); }

.olr-contact { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.olr-contact-label { color: var(--olr-soft); font-size: 13px; }
.olr-contact-name { font-weight: 700; }
.olr-contact-phone { color: var(--olr-main); font-weight: 600; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }

.olr-hints { margin: 16px 0 0; padding: 0 0 0 20px; color: var(--olr-soft); font-size: 15px; }
.olr-hints li + li { margin-top: 4px; }

.olr-help { margin-top: 20px; border-top: 1px solid var(--olr-line); padding-top: 14px; }
.olr-help summary { cursor: pointer; color: var(--olr-main); font-weight: 600; min-height: 32px; }
.olr-help p { margin: 10px 0; color: var(--olr-soft); }
.olr-help img { display: block; width: 100%; height: auto; border: 1px solid var(--olr-line); border-radius: 8px; }

/* ── the opened report ──────────────────────────────────────────────────── */
.olr-viewer { padding-bottom: 96px; }
.olr-viewhead { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; }
.olr-viewhead strong { flex: 1 0 100%; font-size: 18px; overflow-wrap: anywhere; }
.olr-viewhead span { color: var(--olr-soft); font-size: 14px; }
.olr-viewer .olr-note { margin-top: 10px; font-size: 15px; }
.olr-pages { margin-top: 12px; }
.olr-page {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 10px;
    background: #fff;
    border: 1px solid var(--olr-line);
    border-radius: 4px;
}
.olr-loading { margin: 32px 0; text-align: center; color: var(--olr-soft); }
.olr-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--olr-line);
}
.olr-bar .olr-btn { max-width: 528px; margin: 0 auto; }

@media (min-width: 700px) {
    .olr-main { max-width: 860px; padding: 28px 24px; }
    .olr-main > .olr-card { max-width: 520px; margin: 24px auto 0; padding: 28px; }
    .olr-top { padding: 14px 28px; }
}

@media (prefers-reduced-motion: no-preference) {
    .olr-btn, .olr-lang { transition: background-color .15s ease, border-color .15s ease; }
}
