.iot-page {
  --iot-navy: #0b202e;
  --iot-border: #31505d;
  --iot-text: #b7ccd6;
}

.iot-flow ol, .iot-stages, .iot-tables, .iot-notifications {
  list-style: none;
  margin: 0;
  padding: 0;
}

.iot-flow-image {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
  border-radius: 8px;
}

.iot-flow ol {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.iot-flow li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 9.25rem) minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 12px;
  border: 1px solid var(--iot-border);
  border-radius: 8px;
  background: #132e3c;
}

.iot-flow li:nth-child(2) { border-color: #549c9c; background: #173c47; --delay: .65s; }
.iot-flow li:nth-child(3) { --delay: 1.3s; }
.iot-flow li strong { color: var(--impl-teal); font-size: .73rem; letter-spacing: .08em; text-transform: uppercase; }
.iot-flow li span { color: var(--iot-text); font-size: .84rem; }
.iot-flow li:not(:last-child)::before, .iot-flow li:not(:last-child)::after {
  position: absolute;
  content: "";
  top: 100%;
  left: 24px;
}
.iot-flow li:not(:last-child)::before { width: 1px; height: 14px; background: #5d9b9d; }
.iot-flow li:not(:last-child)::after {
  width: 5px;
  height: 5px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--impl-teal);
  box-shadow: 0 0 8px var(--impl-teal);
  opacity: 0;
  animation: iot-pulse .65s ease-in var(--delay, 0s);
}

@keyframes iot-pulse {
  20%, 80% { opacity: 1; }
  to { transform: translateY(9px); }
}

.iot-intro-copy p + p { margin-top: .9em; }
.iot-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.iot-stages li {
  position: relative;
  padding: 24px;
  border: 1px solid var(--impl-line);
  border-top: 3px solid #338884;
  border-radius: 10px;
  background: #f2f8f8;
}
.iot-stages li h3 { margin: 0 0 8px; }
.iot-stages li p { margin: 0; }
.iot-stages li:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  content: "";
  top: 50%;
  left: 100%;
  width: 18px;
  height: 1px;
  background: #338884;
}
.iot-stages.is-visible li { animation: iot-stage-in .5s ease-out both; }
.iot-stages.is-visible li:nth-child(2) { animation-delay: .16s; }
.iot-stages.is-visible li:nth-child(3) { animation-delay: .32s; }
@keyframes iot-stage-in {
  from { opacity: .55; transform: translateY(9px); }
}

.iot-dashboard {
  color: #eff8fa;
  background: var(--iot-navy);
  border: 1px solid var(--iot-border);
  border-radius: 14px;
  box-shadow: 0 24px 48px #09172424;
}
.iot-dashboard-header, .iot-dashboard-body { padding: clamp(14px, 3vw, 28px); }
.iot-dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--iot-border);
}
.iot-dashboard-header p { color: var(--impl-teal); font-size: .75rem; margin: 0 0 4px; }
.iot-dashboard h3, .iot-dashboard h4 { color: inherit; margin: 0; }
.iot-controls:not([hidden]) { display: flex; flex-wrap: wrap; gap: 8px; }
.iot-controls button {
  padding: 8px 12px;
  min-height: 44px;
  border: 1px solid #72919e;
  border-radius: 6px;
  color: #eaf8fa;
  background: #173341;
  font: inherit;
  font-size: .83rem;
  cursor: pointer;
}
.iot-controls [data-simulate] { background: var(--impl-teal); color: #0a292c; font-weight: 750; }
.iot-controls button:hover { filter: brightness(1.12); }
.iot-dashboard-body { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; }
.iot-plan {
  padding: clamp(8px, 2vw, 18px);
  border: 2px solid #50717e;
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, #183440 0 29px, #1d3a46 29px 30px);
}
.iot-plan-fixtures { display: flex; justify-content: space-between; gap: 8px; }
.iot-plan-fixtures span {
  padding: 5px 8px;
  border: 1px solid #527584;
  border-radius: 3px;
  background: #122a37;
  color: #d3e4eb;
  font-size: .69rem;
}
.iot-plan-entry span:first-child { border-bottom-style: dashed; }
.iot-tables {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 12px;
  margin: 24px 0;
}
.iot-tables li { position: relative; min-width: 0; color: var(--table-colour); }
.iot-tables li:nth-child(9) { grid-column: 2; }
.iot-tables li::before, .iot-tables li::after {
  content: "";
  position: absolute;
  left: 36%;
  width: 28%;
  height: 5px;
  border: 1px solid #63808a;
  border-radius: 3px;
  pointer-events: none;
}
.iot-tables li::before { top: -6px; }
.iot-tables li::after { bottom: -6px; }
.iot-tables [data-status="available"] { --table-colour: #93e8b4; --table-bg: #143c32; }
.iot-tables [data-status="occupied"] { --table-colour: #acd6ff; --table-bg: #183651; }
.iot-tables [data-status="cleaning"] { --table-colour: #ffda96; --table-bg: #443727; }
.iot-tables [data-status="attention"] { --table-colour: #ffb6bc; --table-bg: #482d37; }
.iot-tables li, .iot-tables button {
  padding: 6px;
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--table-colour);
  border-radius: 8px;
  background: var(--table-bg);
  text-align: center;
  line-height: 1.15;
  font-size: .82rem;
  font-weight: 700;
}
.iot-tables li:has(button) { padding: 0; border: 0; }
.iot-tables button { width: 100%; height: 100%; color: inherit; cursor: pointer; }
.iot-tables button:hover, .iot-tables button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--table-colour); }
.iot-tables small { font-size: .69rem; font-weight: 500; }
.iot-dashboard button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.iot-table-detail {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--iot-border);
  border-radius: 6px;
  color: var(--iot-text);
  font-size: .84rem;
}
.iot-overview { border: 1px solid var(--iot-border); border-radius: 8px; padding: 14px; }
.iot-metrics { margin: 8px 0 20px; }
.iot-metrics div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--iot-border); padding: 5px 0; }
.iot-metrics dt { color: var(--iot-text); font-size: .8rem; }
.iot-metrics dd { margin: 0; color: var(--impl-teal); white-space: nowrap; font-size: .95rem; font-weight: 750; }
.iot-notifications li { display: grid; gap: 3px; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--iot-border); font-size: .77rem; }
.iot-notifications li span { color: var(--iot-text); }
.iot-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 820px) {
  .iot-dashboard-body { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .iot-flow li { grid-template-columns: 1fr; }
  .iot-stages { grid-template-columns: 1fr; }
  .iot-stages li:not(:last-child)::after { left: 24px; top: 100%; width: 1px; height: 18px; }
  .iot-tables { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 7px; }
  .iot-tables li:nth-child(9) { grid-column: auto; }
  .iot-tables li:last-child { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .iot-flow li:not(:last-child)::after, .iot-stages.is-visible li { animation: none; }
}
