/* Annexus: live IoT demo page (/iot-demo/). Loaded after main.css and pages.css. */

.iot-hero h1 { max-width: 16ch; }
.iot-hero__rings { opacity: .3; }
@media (max-width: 899px) { .iot-hero__rings { opacity: .14; top: 26%; } }
.iot-hero__chips { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.iot-hero__chips li { padding: 6px 12px; border-radius: 99px; font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }

/* "Simulated" badge: shown near the title and again right above the console */
.iot-sim-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 99px;
  font: 600 12px/1.3 var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: #FBE27A;
  background: rgba(245, 208, 16, .08); border: 1px solid rgba(245, 208, 16, .38);
}
.iot-sim-badge span { width: 8px; height: 8px; flex: none; border-radius: 2px; background: var(--yellow); transform: rotate(45deg); }
.iot-sim-badge--hero { margin-top: 22px; }
.iot-body { padding-top: clamp(28px, 4vw, 48px); }
.iot-body > .container > .iot-sim-badge { margin-bottom: 14px; }

/* Raleway defaults to old-style figures; this page shows many numbers, so force lining figures throughout the console. */
html body .iot, html body .iot * { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Console frame ---------- */
.iot {
  --c-trk: var(--yellow); --c-cct: var(--blue); --c-sen: var(--green); --c-wrb: var(--orange);
  --c-crit: #F05BA6; --c-warn: var(--orange); --c-info: #6FB6E6; --c-ok: var(--green);
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, Menlo, monospace;
  position: relative; isolation: isolate; padding: clamp(14px, 2vw, 22px); border-radius: 24px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #0B0F1A, #070A12) padding-box,
    linear-gradient(120deg, rgba(245,208,16,.5), rgba(248,154,28,.35) 25%, rgba(229,48,146,.4) 50%, rgba(45,144,207,.4) 75%, rgba(113,188,125,.5)) border-box;
  box-shadow: 0 40px 120px -40px rgba(45, 144, 207, .35), 0 30px 100px -50px rgba(229, 48, 146, .35);
}
.iot::before { /* faint dot grid behind the console */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.2px); background-size: 22px 22px;
}

.iot__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 2px 2px 16px; }
.iot__brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.iot__title { font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.iot__status { display: inline-flex; align-items: center; gap: 12px; font: 600 12px/1 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.iot__live { display: inline-flex; align-items: center; gap: 8px; color: var(--green); }
.iot__live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: iot-blink 1.6s ease-in-out infinite; }
.iot.is-paused .iot__live { color: var(--orange); }
.iot.is-paused .iot__live::before, .iot.is-reduced .iot__live::before { animation: none; }
.iot__clock { font-family: var(--mono); letter-spacing: .04em; font-size: 13px; font-weight: 400; color: var(--dim); text-transform: none; font-variant-numeric: tabular-nums; }
@keyframes iot-blink { 50% { opacity: .35; } }

.iot__controls { display: flex; flex-wrap: wrap; gap: 8px; }
.iot-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 15px; border-radius: 99px; cursor: pointer;
  font: 500 14px/1 var(--font); color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line-strong);
  transition: background-color .2s, border-color .2s, color .2s;
}
.iot-btn:hover:not(:disabled) { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.34); }
.iot-btn:disabled { opacity: .45; cursor: not-allowed; }
.iot-btn[aria-pressed="true"] { background: rgba(45,144,207,.18); border-color: var(--blue); }
.iot-btn--small { min-height: 34px; padding: 6px 13px; font-size: 13px; }
.iot-ico { width: 15px; height: 15px; fill: currentColor; flex: none; }
.iot-ico [hidden] { display: none; }

