:root{
  --bg:#F4F4F5; --card:#FFFFFF; --ink:#18181B; --muted:#52525B; --line:#E4E4E7;
  --red:#D7192B; --red-dark:#B9101F; --red-soft:#FDECEE;
  --green:#15803D; --green-soft:#DCFCE7; --amber:#92400E; --amber-soft:#FEF3C7;
  --safe-top:env(safe-area-inset-top,0px); --safe-bottom:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased}
button,input,select{font-family:inherit;font-size:16px}
a{color:inherit;text-decoration:none}
.loading{padding:40vh 0;text-align:center;color:var(--muted)}

/* Layout */
.screen{max-width:520px;margin:0 auto;min-height:100vh;padding:calc(20px + var(--safe-top)) 20px calc(110px + var(--safe-bottom));display:flex;flex-direction:column;gap:16px}
.head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.date{font-size:13px;color:var(--muted)}
.brand{font-size:26px;font-weight:700;letter-spacing:-.02em}
.brand b{color:var(--red);font-weight:700}
h1{margin:0;font-size:26px;font-weight:700;letter-spacing:-.02em}
.round{width:44px;height:44px;border-radius:22px;background:var(--card);border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0}
.label{font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:-8px}
.card{background:var(--card);border-radius:20px;padding:20px;display:flex;flex-direction:column;gap:16px}
.list{background:var(--card);border-radius:16px;display:flex;flex-direction:column;overflow:hidden}
.row{padding:14px 16px;border-bottom:1px solid var(--bg);display:flex;gap:12px;align-items:center;justify-content:space-between;min-height:44px}
.row:last-child{border-bottom:none}
.col{display:flex;flex-direction:column;gap:2px;min-width:0}
.t{font-size:15px;font-weight:600}
.s{font-size:13px;color:var(--muted)}
.empty{padding:16px;font-size:14px;color:var(--muted)}

/* Status */
.status{display:flex;align-items:center;gap:14px}
.dot{width:52px;height:52px;border-radius:26px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.st-up .dot{background:var(--green-soft)} .st-up .big{color:var(--green)}
.st-down .dot{background:var(--red-soft)} .st-down .big{color:var(--red)}
.st-slow .dot{background:var(--amber-soft)} .st-slow .big{color:var(--amber)}
.st-unknown .dot{background:var(--bg)} .st-unknown .big{color:var(--muted)}
.big{font-size:22px;font-weight:700}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.stat{background:var(--bg);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:2px}
.stat span{font-size:11px;color:var(--muted)} .stat strong{font-size:16px;font-weight:600}
.stats2{grid-template-columns:repeat(2,minmax(0,1fr))}
.stats2 .stat{background:var(--card);padding:14px;border-radius:16px}
.stats2 .stat strong{font-size:22px}
.ic{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.banner{background:var(--red);color:#fff;border-radius:16px;padding:14px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px;border:none;width:100%;text-align:left;cursor:pointer}
.banner .s{color:#fff;opacity:.9}

/* Nav */
nav{position:fixed;left:0;right:0;bottom:0;background:var(--card);border-top:1px solid var(--line);padding:8px 12px calc(12px + var(--safe-bottom));display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
nav a{display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px;color:var(--muted);font-size:11px;font-weight:500}
nav a.on{color:var(--red);font-weight:600}
nav a svg{stroke:currentColor}

/* Menü */
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile{background:var(--card);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;min-height:112px}
.tile .ic{background:var(--red-soft);width:40px;height:40px;border-radius:12px}
.tile.off{opacity:.6}
.badge{font-size:11px;font-weight:600;color:var(--muted);background:var(--bg);padding:3px 8px;border-radius:999px}
.badge.ok{color:var(--green);background:var(--green-soft)}
.tophead{display:flex;justify-content:space-between;align-items:flex-start}

/* Formulare */
.field{display:flex;flex-direction:column;gap:6px}
.field span{font-size:13px;font-weight:600;color:var(--muted)}
input[type=email],input[type=password],input[type=text],input[type=tel],input[type=time],input[type=number],select{height:48px;border:1px solid var(--line);border-radius:12px;padding:0 14px;background:var(--card);color:var(--ink);width:100%}
input[type=checkbox]{width:22px;height:22px;accent-color:var(--red);flex-shrink:0}
.btn{height:52px;border:none;border-radius:14px;background:var(--red);color:#fff;font-weight:600;font-size:16px;cursor:pointer;width:100%}
.btn.ghost{background:var(--card);color:var(--red)}
.btn.dark{background:var(--ink)}
.btn:disabled{opacity:.6}
.err{color:var(--red);font-size:14px}
.ok{color:var(--green);font-size:14px}
.hint{background:var(--amber-soft);color:var(--amber);border-radius:14px;padding:12px 14px;font-size:14px;line-height:1.45}
.back{margin-left:-10px;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer}

/* Login */
.login{max-width:420px;margin:0 auto;min-height:100vh;padding:calc(80px + var(--safe-top)) 24px 40px;display:flex;flex-direction:column;gap:20px}
.login .brand{font-size:34px}

/* Alarm */
.alarm{position:fixed;inset:0;z-index:20;background:var(--red-dark);color:#fff;overflow:auto}
.alarm-in{max-width:520px;margin:0 auto;min-height:100%;padding:calc(24px + var(--safe-top)) 24px calc(32px + var(--safe-bottom));display:flex;flex-direction:column;gap:24px}
.alarm .close{align-self:flex-end;width:44px;height:44px;border-radius:22px;background:rgba(255,255,255,.16);border:none;display:flex;align-items:center;justify-content:center;cursor:pointer}
.alarm .hero{display:flex;flex-direction:column;align-items:center;gap:14px;text-align:center}
.alarm .circle{width:96px;height:96px;border-radius:48px;background:rgba(255,255,255,.16);display:flex;align-items:center;justify-content:center;animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}
.alarm h2{margin:0;font-size:40px;line-height:1.1;letter-spacing:-.02em}
.alarm p{margin:0;font-size:16px;line-height:1.5}
.alarm .box{background:rgba(0,0,0,.18);border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:12px;font-size:14px}
.alarm .box div{display:flex;gap:10px;align-items:center}
.alarm .actions{margin-top:auto;display:flex;flex-direction:column;gap:12px}
.alarm .claim{height:60px;border:none;border-radius:16px;background:#fff;color:var(--red-dark);font-size:18px;font-weight:700;cursor:pointer}
.alarm .open{height:52px;border-radius:16px;border:1.5px solid rgba(255,255,255,.6);display:flex;align-items:center;justify-content:center;font-weight:600}
