:root {
  color-scheme: light;
  --ink: #13211e;
  --ink-soft: #42504c;
  --paper: #eef1e9;
  --paper-bright: #f8f9f4;
  --line: rgba(19, 33, 30, 0.14);
  --orange: #ff6a1a;
  --orange-deep: #d74808;
  --yellow: #f5bd2e;
  --green: #37a66a;
  --red: #dc3e2d;
  --cyan: #399faa;
  --shadow: 0 22px 60px rgba(25, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 189, 46, 0.2), transparent 28rem),
    radial-gradient(circle at 92% 16%, rgba(57, 159, 170, 0.14), transparent 32rem),
    linear-gradient(145deg, #f4f6ef 0%, #e7ebe3 100%);
  font-family: "DIN Alternate", "Bahnschrift", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-feature-settings: "tnum";
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(19, 33, 30, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 33, 30, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(19, 33, 30, 0.7);
  border-radius: 50% 50% 44% 56%;
  color: var(--paper-bright);
  background: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1px;
  transform: rotate(-7deg);
}

.brand > span:last-child {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-family: "STKaiti", "KaiTi", "FangSong", serif;
  font-size: 22px;
  letter-spacing: 0.12em;
}

.brand small,
.eyebrow,
.section-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.connection-pill {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(248, 249, 244, 0.72);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(19, 33, 30, 0.06);
}

.status-dot {
  position: relative;
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
}

.status-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid currentColor;
  border-radius: inherit;
  content: "";
  opacity: 0.45;
  animation: pulse 1.6s infinite;
}

.connection-pill[data-state="online"] .status-dot {
  color: var(--green);
  background: var(--green);
}

.connection-pill[data-state="offline"] .status-dot {
  color: var(--red);
  background: var(--red);
}

main,
footer {
  width: min(1480px, calc(100% - 48px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(30px, 7vw, 110px);
  align-items: end;
  min-height: 430px;
  padding: clamp(50px, 8vw, 118px) 0 54px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--orange-deep);
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: "STKaiti", "KaiTi", "FangSong", serif;
  font-size: clamp(56px, 8.2vw, 128px);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.08em;
}

.hero h1 span {
  display: inline-block;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}

.hero-description {
  max-width: 650px;
  margin: 34px 0 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.8;
}

.hero-status {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(248, 249, 244, 0.08);
  color: var(--paper-bright);
  background:
    radial-gradient(circle at 90% 0%, rgba(55, 166, 106, 0.3), transparent 52%),
    var(--ink);
  box-shadow: var(--shadow);
}

.hero-status::before {
  position: absolute;
  top: -70px;
  right: -70px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.hero-status[data-alarm="true"] {
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 106, 26, 0.55), transparent 58%),
    #2e1813;
}

.hero-status-head,
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-status-head {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.live-label {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #bfffd7;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.hero-status > strong {
  display: block;
  margin-top: 42px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 46px;
  line-height: 1;
}

.hero-status > p {
  min-height: 24px;
  margin: 12px 0 38px;
  color: rgba(248, 249, 244, 0.64);
  font-size: 13px;
}

.hero-meta {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(248, 249, 244, 0.58);
  font-size: 11px;
}

.hero-meta b {
  margin-left: 5px;
  color: var(--paper-bright);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.metric-card,
.panel {
  border: 1px solid rgba(19, 33, 30, 0.1);
  background: rgba(248, 249, 244, 0.82);
  box-shadow: 0 12px 45px rgba(19, 33, 30, 0.07);
  backdrop-filter: blur(8px);
}

.metric-card {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  padding: 25px;
  opacity: 0;
  animation: reveal 0.6s forwards;
}

.metric-card:nth-child(2) {
  animation-delay: 0.08s;
}

.metric-card:nth-child(3) {
  animation-delay: 0.16s;
}

.metric-card:nth-child(4) {
  animation-delay: 0.24s;
}

.metric-card::after {
  position: absolute;
  right: -46px;
  bottom: -74px;
  width: 160px;
  height: 160px;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
}

.metric-icon {
  position: absolute;
  top: 20px;
  right: 21px;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--orange-deep);
  font-size: 16px;
  font-weight: 900;
}

.metric-heading {
  display: grid;
  gap: 8px;
}

.metric-heading > span:first-child {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.metric-state {
  width: max-content;
  padding: 4px 7px;
  border-radius: 2px;
  color: var(--ink-soft);
  background: rgba(19, 33, 30, 0.07);
  font-size: 10px;
}

.metric-card[data-alarm="true"] .metric-state {
  color: white;
  background: var(--red);
}

.metric-value {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin-top: 36px;
}

.metric-value strong {
  font-size: clamp(45px, 4vw, 68px);
  line-height: 1;
  letter-spacing: -0.07em;
}

.metric-value span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.text-value strong {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 46px;
  letter-spacing: 0;
}

.metric-track {
  height: 4px;
  margin-top: 28px;
  overflow: hidden;
  background: rgba(19, 33, 30, 0.1);
}

.metric-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  transition: width 0.5s ease;
}

.smoke-card .metric-track i {
  background: var(--yellow);
}

.distance-card .metric-track i {
  background: var(--cyan);
}

.metric-card > p {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.metric-card > p b {
  color: var(--ink);
}

.presence-radar {
  position: relative;
  width: 100%;
  height: 4px;
  margin-top: 27px;
  background: rgba(19, 33, 30, 0.1);
}

.presence-radar i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid var(--green);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.human-card[data-detected="true"] .presence-radar i {
  animation: radar 1.8s infinite;
}

.human-card[data-detected="true"] .presence-radar i:nth-child(2) {
  animation-delay: 0.6s;
}

.human-card[data-detected="true"] .presence-radar i:nth-child(3) {
  animation-delay: 1.2s;
}

.human-card[data-detected="true"] .human-figure {
  color: white;
  background: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.8fr);
  gap: 15px;
  margin-bottom: 15px;
}

.control-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.72fr);
}

