/* =========================================================
   ems_stdtest — Medical Tablet
   Theme: nd-factions / New District slate-blue tablet + purple accent
   Mirrors the visual language of the supplied Family Panel UI.
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Slate-blue palette */
    --bg-0: #0a0c14;
    --bg-1: #11141d;
    --bg-2: #181c28;
    --bg-3: #232838;
    --bg-4: #2c3245;

    --tablet-bg: #0a0c14;
    --screen-bg: #0d1019;
    --card-bg:   #161a26;
    --card-bg-2: #1d2231;

    --border:    rgba(255, 255, 255, 0.08);
    --border-2:  rgba(255, 255, 255, 0.16);

    --text:      #e6e9f2;
    --text-dim:  #9aa2b8;
    --text-mute: #5d667e;

    --accent:    #8b5cf6;
    --accent-2:  #a78bfa;
    --accent-d:  #6d28d9;

    --green:  #22c55e;
    --blue:   #38bdf8;
    --orange: #f59e0b;
    --red:    #ef4444;
    --red-2:  #f87171;
    --pink:   #ec4899;

    --radius:    12px;
    --radius-sm: 8px;
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65),
                 0 4px 14px rgba(0, 0, 0, 0.4);

    --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
    width: 100%; height: 100%;
    font-family: var(--font-body);
    color: var(--text);
    background: transparent !important;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
}
#app:not(.hidden) { pointer-events: auto; }
body.hidden, .hidden { display: none !important; }

/* =================== TABLET SHELL =================== */

#app {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    z-index: 10;
    animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.tablet {
    position: relative;
    width: min(1200px, calc(100vw - 40px));
    height: min(820px, calc(100vh - 40px));
    background: var(--tablet-bg);
    border-radius: 28px;
    padding: 18px;
    box-shadow: var(--shadow-lg),
                inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: tablet-in 0.06s ease-out;
}
@keyframes tablet-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bezel-speaker {
    position: absolute;
    top: 9px; left: 50%; transform: translateX(-50%);
    width: 44px; height: 3px; border-radius: 2px;
    background: #1f2330;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.bezel-camera {
    position: absolute;
    top: 10px; left: calc(50% + 38px);
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #0a0c14;
    box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.2);
}
.bezel-home {
    position: absolute;
    bottom: 6px; left: 50%; transform: translateX(-50%);
    width: 80px; height: 3px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.screen {
    width: 100%; height: 100%;
    background: var(--screen-bg);
    border-radius: 16px;
    overflow: hidden;
    display: flex; flex-direction: column;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* Status bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    font-family: var(--font-display);
}
.status-battery { display: inline-flex; align-items: center; gap: 6px; }
.status-battery i.fa-solid { font-size: 12px; color: var(--blue); }

.panel {
    flex: 1;
    background: transparent;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: slide .25s ease-out;
    min-height: 0;
}

/* =================== HEADER =================== */

.panel-header {
    padding: 14px 22px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    position: relative; z-index: 2;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon {
    width: 36px; height: 36px; border-radius: 9px;
    background: var(--card-bg-2);
    border: 1px solid var(--border);
    color: var(--accent-2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-icon i { font-size: 16px; }
.brand-text { min-width: 0; }
.brand-title {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600;
    color: var(--text); line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-title .accent { color: var(--accent-2); }
.brand-sub {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#brand-section { color: var(--accent-2); font-weight: 500; }

.mode-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 3px 8px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .08em;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    vertical-align: middle;
    text-transform: uppercase;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    width: 240px;
    transition: border-color .15s, background .15s;
}
.search-box:focus-within {
    border-color: var(--accent-2);
    background: var(--card-bg-2);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.search-box i.fa-magnifying-glass { font-size: 12px; color: var(--text-mute); }
.search-box input {
    background: transparent; border: 0; outline: 0;
    color: var(--text); font-size: 13px; flex: 1;
    font-family: var(--font-body);
}
.search-box input::placeholder { color: var(--text-mute); }
.search-box.light { width: 100%; max-width: 360px; }

.icon-btn {
    width: 36px; height: 36px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.icon-btn i.fa-solid { font-size: 15px; }
.icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); border-color: var(--border); }
.icon-btn.close:hover { background: rgba(239,68,68,0.10); color: var(--red-2); border-color: rgba(239,68,68,0.35); }

/* =================== BODY LAYOUT =================== */

.panel-body { flex: 1; display: flex; min-height: 0; }

.sidebar {
    width: 220px; flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.20);
    padding: 18px 14px;
    display: flex; flex-direction: column; gap: 3px;
    overflow-y: auto;
}
.nav-label {
    font-family: var(--font-display);
    font-size: 10px; font-weight: 600; letter-spacing: .08em;
    color: var(--text-mute);
    text-transform: uppercase;
    padding: 0 10px 12px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    width: 100%; padding: 10px 12px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    text-align: left; cursor: pointer;
    border-radius: 8px;
    transition: background .15s, color .15s, border-color .15s;
    position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-item.active {
    background: var(--card-bg-2);
    color: var(--text);
    border-color: var(--border-2);
}
.nav-item.active .nav-icon i { color: var(--accent-2); }
.nav-icon { display: flex; flex-shrink: 0; width: 16px; justify-content: center; }
.nav-icon i { font-size: 14px; transition: color .15s; }
.nav-pill {
    margin-left: auto;
    background: rgba(139,92,246,0.18);
    color: var(--accent-2);
    font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
    min-width: 22px; text-align: center;
}

/* =================== CONTENT =================== */

.content {
    flex: 1; min-width: 0;
    padding: 24px 28px;
    overflow-y: auto;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 4px; }
.content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }

.section { display: none; animation: slide .2s ease-out; }
.section.active { display: block; }

.section-head { margin-bottom: 20px; }
.section-head h2 {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    color: var(--text);
}
.section-head p {
    color: var(--text-mute);
    font-size: 12px;
    margin-top: 4px;
}

/* =================== STAT CARDS =================== */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between;
    transition: border-color .15s, transform .15s;
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.stat-label { font-size: 11px; color: var(--text-mute); letter-spacing: .03em; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; }
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.stat-icon i { font-size: 16px; }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-2); }
.icon-blue   { background: rgba(56, 189, 248, 0.15);  color: var(--blue); }
.icon-green  { background: rgba(34, 197, 94, 0.15);  color: var(--green); }
.icon-orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); }