/* ---------- KPIs ---------- */
.iot__kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.kpi { position: relative; overflow: hidden; padding: 14px 16px 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.kpi dt { font: 600 11px/1.3 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.kpi dt abbr { text-decoration: none; }
.kpi dd { margin: 0; }
.kpi dd:first-of-type { margin-top: 8px; display: flex; align-items: baseline; gap: 8px; }
.kpi__value { font-weight: 400; font-size: clamp(26px, 2.6vw, 34px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__of, .kpi__note { font-size: 13px; color: var(--dim); white-space: nowrap; }
.kpi__mix { display: flex; gap: 3px; height: 4px; margin-top: 12px; }
.kpi__mix i { flex: 1 1 0; border-radius: 2px; transition: flex-grow .6s var(--ease-out); }
.kpi__mix [data-mix="trk"] { background: var(--c-trk); } .kpi__mix [data-mix="cct"] { background: var(--c-cct); }
.kpi__mix [data-mix="sen"] { background: var(--c-sen); } .kpi__mix [data-mix="wrb"] { background: var(--c-wrb); }
.kpi__bars { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: flex-end; gap: 2px; height: 30px; width: 46%; }
.kpi__bars i { flex: 1; height: 100%; border-radius: 1px; background: linear-gradient(to top, rgba(45,144,207,.25), rgba(45,144,207,.9)); transform-origin: bottom; transform: scaleY(.05); transition: transform .5s var(--ease-out); }
.kpi__bars i:last-child { background: linear-gradient(to top, rgba(229,48,146,.4), #F05BA6); }

/* ---------- Filters and shapes ---------- */
.iot__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.iot__filters-label { font: 600 11px/1 var(--font-label); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-right: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 6px 13px 6px 12px; border-radius: 99px; cursor: pointer;
  font: 500 14px/1 var(--font); color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--line-strong);
  transition: opacity .2s, background-color .2s, border-color .2s;
}
.chip:hover { border-color: rgba(255,255,255,.34); }
.chip[aria-pressed="false"] { color: var(--muted); background: transparent; border-style: dashed; }
.chip[aria-pressed="false"] .shape { opacity: .35; }
.chip__n { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }

.shape { --c: var(--text); display: inline-block; width: 10px; height: 10px; flex: none; background: var(--c); }
.shape--trk { --c: var(--c-trk, var(--yellow)); border-radius: 50%; }
.shape--cct { --c: var(--c-cct, var(--blue)); border-radius: 3px; }
.shape--sen { --c: var(--c-sen, var(--green)); width: 9px; height: 9px; transform: rotate(45deg); border-radius: 1px; }
.shape--wrb { --c: var(--c-wrb, var(--orange)); border-radius: 50%; background: radial-gradient(circle, #05070D 26%, var(--c) 30%); }
.shape--fence { width: 13px; height: 13px; border-radius: 50%; background: rgba(229,48,146,.12); border: 1.5px dashed rgba(240,91,166,.9); }

/* ---------- Main grid ---------- */
.iot__main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 370px); gap: 14px; }
.iot__mapcol { min-width: 0; display: grid; gap: 14px; align-content: start; }

/* ---------- Map ---------- */
.iot-map {
  position: relative; aspect-ratio: 1000 / 886; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(ellipse 70% 60% at 60% 45%, rgba(45,144,207,.10), transparent 70%), #060912;
  --u: 1;
}
.iot-map__base, .iot-map__overlay, .iot-map__fx, .iot-map__labels { position: absolute; inset: 0; width: 100%; height: 100%; }
.iot-map__base { pointer-events: none; user-select: none; }
.iot-map__overlay, .iot-map__labels { pointer-events: none; overflow: visible; }
.iot-map__fx { touch-action: manipulation; }
.no-js .iot-map__fx, .no-js .iot-map__overlay, .no-js .iot-map__labels { display: none; }

.ov-routes path { fill: none; stroke: rgba(255,255,255,.16); stroke-width: calc(1.1px * var(--u)); stroke-dasharray: calc(2px * var(--u)) calc(4px * var(--u)); stroke-linecap: round; }
.ov-fences circle, .ov-fences path { fill: rgba(229,48,146,.09); stroke: rgba(240,91,166,.85); stroke-width: calc(1.3px * var(--u)); stroke-dasharray: calc(4px * var(--u)) calc(3px * var(--u)); }
.ov-fences [data-kind="advisory"] { fill: rgba(248,154,28,.12); stroke: rgba(248,154,28,.9); }
.ov-prov text { font: 600 calc(9.5px * var(--u)) var(--font-label); letter-spacing: .2em; text-transform: uppercase; fill: rgba(167,174,194,.5); text-anchor: middle; }
.ov-prov .ov-nb { font-size: calc(8px * var(--u)); letter-spacing: .12em; fill: rgba(167,174,194,.45); }
.ov-cities circle { fill: #F4F5FA; stroke: #05070D; stroke-width: calc(1.5px * var(--u)); r: calc(2.6px * var(--u)); }
.ov-cities text { font: 500 calc(12px * var(--u)) var(--font); fill: #C9CEDD; paint-order: stroke; stroke: #05070D; stroke-width: calc(3px * var(--u)); stroke-linejoin: round; }
.ov-cities .is-minor text { font-size: calc(10.5px * var(--u)); fill: #9097AC; }
.ov-cities .is-minor circle { fill: #9097AC; r: calc(2px * var(--u)); }
.ov-cities [data-side="l"] { text-anchor: end; } .ov-cities [data-side="a"], .ov-cities [data-side="b"] { text-anchor: middle; }
.ov-ingest text { font: 600 calc(10px * var(--u)) var(--font-label); letter-spacing: .12em; text-transform: uppercase; fill: #F4F5FA; text-anchor: end; paint-order: stroke; stroke: #05070D; stroke-width: calc(3px * var(--u)); }
.ov-ingest .ov-ingest__sub { fill: var(--muted); font-weight: 500; letter-spacing: .08em; text-transform: none; font-family: var(--mono); }

.iot-map__tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; font-size: 13px; line-height: 1.2; color: var(--text);
  background: rgba(5,7,13,.92); border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.iot-map__sel {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; white-space: nowrap;
  padding: 4px 10px; border-radius: 99px; font-weight: 600; font-size: 12px; line-height: 1.2; color: var(--text);
  background: rgba(5,7,13,.9); border: 1px solid var(--c, var(--line-strong)); box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.iot-map__sel[hidden] { display: none; }
.iot-map__sel[data-type="trk"] { --c: var(--c-trk); } .iot-map__sel[data-type="cct"] { --c: var(--c-cct); }
.iot-map__sel[data-type="sen"] { --c: var(--c-sen); } .iot-map__sel[data-type="wrb"] { --c: var(--c-wrb); }
.iot-map__legend {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; display: grid; gap: 6px; margin: 0; padding: 10px 12px; list-style: none;
  font-size: 12px; line-height: 1.2; color: var(--muted); background: rgba(5,7,13,.72); border: 1px solid var(--line); border-radius: 12px;
}
.iot-map__legend li { display: flex; align-items: center; gap: 9px; }
.iot-map__legend .shape { width: 9px; height: 9px; }
.iot-map-credit { margin-top: -6px; font-size: 12px; line-height: 1.4; color: var(--dim); text-align: right; }
.iot-map-credit a { color: var(--muted); text-underline-offset: 2px; }
.iot-map__nojs { display: none; }
.no-js .iot-map__nojs { display: grid; place-items: center; position: absolute; inset: 0; z-index: 3; padding: 24px; background: rgba(5,7,13,.55); }
.no-js .iot-map__nojs p { max-width: 46ch; padding: 18px 20px; border-radius: 14px; background: rgba(5,7,13,.92); border: 1px solid var(--line-strong); color: var(--muted); font-size: 15px; }
.no-js .iot-map__nojs strong { color: var(--text); }
.no-js .iot__bar .iot__controls, .no-js .iot__kpis, .no-js .iot__filters, .no-js .iot__stream, .no-js .iot__side, .no-js .iot__status { display: none; }
.no-js .iot__main { grid-template-columns: 1fr; }
.no-js .iot-map__legend { display: none; }
.no-js .iot-map { width: 100%; max-width: 820px; margin-inline: auto; }

/* ---------- MQTT stream ---------- */
.iot__stream { padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid var(--line); font-family: var(--mono); min-width: 0; }
.iot__stream-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font: 600 11px/1.2 var(--font-label); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.iot__stream-topic { font-family: var(--mono); letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iot__stream-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12px; line-height: 1.5; }
.iot__stream-lines li { display: flex; gap: 12px; white-space: nowrap; overflow: hidden; color: var(--muted); }
.iot__stream-lines li:empty { display: none; }
.iot__stream-lines li:nth-child(n+2) { opacity: .62; }
.iot__stream-lines time { color: var(--dim); flex: none; font-variant-numeric: tabular-nums; }
.iot__stream-lines .topic { color: #9CCBF0; flex: none; }
.iot__stream-lines .json { color: #B7E3BF; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.iot__stream-lines li.is-new { animation: iot-flash 1s ease-out; }
@keyframes iot-flash { from { background: rgba(45,144,207,.22); } to { background: transparent; } }

/* ---------- Side column: events + devices ---------- */
.iot__side { position: relative; min-width: 0; }
.iot__side-inner { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 44fr) minmax(0, 56fr); gap: 14px; }
.panel { display: flex; flex-direction: column; min-height: 0; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); overflow: hidden; }
.panel__title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); font: 600 11px/1.2 var(--font-label); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.panel__count { font-family: var(--font); font-size: 12px; letter-spacing: 0; color: var(--dim); font-variant-numeric: tabular-nums; }
.panel__hint { font: 400 12px/1.2 var(--font); letter-spacing: 0; text-transform: none; color: var(--dim); }

.feed, .devlist { flex: 1; min-height: 0; margin: 0; padding: 6px; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.ev { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 9px 10px; border-radius: 10px; cursor: default; }
.ev[data-dev] { cursor: pointer; }
.ev[data-dev]:hover { background: rgba(255,255,255,.04); }
.ev + .ev { border-top: 1px solid rgba(255,255,255,.05); }
.ev__sev { grid-row: span 2; align-self: start; margin-top: 2px; padding: 3px 7px; border-radius: 6px; font: 600 10px/1.2 var(--font-label); letter-spacing: .1em; text-transform: uppercase; border: 1px solid currentColor; }
.ev[data-sev="crit"] .ev__sev { color: var(--c-crit); background: rgba(229,48,146,.12); }
.ev[data-sev="warn"] .ev__sev { color: var(--c-warn); background: rgba(248,154,28,.1); }
.ev[data-sev="info"] .ev__sev { color: var(--c-info); background: rgba(45,144,207,.1); }
.ev[data-sev="ok"] .ev__sev { color: var(--c-ok); background: rgba(113,188,125,.1); }
.ev__text { font-size: 14px; line-height: 1.4; color: var(--muted); }
.ev__text b { color: var(--text); font-weight: 500; }
.ev time { font-family: var(--mono); font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.ev.is-new { animation: iot-in .6s var(--ease-out); }
.ev.is-new[data-sev="crit"] { animation: iot-in .6s var(--ease-out), iot-crit 2.4s ease-out; }
@keyframes iot-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes iot-crit { from { background: rgba(229,48,146,.22); } to { background: transparent; } }

.devlist li + li { margin-top: 2px; }
.dev {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  text-align: left; cursor: pointer; color: var(--text); background: transparent; border: 1px solid transparent; font: inherit;
}
.dev:hover { background: rgba(255,255,255,.045); }
.dev[aria-current="true"] { background: rgba(255,255,255,.07); border-color: var(--line-strong); }
.dev:focus-visible { outline-offset: -2px; }
.dev__main { display: grid; min-width: 0; }
.dev__id { font-weight: 500; font-size: 14px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.dev__sub { font-size: 12px; line-height: 1.3; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev__val { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.state { display: inline-flex; align-items: center; gap: 6px; font: 600 10px/1 var(--font-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state[data-state="ok"] { color: var(--c-ok); }
.state[data-state="warn"] { color: var(--c-warn); }
.state[data-state="crit"] { color: var(--c-crit); }
.state[data-state="off"] { color: var(--dim); }
.state[data-state="off"]::before { background: transparent; border: 1.5px solid currentColor; }
.devlist .state { min-width: 74px; }

/* ---------- Device card ---------- */
.card-dev {
  --c: var(--text);
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 18px; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 14px; background: linear-gradient(180deg, #111726, #0A0E18); border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.8);
}
.card-dev[hidden] { display: none; }
.card-dev > * { flex-shrink: 0; }
.card-dev:focus, .card-dev:focus-visible { outline: none; }
.card-dev[data-type="trk"] { --c: var(--c-trk); } .card-dev[data-type="cct"] { --c: var(--c-cct); }
.card-dev[data-type="sen"] { --c: var(--c-sen); } .card-dev[data-type="wrb"] { --c: var(--c-wrb); }
.card-dev::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--c); opacity: .9; border-radius: 14px 14px 0 0; }
.card-dev__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
.card-dev__head .shape { width: 12px; height: 12px; }
.card-dev__title { font-weight: 500; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.card-dev__sub { font-size: 13px; color: var(--dim); line-height: 1.3; }
.card-dev__close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); }
.card-dev__close:hover { background: rgba(255,255,255,.1); }
.card-dev__close svg { width: 14px; height: 14px; }
.card-dev__metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-dev__big { font-weight: 300; font-size: 46px; line-height: 1; letter-spacing: -.03em; color: var(--c); font-variant-numeric: tabular-nums; }
.card-dev__unit { font-size: 16px; color: var(--muted); }
.card-dev__label { font: 600 11px/1.3 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.spark { width: 100%; height: 70px; color: var(--c); overflow: visible; border-radius: 8px; background: linear-gradient(rgba(255,255,255,.025), transparent); }
.spark__line { fill: none; stroke: currentColor; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark__limit { fill: none; stroke: var(--c-crit); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; opacity: .8; }
.card-dev__range { margin-top: -6px; font-size: 12px; color: var(--dim); }
.card-dev__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; border-radius: 10px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.card-dev__grid div { padding: 8px 10px; background: #0C111D; min-width: 0; }
.card-dev__grid div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.card-dev__grid dt { font: 600 10px/1.3 var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.card-dev__grid dd { margin: 3px 0 0; font-size: 13.5px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.card-dev__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.card-dev__ping { font-size: 13px; color: var(--muted); }
.card-dev__log { padding-top: 12px; border-top: 1px solid var(--line); }
.card-dev__log-title { font: 600 11px/1.3 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.card-dev__events { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.card-dev__events li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding-left: 10px; border-left: 2px solid var(--line-strong); }
.card-dev__events li[data-sev="crit"] { border-left-color: var(--c-crit); } .card-dev__events li[data-sev="warn"] { border-left-color: var(--c-warn); }
.card-dev__events li[data-sev="ok"] { border-left-color: var(--c-ok); } .card-dev__events li[data-sev="info"] { border-left-color: var(--c-info); }
.card-dev__events li.is-empty { display: block; border-left-color: transparent; padding-left: 0; color: var(--dim); }
.card-dev__events time { font-family: var(--mono); font-size: 11px; color: var(--dim); padding-top: 2px; }

/* ---------- CTA band ---------- */
.iot-cta { position: relative; margin-top: clamp(64px, 8vw, 112px); padding: clamp(48px, 6vw, 80px) 0; border-block: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.iot-cta::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(1000px, 140vw); aspect-ratio: 2.4; translate: -50% -50%; border-radius: 50%;
  background: conic-gradient(from 90deg, var(--yellow), var(--orange), var(--pink), var(--blue), var(--green), var(--yellow));
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); opacity: .12; pointer-events: none;
}
.iot-cta__inner { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; align-items: center; gap: 28px 48px; }
.iot-cta__title { margin-top: 18px; font-weight: 500; font-size: clamp(30px, 4vw, 52px); line-height: 1.06; letter-spacing: -.03em; text-wrap: balance; }
.iot-cta__text { margin-top: 16px; max-width: 54ch; color: var(--muted); font-weight: 300; font-size: clamp(16px, 1.3vw, 18px); }
.iot-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.iot-body { padding-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .iot__main { grid-template-columns: minmax(0, 1fr); }
  .iot__side-inner { position: static; grid-template-rows: none; }
  .feed { max-height: 320px; }
  .devlist { max-height: 460px; }
  /* the device card becomes a bottom sheet */
  .card-dev {
    position: fixed; inset: auto 8px 8px 8px; z-index: 60; max-height: min(54vh, 620px); max-height: min(54svh, 620px); max-width: 560px; margin-inline: auto;
    box-shadow: 0 -10px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.06);
  }
  .iot__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .iot-cta__inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .iot { padding: 10px; border-radius: 18px; margin-inline: calc(var(--gutter) * -0.5); }
  .iot__bar { padding: 4px 4px 12px; }
  .iot__title { font-size: 19px; }
  .iot__controls { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .iot__controls .iot-btn { justify-content: center; padding-inline: 10px; font-size: 13.5px; }
  .iot__controls [data-pause] { grid-column: 1 / -1; }
  .iot__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi:first-child { grid-column: 1 / -1; }
  .kpi__bars { width: 40%; height: 24px; }
  .iot__filters { gap: 6px; }
  .iot__filters-label { display: none; }
  .chip { font-size: 13px; padding-inline: 10px; gap: 7px; }
  .iot-map { border-radius: 12px; }
  .iot-map__legend { display: none; }
  .iot-map-credit { font-size: 11px; text-align: left; }
  .ov-cities .is-minor, .ov-prov, .ov-ingest { display: none; }
  .iot__stream-lines li:nth-child(n+4) { display: none; }
  .iot__stream-lines .topic { display: none; }
  .panel__hint { display: none; }
  .card-dev__big { font-size: 40px; }
}
@media (max-width: 380px) {
  .chip__n { display: none; }
  .dev { gap: 8px; padding-inline: 8px; }
  .devlist .state { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .iot__live::before, .iot__stream-lines li.is-new, .ev.is-new { animation: none; }
  .kpi__bars i, .kpi__mix i { transition: none; }
}
@media (max-width: 420px) { .iot-sim-badge { font-size: 11px; letter-spacing: .06em; padding-inline: 10px 12px; gap: 8px; } }
