:root {
  --red:#e30613; --red-dark:#bd0711; --blue:#075985; --blue-soft:#e8f3f8;
  --green:#15803d; --ink:#172033; --muted:#64748b; --line:#e2e8f0;
  --surface:#fff; --canvas:#f4f7fa; --radius:18px; --shadow:0 18px 50px rgba(15,23,42,.12);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink); background:var(--canvas); font-synthesis:none;
}
*{box-sizing:border-box} body{margin:0;min-height:100vh} button,input,textarea,select{font:inherit} a{color:inherit;text-decoration:none}
.login-page{min-height:100vh;display:grid;place-items:center;padding:28px;position:relative;overflow:hidden;background:linear-gradient(135deg,#0b3a55 0%,#2c647d 48%,#e6eef2 100%)}
.login-scene{position:absolute;inset:0;opacity:.62;background:radial-gradient(circle at 18% 32%,rgba(255,255,255,.38),transparent 28%),linear-gradient(25deg,transparent 43%,rgba(255,255,255,.14) 44% 48%,transparent 49%)}
.login-scene span{position:absolute;border-radius:999px;background:#fff2;filter:blur(1px)}.login-scene span:nth-child(1){width:42vw;height:42vw;right:-12vw;top:-8vw}.login-scene span:nth-child(2){width:18vw;height:18vw;left:5vw;bottom:8vh}.login-scene span:nth-child(3){width:52vw;height:7px;left:15vw;top:55%;transform:rotate(-18deg)}
.login-card{position:relative;width:min(100%,520px);padding:44px;background:rgba(255,255,255,.97);border:1px solid #ffffff80;border-radius:28px;box-shadow:0 28px 80px #071b2b55;backdrop-filter:blur(22px)}
.brand-lockup{display:flex;align-items:center;gap:14px}.brand-lockup strong,.brand-lockup small{display:block}.brand-lockup strong{font-size:20px}.brand-lockup small{color:var(--muted);margin-top:2px}.brand-mark{width:52px;height:52px;border-radius:16px;background:var(--red);color:#fff;display:grid;place-items:center;box-shadow:0 8px 20px #e3061340;font-weight:900;font-size:26px}.brand-mark span{border:2px solid #fff;border-radius:9px;padding:0 6px}
.entity-chip{display:inline-flex;align-items:center;gap:8px;margin:30px 0 12px;padding:7px 12px;border-radius:999px;background:#edf8f1;color:#166534;font-size:13px;font-weight:700}.status-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 5px #22c55e20}
h1,h2,h3,p{margin-top:0}.login-card h1{font-size:31px;margin-bottom:8px;letter-spacing:-.03em}.lead{color:var(--muted);line-height:1.6;margin-bottom:24px}.stack{display:grid;gap:16px}.floating-field{position:relative}.floating-field input{width:100%;height:58px;padding:21px 16px 8px;border:2px solid #cbd5e1;border-radius:15px;outline:none;background:#fff}.floating-field span{position:absolute;left:17px;top:18px;color:var(--muted);transition:.18s;pointer-events:none}.floating-field input:focus{border-color:var(--blue);box-shadow:0 0 0 4px #07598518}.floating-field input:focus+span,.floating-field input:valid+span{top:6px;font-size:11px;color:var(--blue);font-weight:700}.button{min-height:46px;padding:0 18px;border:0;border-radius:13px;display:inline-flex;align-items:center;justify-content:center;gap:9px;font-weight:750;cursor:pointer;transition:.18s}.button.primary{background:var(--red);color:#fff;box-shadow:0 8px 18px #e306132c}.button.primary:hover{background:var(--red-dark);transform:translateY(-1px)}.button.secondary{background:var(--blue);color:#fff}.button.ghost{background:#eef2f6;color:var(--ink)}.button.small{min-height:40px;font-size:14px}.alert{padding:12px 14px;margin-bottom:18px;border-radius:12px;background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}.login-footer{display:flex;justify-content:space-between;gap:12px;margin-top:28px;padding-top:20px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.app-shell{min-height:100vh;display:grid;grid-template-columns:248px 1fr}.sidebar{background:#fff;border-right:1px solid var(--line);padding:26px 18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand-lockup.compact{padding:0 10px 28px}.compact .brand-mark{width:42px;height:42px;border-radius:13px;font-size:20px}.sidebar nav{display:grid;gap:6px}.nav-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;color:#475569;font-weight:650;font-size:14px}.nav-item span{width:22px;text-align:center;font-size:18px}.nav-item:hover{background:#f8fafc}.nav-item.active{background:#fff0f1;color:var(--red)}.nav-item.disabled{opacity:.5;cursor:not-allowed}.sidebar-foot{margin-top:auto;padding:14px;border-radius:14px;background:#f3f8fa;display:flex;align-items:center;gap:12px}.sidebar-foot strong,.sidebar-foot small{display:block;font-size:12px}.sidebar-foot small{color:var(--muted);margin-top:3px}.workspace{padding:34px 4vw 56px;min-width:0}.topbar{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:30px}.eyebrow{margin:0 0 5px;text-transform:uppercase;letter-spacing:.12em;color:var(--red);font-size:11px;font-weight:850}.topbar h1,.form-heading h1{font-size:30px;letter-spacing:-.035em;margin:0}.user-menu{display:flex;align-items:center;gap:11px}.user-menu strong,.user-menu small{display:block;font-size:13px}.user-menu small{color:var(--muted);margin-top:2px}.avatar{width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:var(--blue);color:#fff;font-weight:800}.icon-button{width:38px;height:38px;border:0;background:#fff;border-radius:10px;color:var(--muted);cursor:pointer}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}.stat-card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:20px;display:flex;align-items:center;gap:14px}.stat-card strong,.stat-card small{display:block}.stat-card strong{font-size:24px}.stat-card small{color:var(--muted);font-size:12px;margin-top:2px}.stat-icon{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-size:20px;font-weight:800}.stat-icon.red{background:#fff0f1;color:var(--red)}.stat-icon.blue{background:#edf6fa;color:var(--blue)}.stat-icon.green{background:#ecfdf3;color:var(--green)}.stat-icon.slate{background:#f1f5f9;color:#475569}.panel{background:#fff;border:1px solid var(--line);border-radius:20px;overflow:hidden}.panel-head{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:22px 24px;border-bottom:1px solid var(--line)}.panel-head h2{font-size:18px;margin-bottom:4px}.panel-head p{margin:0;color:var(--muted);font-size:13px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left}th{padding:12px 24px;background:#f8fafc;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em}td{padding:17px 24px;border-top:1px solid #eef2f6;font-size:14px}.badge{display:inline-flex;padding:5px 9px;border-radius:999px;background:#f1f5f9;color:#475569;font-size:10px;font-weight:850}.badge.draft{background:#fff7ed;color:#c2410c}.badge.finalized{background:#ecfdf3;color:#15803d}.empty-state{text-align:center;padding:64px 24px}.empty-state .empty-icon{width:58px;height:58px;margin:0 auto 16px;border-radius:18px;display:grid;place-items:center;background:#fff0f1;color:var(--red);font-size:28px}.empty-state h3{margin-bottom:8px}.empty-state p{color:var(--muted);margin-bottom:22px}
.form-page{min-height:100vh;padding:24px}.form-topbar{max-width:1000px;margin:0 auto 22px;display:flex;justify-content:space-between;align-items:center}.form-topbar .entity-chip{margin:0}.back-link{color:var(--muted);font-weight:700}.protocol-form{max-width:1000px;margin:0 auto 50px;background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:0 14px 40px #0f172a0b;overflow:hidden}.form-heading{padding:32px 36px;border-bottom:1px solid var(--line)}.form-heading p:last-child{color:var(--muted);margin:10px 0 0}.form-section{display:grid;grid-template-columns:72px 1fr;padding:30px 36px;border-bottom:1px solid var(--line)}.section-number{width:42px;height:42px;border-radius:13px;background:#fff0f1;color:var(--red);display:grid;place-items:center;font-weight:850}.section-content h2{font-size:18px;margin:8px 0 22px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.form-grid .full{grid-column:1/-1}.section-content label{display:grid;gap:8px;color:#475569;font-size:13px;font-weight:700}.section-content input,.section-content textarea{width:100%;border:1.5px solid #cbd5e1;border-radius:12px;padding:13px 14px;outline:none;color:var(--ink);background:#fff}.section-content input:focus,.section-content textarea:focus{border-color:var(--blue);box-shadow:0 0 0 4px #07598514}.section-content textarea{resize:vertical}.form-actions{padding:22px 36px;display:flex;justify-content:flex-end;gap:12px;background:#f8fafc}
@media(max-width:980px){.stats-grid{grid-template-columns:1fr 1fr}.app-shell{grid-template-columns:82px 1fr}.sidebar{padding:20px 12px}.sidebar .brand-lockup div:last-child,.sidebar .nav-item:not(.active){font-size:0}.sidebar .nav-item{justify-content:center}.sidebar-foot{display:none}}
@media(max-width:640px){.login-page{padding:16px}.login-card{padding:28px 22px;border-radius:22px}.login-footer{flex-direction:column}.app-shell{display:block}.sidebar{height:auto;position:fixed;z-index:10;left:0;right:0;bottom:0;top:auto;display:block;padding:8px;border:0;border-top:1px solid var(--line)}.sidebar .brand-lockup,.sidebar-foot{display:none}.sidebar nav{grid-template-columns:repeat(4,1fr)}.nav-item,.sidebar .nav-item:not(.active){padding:9px 4px;display:grid;gap:2px;justify-items:center;font-size:9px}.nav-item span{font-size:18px}.workspace{padding:24px 16px 90px}.topbar{align-items:flex-start}.user-menu>div:not(.avatar){display:none}.stats-grid{grid-template-columns:1fr 1fr;gap:10px}.stat-card{padding:14px;gap:10px}.stat-icon{width:38px;height:38px}.panel-head{align-items:flex-start}.panel-head .button{font-size:0;width:42px;padding:0}.panel-head .button::first-letter{font-size:18px}th,td{padding:13px 16px}.form-page{padding:14px}.protocol-form{border-radius:18px}.form-heading,.form-section,.form-actions{padding:24px 20px}.form-section{grid-template-columns:1fr}.section-number{margin-bottom:10px}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}}



/* Expanded protocol editor */
html{scroll-behavior:smooth}.protocol-editor{background:#eef3f7}.protocol-form.expanded{max-width:1120px}.section-jump{position:sticky;top:0;z-index:8;display:flex;gap:8px;overflow-x:auto;padding:12px 20px;background:#fff;border-bottom:1px solid var(--line);scrollbar-width:thin}.section-jump a{flex:0 0 auto;display:flex;align-items:center;gap:7px;padding:8px 12px;border-radius:11px;color:var(--muted);font-size:12px;font-weight:750}.section-jump a:hover,.section-jump a.active{background:var(--blue-soft);color:var(--blue)}.section-jump b{width:24px;height:24px;border-radius:8px;display:grid;place-items:center;background:#f1f5f9;font-size:11px}.form-section{scroll-margin-top:72px}.form-grid.three{grid-template-columns:repeat(3,1fr)}.section-content h3{margin:28px 0 16px;padding-bottom:8px;border-bottom:1px solid var(--line);font-size:15px}.section-content select{width:100%;min-height:48px;border:1.5px solid #cbd5e1;border-radius:12px;padding:11px 38px 11px 14px;outline:none;color:var(--ink);background:#fff}.section-content select:focus{border-color:var(--blue);box-shadow:0 0 0 4px #07598514}.check-row{display:flex;flex-wrap:wrap;gap:16px 24px;margin-top:20px}.check-row label{display:flex;align-items:center;gap:8px;color:#475569;font-size:13px;font-weight:700}.check-row input,.choice-field input,.toggle-label input{accent-color:var(--red)}.toggle-label{align-content:start}.toggle{appearance:none;width:48px!important;height:27px;border:0!important;border-radius:999px!important;background:#cbd5e1!important;padding:0!important;position:relative;cursor:pointer}.toggle::after{content:"";position:absolute;width:21px;height:21px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0003;transition:.18s}.toggle:checked{background:var(--green)!important}.toggle:checked::after{transform:translateX(21px)}.choice-field{border:0;padding:0;margin:22px 0 0;min-width:0}.choice-field legend{margin-bottom:9px;color:#475569;font-size:13px;font-weight:750}.segmented,.check-pills,.nrs{display:flex;overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:#f8fafc}.segmented label,.check-pills label,.nrs label{flex:1 0 auto;min-width:100px}.segmented input,.check-pills input,.nrs input{position:absolute;opacity:0;pointer-events:none}.segmented span,.check-pills span,.nrs span{min-height:47px;padding:10px 13px;display:grid;place-items:center;border-right:1px solid var(--line);color:#475569;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap}.segmented label:last-child span,.check-pills label:last-child span,.nrs label:last-child span{border-right:0}.segmented input:checked+span,.check-pills input:checked+span,.nrs input:checked+span{background:var(--blue);color:#fff}.nrs label{min-width:48px}.nrs span{padding:8px}.vitals-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:12px}.vitals-grid label{min-width:0}.vitals-grid input{text-align:center}.gcs-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.gcs-grid .segmented{display:grid}.gcs-grid .segmented label{min-width:0}.gcs-grid .segmented span{justify-items:start;border-right:0;border-bottom:1px solid var(--line)}.call-sign-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.final-check{padding:14px;border:1px solid #fecaca;border-radius:12px;background:#fff7f7}.sticky-actions{position:sticky;bottom:0;z-index:9;box-shadow:0 -8px 24px #0f172a12}.button.secondary{background:var(--blue);color:#fff}
.skin-field{max-width:520px;margin-bottom:8px}.measure-group{border:0;padding:0;margin:34px 0 0}.measure-group legend{width:100%;padding:0 0 9px;border-bottom:2px solid color-mix(in srgb,var(--group-color) 75%,#1e293b);color:var(--group-color);font-size:18px;font-weight:850;text-align:center}.measure-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;padding-top:18px}.measure-options label{position:relative;display:flex;align-items:center;gap:12px;min-height:50px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer;transition:.16s}.measure-options label:hover{border-color:color-mix(in srgb,var(--group-color) 55%,#cbd5e1);background:color-mix(in srgb,var(--group-color) 5%,white)}.measure-options input{width:21px;height:21px;flex:0 0 auto;accent-color:var(--group-color)}.measure-options span{font-size:14px}.measure-options label:has(input:checked){border-color:var(--group-color);background:color-mix(in srgb,var(--group-color) 8%,white);color:#172033}.measure-note{margin:14px 0 0;text-align:center;color:var(--muted);font-size:13px}.first-aid-title{margin-top:42px!important;font-size:18px!important;text-align:center}.gcs-total{width:max-content;min-width:132px;margin-top:18px;padding:10px 14px;display:grid;grid-template-columns:auto auto;gap:1px 10px;align-items:baseline;border:2px dashed #94a3b8;border-radius:12px;background:#f8fafc}.gcs-total span{grid-column:1/-1;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.gcs-total strong{font-size:24px;color:var(--red)}.gcs-total small{color:var(--muted)}
@media(max-width:800px){.form-grid.three,.vitals-grid{grid-template-columns:repeat(2,1fr)}.gcs-grid{grid-template-columns:1fr}.call-sign-grid{grid-template-columns:repeat(2,1fr)}.section-jump{margin:0 -1px}.protocol-form.expanded{overflow:visible}.form-heading{border-radius:18px 18px 0 0;background:#fff}}
@media(max-width:640px){.protocol-editor{padding:0}.protocol-editor .form-topbar{padding:12px 14px;margin-bottom:0}.protocol-form.expanded{margin-bottom:0;border:0;border-radius:0;box-shadow:none}.form-heading{padding:24px 18px}.section-jump{top:0;padding:9px 10px}.section-jump a{padding:7px 9px}.section-jump a span{display:none}.section-jump b{width:30px;height:30px}.form-section{padding:24px 18px}.section-content h2{font-size:21px;margin-top:2px}.form-grid.three{grid-template-columns:1fr 1fr}.vitals-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.call-sign-grid{grid-template-columns:1fr 1fr}.segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.segmented label{min-width:0}.segmented span{height:100%;min-height:48px;padding:10px 8px;border-bottom:1px solid var(--line);white-space:normal;text-align:center}.measure-group{margin-top:38px}.measure-group legend{font-size:19px}.measure-options{grid-template-columns:1fr;gap:9px;padding-top:15px}.measure-options label{min-height:54px}.sticky-actions{display:grid;grid-template-columns:1fr 1fr;padding:10px 12px calc(10px + env(safe-area-inset-bottom))}.sticky-actions .ghost{display:none}.sticky-actions .primary{grid-column:1/-1}.section-content input,.section-content textarea,.section-content select{font-size:16px;min-height:50px}.form-heading h1{font-size:25px}}
