/* AgroVision — neumorphism, "dala" palitrasi */

@font-face { font-family: "Onest"; src: url("../fonts/Onest.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url("../fonts/Unbounded.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --surface: #dce2d8;      /* sirt: qurigan bug'doypoya va barg orasidagi kulrang-yashil */
  --surface-2: #e3e8df;
  --hi: #f7faf4;           /* yorug' soya */
  --lo: #b3bdae;           /* qorong'i soya */
  --ink: #26322a;
  --ink-2: #536257;
  --ink-3: #7f8c7a;
  --leaf: #3c8a4a;
  --leaf-soft: #cfe0c8;
  --rust: #a65a1f;
  --rust-soft: #ecd9c6;
  --amber: #b4861b;
  --red: #9b3a22;

  --raise: 7px 7px 16px var(--lo), -7px -7px 16px var(--hi);
  --raise-sm: 4px 4px 9px var(--lo), -4px -4px 9px var(--hi);
  --press: inset 4px 4px 9px var(--lo), inset -4px -4px 9px var(--hi);
  --press-deep: inset 7px 7px 16px var(--lo), inset -6px -6px 14px var(--hi);

  --r-xl: 26px;
  --r-lg: 18px;
  --r-md: 13px;

  --font: "Onest", "Segoe UI", system-ui, sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
p { margin: 0; }
small { font-size: 12.5px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mt { margin-top: 26px; }

:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; border-radius: 8px; }

/* ---------- neumorph asoslari ---------- */
.raised { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--raise); }
.raised-sm { background: var(--surface); box-shadow: var(--raise-sm); }
.inset { background: var(--surface); box-shadow: var(--press); border: 0; border-radius: var(--r-md); }
.inset-sm { background: var(--surface); box-shadow: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi); border-radius: 999px; }
.card-pad { padding: 24px; }

/* ---------- tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--raise-sm);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: box-shadow .15s, transform .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { color: var(--leaf); }
.btn:active, .btn.is-pressed { box-shadow: var(--press); transform: translateY(1px); }
.btn-primary { color: var(--leaf); }
.btn-primary:hover { color: #2c6e38; }
.btn-ghost { color: var(--ink-2); }
.btn-block { width: 100%; height: 50px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-danger { color: var(--red); }
.btn:disabled { opacity: .55; cursor: default; }

.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 12px; display: grid; place-items: center;
  cursor: pointer; color: var(--ink-2); transition: box-shadow .15s, color .15s;
}
.icon-btn:active, .icon-btn[aria-pressed="true"] { box-shadow: var(--press); }
.icon-btn[aria-pressed="true"] { color: var(--amber); }

/* ---------- maydonlar ---------- */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; }
.field input.inset { height: 48px; padding: 0 16px; width: 100%; outline: none; }
.field input.inset:focus { box-shadow: var(--press-deep); }
.form-error { min-height: 20px; color: var(--red); font-size: 13.5px; margin: -6px 0 10px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--press); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: var(--raise-sm); border: 6px solid var(--surface); outline: 0; cursor: pointer; background-image: radial-gradient(var(--leaf) 45%, transparent 47%); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(var(--leaf) 30%, var(--surface) 33%); box-shadow: var(--raise-sm); border: 0; cursor: pointer; }

.switch { width: 54px; height: 30px; border-radius: 999px; border: 0; padding: 0; background: var(--surface); box-shadow: var(--press); position: relative; cursor: pointer; flex: none; }
.switch i { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: var(--raise-sm); transition: transform .2s, background .2s; }
.switch[aria-checked="true"] i { transform: translateX(24px); background: var(--leaf); }
.switch-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: 6px 0 22px; }
.switch-row span { display: grid; gap: 2px; }

/* ---------- kirish ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); padding: 40px 34px 28px; text-align: center; }
.brand-mark { width: 64px; height: 64px; border-radius: 20px; display: inline-grid; place-items: center; color: var(--leaf); }
.brand-mark svg { width: 32px; height: 32px; }
.login-title { font-family: var(--display); font-weight: 600; font-size: 26px; margin-top: 20px; letter-spacing: -0.02em; }
.login-sub { color: var(--ink-2); margin: 8px auto 30px; max-width: 30ch; }
.login-form { text-align: left; }
.pw-wrap { position: relative; display: block; }
.pw-eye { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border: 0; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.login-foot { margin-top: 26px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- karkas ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; padding: 26px 18px; display: flex; flex-direction: column; gap: 28px; }
.rail-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 6px; }
.rail-brand .brand-mark { width: 44px; height: 44px; border-radius: 14px; }
.rail-brand .brand-mark svg { width: 24px; height: 24px; }
.rail-brand-name { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.rail-nav { display: grid; gap: 6px; }
.rail-nav a {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: var(--r-md);
  text-decoration: none; color: var(--ink-2); font-weight: 550; transition: box-shadow .15s, color .15s;
}
.rail-nav a:hover { color: var(--ink); }
.rail-nav a.active { box-shadow: var(--press); color: var(--leaf); }
.rail-foot { margin-top: auto; display: grid; gap: 14px; }
.rover { display: grid; gap: 12px; padding: 14px; border-radius: var(--r-lg); }
.rover-head { display: flex; align-items: center; gap: 12px; }
.rover-ico { width: 46px; height: 30px; color: var(--ink-2); }
.rover-head b { display: block; font-size: 14px; }
.rover-head small { color: var(--ink-3); }
.rover.ok .rover-ico { color: var(--leaf); }
.rover-sensors { display: grid; gap: 6px; margin: 0; }
.rover-sensors div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px; box-shadow: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi);
}
.rover-sensors dt { font-size: 12.5px; color: var(--ink-2); }
.rover-sensors dd { margin: 0; font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rover-sensors dd small { font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.rover-sensors div.warn dd { color: var(--rust); }

.main { padding: 30px 34px 60px 18px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.topbar h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.025em; }
.topbar p { margin-top: 4px; }
.clock { display: flex; gap: 12px; align-items: baseline; padding: 10px 18px; font-variant-numeric: tabular-nums; }
.clock span { color: var(--ink-2); font-size: 14px; }
.clock b { font-weight: 650; }

/* ---------- kameralar ---------- */
.cams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.cam { padding: 18px; }
.cam-head { display: flex; align-items: center; gap: 12px; padding: 2px 4px 14px; }
.cam-head h2 { font-size: 16px; }
.cam-head small { color: var(--ink-3); display: block; }
.cam-head .grow { flex: 1; min-width: 0; }
.signal { display: flex; gap: 2px; align-items: flex-end; height: 16px; }
.signal i { width: 4px; border-radius: 2px; background: var(--lo); }
.signal i:nth-child(1) { height: 5px } .signal i:nth-child(2) { height: 8px } .signal i:nth-child(3) { height: 12px } .signal i:nth-child(4) { height: 16px }
.signal[data-l="1"] i:nth-child(-n+1), .signal[data-l="2"] i:nth-child(-n+2),
.signal[data-l="3"] i:nth-child(-n+3), .signal[data-l="4"] i:nth-child(-n+4) { background: var(--leaf); }

.screen {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--press-deep); background: #cfd6cb; padding: 8px;
}
.screen img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; background: #c4ccc0; }
.screen .live {
  position: absolute; left: 20px; top: 20px; display: flex; align-items: center; gap: 7px;
  background: rgba(30, 40, 32, .55); color: #eef3ea; font-size: 12.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.screen .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7fd18b; }
.screen .reticle { position: absolute; inset: 22% 26%; border-radius: 14px; pointer-events: none;
  background:
    linear-gradient(#f2f6ef, #f2f6ef) top left / 18px 2px, linear-gradient(#f2f6ef, #f2f6ef) top left / 2px 18px,
    linear-gradient(#f2f6ef, #f2f6ef) top right / 18px 2px, linear-gradient(#f2f6ef, #f2f6ef) top right / 2px 18px,
    linear-gradient(#f2f6ef, #f2f6ef) bottom left / 18px 2px, linear-gradient(#f2f6ef, #f2f6ef) bottom left / 2px 18px,
    linear-gradient(#f2f6ef, #f2f6ef) bottom right / 18px 2px, linear-gradient(#f2f6ef, #f2f6ef) bottom right / 2px 18px;
  background-repeat: no-repeat; opacity: .8; }
.screen.scanning .reticle { opacity: 1; animation: lock 1.1s ease-in-out infinite alternate; }
@keyframes lock { to { inset: 25% 29%; } }

.offline {
  position: absolute; inset: 8px; border-radius: 12px; display: grid; place-content: center; text-align: center; gap: 6px;
  color: var(--ink-2); padding: 20px;
  background: repeating-linear-gradient(135deg, #d3d9cf 0 14px, #d7ddd3 14px 28px);
}
.offline svg { width: 34px; height: 34px; margin: 0 auto 6px; color: var(--ink-3); }
.offline b { color: var(--ink); }
.offline code { font-size: 13px; }

.cam-actions { display: flex; align-items: center; gap: 14px; padding-top: 18px; }
.cam-actions .grow { flex: 1; }
.cam-actions .hint { font-size: 13px; color: var(--ink-3); line-height: 1.35; }

/* asosiy dumaloq tugma — traktor pultidagi kabi */
.analyze {
  --s: 92px;
  width: var(--s); height: var(--s); border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: var(--surface); box-shadow: var(--raise); position: relative;
  display: grid; place-items: center; color: var(--leaf); transition: box-shadow .18s, transform .18s;
}
.analyze::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; box-shadow: var(--press); }
.analyze span { position: relative; display: grid; justify-items: center; gap: 2px; font-weight: 700; font-size: 13px; line-height: 1.1; }
.analyze svg { width: 26px; height: 26px; }
.analyze:hover { color: #2c6e38; }
.analyze:active, .analyze.busy { box-shadow: var(--press-deep); transform: scale(.98); }
.analyze.busy::before { box-shadow: none; border: 3px solid transparent; border-top-color: var(--leaf); border-right-color: var(--leaf-soft); animation: spin .9s linear infinite; }
.analyze:disabled { color: var(--ink-3); cursor: not-allowed; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- natija ---------- */
.result { margin-top: 30px; padding: 26px; }
.result-empty { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.result-empty-ico { width: 54px; height: 54px; color: var(--ink-3); }
.result-empty p { max-width: 62ch; margin-top: 4px; }

.result-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 30px; }
.shot { position: relative; }
.shot .screen { aspect-ratio: auto; }
.shot .screen img { height: auto; max-height: 460px; object-fit: contain; background: #c7cfc3; }
.shot-tabs { display: inline-flex; margin-top: 14px; }
.shot-meta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--ink-3); font-size: 13.5px; }

.verdict { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.dial { width: 150px; height: 150px; border-radius: 50%; box-shadow: var(--raise); display: grid; place-items: center; position: relative; }
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dial-track { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.dial-in { position: absolute; inset: 22px; border-radius: 50%; box-shadow: var(--press); }
.dial-val { position: relative; text-align: center; }
.dial-val b { display: block; font-family: var(--display); font-size: 38px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.dial-val small { color: var(--ink-3); }
.verdict h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.verdict p { margin-top: 6px; color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 650; margin-top: 12px; }
.tag-ok { background: var(--leaf-soft); color: #2c6b37; }
.tag-low { background: #efe4c4; color: #7a5a0e; }
.tag-medium { background: var(--rust-soft); color: #87461a; }
.tag-high { background: #ebcfc5; color: var(--red); }
.tag-none { background: var(--surface-2); color: var(--ink-2); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 22px; }
.fact { padding: 14px 16px; border-radius: var(--r-lg); box-shadow: var(--press); }
.fact b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fact small { color: var(--ink-2); }

.zones-wrap { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.zones { display: grid; grid-template-columns: repeat(3, 26px); gap: 5px; padding: 8px; border-radius: 12px; box-shadow: var(--press); flex: none; }
.zones i { width: 26px; height: 20px; border-radius: 5px; background: var(--surface-2); }
.zones-wrap p { font-size: 13.5px; color: var(--ink-2); }

.advice h3 { font-size: 15px; margin-bottom: 10px; }
.advice ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.advice li { position: relative; padding-left: 22px; color: var(--ink-2); }
.advice li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border-radius: 3px; background: var(--leaf); transform: rotate(45deg); }
.advice.warn li::before { background: var(--rust); }
.result-tools { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- segment ---------- */
.seg { display: inline-flex; padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-weight: 550; font-size: 14px; }
.seg button.on { background: var(--surface); box-shadow: var(--raise-sm); color: var(--ink); }

/* ---------- tarix ---------- */
.toolbar { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hist { padding: 8px; }
.hrow {
  display: grid; grid-template-columns: 84px 1fr auto auto; gap: 18px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: var(--r-lg); cursor: pointer; transition: box-shadow .15s; border: 0; background: none; width: 100%; text-align: left;
}
.hrow + .hrow { margin-top: 2px; }
.hrow:hover { box-shadow: var(--press); }
.hrow img { width: 84px; height: 62px; border-radius: 10px; object-fit: cover; display: block; background: #c7cfc3; }
.hrow b { display: block; }
.hrow small { color: var(--ink-3); }
.hrow .idx { font-family: var(--display); font-weight: 600; font-size: 20px; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 50px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

/* ---------- statistika ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 28px; }
.kpi { padding: 20px 22px; }
.kpi b { display: block; font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.04em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-2); font-size: 14px; }
.kpi small { color: var(--ink-3); }
.stat-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.lg-ok { background: var(--leaf); } .lg-bad { background: var(--rust); }
.chart { margin-top: 18px; }
.chart svg { width: 100%; height: 240px; display: block; overflow: visible; }
.chart text { font-size: 11px; fill: var(--ink-3); font-family: var(--font); }
.sev-bars { display: grid; gap: 14px; margin-top: 16px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 12px; align-items: center; font-size: 14px; }
.bar-row .track { height: 12px; border-radius: 999px; box-shadow: var(--press); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- qurilmalar ---------- */
.devices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-bottom: 28px; }
.dev { padding: 24px; }
.dev-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.dev-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--ink-2); }
.dev-ico svg { width: 26px; height: 26px; }
.dev.on .dev-ico { color: var(--leaf); }
.dev-top .grow { flex: 1; }
.state { font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.state.on { color: var(--leaf); } .state.on::before { background: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-soft); }
.state.off { color: var(--red); } .state.off::before { background: var(--red); }
.dev dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 20px; }
.dev dl div { padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--press); }
.dev dt { font-size: 12.5px; color: var(--ink-3); }
.dev dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dev-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.note-card .steps { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 6px; }

/* ---------- sozlamalar ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.settings h2 { margin-bottom: 18px; }
.cam-field { padding: 16px; border-radius: var(--r-lg); box-shadow: var(--press); margin-bottom: 18px; }
.cam-field h3 { font-size: 14px; margin-bottom: 12px; color: var(--ink-2); }
.cam-field .field { margin-bottom: 12px; }
.cam-field .field input.inset { height: 42px; background: var(--surface-2); box-shadow: var(--raise-sm); }
.sysinfo { border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 6px; font-size: 14px; }
.sysinfo div { display: flex; justify-content: space-between; gap: 10px; }
.sysinfo span { color: var(--ink-2); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(60, 72, 60, .28); backdrop-filter: blur(3px); }
.modal-box { width: min(980px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; position: relative; }
.modal-close { position: absolute; right: 18px; top: 18px; z-index: 2; }
.note-area { width: 100%; min-height: 80px; resize: vertical; padding: 12px 14px; outline: none; margin: 8px 0 12px; }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; display: grid; gap: 10px; z-index: 50; }
.toast { padding: 13px 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--raise); max-width: 360px; font-size: 14px; border-left: 4px solid var(--leaf); }
.toast.err { border-left-color: var(--red); }

/* ---------- moslashuvchan ---------- */
@media (max-width: 1180px) {
  .result-body { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .stat-grid, .settings { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 30; padding: 8px 10px; background: var(--surface); box-shadow: 0 -6px 16px var(--lo); flex-direction: row; }
  .rail-brand, .rail-foot { display: none; }
  .rail-nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 4px; }
  .rail-nav a { flex-direction: column; height: 56px; gap: 3px; justify-content: center; padding: 0 4px; font-size: 11px; text-align: center; }
  .rail-nav a span { line-height: 1.1; }
  .main { padding: 22px 16px 100px; }
  .cams, .devices { grid-template-columns: 1fr; }
  .clock { display: none; }
}
@media (max-width: 560px) {
  .topbar h1 { font-size: 22px; }
  .result { padding: 18px; }
  .result-empty { grid-template-columns: 1fr; text-align: left; }
  .verdict { grid-template-columns: 1fr; justify-items: start; }
  .facts { grid-template-columns: 1fr 1fr; }
  .hrow { grid-template-columns: 64px 1fr auto; }
  .hrow img { width: 64px; height: 50px; }
  .hrow .tag { display: none; }
  .kpis { gap: 14px; }
  .analyze { --s: 80px; }
  .bar-row { grid-template-columns: 90px 1fr 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
