/* Heart Check portal. Plain, dense enough for clinic staff, and never relying on colour alone for a result. */
:root {
    --ink: #17202b;
    --muted: #566170;
    --line: #d3d9e1;
    --panel: #ffffff;
    --page: #f3f5f8;
    --accent: #0b4f9e;
    --header: #10243e;
}

html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--page);
    color: var(--ink);
}

a, .btn-link { color: var(--accent); }
.btn-primary { background-color: var(--accent); border-color: var(--accent); }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus, a:focus-visible {
    outline: 3px solid #258cfb;
    outline-offset: 2px;
    box-shadow: none;
}
h1:focus { outline: none; }
h1 { font-size: 1.7rem; margin: 0 0 1rem; }
h1 small { font-size: 1rem; margin-left: .5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }

.portal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    padding: .6rem 1.25rem;
    background: var(--header);
    color: #fff;
}
.portal-header .brand { color: #fff; font-weight: 700; text-decoration: none; }
.portal-header .clinic { font-weight: 700; padding: .15rem .6rem; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; }
.portal-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; flex: 1; }
.portal-header nav a { color: #dbe6f5; text-decoration: none; padding: .15rem 0; border-bottom: 2px solid transparent; }
.portal-header nav a.active { color: #fff; border-bottom-color: #fff; }
.portal-header .who { color: #dbe6f5; font-size: .9rem; }
.portal-header form { margin: 0; }

.research-banner {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff1cc;
    color: #3d2c00;
    border-bottom: 1px solid #e0c36a;
    padding: .35rem 1.25rem;
    font-weight: 600;
    font-size: .92rem;
}

.portal-main { max-width: 1180px; margin: 0 auto; padding: 1.25rem; }
.portal-main section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.signin { max-width: 420px; margin: 3rem auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0; }
.toolbar input[type=search] { max-width: 360px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem 1rem; margin-bottom: .75rem; }
.form-grid label, label.d-block { font-weight: 600; font-size: .92rem; }
/* The boxes of one line of a form stand in a row, whatever is above or below them. Each label is three
   rows of the form's own grid: its words (which may wrap), its box, and a note under the box if it has one.
   Before 1 Dec 2026 every box sat at the bottom of its cell, so a note under one box pushed that box above
   its neighbours (the emergency number on the platform's clinics page). */
.form-grid label { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-items: end; }
.form-grid label > .form-text { align-self: start; }
.form-grid label > .form-control, .form-grid label > .form-select, label.d-block > .form-control { margin-top: .25rem; font-weight: 400; }
.form-text { display: block; font-weight: 400; }

.table { background: var(--panel); }
.table th { font-size: .85rem; color: var(--muted); font-weight: 600; }

/* Results: the word carries the meaning; the mark in front is a second cue, not the only one. */
.outcome { font-weight: 700; white-space: nowrap; }
.outcome::before { display: inline-block; width: 1.15em; font-weight: 700; }
.outcome-steady::before { content: "\2713"; }
.outcome-uneven::before { content: "\25B2"; }
.outcome-noclearreading::before { content: "?"; }
.outcome-none { font-weight: 400; color: var(--muted); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }

.setup-code { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
.setup-code .qr svg { width: 200px; height: 200px; display: block; }
.setup-code .code { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; margin: 0 0 .25rem; }
.review { border-left: 3px solid var(--line); padding: .25rem .75rem; margin-bottom: .75rem; }
.review p { margin: .25rem 0 0; }

/* Recording viewer. Text wears text inks; only the marks carry colour. */
.viewer { color: #191919; }
.viewer-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.viewer-choice { display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; color: #666666; margin: 0; }
.viewer-choice select { width: auto; }
.viewer-frame { position: relative; width: 100%; }
.viewer-canvas { display: block; touch-action: pan-y; cursor: grab; }
.viewer-canvas:active { cursor: grabbing; }
.viewer-canvas:focus-visible, .viewer svg:focus-visible { outline: 3px solid #258cfb; outline-offset: 2px; }
.viewer-tip {
    position: absolute;
    pointer-events: none;
    background: #ffffff;
    border: 1px solid rgba(11, 11, 11, .10);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    padding: .35rem .55rem;
    font-size: .8rem;
    color: #666666;
    max-width: 300px;
    z-index: 5;
}
.viewer-tip strong { display: block; color: #191919; font-size: .95rem; }
.viewer-tip span { display: block; }
.viewer-readout { min-height: 1.4em; margin: .25rem 0 0; font-size: .875rem; color: #666666; }
.viewer-note { font-size: .8rem; color: #666666; margin: .25rem 0 .5rem; }
.viewer-summary { margin: 0 0 .4rem; }
.viewer-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .85rem; color: #666666; margin-bottom: .4rem; }
.viewer-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: .4rem; }
.viewer-table { margin-top: .5rem; }
.viewer-table summary { cursor: pointer; font-size: .875rem; color: #0b4f9e; }
.viewer-table table { font-variant-numeric: tabular-nums; max-width: 760px; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #b3261e; }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: .6rem 1.25rem;
    background: #fff1cc;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }
