/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --text: #1f2a24;
  --muted: #6b7a70;
  --border: #ddd8ca;
  --pine: #234d3a;
  --pine-light: #4f9d77;
  --amber: #f2a93b;
  --ok: #2f9e62;
  --bad: #b8483a;
  --land: #eaf0df; --field: #d6e6ae; --field-edge: #a9c27a;
  --water: #7fb8dc; --trail: #8a6a45; --closed: #9b9b95;
  --a1: #d9b400; --a2: #ee7d1f; --a3: #d62f2f;
  --gutter: clamp(12px, 3vw, 28px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141b17;
    --surface: #1c2621;
    --text: #e8efe9;
    --muted: #8a9b90;
    --border: #2c3a33;
    --pine: #2d6a50;
    --ok: #4ec98a;
    --bad: #e0705f;
    --land: #1d2a22; --field: #3a5030; --field-edge: #55743f; --water: #2f6a90; --trail: #b99467; --closed: #6f7570;
    --a1: #e6c83a; --a2: #f59a42; --a3: #ef5b5b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
code { font: 12px ui-monospace, Consolas, monospace; background: color-mix(in srgb, var(--muted) 15%, transparent); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(21px, 4.5vw, 28px); overflow-wrap: anywhere; }
h2 { margin: 28px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
h2.first { margin-top: 0; }
.muted { color: var(--muted); font-size: 13px; }

/* Layout: fluid from ~320px phones up to 1440+ monitors */
.wrap { max-width: 980px; margin: 0 auto; padding: 20px var(--gutter) 64px; }
.wrap.wide { max-width: 1480px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 10px var(--gutter); border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a { font-size: 14px; padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.nav a:hover { color: var(--text); }
.nav a.active { background: color-mix(in srgb, var(--pine-light) 18%, transparent); color: var(--text); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.pill i, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); display: inline-block; flex: none; }
.pill.on i, .dot.on { background: var(--ok); }
.page-head { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 13px; padding: 4px 0; }
.back:hover { color: var(--text); }
.badge { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.badge.on { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.off { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.devlist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-gap: 8px; gap: 8px; }
.devrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.devrow:hover { border-color: var(--pine-light); }
.devname { font-weight: 600; overflow-wrap: anywhere; }
.devmeta { margin-left: auto; }
.chev { color: var(--muted); font-size: 20px; }
.empty { margin-top: 24px; padding: 28px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); }
.empty strong { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); grid-gap: 12px; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.value { font-size: clamp(24px, 5vw, 30px); font-weight: 700; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.value.bool { font-size: clamp(20px, 4vw, 24px); }
.raw { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.spark { width: 100%; height: 44px; color: var(--pine-light); margin-top: 6px; }
.spark-empty { height: 44px; margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.control { gap: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background: var(--pine); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled, .switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch { --sw: var(--pine-light); width: 52px; height: 28px; border-radius: 999px; border: 0; background: var(--border); position: relative; cursor: pointer; transition: background 0.15s; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on { background: var(--sw); }
.switch.on span { transform: translateX(24px); }
.error { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.tablewrap { overflow-x: auto; }
.log { border-collapse: collapse; font-size: 13px; }
.log td { padding: 4px 16px 4px 0; white-space: nowrap; }
.lamp { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 10px; background: var(--border); vertical-align: middle; }
.lamp.t { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.lamp.f { background: var(--muted); opacity: 0.5; }

/* Bigger tap targets on touch screens */
@media (pointer: coarse) {
  .btn { min-height: 42px; padding: 10px 16px; }
  .btn.small { min-height: 36px; }
  .switch { width: 58px; height: 32px; }
  .switch span { width: 26px; height: 26px; }
  .switch.on span { transform: translateX(26px); }
  .nav a { padding: 10px 14px; }
  .devrow { padding: 14px 16px; }
}
@media (max-width: 480px) {
  body { font-size: 14px; }
  .brand span { display: none; }
  .card { padding: 12px; }
}
@media (min-width: 1500px) {
  body { font-size: 16px; }
}

/* ---- park map ---- */
.mapgrid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 360px); grid-gap: 20px; gap: 20px; align-items: start; margin-top: 12px; }
@media (max-width: 900px) { .mapgrid { grid-template-columns: minmax(0, 1fr); } }
.sidecol { display: grid; grid-gap: 4px; gap: 4px; min-width: 0; }
@media (min-width: 560px) and (max-width: 900px) { .sidecol.two { grid-template-columns: 1fr 1fr; gap: 4px 20px; } }
.parkmap { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; display: block; background: var(--land); -moz-user-select: none; user-select: none; -webkit-user-select: none; }
.pk-bg { fill: var(--land); }
.pk-hatch { stroke: var(--closed); opacity: 0.55; }
.pk { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pk-trail { --w: 5; }
.pk-river { --w: 12; }
.pk-field.open { fill: var(--field); stroke: var(--field-edge); stroke-width: calc(2px * var(--s)); }
.pk-lake.open { fill: var(--water); stroke: none; }
.pk-river.open { stroke: var(--water); stroke-width: calc(var(--w) * var(--s) * 1px); }
.pk-trail.open { stroke: var(--trail); stroke-width: calc(var(--w) * var(--s) * 1px); }
/* closed: greyed out, dashed/hatched, with an x marker on top */
.pk-field.closed { fill: url(#hatch); stroke: var(--closed); stroke-width: calc(2px * var(--s)); stroke-dasharray: calc(8px * var(--s)) calc(6px * var(--s)); }
.pk-lake.closed { fill: url(#hatch); stroke: var(--water); stroke-width: calc(3px * var(--s)); stroke-dasharray: calc(8px * var(--s)) calc(6px * var(--s)); }
.pk-river.closed { stroke: var(--water); stroke-width: calc(var(--w) * var(--s) * 1px); stroke-dasharray: calc(3px * var(--s)) calc(14px * var(--s)); opacity: 0.6; stroke-linecap: butt; }
.pk-trail.closed { stroke: var(--closed); stroke-width: calc(var(--w) * 0.8 * var(--s) * 1px); stroke-dasharray: calc(2px * var(--s)) calc(9px * var(--s)); }
.pk.sel { filter: drop-shadow(0 0 4px var(--amber)); }
.pk-closed-mark circle { fill: var(--bad); stroke: var(--surface); stroke-width: 2; }
.pk-closed-mark path { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.pk-occ rect { fill: var(--amber); stroke: var(--surface); stroke-width: 2; }
.pk-occ.zero { opacity: 0.55; }
.pk-occ.zero rect { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.pk-occ.zero text { fill: var(--muted); }
.pk-occ text { font: 800 12px system-ui, sans-serif; fill: #3a2a00; pointer-events: none; }
.pk-hit { fill: none; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; cursor: move; touch-action: none; }
.pk-hit.shape { fill: transparent; pointer-events: all; }
.gw { cursor: pointer; outline: none; }
.gw-edit { cursor: -webkit-grab; cursor: grab; touch-action: none; }
.gw-hit { fill: transparent; }
.gw-cone { fill: var(--amber); fill-opacity: 0.28; stroke: var(--amber); stroke-opacity: 0.7; stroke-width: 1.5; stroke-linejoin: round; pointer-events: none; }
.ed-rot { fill: var(--amber); stroke: var(--surface); stroke-width: 2; cursor: -webkit-grab; cursor: grab; touch-action: none; }
.gw.sel .gw-dot { stroke: var(--amber); stroke-width: 4; }
.gw-dot { stroke: var(--surface); stroke-width: 3; fill: var(--muted); }
.gw.online .gw-dot { fill: var(--ok); }
.gw.offline .gw-dot { fill: var(--bad); }
.gw.nodata .gw-dot { fill: var(--surface); stroke: var(--muted); stroke-width: 2.5; }
.gw:hover .gw-dot, .gw:focus-visible .gw-dot { stroke: var(--text); }
.gw-label { font: 600 14px system-ui, sans-serif; fill: var(--text); paint-order: stroke; stroke: var(--land); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.gw-ring { fill: none; stroke-width: 4; }
.gw-badge-txt { font: 800 12px system-ui, sans-serif; fill: #fff; pointer-events: none; }
.gw.alert-1 .gw-ring { stroke: var(--a1); }
.gw.alert-1 .gw-badge { fill: var(--a1); }
.gw.alert-1 .gw-badge-txt { fill: #3a3000; }
.gw.alert-2 .gw-ring { stroke: var(--a2); }
.gw.alert-2 .gw-badge { fill: var(--a2); }
.gw.alert-3 .gw-ring { stroke: var(--a3); animation: pulse 1.1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.gw.alert-3 .gw-badge { fill: var(--a3); }
@keyframes pulse { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
.alertrow { border-left: 5px solid var(--a1); }
.alertrow.alert-2 { border-left-color: var(--a2); }
.alertrow.alert-3 { border-left-color: var(--a3); }
.alertpill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 999px; background: var(--a1); color: #3a3000; }
.alertrow.alert-2 .alertpill { background: var(--a2); color: #fff; }
.alertrow.alert-3 .alertpill { background: var(--a3); color: #fff; }
.alertbar { padding: 10px 14px; border-radius: 8px; margin: 8px 0; border-left: 5px solid var(--a1); background: color-mix(in srgb, var(--a1) 18%, transparent); }
.alertbar.alert-2 { border-left-color: var(--a2); background: color-mix(in srgb, var(--a2) 18%, transparent); }
.alertbar.alert-3 { border-left-color: var(--a3); background: color-mix(in srgb, var(--a3) 18%, transparent); }
.elist { list-style: none; margin: 0; padding: 0; display: grid; grid-gap: 6px; gap: 6px; }
.elist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.elist li.sel { border-color: var(--amber); }
.elist li.clickable { cursor: pointer; }
.etype { width: 22px; height: 0; border-top: 4px solid var(--trail); border-radius: 2px; flex: none; }
.etype.pk-river { border-top: 6px solid var(--water); }
.etype.pk-field, .etype.pk-lake { height: 12px; border: 2px solid var(--field-edge); background: var(--field); }
.etype.pk-lake { border-color: var(--water); background: var(--water); }
.etype.closed { border-color: var(--closed) !important; border-style: dotted !important; background: transparent !important; }

/* ---- map editor ---- */
.parkmap.editing { cursor: default; }
.ed-line { stroke: var(--amber); stroke-width: 1.5; opacity: 0.8; pointer-events: none; }
.ed-anchor { fill: #fff; stroke: var(--amber); stroke-width: 2; }
.ed-handle { fill: var(--amber); stroke: #fff; stroke-width: 1.5; }
.ed-grab { fill: transparent; cursor: -webkit-grab; cursor: grab; touch-action: none; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; grid-gap: 10px; gap: 10px; }
.panel label { display: grid; grid-gap: 3px; gap: 3px; font-size: 12px; color: var(--muted); }
.panel input[type="text"], .panel input[type="number"], .panel select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%; min-width: 0; }
.panel .pair { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 8px; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.savestate { font-size: 12px; color: var(--muted); }
.savestate.err { color: var(--bad); }
.checkrow { display: flex !important; align-items: center; gap: 8px; grid-auto-flow: column; }
.first-sm { margin-top: 20px; }
@media (min-width: 560px) and (max-width: 900px) { .first-sm { margin-top: 0; } }

/* ---- ladder logic ---- */
.ladder { display: grid; grid-gap: 14px; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.rung-slot { position: relative; }
.rung-slot.dragging { opacity: 0.45; }
.rung-slot.drop-before::before, .rung-slot.drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--amber); z-index: 2; }
.rung-slot.drop-before::before { top: -9px; }
.rung-slot.drop-after::after { bottom: -9px; }
.rung { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; grid-gap: 10px; gap: 10px; min-width: 0; }
.rung.on { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.rung.unknown { border-color: color-mix(in srgb, var(--a2) 45%, var(--border)); }
.rung.disabled { border-style: dashed; }
.rung-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.rung-grip { cursor: -webkit-grab; cursor: grab; font-size: 18px; color: var(--muted); -webkit-user-select: none; -moz-user-select: none; user-select: none; padding: 0 4px; touch-action: none; }
.rung-no { font-weight: 700; color: var(--muted); }
.rung-name { flex: 1 1 160px; min-width: 0; font: inherit; font-weight: 600; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text); }
.rung-name:hover, .rung-name:focus { border-color: var(--border); background: var(--bg); }
.rung-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.rung-state { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 999px; background: var(--border); color: var(--muted); white-space: nowrap; }
.rung-state.on { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.rung-state.unknown { background: color-mix(in srgb, var(--a2) 20%, transparent); color: var(--a2); }
.lad-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.lad-sig { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rung select, .rung input[type="text"], .rung input[type="number"] { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); max-width: 100%; }
.rung input[type="number"] { width: 90px; }
.rung input.rung-name { border-color: transparent; background: transparent; }
.lad-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: grid; grid-gap: 10px; gap: 10px; }
.lad-inspector { display: grid; grid-gap: 8px; gap: 8px; }
.ld-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ld-chip { font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px dashed var(--pine-light); background: transparent; color: var(--text); cursor: -webkit-grab; cursor: grab; }
.ld-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.ld-tip { margin-left: auto; font-size: 12px; }

/* the ladder diagram: every contact row is 64px tall and its wire runs at y = 32px */
.ld-scroll { overflow-x: auto; padding: 6px 2px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.ld-rung { display: flex; align-items: flex-start; min-width: min-content; padding: 6px 0; }
.ld-rail { width: 6px; align-self: stretch; background: var(--muted); border-radius: 3px; flex: none; }
.ld-rail.on { background: var(--ok); }
.ld-wire { flex: none; width: 16px; height: 2px; margin-top: 31px; background: var(--muted); }
.ld-wire.grow { flex: 1 1 16px; }
.ld-wire.on { background: var(--ok); }
.ld-series { display: flex; align-items: flex-start; }
.ld-parallel { display: flex; flex-direction: column; gap: 8px; }
.ld-branch { position: relative; display: flex; align-items: flex-start; }
.ld-bar { position: absolute; width: 2px; background: var(--muted); }
.ld-bar.l { left: 0; } .ld-bar.r { right: 0; }
.ld-branch .ld-bar { top: -8px; bottom: -8px; }
.ld-branch.first .ld-bar { top: 31px; }
.ld-branch.last .ld-bar { bottom: calc(100% - 33px); }
.ld-contact { position: relative; width: 156px; height: 64px; flex: none; }
.ld-box { position: absolute; inset: 6px 0; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--surface); border: 2px solid var(--border); border-radius: 8px; cursor: -webkit-grab; cursor: grab; overflow: hidden; }
.ld-box.t { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.ld-box.u { border-style: dashed; border-color: var(--a2); }
.ld-box.sel { outline: 3px solid var(--amber); outline-offset: 1px; }
.ld-box.rung { border-radius: 14px; }
.ld-sym { font: 700 13px ui-monospace, Consolas, monospace; color: var(--muted); flex: none; }
.ld-text { display: grid; min-width: 0; line-height: 1.25; }
.ld-text b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-text small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-notbox { position: relative; border: 2px dashed var(--bad); border-radius: 10px; padding: 8px 6px; margin-top: -10px; }
.ld-notbadge { position: absolute; top: -10px; left: 8px; font: 700 10px system-ui; padding: 1px 6px; border-radius: 999px; background: var(--bad); color: #fff; border: 0; cursor: pointer; }
.ld-coil { flex: none; width: 190px; height: 52px; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; cursor: pointer; border: 2px solid var(--border); border-radius: 26px; background: var(--surface); }
.ld-coil.t { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.ld-coil.internal { border-style: dotted; }
.ld-coil.sel { outline: 3px solid var(--amber); outline-offset: 1px; }
.ld-paren { font: 300 30px/1 ui-monospace, Consolas, monospace; color: var(--muted); }
.ld-hot { position: absolute; z-index: 3; display: grid; place-items: center; font: 700 10px system-ui; color: var(--text); background: color-mix(in srgb, var(--amber) 22%, transparent); border: 1px dashed var(--amber); border-radius: 6px; }
.ld-hot.over { background: color-mix(in srgb, var(--amber) 70%, transparent); }
.ld-hot.before { left: 0; top: 6px; bottom: 6px; width: 28%; }
.ld-hot.after { right: 0; top: 6px; bottom: 6px; width: 28%; }
.ld-hot.below { left: 30%; right: 30%; bottom: 0; height: 22px; }
.ld-hot span { pointer-events: none; }
@media (max-width: 560px) { .ld-contact { width: 138px; } .ld-coil { width: 160px; } }

/* ---- heat maps ---- */
.layerbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.layerbar button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.layerbar button.active { background: var(--pine); border-color: var(--pine); color: #fff; }
.heatlegend { margin-top: 10px; display: grid; grid-gap: 4px; gap: 4px; }
.heatbar { height: 12px; border-radius: 6px; border: 1px solid var(--border); }
.heatticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.heatreadout { position: absolute; pointer-events: none; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; transform: translate(10px, -26px); white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.mapwrap { position: relative; }
.formula { width: 100%; font: 13px/1.4 ui-monospace, Consolas, monospace; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); resize: vertical; min-height: 38px; }
.formula.bad { border-color: var(--bad); }
.defrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-gap: 4px 6px; gap: 4px 6px; align-items: center; }
.defrow > :nth-child(2) { grid-column: 1 / -1; order: 3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 12px ui-monospace, Consolas, monospace; background: color-mix(in srgb, var(--muted) 15%, transparent); padding: 2px 8px; border-radius: 999px; cursor: pointer; border: 0; color: var(--text); }
.chip.builtin { background: color-mix(in srgb, var(--pine-light) 20%, transparent); }
.panel input[type="color"] { width: 36px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.alertitem { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; } .alertitem .devrow { flex: 1 1 220px; min-width: 0; }

.hm-factor { display: grid; grid-gap: 6px; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.hm-factor-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-gap: 6px; gap: 6px; align-items: center; }
.hm-factor-range { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 8px; gap: 8px; }
.panel label.inline { display: flex; align-items: center; gap: 6px; }
.walkevent { display: grid; grid-gap: 6px; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.walklink { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-gap: 6px; gap: 6px; align-items: center; }

/* gateway hover tooltip */
.gwtip { position: absolute; z-index: 5; pointer-events: none; width: max-content; max-width: min(300px, 90%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.gwtip dl { margin: 6px 0 0; display: grid; grid-gap: 1px; gap: 1px; }
.gwtip dt { color: var(--muted); font-size: 11px; margin-top: 4px; }
.gwtip dd { margin: 0; font-weight: 600; }
.gwtip dd .muted { font-weight: 400; }

/* user accounts, login, scan log */
.loginbox { max-width: 360px; margin: 48px auto; }
.panel input[type="password"] { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%; min-width: 0; }
.usertag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.typebadge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.typebadge.management { border-color: var(--pine-light); color: var(--pine-light); }
.inlineform { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inlineform label { flex: 1 1 140px; }

/* loading states */
.loading { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.loading.block { justify-content: center; padding: 48px 0; }
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--pine-light); animation: tc-spin 0.8s linear infinite; }
.skeleton { display: inline-block; border-radius: 6px; background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 45%, var(--surface)) 50%, var(--border) 75%); background-size: 200% 100%; animation: tc-shimmer 1.4s ease-in-out infinite; }
div.skeleton { display: block; border-radius: 12px; }
.btn.busy { position: relative; pointer-events: none; opacity: 0.75; }
.btn .spinner { width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; display: inline-block; }
@keyframes tc-spin { to { transform: rotate(360deg); } }
@keyframes tc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .skeleton { animation: none; }
}

