:root {
  color-scheme: dark;
  --bg: #6fa89e;
  --panel: rgba(15, 62, 61, .88);
  --panel-solid: #174e4d;
  --line: rgba(5, 48, 48, .35);
  --ink: #173a42;
  --cream: #f5fffc;
  --muted: #c7e6df;
  --gold: #ffd166;
  --mint: #74e0b8;
  --coral: #ff887b;
  --blue: #258fc4;
  --red: #e65350;
  --orange: #ed9b3b;
  --pixel: "Press Start 2P", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --body: "VT323", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --display: var(--pixel);
  --mono: var(--pixel);
  font-family: var(--body);
  font-size: 20px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #5b968d; } }
:root[data-theme="dark"] { --bg: #5b968d; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; background: var(--bg); background-image: linear-gradient(90deg, rgba(255,255,255,.075) 1px, transparent 1px), linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), radial-gradient(circle at 18% 12%, rgba(235,255,250,.32), transparent 28%), linear-gradient(135deg, #75afa4, #5e9c93 46%, #4d8983); background-size: 28px 28px, 28px 28px, auto, auto; color: var(--cream); overflow-x: clip; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, p, dl, dd { margin: 0; }
svg { display: block; }

/* o cenário (fundo) fica em cenario.css */
.topbar { background: linear-gradient(90deg, rgba(12, 58, 58, .94), rgba(27, 91, 85, .9)); border-bottom: 4px solid rgba(5, 45, 45, .52); }
.panel, .zone { border: 1px solid rgba(224, 255, 247, .18); background: linear-gradient(145deg, rgba(24, 83, 81, .94), rgba(12, 58, 59, .92)); box-shadow: 0 7px 0 rgba(7, 49, 48, .28), inset 0 1px 0 rgba(255, 255, 255, .08); }
.topbar, main, .footer { position: relative; z-index: 1; }

.wrap { width: min(1270px, calc(100% - 48px)); margin-inline: auto; }
.topbar { border-bottom: 4px solid rgba(5, 45, 45, .52); }
.topbar-inner, .brand, .top-actions { display: flex; align-items: center; }
.topbar-inner { min-height: 80px; justify-content: space-between; gap: 12px; }
.brand { gap: 12px; }
.brand img { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); image-rendering: pixelated; animation: balanco 4s ease-in-out infinite; }
.brand h1 { font: 400 clamp(16px, 2.6vw, 24px)/1 var(--pixel); text-shadow: 3px 3px 0 rgba(0, 0, 0, .45); }
.brand em { color: var(--gold); font-style: normal; }
.brand span { display: block; margin-top: 8px; color: var(--muted); font: 400 8px var(--pixel); letter-spacing: .08em; text-shadow: 2px 2px 0 rgba(0, 0, 0, .4); }
.top-actions { flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.end-shift-button { border-color: var(--coral); }
.solo { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 400 9px var(--pixel); }
.solo span { width: 8px; height: 8px; background: var(--mint); animation: piscar 1.6s steps(2) infinite; }
@keyframes piscar { 50% { opacity: .25; } }

/* botões chunky */
.quiet, .primary { min-height: 42px; padding: 11px 16px; border: 0; border-radius: 8px; color: #fff; font: 400 10px/1.3 var(--pixel); text-shadow: 2px 2px 0 rgba(0, 0, 0, .3); box-shadow: 0 6px 0 rgba(0, 0, 0, .38); transition: transform .1s, box-shadow .1s, filter .15s; }
.quiet { background: var(--orange); }
.primary { background: var(--blue); }
.quiet:not(:disabled):hover, .primary:not(:disabled):hover { filter: brightness(1.12); }
.quiet:active, .primary:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .38); }
.quiet span { margin-right: 4px; }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 24px; }
.game-shortcuts { display: none; }
.sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.sidebar > .panel { min-width: 0; }
.patient .panel-top { flex-wrap: wrap; }
.panel { padding: 16px; border-radius: 16px; }
.menu-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 34px auto 16px; }
.menu-tabs [role="tab"][aria-selected="true"] { background: var(--panel-solid); box-shadow: inset 0 -3px var(--gold), 0 6px 0 rgba(0, 0, 0, .38); }
.panel.menu { max-width: 540px; margin: 0 auto; padding: clamp(20px, 5vw, 40px); text-align: center; }
.menu h2 { font: 400 clamp(14px, 3vw, 20px)/1.6 var(--pixel); }
.menu p { margin: 12px 0 20px; color: var(--muted); }
.clipboard { max-width: 1120px; margin-inline: auto; padding: clamp(14px, 3vw, 30px); }
.clipboard h2 { margin-top: 6px; font: 400 clamp(16px, 3vw, 24px)/1.5 var(--pixel); }
.clipboard > p { margin-top: 8px; color: var(--muted); }
.review-case { margin-top: 12px; padding: 12px; border: 1px solid rgba(224, 255, 247, .2); border-radius: 9px; background: rgba(7, 41, 42, .6); }
.review-case summary { cursor: pointer; color: var(--cream); }
.review-case summary small { display: block; margin-top: 4px; color: var(--muted); }
.review-retry { margin-top: 12px; }
.decision-scores { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
.decisive-finding { margin-block: 12px; padding: 12px; border-left: 3px solid var(--gold); background: rgba(5, 30, 27, .42); }
.review-list .current-variant { border: 1px solid var(--mint); }
#treatment-evidence { margin-top: 12px; }
#treatment-evidence summary { cursor: pointer; }
.clipboard-group { margin-top: 22px; }
.clipboard-group h3 { margin: 0 0 10px; color: var(--gold); font: 400 10px/1.6 var(--pixel); }
.clipboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.clipboard-combo { padding: 12px; border: 1px solid rgba(224, 255, 247, .2); border-radius: 9px; background: rgba(7, 41, 42, .6); }
.clipboard-combo details { margin-bottom: 8px; }
.clipboard-combo-trigger { width: fit-content; max-width: 100%; padding-block: 4px; color: var(--cream); cursor: pointer; }
.clipboard-combo-trigger::marker { color: var(--gold); }
.clipboard-combo-trigger h4 { display: inline; margin: 0; font-size: 21px; line-height: 1; }
.clipboard-combo-trigger:hover h4, .clipboard-combo-trigger:focus-visible h4 { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }
.clipboard-combo-trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.clipboard-combo-info { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--gold); background: rgba(5, 30, 27, .42); }
.clipboard-combo-info .micro { color: var(--gold); text-transform: uppercase; }
.clipboard-combo-info p { margin-top: 4px; color: var(--muted); line-height: 1.15; }
.clipboard-hand { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; list-style: none; }
.clipboard-card { display: grid; align-content: start; flex: 1 1 78px; min-width: 0; gap: 6px; padding: 6px; border: 2px solid currentColor; border-radius: 6px; background: #fffdf3; color: #164b45; font-size: 16px; line-height: 1; overflow-wrap: anywhere; }
.clipboard-card.anamnese, .clipboard-card.critico { color: #a73530; }
.clipboard-card.laboratorio { color: #85400e; }
.clipboard-card.imagem { color: #2b4675; }
.clipboard-card span { font: 400 10px/1 var(--pixel); }
.panel-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.eyebrow, .micro { font: 400 8px/1.6 var(--pixel); letter-spacing: .04em; }
.eyebrow { color: var(--gold); text-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.micro { color: var(--muted); }
.sidebar h2 { margin-top: 10px; font: 400 15px/1.3 var(--pixel); text-shadow: 2px 2px 0 rgba(0, 0, 0, .4); }
.patient { padding: 10px; background: linear-gradient(145deg, #d8e6e2, #9caeac 42%, #d1dfdb); box-shadow: 0 8px 0 rgba(7, 49, 48, .3), inset 0 1px 0 #fff; }
.patient .panel-top { padding: 4px 5px 8px; }
.patient .eyebrow { color: #254c50; text-shadow: none; }
.patient h2 { margin: 0; color: #1a3338; font-size: 12px; text-shadow: none; }
.monitor-label { margin: 0; color: #9dd7c8; font: 400 14px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; color: #fff; font: 400 8px/1.2 var(--pixel); white-space: nowrap; border-radius: 3px; background: #2f8c75; box-shadow: none; }
.status-chip::before { width: 6px; height: 6px; border-radius: 50%; background: #bfffe7; box-shadow: 0 0 5px #bfffe7; content: ""; }
.status-chip.critical { background: var(--red); animation: pulsar .9s ease-in-out infinite; }
.monitor-screen { position: relative; overflow: hidden; padding: 10px; border: 5px solid #263f43; border-radius: 9px; background: #071d20; box-shadow: inset 0 0 0 2px #526c6c, inset 0 0 22px rgba(51, 248, 192, .12), 0 3px 5px rgba(0, 0, 0, .35); }
.monitor-screen::after { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(128, 255, 224, .025) 0 1px, transparent 1px 4px); content: ""; pointer-events: none; }
.monitor-screen-head { position: relative; z-index: 1; display: grid; gap: 4px; padding-bottom: 7px; border-bottom: 1px solid rgba(117, 222, 195, .35); }
.patient .monitor-screen-head h2 { margin: 0; color: #d5fff3; font-size: 8px; line-height: 1.4; letter-spacing: .02em; text-shadow: 0 0 6px rgba(101, 240, 180, .35); }
.monitor-wave { position: relative; z-index: 1; display: block; width: 100%; height: 46px; margin: 6px 0 2px; color: #63efb3; filter: drop-shadow(0 0 2px #40db9e); }
.monitor-wave { cursor: zoom-in; }
.monitor-wave:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.monitor-screen.critical .monitor-wave { color: #ff625b; filter: drop-shadow(0 0 3px #f3423c); }
.monitor-screen.critical { border-color: #8b2728; box-shadow: inset 0 0 0 2px #ba4a49, inset 0 0 24px rgba(255, 68, 63, .2), 0 3px 5px rgba(0, 0, 0, .35); }
.monitor-screen.critical .monitor-label { color: #ff958c; }
.monitor-screen.critical .vital { border-color: rgba(255, 109, 101, .3); }
@keyframes pulsar { 50% { transform: scale(1.08); } }
@keyframes tremer { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.count-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; background: var(--orange); color: #fff; font: 400 8px/1.2 var(--pixel); white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }

.vitals { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 5px; margin-top: 6px; }
.vital { container-type: inline-size; min-width: 0; padding: 5px 4px 6px; border: 1px solid rgba(118, 228, 201, .2); border-radius: 3px; background: rgba(0, 26, 29, .72); box-shadow: none; }
.vital dt { display: flex; align-items: center; gap: 4px; color: #9dd7c8; font: 400 6px var(--pixel); }
.vital dt::before { width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 5px currentColor; content: ""; }
.vital dd { margin-top: 4px; color: #67f2b7; font: 400 min(16px, 24cqi)/1 var(--pixel); letter-spacing: -.06em; text-shadow: 0 0 7px rgba(101, 240, 180, .45); }
.vital dd small { display: block; margin-top: 3px; color: #9dd7c8; font: 400 12px var(--body); letter-spacing: 0; text-shadow: none; }
.vital-pa dd { color: #ffd269; font-size: min(16px, 14cqi); text-shadow: 0 0 7px rgba(255, 210, 105, .45); }
.vital-fr dd { color: #64d9ef; text-shadow: 0 0 7px rgba(100, 217, 239, .45); }
.vital-spo2 dd { color: #8fb5ff; text-shadow: 0 0 7px rgba(143, 181, 255, .45); }
.vital.changed { border-color: #ff756c; background: rgba(103, 21, 22, .72); animation: tremer .4s 2; }
.vital.changed dd { color: #ff8a7c; text-shadow: 0 0 7px rgba(255, 105, 96, .6); }
.vital dd.previous { margin-top: 3px; color: #ffb1a7; font: 400 12px var(--body); letter-spacing: 0; text-shadow: none; }

.shift-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.shift-stats > div { padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, .32); }
.shift-stats > div:first-child strong { color: #7db8ff; }
.shift-stats > div:last-child strong { color: var(--gold); }
.shift-stats strong, .shift-stats span { display: block; }
.shift-stats strong { font: 400 20px/1.1 var(--pixel); }
.shift-stats span { margin-top: 6px; font-size: 17px; color: var(--muted); overflow-wrap: anywhere; }
.pressure { margin-top: 14px; }
.pressure > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.pressure strong { color: var(--gold); font: 400 9px var(--pixel); }
.pressure-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; margin-top: 8px; }
.case-specialty { margin: 8px 0; color: var(--gold); }
.pressure-track span { height: 12px; border-radius: 3px; background: rgba(0, 0, 0, .38); }
.pressure-track .available { background: var(--blue); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.pressure-track .lost { background: repeating-linear-gradient(135deg, #a8392f 0 4px, #5a2a25 4px 8px); }
.pressure-track.critical-track .available { background: var(--red); }
.game-message { margin-top: 12px; color: var(--cream); font-size: 19px; line-height: 1.15; }
.shift-step { margin-top: 12px; padding-top: 10px; border-top: 2px dashed rgba(255, 255, 255, .2); }

/* mesa */
.felt { --card-width: clamp(100px, 9.4vw, 124px); display: grid; gap: 18px; min-width: 0; }
.zone { min-width: 0; padding: 14px 18px 18px; border-radius: 18px; }
.zone-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.zone-head .eyebrow b { margin-right: 6px; color: #fff; font-weight: 400; }
.zone-head h2, .resolution h2, dialog h2 { margin-top: 8px; font: 400 clamp(13px, 1.7vw, 17px)/1.35 var(--pixel); text-shadow: 3px 3px 0 rgba(0, 0, 0, .4); }
.zone-note { margin-top: 8px; color: var(--muted); font-size: 19px; }
.card-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 18px; margin-top: 16px; }
.field { min-height: calc(var(--card-width) * 1.34); align-content: start; }
.empty-field { display: flex; align-items: center; gap: 15px; color: var(--cream); font-size: 20px; line-height: 1.1; }
.empty-field small { display: block; margin-top: 4px; color: var(--muted); font-size: 18px; }
.card-slot { display: grid; place-items: center; width: var(--card-width); aspect-ratio: 3 / 4; flex: 0 0 auto; border: 3px dashed rgba(255, 255, 255, .28); border-radius: 10px; color: rgba(255, 255, 255, .35); font: 24px var(--pixel); }

/* cartas */
.game-card {
  --ink: #202a5e;
  --wash: #dfe6f6;
  --paper: #fdfdfb;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 4px;
  width: var(--card-width);
  aspect-ratio: 3 / 4;
  padding: 18px 7px 15px;
  border: 3px solid var(--ink-edge, #1b2430);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .26);
  color: var(--ink);
  text-align: center;
  transition: transform .16s ease, box-shadow .16s ease, translate .16s ease;
}
.game-card::before { position: absolute; z-index: -1; inset: 3px; border: 2px solid var(--ink); border-radius: 5px; opacity: .14; content: ""; }
.paciente { --ink: #1b2430; --wash: #ffe08a; --paper: #fffdf6; }
.anamnese { --ink: #d8382e; --wash: #fbd9d3; }
.fisico { --ink: #1c5d4c; --wash: #cfeadd; }
.maneuver-card { --ink: #563e76; --wash: #e6d8f4; --paper: #fffaff; }
.laboratorio { --ink: #d1661a; --wash: #fde2c6; }
.exame { --ink: #20566f; --wash: #d3eaf3; }
.evolution-card { --ink: #23507e; --wash: #deebf8; --paper: #eff9ff; }
.imagem { --ink: #202a5e; --wash: #d9e0f7; }
.critico { --ink: #fff; --wash: #b8291f; --paper: #e2453a; --ink-edge: #5c1511; }
.critico .card-art { color: #fff; }
.diagnostico { --ink: #7a4a10; --wash: #ffe08a; --paper: #fff3c4; }
.no-clue { --ink: #6b7480; --wash: #e4e7eb; --paper: #f2f3f4; }
.game-card:not(:disabled):focus-visible { z-index: 3; transform: translateY(-6px) rotate(0); }
@media (hover: hover) {
  .game-card:not(:disabled):hover { z-index: 3; transform: translateY(-10px) scale(1.04) rotate(0); box-shadow: 0 16px 0 rgba(0, 0, 0, .22); }
}
.corner { position: absolute; font: 400 11px/1 var(--pixel); }
.corner-start { top: 8px; left: 8px; }
.corner-end { right: 8px; bottom: 8px; transform: rotate(180deg); }
.card-kind, .card-foot { font: 400 6px/1.5 var(--pixel); text-transform: uppercase; }
.card-kind { max-width: 70%; margin-left: 12px; }
.card-foot { max-width: 76%; opacity: .9; }
.card-art { display: grid; place-items: center; width: clamp(32px, 36%, 44px); aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 8px; background: var(--wash); }
.card-art svg { width: 72%; height: 72%; }
.card-title { display: block; width: 100%; min-width: 0; overflow-wrap: break-word; font: 400 clamp(13px, 1.35vw, 18px)/1 var(--body); letter-spacing: .01em; }
.field .game-card:first-child { margin-right: 2px; animation: balanco 5s ease-in-out infinite; }
@keyframes balanco { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(1.5deg) translateY(-4px); } }

/* mão em leque */
.hand { flex-wrap: wrap; justify-content: center; padding: 18px 0 14px; }
.hand .game-card { margin-inline: -7px; flex: 0 1 auto; }
.hand .game-card:nth-child(6n + 1) { rotate: -5deg; translate: 0 10px; }
.hand .game-card:nth-child(6n + 2) { rotate: -3deg; translate: 0 3px; }
.hand .game-card:nth-child(6n + 3) { rotate: -1deg; translate: 0 0; }
.hand .game-card:nth-child(6n + 4) { rotate: 1deg; translate: 0 0; }
.hand .game-card:nth-child(6n + 5) { rotate: 3deg; translate: 0 3px; }
.hand .game-card:nth-child(6n + 6) { rotate: 5deg; translate: 0 10px; }
.hand .game-card:hover, .hand .game-card:focus-visible { rotate: 0deg; }
.hand .unavailable { opacity: .55; filter: grayscale(.6); }
.diagnoses { --card-width: 112px; }
.diagnoses .game-card { aspect-ratio: auto; min-height: 152px; padding: 24px 6px 20px; }
.diagnoses .card-art { width: 34%; }
.diagnoses .card-title { font-size: 19px; }
.diagnoses .game-card:disabled:not(.correct, .wrong) { opacity: .55; filter: grayscale(.5); }
.shift-deck .game-card:disabled { opacity: .5; filter: grayscale(.6); cursor: not-allowed; }
.diagnoses .eliminada { --ink: #4e5357; --wash: #d4d7d8; --paper: #e6e8e9; }
.diagnoses .eliminada .card-title { text-decoration: line-through; }
.diagnoses .correct { --ink: #1c5d4c; --wash: #a8ecc0; --paper: #e3f8e8; animation: pular .6s ease; }
.diagnoses .wrong { --ink: #fff; --wash: #b8291f; --paper: #e2453a; --ink-edge: #5c1511; animation: tremer .45s; }
@keyframes pular { 40% { transform: translateY(-22px) scale(1.12) rotate(-4deg); } }

/* dica */
.card-tooltip { position: fixed; z-index: 10; width: min(270px, calc(100vw - 16px)); padding: 12px 14px; border: 3px solid #fff; border-radius: 10px; background: #243248; color: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .4); animation: surgir .14s ease-out; }
.card-tooltip.clipboard-tooltip { width: min(350px, calc(100vw - 16px)); }
@keyframes surgir { from { transform: translateY(6px) scale(.96); opacity: 0; } }
.card-tooltip::after { position: absolute; left: 0; right: 0; height: 12px; content: ""; }
.card-tooltip[data-posicao="acima"]::after { top: 100%; }
.card-tooltip[data-posicao="abaixo"]::after { bottom: 100%; }
.card-tooltip .micro { color: var(--gold); text-transform: uppercase; }
.card-tooltip strong { display: block; margin-top: 6px; font: 400 11px/1.4 var(--pixel); }
.card-tooltip p { margin-top: 6px; font-size: 20px; line-height: 1.05; }
.treatment-screen { display: grid; gap: 14px; min-height: calc(100svh - 112px); margin-top: 20px; }
.treatment-header h2 { width: fit-content; margin: 8px 0; font: 400 clamp(15px, 2vw, 21px)/1.5 var(--pixel); }
.treatment-header p + p { margin-top: 6px; }
#treatment-diagnosis { color: var(--mint); font-size: 23px; }
#treatment-hypothesis, #treatment-event { color: var(--gold); }
#treatment-form { display: grid; grid-template-rows: 1fr auto; gap: 14px; }
.treatment-options { min-width: 0; padding: 0; margin: 0; border: 0; }
.treatment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; height: 100%; }
.treatment-card { display: flex; flex-direction: column; min-width: 0; min-height: 148px; padding: 13px 15px; border: 3px solid #193f3c; border-radius: 11px; background: #fffdf3; color: #1b403b; color-scheme: light; box-shadow: 0 6px 0 rgba(5, 37, 36, .4); }
.treatment-card:has(input:checked) { border-color: var(--gold); background: #fff2c5; }
.treatment-choice { display: flex; align-items: flex-start; gap: 9px; flex: 1; cursor: pointer; }
.treatment-choice input { flex: 0 0 auto; margin: 4px 0 0; accent-color: #216553; }
.treatment-choice strong, .treatment-choice small { display: block; }
.treatment-choice strong { font-size: clamp(20px, 2vw, 26px); line-height: 1.05; }
.treatment-choice small { margin-top: 6px; font-size: 18px; line-height: 1.12; }
.treatment-meds, .treatment-vitals, .treatment-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.treatment-meds { margin-top: 10px; }
.medication-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 8px; border: 1px solid #216553; border-radius: 5px; background: #d9eee3; color: #173d34; text-align: left; font-size: 17px; }
.medication-chip:hover { background: #bce4d2; }
.treatment-vitals { margin-top: 8px; }
.treatment-vitals div { display: flex; gap: 5px; padding: 3px 7px; border-radius: 4px; background: #102f2d; }
.treatment-vitals dt { color: var(--muted); }
.treatment-controls { justify-content: space-between; }
.treatment-controls p { flex: 1 1 280px; color: var(--muted); line-height: 1.1; }
#confirm-treatment:disabled { opacity: .55; }

/* fichas flutuantes (+pista) */
.ficha { position: fixed; z-index: 60; transform: translateX(-50%); padding: 8px 10px; border-radius: 8px; color: #fff; font: 400 12px var(--pixel); pointer-events: none; text-shadow: 2px 2px 0 rgba(0, 0, 0, .4); animation: flutuar 1s ease-out forwards; }
.ficha.azul { background: var(--blue); }
.ficha.vermelha { background: var(--red); }
.ficha.cinza { background: #5d6772; }
@keyframes flutuar { 0% { translate: 0 10px; scale: .6; opacity: 0; } 20% { scale: 1.15; opacity: 1; } 100% { translate: 0 -56px; opacity: 0; } }

/* resolução */
.resolution { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; border: 4px solid var(--mint); animation: entrar .45s cubic-bezier(.3, 1.4, .5, 1); }
.resolution.incorrect { border-color: var(--coral); }
.resolution .diagnosis-missed { color: var(--coral); }
@keyframes entrar { from { transform: translateY(-20px) scale(.95); opacity: 0; } }
.resolution p, dialog p { margin-top: 8px; color: var(--muted); line-height: 1.1; font-size: 21px; }
.source { display: inline-block; margin-top: 10px; color: var(--gold); font-size: 19px; text-underline-offset: 4px; }
.reference-list { margin: 10px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.result-actions > p { margin-top: 0; }
.result-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.result-actions > span { color: var(--muted); font-size: 18px; }
.case-review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case-review h3, .combo-result h3 { margin: 0; color: var(--gold); font: 400 10px/1.7 var(--pixel); }
.review-list { display: grid; gap: 6px; padding: 0; margin: 8px 0 0; list-style: none; }
.review-list li { padding: 8px 10px; border-radius: 6px; background: rgba(5, 48, 48, .46); }
.review-list strong { font-weight: 400; color: var(--cream); }
.review-list p, .resolution .review-no-clue { margin-top: 3px; font-size: 18px; }
.review-state { display: inline-block; margin-left: 4px; color: var(--gold); font-size: 16px; }
.review-state.used { color: var(--mint); }
.review-state.picked { color: var(--coral); }
.treatment-review { padding: 12px; border: 1px solid rgba(224, 255, 247, .22); border-radius: 8px; }
.treatment-review h3 { margin: 4px 0 0; font: 400 11px/1.5 var(--pixel); }
.treatment-review li > small { display: block; color: var(--gold); margin-top: 3px; }
.feedback-comparison { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.feedback-option { flex: 1 1 260px; min-width: 0; padding: 12px; border: 1px solid rgba(224, 255, 247, .25); border-left-width: 4px; border-radius: 7px; background: rgba(5, 30, 27, .33); }
.feedback-option.expected { border-left-color: var(--mint); }
.feedback-option.missed { border-left-color: var(--coral); }
.feedback-option h4, .prescription-review h4 { margin: 7px 0 0; font-size: 24px; line-height: 1.1; }
.feedback-tag { display: inline-block; padding: 2px 6px; border-radius: 4px; background: #d9e9e6; color: #183a34; font-size: 17px; line-height: 1.1; }
.feedback-tag.expected { background: #a8eacb; color: #123f33; }
.feedback-tag.missed { background: #ffd2ca; color: #692420; }
.feedback-alternatives { margin-top: 12px; }
.feedback-alternatives summary { width: fit-content; color: var(--gold); cursor: pointer; }
.stabilization #open-stabilization { margin-top: 10px; }
#open-stabilization:disabled { opacity: .55; }
#stabilization-note:empty { display: none; }
.stabilization details, .timeline-review details { margin-top: 12px; }
.stabilization summary, .timeline-review summary { width: fit-content; color: var(--gold); cursor: pointer; }
.stabilization-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
.stabilization-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; margin-top: 12px; }
.stabilization-options button:disabled { opacity: .55; }
#end-shift-dialog .dialog-actions { flex-wrap: wrap; }
#end-shift-dialog .dialog-actions .primary { margin-top: 0; }
.timeline-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.timeline-score { color: var(--mint); font-size: 22px; }
.priority-list, .timeline-list { display: grid; gap: 8px; margin: 10px 0 0; }
.priority-list { padding: 0; list-style: none; }
.priority-list li, .timeline-list li { padding: 8px 10px; border-radius: 7px; background: rgba(5, 30, 27, .33); }
.resolution .priority-list p { margin-top: 4px; font-size: 20px; line-height: 1.15; }
.timeline-list { padding-inline-start: 25px; }
.timeline-list li::marker { color: var(--gold); }
.timeline-list span { display: block; margin-top: 3px; color: var(--muted); }
.shift-summary { max-width: 800px; margin: 24px auto 0; padding: clamp(16px, 4vw, 30px); }
.shift-summary h2 { margin: 8px 0; font: 400 clamp(14px, 2.4vw, 20px)/1.5 var(--pixel); }
.shift-summary > p { color: var(--muted); }
.shift-summary .result-buttons { margin-top: 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; margin-top: 14px; }
.summary-grid div { padding: 10px; border-radius: 7px; background: rgba(5, 30, 27, .42); }
.summary-grid dt { color: var(--muted); }
.summary-grid dd { margin-top: 5px; color: var(--gold); font: 400 13px/1.5 var(--pixel); }
.prescription-review .rx-mini-list { margin-top: 10px; }
.prescription-review .review-list { margin-bottom: 0; }
.medication-chip .feedback-tag { border: 1px solid currentColor; }
.medication-use { margin-top: 12px; padding: 10px; border: 1px solid rgba(224, 255, 247, .24); border-radius: 7px; }
.medication-contexts { display: grid; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.medication-contexts li + li { margin: 0; }
#medication-dialog { width: min(620px, calc(100% - 25px)); max-height: calc(100dvh - 24px); }
.combo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 16px; color: var(--muted); }
.combo-bar button:disabled, .combo-choices ~ .dialog-actions button:disabled { opacity: .65; }
.combo-choices { min-width: 0; margin: 16px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-color: var(--muted); border-radius: 8px; }
.combo-choices legend { padding: 0 6px; }
#combo-options { display: grid; gap: 6px; }
.combo-option { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 5px; cursor: pointer; }
.combo-option:has(input:checked) { background: rgba(116, 224, 184, .16); }
.combo-option input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--mint); }
.combo-option span { min-width: 0; overflow-wrap: anywhere; }
.combo-option small { display: block; color: var(--muted); }
#combo-form .dialog-actions { flex-wrap: wrap; }
#combo-form .dialog-actions .primary { margin-top: 0; }
.combo-result { padding: 9px 12px; border-left: 3px solid var(--gold); background: rgba(5, 48, 48, .35); }
.combo-result h3 { margin-top: 6px; }
.maneuver-options { display: grid; gap: 8px; margin-block: 14px; }
.maneuver-option { width: 100%; padding: 10px 12px; border: 1px solid var(--muted); border-radius: 6px; background: var(--panel-solid); text-align: left; }
.maneuver-option:hover, .maneuver-option:focus-visible { background: #216563; }
.maneuver-option span { display: block; margin-top: 3px; color: var(--muted); }
.summary { font: 400 10px/1.5 var(--pixel); color: var(--gold); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-block: 26px 18px; color: var(--muted); font-size: 17px; }
.footer span:first-child { font: 400 8px var(--pixel); }
.footer b { color: var(--gold); }

dialog { width: min(460px, calc(100% - 25px)); padding: 20px; border: 4px solid #fff; border-radius: 16px; background: #1d3a2f; color: var(--cream); box-shadow: 0 10px 0 rgba(0, 0, 0, .45); }
dialog[open] { animation: entrar .3s cubic-bezier(.3, 1.4, .5, 1); }
dialog::backdrop { background: rgba(6, 18, 14, .78); }
.dialog-heading, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dialog-actions { justify-content: flex-end; gap: 14px; margin-top: 18px; }
.close { min-height: 32px; padding: 4px 10px; font-size: 14px; background: var(--red); }
dialog ol { padding-left: 24px; color: var(--muted); font-size: 21px; line-height: 1.1; }
dialog li + li { margin-top: 8px; }
dialog form:last-child .primary { margin-top: 18px; }
.account-form, .account-names, .account-form label { display: grid; gap: 8px; min-width: 0; }
.account-form { margin-top: 16px; gap: 12px; }
.account-names { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-form input, .account-form select {
  width: 100%; min-width: 0; min-height: 42px; padding: 6px 9px; border: 1px solid var(--muted);
  border-radius: 6px; background: #102f2d; color: var(--cream); font: inherit;
}
.account-form :is(input, select):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#account-dialog .account-actions .primary { margin-top: 0; }
#account-profile button { margin-top: 12px; }
#account-message, #account-ccm, .menu #player-card { color: var(--gold); }
#account-name, #player-card { overflow-wrap: anywhere; }
#account-message:empty { display: none; }
.shift-dialog { width: min(748px, calc(100% - 20px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: clamp(12px, 3vw, 24px); background: var(--panel-solid); }
.shift-deck { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid rgba(224, 255, 247, .2); border-radius: 12px; background: rgba(5, 37, 36, .5); }
.shift-card { width: 100%; min-width: 0; min-height: 136px; aspect-ratio: auto; padding: 13px 5px 14px; --ink: #1c5d4c; --wash: #d6ece3; --paper: #fffdf5; }
.shift-card .card-art { width: clamp(36px, 55%, 60px); }
.shift-card .card-kind { margin-left: 0; font-size: 7px; }
.shift-card .card-title { hyphens: none; -webkit-hyphens: none; overflow-wrap: anywhere; }
.shift-card .card-foot { font-size: 7px; }
.shift-card .corner svg { width: 14px; height: 14px; }
.shift-card[data-shift-mode="misto"], .shift-card[data-shift-mode="endocrinologia"] { --ink: #77520e; --wash: #f8e6b9; }
.shift-card[data-shift-mode="avancado"] { --ink: #982f39; --wash: #f6dadd; }
.shift-card[data-shift-mode="pneumologia"], .shift-card[data-shift-mode="ortopedia"] { --ink: #23507e; --wash: #deebf8; }
.shift-card[data-shift-mode="cirurgia-geral"], .shift-card[data-shift-mode="cardiologia"] { --ink: #982f39; --wash: #f6dadd; }
.shift-card[data-shift-mode="gastroenterologia"], .shift-card[data-shift-mode="pediatria"] { --ink: #654184; --wash: #efe2f8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 970px) {
  .wrap { width: calc(100% - 30px); }
  .layout { grid-template-columns: 200px minmax(0, 1fr); gap: 12px; }
  .zone, .panel { padding-inline: 12px; }
  .hand .game-card { margin-inline: -10px; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-shortcuts {
    position: sticky; top: 0; z-index: 8; display: grid;
    grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px;
    padding: 5px; border: 1px solid var(--muted); border-radius: 9px;
    background: var(--panel-solid); box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
  }
  .game-shortcuts button {
    min-width: 0; min-height: 44px; padding: 4px;
    border: 1px solid var(--muted); border-radius: 6px; background: #143f3c;
    font: 400 8px/1.35 var(--pixel);
  }
  .game-shortcuts span { color: var(--gold); }
  #game :is(#patient-heading, #evidence-title, #hand-title, #diagnosis-title, #result-heading) { scroll-margin-block-start: 72px; }
  .hand, .field, .diagnoses {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); align-items: stretch; gap: 12px 9px;
  }
  .hand { padding: 0 0 8px; }
  .hand .game-card:nth-child(n), .field .game-card:first-child { margin: 0; rotate: none; translate: none; animation: none; }
  .hand .game-card, .field .game-card, .diagnoses .game-card { width: 100%; min-width: 0; min-height: 130px; aspect-ratio: auto; }
  .field { min-height: 0; }
  .field .empty-field { grid-column: 1 / -1; }
  .card-slot { display: none; }
  .diagnoses { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar-inner:has(#end-shift:not([hidden])) { flex-wrap: wrap; padding-block: 10px; }
  .top-actions { justify-content: flex-start; }
  .clipboard-grid { grid-template-columns: minmax(0, 1fr); }
  .case-review { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { min-height: 66px; }
  .brand img { width: 34px; height: 34px; }
  .solo { display: none; }
}

@media (max-width: 520px) {
  .hand { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hand .game-card, .field .game-card { padding-inline: 5px; }
  .hand .card-kind, .field .card-kind { max-width: 100%; margin-left: 0; }
  .diagnoses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .treatment-grid { grid-template-columns: minmax(0, 1fr); }
  .treatment-card { min-height: 0; }
  .treatment-controls .primary, .rx-controls .primary, #open-blind-treatment { width: 100%; }
  .treatment-choice { min-height: 44px; }
  .shift-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .patient { padding: 8px; }
  .monitor-screen { padding: 8px; }
  .monitor-screen-head h2 { font-size: 10px; }
  .vitals { grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr)); }
  .monitor-wave { height: 34px; }
  .status-chip { white-space: normal; text-align: center; }
  .shift-stats, .shift-step { margin-top: 8px; }
  .shift-stats span { font-size: 16px; }
  .shift .game-message { font-size: clamp(16px, 4.5vw, 20px); }
  .menu-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 20px; }
  .menu-tabs button { padding-inline: 4px; font-size: 8px; }
  dialog { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 14px; overflow-y: auto; overflow-wrap: anywhere; }
  .dialog-actions { flex-wrap: wrap; gap: 10px; }
  dialog .dialog-actions .primary { margin-top: 0; }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 16px); }
  .felt { gap: 12px; }
  .zone { padding: 10px 10px 14px; }
  .card-row { column-gap: 10px; }
  .footer { flex-wrap: wrap; }
}

@media (max-width: 359px) {
  .hand { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (hover: none) and (pointer: coarse) {
  .quiet, .primary, .maneuver-option, .medication-chip, .combo-option { min-height: 44px; }
  .hand .game-card:nth-child(n) { margin-inline: 0; rotate: none; translate: none; }
  .treatment-choice input, .destiny-card input { width: 18px; height: 18px; }
  .account-form :is(input, select) { font-size: max(16px, 1em); }
}

@media (prefers-reduced-motion: reduce) {
  .brand img, .field .game-card:first-child, .solo span, .status-chip.critical, .vital.changed,
  .diagnoses .correct, .diagnoses .wrong, .resolution, dialog[open], .card-tooltip { animation: none; }
  .game-card { transition: none; }
}

/* ==========================================================
   LEGIBILIDADE — mesmas fontes (Press Start 2P + VT323),
   mesmo visual das cartas; só tamanhos, espaçamento e contraste.
   Regra: Press Start 2P nunca abaixo de 8px nos painéis;
   VT323 (fina e estreita) ganha corpo maior e mais entrelinha.
   ========================================================== */
:root { font-size: 22px; }
body { text-rendering: optimizeSpeed; -webkit-font-smoothing: none; }

/* Textos corridos em VT323: maiores e com mais respiro */
.zone-note, .game-message, .resolution p, dialog p, dialog ol,
.empty-field, .review-list p, .resolution .review-no-clue,
.treatment-choice small, .tooltip p, .card-tooltip p { line-height: 1.25; letter-spacing: .02em; }
.zone-note { font-size: 21px; }
.game-message { font-size: 21px; }
.resolution p, dialog p { font-size: 23px; }
dialog ol { font-size: 23px; line-height: 1.3; }
dialog ol li + li { margin-top: 6px; }
.empty-field { font-size: 22px; }
.empty-field small { font-size: 20px; }
.shift-stats span { font-size: 19px; }
.review-list p, .resolution .review-no-clue { font-size: 20px; }
.review-state { font-size: 18px; }
.source { font-size: 21px; }
.result-actions > span { font-size: 20px; }
.footer { font-size: 19px; }
#treatment-diagnosis { font-size: 25px; }
.treatment-choice strong { font-size: clamp(22px, 2vw, 28px); line-height: 1.1; }
.treatment-choice small { font-size: 20px; line-height: 1.2; }
.medication-chip { font-size: 19px; }
.card-tooltip p { font-size: 22px; }
.clipboard-combo h4 { font-size: 23px; line-height: 1.1; }
.clipboard-card { font-size: 18px; line-height: 1.1; }

/* Rótulos em Press Start 2P: pisos mínimos + sombra mais leve nos textos pequenos */
.eyebrow, .micro { font-size: 9px; line-height: 1.8; letter-spacing: .06em; }
.brand span { font-size: 9px; }
.solo { font-size: 10px; }
.status-chip, .count-chip { font-size: 9px; line-height: 1.3; padding: 7px 9px; }
.pressure strong { font-size: 11px; }
.footer span:first-child { font-size: 9px; }
.quiet, .primary { font-size: 11px; line-height: 1.4; letter-spacing: .02em; }
.close { font-size: 14px; }
.case-review h3, .combo-result h3, .clipboard-group h3 { font-size: 11px; line-height: 1.8; }
.treatment-review h3 { font-size: 12px; }
.summary { font-size: 11px; }
.zone-head h2, .resolution h2, dialog h2 { line-height: 1.5; }
.eyebrow, .status-chip, .count-chip, .brand span, .solo { text-shadow: 1px 1px 0 rgba(0, 0, 0, .3); }

/* Monitor: números e legendas */
.monitor-label { font-size: 16px; letter-spacing: .06em; }
.patient .monitor-screen-head h2 { font-size: 9px; line-height: 1.5; }
.vital dt { font-size: 8px; line-height: 1.4; }
.vital dd small, .vital dd.previous { font-size: 15px; }

/* Cartas: mesmo desenho; título em VT323 maior e rótulos de 7px */
.card-title { font-size: clamp(16px, 1.55vw, 21px); line-height: 1.02; letter-spacing: .02em; }
.card-kind, .card-foot { font-size: 7px; line-height: 1.6; letter-spacing: 0; }
.card-kind { max-width: 78%; }
.card-foot { max-width: 86%; opacity: 1; }
.corner { font-size: 12px; }
.diagnoses .card-title { font-size: 21px; }
.shift-card .card-title { font-size: clamp(17px, 2.4vw, 22px); }
.shift-card .card-kind, .shift-card .card-foot { font-size: 7px; }

@media (max-width: 760px) {
  .card-title { font-size: clamp(16px, 4.6vw, 20px); }
}
@media (max-width: 520px) {
  .patient .monitor-screen-head h2 { font-size: 10px; }
}
@media (max-width: 420px) {
  .diagnoses .card-title { font-size: 19px; }
}

/* ==========================================================
   CARTAS DE DIAGNÓSTICO MAIS LARGAS
   Evita palavra quebrada com 1 letra sozinha ("Pneumotórax" → "Pneumotór/ax").
   Altura continua a mesma; só a largura cresce.
   ========================================================== */
.diagnoses { --card-width: 136px; }
.diagnoses .game-card { padding-inline: 5px; }
.diagnoses .card-title { font-size: 20px; letter-spacing: 0; }
.card-title { text-wrap: balance; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 760px) { .diagnoses { --card-width: 132px; } }
@media (max-width: 420px) {
  .diagnoses { --card-width: 128px; }
  .diagnoses .card-title { font-size: 19px; }
}

/* ==========================================================
   CONDUTA: PRESCRIÇÃO VISÍVEL, DESTINO, RECEITUÁRIO E CARIMBO
   ========================================================== */
#treatment-form { grid-template-rows: 1fr auto auto; }

/* prescrição sugerida dentro de cada carta de conduta */
.rx-mini-title { margin: 12px 0 6px; color: #216553; }
.rx-mini-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rx-mini-list li { display: grid; gap: 2px; margin: 0; padding: 7px 9px; border: 2px dashed #7fae9b; border-radius: 7px; background: #f7f3df; }
.rx-mini-name { color: #173d34; font-size: 21px; line-height: 1.15; }
.rx-mini-dose { color: #173d34; font-size: 20px; line-height: 1.05; }
.rx-mini-list small { color: #3f6359; font-size: 17px; line-height: 1.12; }

/* destino do paciente */
.destiny { min-width: 0; margin: 0; padding: 14px 16px 16px; border: 1px solid rgba(224, 255, 247, .18); border-radius: 16px; background: linear-gradient(145deg, rgba(24, 83, 81, .94), rgba(12, 58, 59, .92)); box-shadow: 0 7px 0 rgba(7, 49, 48, .28); }
.destiny-title { margin: 0 0 10px; color: var(--gold); font: 400 clamp(9px, 1.5vw, 13px)/1.8 var(--pixel); }
.destiny-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.destiny-card { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 13px 15px; border: 3px solid #193f3c; border-radius: 11px; background: #fffdf3; color: #1b403b; color-scheme: light; cursor: pointer; box-shadow: 0 6px 0 rgba(5, 37, 36, .4); }
.destiny-card:has(input:checked) { border-color: var(--gold); background: #fff2c5; }
.destiny-card:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.destiny-card input { flex: 0 0 auto; margin: 5px 0 0; accent-color: #216553; }
.destiny-card strong, .destiny-card small { display: block; }
.destiny-card strong { font-size: clamp(22px, 2vw, 27px); line-height: 1.05; }
.destiny-card small { margin-top: 5px; font-size: 19px; line-height: 1.15; }

/* tela do receituário */
.rx-screen { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; min-height: calc(100svh - 112px); margin-top: 20px; }
.rx-header, .rx-controls { width: 100%; }
.rx-header h2 { width: fit-content; margin: 8px 0; font: 400 clamp(15px, 2vw, 21px)/1.5 var(--pixel); }
.rx-header p { color: var(--mint); font-size: 23px; }
.rx-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rx-tabs [role="tab"][aria-selected="true"] { background: var(--panel-solid); box-shadow: inset 0 -3px var(--gold), 0 6px 0 rgba(0, 0, 0, .38); }
.rx-desk { display: flex; justify-content: center; width: 100%; padding: 8px 0 18px; }
.rx-sheet-wrap { width: min(560px, 100%); }
.rx-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.rx-controls p { flex: 1 1 280px; color: var(--muted); line-height: 1.15; }

/* folha de receituário */
.rx-sheet {
  --tinta: #1d2a66; --marrom: #5b3f2e;
  position: relative; display: flex; flex-direction: column; min-height: 640px; padding: 18px 24px 26px;
  border: 3px solid var(--marrom); border-radius: 8px; color: #3b2a22; color-scheme: light;
  background-color: #ecd3bd;
  background-image: radial-gradient(rgba(110, 66, 40, .1) 1px, transparent 1.2px), linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(120, 70, 40, .1));
  background-size: 7px 7px, auto;
  box-shadow: 0 10px 0 rgba(0, 0, 0, .3);
  transform: rotate(-.5deg);
  animation: batida .35s ease-out .75s both;
}
.rx-sheet::after { position: absolute; top: 12px; right: 12px; bottom: 12px; border-right: 2px dashed rgba(91, 63, 46, .3); content: ""; pointer-events: none; }
@keyframes batida { 40% { transform: rotate(-.5deg) translateY(4px); } 100% { transform: rotate(-.5deg); } }
.rx-hand { color: var(--tinta); font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 25px; font-weight: 500; line-height: 1.1; letter-spacing: 0; }
.rx-label { color: var(--marrom); font: 400 9px/1.7 var(--pixel); letter-spacing: .04em; text-transform: uppercase; }
.rx-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid rgba(60, 40, 30, .55); }
.rx-head img { flex: 0 0 auto; }
.rx-head strong { display: block; color: #3b2a22; font: 400 10px/1.5 var(--pixel); }
.rx-head span { display: block; margin-top: 3px; color: #5b3f2e; font-size: 18px; line-height: 1; }
.rx-kind { margin: 14px 0 10px; color: #3b2a22; font: 400 12px/1.6 var(--pixel); text-align: center; text-transform: uppercase; }
.rx-kind small { display: block; margin-top: 3px; color: #5b3f2e; font: 400 18px/1 var(--body); text-transform: none; }
.rx-patient { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding-bottom: 6px; border-bottom: 2px solid rgba(60, 40, 30, .35); }
.rx-name { flex: 1 1 100%; margin-bottom: 2px; font-size: 34px; font-weight: 700; }
.rx-patient .rx-label:first-child { flex: 1 1 100%; }
.rx-body { flex: 1; padding: 14px 4px 18px; }
.rx-items { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.rx-items li { display: flex; align-items: flex-start; gap: 12px; margin: 0; }
.rx-num { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 2px solid var(--tinta); border-radius: 50%; color: var(--tinta); font: 700 24px/1 "Caveat", "Segoe Print", cursive; }
.rx-drug { font-size: 29px; font-weight: 700; }
.rx-drug span { font-weight: 500; }
.rx-how { margin-top: 2px; font-size: 23px; opacity: .92; }
.rx-sub { margin: 16px 0 4px; }
.rx-notes { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.rx-notes li { margin: 0; padding-left: 20px; text-indent: -20px; }
.rx-notes li::before { content: "* "; }
.rx-form { display: grid; gap: 12px; margin: 0; }
.rx-form div { padding-bottom: 6px; border-bottom: 1px dotted rgba(60, 40, 30, .4); }
.rx-form dt { margin: 0 0 2px; }
.rx-form dd { margin: 0; font-size: 27px; }
.rx-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: center; gap: 4px 12px; min-height: 120px; padding: 20px 8px 14px 0; border-top: 2px solid rgba(60, 40, 30, .5); }
.rx-foot .rx-label b { margin-left: 6px; font-weight: 700; text-transform: none; }

/* carimbo */
.rx-stamp {
  grid-column: 2; grid-row: 1 / span 2; justify-self: end; display: grid; gap: 2px; width: min(100%, 224px); padding: 8px 10px 9px;
  border: 3px solid #3a3d9a; border-radius: 6px; color: #3a3d9a; text-align: center;
  box-shadow: inset 0 0 0 2px rgba(58, 61, 154, .35), 0 0 1px #3a3d9a;
  text-shadow: 0 0 1px rgba(58, 61, 154, .8);
  mix-blend-mode: multiply; opacity: .88; transform: rotate(-9deg);
  animation: carimbar .45s cubic-bezier(.2, 1.7, .4, 1) .5s both;
}
.rx-stamp strong { font: 400 21px/1.1 var(--body); text-transform: uppercase; overflow-wrap: anywhere; }
.rx-stamp span { font: 400 17px/1 var(--body); text-transform: uppercase; letter-spacing: .04em; }
@keyframes carimbar {
  0% { opacity: 0; transform: translateY(-46px) scale(1.8) rotate(-9deg); }
  100% { opacity: .88; transform: translateY(0) scale(1) rotate(-9deg); }
}

@media (max-width: 520px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 10px; }
  .top-actions { gap: 8px; }
  .account-names { grid-template-columns: 1fr; }
  .destiny-grid { grid-template-columns: minmax(0, 1fr); }
  .rx-sheet { min-height: 560px; padding: 14px 14px 20px; overflow-wrap: anywhere; transform: none; animation: none; }
  .rx-drug { font-size: 26px; }
  .rx-how { font-size: 21px; }
  .rx-foot { row-gap: 28px; }
  .rx-foot .rx-label:first-child { grid-column: 1 / -1; }
  .rx-stamp { grid-row: 2; padding-inline: 5px; }
  .rx-stamp strong { font-size: 18px; }
  .rx-stamp span { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .rx-stamp, .rx-sheet { animation: none; }
}

/* Carta de queixa: sintomas-base na face; o relato completo aparece ao passar o mouse */
.complaint-card .card-title { font-size: clamp(14px, 1.3vw, 19px); line-height: 1.02; text-wrap: balance; overflow-wrap: normal; word-break: normal; hyphens: manual; -webkit-hyphens: manual; }
.complaint-card .card-foot { display: inline-flex; align-items: center; gap: 4px; }
.complaint-card .card-foot::after { content: "…"; color: var(--ink); font-size: 11px; letter-spacing: 1px; animation: piscar 1.6s steps(2) infinite; }

/* TRAÇADO AMPLIADO */
.ecg-dialog { width: min(1100px, calc(100% - 25px)); }
.ecg-papel { margin-top: 10px; border: 3px solid #0b2a24; border-radius: 8px; color: #63efb3; background-color: #021a17;
  background-image: linear-gradient(rgba(99, 239, 179, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 239, 179, .16) 1px, transparent 1px),
    linear-gradient(rgba(99, 239, 179, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 239, 179, .07) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px; }
.ecg-grande { display: block; width: 100%; height: min(52vh, 420px); color: inherit; filter: drop-shadow(0 0 3px #40db9e); }
.ecg-papel.critical { color: #ff625b; }
.ecg-papel.critical .ecg-grande { filter: drop-shadow(0 0 4px #f3423c); }
.ecg-legenda { margin-top: 10px; font: 400 16px/1.3 var(--body); color: #9dd7c8; }

/* IDENTIFICAÇÃO DO RITMO */
.ritmo-id { margin: 8px 0 12px; padding: 10px 12px; border: 2px dashed rgba(99, 239, 179, .45); border-radius: 8px; background: rgba(0, 26, 29, .45); }
.ritmo-id h3 { font: 400 10px/1.4 var(--pixel); color: #9dd7c8; }
.ritmo-id p { margin-top: 6px; font: 400 17px/1.3 var(--body); }
.ritmo-opcoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ritmo-opcoes button, .ritmo-id p button { font-size: 9px; }

/* Controle de som */
.som-controle { position: relative; display: inline-flex; }
.som-pop {
  position: absolute; top: 100%; right: 0; z-index: 30; display: none; padding: 12px 14px 10px;
  border-radius: 8px; background: rgba(7, 49, 48, .96); box-shadow: 0 6px 0 rgba(0, 0, 0, .25);
}
.som-pop { display: none; gap: 10px; min-width: 190px; }
.som-controle:hover .som-pop, .som-controle:focus-within .som-pop { display: grid; }
.som-pop label { display: grid; gap: 6px; color: var(--cream); font-size: 12px; }
.som-pop input { width: 100%; accent-color: var(--gold); }
.som-pop select { padding: 6px 8px; border-radius: 6px; border: 2px solid var(--cream); background: #0b4a47; color: var(--cream); font: inherit; }

.janela-aberta .som-pop { display: none !important; }

.footer a, .account-legal a { color: var(--gold); }
.account-legal { margin: 0; font-size: 17px; line-height: 1.25; }
#account-dialog #email-pending { display: grid; gap: 10px; margin: 12px 0; padding: 10px 12px; border: 2px solid var(--gold); border-radius: 8px; }
#account-dialog #email-pending[hidden] { display: none; }
#account-dialog #email-pending p { margin: 0; }