/* =================== CARDS =================== */

.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.card-icon {
    width: 38px; height: 38px;
    background: rgba(139,92,246,0.15);
    color: var(--accent-2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.card-icon i { font-size: 16px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.about-list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-dim); }
.about-list strong { color: var(--text); margin-right: 6px; }

/* =================== LISTS (samples / mytests / lookup) =================== */

.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
    transition: all .15s;
}
.lb-row:hover { background: rgba(139,92,246,0.05); border-color: rgba(139,92,246,0.2); }
.lb-rank {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    background: rgba(255,255,255,0.05);
    color: var(--accent-2);
}
.lb-name { font-weight: 600; font-size: 14px; }
.lb-meta { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.lb-meta .pid { font-family: ui-monospace, monospace; }

.status-pill {
    display: inline-block;
    font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 4px;
    letter-spacing: .05em;
}
.status-pill.drawn       { background: rgba(56,189,248,0.15);  color: var(--blue); }
.status-pill.testing     { background: rgba(245,158,11,0.15); color: var(--orange); }
.status-pill.completed   { background: rgba(34,197,94,0.15);  color: var(--green); }
.status-pill.notified    { background: rgba(139,92,246,0.15); color: var(--accent-2); }
.status-pill.paused      { background: rgba(245,158,11,0.18); color: var(--orange); border: 1px solid rgba(245,158,11,0.35); }
.status-pill.delivered   { background: rgba(255,255,255,0.05); color: var(--text-mute); }
.status-pill.positive    { background: rgba(239,68,68,0.18);  color: var(--red-2); }
.status-pill.negative    { background: rgba(34,197,94,0.15);  color: var(--green); }
.status-pill.inconclusive{ background: rgba(245,158,11,0.15); color: var(--orange); }

/* =================== BUTTONS =================== */

.btn {
    padding: 9px 16px; border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text); font-size: 13px; font-weight: 500;
    border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background .15s, border-color .15s, color .15s;
    font-family: var(--font-body);
}
.btn:hover { background: var(--card-bg-2); border-color: var(--border-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn i { font-size: 12px; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--red-2);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.30);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fff;
}
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* =================== EMPTY / TOASTS =================== */

.empty-state {
    padding: 60px 20px; text-align: center;
    color: var(--text-mute); font-size: 14px;
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius);
}

