:root {
  --navy: #10265f;
  --navy-deep: #071028;
  --plum: #70264d;
  --red: #d0202e;
  --bg: #071028;
  --panel: #24366e;
  --ink: #ffe14a;
  --muted: #ffe14a;
  --chrome: #e8e2f2;
  --line: #8b9ad4;
  --accent: #d0202e;
  --danger: #d0202e;
  --ok: #2f8f6b;
  --radius: 10px;
  --brand: linear-gradient(90deg, #10265f 0%, #70264d 48%, #d0202e 100%);
}

* { box-sizing: border-box; }
html.is-kiosk, html.is-kiosk * { cursor: none !important; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  background: #070d22;
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  overflow: hidden;
}
.app {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-frame {
  width: 1024px;
  height: 600px;
  flex: none;
  overflow: hidden;
}
.stage {
  width: 1024px;
  height: 600px;
  display: flex;
  flex-direction: column;
  padding: 12px 20px 12px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  transform-origin: top left;
  -webkit-font-smoothing: antialiased;
}
.stage.is-alarm {
  box-shadow: inset 0 0 0 4px var(--red);
}
.stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--brand);
  z-index: 2;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: none;
  min-width: 0;
  min-height: 52px;
  margin: 6px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.logo-link {
  display: block;
  flex: none;
  line-height: 0;
  border-radius: 6px;
}
.logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: 280px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 2px #fff;
}
html.is-kiosk .logo-link {
  pointer-events: none;
}
h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--chrome);
  line-height: 1;
}
.sensor-addr {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--chrome);
  line-height: 1;
  white-space: nowrap;
}
.sensor-addr [data-i18n="hdr.addr"] {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--chrome);
}
.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}
.status-row .meta,
.status-row .badge,
.status-row .btn-secondary,
.status-row .btn-ghost {
  color: var(--chrome);
}
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.badge-ok { background: #1a5c48; color: var(--ink); }
.badge-warn { background: #6a2040; color: var(--ink); }

.pages {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.pages-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translateX(0);
  transition: transform 220ms ease;
}
.pages-track.is-page-1 {
  transform: translateX(-100%);
}
.pages-track.is-page-2 {
  transform: translateX(-200%);
}
.pages-track.is-page-3 {
  transform: translateX(-300%);
}
.page {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  box-shadow: -3px 0 0 var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  .pages-track { transition: none; }
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
  padding-right: 4px;
  box-sizing: border-box;
}
.card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card > .value {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0;
  min-height: 0;
}
.hero {
  grid-row: 1 / span 2;
  padding: 14px 16px 16px;
}
.hero .label {
  flex: none;
}
.hero .value {
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  font-size: 203px;
  line-height: 0.82;
  letter-spacing: -0.02em;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.hero .value.is-wide {
  font-size: 176px;
}
.hero .value .num {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.hero .value small {
  flex: none;
  font-size: 34px;
  margin-left: 0;
  margin-top: 6px;
  letter-spacing: 0.08em;
  font-weight: 600;
  align-self: flex-start;
  line-height: 1;
}
.hero .value.is-empty {
  font-size: 48px;
  letter-spacing: 0.04em;
}
.meta {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  word-spacing: normal;
  line-height: 1.25;
  white-space: nowrap;
}
.hero .meta {
  flex: none;
  font-size: 20px;
}
#card-peak #avg3-sub {
  font-size: 40px;
}
.air-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
}
.air-stack > .card {
  flex: 1;
  min-height: 0;
}
#card-temp .meta {
  font-size: 12px;
  flex: 1;
  align-content: center;
}
#card-temp .temp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: baseline;
  width: 100%;
}
#card-temp .temp-row > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#card-temp .temp-val {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  justify-self: end;
  min-width: 6ch;
}
.label {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  min-width: 0;
  padding-right: 2px;
}
.label-hint {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0;
  word-spacing: 0.08em;
  line-height: 1.2;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  padding-right: 8px;
}
#card-live,
#alarms-card {
  padding-right: 16px;
}
#card-live .label,
#card-live .label-hint,
#alarms-card .label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
  letter-spacing: 0;
  word-spacing: 0.08em;
  padding-right: 8px;
}
#card-live .label > span,
#card-live .label-hint > span,
#alarms-card .label > span {
  flex: none;
  padding-right: 1px;
}
#card-live .meta {
  flex: none;
}
.value {
  margin: 2px 0;
  font-size: 52px;
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.value-sm { font-size: 48px; }
.value.is-empty {
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.dir.is-empty {
  color: var(--ink);
}
.dir {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.value small {
  margin-left: 14px;
  font-size: 22px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--muted);
}

.highs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 8px;
  padding-right: 4px;
  box-sizing: border-box;
}
.highs-head .label {
  font-size: 20px;
}
.seg {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg-item {
  margin: 0;
  cursor: pointer;
}
.seg-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.seg-item input:checked + span {
  background: var(--navy);
  color: var(--ink);
}
.seg-item input:focus-visible + span {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}
.highs-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
}
.highs-cols-one {
  grid-template-columns: minmax(0, 1fr);
}
#page-highs .highs-cols {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  padding-right: 4px;
  box-sizing: border-box;
}
#page-highs .highs-card {
  min-width: 0;
  max-width: 100%;
}
#page-highs .highs-card-temp .highs-list li {
  gap: 8px;
  padding: 0 6px;
  font-size: 18px;
}
.highs-card {
  min-height: 0;
  padding-bottom: 10px;
}
.highs-card .highs-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}
.highs-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: high;
}
.highs-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
#page-highs .highs-list li:nth-child(odd) {
  background: #1a2a58;
}
#page-highs .highs-list li:nth-child(even) {
  background: #2e427a;
}
#page-highs .highs-list li.highs-empty,
#page-alarms .highs-list li.highs-empty {
  background: transparent;
}
#page-alarms .highs-list li:nth-child(odd) {
  background: #1a2a58;
}
#page-alarms .highs-list li:nth-child(even) {
  background: #2e427a;
}
.weather-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 268px);
  gap: 8px;
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
}
.weather-body:has(#weather-radar-card[hidden]):has(#weather-lightning-card[hidden]) {
  grid-template-columns: 1fr;
}
.weather-maps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
}
.weather-table-card,
.weather-radar-card,
.weather-lightning-card {
  min-height: 0;
  padding: 8px 10px 8px;
}
.weather-radar-card,
.weather-lightning-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.weather-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.weather-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 15px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.weather-table th,
.weather-table td {
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
}
.weather-table th.num,
.weather-table td.num {
  text-align: right;
}
.weather-table col.wx-c-time { width: 6.2rem; }
.weather-table col.wx-c-wind,
.weather-table col.wx-c-gust,
.weather-table col.wx-c-temp,
.weather-table col.wx-c-rain { width: 5.4rem; }
.weather-table col.wx-c-dir { width: 4.6rem; }
.weather-table tbody tr:nth-child(odd) { background: #1a2a58; }
.weather-table tbody tr:nth-child(even) { background: #2e427a; }
.weather-table .wx-wind,
.weather-table .wx-gust { font-weight: 700; }
.weather-table .wx-empty {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  background: transparent;
}
.weather-radar-card .label,
.weather-lightning-card .label {
  font-size: 13px;
}
.weather-radar-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 2px;
  background: #071028;
  border-radius: 6px;
  overflow: hidden;
}
.weather-radar-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.weather-radar-frame .weather-radar-base {
  z-index: 0;
}
.weather-radar-frame .weather-radar-overlay {
  z-index: 1;
}
.weather-lightning-mark {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #ffe14a;
  box-shadow: 0 0 0 2px #d0202e;
  pointer-events: none;
  z-index: 3;
}
.weather-radar-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  pointer-events: none;
  z-index: 2;
}
.weather-radar-pin::before,
.weather-radar-pin::after {
  content: "";
  position: absolute;
  background: var(--red);
  box-shadow: 0 0 0 1px #fff;
}
.weather-radar-pin::before {
  left: 7px;
  top: 0;
  width: 2px;
  height: 16px;
}
.weather-radar-pin::after {
  left: 0;
  top: 7px;
  width: 16px;
  height: 2px;
}
.weather-radar-legend,
.weather-radar-scale {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  word-spacing: 0.06em;
  line-height: 1.2;
  color: var(--ink);
  min-width: 0;
}
.weather-radar-scale {
  display: flex;
  align-items: center;
  gap: 6px;
}
.weather-radar-bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #2f8f6b 0%, #ffe14a 48%, #d0202e 100%);
}
.highs-list li::before {
  counter-increment: high;
  content: counter(high);
  color: var(--muted);
  font-weight: 700;
}
.highs-list .high-val { font-weight: 700; }
.highs-list .high-when { color: var(--muted); }
.highs-empty {
  display: block;
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.highs-list .highs-empty::before { content: none; }
.alarms-page-list {
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.alarms-page-list li {
  flex: none;
  min-height: 48px;
  font-size: 22px;
}
#page-alarms .alarms-page-list li.is-firing,
#page-alarms .alarms-page-list li.is-armed {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  position: relative;
  padding: 10px 12px 10px 40px;
  min-height: 56px;
}
#page-alarms .alarms-page-list li.is-firing::before,
#page-alarms .alarms-page-list li.is-armed::before {
  position: absolute;
  left: 8px;
  top: 12px;
}
#page-alarms .alarm-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
#page-alarms .alarm-copy {
  font-size: 16px;
}
.alarms-page-list li.is-armed,
.alarms-page-list li.is-firing {
  cursor: pointer;
}
.alarms-page-list li.is-armed .high-val,
.alarms-page-list li.is-armed .high-when {
  font-weight: 600;
}
.alarms-page-list li.is-firing .high-val,
.alarms-page-list li.is-firing .high-when {
  font-weight: 700;
}
#page-alarms-card.is-on {
  background: #6a2040;
  border-color: #ff4d5e;
  box-shadow: inset 6px 0 0 #ff4d5e;
}
/* Hug the alarm list. Highs/weather keep flex-fill; one or two
   alarms must not stretch the card into an empty navy field. */
