/* Herd, "Night watch". The map is the screen; everything else is glass floating
   on it. Two themes set by data-theme on <html>. Lime is the one signal colour:
   always a fill with dark text on it, never thin text on a light ground. */
:root {
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px; --bar: 54px; --gap: 16px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0b0f12; --solid: #11171a; --glass: rgb(13 18 21 / .8); --card: rgb(255 255 255 / .035); --tile: rgb(255 255 255 / .055);
  --edge: rgb(255 255 255 / .09); --hover: rgb(255 255 255 / .07);
  --ink: #eef2ee; --ink2: #c3ccc6; --mute: #8f9b94; --faint: #66716b; --accent-text: var(--accent);
  --red: #ff7d6f; --red-soft: rgb(255 93 77 / .16); --amber: #f5b54a; --amber-soft: rgb(240 160 32 / .16);
  --blue: #7fb4f5; --blue-soft: rgb(90 160 240 / .16); --ok: #8fd66a; --ok-soft: rgb(143 214 106 / .14);
  --float: 0 18px 50px rgb(0 0 0 / .45); --mapfilter: brightness(.55) saturate(.65) contrast(1.1); --mapbg: #0e1412;
}
[data-theme="light"] {
  color-scheme: light;
  --ground: #edf0ea; --solid: #ffffff; --glass: rgb(255 255 255 / .86); --card: #ffffff; --tile: #f0f3ec;
  --edge: rgb(19 26 21 / .1); --hover: rgb(19 26 21 / .055);
  --ink: #131a15; --ink2: #39443d; --mute: #647068; --faint: #98a39b; --accent-text: var(--accent-deep);
  --red: #c5301d; --red-soft: #fde8e4; --amber: #96590a; --amber-soft: #fbeed3;
  --blue: #1f5fc4; --blue-soft: #e5eefc; --ok: #2f7a1f; --ok-soft: #e1f3d8;
  --float: 0 14px 40px rgb(19 26 21 / .16); --mapfilter: saturate(.92); --mapbg: #2a3329;
}
/* The signal colour: a fill with dark text on it (--accent / --on-accent), and a deeper
   shade for text and thin marks on the light theme (--accent-deep). */
:root { --accent: #f5cb62; --on-accent: #261b02; --accent-deep: #8a5a00; }
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
/* Floating panels scroll without a visible bar. */
.side, .drawer, .sheet, .strip { scrollbar-width: none; } .side::-webkit-scrollbar, .drawer::-webkit-scrollbar, .sheet::-webkit-scrollbar, .strip::-webkit-scrollbar { display: none; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 23px; line-height: 1.2; font-weight: 650; letter-spacing: -0.025em; }
h2, h3 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
a { color: var(--accent-text); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; } button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.mono { letter-spacing: 0; font-weight: 600; }
.mute { color: var(--mute); } .small { font-size: 13px; }
svg.ic { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--float); }

/* ---------- Floating bar and phone tabs ---------- */
.bar { position: fixed; z-index: 1200; top: var(--gap); left: var(--gap); right: var(--gap); height: var(--bar); display: flex; align-items: center; gap: 18px; padding: 0 10px 0 18px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-text) 25%, transparent); }
.brand small { font-size: 12.5px; font-weight: 500; color: var(--mute); letter-spacing: 0; }
.nav { display: flex; gap: 2px; min-width: 0; }
.nav a { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 99px; color: var(--ink2); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.nav b { background: #ff5d4d; color: #fff; border-radius: 99px; font-size: 11px; font-weight: 600; padding: 0 6px; line-height: 17px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--ink2); font-size: 13.5px; white-space: nowrap; }
.tools .farm { font-weight: 600; color: var(--ink); margin-right: 8px; }
.status { display: inline-flex; align-items: center; gap: 7px; margin-right: 6px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7fcf3a; }
.status.off::before { background: #ff5d4d; }
.iconbtn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink2); border: 0; background: none; }
.iconbtn:hover { background: var(--hover); text-decoration: none; }
.iconbtn .pip { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #ff5d4d; }
[data-theme="dark"] .t-light, [data-theme="light"] .t-dark { display: none; }
.tabs { display: none; }

.page { padding: calc(var(--bar) + var(--gap) * 2 + 14px) 24px 64px; max-width: 1240px; margin: 0 auto; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.pagehead p { color: var(--mute); margin-top: 3px; }

/* ---------- Building blocks ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: 99px; border: 1px solid var(--edge); background: var(--tile); font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: rgb(16 21 12 / .1); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.sm { height: 31px; padding: 0 12px; font-size: 13px; } .btn.wide { width: 100%; height: 44px; border-radius: 12px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--tile); color: var(--ink2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.crit { background: var(--red-soft); color: var(--red); }
.chip.warn { background: var(--amber-soft); color: var(--amber); } .chip.info { background: var(--blue-soft); color: var(--blue); }
.chip.plain::before { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.crit { background: #ff5d4d; } .dot.warn { background: #f0a020; } .dot.info { background: #5aa0f0; } .dot.ok { background: #7fcf3a; }

.stats, .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat, .kpi { background: var(--tile); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.stat b, .kpi .val { display: block; font-size: 27px; line-height: 1.12; font-weight: 650; letter-spacing: -0.035em; }
.stat b small, .kpi .val small { font-size: 14px; font-weight: 500; color: var(--faint); letter-spacing: -0.01em; }
.stat span, .kpi .label, .kpi .sub { font-size: 12.5px; color: var(--mute); display: block; }
.kpi { display: flex; flex-direction: column; } .kpi .label { order: 2; } .kpi .sub { order: 3; color: var(--faint); } .kpi .sub:empty { display: none; }
.stat.hot b { color: var(--red); }

.sec { background: var(--card); border: 1px solid var(--edge); border-radius: var(--r); padding: 16px 20px 10px; min-width: 0; margin-bottom: var(--gap); }
.sec > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; min-height: 28px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }

.list { display: grid; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 11px 0; border: 0; border-top: 1px solid var(--edge); text-align: left; background: none; width: 100%; }
.list > .item:first-child { border-top: 0; }
button.item:hover { background: var(--hover); box-shadow: -10px 0 0 var(--hover), 10px 0 0 var(--hover); }
.item.c3 { grid-template-columns: minmax(0, 1fr) auto auto; }
.item b { font-weight: 600; } .item .sub { display: block; color: var(--mute); font-size: 13px; }
.right { text-align: right; justify-self: end; }

table.tbl { width: 100%; border-collapse: collapse; }
.sec { overflow-x: auto; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); padding: 6px 12px 10px 0; border-bottom: 1px solid var(--edge); white-space: nowrap; }
.tbl td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--edge); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr[data-animal] { cursor: pointer; } .tbl tbody tr:hover { background: var(--hover); }
.tbl .r { text-align: right; } .tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl td.mono { white-space: nowrap; } .tbl .sub { display: none; color: var(--mute); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.search { flex: 0 1 300px; height: 38px; border: 1px solid var(--edge); border-radius: 99px; padding: 0 16px; background: var(--card); }
.seg { display: flex; gap: 2px; flex-wrap: wrap; }
.seg button, .tabsline button { height: 32px; padding: 0 13px; border-radius: 99px; border: 0; background: none; color: var(--mute); font-weight: 500; font-size: 13.5px; }
.seg button:hover, .tabsline button:hover { background: var(--hover); }
.seg button[aria-pressed="true"], .tabsline button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.seg button span { opacity: .6; margin-left: 5px; }
.tabsline { display: flex; gap: 4px; margin-bottom: 14px; }

.arow { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px 6px; padding: 14px 0; border-top: 1px solid var(--edge); align-items: start; }
.arow:first-child { border-top: 0; }
.arow .dot { margin-top: 7px; } .arow b { font-weight: 600; }
.arow p { color: var(--ink2); max-width: 70ch; } .arow .meta { color: var(--mute); font-size: 12.5px; margin-top: 3px; }
.arow .btnrow { grid-column: 3; grid-row: 1; align-self: center; }

dl.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; }
dl.facts dt, dl.facts dd { padding: 9px 0; border-top: 1px solid var(--edge); margin: 0; }
dl.facts dt { color: var(--mute); padding-right: 20px; } dl.facts dd { text-align: right; font-weight: 500; }
dl.facts dt:first-of-type, dl.facts dd:first-of-type { border-top: 0; }
.note { color: var(--mute); font-size: 13px; max-width: 72ch; }
.progress { height: 8px; border-radius: 99px; background: var(--tile); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s; }
.spark { width: 100%; height: 54px; display: block; } .spark path { fill: none; stroke: var(--accent-text); stroke-width: 2; }

/* ---------- Overview: full-screen map with floating panels ---------- */
.ov { position: fixed; inset: 0; }
.mapbox { position: absolute; inset: 0; background: var(--mapbg); }
.leaflet-container { font: inherit; background: var(--mapbg); }
.leaflet-tile-pane { filter: var(--mapfilter); }
.leaflet-control-attribution { font-size: 10px; background: rgb(0 0 0 / .35) !important; color: #cfd6d0 !important; } .leaflet-control-attribution a { color: #cfd6d0 !important; }
.ov .leaflet-top { top: calc(var(--bar) + var(--gap) + 8px); } .ov .leaflet-right { right: 6px; }
.leaflet-bar { border: 1px solid var(--edge) !important; box-shadow: var(--float) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-bar a { background: var(--glass) !important; color: var(--ink) !important; border-color: var(--edge) !important; }
.padlabel { color: #fff; font: 600 12.5px/1.25 var(--sans); white-space: nowrap; text-shadow: 0 1px 3px rgb(0 0 0 / .9), 0 0 12px rgb(0 0 0 / .6); }
.padlabel span { display: block; font-weight: 450; font-size: 11.5px; opacity: .9; }
.tip { border: 0; border-radius: 8px; box-shadow: var(--float); font: 500 12px var(--sans); background: var(--solid); color: var(--ink); padding: 4px 9px; } .tip::before { display: none; }
.gw { width: 16px; height: 16px; border-radius: 5px; background: #fff; border: 2px solid #10150c; box-shadow: 0 0 0 5px rgb(255 255 255 / .22); }
.halo { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #ff4a3d; box-shadow: 0 0 0 5px rgb(255 74 61 / .22); }

.side { position: absolute; z-index: 600; top: calc(var(--bar) + var(--gap) * 2); left: var(--gap); width: 336px; max-height: calc(100dvh - var(--bar) - var(--gap) * 3); overflow-y: auto; padding: 20px; }
.side .stats { margin: 16px 0 20px; } .side h3 { margin-bottom: 4px; }
.al { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--edge); background: none; text-align: left; font-size: 13.5px; }
h3 + .al { border-top: 0; } .al:hover { color: var(--accent-text); }
.al .dot { transform: translateY(-1px); } .al time { margin-left: auto; color: var(--mute); font-size: 12px; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--edge); font-size: 12.5px; color: var(--mute); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; border: 1.5px solid #10150c; vertical-align: -1px; }
.strip { position: absolute; z-index: 600; left: calc(336px + var(--gap) * 2); right: var(--gap); bottom: var(--gap); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 6px; }
.pd { border: 0; text-align: left; border-radius: 11px; padding: 10px 12px; background: var(--tile); min-width: 0; }
.pd:hover { background: var(--hover); }
.pd.on { background: var(--accent); color: var(--on-accent); } .pd.on span, .pd.on div { color: inherit; opacity: .85; } .pd.on div { opacity: 1; }
.pd b { font-size: 13px; font-weight: 600; display: block; } .pd div { font-size: 21px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.2; }
.pd span { font-size: 11.5px; color: var(--mute); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pd.rest div { color: var(--faint); }
.sheet { display: none; }

/* ---------- Module pieces ---------- */
.kpi.hot .val { color: var(--red); } .kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tabsline button span { margin-left: 6px; font-size: 11.5px; font-weight: 600; opacity: .7; }
.cols2.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.rowhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.link { all: unset; cursor: pointer; color: var(--accent-text); font-weight: 500; } .link:hover { text-decoration: underline; }
.hotText { color: var(--red); font-weight: 600; }
.tipline { display: block; margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: var(--tile); color: var(--ink2); font-size: 13px; }
.tipline:hover { background: var(--hover); text-decoration: none; } .tipline b { color: var(--ink); }
.chart { width: 100%; height: auto; display: block; margin: 6px 0 8px; }
.chart text { font: 500 11.5px var(--sans); fill: var(--mute); } .chart text.strong { font-weight: 650; font-size: 13px; fill: var(--ink); }
.chart .grid { stroke: var(--faint); stroke-width: 1; } .chart .trend { fill: none; stroke: var(--accent-text); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--solid); stroke: var(--accent-text); stroke-width: 2; } .chart .proj { stroke: var(--mute); stroke-width: 1.5; } .chart .ring { fill: none; stroke: var(--mute); stroke-width: 1.5; }
.quick { display: flex; gap: 8px; padding-top: 4px; }
.quick input { height: 42px; min-width: 0; flex: 1 1 0; border: 1px solid var(--edge); border-radius: 12px; padding: 0 14px; background: var(--tile); font-size: 16px; }
.quick input[name="kg"] { flex: 0 0 96px; } .quick .btn { height: 42px; border-radius: 12px; }
.scanmsg { padding: 10px 0; color: var(--mute); font-size: 13.5px; } .scanmsg.ok { color: var(--ok); font-weight: 600; } .scanmsg.again { color: var(--amber); font-weight: 600; } .scanmsg.unknown { color: var(--red); font-weight: 600; }
.split { display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: hidden; margin: 8px 0 12px; } .split i { min-width: 4px; }
.legend2 { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink2); }
.meter { display: inline-block; width: 84px; height: 6px; border-radius: 99px; background: var(--tile); overflow: hidden; vertical-align: middle; margin-right: 10px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--accent-text); } .meter.over i { background: var(--red); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-weight: 500; } .check input { width: 18px; height: 18px; accent-color: var(--accent-deep); }
.field small { color: var(--mute); font-size: 12.5px; } .err { color: var(--red); font-size: 13.5px; margin-top: 12px; min-height: 0; } .err:empty { display: none; }
.btnrow.end { justify-content: flex-end; margin-top: 18px; }

.tbl tr.off td { opacity: .55; } .tbl tr.off td:last-child { opacity: 1; }
.farmswitch { height: 34px; border-radius: 99px; border: 1px solid var(--edge); background: var(--tile); padding: 0 12px; font-weight: 600; max-width: 180px; margin-right: 6px; }
.copybox { width: 100%; height: 42px; border: 1px solid var(--edge); border-radius: 12px; padding: 0 12px; background: var(--tile); font-size: 13px; }
.batchcount .quick input { flex: 0 0 96px; height: 38px; } .batchcount .quick .btn { height: 38px; }
a.item { color: inherit; } a.item:hover { background: var(--hover); text-decoration: none; box-shadow: -10px 0 0 var(--hover), 10px 0 0 var(--hover); }
dialog .list { max-height: 50dvh; overflow-y: auto; }
#ask { width: min(600px, calc(100% - 32px)); } #ask h3 { margin-bottom: 2px; }

/* ---------- Sign-in and join pages ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.gatecard { width: min(400px, 100%); background: var(--solid); border: 1px solid var(--edge); border-radius: 22px; padding: 30px 28px; box-shadow: var(--float); }
.gatecard .brand { margin-bottom: 22px; } .gatecard h1 { margin-bottom: 4px; }
.gatecard .field input { height: 46px; font-size: 16px; }

/* ---------- Drawer, toast, dialog ---------- */
.scrim { position: fixed; inset: 0; background: rgb(5 8 10 / .4); z-index: 2000; }
.drawer { position: fixed; top: var(--gap); right: var(--gap); bottom: var(--gap); width: min(432px, calc(100% - var(--gap) * 2)); background: var(--solid); border: 1px solid var(--edge); border-radius: 20px; box-shadow: var(--float); z-index: 2001; overflow-y: auto; padding: 22px; display: grid; gap: 20px; align-content: start; }
.drawer .close { position: absolute; top: 14px; right: 14px; }
.drawer .arow { background: var(--tile); border: 0; border-radius: 12px; padding: 12px 14px; grid-template-columns: 18px minmax(0, 1fr); }
.drawer .arow .btnrow { grid-column: 2; grid-row: auto; margin-top: 8px; }
.minimap { height: 220px; border-radius: 14px; overflow: hidden; background: var(--mapbg); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 99px; z-index: 3000; font-weight: 500; box-shadow: var(--float); max-width: calc(100% - 32px); }
dialog { border: 1px solid var(--edge); border-radius: 20px; padding: 24px; width: min(440px, calc(100% - 32px)); background: var(--solid); color: var(--ink); box-shadow: var(--float); }
dialog::backdrop { background: rgb(5 8 10 / .5); } dialog h2 { font-size: 18px; text-transform: none; letter-spacing: -0.02em; color: var(--ink); }
.field { display: grid; gap: 5px; margin-top: 14px; } .field span { font-size: 13px; color: var(--ink2); font-weight: 500; }
.field input, .field select { height: 40px; border: 1px solid var(--edge); border-radius: 12px; padding: 0 12px; background: var(--tile); }
.steps { display: flex; gap: 3px; } .steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--tile); } .steps i.on { background: var(--accent); }

/* Motion: short, opacity-led, and only where it explains a change. Nothing loops. */
@media (prefers-reduced-motion: no-preference) {
  .enter .page, .enter .side, .enter .strip { animation: fade .18s ease-out both; }
  @keyframes fade { from { opacity: 0; } }
  .drawer { animation: slide .2s cubic-bezier(.2, .7, .2, 1); } @keyframes slide { from { transform: translateX(10px); opacity: 0; } }
  dialog[open] { animation: pop .16s ease-out; } @keyframes pop { from { opacity: 0; transform: translateY(4px); } }
  .nav a, .btn, .item, .pd, .seg button, .tabsline button, .iconbtn { transition: background-color .12s ease, color .12s ease; }
}

/* ---------- Narrower ---------- */
@media (max-width: 1180px) {
  .tools .farm, .status span { display: none; } .nav a { padding: 0 10px; }
  .pd span, .hide-md { display: none; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --gap: 10px; --bar: 50px; }
  body { font-size: 15px; }
  .bar .nav { display: none; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 1500; left: var(--gap); right: var(--gap); bottom: calc(var(--gap) + env(safe-area-inset-bottom)); padding: 5px; border-radius: 22px; }
  .tabs a { display: grid; justify-items: center; gap: 1px; padding: 7px 0 5px; border-radius: 16px; color: var(--mute); font-size: 11px; font-weight: 500; position: relative; }
  .tabs a:hover { text-decoration: none; } .tabs a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
  .tabs .pip { position: absolute; top: 6px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: #ff5d4d; }
  .page { padding: calc(var(--bar) + 34px) 14px 110px; }
  .side, .strip { display: none; }
  .sheet { display: block; position: absolute; z-index: 600; left: var(--gap); right: var(--gap); bottom: calc(var(--gap) + 74px + env(safe-area-inset-bottom)); padding: 6px 16px 14px; border-radius: 22px; max-height: 72dvh; overflow-y: auto; }
  .grab { display: block; width: 100%; height: 22px; border: 0; background: none; position: relative; }
  .grab::after { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px; border-radius: 9px; background: var(--faint); }
  .headline { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 12px; }
  .headline em { font-style: normal; } .headline em.crit { color: var(--red); } .headline em.warn { color: var(--amber); } .headline em.info { color: var(--blue); }
  .sheet .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; } .sheet .stat b { font-size: 22px; }
  .sheet .more { display: none; padding-top: 16px; } .sheet.open .more { display: block; } .sheet h3 { margin: 6px 0 2px; }
  .strip2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; } .strip2 .pd span { display: block; }
  .ov .leaflet-control-zoom { display: none; } .padlabel span { display: none; }
  .cols2, .cols2.wide-left { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabsline { overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; } .tabsline::-webkit-scrollbar { display: none; } .tabsline button { white-space: nowrap; flex: none; height: 36px; }
  .meter { width: 56px; }
  .sec { padding: 14px 16px 8px; }
  .btn { height: 42px; } .btn.sm { height: 36px; } .search { height: 44px; flex-basis: 100%; } .seg button { height: 36px; }
  .signout { display: none; }
  .console .bar { height: auto; flex-wrap: wrap; padding: 8px 10px 8px 16px; row-gap: 4px; } .console .bar .nav { display: flex; order: 3; width: 100%; } .console .page { padding-top: 134px; }
  .hide-m, .tbl thead { display: none; } .tbl .sub { display: block; } .tbl td { padding: 12px 10px 12px 0; }
  .arow { grid-template-columns: 18px minmax(0, 1fr); } .arow .btnrow { grid-column: 2; grid-row: auto; margin-top: 8px; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; border: 0; padding: 18px 16px 32px; } .toast { bottom: 96px; }
}