.panel {
  padding: 26px;
}

.panel-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.panel-heading h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 28px;
}

.panel-heading .section-kicker {
  margin-bottom: 7px;
}

.panel-badge {
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.chart-legend i {
  display: block;
  width: 14px;
  height: 3px;
}

.legend-temperature {
  background: var(--orange);
}

.legend-smoke {
  background: var(--yellow);
}

.legend-distance {
  background: var(--cyan);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 285px;
}

#trendChart {
  width: 100%;
  height: 100%;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(19, 33, 30, 0.4);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.chart-empty[hidden] {
  display: none;
}

.alarm-list {
  display: grid;
}

.alarm-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  border-top: 1px solid var(--line);
}

.alarm-item:last-child {
  border-bottom: 1px solid var(--line);
}

.alarm-index {
  color: rgba(19, 33, 30, 0.35);
  font-size: 10px;
  font-weight: 800;
}

.alarm-item div {
  display: grid;
  gap: 4px;
}

.alarm-item b {
  font-size: 13px;
}

.alarm-item small {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.alarm-result {
  padding: 4px 7px;
  color: var(--green);
  background: rgba(55, 166, 106, 0.1);
  font-size: 10px;
  font-weight: 800;
}

.alarm-item[data-alarm="true"] .alarm-result {
  color: white;
  background: var(--red);
}

.relay-control {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(19, 33, 30, 0.025);
}

.relay-visual {
  position: relative;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.relay-door {
  width: 25px;
  height: 34px;
  border: 2px solid var(--ink);
  border-left-width: 6px;
  transition: transform 0.35s ease;
  transform-origin: left center;
}

.relay-door::after {
  display: block;
  width: 4px;
  height: 4px;
  margin: 13px 0 0 11px;
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

.relay-visual[data-on="true"] .relay-door {
  transform: perspective(60px) rotateY(-37deg);
}

.relay-visual[data-on="true"] {
  border-color: rgba(55, 166, 106, 0.45);
  background: rgba(55, 166, 106, 0.08);
}

.relay-copy {
  display: grid;
  gap: 5px;
}

.relay-copy > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.relay-copy strong {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 25px;
}

.relay-copy small {
  color: var(--ink-soft);
  font-size: 11px;
}

.switch {
  display: grid;
  gap: 7px;
  justify-items: center;
  cursor: pointer;
}

.switch input,
.light-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  width: 52px;
  height: 29px;
  border-radius: 99px;
  background: rgba(19, 33, 30, 0.16);
  transition: background 0.25s ease;
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--paper-bright);
  box-shadow: 0 2px 6px rgba(19, 33, 30, 0.18);
  content: "";
  transition: transform 0.25s ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(23px);
}

.switch input:disabled + span,
.light-switch input:disabled ~ * {
  opacity: 0.42;
}

.switch em {
  color: var(--ink-soft);
  font-size: 9px;
  font-style: normal;
}

.control-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.control-actions .primary-button {
  width: 100%;
}

.primary-button,
.secondary-button,
.subheading button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background 0.2s ease;
}

.primary-button {
  color: white;
  background: var(--orange);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}

