* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1d2329; background: #f4f6f8; }
header { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between;
         padding: 8px 16px; background: #1f2a33; color: #fff; }
header a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; }
nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; align-items: center; }
nav a, nav button { color: #dfe7ee; background: none; border: 0; font: inherit; cursor: pointer; padding: 4px 0;
                    min-height: 0; font-weight: 400; }
main { max-width: 860px; margin: 0 auto; padding: 12px 16px 48px; }
main.wide { max-width: 1240px; }
h1 { font-size: 22px; margin: 6px 0 10px; overflow-wrap: anywhere; }
h2 { font-size: 17px; margin: 0 0 8px; }
main > h2 { margin: 22px 0 8px; }
.card { background: #fff; border: 1px solid #dde3e8; border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.card.click { cursor: pointer; display: block; color: inherit; text-decoration: none; }
.card.warn { background: #fff7dd; border-color: #f0d68a; }
.card.alarm { background: #d72f2f; color: #fff; border-color: #b81f1f; }
.card.alarm .muted { color: #ffe1e1; }
.card.alarm button { border-color: #fff; background: #fff; color: #b81f1f; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.row.spread { justify-content: space-between; }
.muted { color: #66717c; font-size: 14px; }
.big { font-size: 20px; font-weight: 700; }
p { margin: 6px 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 600; font-size: 14px;
         background: #e4e7eb; color: #4a545e; }
.badge.ok { background: #dff3e4; color: #17642e; }
.badge.missing { background: #d72f2f; color: #fff; }
.badge.stopping { background: #fff1cc; color: #7a5600; }
.badge.tracking { background: #dbe9ff; color: #174ea6; }
button, .button { display: inline-block; font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 8px;
                  border: 1px solid #b8c2cc; background: #fff; color: #1d2329; cursor: pointer; min-height: 44px;
                  text-decoration: none; text-align: center; }
button.primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
button.danger { background: #d72f2f; border-color: #b81f1f; color: #fff; }
button.link { background: none; border: 0; color: #1f6feb; padding: 4px 0; min-height: 0; font-weight: 400;
              text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input, select { font: inherit; padding: 9px 10px; border: 1px solid #b8c2cc; border-radius: 8px; min-height: 44px;
                width: 100%; max-width: 360px; background: #fff; color: inherit; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; flex: none; margin: 0; }
input[type=range] { width: 100%; max-width: none; padding: 0; border: 0; min-height: 36px; background: none; }
label { display: block; margin: 10px 0 4px; font-size: 14px; color: #4a545e; }
label.inline { display: flex; gap: 10px; align-items: flex-start; color: inherit; font-size: 16px; margin: 10px 0; }
.map { height: 340px; border-radius: 10px; border: 1px solid #dde3e8; margin: 12px 0; z-index: 0; background: #e8ecef; }
.leaflet-tooltip.newest { background: #1f2a33; color: #fff; border: 0; font-weight: 600; padding: 3px 7px; box-shadow: none; }
.leaflet-tooltip.newest::before { display: none; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #edf0f3; vertical-align: top; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tiles div { background: #f4f6f8; border-radius: 8px; padding: 10px; }
.tiles .big { display: block; }
.error { color: #b81f1f; font-weight: 600; }
.ok { color: #17642e; font-weight: 600; }
.card.alarm .error { color: #fff; }
.copy { display: block; word-break: break-all; background: #f4f6f8; border: 1px dashed #b8c2cc; border-radius: 8px;
        padding: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; user-select: all; }
.setting { padding: 10px 0; border-top: 1px solid #edf0f3; }
.setting:first-of-type { border-top: 0; }
.setting .row { justify-content: space-between; }
.setting .value { font-weight: 600; white-space: nowrap; }
.setting label { margin: 0; font-size: 15px; color: inherit; }
pre { margin: 8px 0; padding: 10px; background: #1f2a33; color: #e8eef3; border-radius: 8px; overflow-x: auto;
      font: 13px/1.4 ui-monospace, Consolas, monospace; }
.qr { max-width: 360px; }
.qr svg { display: block; width: 100%; height: auto; background: #fff; }
.tabs { display: flex; gap: 14px; margin: 4px 0 10px; font-size: 15px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .map { height: 300px; } }
@media print { header, button, .noprint { display: none; } body { background: #fff; } .card { border: 0; } }
