/* iPad / Android tablet single-screen ENMG layout */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;height:100%}
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f4f6f8;color:#18212d;margin:0;min-height:100%;overflow-x:hidden}
button{font:inherit;border:1px solid #b1bcc8;background:#fff;border-radius:9px;padding:8px 11px;min-height:44px;cursor:pointer;touch-action:manipulation}
button:focus-visible{outline:3px solid #2466c4;outline-offset:2px}
button.active{background:#193b70;color:white;border-color:#193b70;font-weight:650}
button:disabled{opacity:.45;cursor:not-allowed}
.appShell{width:100%;max-width:1600px;margin:0 auto;padding:clamp(6px,1.4vmin,14px);height:100vh;height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr);gap:clamp(5px,1vmin,12px);overflow:hidden}
.pageHeader{min-width:0}
.pageHeader h1{font-size:clamp(16px,2.5vmin,26px);line-height:1.14;margin:0 0 3px}
.pageHeader p{font-size:clamp(11px,1.65vmin,15px);line-height:1.25;margin:2px 0}
.pageHeader .participantId{font-size:clamp(10px,1.4vmin,13px);color:#536171;overflow-wrap:anywhere}
.drawingLayout{display:grid;grid-template-columns:minmax(0,1fr) clamp(174px,25vw,280px);gap:clamp(8px,1.7vw,20px);align-items:center;min-height:0;min-width:0}
#mapWrap{position:relative;width:min(100%,100cqh);aspect-ratio:1/1;max-height:100%;justify-self:center;background:white;border:1px solid #cbd3dd;touch-action:none;user-select:none;-webkit-user-select:none;overflow:hidden}
/* The grid's available height controls the square map without affecting its 1000x1000 backing pixels. */
.drawingLayout{container-type:size}
#mapWrap img{position:absolute;width:100%;height:92%;left:0;top:4%;object-fit:fill;pointer-events:none}
#paint{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair}
.mapTitle{position:absolute;left:45%;top:6.7%;width:13%;text-align:center;pointer-events:none;line-height:1.15;color:#111;display:flex;flex-direction:column;gap:clamp(1px,.5vmin,6px)}
.mapTitle strong{font-size:clamp(7px,1.5vmin,18px)}
.mapTitle span{font-size:clamp(5px,1vmin,12px);overflow-wrap:break-word}
.drawingSidebar{display:flex;flex-direction:column;justify-content:space-between;gap:10px;min-height:0;height:100%;min-width:0;padding-block:clamp(2px,1vmin,12px)}
#tabs{display:flex;flex-direction:column;gap:clamp(6px,1.2vmin,12px)}
#tabs button{width:100%;text-align:left;min-height:clamp(42px,6.5vmin,60px);font-size:clamp(12px,1.7vmin,17px)}
.sidebarBottom{display:flex;flex-direction:column;gap:clamp(8px,1.5vmin,15px)}
.controls,.bottom{display:flex;flex-direction:column;gap:clamp(7px,1.2vmin,12px);margin:0}
.controls button,.bottom button{width:100%;text-align:center;min-height:clamp(44px,7vmin,60px);font-size:clamp(12px,1.7vmin,17px)}
.bottom #status{font-size:clamp(11px,1.5vmin,14px);line-height:1.2;overflow-wrap:anywhere;min-height:1.2em}
.primary{background:#1657a5;color:white;border-color:#1657a5;font-weight:650}
/* Very narrow portrait screens: fit the controls below the map when a right rail is impractical. */
@media(max-width:590px){
 .appShell{overflow:auto;height:auto;min-height:100dvh;grid-template-rows:auto auto}
 .drawingLayout{container-type:normal;display:flex;flex-direction:column;align-items:stretch;gap:10px}
 #mapWrap{width:100%;max-height:none}
 .drawingSidebar{height:auto;display:flex;flex-direction:column;gap:10px}
 #tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 #tabs button{font-size:clamp(10px,2.8vw,14px);padding:7px 4px;text-align:center;min-height:44px}
 .sidebarBottom{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .controls{gap:6px}
 .controls button,.bottom button{min-height:44px;font-size:12px;padding:6px}
 .mapTitle strong{font-size:clamp(7px,2vw,11px)}
 .mapTitle span{font-size:clamp(5px,1.35vw,8px)}
}
/* Small-height landscape screens: prioritize all controls remaining visible. */
@media(max-height:520px) and (min-width:591px){
 .pageHeader p{display:none}
 .pageHeader h1{margin:0}
 #tabs{gap:4px}
 #tabs button,.controls button,.bottom button{min-height:36px;padding:4px 8px}
 .sidebarBottom,.controls,.bottom{gap:4px}
}

/* Completion action and accessible confirmation modal */
.finishButton{background:#e8eff9;border-color:#8da8ce;font-weight:650}
.finishDialog{width:min(92vw,530px);max-height:85dvh;overflow:auto;border:1px solid #a8b7ca;border-radius:14px;padding:clamp(18px,3vw,28px);box-shadow:0 20px 70px #0005;color:#18212d}
.finishDialog::backdrop{background:#0008}
.finishDialog p{font-size:clamp(15px,2vmin,18px);line-height:1.5;margin:0 0 20px}
.dialogButtons{display:flex;flex-direction:column;gap:10px}
.dialogButtons button{min-height:48px}
.thankYouPage{min-height:100dvh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:24px;gap:14px}
.thankYouPage h1{font-size:clamp(24px,4vw,38px);margin:0}
.thankYouPage p{font-size:clamp(16px,2.5vw,22px);line-height:1.45;margin:0}
.thankYouPage a{font-size:16px;color:#1657a5}
@media(max-height:600px) and (min-width:591px){
 .drawingSidebar{padding-block:0;gap:4px}
 .sidebarBottom,.controls,.bottom{gap:4px}
 #tabs button,.controls button,.bottom button{min-height:34px;padding:4px 8px;font-size:clamp(11px,1.5vmin,15px)}
}

/* Combined symptom view is a read-only fourth tab. */
#tabs button[data-task="combined"]{border-style:dashed;background:#eaf1fa;color:#193b70}
#tabs button[data-task="combined"].active{background:#193b70;color:#fff}
@media(max-width:590px){#tabs{grid-template-columns:repeat(3,minmax(0,1fr))}#tabs button[data-task="combined"]{grid-column:1/-1}}
