:root {
  --ink: #102033;
  --muted: #64748b;
  --line: #dce4eb;
  --surface: #ffffff;
  --canvas: #f3f7f9;
  --navy: #0b1728;
  --navy-2: #13243a;
  --aqua: #1ebcaa;
  --aqua-bright: #40e0c1;
  --amber: #f2bd58;
  --red: #e86a76;
  --shadow: 0 14px 40px rgba(15, 31, 49, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; fill: currentColor; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px 22px; display: flex; flex-direction: column; color: #dce8f4; background: var(--navy); z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 13px; color: #fff; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1.15rem; letter-spacing: .02em; }
.brand small { margin-top: 5px; color: #8193a8; font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(64, 224, 193, .35); border-radius: 11px; display: grid; place-items: center; position: relative; background: rgba(64, 224, 193, .06); }
.brand-mark i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--aqua-bright); box-shadow: 0 0 12px rgba(64, 224, 193, .7); }
.brand-mark i:first-child { transform: translate(-8px, 7px); }
.brand-mark i:nth-child(2) { transform: translate(0, -7px); }
.brand-mark i:nth-child(3) { transform: translate(8px, 7px); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; width: 11px; height: 1px; background: rgba(64, 224, 193, .7); transform-origin: center; }
.brand-mark::before { transform: translate(-4px, 2px) rotate(-48deg); }
.brand-mark::after { transform: translate(4px, 2px) rotate(48deg); }

.side-nav { margin-top: 62px; display: grid; gap: 8px; }
.side-nav a { min-height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 13px; border-radius: 12px; color: #8fa2b8; font-size: .91rem; font-weight: 650; transition: .2s ease; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.side-nav a.active { color: var(--aqua-bright); background: rgba(64, 224, 193, .1); }
.side-nav svg { width: 20px; height: 20px; }
.sidebar-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-block { min-width: 0; display: flex; align-items: center; gap: 10px; }
.user-block > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.user-block strong { overflow: hidden; text-overflow: ellipsis; font-size: .83rem; white-space: nowrap; }
.user-block small { color: #7589a0; font-size: .72rem; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; color: var(--navy); background: var(--aqua-bright); font-weight: 800; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 10px; display: grid; place-items: center; color: inherit; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.08); }
.icon-button svg { width: 19px; }

.main { min-width: 0; }
.topbar { height: 104px; padding: 0 clamp(22px, 4vw, 54px); display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(243, 247, 249, .88); backdrop-filter: blur(12px); }
.topbar h1 { margin: 2px 0 0; font-size: clamp(1.5rem, 2vw, 2rem); letter-spacing: -.035em; line-height: 1.1; }
.eyebrow { margin: 0; color: var(--aqua); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.clock { margin-left: auto; color: var(--muted); font-size: .83rem; font-variant-numeric: tabular-nums; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.menu-button svg { width: 22px; margin: auto; }
.content { padding: 34px clamp(22px, 4vw, 54px) 56px; }

.flash-stack { padding: 20px clamp(22px, 4vw, 54px) 0; display: grid; gap: 8px; }
.flash { min-height: 48px; padding: 12px 15px; border: 1px solid; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .88rem; overflow-wrap: anywhere; }
.flash.success { color: #08796e; border-color: #9de1d7; background: #e7fbf7; }
.flash.error { color: #a53744; border-color: #f2bcc2; background: #fff0f2; }
.flash button { border: 0; color: inherit; background: transparent; font-size: 1.3rem; cursor: pointer; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.summary-card { min-height: 144px; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; align-items: flex-start; gap: 17px; background: var(--surface); box-shadow: var(--shadow); }
.summary-card > div:last-child { display: grid; }
.summary-card span { color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.summary-card strong { margin: 1px 0 -1px; color: var(--ink); font-size: 2.25rem; letter-spacing: -.06em; line-height: 1.15; }
.summary-card small { color: #8897a8; font-size: .72rem; }
.summary-icon { width: 41px; height: 41px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; }
.summary-icon svg { width: 20px; }
.summary-card.total .summary-icon { color: #356ec5; background: #e9f0ff; }
.summary-card.online .summary-icon { background: #ddf8f3; }
.summary-card.alert .summary-icon { color: #bb7a11; background: #fff3d9; }
.summary-card.offline .summary-icon { color: #708196; background: #edf1f5; }
.pulse-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 7px rgba(30, 188, 170, .14); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px rgba(30,188,170,0); } }

.dashboard-grid { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .85fr); gap: 20px; align-items: stretch; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { padding: 23px 25px 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 1.13rem; letter-spacing: -.025em; }
.panel-heading > a { color: var(--aqua); font-size: .8rem; font-weight: 750; }
.panel-heading > span { color: var(--muted); font-size: .76rem; }
.chart-panel { min-height: 415px; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: .72rem; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 50%; }
.chart-legend .temp { background: var(--amber); }
.chart-legend .humid { background: var(--aqua); }
.chart-wrap { position: relative; height: 320px; padding: 8px 18px 18px; }
.chart-wrap canvas { width: 100%; height: 100%; }
.device-list { padding: 2px 10px 10px; }
.device-row { min-height: 68px; padding: 12px 13px; border-radius: 13px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 11px; transition: background .2s ease; }
.device-row:hover { background: #f4f8fa; }
.device-glyph { position: relative; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid #d7e1e7; border-radius: 12px; display: grid; place-items: center; background: #f5f8fa; }
.device-glyph::before { content: ""; width: 13px; height: 17px; border: 2px solid #7890a5; border-radius: 4px; }
.device-glyph i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--aqua); transform: translateY(5px); }
.device-glyph.large { width: 47px; height: 47px; }
.device-main { min-width: 0; display: flex; flex-direction: column; }
.device-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.device-main small { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.device-reading { color: var(--ink); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.online { color: #078777; background: #e0f8f3; }
.status.alert { color: #b33f4b; background: #ffeaec; }
.status.offline { color: #718196; background: #edf1f5; }

.empty { text-align: center; color: var(--muted); }
.empty.compact { min-height: 245px; padding: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty h2, .empty h3 { margin: 10px 0 4px; color: var(--ink); }
.empty h3 { font-size: .98rem; }
.empty p { max-width: 450px; margin: 0 auto 17px; font-size: .84rem; }
.empty-orbit { width: 48px; height: 48px; border: 1px dashed #a6b8c8; border-radius: 50%; display: grid; place-items: center; animation: orbit 10s linear infinite; }
.empty-orbit span { width: 9px; height: 9px; border-radius: 50%; background: var(--aqua); transform: translateX(23px); box-shadow: 0 0 12px rgba(30,188,170,.5); }
@keyframes orbit { to { transform: rotate(360deg); } }

.section-actions { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-actions p { margin: 0; color: var(--muted); font-size: .9rem; }
.action-group { display: flex; align-items: center; gap: 9px; }
.action-group form { margin: 0; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 750; cursor: pointer; transition: .2s ease; }
.button.primary { color: #06241f; background: var(--aqua-bright); box-shadow: 0 8px 20px rgba(30,188,170,.18); }
.button.primary:hover { background: #31d5b7; transform: translateY(-1px); }
.button.secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.button.secondary:hover { border-color: #b6c4cf; background: #f7fafb; }
.button.ghost { color: var(--muted); background: transparent; }
.button.full { width: 100%; }

.device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.device-card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: .2s ease; }
.device-card:hover { border-color: #b9d8d2; transform: translateY(-3px); box-shadow: 0 18px 42px rgba(15,31,49,.12); }
.device-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.device-card h2 { margin: 19px 0 2px; font-size: 1.02rem; letter-spacing: -.02em; }
.device-card > p { margin: 0; color: var(--muted); font-size: .78rem; }
.device-metrics { margin-top: 21px; padding: 16px 0; border-top: 1px solid #e8edf1; border-bottom: 1px solid #e8edf1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.device-metrics span { display: flex; flex-direction: column; }
.device-metrics small { color: var(--muted); font-size: .64rem; }
.device-metrics strong { margin-top: 3px; font-size: .86rem; font-variant-numeric: tabular-nums; }
.device-card-foot { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #8494a5; font-size: .66rem; }
.device-card-foot code { color: #506579; }
.large-empty { min-height: 430px; padding: 50px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: #fff; box-shadow: 0 30px 80px rgba(5,18,34,.28); }
.dialog::backdrop { background: rgba(7, 20, 35, .68); backdrop-filter: blur(4px); }
.dialog form { padding: 26px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin: 3px 0 0; font-size: 1.3rem; }
.dialog-head .icon-button { font-size: 1.5rem; }
.dialog form > p { margin: 10px 0 21px; color: var(--muted); font-size: .84rem; }
label { display: grid; gap: 7px; margin-top: 15px; color: var(--ink); font-size: .8rem; font-weight: 700; }
label span em { color: var(--muted); font-size: .7rem; font-style: normal; font-weight: 500; }
label small { color: var(--muted); font-size: .68rem; font-weight: 500; }
input { width: 100%; min-height: 47px; padding: 0 14px; border: 1px solid #cad5de; border-radius: 11px; outline: none; color: var(--ink); background: #fff; transition: .15s ease; }
input:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(30,188,170,.13); }
.dialog-actions { margin-top: 25px; display: flex; justify-content: flex-end; gap: 8px; }

.detail-head { margin-bottom: 21px; }
.back-link { color: var(--muted); font-size: .78rem; font-weight: 700; }
.back-link:hover { color: var(--aqua); }
.detail-title { margin-top: 17px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.detail-title > div { display: flex; align-items: center; gap: 11px; }
.detail-title p { margin: 0; color: var(--muted); font-size: .79rem; }
.reading-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.reading-grid article { padding: 21px 23px; border: 1px solid var(--line); border-radius: 16px; display: grid; background: #fff; box-shadow: var(--shadow); }
.reading-grid span { color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.reading-grid strong { margin: 3px 0; font-size: 1.55rem; letter-spacing: -.04em; }
.reading-grid small { color: #91a0ae; font-size: .68rem; }
.integration-panel, .table-panel { margin-top: 20px; }
.integration-panel > p { margin: -7px 25px 16px; color: var(--muted); font-size: .82rem; }
.endpoint-details { padding: 0 25px 24px; display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: 12px; }
.endpoint-details > div { min-width: 0; padding: 14px; border: 1px solid #e2e9ee; border-radius: 12px; display: grid; gap: 4px; background: #f8fafb; }
.endpoint-details small { color: var(--muted); font-size: .67rem; font-weight: 750; text-transform: uppercase; }
.endpoint-details code, .endpoint-details strong { overflow: hidden; color: #42596e; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.receiver-note { margin: -10px 25px 24px; padding: 12px 14px; border: 1px solid #f0d18f; border-radius: 10px; color: #7a5818; background: #fff8e8; font-size: .78rem; }
.state-layout { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.state-panel { min-width: 0; }
.io-grid { padding: 0 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.io-item { min-width: 0; padding: 10px; border: 1px solid #e4eaee; border-radius: 11px; display: flex; align-items: center; gap: 10px; background: #fafcfd; }
.io-item > span { width: 29px; height: 29px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; color: #687c90; background: #e8eef2; font-size: .7rem; font-weight: 850; }
.io-item > div { min-width: 0; display: grid; }
.io-item strong, .io-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io-item strong { font-size: .74rem; }
.io-item small { color: var(--muted); font-size: .64rem; }
.io-item.violated { border-color: #f0b8bf; background: #fff4f5; }
.io-item.violated > span { color: #a53744; background: #ffdfe3; }
.io-item.powered { border-color: #91ddd1; background: #effbf8; }
.io-item.powered > span { color: #08796e; background: #d7f6f0; }
.fault-state { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .66rem; font-weight: 850; }
.fault-state.normal { color: #08796e; background: #e0f8f3; }
.fault-state.pendente { color: #a16709; background: #fff2d5; }
.fault-state.ativa { color: #a53744; background: #ffeaec; }
.wide-cell { min-width: 280px; white-space: normal; }
pre { margin: 0 25px 25px; padding: 18px; border-radius: 12px; overflow: auto; color: #c7f8ef; background: var(--navy); font-size: .73rem; line-height: 1.7; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .79rem; }
th, td { padding: 13px 22px; border-top: 1px solid #e7edf1; text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f9fbfc; font-size: .67rem; letter-spacing: .04em; text-transform: uppercase; }
td { color: #3f5367; font-variant-numeric: tabular-nums; }
.error-code { color: #d7e1e8; font-size: 5rem; font-weight: 850; letter-spacing: -.08em; line-height: 1; }

.auth-body { min-height: 100vh; background: var(--navy); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr); }
.auth-intro { position: relative; padding: clamp(35px, 6vw, 72px); overflow: hidden; display: flex; flex-direction: column; color: #fff; background: var(--navy); }
.auth-intro::before { content: ""; position: absolute; inset: auto -22% -25% 10%; height: 70%; background: radial-gradient(circle at center, rgba(30,188,170,.18), transparent 68%); }
.auth-copy { position: relative; z-index: 1; margin: auto 0; max-width: 560px; }
.auth-copy h1 { max-width: 500px; margin: 12px 0 18px; font-size: clamp(2.5rem, 5vw, 5.1rem); letter-spacing: -.065em; line-height: .96; }
.auth-copy > p:last-child { max-width: 480px; color: #91a5ba; font-size: 1rem; }
.signal-lines { position: absolute; right: -60px; bottom: 14%; width: 390px; height: 390px; }
.signal-lines span { position: absolute; inset: 0; border: 1px solid rgba(64,224,193,.16); border-radius: 50%; }
.signal-lines span:nth-child(2) { inset: 55px; }
.signal-lines span:nth-child(3) { inset: 110px; }
.signal-lines span:nth-child(4) { inset: 165px; background: var(--aqua-bright); box-shadow: 0 0 50px rgba(64,224,193,.45); }
.auth-panel { padding: 30px; display: grid; place-items: center; background: #eef4f5; }
.login-card { width: min(440px, 100%); padding: clamp(28px, 5vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 30px 70px rgba(11,23,40,.12); }
.login-card h2 { margin: 6px 0; font-size: 1.65rem; letter-spacing: -.04em; }
.login-card > div:first-child > p:last-child { margin: 0; color: var(--muted); font-size: .84rem; }
.login-card .flash { margin-top: 18px; }
.login-card .button { margin-top: 24px; }
.secure-note { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #8494a5; font-size: .68rem; text-align: center; }
.secure-note svg { width: 15px; flex: 0 0 auto; }
.installer-shell { min-height: 100vh; padding: 36px 18px; display: grid; place-items: center; background: radial-gradient(circle at top, #18304b 0, var(--navy) 48%); }
.installer-card { width: min(680px, 100%); }
.installer-brand { margin-bottom: 30px; }
.installer-card h1 { margin: 7px 0; font-size: 1.85rem; letter-spacing: -.04em; }
.installer-intro, .installer-card > p { color: var(--muted); font-size: .86rem; }
.requirements { margin: 22px 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; background: #f8fafb; }
.requirements span { display: flex; align-items: center; gap: 8px; color: #51667a; font-size: .75rem; }
.requirements i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 850; }
.requirements .ok i { color: #08796e; background: #dff7f2; }
.requirements .missing i { color: #a53744; background: #ffeaec; }
.installer-card fieldset { margin: 24px 0; padding: 19px; border: 1px solid var(--line); border-radius: 14px; }
.installer-card legend { padding: 0 8px; color: var(--ink); font-size: .82rem; font-weight: 800; }
.installer-grid { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.installer-card form > .button { margin-top: 4px; }
.installer-card .button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.install-result { width: 62px; height: 62px; margin-bottom: 20px; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; font-weight: 850; }
.success-mark { color: #08796e; background: #dff7f2; }

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(290px, 86vw); box-shadow: 20px 0 50px rgba(0,0,0,.25); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: block; flex: 0 0 auto; }
  .topbar { height: 86px; }
  .clock { display: none; }
  .content { padding-top: 24px; }
  .reading-grid { grid-template-columns: repeat(2, 1fr); }
  .endpoint-details { grid-template-columns: 1fr; }
  .state-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: 310px; padding: 34px; }
  .auth-copy { margin: auto 0 0; }
  .auth-copy h1 { max-width: 420px; font-size: clamp(2.4rem, 10vw, 4rem); }
  .auth-copy > p:last-child { display: none; }
  .auth-panel { min-height: 520px; padding: 22px; }
  .signal-lines { width: 280px; height: 280px; bottom: -30%; }
}

@media (max-width: 590px) {
  .summary-grid, .device-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 118px; }
  .section-actions { align-items: flex-start; flex-direction: column; }
  .section-actions .button { width: 100%; }
  .action-group { width: 100%; }
  .action-group form, .action-group .button { flex: 1; }
  .panel-heading { padding: 20px; }
  .chart-legend { display: none; }
  .device-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .device-row .device-reading { display: none; }
  .detail-title { align-items: flex-start; flex-direction: column; }
  .detail-title > div { align-items: flex-start; flex-direction: column; gap: 7px; }
  .detail-title form, .detail-title .button { width: 100%; }
  .reading-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .reading-grid article { padding: 17px; }
  .integration-panel > p { margin-left: 20px; margin-right: 20px; }
  .endpoint-details { padding-left: 20px; padding-right: 20px; }
  pre { margin: 0 20px 20px; }
  th, td { padding: 12px 16px; }
  .auth-intro { min-height: 270px; }
  .auth-copy h1 { font-size: 2.45rem; }
  .requirements { grid-template-columns: 1fr; }
  .installer-grid { grid-template-columns: 1fr; }
  .installer-card fieldset { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

.fault-alert { margin: 16px 0; padding: 16px 20px; border: 1px solid #ef4444; border-radius: 12px; background: #fee2e2; color: #991b1b; font-weight: 700; box-shadow: 0 8px 24px rgba(153,27,27,.16); }
.live-occurrences { margin: 16px 0; padding: 14px; border-top: 1px solid #e5e7eb; }
.occurrence { display:grid; grid-template-columns:1fr auto; gap:3px 10px; padding:8px 0; border-bottom:1px solid #e5e7eb; }
.occurrence span { color:#b45309; font-size:.82rem; font-weight:700; }
.occurrence small { grid-column:1/-1; color:#64748b; }
.occurrence.fault { background:#fff1f2; border-left:4px solid #dc2626; padding-left:10px; }