.primary-button:hover,
.secondary-button:hover,
.subheading button:hover {
  transform: translateY(-2px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none !important;
}

.light-control {
  margin-top: 28px;
}

.subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.subheading > div {
  display: grid;
  gap: 4px;
}

.subheading b {
  font-size: 14px;
}

.subheading small {
  color: var(--ink-soft);
  font-size: 10px;
}

.subheading button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 10px;
}

.light-switches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.light-switch {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 18px 10px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.light-orb {
  width: 26px;
  height: 26px;
  border: 5px solid rgba(19, 33, 30, 0.08);
  border-radius: 50%;
  background: rgba(19, 33, 30, 0.18);
  box-shadow: inset 0 0 0 1px rgba(19, 33, 30, 0.12);
  transition: all 0.25s ease;
}

.light-switch.green input:checked ~ .light-orb {
  background: var(--green);
  box-shadow: 0 0 22px rgba(55, 166, 106, 0.65);
}

.light-switch.yellow input:checked ~ .light-orb {
  background: var(--yellow);
  box-shadow: 0 0 22px rgba(245, 189, 46, 0.75);
}

.light-switch.red input:checked ~ .light-orb {
  background: var(--red);
  box-shadow: 0 0 22px rgba(220, 62, 45, 0.65);
}

.light-switch b {
  font-size: 12px;
}

.light-switch small {
  color: var(--ink-soft);
  font-size: 9px;
}

.access-list {
  margin: 0;
}

.access-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 15px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.access-list > div:last-child {
  border-bottom: 1px solid var(--line);
}

.access-list dt {
  color: var(--ink-soft);
  font-size: 11px;
}

.access-list dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-list code {
  color: var(--orange-deep);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 0 32px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.connection-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  padding: 20px;
  place-items: center;
  visibility: hidden;
  background: rgba(10, 18, 16, 0.72);
  opacity: 0;
  backdrop-filter: blur(14px);
  transition:
    visibility 0.25s,
    opacity 0.25s;
}

.connection-modal.is-visible {
  visibility: visible;
  opacity: 1;
}

.modal-card {
  width: min(520px, 100%);
  padding: clamp(28px, 6vw, 48px);
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 189, 46, 0.22), transparent 40%),
    var(--paper-bright);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.modal-card h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(30px, 6vw, 42px);
}

.modal-card > p:not(.section-kicker) {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.bluetooth-option {
  display: grid;
  gap: 10px;
  margin: 24px 0 28px;
  padding: 18px;
  border: 1px solid rgba(55, 166, 106, 0.28);
  background: rgba(55, 166, 106, 0.07);
}

.bluetooth-button {
  width: 100%;
  min-height: 50px;
  background: var(--green);
}

.bluetooth-option small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.fallback-title {
  margin: 0 !important;
  color: var(--orange-deep) !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.modal-signal {
  display: flex;
  gap: 5px;
  align-items: flex-end;
  height: 33px;
  margin-bottom: 22px;
}

.modal-signal i {
  display: block;
  width: 7px;
  background: var(--orange);
}

.modal-signal i:nth-child(1) {
  height: 11px;
}

.modal-signal i:nth-child(2) {
  height: 21px;
}

.modal-signal i:nth-child(3) {
  height: 31px;
  opacity: 0.25;
}

.wifi-credentials {
  margin: 24px 0;
  border-top: 1px solid var(--line);
}

.wifi-credentials > div {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.wifi-credentials span {
  color: var(--ink-soft);
  font-size: 11px;
}

.wifi-credentials strong {
  font-size: 13px;
  text-align: right;
}

.connection-help {
  padding-left: 12px;
  border-left: 3px solid var(--yellow);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(390px, calc(100% - 44px));
  padding: 14px 18px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-type="error"] {
  background: var(--red);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.65;
    transform: scale(0.75);
  }

  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes radar {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.2);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(6);
  }
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr 330px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar,
  main,
  footer {
    width: min(100% - 28px, 1480px);
  }

  .topbar {
    padding: 13px 0;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small {
    display: none;
  }

  .connection-pill {
    padding: 0 11px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 65px 0 34px;
  }

  .hero h1 {
    font-size: clamp(54px, 19vw, 88px);
  }

  .hero-status {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 225px;
  }

  .panel {
    padding: 20px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-legend {
    order: 2;
  }

  .chart-wrap {
    height: 240px;
  }

  .relay-control {
    grid-template-columns: 65px 1fr;
    padding: 18px;
  }

  .relay-visual {
    width: 60px;
    height: 60px;
  }

  .control-actions,
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .light-switches {
    gap: 6px;
  }

  .light-switch {
    padding-inline: 6px;
  }

  footer {
    gap: 10px;
    flex-direction: column;
  }
}

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