
:root{
  --background:222.2 84% 4.9%;--foreground:210 40% 98%;--card:222.2 84% 4.9%;
  --primary:210 40% 98%;--primary-foreground:222.2 47.4% 11.2%;
  --secondary:217.2 32.6% 17.5%;--muted:217.2 32.6% 17.5%;--muted-foreground:215 20.2% 65.1%;
  --destructive:0 62.8% 50.6%;--success:142 76% 46%;--warning:38 92% 50%;
  --border:217.2 32.6% 17.5%;--ring:212.7 26.8% 83.9%;--radius:.5rem;
}
*{box-sizing:border-box;border-color:hsl(var(--border))}
html{overscroll-behavior:none}
body{margin:0;background:hsl(var(--background));color:hsl(var(--foreground));
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;font-size:14px;line-height:1.45;
  -webkit-font-smoothing:antialiased;padding-bottom:env(safe-area-inset-bottom,0)}
h2{font-size:1rem;font-weight:600;margin:0;letter-spacing:-.01em}
.wrap{max-width:1100px;margin:0 auto;padding:0 16px}
.muted{color:hsl(var(--muted-foreground))}.small{font-size:12px}.center{text-align:center}.w-full{width:100%}
.mono{font-variant-numeric:tabular-nums}
.pos{color:hsl(var(--success))}.neg{color:hsl(var(--destructive))}.warn{color:hsl(var(--warning))}

.topbar{position:sticky;top:0;z-index:10;background:hsl(var(--background)/.9);backdrop-filter:blur(8px);border-bottom:1px solid hsl(var(--border))}
.topbar-inner{display:flex;align-items:center;justify-content:space-between;height:60px;gap:12px}
.top-right{display:flex;align-items:center;gap:8px}.top-right form{margin:0}
.brand{display:flex;align-items:center;gap:10px}.title{font-weight:700;letter-spacing:-.02em}
.logo{width:30px;height:30px;border-radius:8px;flex:none;background:hsl(var(--secondary)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 21l6-6 4 4 8-9' stroke='%2322c55e' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/22px no-repeat}

.card{border:1px solid hsl(var(--border));background:hsl(var(--card));border-radius:var(--radius);box-shadow:0 1px 2px rgb(0 0 0/.2);padding:16px;margin-bottom:16px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.tile{margin:0;padding:14px}.tile-label{font-size:12px;color:hsl(var(--muted-foreground))}
.tile-value{font-size:22px;font-weight:700;letter-spacing:-.02em;margin-top:2px;font-variant-numeric:tabular-nums}
.tile-sub{font-size:12px;color:hsl(var(--muted-foreground));margin-top:2px}
.grid{display:grid;grid-template-columns:1fr;gap:0 16px}
@media(min-width:860px){.tiles{grid-template-columns:repeat(4,minmax(0,1fr))}.grid{grid-template-columns:3fr 2fr}}

.badge{display:inline-flex;align-items:center;gap:4px;border-radius:9999px;padding:2px 10px;font-size:12px;font-weight:600;border:1px solid transparent;white-space:nowrap}
.badge-outline{border-color:hsl(var(--border));color:hsl(var(--muted-foreground))}
.b-ok{background:hsl(var(--success)/.15);color:hsl(var(--success))}
.b-bad{background:hsl(var(--destructive)/.18);color:hsl(0 90% 70%)}
.b-warn{background:hsl(var(--warning)/.15);color:hsl(var(--warning))}
.b-muted{background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}
.b-info{background:hsl(217 91% 60%/.15);color:hsl(217 91% 70%)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:calc(var(--radius) - 2px);font:inherit;font-weight:500;
  height:40px;padding:0 16px;border:1px solid transparent;cursor:pointer;transition:background .15s,opacity .15s;white-space:nowrap}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}
.btn-sm{height:32px;padding:0 12px;font-size:13px}
.btn-primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.btn-primary:hover{opacity:.9}
.btn-success{background:hsl(var(--success));color:#04210f;font-weight:600}.btn-success:hover{opacity:.9}
.btn-danger{background:hsl(var(--destructive));color:#fff}.btn-danger:hover{opacity:.9}
.btn-outline{background:transparent;border-color:hsl(var(--border));color:hsl(var(--foreground))}.btn-outline:hover{background:hsl(var(--secondary))}
.btn-ghost{background:transparent;color:hsl(var(--muted-foreground))}.btn-ghost:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}
@media(max-width:768px){.btn{min-height:44px}.btn-sm{min-height:36px}}

.controls{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.empty{padding:18px;text-align:center;color:hsl(var(--muted-foreground));border:1px dashed hsl(var(--border));border-radius:var(--radius)}

.prop{border:1px solid hsl(var(--border));border-radius:var(--radius);padding:12px;margin-bottom:10px}
.prop.armed{border-color:hsl(var(--success)/.6);box-shadow:0 0 0 1px hsl(var(--success)/.25) inset}
.prop-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:10px}
.prop-head .spacer{flex:1}
.levels{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:8px}
@media(max-width:520px){.levels{grid-template-columns:repeat(2,minmax(0,1fr))}}
.lv{background:hsl(var(--secondary)/.5);border-radius:calc(var(--radius) - 2px);padding:6px 8px}
.lv span{display:block;font-size:11px;color:hsl(var(--muted-foreground))}.lv b{font-variant-numeric:tabular-nums}
.reason{font-size:12px;color:hsl(var(--muted-foreground));margin:6px 0}
.sizing{font-size:12px;margin:6px 0 10px}
.actions{display:flex;gap:8px}.actions .btn{flex:1}

.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-size:13px}
.kv dt{color:hsl(var(--muted-foreground))}.kv dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}

.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
th{text-align:left;font-weight:500;color:hsl(var(--muted-foreground));font-size:12px;padding:8px;border-bottom:1px solid hsl(var(--border));white-space:nowrap}
td{padding:8px;border-bottom:1px solid hsl(var(--border)/.6);white-space:nowrap}
tr:last-child td{border-bottom:0}

.health{margin-top:12px}
.alert{border-radius:var(--radius);padding:10px 12px;font-size:13px;border:1px solid}
.alert-bad{border-color:hsl(var(--destructive)/.5);background:hsl(var(--destructive)/.1)}
.alert-warn{border-color:hsl(var(--warning)/.5);background:hsl(var(--warning)/.08)}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:currentColor}

.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0));transform:translateX(-50%);z-index:50;
  background:hsl(var(--secondary));border:1px solid hsl(var(--border));border-radius:var(--radius);padding:10px 16px;font-size:13px;box-shadow:0 8px 24px rgb(0 0 0/.4);max-width:90vw}
.toast.ok{border-color:hsl(var(--success)/.6)}.toast.ko{border-color:hsl(var(--destructive)/.7)}
.foot{margin:8px 0 28px}
.mt8{margin:8px 0 0}.mt10{margin:10px 0 0}.notes{padding-left:18px}

body.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:16px}
.login-card{width:100%;max-width:360px;display:flex;flex-direction:column;gap:12px;padding:24px}
.label{font-size:13px;font-weight:500}
.input{height:40px;border-radius:calc(var(--radius) - 2px);border:1px solid hsl(var(--border));background:transparent;color:inherit;padding:0 12px;font:inherit}
.input:focus{outline:2px solid hsl(var(--ring));outline-offset:1px}
.error{color:hsl(0 90% 70%);font-size:13px;margin:0}