.toast-stack {
    position: fixed; bottom: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 9999; pointer-events: none;
}
.toast {
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--accent);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 8px; min-width: 240px; max-width: 360px;
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.fade-out { animation: toast-out .25s ease-out forwards; }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateX(20px); opacity: 0; } }

/* =================== MODALS =================== */

.modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    animation: fade .15s ease-out;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-window {
    position: relative;
    width: min(820px, 90vw); max-height: 86vh;
    background: var(--card-bg);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    animation: slide .2s ease-out;
}
.mg-window { width: min(900px, 92vw); }
.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-title i { color: var(--accent-2); }
.modal-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.modal-body { padding: 22px 24px; overflow-y: auto; }

/* =================== RESULTS ENTRY =================== */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
}
.result-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
}
.result-name { font-weight: 600; font-size: 14px; }
.result-pick {
    padding: 6px 10px; border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-dim);
    font-size: 12px; font-weight: 600;
    border-radius: 6px; cursor: pointer;
    transition: all .15s;
}
.result-pick:hover { color: var(--text); border-color: var(--border-2); }
.result-pick.active.negative      { background: rgba(34,197,94,0.18);  color: var(--green); border-color: rgba(34,197,94,0.5); }
.result-pick.active.positive      { background: rgba(239,68,68,0.18);  color: var(--red-2); border-color: rgba(239,68,68,0.5); }
.result-pick.active.inconclusive  { background: rgba(245,158,11,0.18); color: var(--orange); border-color: rgba(245,158,11,0.5); }

.results-notes { margin: 14px 0 18px; }
.results-notes label { display: block; font-size: 12px; color: var(--text-mute); margin-bottom: 6px; letter-spacing: .04em; }
.results-notes textarea {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text); font-size: 13px; resize: vertical;
    font-family: inherit;
}
.results-notes textarea:focus { outline: 0; border-color: var(--accent); background: rgba(139,92,246,0.05); }
.results-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* =================== PATIENT VIEW =================== */
.patient-result-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}
.patient-result-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.patient-result-head .doc-line { font-size: 13px; color: var(--text-dim); }
.patient-result-head .doc-line strong { color: var(--text); }
.patient-result-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.patient-result-grid .row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.025);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
}
.patient-result-notes {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(139,92,246,0.06);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 8px;
    font-size: 12px; color: var(--text-dim);
    font-style: italic;
}
.patient-result-foot {
    display: flex; justify-content: flex-end; margin-top: 12px;
}

/* =================== MINIGAME =================== */

