:root {
    --navy: #0b2545;
    --navy-2: #13315c;
    --red: #d00000;
    --text: #1b1f27;
    --muted: #5b6574;
    --line: #d5dbe3;
    --paper: #f7f9fb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #fff;
    color: var(--text);
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- TARJA ALERTA (fixa + piscando) ---------- */
.alarm {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--red);
    color: #fff;
    text-align: center;
    font: 700 15px/1 'IBM Plex Sans', sans-serif;
    letter-spacing: 3px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: flash 1.2s infinite;
}

.alarm .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes flash {

    0%,
    100% {
        background: var(--red);
    }

    50% {
        background: #8f0000;
    }
}

/* ---------- HEADER CLÍNICO ---------- */
.header {
    background: var(--navy);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inst {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.inst .cross {
    width: 30px;
    height: 30px;
    background: #fff;
    position: relative;
    border-radius: 4px;
    flex-shrink: 0;
}

.inst .cross::before,
.inst .cross::after {
    content: "";
    position: absolute;
    background: var(--navy);
}

.inst .cross::before {
    left: 12px;
    top: 5px;
    width: 6px;
    height: 20px;
}

.inst .cross::after {
    left: 5px;
    top: 12px;
    width: 20px;
    height: 6px;
}

.inst small {
    display: block;
    font-weight: 400;
    font-size: 11px;
    opacity: .75;
    letter-spacing: .5px;
}

.header .ref {
    font: 11px 'IBM Plex Mono', monospace;
    text-align: right;
    opacity: .8;
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ---------- CABEÇALHO DO LAUDO ---------- */
.report-head {
    border: 1px solid var(--line);
    border-top: 5px solid var(--navy);
    background: var(--paper);
    padding: 14px 16px;
    font: 13px/1.6 'IBM Plex Mono', monospace;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    margin-bottom: 24px;
}

.report-head b {
    color: var(--navy);
}

.report-head .status {
    grid-column: 1 / -1;
    color: var(--red);
    font-weight: 600;
}

.doc-type {
    font: 600 12px 'IBM Plex Mono', monospace;
    color: var(--red);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

h1 {
    font-size: 30px;
    line-height: 1.2;
    color: var(--navy);
    margin-bottom: 14px;
}

.lead {
    font-size: 19px;
    color: var(--muted);
    margin-bottom: 26px;
    border-left: 4px solid var(--red);
    padding-left: 14px;
}

.article p {
    margin-bottom: 20px;
}

.article h2 {
    font-size: 22px;
    color: var(--navy);
    margin: 34px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--navy);
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.article h2 .sec {
    font: 600 13px 'IBM Plex Mono', monospace;
    color: var(--red);
}

/* ---------- FOTO MICROSCÓPIO (grande) ---------- */
.micro {
    margin: 28px -16px;
    background: #000;
    position: relative;
}

.micro img {
    width: 100%;
    filter: contrast(1.15) saturate(1.1);
}

.micro .overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    font: 600 11px 'IBM Plex Mono', monospace;
    color: #7fffb0;
    background: rgba(0, 0, 0, .55);
    padding: 4px 8px;
    line-height: 1.5;
}

.micro .scale {
    position: absolute;
    right: 12px;
    bottom: 44px;
    color: #fff;
    font: 11px 'IBM Plex Mono', monospace;
    text-align: center;
}

.micro .scale::before {
    content: "";
    display: block;
    width: 70px;
    height: 3px;
    background: #fff;
    margin-bottom: 3px;
}

.micro .marker {
    position: absolute;
    top: 38%;
    left: 52%;
    width: 18%;
    aspect-ratio: 1;
    border: 2px dashed var(--red);
    border-radius: 50%;
}

.micro .marker::after {
    content: "Befund A";
    position: absolute;
    left: 100%;
    top: -4px;
    white-space: nowrap;
    margin-left: 6px;
    font: 700 11px 'IBM Plex Mono', monospace;
    background: var(--red);
    color: #fff;
    padding: 2px 6px;
}

.fig-cap {
    font: 13px/1.5 'IBM Plex Mono', monospace;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 0;
    padding: 10px 12px;
}

.fig-cap b {
    color: var(--navy);
}

/* ---------- GRÁFICO FIO DESENCAPADO (centralizado) ---------- */
.diagram {
    margin: 30px auto;
    max-width: 560px;
    text-align: center;
    border: 1px solid var(--line);
    background: var(--paper);
    padding: 18px 12px 10px;
}

.diagram svg {
    width: 100%;
    height: auto;
}

.diagram .t {
    font: 600 11px 'IBM Plex Mono', monospace;
}

/* ---------- TABELA DE VALORES ---------- */
table.values {
    width: 100%;
    border-collapse: collapse;
    font: 13px 'IBM Plex Mono', monospace;
    margin: 22px 0;
}

table.values th {
    background: var(--navy);
    color: #fff;
    text-align: left;
    padding: 8px;
    font-weight: 600;
}

table.values td {
    border-bottom: 1px solid var(--line);
    padding: 8px;
}

table.values .bad {
    color: var(--red);
    font-weight: 600;
}

.warning {
    border: 2px solid var(--red);
    background: #fff4f4;
    padding: 16px;
    margin: 26px 0;
    display: flex;
    gap: 12px;
}

.warning .ico {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    padding-top: 8px;
}

.warning b {
    color: var(--red);
}

.cta {
    display: block;
    background: var(--navy);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    padding: 18px;
    border-radius: 4px;
    margin: 30px 0;
    border-bottom: 4px solid var(--red);
}

.cta:hover {
    background: var(--navy-2);
}

.stamp-sig {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px dashed var(--line);
    padding-top: 16px;
    margin-top: 30px;
    font: 12px 'IBM Plex Mono', monospace;
    color: var(--muted);
}

.stamp-sig .stamp {
    border: 2px solid var(--red);
    color: var(--red);
    padding: 6px 10px;
    transform: rotate(-6deg);
    font-weight: 600;
    letter-spacing: 1px;
}

.footer {
    background: var(--navy);
    color: #9fb0c8;
    text-align: center;
    font-size: 12px;
    padding: 22px 16px;
}

@media (min-width: 768px) {
    h1 {
        font-size: 38px;
    }

    .micro {
        margin: 28px 0;
    }
}