/* Inter (OFL, vendor/inter): latin, cyrillic and cyrillic-ext, which holds Mongolian Ө and Ү */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(vendor/inter/inter-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(vendor/inter/inter-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(vendor/inter/inter-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(vendor/inter/inter-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-700-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(vendor/inter/inter-cyrillic-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --bg: #f4f6f9; --panel: #ffffff; --panel-2: #f8fafc; --ink: #0f1b2d; --ink-2: #3d4a5c; --muted: #5b6779;
  --line: #e3e8ef; --line-2: #eef1f5;
  --accent: #1f5fd6; --accent-ink: #174aa8; --accent-soft: #eaf1fd; --accent-ring: #dce6f7;
  /* Incident states: orange = Suspected, red = Confirmed / overdue, green = done; they differ in lightness too */
  --suspected: #9a3412; --suspected-soft: #ffe8d9;
  --fire: #b42318; --fire-strong: #d92d20; --fire-soft: #fef3f2; --fire-line: #f3b4ae;
  --confirmed: #b42318; --warn: #92400e; --warn-soft: #fef5e1;
  --ok: #166534; --ok-soft: #eaf7ee; --silent: #9aa3b2;
  --header: var(--accent);   /* primary buttons on every page */
  --radius: 12px; --shadow: 0 4px 16px rgba(15, 27, 45, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* our display rules must not unhide */
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
       background: var(--bg); display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.error { color: var(--fire); margin: 0; }

/* Header: every page */
header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 10px 24px; min-height: 64px;
         background: var(--panel); border-bottom: 1px solid var(--line); }
header > h1, .brand h1 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
header > h1 { flex: 1; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; }
.subtitle { font-size: 12px; color: var(--muted); }
.mark { width: 34px; height: 34px; flex: none; }
.mark rect { fill: var(--accent); }
.mark path { fill: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 320px; }
.tab, .register-link { text-decoration: none; padding: 8px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 500;
                       font-size: 14px; }
.tab:hover, .register-link:hover { background: var(--panel-2); color: var(--ink); }
.tab.current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
header > .register-link { border: 1px solid var(--line); }
header .who { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--line);
       border-radius: 999px; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-ring); color: var(--accent-ink);
          display: grid; place-items: center; font-weight: 600; }
.who-text { display: flex; flex-direction: column; line-height: 1.2; }
#who-name { font-weight: 600; }
#who-role { font-size: 12px; color: var(--muted); }
button.link { background: none; border: 0; color: var(--accent); padding: 0 0 0 6px; font-size: 13px; font-weight: 500; }
button.link:hover { text-decoration: underline; }
.lang { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
        color: var(--ink-2); font-size: 13px; font-weight: 600; }
.banner { background: var(--warn-soft); color: var(--warn); padding: 8px 24px; border-bottom: 1px solid #f2d79b; font-weight: 500; }

/* Login */
.login { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.login form { background: var(--panel); padding: 28px; border: 1px solid var(--line); border-radius: 16px; width: min(380px, 100%);
              display: grid; gap: 14px; box-shadow: var(--shadow); }
.login .mark { width: 40px; height: 40px; }
.login h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.login label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.login input { font: inherit; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.login input:focus { border-color: var(--accent); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.login button { height: 44px; background: var(--accent); color: #fff; border: 0; border-radius: 10px; font-weight: 600; }
.login button:hover { background: var(--accent-ink); }

/* Dashboard: summary strip, then three columns */
.app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 16px 24px 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
       display: flex; flex-direction: column; gap: 4px; min-height: 84px; }
.kpi .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi .value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.kpi strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .note.bad { color: var(--fire); }
.kpi .note.warn { color: var(--warn); }
.kpi .note.good { color: var(--ok); }
.kpi .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 13px;
             font-weight: 500; color: var(--muted); }
.kpi .go { width: 28px; height: 28px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
           display: grid; place-items: center; flex: none; }
.kpi .go:hover { border-color: var(--accent); background: var(--accent-soft); }
.kpi .go svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; }
.kpi strong small { font-size: 16px; color: var(--muted); font-weight: 600; }
.kpi.alarm strong { color: var(--fire); }
.kpi .pill { padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; margin-right: 6px; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px;
               border-radius: 999px; background: var(--fire); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 1px; }

.app > main { min-height: 620px; flex: 1; display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(280px, 340px);
              gap: 16px; padding: 16px 24px 24px; min-height: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.list-panel, .detail-panel { overflow-y: auto; }
.panel-head { padding: 16px 16px 12px; display: grid; gap: 12px; border-bottom: 1px solid var(--line-2);
              position: sticky; top: 0; background: var(--panel); z-index: 1; border-radius: 14px 14px 0 0; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line);
          border-radius: 10px; background: var(--panel-2); }
.search:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-ring); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { border: 0; background: transparent; font: inherit; flex: 1; min-width: 0; outline: none; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-size: 13px; font-weight: 500; padding: 6px 12px; min-height: 32px; border-radius: 999px;
                border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); }
.chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.empty { padding: 0 16px; }

.incidents { list-style: none; margin: 0; padding: 12px; display: grid; gap: 10px; }
.incident { border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--panel);
            display: grid; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.incident:hover { border-color: #c9d3e0; }
.incident.unack { border-color: var(--fire-line); }
.incident.overdue { background: var(--fire-soft); border-color: var(--fire-line); }
.incident.closed { background: var(--panel-2); }
.incident.selected { box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.incident .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.incident .num { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.incident.closed .num { color: var(--muted); font-weight: 600; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--suspected-soft);
         color: var(--suspected); white-space: nowrap; }
.badge.confirmed { background: var(--fire-strong); color: #fff; }
.badge.closed { background: var(--line-2); color: var(--ink-2); }
.incident .meta { color: var(--ink-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.incident .status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.incident .status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.incident .ack { color: var(--ok); }
.incident .unack-label { color: var(--warn); }
.incident.overdue .unack-label { color: var(--fire); }
.incident button.acknowledge { min-height: 44px; width: 100%; background: var(--fire); color: #fff; border: 0;
                               border-radius: 10px; font-weight: 700; font-size: 15px; }
.incident button.acknowledge:hover { background: #912018; }
.incident button.acknowledge:disabled { opacity: .6; }
.failed { padding: 10px 12px; background: var(--fire-soft); border: 1px solid var(--fire-line); border-radius: 10px;
          color: var(--fire); font-weight: 600; font-size: 13px; }
.failed a { color: inherit; }
.closed-section { margin: 0 12px 12px; }
.closed-section summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 4px; }
.closed-section .incidents { padding: 6px 0 0; }

/* Map */
.map-wrap { position: relative; min-height: 420px; overflow: hidden; }
#map { position: absolute; inset: 0; border-radius: 14px; background: #eef3ea; }
.wind { position: absolute; top: 12px; right: 12px; z-index: 500; background: var(--panel); border: 1px solid var(--line);
        border-radius: 12px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; font-size: 13px;
        box-shadow: var(--shadow); }
.wind svg { width: 36px; height: 36px; }
.wind strong { display: block; font-size: 15px; }
.wind small { display: block; color: var(--muted); font-size: 12px; }
.map-foot { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 500; display: flex; flex-wrap: wrap;
            align-items: flex-end; justify-content: space-between; gap: 8px; pointer-events: none; }
.map-note { margin: 0; max-width: 440px; font-size: 12px; background: rgba(255, 255, 255, .92); padding: 6px 10px;
            border-radius: 8px; color: var(--muted); border: 1px solid var(--line); }
.legend { list-style: none; margin: 0; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px;
          color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.fire { background: var(--fire-strong); }
.dot.node { background: var(--accent); }
.dot.silent { background: #fff; border: 2px solid var(--silent); }
.leaflet-container { font-family: inherit; }
.leaflet-bar a { color: var(--ink-2); }
.leaflet-control-attribution { pointer-events: auto; }

/* Selected Incident */
.detail-panel { padding: 18px; }
.detail-panel .empty { padding: 0; }
.detail { display: grid; gap: 16px; font-size: 14px; }
.detail .head { display: grid; gap: 4px; }
.detail .head .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.detail h2 { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail h3 { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 8px; }
.detail ul.nodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.detail ul.nodes li { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; padding: 8px 10px;
                      background: var(--panel-2); border-radius: 8px; }
.detail .readonly { margin: 0; padding: 12px 14px; background: var(--panel-2); border-radius: 10px; font-size: 12px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button, .confirm-step button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--panel);
                                        border-radius: 10px; font-weight: 600; color: var(--ink-2); }
.actions button:hover, .confirm-step button:hover { border-color: #c9d3e0; color: var(--ink); }
.actions button.primary, .confirm-step button.primary { background: var(--fire); color: #fff; border-color: var(--fire); }
.form { display: grid; gap: 8px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.form label { display: flex; gap: 8px; align-items: center; }
.form select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.confirm-step { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; }
.timeline li { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 0 0 12px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%;
                       background: var(--accent); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .who { color: var(--muted); }
.timeline .bad { color: var(--fire); font-weight: 600; }

@media (max-width: 1180px) {
  .app > main { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .detail-panel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  header { padding: 10px 16px; }
  .kpis { padding: 12px 16px 0; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-wind { grid-column: 1 / -1; }
  .app > main { grid-template-columns: 1fr; padding: 12px 16px 16px; gap: 12px; }
  .map-wrap { min-height: 340px; }   /* after the list: the Acknowledge button comes first on a phone */
  .list-panel, .detail-panel { overflow: visible; }
}

/* Sensor Node registration by phone (ticket 14) */
.register-page { display: block; }
.register { max-width: 520px; margin: 0 auto; padding: 16px 16px 24px; display: grid; gap: 12px; align-content: start; }
.register form { display: grid; gap: 12px; }
.register fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px 14px;
                     display: grid; gap: 10px; margin: 0; }
.register legend { font-weight: 600; padding: 0 4px; }
.register input, .register select { font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--line);
                                    border-radius: 10px; width: 100%; background: #fff; }
.register #dev-eui { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; }
.register label { display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.register button { min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
                   font-size: 16px; font-weight: 500; }
.register .submit { background: var(--accent); color: #fff; border: 0; font-weight: 600; }
.register .submit:disabled { opacity: .45; cursor: not-allowed; }
.scanner { display: grid; gap: 8px; }
.scanner video { width: 100%; border-radius: 10px; background: #000; }
.gps { margin: 0; font-variant-numeric: tabular-nums; }
.gps.good { color: var(--ok); font-weight: 600; }
.gps.poor { color: var(--fire); font-weight: 600; }
.relocate { border: 1px solid var(--fire-line); border-radius: var(--radius); padding: 12px 14px; background: var(--fire-soft); }
.relocate p { margin: 0 0 8px; }
.done { color: var(--ok); font-weight: 600; margin: 0; }

/* Maintainer network health (ticket 15), Controlled Burns (16), Fire Season (18) */
.health-page { display: block; }
.health { max-width: 1120px; margin: 0 auto; padding: 20px 24px 32px; display: grid; gap: 24px; align-content: start; }
.health h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 10px; align-items: end; }
.filters label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.filters label.check { display: flex; gap: 6px; align-items: center; color: var(--ink); }
.filters select { font: inherit; padding: 7px 8px; min-width: 160px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel-2); }
table.grid th[data-sort] { cursor: pointer; }
table.grid th.sorted::after { content: " ▲"; }
table.grid th.sorted.desc::after { content: " ▼"; }
table.grid .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
table.grid .num { font-variant-numeric: tabular-nums; }
table.grid .bad, .digest .bad { color: var(--fire); font-weight: 600; }
table.grid .good, .digest .good { color: var(--ok); }
table.grid tr.silent-row { background: var(--fire-soft); }
.digest { margin: 0; padding-left: 18px; font-size: 14px; font-variant-numeric: tabular-nums; }

.burn-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 16px; }
.burn-map { height: 340px; border: 1px solid var(--line); border-radius: var(--radius); }
.burn-fields { display: grid; gap: 10px; align-content: start; }
.burn-fields label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.burn-fields input { font: inherit; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.burn-fields .submit { min-height: 44px; background: var(--accent); color: #fff; border: 0; border-radius: 10px; font-weight: 600; }
.burns { display: grid; gap: 12px; }
.burn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.burn h3 { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.burn p { margin: 0; }
.burn .latency { font-weight: 600; }
.link-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-form select { font: inherit; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; }
.link-form button { min-height: 38px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font-weight: 600; }
.late-alerts { margin: 0; padding-left: 18px; font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .burn-form { grid-template-columns: 1fr; } .health { padding: 16px; } }

.season-form { display: grid; gap: 12px; max-width: 560px; }
.season-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 10px 14px; margin: 0; }
.season-form legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.season-form > label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.season-form input[type=date] { font: inherit; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; max-width: 220px; }
.soums { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.soums label.check { display: flex; gap: 6px; align-items: center; }

/* Map layers: Ignition Probability (ticket 27) and Spread Forecast (ticket 24) */
.layer-toggle { position: absolute; top: 12px; left: 56px; z-index: 500; display: inline-flex; align-items: center; gap: 8px;
                height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
                box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.layer-toggle[aria-pressed="false"] { opacity: .65; }
.layer-toggle[aria-pressed="false"] .dot { background: var(--line); }
.dot.ig { background: conic-gradient(#52b788 0 25%, #e9c46a 0 50%, #f4a261 0 75%, #b42318 0); }
.forecast-panel { pointer-events: auto; flex: 1 1 300px; max-width: 420px; background: var(--panel); border: 1px solid var(--line);
                  border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.fc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.fc-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px;
            border-radius: 6px; background: var(--warn-soft); color: var(--warn); }
.fc-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-message { margin: 0; font-size: 13px; color: var(--ink-2); }
.fc-controls { display: grid; gap: 6px; }
.fc-controls input[type=range] { width: 100%; accent-color: #c2410c; margin: 0; }
.fc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.fc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 10px; border-radius: 3px; }
.sw.p90 { background: rgba(194, 65, 12, .75); }
.sw.p50 { background: rgba(234, 88, 12, .45); }
.sw.p10 { background: rgba(245, 158, 11, .35); border: 1px solid #f59e0b; }

/* Below the three columns: Ignition Probability and the week of Fire Signals */
.extras { display: flex; flex-wrap: wrap; gap: 16px; padding: 0 24px 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-width: 0; padding-bottom: 16px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 16px 8px; }
.card h2 { margin: 0; font-size: 16px; font-weight: 700; }
.small { font-size: 12px; }
.ignition-card { flex: 1 1 340px; }
.ig-help { margin: 0; padding: 0 16px 10px; }
.ignition-list { list-style: none; margin: 0; padding: 0 12px; display: grid; gap: 8px; }
.ignition-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
                    padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); }
.ignition-list .pct { grid-row: 1 / span 2; font-weight: 700; font-size: 17px; text-align: center; border-radius: 8px; padding: 6px 0;
                      font-variant-numeric: tabular-nums; }
.ignition-list .who { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.ignition-list .where { font-size: 12px; color: var(--muted); grid-column: 2; }
.ignition-list .cls { grid-row: 1 / span 2; grid-column: 3; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.ig-low { background: #eaf7ee; color: #166534; }
.ig-moderate { background: #fdf6dc; color: #6b4e00; }
.ig-high { background: #ffe8d9; color: #9a3412; }
.ig-very_high { background: #b42318; color: #fff; }
.ig-legend { list-style: none; margin: 12px 0 0; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 12px; }
.ig-legend li { padding: 2px 10px; border-radius: 999px; }
.chart-card { flex: 2 1 420px; }
.chart-card > p { padding: 0 16px; margin: 10px 0 0; }
.week-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: end; height: 170px; padding: 8px 16px 0; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar .count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--ink); color: #fff; }
.bar .count:empty { display: none; }
.bar .fill { width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 14px; }
.bar.none .fill { background: var(--line-2); }
.bar.today .fill { background: var(--accent-ink); }
.bar .day { font-size: 12px; color: var(--muted); }
.bar.today .day { color: var(--ink); font-weight: 700; }
@media (max-width: 760px) { .extras { padding: 0 16px 16px; } }

/* Settings page (ticket 29) */
.settings { max-width: 980px; }
.set-intro { margin: 0 0 12px; }
.set-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.set-nav .chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
                 color: var(--ink-2); text-decoration: none; }
.set-nav .chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.set-sections { display: grid; gap: 16px; margin-bottom: 16px; }
.set-card { scroll-margin-top: 16px; }
.set-card > p.muted { margin: 0 16px 8px; }
.set-body { padding: 4px 16px 0; display: grid; gap: 10px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.set-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); align-content: start; }
.set-field small { font-size: 12px; }
.settings input, .settings select, .settings textarea { font: inherit; color: var(--ink); height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.settings textarea { height: auto; padding: 8px 10px; resize: vertical; }
.settings input:focus, .settings select:focus, .settings textarea:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring); }
.settings input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.settings input.short { width: 96px; }
.settings input.strong { font-weight: 600; }
.set-inline { display: flex; gap: 8px; }
.set-inline input { width: 0; flex: 1; }
.set-sub { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px 12px; margin: 0; }
.set-sub legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.set-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.set-row input { flex: 1 1 160px; }
.set-row input.phone { flex: 0 1 170px; }
.set-row input.short { flex: 0 0 96px; }
.set-row.head { justify-content: space-between; }
.set-aimags { gap: 14px; }
.set-aimag { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: var(--panel-2); }
.set-aimag h3 { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.set-soum { border-left: 3px solid var(--accent-ring); padding-left: 10px; display: grid; gap: 6px; }
.set-recipients { display: grid; gap: 6px; justify-items: start; }
.set-recipients .set-row { width: 100%; }
.set-table td { padding: 6px 8px; }
.set-table input { width: 100%; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.icon-btn:hover { border-color: var(--fire-line); color: var(--fire); background: var(--fire-soft); }
button.link.danger { color: var(--fire); }
.set-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px 0; }
.set-foot .primary { min-height: 38px; padding: 0 16px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font-weight: 600; }
.set-foot .primary:hover { background: var(--accent-ink); }
.set-foot .primary:disabled { opacity: .6; }
.set-note { margin: 0; font-size: 13px; }
.set-note.ok { color: var(--ok); font-weight: 600; }
.set-note.error { font-weight: 600; }
.set-history { margin: 0; padding: 4px 16px 0 36px; font-size: 14px; font-variant-numeric: tabular-nums; display: grid; gap: 4px; }
#history-section > h2 { padding: 16px 16px 4px; }
#history-section > p { margin: 0 16px; }
@media (max-width: 760px) { .set-row input.phone { flex: 1 1 160px; } }

/* Sensor Node data (ticket 31) */
.nodes-page { display: block; }
.nodes-note { padding: 20px 24px; margin: 0; }
.nodes-layout { display: flex; flex-wrap: wrap; gap: 16px; padding: 20px 24px 32px; align-items: flex-start; }
.node-list-panel { flex: 1 1 280px; max-width: 340px; min-width: 0; }
.node-list-panel .panel-head { display: grid; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line-2); }
.card-head.flat { padding: 0; }
.node-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; max-height: calc(100vh - 230px); overflow-y: auto; }
.node-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border-radius: 10px;
             text-decoration: none; color: inherit; }
.node-item:hover { background: var(--panel-2); color: inherit; }
.node-item[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.node-item .id { font-size: 13px; font-weight: 600; }
.node-item .state { font-size: 12px; font-weight: 600; text-align: right; }
.node-item .state.ok { color: var(--ok); } .node-item .state.fire { color: var(--fire); }
.node-item .state.silent, .node-item .state.none { color: var(--muted); }
.node-item .where { font-size: 12px; color: var(--ink-2); }
.node-item .age { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.node-item.silent { background: var(--panel-2); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.node-main { flex: 999 1 600px; min-width: 0; display: grid; gap: 16px; }
.node-main > .empty.card { padding: 32px; text-align: center; }
#node-view { display: grid; gap: 16px; }
#node-view[hidden] { display: none; }
.node-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 18px 20px; }
.node-id { display: grid; gap: 4px; flex: 1 1 320px; min-width: 0; }
.node-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.node-title-row h2 { margin: 0; font-size: 20px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.fire { background: var(--fire-soft); color: var(--fire); border: 1px solid var(--fire-line); }
.badge.silent, .badge.none { background: var(--line-2); color: var(--ink-2); }
.badge.season { background: #fff4e5; color: #92400e; }
.node-facts { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; }
.node-facts div { display: grid; }
.node-facts dt { font-size: 12px; color: var(--muted); }
.node-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.node-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px;
       border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font: inherit; font-size: 13px;
       font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { color: var(--silent); background: var(--panel-2); border-color: var(--line); cursor: default; }
.node-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.tile .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tile .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .unit { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.tile .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile.alarm { background: var(--fire-soft); border-color: var(--fire-line); }
.tile.alarm .value, .tile.alarm .label, .tile.alarm .sub { color: var(--fire); }
.chart-card-node { padding: 16px 20px 18px; display: grid; gap: 10px; }
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.chart-toolbar h2 { margin: 0; font-size: 16px; font-weight: 700; }
.range-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--panel-2); }
.segmented button { font: inherit; font-size: 13px; height: 32px; padding: 0 12px; border: 0; border-radius: 7px;
                    background: transparent; color: var(--ink-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--panel); color: var(--accent-ink); font-weight: 600;
                                         box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.range-field { display: grid; gap: 2px; font-size: 11px; color: var(--muted); }
.range-field input { font: inherit; font-size: 13px; height: 38px; padding: 0 8px; border: 1px solid var(--line);
                     border-radius: 8px; color: var(--ink); background: var(--panel); }
.chart-toolbar .icon-btn { width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.chart-toolbar .icon-btn:disabled { opacity: .45; cursor: default; }
.btn.live[aria-pressed="true"] { background: var(--ok-soft); border-color: #b7e1c4; color: var(--ok); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--silent); }
.btn.live[aria-pressed="true"] .dot-live { background: #16a34a; }
.chart-note { margin: 0; }
.btn.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
/* one chart per quantity (ticket 47): two side by side where there is room */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(420px, 34%)), 1fr)); gap: 6px 24px; min-width: 0; }
.charts .chart { min-width: 0; }
.charts .u-legend { font-size: 12px; text-align: left; padding: 0 0 4px 52px; }
.charts .u-legend .u-marker { width: 12px; height: 3px; border-radius: 2px; }
.charts .u-select { background: rgba(31, 95, 214, .12); }
.node-bottom { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.latest-card { flex: 1 1 320px; min-width: 0; padding-bottom: 16px; }
.latest { margin: 0; padding: 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px;
          font-variant-numeric: tabular-nums; }
.latest dt { color: var(--muted); }
.latest dd { margin: 0; }
.latest dd.gateways { display: grid; gap: 2px; }
.latest .gw.best { font-weight: 600; }
.latest dd.wide { grid-column: 1 / -1; }
.latest .payload summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.latest .payload code { display: block; margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--ink);
                        color: #e3e8ef; font-size: 12px; word-break: break-all; }
.messages-card { flex: 2 1 520px; min-width: 0; }
.table-wrap.flat { border: 0; border-radius: 0; border-top: 1px solid var(--line-2); max-height: 520px; overflow-y: auto; }
.table-wrap.flat thead th { position: sticky; top: 0; z-index: 1; }
#messages tr.fire-row { background: var(--fire-soft); }
#messages .bad { color: var(--fire); font-weight: 600; }
.messages-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 16px 0; }

/* map: latest values beside each Node from zoom 13, rich tooltip, quick view (ticket 31) */
.leaflet-tooltip.node-label { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px;
  font-size: 12px; color: var(--ink); box-shadow: 0 2px 8px rgba(15, 27, 45, .14); font-variant-numeric: tabular-nums; }
.leaflet-tooltip.node-label::before { display: none; }
.leaflet-tooltip.node-label .age { color: var(--muted); }
.leaflet-tooltip.node-label.fire { border: 1.5px solid var(--fire-strong); }
.leaflet-tooltip.node-label.silent { color: var(--muted); background: var(--panel-2); }
.leaflet-tooltip.node-tip { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(15, 27, 45, .2); }
.node-tip-body { display: grid; gap: 6px; width: 250px; white-space: normal; font-size: 13px; font-variant-numeric: tabular-nums; }
.node-tip-body .tip-top { display: flex; justify-content: space-between; gap: 8px; }
.node-tip-body .good { color: var(--ok); font-weight: 600; } .node-tip-body .bad { color: var(--fire); font-weight: 600; }
.tip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tip-grid .cell { display: grid; background: var(--panel-2); border-radius: 8px; padding: 5px 7px; }
.tip-grid .cell small { font-size: 11px; color: var(--muted); }
.tip-grid .cell.bad { background: var(--fire-soft); color: var(--fire); }
.tip-grid .cell.warn { background: #fff4e5; color: #92400e; }
.detail .icon-close { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
                      color: var(--muted); cursor: pointer; }
.detail .node-incident { text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--fire-soft);
                         border: 1px solid var(--fire-line); color: var(--fire); font: inherit; font-weight: 600; cursor: pointer; }
.node-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-variant-numeric: tabular-nums; }
.node-quick .q { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.node-quick .q small { font-size: 12px; color: var(--muted); }
.node-quick .q b { font-size: 18px; }
.node-quick .q.alarm { background: var(--fire-soft); } .node-quick .q.alarm b { color: var(--fire); }
.node-quick .spark { width: 100%; height: 26px; }
.detail ul.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.detail ul.recent li { display: flex; justify-content: space-between; gap: 8px; font-family: inherit; padding: 0; }
.detail ul.recent li.bad span:first-child { color: var(--fire); font-weight: 600; }
.detail .node-all { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; border-radius: 10px;
                    background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.detail .node-all:hover { background: var(--accent-ink); color: #fff; }
@media (max-width: 760px) {
  .nodes-layout { padding: 12px; }
  .node-list-panel { max-width: none; }
  .node-list { max-height: 260px; }
  .range-controls { width: 100%; }
}
.node-list-panel .search input { min-width: 0; width: 100%; }

/* Network status (ticket 30): like the Nodes page, with a map of the whole network */
.net-view { display: grid; gap: 16px; }
.net-view[hidden] { display: none; }
.overview-item .id { font-weight: 700; }
.card-body { padding: 0 16px 4px; }
.card > .card-head + .card-body { margin-top: 0; }
#late-section ul, #digest-section .digest { margin: 0; }
.net-map-card { padding-bottom: 12px; }
.net-map { height: 520px; margin: 0 16px; border-radius: 10px; border: 1px solid var(--line); }
.map-help { margin: 8px 16px 0; }
.net-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--ink-2); }
.net-legend li { display: inline-flex; align-items: center; gap: 6px; }
.net-legend .sym { width: 12px; height: 12px; background: var(--ink); display: inline-block; }
.net-legend .sym.gw-border { transform: rotate(45deg) scale(.85); }
.net-legend .sym.gw-relay { clip-path: polygon(50% 0, 100% 100%, 0 100%); background: #7c3aed; }
.net-legend .line { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.net-legend .line.good { background: #16a34a; } .net-legend .line.fair { background: #d97706; } .net-legend .line.poor { background: #d92d20; }
.gw-icon span { display: block; width: 16px; height: 16px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(15, 27, 45, .45); }
.gw-icon.border span { background: var(--ink); transform: rotate(45deg); }
.gw-icon.relay span { background: #7c3aed; clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; width: 18px; height: 18px; }
.gw-icon.offline span { background: var(--fire-strong); }
.gw-icon.offline.border span { outline: 3px solid rgba(217, 45, 32, .35); }
#links .snr.good, #gw-links .snr.good { color: var(--ok); font-weight: 600; }
#links .snr.bad, #gw-links .snr.bad, #gw-events .bad { color: var(--fire); font-weight: 600; }
#gw-params dd { word-break: break-word; }
@media (max-width: 760px) { .net-map { height: 380px; margin: 0 8px; } }

/* Node Config card (ticket 33) */
.config-card { padding-bottom: 12px; }
.config-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; padding: 0 16px; }
.config-now { flex: 1 1 340px; min-width: 0; display: grid; gap: 8px; }
.config-now .table-wrap.flat { border: 1px solid var(--line); border-radius: 10px; max-height: none; }
.config-table { width: 100%; }
table.grid.config-table th, table.grid.config-table td { white-space: normal; }
.config-table tbody th { text-align: left; font-weight: 500; color: var(--ink-2); width: 40%; }
.config-table td { font-variant-numeric: tabular-nums; }
.config-table td.changed { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.config-source { margin: 0; }
.config-form { flex: 1 1 420px; min-width: 0; display: grid; gap: 12px; padding: 14px; background: var(--panel-2);
               border: 1px solid var(--line); border-radius: 12px; }
.config-form h3 { margin: 0; font-size: 14px; }
.config-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.unit-input { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.unit-input input { width: 0; flex: 1; max-width: 120px; font-variant-numeric: tabular-nums; }
.config-form input[aria-invalid="true"] { border-color: var(--fire-strong); background: var(--fire-soft); }
.config-periods { display: grid; gap: 6px; margin-bottom: 8px; }
.config-periods .set-row input { flex: 0 0 96px; }
.config-form fieldset .btn { justify-self: start; }
.config-form fieldset small.muted { display: block; margin-top: 6px; font-size: 12px; }
.config-effect { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); }
.segmented.scope { flex-wrap: wrap; }
.config-foot { padding: 0; }
.config-foot .primary.confirming { background: var(--warn); }
.config-foot .set-note.error { color: var(--fire); }
.config-history { margin: 14px 16px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.config-history summary { cursor: pointer; padding: 10px 12px; font-weight: 600; color: var(--ink-2); background: var(--panel-2); }
.config-history td.small { font-size: 12px; color: var(--ink-2); }
.badge.waiting { background: var(--warn-soft); color: var(--warn); }
.badge.applied { background: var(--ok-soft); color: var(--ok); }
.badge.replaced, .badge.muted-badge { background: var(--line-2); color: var(--muted); }
@media (max-width: 560px) { .config-pair { grid-template-columns: 1fr; } }

/* gateway configuration and registration (ticket 34) */
.gw-config-card { padding-bottom: 14px; }
.gw-config-intro { margin: 0 16px 8px; }
.gw-config-body { padding: 0 16px; }
.gw-form { display: grid; gap: 12px; }
.gw-form .set-field.wide textarea { width: 100%; }
.gw-form .set-foot { padding: 0; }
.gw-form .set-note.error { color: var(--fire); }
.gw-register-open { width: 100%; margin-top: 8px; }
.gw-description { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.gw-icon.never span { background: #fff; border: 2px dashed var(--ink-2); box-shadow: none; }
.gw-icon.relay.never span { background: #c4b5fd; }
/* a Node's place: map, change form, history (ticket 35) */
.place-card { padding-bottom: 12px; }
.place-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; padding: 0 16px; }
.place-map-wrap { flex: 1 1 360px; min-width: 0; display: grid; gap: 6px; }
.place-map { height: 320px; border: 1px solid var(--line); border-radius: 10px; }
.place-map-wrap p { margin: 0; }
.place-form { flex: 1 1 380px; min-width: 0; display: grid; gap: 12px; padding: 14px; background: var(--panel-2);
              border: 1px solid var(--line); border-radius: 12px; }
.place-form h3 { margin: 0; font-size: 14px; }
.place-form textarea { width: 100%; }
.place-pin span { display: block; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
                  background: var(--fire-strong); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(15, 27, 45, .4); }
#place-history tr.current-place td { font-weight: 600; }
#place-history table.grid td.small { white-space: normal; min-width: 180px; }

/* soum boundaries (ticket 36) */
.leaflet-tooltip.soum-tip { font-size: 12px; padding: 2px 6px; }
.boundary-hint { margin: 0; font-size: 13px; color: var(--ok); }
.boundary-hint.warn { color: var(--warn); font-weight: 600; }
.set-tabs { margin-bottom: 14px; }
.set-tabs button[aria-selected="true"] { background: var(--panel); color: var(--accent-ink); font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.area-tools { align-items: center; }
.area-tools input[type="search"] { flex: 1 1 260px; max-width: 360px; }
details.set-aimag > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; }
details.set-aimag > summary::-webkit-details-marker { display: none; }
details.set-aimag > summary::before { content: "▸"; color: var(--muted); }
details.set-aimag[open] > summary::before { content: "▾"; }
details.set-aimag .count, .soum-tags .count { font-size: 12px; color: var(--muted); }
.soum-tags { display: inline-flex; gap: 6px; align-items: center; }
.soum-tags .count.has { color: var(--accent-ink); font-weight: 600; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.boundary-pick { font: inherit; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* deleting a Sensor Node or a gateway (ticket 37) */
.delete-card { border-color: var(--fire-line); }
.delete-card .card-head h2 { color: var(--fire); }
.delete-form { display: grid; gap: 12px; padding: 0 16px 16px; max-width: 720px; }
.delete-form .set-foot { padding: 0; }
.delete-effect { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); color: var(--ink-2); }
.delete-effect.warn { background: var(--fire-soft); color: var(--fire); font-weight: 600; }
.delete-history { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.delete-history input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
button.danger { min-height: 38px; padding: 0 16px; border-radius: 8px; border: 0; background: var(--fire); color: #fff;
  font-weight: 600; }
button.danger:disabled { opacity: .45; cursor: not-allowed; }
.delete-form .set-note.error { color: var(--fire); }
.deleted-note { margin: 0 0 12px; padding: 12px 16px; color: var(--ok); font-weight: 600; }