.mg-steps {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}
.mg-step {
    padding: 8px 6px;
    text-align: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 11px;
    color: var(--text-mute);
    transition: all .2s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.mg-step i { font-size: 14px; }
.mg-step.active {
    background: rgba(139,92,246,0.10);
    border-color: rgba(139,92,246,0.5);
    color: var(--accent-2);
    box-shadow: 0 0 0 2px rgba(139,92,246,0.15);
}
.mg-step.done {
    background: rgba(34,197,94,0.10);
    border-color: rgba(34,197,94,0.4);
    color: var(--green);
}
.mg-step.failed {
    background: rgba(239,68,68,0.10);
    border-color: rgba(239,68,68,0.4);
    color: var(--red-2);
}

.mg-stage {
    min-height: 340px;
    background: rgba(0,0,0,0.20);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.mg-instruction {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 18px;
    padding: 10px 14px;
    background: rgba(139,92,246,0.06);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
}

.mg-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.mg-timer {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--text-dim);
    font-family: ui-monospace, monospace;
}
.mg-timer i { color: var(--accent-2); }
.mg-actions { display: flex; gap: 10px; }

/* --- Step 1: gloves --- */
.gloves-scene {
    display: flex; justify-content: center; gap: 60px;
    margin-top: 30px;
}
.glove {
    width: 100px; height: 130px;
    background: linear-gradient(180deg, #2c3245, #1d2231);
    border: 2px solid var(--border-2);
    border-radius: 16px 16px 30px 30px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-mute);
    font-size: 13px; font-weight: 600;
    transition: all .2s;
    position: relative;
}
.glove::before {
    content: '';
    position: absolute; top: -10px; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 18px;
    background: linear-gradient(180deg, #232838, #181c28);
    border: 2px solid var(--border-2);
    border-radius: 8px;
}
.glove i { font-size: 32px; color: var(--text-mute); }
.glove:hover { border-color: var(--accent-2); color: var(--text); }
.glove.on {
    background: linear-gradient(180deg, rgba(139,92,246,0.25), rgba(139,92,246,0.10));
    border-color: var(--accent);
}
.glove.on i { color: var(--accent-2); }

/* --- Step 2: sanitize --- */
.sanitize-scene {
    margin-top: 12px;
    position: relative;
    height: 280px;
    background: radial-gradient(ellipse at center, rgba(139,92,246,0.06), transparent 70%);
    border: 1px dashed var(--border-2);
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
}
.sanitize-area {
    position: absolute;
    left: 50%; top: 50%;
    width: 220px; height: 160px;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.03);
    border: 2px dashed rgba(139,92,246,0.3);
    border-radius: 10px;
}
.sanitize-swab {
    position: absolute;
    width: 26px; height: 90px;
    background: linear-gradient(180deg, #f1f4ff 0%, #f1f4ff 30%, #5d667e 30%, #5d667e 100%);
    border-radius: 4px;
    transform: translate(-50%, -50%) rotate(15deg);
    pointer-events: none;
    transition: transform .03s linear;
}
.sanitize-progress {
    position: absolute; bottom: 10px; left: 10px; right: 10px;
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
}
.sanitize-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .15s;
}

/* --- Step 3: vial labeling --- */
.label-scene {
    display: flex; gap: 24px; margin-top: 18px;
    align-items: flex-start;
}
.vial-area {
    flex: 1;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    min-height: 240px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.vial {
    width: 60px; height: 130px;
    background: linear-gradient(180deg, rgba(239,68,68,0.3), rgba(239,68,68,0.7));
    border: 2px solid var(--border-2);
    border-radius: 4px 4px 12px 12px;
    position: relative;
    cursor: grab;
}
.vial::before {
    content: '';
    position: absolute; top: -10px; left: -4px; right: -4px;
    height: 14px;
    background: #4a5060;
    border: 2px solid var(--border-2);
    border-radius: 3px;
}
.vial-label-applied {
    position: absolute;
    top: 30px; left: -6px; right: -6px;
    background: #fff; color: #000;
    text-align: center;
    font-size: 8px; font-weight: 700;
    padding: 4px 2px;
    border-radius: 2px;
    font-family: ui-monospace, monospace;
}
.label-options {
    flex: 1;
    display: flex; flex-direction: column; gap: 8px;
}
.label-option {
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: ui-monospace, monospace;
    transition: all .15s;
}
.label-option:hover { background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.3); }
.label-option.correct { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.5); color: var(--green); }
.label-option.wrong   { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.5); color: var(--red-2); }

/* --- Step 4: centrifuge --- */
.centrifuge-scene {
    display: flex; flex-direction: column; align-items: center; gap: 18px;
    margin-top: 10px;
}
.centrifuge-dial {
    position: relative;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        var(--red) 0deg 60deg,
        var(--orange) 60deg 110deg,
        var(--green) 110deg 250deg,
        var(--orange) 250deg 300deg,
        var(--red) 300deg 360deg
    );
    border: 4px solid var(--border-2);
    box-shadow: inset 0 0 0 12px var(--bg-2),
                0 0 0 4px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
}
.centrifuge-needle {
    position: absolute;
    top: 50%; left: 50%;
    width: 4px; height: 96px;
    background: linear-gradient(180deg, var(--accent-2), var(--text));
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(-90deg);
    transition: transform .08s linear;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(139,92,246,0.6);
}
.centrifuge-pivot {
    position: absolute;
    width: 16px; height: 16px;
    background: var(--text);
    border-radius: 50%;
    z-index: 2;
}
.centrifuge-readout {
    font-family: ui-monospace, monospace;
    font-size: 14px;
    color: var(--text);
}
.centrifuge-readout .target { color: var(--accent-2); font-weight: 700; }
.centrifuge-bar {
    width: 320px; height: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.centrifuge-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .1s;
}
.centrifuge-controls {
    display: flex; gap: 12px;
}
.centrifuge-btn {
    width: 60px; height: 60px;
    border-radius: 12px;
    background: var(--card-bg-2);
    border: 2px solid var(--border-2);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    transition: all .1s;
    user-select: none;
    display: flex; align-items: center; justify-content: center;
}
.centrifuge-btn:hover { border-color: var(--accent); }
.centrifuge-btn:active, .centrifuge-btn.held {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: scale(0.95);
}

