:root{
  --navy:#0E3B71; --deep:#0A2C55; --mid:#2A6FB5; --sky:#8FC7EC; --pale:#E8F1FA; --bg:#F7F9FC;
  --text:#25303A; --muted:#52656D; --line:#D6E3F0; --red:#A4262C; --red-bg:#FBEDEE; --amber:#8A5A00; --amber-bg:#FFF5DF; --green:#1F6B45; --green-bg:#E7F4EC;
  --radius:14px; --tabs:72px;
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{font-family:'Atkinson Hyperlegible',system-ui,sans-serif;color:var(--text);background:var(--bg);font-size:1.125rem;line-height:1.55;min-height:100vh;padding-bottom:calc(var(--tabs) + env(safe-area-inset-bottom) + 1rem)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--sky);outline-offset:2px}

.top{position:sticky;top:0;z-index:20;background:var(--navy);padding:calc(.5rem + env(safe-area-inset-top)) 1rem .5rem}
.brand{display:flex;max-width:648px;width:100%;margin:0 auto;align-items:center;gap:.65rem;background:none;border:0;color:#fff;font-weight:700;font-size:1.15rem}
.brand img{width:40px;height:auto;background:#fff;border-radius:10px;padding:3px}

main{max-width:680px;margin:0 auto;padding:1.25rem 1rem 1rem;outline:none}
h1{font-size:1.65rem;line-height:1.2;color:var(--navy);margin-bottom:.35rem}
h2{font-size:1.25rem;color:var(--navy);margin:1.5rem 0 .6rem}
h3{font-size:1.08rem;color:var(--navy);margin-bottom:.25rem}
p.lede{color:var(--muted);margin-bottom:1rem}
.muted{color:var(--muted)}
.small{font-size:.95rem}

.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(5,1fr);background:#fff;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
.tabs button{background:none;border:0;min-height:var(--tabs);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:.78rem;font-weight:700;color:var(--muted)}
.tabs svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tabs button[aria-current="page"]{color:var(--navy)}
.tabs button[aria-current="page"] svg{stroke-width:2.4}
@media (min-width:760px){.tabs{max-width:680px;margin:0 auto;border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0}}

.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:1rem 1.1rem;margin-bottom:.85rem}
.big-actions{display:grid;gap:.75rem;margin:1rem 0 1.25rem}
.big{display:flex;align-items:center;gap:1rem;text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:1rem 1.1rem;min-height:76px;width:100%}
.big.primary{background:var(--navy);border-color:var(--navy);color:#fff}
.big .ic{flex:none;width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:var(--pale);color:var(--navy)}
.big.primary .ic{background:rgba(255,255,255,.14);color:#fff}
.big svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.big strong{display:block;font-size:1.12rem}
.big span.sub{display:block;font-size:.95rem;opacity:.85}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:52px;padding:.7rem 1.2rem;border-radius:12px;border:2px solid var(--navy);background:var(--navy);color:#fff;font-weight:700;font-size:1.05rem;text-decoration:none}
.btn.ghost{background:#fff;color:var(--navy)}
.btn.danger{background:var(--red);border-color:var(--red)}
.btn.link{background:none;border:0;color:var(--mid);min-height:44px;padding:.4rem .2rem;text-decoration:underline}
.btn.block{width:100%}
.row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.row.end{justify-content:flex-end}
.stack>*+*{margin-top:.6rem}

label.f{display:block;font-weight:700;margin:1rem 0 .3rem}
.hint{display:block;font-weight:400;color:var(--muted);font-size:.95rem}
input[type=text],input[type=tel],input[type=date],select,textarea{width:100%;border:1.5px solid #B8CBE0;border-radius:10px;padding:.7rem .8rem;background:#fff;min-height:52px}
textarea{min-height:96px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--mid);outline:3px solid rgba(143,199,236,.6);outline-offset:0}

.areas{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.area{background:#fff;border:2px solid var(--line);border-radius:12px;padding:.8rem;min-height:84px;text-align:left;font-weight:700;display:flex;flex-direction:column;gap:.3rem}
.area svg{width:28px;height:28px;fill:none;stroke:var(--mid);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.area[aria-pressed="true"]{border-color:var(--navy);background:var(--pale);box-shadow:inset 0 0 0 1px var(--navy)}
.chips{display:flex;flex-wrap:wrap;gap:.5rem}
.chip{border:2px solid var(--line);background:#fff;border-radius:999px;padding:.5rem .95rem;min-height:46px;font-weight:700}
.chip[aria-pressed="true"]{border-color:var(--navy);background:var(--navy);color:#fff}
.check{display:flex;gap:.7rem;align-items:flex-start;padding:.75rem;border:1.5px solid var(--line);border-radius:12px;background:#fff;margin-top:.6rem}
.check input{width:26px;height:26px;flex:none;margin-top:2px;accent-color:var(--navy)}

.steps{display:flex;gap:.35rem;margin:.25rem 0 1rem}
.steps i{flex:1;height:6px;border-radius:3px;background:var(--line)}
.steps i.on{background:var(--navy)}

.entry{background:#fff;border:1px solid var(--line);border-left:6px solid var(--mid);border-radius:12px;padding:.9rem 1rem;margin-bottom:.7rem}
.entry .meta{display:flex;justify-content:space-between;gap:.5rem;flex-wrap:wrap;font-size:.92rem;color:var(--muted);margin-bottom:.35rem}
.entry .tag{font-weight:700;color:var(--navy)}
.entry dl{display:grid;grid-template-columns:auto 1fr;gap:.15rem .7rem;font-size:1rem}
.entry dt{font-weight:700;color:var(--deep)}
.entry.fall{border-left-color:var(--amber)}
.badge{display:inline-block;font-size:.8rem;font-weight:700;padding:.1rem .5rem;border-radius:999px;background:var(--amber-bg);color:var(--amber)}

.note{border-radius:12px;padding:.85rem 1rem;font-size:1rem;margin:1rem 0}
.note.info{background:var(--pale);color:var(--deep)}
.note.warn{background:var(--amber-bg);color:#5a3b00}
.tier{border-radius:var(--radius);padding:1rem 1.1rem;margin-bottom:.8rem;border:2px solid}
.tier h3{font-size:1.2rem;margin-bottom:.35rem}
.tier ul{padding-left:1.2rem}
.tier.t1{background:var(--red-bg);border-color:var(--red)} .tier.t1 h3{color:var(--red)}
.tier.t2{background:var(--amber-bg);border-color:#C98A12} .tier.t2 h3{color:var(--amber)}
.tier.t3{background:var(--green-bg);border-color:#4F9A73} .tier.t3 h3{color:var(--green)}
.tier .btn{margin-top:.7rem}

.empty{text-align:center;padding:1.5rem 1rem;color:var(--muted);background:#fff;border:1.5px dashed var(--line);border-radius:var(--radius)}
.foot{margin-top:2rem;font-size:.92rem;color:var(--muted);text-align:center}

.dialog{position:fixed;inset:0;z-index:50;background:rgba(10,30,60,.45);display:grid;place-items:center;padding:1rem}
.dialog[hidden]{display:none}
.dialog-box{background:#fff;border-radius:16px;padding:1.25rem;max-width:420px;width:100%}
.dialog-box h2{margin-top:0}
.dialog-box p{margin-bottom:1rem}
.toast{position:fixed;left:50%;bottom:calc(var(--tabs) + 1rem + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(20px);background:var(--deep);color:#fff;padding:.7rem 1.1rem;border-radius:12px;font-weight:700;opacity:0;pointer-events:none;transition:.2s;z-index:60;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

.summary{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem}
.summary h2:first-child{margin-top:0}
.summary table{width:100%;border-collapse:collapse;font-size:1rem}
.summary td,.summary th{border:1px solid var(--line);padding:.4rem .5rem;text-align:left;vertical-align:top}
.summary th{background:var(--pale)}

@media screen and (max-width:560px){
  .summary thead{display:none}
  .summary table,.summary tbody,.summary tr,.summary td{display:block;border:0}
  .summary tr{border:1px solid var(--line);border-radius:10px;padding:.5rem .7rem;margin-bottom:.5rem}
  .summary td{padding:.15rem 0}
  .summary td::before{content:attr(data-l) ": ";font-weight:700;color:var(--deep)}
  .summary td:empty{display:none}
}
#print-area{display:none}
@media print{
  body{background:#fff;padding:0;font-size:12pt}
  body>*:not(#print-area){display:none !important}
  #print-area{display:block !important}
  #print-area .summary{border:0;padding:0}
  #print-area h2{page-break-after:avoid}
  #print-area tr{page-break-inside:avoid}
}
@media (prefers-reduced-motion:reduce){*{transition:none !important}}
