*{box-sizing:border-box}
:root{--green:#0b5d46;--bg:#f2f6f4;--danger:#a62b2b;--yellow:#fff3cd}
body{margin:0;background:var(--bg);font-family:Arial,sans-serif;color:#17231f}
main{max-width:760px;margin:auto;padding:14px}
header{display:flex;justify-content:space-between;align-items:center}
header h1{margin:0}header p{margin:4px 0 12px;color:#65736d}
header a{color:var(--green);font-weight:bold;text-decoration:none}
section,details{background:#fff;border-radius:14px;padding:13px;margin-bottom:11px}
.status-grid,.counters{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.status-grid div,.counters div{text-align:center;background:#fff;border-radius:12px;padding:10px}
.status-grid b,.status-grid span,.counters b,.counters span{display:block}
.status-grid b,.counters b{color:var(--green);font-size:1.12rem}
.status-grid span,.counters span{color:#65736d;font-size:.76rem}
.warning{background:var(--yellow);border:1px solid #e6cc7a;font-weight:bold}
.route-card,.sync-card{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.route-card>div{flex:1}.route-card b,.route-card strong,.route-card small{display:block}
.route-card strong{font-size:1.45rem;margin:4px 0}.route-card small{color:#65736d}
button{padding:13px;border:0;border-radius:10px;background:var(--green);color:#fff;font-weight:bold;font-size:1rem}
button:disabled{background:#9aa7a2;color:#e8eeee}
.danger{background:var(--danger)}.hidden{display:none!important}
.video-wrap{position:relative;background:#111;border-radius:14px;overflow:hidden;aspect-ratio:3/4}
video{width:100%;height:100%;object-fit:cover}
.camera-message{position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:25px;color:#fff;background:#0009;font-weight:bold}
.flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none}
.flash.active{animation:flash .18s ease}@keyframes flash{0%{opacity:0}40%{opacity:.9}100%{opacity:0}}
.saving-badge{position:absolute;top:14px;right:14px;background:#000c;color:#fff;padding:8px 12px;border-radius:999px;font-weight:bold}
.shoot{width:100%;min-height:100px;margin-top:10px;font-size:1.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center}
.shoot span{font-size:2.1rem;line-height:1}.shoot small{font-size:.78rem;font-weight:normal;margin-top:4px}
.last-result div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid #e2e9e6}
.last-result span{color:#65736d}.last-result b{text-align:right}
.sync-card button{min-width:230px}
.settings label{display:block;margin:9px 0}
.settings input[type=text]{width:100%;padding:12px;margin-top:5px;border:1px solid #c7d2cd;border-radius:9px}
.settings button{width:100%;margin-top:8px}
pre{white-space:pre-wrap;word-break:break-word;background:#111;color:#d7ffe8;padding:10px;max-height:300px;overflow:auto;border-radius:8px}
@media(max-width:620px){
 .status-grid{grid-template-columns:1fr 1fr}
 .counters{grid-template-columns:1fr 1fr}
 .route-card,.sync-card{flex-direction:column;align-items:stretch}
 .sync-card button{min-width:0;width:100%}
}