#page-alarms .highs-cols,
#page-alarms .highs-cols-one {
  align-items: start;
  align-content: start;
  padding-right: 4px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
#page-alarms-card {
  width: 100%;
  height: auto;
  max-width: 100%;
  min-width: 0;
  max-height: 100%;
}
#page-alarms-card .highs-list {
  flex: 0 1 auto;
}

.btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  word-spacing: normal;
  line-height: 42px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn:focus { outline: 2px solid var(--red); outline-offset: 2px; }
.btn-primary { background: var(--red); color: var(--ink); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--ink); border-color: transparent; }

.foot {
  margin-top: 8px;
  padding-top: 4px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.foot .meta {
  margin: 0;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  color: var(--chrome);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.pager-dot {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.pager-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 999px;
  background: var(--line);
}
.pager-dot.is-on::after {
  width: 22px;
  margin-left: -11px;
  background: #e8e2f2;
}
.pager-dot:focus { outline: 2px solid var(--red); outline-offset: 2px; }

.card-alarms.is-on {
  background: #6a2040;
  border-color: #ff4d5e;
  box-shadow: inset 6px 0 0 #ff4d5e;
}
.card.is-alarm-src {
  animation: alarm-flash 0.7s steps(1, end) infinite;
  border-color: #ff4d5e;
}
@keyframes alarm-flash {
  0%, 49% {
    background: #9a1a28;
    box-shadow: inset 0 0 0 4px #ff4d5e;
  }
  50%, 100% {
    background: var(--panel);
    box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card.is-alarm-src {
    animation: none;
    background: #9a1a28;
    border-color: #ff4d5e;
  }
}
.alarms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: none;
  min-width: 0;
}
.card-alarms:not(.is-on) .alarm-list:empty {
  display: none;
  flex: none;
}
.card-alarms:not(.is-on) .alarm-empty {
  flex: 1;
  align-content: flex-start;
  padding-top: 2px;
}
.alarms-head .btn {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}
.alarm-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
}
.alarm-list li {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.alarm-list li[data-rule-id] {
  cursor: pointer;
}
.alarm-list li.is-armed {
  color: var(--muted);
  font-weight: 600;
}
.alarm-list .alarm-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.alarm-list .alarm-item-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}
.alarm-list .alarm-item-hit {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.alarm-list .alarm-copy,
#page-alarms .alarm-copy {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: pre-wrap;
}
.alarm-copy-lab {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1px;
}
.alarm-list li[data-rule-id] {
  cursor: pointer;
}
.alarm-list li.is-armed {
  color: var(--muted);
  font-weight: 600;
}
.alarm-empty {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: flex-start;
  gap: 0.4em;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 2px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow: visible;
  min-height: calc(12px * 1.25 * 2 + 4px);
  appearance: none;
  -webkit-appearance: none;
}
.alarm-empty > span {
  flex: none;
  padding-right: 1px;
}

dialog.modal {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 12px;
  border: none;
  /* Chromium 91 kiosk: display:flex on <dialog> drops ::backdrop and
     the live cards paint through the form. Block + own dim keeps both. */
  background: rgba(6, 10, 28, 0.78);
  display: none;
  overflow: auto;
  letter-spacing: 0;
  word-spacing: normal;
  transform: none;
  z-index: 30;
}
dialog.modal[open] {
  display: block;
}
dialog.modal form {
  width: 640px;
  max-width: min(640px, calc(100vw - 24px));
  margin: 0 auto;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
dialog.modal,
dialog.modal * {
  letter-spacing: 0;
  word-spacing: normal;
}
.modal::backdrop { background: rgba(6, 10, 28, 0.72); }
.modal header, .modal footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  flex: none;
  position: relative;
  z-index: 2;
  background: var(--panel);
}
.alarm-form-foot-end {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.modal header {
  border-bottom: 4px solid transparent;
  border-image: var(--brand) 1;
}
.modal h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.modal form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}
.modal .help, .modal label {
  margin: 0 14px 8px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
}
.modal label { color: var(--ink); display: block; }
.modal input,
.modal select {
  width: 100%;
  margin-top: 4px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--navy-deep);
  color: var(--ink);
  padding: 0 10px;
  font-size: 16px;
}
#admin-form {
  overflow: auto;
}
.admin-cert {
  margin: 4px 14px 10px;
}
.admin-cert label {
  margin: 0 0 8px;
}
.admin-cert .label {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}
.admin-cert .help {
  margin: 0 0 8px;
}
.admin-cert-status {
  color: var(--ink);
}
.admin-cert input[type="file"] {
  min-height: 44px;
  padding: 8px 0;
}
.admin-cert .btn {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  justify-content: center;
}
dialog.modal-alarms form {
  width: 720px;
  max-width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  height: auto;
  display: flex;
  flex-direction: column;
}
.alarm-cards {
  flex: 1 1 0;
  min-height: 0;
  max-height: 42vh;
  overflow: auto;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
}
.alarm-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--navy-deep);
  flex: none;
}
.alarm-card.is-fresh {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.alarm-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.alarm-card-top .group-name,
.alarm-card > .group-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}
.alarm-groups {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.alarm-groups button,
.unit-seg button {
  min-height: 48px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: normal;
  line-height: 1.2;
  pointer-events: auto;
}
.alarm-groups button.is-on,
.unit-seg button.is-on {
  background: var(--navy);
  border-color: var(--ink);
}
.unit-seg {
  display: flex;
  gap: 6px;
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-step {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.stepper-val {
  min-width: 96px;
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
}
.stepper-unit {
  min-width: 40px;
  font-size: 16px;
  font-weight: 700;
}
.rule-actions {
  margin: 8px 14px;
  flex: none;
}
.btn-add-alarm {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}
.btn-add-alarm:focus { outline-offset: 0; }
.alarm-text {
  display: block;
  margin: 0 14px 8px;
  flex: none;
  position: relative;
  z-index: 2;
  background: var(--panel);
}
.alarm-text span {
  display: block;
}
.modal textarea {
  width: 100%;
  margin-top: 4px;
  min-height: 56px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--navy-deep);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  resize: none;
}
.alarm-email {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 8px;
  flex: none;
  position: relative;
  z-index: 2;
  background: var(--panel);
}
.alarm-email span {
  flex: none;
  white-space: nowrap;
}
.alarm-email input {
  margin-top: 0;
  min-height: 40px;
}
.alarm-fields {
  display: flex;
  flex-direction: column;
  flex: none;
  min-height: 0;
}
.alarm-empty-hint { text-align: center; flex: none; }
.download-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 16px 16px;
}
.download-list .btn {
  justify-content: center;
  width: 100%;
}
#export-link {
  display: block;
  margin: 0 16px 16px;
  word-break: break-all;
  text-align: center;
}
#export-link[hidden] { display: none !important; }
#export-link-help { margin: 0 16px 8px; }
.icon-close {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  cursor: pointer;
}