/* --- Step 5: reagents --- */
.reagent-scene {
    display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
    margin-top: 12px;
}
.reagent-shelf, .well-tray {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    min-height: 240px;
}
.reagent-shelf-title, .well-tray-title {
    font-size: 11px; color: var(--text-mute); letter-spacing: .08em;
    text-transform: uppercase; margin-bottom: 12px;
    text-align: center;
}
.reagent-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reagent {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    color: #fff;
    box-shadow: inset 0 -8px 0 rgba(0,0,0,0.25);
    border: 2px solid rgba(255,255,255,0.15);
    transition: transform .1s, box-shadow .15s;
    user-select: none;
}
.reagent.r-red    { background: linear-gradient(180deg, #f87171, #ef4444); }
.reagent.r-blue   { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.reagent.r-green  { background: linear-gradient(180deg, #4ade80, #16a34a); }
.reagent.r-purple { background: linear-gradient(180deg, #c084fc, #9333ea); }
.reagent.r-amber  { background: linear-gradient(180deg, #fbbf24, #d97706); }
.reagent.r-pink   { background: linear-gradient(180deg, #f9a8d4, #ec4899); }
.reagent.used { opacity: 0.3; cursor: not-allowed; }
.reagent:hover:not(.used) { transform: scale(1.06); }
.reagent.selected {
    transform: scale(1.08);
    box-shadow:
        0 0 0 3px var(--accent-2),
        0 0 18px rgba(167, 139, 250, 0.55),
        inset 0 -8px 0 rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.55);
}

.well-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.well {
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(ellipse at top, rgba(255,255,255,0.10), rgba(0,0,0,0.40));
    border: 2px solid var(--border-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    color: var(--text-mute);
    transition: all .15s;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    user-select: none;
}
.well-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: break-word;
}
.well-code {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-2);
    opacity: 0.85;
    letter-spacing: 0.04em;
    text-transform: lowercase;
}
.well.target { border-color: rgba(139,92,246,0.5); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.well.armed  {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.30), 0 0 22px rgba(139,92,246,0.20);
    transform: scale(1.03);
}
.well.armed:hover { transform: scale(1.06); }
.well.correct { background: radial-gradient(ellipse at top, rgba(34,197,94,0.45), rgba(34,197,94,0.15)); border-color: var(--green); color: #fff; cursor: default; }
.well.correct .well-name, .well.correct .well-code { color: #fff; }
.well.wrong   { background: radial-gradient(ellipse at top, rgba(239,68,68,0.45), rgba(239,68,68,0.15)); border-color: var(--red); color: #fff; animation: shake .25s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* --- Step 6: read & verify --- */
.sequence-scene {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    margin-top: 8px;
}
.sequence-instruction {
    font-size: 13px; color: var(--text-dim); text-align: center;
}
.sequence-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.sequence-btn {
    width: 84px; height: 84px;
    border-radius: 12px;
    background: var(--card-bg-2);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    color: var(--text-dim);
    transition: all .12s;
    user-select: none;
}
.sequence-btn:hover { border-color: var(--accent); }
.sequence-btn.flash {
    background: var(--accent);
    border-color: var(--accent-2);
    color: #fff;
    box-shadow: 0 0 18px rgba(139,92,246,0.7);
}
.sequence-btn.correct {
    background: rgba(34,197,94,0.15);
    border-color: var(--green);
    color: var(--green);
}
.sequence-btn.wrong {
    background: rgba(239,68,68,0.18);
    border-color: var(--red);
    color: var(--red-2);
    animation: shake .25s;
}
.sequence-progress {
    display: flex; gap: 6px;
}
.sequence-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
    border: 1px solid var(--border-2);
}
.sequence-dot.lit { background: var(--accent); border-color: var(--accent-2); }

/* =================== COMPLETION SCREEN =================== */
.mg-complete {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    text-align: center; padding: 30px 20px;
}
.mg-complete-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(34,197,94,0.15);
    color: var(--green);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
}
.mg-complete h3 { font-size: 20px; }
.mg-complete p  { font-size: 13px; color: var(--text-dim); max-width: 460px; }

/* =================== SCROLLBARS =================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* =================== RESPONSIVE =================== */
@media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .reagent-scene { grid-template-columns: 1fr; }
    .label-scene { flex-direction: column; }
}

/* =================== v2: TEST REQUEST VIEW =================== */
.active-request {
    background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(167,139,250,0.06));
    border: 1px solid rgba(139,92,246,0.35);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.active-request.hidden { display: none; }

.ar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ar-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: rgba(139,92,246,0.25); color: var(--accent-2);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ar-info { flex: 1; }
.ar-title { font-weight: 600; font-size: 14px; color: var(--text); }
.ar-sub   { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.ar-progress {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.ar-progress-step {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    transition: all 0.2s ease;
}
.ar-progress-step i { display: block; margin-bottom: 4px; font-size: 13px; }
.ar-progress-step.active {
    background: rgba(139,92,246,0.22);
    border-color: var(--accent);
    color: var(--text);
}
.ar-progress-step.done {
    background: rgba(34,197,94,0.16);
    border-color: rgba(34,197,94,0.4);
    color: var(--green, #22c55e);
}

.nearby-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 4px; margin-bottom: 8px;
    color: var(--text-dim);
}
.nearby-label { font-size: 13px; font-weight: 600; color: var(--text); }
.nearby-label i { color: var(--accent-2); margin-right: 6px; }
.nearby-meta  { font-size: 11px; }

/* nearby row */
.nearby-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-bottom: 6px;
    transition: background 0.15s;
}
.nearby-row:hover { background: rgba(255,255,255,0.04); }
.nearby-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(139,92,246,0.2); color: var(--accent-2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.nearby-info { flex: 1; }
.nearby-name { font-size: 13px; font-weight: 600; color: var(--text); }
.nearby-meta-sub {
    font-size: 11px; color: var(--text-dim); display: flex; gap: 10px; margin-top: 2px;
}

/* =================== v2: PAPERWORK MODAL ADDITIONS =================== */
.paperwork-section { margin-bottom: 16px; }
.paperwork-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-dim);
    margin-bottom: 8px;
}
.paperwork-label i { color: var(--accent-2); font-size: 12px; }
.paperwork-section textarea {
    width: 100%; resize: vertical;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text); font-family: inherit; font-size: 13px;
    transition: border 0.15s;
}
.paperwork-section textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0,0,0,0.32);
}

/* =================== PATIENT CONSENT POPUP =================== */
/* Lives outside #app so it can render when the tablet is closed.
   Important: this rule is more specific than `body.hidden, .hidden`
   so the popup still shows even with body.hidden set. */
.consent-popup {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #e8e9f2;
    /* No backdrop dim — player can see the game world behind the popup.
       Only the card itself captures the cursor (set on .consent-card). */
    pointer-events: none;
    animation: consent-fade-in 0.18s ease-out;
}
.consent-popup.hidden { display: none !important; }

/* Transparent backdrop — kept as a layout element only.
   No darkening, no blur — the game stays fully visible. */
.consent-backdrop {
    position: absolute; inset: 0;
    background: transparent;
    pointer-events: none;
}

.consent-card {
    position: relative;
    width: min(440px, 92vw);
    background: linear-gradient(160deg, #1a1f2e 0%, #131724 100%);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 18px;
    /* Stronger shadow / outer glow so the card stands out without a backdrop dim */
    box-shadow:
        0 30px 60px -20px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 60px -10px rgba(139, 92, 246, 0.35);
    padding: 26px 26px 18px;
    text-align: center;
    /* Re-enable pointer events on the card itself (parent has it off so the
       transparent area outside the card doesn't eat clicks). */
    pointer-events: auto;
    animation: consent-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes consent-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes consent-pop {
    0%   { transform: scale(0.94) translateY(8px); opacity: 0; }
    100% { transform: scale(1)    translateY(0);   opacity: 1; }
}

.consent-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139,92,246,0.30), rgba(167,139,250,0.10));
    border: 1px solid rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
    margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    box-shadow: 0 0 32px rgba(139, 92, 246, 0.25);
}

.consent-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a78bfa;
    margin-bottom: 6px;
}
.consent-title {
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.consent-body {
    font-size: 13.5px;
    line-height: 1.55;
    color: #b4b8c9;
    margin-bottom: 22px;
    padding: 0 8px;
}
.consent-body strong { color: #e8e9f2; }

.consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}
.consent-btn {
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.consent-btn i { font-size: 12px; }
.consent-decline {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.28);
}
.consent-decline:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fecaca;
    transform: translateY(-1px);
}
.consent-accept {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
}
.consent-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(34, 197, 94, 0.4);
}

.consent-timer {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.consent-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
    width: 100%;
    transition: width 0.2s linear;
}
.consent-meta {
    font-size: 11px;
    color: #6f7484;
    letter-spacing: 0.02em;
}
.consent-meta span { color: #a78bfa; font-weight: 600; }

/* =================== v3: PANEL CARDS IN LAB QUEUE =================== */
.labqueue-row {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}
.labqueue-row-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.panel-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.panel-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px;
    transition: border .15s, background .15s;
}
.panel-card.panel-pending     { border-color: rgba(255,255,255,0.08); }
.panel-card.panel-running     { border-color: rgba(139,92,246,0.45); background: rgba(139,92,246,0.06); }
.panel-card.panel-incubating  { border-color: rgba(245,158,11,0.4);  background: rgba(245,158,11,0.06); }
.panel-card.panel-ready       { border-color: rgba(34,197,94,0.45);  background: rgba(34,197,94,0.06); }
.panel-card-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.panel-card-head > i {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(139,92,246,0.18);
    color: var(--accent-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
}
.panel-card-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.panel-status-pill {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 3px 7px; border-radius: 6px;
}
.panel-status-pill.pending    { background: rgba(255,255,255,0.07); color: var(--text-mute); }
.panel-status-pill.running    { background: rgba(139,92,246,0.22); color: var(--accent-2); }
.panel-status-pill.incubating { background: rgba(245,158,11,0.22); color: var(--orange); }
.panel-status-pill.ready      { background: rgba(34,197,94,0.22);  color: var(--green); }
.panel-card-body {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.panel-diseases { font-size: 11px; color: var(--text-dim); }
.panel-action { display: flex; align-items: center; }
.panel-countdown {
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 14px; font-weight: 700;
    color: var(--orange);
    background: rgba(245,158,11,0.12);
    padding: 4px 8px; border-radius: 6px;
    border: 1px solid rgba(245,158,11,0.3);
    transition: color .2s, background .2s;
}
.panel-countdown.ready { color: var(--green); background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.4); }
.panel-ready-badge {
    font-size: 11px; font-weight: 700; color: var(--green);
    display: inline-flex; align-items: center; gap: 4px;
}
.panel-running-badge { color: var(--accent-2); font-size: 13px; }
.btn.btn-xs {
    padding: 5px 10px; font-size: 11px;
}

/* =================== v3: TO SEND LIST =================== */
.tosend-row {
    background: var(--card-bg);
    border: 1px solid rgba(245,158,11,0.20);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.tosend-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.tosend-actions { display: flex; gap: 8px; }
.tosend-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.result-chip {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px; border-radius: 6px;
}
.result-chip.positive     { background: rgba(239,68,68,0.18);  color: var(--red); }
.result-chip.negative     { background: rgba(34,197,94,0.15);  color: var(--green); }
.result-chip.inconclusive { background: rgba(255,255,255,0.06); color: var(--text-mute); }

/* =================== v3: READ-ONLY RESULTS ROW =================== */
.result-row.result-readonly {
    grid-template-columns: 1fr auto;
}
.result-readonly-pill {
    font-size: 13px; font-weight: 600;
    padding: 8px 14px; border-radius: 8px;
    display: inline-flex; align-items: center; gap: 8px;
}
.result-readonly-pill.positive     { background: rgba(239,68,68,0.20);  color: var(--red); }
.result-readonly-pill.negative     { background: rgba(34,197,94,0.18);  color: var(--green); }
.result-readonly-pill.inconclusive { background: rgba(255,255,255,0.06); color: var(--text-mute); }

/* =================== v3: CURRENT APPOINTMENT SECTION =================== */
.nav-pill-live {
    background: rgba(34,197,94,0.2) !important;
    color: var(--green) !important;
    animation: nav-pulse 1.6s ease-in-out infinite;
}
@keyframes nav-pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.appointment-card {
    background: var(--card-bg);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 16px;
    padding: 20px;
}

/* Header */
.appt-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.appt-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(167,139,250,0.12));
    border: 1px solid rgba(139,92,246,0.5);
    color: #c4b5fd;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700;
}
.appt-id { flex: 1; }
.appt-name { font-size: 17px; font-weight: 700; color: var(--text); }
.appt-sub  { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

/* Stepper */
.appt-stepper {
    display: flex; align-items: flex-start;
    margin-bottom: 20px;
}
.appt-step {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; flex: 0 0 auto; width: 84px;
    text-align: center;
}
.appt-step-dot {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.10);
    color: var(--text-mute);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: all .25s;
}
.appt-step-label { font-size: 10.5px; font-weight: 600; color: var(--text-mute); line-height: 1.25; }
.appt-step.active .appt-step-dot {
    background: rgba(139,92,246,0.22);
    border-color: var(--accent);
    color: var(--accent-2);
    box-shadow: 0 0 16px rgba(139,92,246,0.4);
}
.appt-step.active .appt-step-label { color: var(--text); }
.appt-step.done .appt-step-dot {
    background: rgba(34,197,94,0.18);
    border-color: var(--green);
    color: var(--green);
}
.appt-step.done .appt-step-label { color: var(--text-dim); }
.appt-step-line {
    flex: 1; height: 2px; margin-top: 18px;
    background: rgba(255,255,255,0.10);
    transition: background .25s;
    min-width: 12px;
}
.appt-step-line.done { background: var(--green); }

/* Blocks */
.appt-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.appt-block-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-dim);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
.appt-block-title i { color: var(--accent-2); }

/* Sample dots */
.appt-samples-row { display: flex; gap: 12px; }
.appt-sample-dot {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 12px 8px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: var(--text-mute);
    font-size: 11px; font-weight: 600;
    transition: all .2s;
}
.appt-sample-dot i { font-size: 16px; }
.appt-sample-dot.filled {
    background: rgba(34,197,94,0.14);
    border-color: rgba(34,197,94,0.4);
    color: var(--green);
}

/* Panels */
.appt-panels { display: flex; flex-direction: column; gap: 8px; }
.appt-panel {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px;
    padding: 10px 12px;
}
.appt-panel > i:first-child {
    width: 26px; height: 26px; border-radius: 7px;
    background: rgba(139,92,246,0.16); color: var(--accent-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
}
.appt-panel-name { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--text); }
.appt-panel-status {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-mute);
}
.appt-panel.appt-panel-running    { border-color: rgba(139,92,246,0.4); }
.appt-panel.appt-panel-running    .appt-panel-status { color: var(--accent-2); }
.appt-panel.appt-panel-incubating { border-color: rgba(245,158,11,0.35); }
.appt-panel.appt-panel-incubating .appt-panel-status { color: var(--orange); }
.appt-panel.appt-panel-ready      { border-color: rgba(34,197,94,0.4); }
.appt-panel.appt-panel-ready      .appt-panel-status { color: var(--green); }
.appt-panel-countdown {
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 13px; font-weight: 700; color: var(--orange);
    background: rgba(245,158,11,0.12);
    padding: 3px 8px; border-radius: 6px;
}
.appt-panel-countdown.ready { color: var(--green); background: rgba(34,197,94,0.15); }
.appt-panel-ready   { color: var(--green); font-size: 13px; }
.appt-panel-running { color: var(--accent-2); font-size: 12px; }
.appt-panel-pending { color: var(--text-mute); font-size: 12px; }

/* Action */
.appt-action { margin-top: 4px; }
.appt-action:empty { display: none; }

/* =================== v3: DISEASE PREVALENCE CHART =================== */
.disease-chart { padding: 4px 2px; }
.dc-meta {
    font-size: 12px; color: var(--text-dim);
    margin-bottom: 14px;
}
.dc-meta strong { color: var(--text); }
.dc-bars { display: flex; flex-direction: column; gap: 10px; }
.dc-row { display: flex; align-items: center; gap: 12px; }
.dc-label {
    width: 110px; flex: 0 0 110px;
    font-size: 12.5px; font-weight: 600; color: var(--text);
    text-align: right;
}
.dc-track {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    height: 28px;
    overflow: hidden;
    position: relative;
}
.dc-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 10px;
    min-width: 28px;
    transition: width .5s cubic-bezier(.4,1.4,.5,1);
    box-shadow: 0 0 12px rgba(139,92,246,0.3);
}
.dc-bar-empty {
    background: transparent;
    box-shadow: none;
    justify-content: flex-start;
    padding-left: 4px;
    min-width: 0;
}
.dc-count {
    font-size: 12px; font-weight: 700; color: #fff;
}
.dc-bar-empty .dc-count { color: var(--text-mute); }