html.is-kiosk dialog.modal[open] {
  padding: 6px;
}
html.is-kiosk dialog.modal-alarms {
  overflow: hidden;
}
html.is-kiosk dialog.modal-alarms form {
  display: flex;
  flex-direction: column;
  width: calc(100vw - 12px);
  max-width: none;
  height: calc(100vh - 12px);
  max-height: calc(100vh - 12px);
  overflow: hidden;
}
html.is-kiosk .modal header,
html.is-kiosk .modal footer {
  padding: 6px 12px;
}
html.is-kiosk .modal h2 {
  font-size: 18px;
}
html.is-kiosk .icon-close {
  width: 40px;
  height: 40px;
}
html.is-kiosk .alarm-cards {
  flex: none;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding: 6px 12px 4px;
  gap: 6px;
}
html.is-kiosk .alarm-card {
  padding: 8px 10px;
  gap: 6px;
}
html.is-kiosk .alarm-card-top .group-name,
html.is-kiosk .alarm-card > .group-name {
  font-size: 15px;
}
html.is-kiosk .alarm-groups {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
html.is-kiosk .alarm-groups button,
html.is-kiosk .unit-seg button {
  min-height: 38px;
  font-size: 12px;
  padding: 4px 6px;
}
html.is-kiosk .unit-seg {
  gap: 6px;
}
html.is-kiosk .stepper {
  gap: 8px;
}
html.is-kiosk .btn-step {
  width: 44px;
  min-width: 44px;
  height: 44px;
  font-size: 26px;
}
html.is-kiosk .stepper-val {
  min-width: 84px;
  font-size: 28px;
}
html.is-kiosk .stepper-unit {
  font-size: 14px;
}
html.is-kiosk .alarm-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "name email"
    "detail measures";
  gap: 6px 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 4px 12px 6px;
  align-content: stretch;
}
html.is-kiosk .alarm-fields .alarm-text,
html.is-kiosk .alarm-fields .alarm-email {
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html.is-kiosk .alarm-fields .alarm-text:nth-child(1) { grid-area: name; }
html.is-kiosk .alarm-fields .alarm-text:nth-child(2) { grid-area: detail; }
html.is-kiosk .alarm-fields .alarm-text:nth-child(3) { grid-area: measures; }
html.is-kiosk .alarm-fields .alarm-email { grid-area: email; }
html.is-kiosk .alarm-fields span {
  font-size: 13px;
  margin-bottom: 2px;
}
html.is-kiosk #notify-email,
html.is-kiosk #alarm-name,
html.is-kiosk #alarm-detail,
html.is-kiosk #alarm-measures {
  font-size: 16px;
  min-height: 40px;
}
html.is-kiosk .alarm-fields textarea {
  flex: 1 1 auto;
  min-height: 48px;
  max-height: none;
  font-size: 15px;
  padding: 6px 8px;
}
html.is-kiosk .alarm-email {
  align-items: stretch;
  flex-direction: column;
  gap: 2px;
}
html.is-kiosk .alarm-email input {
  min-height: 40px;
}
html.is-kiosk dialog.modal-alarms.osk-open {
  padding: 0;
  overflow: hidden;
  height: 100%;
}
html.is-kiosk dialog.modal-alarms.osk-open form {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  overflow: hidden;
}
html.is-kiosk dialog.modal-alarms.osk-open .alarm-fields {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
html.is-kiosk dialog.modal-alarms.osk-open .alarm-cards,
html.is-kiosk dialog.modal-alarms.osk-open .alarm-form-foot {
  display: none !important;
}
html.is-kiosk dialog.modal-alarms.osk-open .alarm-email,
html.is-kiosk dialog.modal-alarms.osk-open .alarm-text {
  display: none;
}
html.is-kiosk dialog.modal-alarms.osk-open .is-osk-target {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 12px 16px 8px;
  margin-top: auto;
}
html.is-kiosk dialog.modal-alarms.osk-open .is-osk-target span {
  font-size: 16px;
}
html.is-kiosk dialog.modal-alarms.osk-open .is-osk-target input,
html.is-kiosk dialog.modal-alarms.osk-open .is-osk-target textarea {
  font-size: 28px;
  min-height: 56px;
  letter-spacing: 0;
}
html.is-kiosk dialog.modal-alarms.osk-open .is-osk-target textarea {
  min-height: 96px;
}
html.is-kiosk .osk {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 8px 8px 12px;
  background: var(--navy-deep);
  border-top: 1px solid var(--line);
  flex: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
html.is-kiosk .osk-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
html.is-kiosk .osk-key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  touch-action: manipulation;
}
html.is-kiosk .osk-key.is-wide {
  flex: 1.35 1 0;
}
html.is-kiosk .osk-key.is-space {
  flex: 2.4 1 0;
}
html.is-kiosk .osk-key.is-action {
  flex: 1.5 1 0;
  background: var(--navy);
  font-size: 16px;
}
html.is-kiosk .osk-key.is-on {
  background: var(--navy);
  border-color: var(--ink);
}
html.is-kiosk .osk-spacer {
  flex: 0.5 1 0;
  min-width: 0;
}

/* Kiosk scrollbars: navy track, muted-blue thumb (yellow on hover). */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line) var(--navy-deep);
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: var(--navy-deep);
}
*::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--ink);
}
*::-webkit-scrollbar-corner {
  background: var(--navy-deep);
}

#forecast-warn,
#forecast-warn-wx {
  flex: none;
  margin: 0 0 8px;
  padding: 6px 10px;
  max-height: 72px;
  overflow-y: auto;
  border: 2px solid #e6b800;
  border-radius: var(--radius);
  background: #4a3a10;
  color: var(--ink);
  box-shadow: inset 4px 0 0 #e6b800;
}
.warning-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffe14a;
}
.warning-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.warning-item {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-table tbody tr.warning-hour {
  background: #4a3a10 !important;
  box-shadow: inset 4px 0 0 #e6b800;
}
html.is-readonly #open-admin,
html.is-readonly #open-export,
html.is-readonly #open-alarms,
html.is-readonly a[href="/certificate.pdf"],
html.is-readonly .js-mute-alarm {
  display: none !important;
}

