:root {
  color-scheme: light;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #e9f2ef;
  color: #12312f;
  --page-gutter: 14px;
  --card-gap: 10px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(circle at 18% 10%, rgba(95, 201, 199, 0.26), transparent 28%),
    linear-gradient(140deg, #e6f4f0 0%, #f7faf8 56%, #dcebe7 100%);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.app-shell {
  position: relative;
  width: min(100vw, 430px);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #f5faf8;
}

.screen {
  display: none;
  position: relative;
  height: 100%;
  padding-bottom: 96px;
  overflow-y: auto;
}

.screen-active {
  display: block;
}

#pondScreen {
  padding-bottom: 0;
  overflow: hidden;
}

#pondScreen.screen-active {
  display: flex;
  flex-direction: column;
}

.main-tab {
  display: none;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  contain: layout paint;
}

.main-tab-active {
  display: block;
  flex: 1 1 auto;
}

.top-area,
.detail-hero {
  background: #ddf4ee;
  padding: max(22px, env(safe-area-inset-top)) var(--page-gutter) 18px;
}

.title-row,
.detail-title-row,
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-row {
  margin-top: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.25;
}

.title-row p {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #43706a;
}

.chips {
  display: flex;
  gap: 8px;
}

.chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 24px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.ok {
  background: #c9eee6;
  color: #17655c;
}

.chip.warn {
  background: #ffe1ce;
  color: #9a421a;
}

.chip.offline {
  background: #ffe8e3;
  color: #b83228;
}

.summary-card,
.panel,
.pond-section {
  border: 1px solid #ddeae6;
  background: #ffffff;
  border-radius: 8px;
}

.summary-card {
  min-height: 80px;
  margin-top: 20px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alarm-contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
}

.summary-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 10px;
}

.summary-card span {
  display: block;
  font-size: 13px;
  color: #6c817d;
}

.alarm-contact-heading {
  min-width: 0;
}

.alarm-contact-heading strong {
  margin-bottom: 6px;
}

.alarm-contact-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.summary-card .alarm-contact-value {
  width: min(245px, 54vw);
  min-width: 0;
  color: #087b69;
  font-size: clamp(26px, 6.5vw, 32px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.035em;
  text-shadow: 0 2px 3px rgba(8, 123, 105, 0.24), 0 6px 14px rgba(8, 123, 105, 0.12);
  overflow-wrap: anywhere;
}

.summary-card .alarm-contact-value.is-placeholder {
  color: #6c817d;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
}

.alarm-contact-form input {
  width: min(180px, 44vw);
  height: 34px;
  min-width: 0;
  border: 1px solid #cfe2dd;
  border-radius: 8px;
  padding: 0 10px;
  background: #f6fbf9;
  color: #174a43;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.alarm-contact-form input[hidden],
.alarm-contact-value[hidden] {
  display: none;
}

.alarm-contact-form input:focus {
  border-color: #1a9f86;
  box-shadow: 0 0 0 3px rgba(26, 159, 134, 0.13);
}

.alarm-contact-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #b9ddd5;
  border-radius: 50%;
  background: #e5f5f1;
  color: #136f63;
}

.alarm-contact-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.alarm-contact-action.is-saving {
  border-color: #159d70;
  background: #18a875;
  color: #ffffff;
}

.alarm-contact-action:disabled {
  opacity: 0.5;
}

.alarm-contact-action:active:not(:disabled) {
  transform: scale(0.94);
}

.alarm-contact-status {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #6c817d;
  font-size: 12px;
  font-weight: 700;
}

.summary-tip {
  margin: 8px 0 0;
  color: #58716d;
  font-size: 12px;
  line-height: 1.45;
}

.primary-mini {
  width: 76px;
  height: 34px;
  border-radius: 8px;
  background: #136f63;
  color: white;
  font-weight: 700;
}

.farm-select-wrap {
  position: relative;
  min-width: 0;
}

.farm-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #136f63;
  border-bottom: 2px solid #136f63;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.log-device-filter select {
  width: 100%;
  height: 38px;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0 34px 0 12px;
  background: #eef8f5;
  color: #136f63;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  outline: none;
}

.pond-list {
  display: grid;
  gap: var(--card-gap);
  padding: 0 var(--page-gutter) 22px;
}

.pond-section {
  overflow: hidden;
}

.pond-header {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto 18px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #ffffff;
  color: #12312f;
  text-align: left;
}

.pond-preview {
  position: relative;
  width: 54px;
  height: 42px;
  overflow: hidden;
  border-radius: 8px;
  background: #5dc9c7;
}

.pond-preview::before,
.pond-preview::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.pond-preview::before {
  width: 72px;
  height: 22px;
  left: -8px;
  top: 5px;
  background: rgba(255, 255, 255, 0.22);
}

.pond-preview::after {
  width: 36px;
  height: 14px;
  right: -8px;
  bottom: 7px;
  background: rgba(39, 153, 165, 0.24);
}

.pond-meta {
  min-width: 0;
}

.pond-meta strong,
.pond-meta span,
.pond-stats span {
  display: block;
}

.pond-meta strong {
  font-size: 16px;
  line-height: 22px;
}

.pond-meta span {
  margin-top: 4px;
  overflow: hidden;
  color: #6c817d;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pond-stats {
  display: grid;
  gap: 3px;
  min-width: 52px;
  text-align: right;
}

.pond-stats span:first-child {
  color: #136f63;
  font-size: 15px;
  font-weight: 900;
}

.pond-stats span:last-child {
  color: #9a421a;
  font-size: 11px;
  font-weight: 700;
}

.chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #78918c;
  border-bottom: 2px solid #78918c;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.pond-section.is-expanded .chevron {
  transform: rotate(225deg);
}

.pond-body {
  display: none;
  padding: 0 8px 12px;
}

.pond-section.is-expanded .pond-body {
  display: block;
}

.pond-card {
  position: relative;
  min-height: 438px;
  overflow: hidden;
  padding: 50px 8px 16px;
  border-radius: 18px;
  border: 1px solid #bfede8;
  background: #5dc9c7;
}

.water-layer,
.water-shine {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.layer-one {
  left: -20px;
  top: 16px;
  width: 388px;
  height: 96px;
  background: rgba(164, 227, 219, 0.34);
}

.layer-two {
  left: -30px;
  top: 160px;
  width: 410px;
  height: 112px;
  background: rgba(56, 174, 184, 0.26);
}

.water-shine {
  right: 30px;
  top: 54px;
  width: 96px;
  height: 34px;
  background: rgba(255, 255, 255, 0.14);
}

.pond-label {
  position: absolute;
  left: 16px;
  top: 14px;
  font-size: 13px;
  font-weight: 800;
  color: #0e555c;
}

.device-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 104px);
  gap: 7px;
}

.pond-video-card {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  background: #173d3a;
  box-shadow: 0 5px 14px rgba(12, 74, 74, 0.16);
}

.pond-video-stream {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  background: #173d3a;
}

.pond-video-live {
  position: absolute;
  right: 9px;
  top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(7, 70, 62, 0.9);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 23px;
}

.pond-video-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6fd8c8;
  box-shadow: 0 0 0 3px rgba(111, 216, 200, 0.2);
}

.pond-video-card.is-missing-thumb {
  min-height: 180px;
}

.pond-video-card.is-missing-thumb::before {
  content: "暂无最近截图";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 900;
}

.device-cell {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 7px 5px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(221, 247, 244, 0.28);
  color: #6c9792;
}

.device-cell.deployed {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
}

.device-cell.deployed.online {
  border-color: rgba(23, 163, 107, 0.55);
  background: rgba(242, 255, 251, 0.96);
  box-shadow: inset 0 0 0 1px rgba(23, 163, 107, 0.12);
}

.device-cell.video-cell {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #173d3a;
  border-color: rgba(255, 255, 255, 0.78);
}

.cell-stream {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.58));
  pointer-events: none;
}

.video-live {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 1;
  height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(19, 111, 99, 0.92);
  color: white;
  font-size: 9px;
  line-height: 18px;
  font-weight: 900;
}

.video-cell.is-missing-thumb::before {
  content: "暂无截图";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 900;
}

.device-cell.offline {
  opacity: 0.62;
  border-color: rgba(120, 139, 135, 0.36);
  background: rgba(239, 245, 243, 0.92);
}

.device-cell.offline .cell-name,
.device-cell.offline .cell-reading,
.device-cell.offline .cell-reading-off,
.device-cell.offline .cell-status {
  color: #a8b5b2 !important;
}

.device-cell.offline .plug-icon {
  background: #aebbb8 !important;
}

.device-cell.offline .plug-icon::before,
.device-cell.offline .plug-icon::after {
  background: rgba(255, 255, 255, 0.82) !important;
}

.device-cell.power-lost {
  opacity: 0.62;
  border-color: rgba(120, 139, 135, 0.36);
  background: rgba(239, 245, 243, 0.92);
}

.device-cell.overcurrent-fault {
  border-color: rgba(210, 54, 43, 0.5);
  background: rgba(255, 244, 241, 0.96);
  opacity: 1;
}

.device-cell.stale {
  opacity: 1;
  border-color: rgba(180, 122, 12, 0.32);
  background: rgba(255, 250, 237, 0.94);
}

.device-cell.empty {
  border-color: rgba(183, 228, 221, 0.58);
}

.cell-online-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 2;
  height: 17px;
  min-width: 32px;
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(121, 140, 136, 0.14);
  color: #6f8480;
  font-size: 9px;
  line-height: 17px;
  font-weight: 900;
}

.device-cell.online .cell-online-badge {
  background: rgba(205, 243, 234, 0.96);
  color: #0f7d6f;
}

.device-cell.offline .cell-online-badge {
  background: rgba(226, 233, 231, 0.96);
  color: #71817e;
}

.device-cell.power-lost .cell-online-badge {
  min-width: 52px;
  background: rgba(226, 233, 231, 0.96);
  color: #71817e;
}

.device-cell.overcurrent-fault .cell-online-badge {
  min-width: 52px;
  background: rgba(255, 219, 214, 0.98);
  color: #b83228;
}

.device-cell.stale .cell-online-badge {
  background: rgba(255, 239, 202, 0.98);
  color: #a05f00;
}

.empty-plus {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(168, 216, 209, 0.65);
  font-size: 18px;
  line-height: 1;
}

.empty-text {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
}

.device-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.device-icon.oxygen::before,
.device-icon.oxygen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
}

.device-icon.oxygen::before {
  width: 8px;
  height: 8px;
  left: 9px;
  top: 13px;
}

.device-icon.oxygen::after {
  width: 10px;
  height: 10px;
  right: 7px;
  bottom: 8px;
  box-shadow: -2px -12px 0 -3px rgba(255, 255, 255, 0.9);
}

.device-icon.temp::before {
  content: "";
  width: 7px;
  height: 21px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 11px 0 4px white;
}

.device-icon.camera {
  color: white;
}

.camera-symbol {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.device-icon.switch {
  overflow: hidden;
}

.switch-toggle-icon {
  width: 58px;
  height: 30px;
  border-radius: 999px;
  display: block;
  overflow: visible;
  box-shadow: none;
}

.switch-toggle-on {
  background: #28b84a !important;
}

.switch-toggle-off {
  background: #d7d9db !important;
}

.toggle-knob,
.toggle-symbol {
  position: absolute;
  display: block;
}

.toggle-knob {
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(20, 45, 39, 0.14);
}

.switch-toggle-on .toggle-knob {
  right: 3px;
}

.switch-toggle-off .toggle-knob {
  left: 3px;
}

.toggle-symbol {
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-53%);
  color: #315246;
  font-size: 24px;
  line-height: 24px;
  font-weight: 1000;
  text-align: center;
}

.switch-toggle-on .toggle-symbol {
  left: 9px;
}

.switch-toggle-off .toggle-symbol {
  right: 8px;
  color: #333333;
  font-size: 25px;
}

.switch-offline-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(145deg, #7e8f8b, #5d6c69) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 4px 10px rgba(31, 54, 48, 0.18);
}

.switch-offline-icon svg {
  width: 30px;
  height: 30px;
  overflow: visible;
}

.offline-wave {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 5.2;
  stroke-linecap: round;
}

.offline-wave-sm {
  stroke-width: 5.6;
}

.offline-slash {
  fill: none;
  stroke: #ffe8e2;
  stroke-width: 6.2;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 0 rgba(93, 108, 105, 0.25));
}

.offline-dot {
  fill: rgba(255, 255, 255, 0.94);
}

.socket-mark,
.plug-mark,
.plug-prongs,
.plug-body,
.plug-cord {
  position: absolute;
  display: block;
}

.socket-mark {
  width: 24%;
  height: 36%;
  right: 21%;
  top: 32%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid #ffffff;
}

.socket-mark::before,
.socket-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 22%;
  border-radius: 999px;
  background: #ffffff;
  transform: translateX(-50%);
}

.socket-mark::before {
  top: 20%;
}

.socket-mark::after {
  bottom: 20%;
}

.plug-mark {
  width: 46%;
  height: 34%;
  left: 18%;
  top: 33%;
  transition: transform 0.22s ease;
}

.plug-prongs {
  width: 17%;
  height: 50%;
  right: 0;
  top: 25%;
  border-radius: 2px;
  border-top: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.plug-body {
  width: 58%;
  height: 70%;
  right: 12%;
  top: 15%;
  border-radius: 4px;
  background: #ffffff;
}

.plug-cord {
  width: 32%;
  height: 3px;
  left: 0;
  top: calc(50% - 1px);
  border-radius: 999px;
  background: #ffffff;
}

.plug-on .plug-mark {
  transform: translateX(8%);
}

.plug-off {
  background: #8aa09b !important;
}

.plug-unknown {
  background: #6f7f7c !important;
}

.plug-power-lost {
  background: #8b5d5d !important;
}

.plug-off .socket-mark {
  opacity: 0.75;
}

.plug-unknown .socket-mark {
  opacity: 0.42;
}

.plug-power-lost .socket-mark {
  opacity: 0.38;
}

.plug-off .plug-mark {
  transform: translateX(-16%) rotate(-18deg);
}

.plug-unknown .plug-mark {
  opacity: 0.72;
  transform: translateX(-18%) rotate(-22deg);
}

.plug-power-lost .plug-mark {
  opacity: 0.55;
  transform: translateX(-20%) rotate(-24deg);
}

.plug-unknown::after,
.plug-power-lost::after {
  position: absolute;
  right: 9%;
  top: 7%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #5e6c69;
  font-size: 13px;
  font-weight: 1000;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(94, 108, 105, 0.28);
}

.plug-unknown::after {
  content: "?";
}

.plug-power-lost::after {
  content: "!";
  color: #8b3f3f;
  box-shadow: 0 0 0 2px rgba(139, 63, 63, 0.28);
}

.detail-icon .plug-off {
  background: #6c817d !important;
}

.detail-icon .plug-unknown {
  background: #5e6c69 !important;
}

.detail-icon .plug-power-lost {
  background: #7a5151 !important;
}

.cell-name,
.cell-reading,
.cell-status {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-name {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 800;
  color: #7f918d;
}

.cell-reading {
  font-size: 18px;
  line-height: 22px;
  font-weight: 900;
}

.cell-reading-unknown {
  color: #879894;
}

.cell-reading-off {
  color: #c0392b;
}

.cell-reading-fault {
  color: #c0392b;
}

.cell-status {
  color: #52706c;
  font-size: 9.5px;
  line-height: 13px;
  font-weight: 700;
}

.cell-status.alarm {
  color: #b83228;
}

.cell-status.power-lost-label {
  max-width: calc(100% - 8px);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 219, 214, 0.95);
  color: #b83228;
  font-size: 9px;
  font-weight: 900;
}

.cell-status.stale-label {
  max-width: calc(100% - 8px);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 239, 202, 0.95);
  color: #a05f00;
  font-size: 9px;
  font-weight: 900;
}

.demo-page {
  padding-bottom: 16px;
}

#logTab {
  background: #fff9e8;
}

#logTab .demo-hero {
  min-height: 0;
  padding-bottom: 16px;
  background: #fff0bf;
}

#logTab .demo-card {
  border-color: #eadfb9;
}

.demo-hero {
  min-height: 176px;
  padding: max(28px, env(safe-area-inset-top)) calc(var(--page-gutter) + 8px) 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: #ddf4ee;
}

.demo-hero h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.25;
}

.demo-hero p {
  max-width: 250px;
  margin: 10px 0 0;
  color: #65817c;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 700;
}

.alarm-hero {
  background: #fff0e9;
}

.alarm-call-page {
  background: #fff8f3;
}

.alarm-call-hero {
  min-height: 0;
  padding-bottom: 18px;
  background: linear-gradient(145deg, #fff0df, #ffe7dc);
}

.alarm-call-overview {
  margin: 14px var(--page-gutter) 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.alarm-call-overview > div {
  min-width: 0;
  padding: 13px 6px 11px;
  border: 1px solid #efd9cb;
  border-radius: 10px;
  background: #ffffff;
  text-align: center;
}

.alarm-call-overview strong,
.alarm-call-overview span {
  display: block;
}

.alarm-call-overview strong {
  color: #9d4c2f;
  font-size: 23px;
  line-height: 1.1;
}

.alarm-call-overview span {
  margin-top: 5px;
  color: #89736b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.alarm-call-card {
  border-color: #efd9cb;
}

.alarm-call-card .demo-card-title p {
  margin: 5px 0 0;
  color: #89736b;
  font-size: 12px;
  font-weight: 700;
}

.alarm-call-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.alarm-call-job {
  overflow: hidden;
  border: 1px solid #eaded7;
  border-radius: 12px;
  background: #fffdfb;
  box-shadow: 0 5px 16px rgba(119, 65, 43, 0.06);
}

.alarm-call-job-head {
  padding: 14px 14px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alarm-call-job-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.alarm-call-job-head time {
  color: #8b7770;
  font-size: 11px;
  font-weight: 700;
}

.alarm-call-job-head strong {
  color: #4e2f25;
  font-size: 17px;
  font-weight: 900;
}

.alarm-call-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff0c7;
  color: #9a6313;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.alarm-call-status.completed,
.alarm-call-status.play_finished,
.alarm-call-status.sms_success,
.alarm-call-status.fallback_sms_success {
  background: #dff3e7;
  color: #13734e;
}

.alarm-call-status.failed,
.alarm-call-status.cancelled,
.alarm-call-status.sms_failed,
.alarm-call-status.fallback_sms_failed {
  background: #ffe1dd;
  color: #b33b31;
}

.alarm-call-message {
  margin: 0;
  padding: 0 14px 12px;
  color: #5f514c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
}

.alarm-call-message-text {
  margin: 0;
}

.alarm-call-summary-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid #e7d9d1;
  border-spacing: 0;
  border-collapse: separate;
  border-radius: 9px;
  background: #fffaf7;
  table-layout: fixed;
}

.alarm-call-summary-table > tbody > tr > th,
.alarm-call-summary-table > tbody > tr > td {
  border-bottom: 1px solid #eee2dc;
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.alarm-call-summary-table > tbody > tr:last-child > th,
.alarm-call-summary-table > tbody > tr:last-child > td {
  border-bottom: 0;
}

.alarm-call-summary-table > tbody > tr > th {
  width: 74px;
  background: #f8f0eb;
  color: #886b5d;
  font-size: 11px;
  white-space: nowrap;
}

.alarm-call-summary-table > tbody > tr > td {
  color: #4e3c35;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.alarm-call-summary-type {
  color: #bd493d;
  font-weight: 900;
}

.alarm-call-device-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.alarm-call-device-table th,
.alarm-call-device-table td {
  border-bottom: 1px dashed #eadbd3;
  padding: 4px 5px;
  text-align: left;
  line-height: 1.4;
}

.alarm-call-device-table thead th {
  color: #9a8073;
  font-size: 10px;
  font-weight: 800;
}

.alarm-call-device-table th:first-child,
.alarm-call-device-table td:first-child {
  width: 84px;
}

.alarm-call-device-table tbody tr:last-child td {
  border-bottom: 0;
}

.alarm-call-id-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.alarm-call-id-list span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 6px;
  padding: 0 7px;
  background: #f2e8e2;
  color: #765b50;
  font-size: 10px;
  font-weight: 900;
}

.alarm-call-meta {
  padding: 0 14px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alarm-call-meta span {
  padding: 4px 7px;
  border-radius: 7px;
  background: #f5efeb;
  color: #806e66;
  font-size: 10px;
  font-weight: 800;
}

.alarm-call-toggle {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-top: 1px solid #eee2dc;
  background: #faf5f1;
  color: #8a4d37;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.alarm-call-toggle small {
  color: #9b8981;
  font-size: 10px;
  font-weight: 700;
}

.alarm-call-toggle b {
  margin-left: auto;
  font-size: 20px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.18s ease;
}

.alarm-call-job.is-open .alarm-call-toggle b {
  transform: rotate(90deg);
}

.alarm-call-detail[hidden] {
  display: none;
}

.alarm-call-timeline {
  padding: 10px 14px 14px 22px;
  border-top: 1px dashed #e6d5cb;
  background: #fffaf6;
}

.alarm-call-timeline-item {
  position: relative;
  padding: 7px 0 11px 16px;
  display: grid;
  gap: 5px;
  border-left: 2px solid #eaded7;
}

.alarm-call-timeline-item:last-child {
  padding-bottom: 3px;
}

.alarm-call-timeline-dot {
  position: absolute;
  top: 10px;
  left: -7px;
  width: 12px;
  height: 12px;
  border: 3px solid #fffaf6;
  border-radius: 50%;
  background: #9b8981;
}

.alarm-call-timeline-dot.ok {
  background: #19885f;
}

.alarm-call-timeline-dot.bad {
  background: #c9463b;
}

.alarm-call-timeline-item time {
  color: #95817a;
  font-size: 10px;
  font-weight: 700;
}

.alarm-call-timeline-item > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.alarm-call-timeline-item strong {
  color: #53372e;
  font-size: 12px;
}

.alarm-call-channel,
.alarm-call-result {
  padding: 2px 6px;
  border-radius: 999px;
  background: #eee8e4;
  color: #796a64;
  font-size: 9px;
  font-weight: 800;
}

.alarm-call-result.ok {
  background: #dff3e7;
  color: #13734e;
}

.alarm-call-result.bad {
  background: #ffe1dd;
  color: #b33b31;
}

.alarm-call-timeline-item p {
  width: 100%;
  margin: 0;
  color: #7d6d66;
  font-size: 11px;
  line-height: 1.55;
}

.alarm-call-empty-detail {
  padding: 18px;
  color: #8b7770;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 380px) {
  .alarm-call-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mine-hero {
  min-height: 0;
  padding-bottom: 16px;
  background: #e8f4ff;
}

.demo-card,
.profile-card {
  margin: 14px var(--page-gutter) 0;
  padding: 18px;
  border: 1px solid #dbe9e5;
  border-radius: 8px;
  background: #ffffff;
}

.demo-card.compact {
  padding-bottom: 16px;
}

.demo-card h2,
.demo-card-title h2 {
  margin: 0;
  color: #143b38;
  font-size: 19px;
  line-height: 1.3;
}

.demo-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.demo-card-title span {
  color: #78918c;
  font-size: 12px;
  font-weight: 900;
}

.log-list {
  display: grid;
  gap: 12px;
}

.log-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px var(--page-gutter) 0;
}

.log-overview button {
  min-width: 0;
  padding: 12px 4px 10px;
  border: 1px solid #d8e9e5;
  border-radius: 10px;
  background: #fff;
  color: #176f63;
  font: inherit;
  text-align: center;
}

.log-overview strong,
.log-overview span {
  display: block;
}

.log-overview strong {
  margin-bottom: 4px;
  font-size: 22px;
  line-height: 1;
}

.log-overview span {
  overflow: hidden;
  color: #718b86;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.log-refresh {
  padding: 5px 11px;
  border: 1px solid #bcd9d3;
  border-radius: 999px;
  background: #edf8f5;
  color: #147667;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.log-refresh:disabled {
  opacity: 0.55;
}

.log-filters {
  display: flex;
  gap: 7px;
  margin: -2px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.log-filters::-webkit-scrollbar {
  display: none;
}

.log-filters button {
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 1px solid #d5e6e2;
  border-radius: 999px;
  background: #f7fbfa;
  color: #65817c;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.log-filters button.active {
  border-color: #187c6e;
  background: #187c6e;
  color: #fff;
}

.log-device-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: #52736e;
  font-size: 12px;
  font-weight: 900;
}

.log-device-filter select {
  display: block;
}

.log-device-filter select:disabled {
  color: #8ba09c;
  background: #f2f7f5;
  opacity: 0.7;
}

.log-status {
  margin: 0 0 12px;
  color: #78918c;
  font-size: 12px;
  font-weight: 800;
}

.log-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 8px;
  background: #f5faf8;
  border-left: 4px solid #9bb3ae;
}

.log-item.success {
  border-left-color: #17a36b;
}

.log-item.warning {
  border-left-color: #e0993e;
}

.log-item time {
  color: #78918c;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.log-item time span {
  display: block;
  color: #9aacaa;
  font-size: 10px;
}

.log-item strong {
  display: block;
  color: #143b38;
  font-size: 14px;
  line-height: 1.3;
}

.log-item p {
  margin: 5px 0 0;
  color: #65817c;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.log-item-tag {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e4f3ef;
  color: #29766b;
  font-size: 10px;
  font-weight: 900;
}

.log-item.warning .log-item-tag {
  background: #fff0d9;
  color: #a96618;
}

.log-empty {
  padding: 34px 16px;
  border: 1px dashed #c9ddd9;
  border-radius: 10px;
  background: #f8fcfb;
  text-align: center;
}

.log-empty strong {
  color: #315e58;
  font-size: 15px;
}

.log-empty p {
  margin: 7px 0 0;
  color: #78918c;
  font-size: 12px;
  line-height: 1.5;
}

.stat-grid,
.alarm-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.stat-grid div,
.alarm-summary-card {
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 8px;
  background: #eef8f5;
  color: #136f63;
  text-align: center;
}

.stat-grid strong,
.alarm-summary-card strong {
  font-size: 24px;
  line-height: 1;
}

.stat-grid span,
.alarm-summary-card span {
  color: #65817c;
  font-size: 12px;
  font-weight: 900;
}

.alarm-summary-card.ok {
  background: #f1faf6;
}

.empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.empty-icon {
  position: relative;
  width: 66px;
  height: 66px;
  display: block;
  border-radius: 50%;
  background: #ddf4ee;
}

.empty-icon::before {
  content: "!";
  position: absolute;
  inset: 13px;
  display: grid;
  place-items: center;
  border: 3px solid #136f63;
  border-radius: 50%;
  color: #136f63;
  font-size: 25px;
  font-weight: 900;
}

.empty-state strong {
  color: #143b38;
  font-size: 18px;
}

.empty-state p {
  max-width: 280px;
  margin: 0;
  color: #78918c;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-actions {
  display: grid;
  gap: 7px;
  flex: 0 0 auto;
}

.profile-action {
  min-width: 78px;
  min-height: 36px;
  border: 1px solid #d4e4e0;
  border-radius: 8px;
  padding: 0 12px;
  background: #f1f6f4;
  color: #526b67;
  font-size: 13px;
  font-weight: 900;
}

.profile-action.primary {
  border-color: #136f63;
  background: #136f63;
  color: #ffffff;
}

.account-settings-card .demo-card-title {
  margin-bottom: 12px;
}

.account-setting-list {
  overflow: hidden;
  border: 1px solid #dbe9e5;
  border-radius: 10px;
  background: #f8fbfa;
}

.account-setting-row {
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #173d3a;
  text-align: left;
  background: transparent;
}

.account-setting-row + .account-setting-row {
  border-top: 1px solid #dbe9e5;
}

.account-setting-row:active {
  background: #edf7f4;
}

.account-setting-icon {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #dff3ee;
  color: #137a69;
}

.account-setting-lock::before {
  content: "";
  width: 14px;
  height: 12px;
  margin-top: 6px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.account-setting-lock::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.account-setting-phone::before {
  content: "☎";
  font-size: 23px;
  line-height: 1;
}

.account-setting-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  flex: 1;
}

.account-setting-copy strong {
  color: #173d3a;
  font-size: 15px;
  font-weight: 900;
}

.account-setting-copy small {
  color: #78918c;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-setting-arrow {
  color: #7e9792;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #136f63;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

.profile-card strong {
  color: #143b38;
  font-size: 18px;
}

.profile-card p {
  margin: 5px 0 0;
  color: #78918c;
  font-size: 13px;
  font-weight: 800;
}

.user-admin-card {
  display: grid;
  gap: 12px;
}

.user-admin-card[hidden] {
  display: none;
}

.user-admin-card .demo-card-title {
  align-items: center;
}

.user-admin-card .demo-card-title p {
  margin: 4px 0 0;
  color: #78918c;
  font-size: 12px;
  font-weight: 700;
}

.user-admin-status {
  min-height: 18px;
  margin: 0;
  color: #78918c;
  font-size: 12px;
  font-weight: 800;
}

.user-admin-list {
  display: grid;
  gap: 8px;
}

.user-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dbe9e6;
  border-radius: 8px;
  background: #f8fbfa;
}

.user-admin-row.is-disabled {
  opacity: 0.58;
}

.user-admin-row strong {
  overflow: hidden;
  color: #173d3a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-admin-row p {
  margin: 4px 0 0;
  color: #78918c;
  font-size: 11px;
  font-weight: 700;
}

.user-admin-edit {
  width: 52px;
  height: 34px;
  border-radius: 7px;
  background: #e6f4f1;
  color: #136f63;
  font-size: 12px;
  font-weight: 900;
}

.feature-intro {
  display: grid;
  gap: 12px;
}

.feature-lead {
  margin: -4px 0 0;
  color: #5f7671;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 800;
}

.feature-list {
  display: grid;
  gap: 10px;
}

.feature-list article {
  padding: 12px;
  border-radius: 8px;
  background: #f5faf8;
  border-left: 4px solid #64c8bd;
}

.feature-list strong {
  display: block;
  color: #143b38;
  font-size: 14px;
  line-height: 1.35;
}

.feature-list p {
  margin: 6px 0 0;
  color: #65817c;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 700;
}

.usage-guide {
  display: grid;
  gap: 12px;
}

.usage-guide-lead {
  margin: -4px 0 0;
  color: #5f7671;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 800;
}

.usage-guide-list {
  display: grid;
  gap: 9px;
}

.usage-guide-list details {
  overflow: hidden;
  border: 1px solid #cce4df;
  border-radius: 10px;
  background: #f5faf8;
}

.usage-guide-list summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #143b38;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.usage-guide-list summary::-webkit-details-marker {
  display: none;
}

.usage-guide-list summary::after {
  content: "＋";
  margin-left: auto;
  color: #268f82;
  font-size: 20px;
  line-height: 1;
}

.usage-guide-list details[open] summary {
  background: #e6f5f1;
  border-bottom: 1px solid #cce4df;
}

.usage-guide-list details[open] summary::after {
  content: "－";
}

.usage-guide-list summary span {
  min-width: 30px;
  color: #168071;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.usage-guide-content {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
  color: #58746f;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 700;
}

.usage-guide-content p,
.usage-guide-content ol,
.usage-guide-content ul {
  margin: 0;
}

.usage-guide-content ol,
.usage-guide-content ul {
  display: grid;
  gap: 4px;
  padding-left: 20px;
}

.usage-guide-content b {
  color: #214a45;
}

.usage-guide-warning {
  padding: 9px 10px;
  border: 1px solid #e8c96f;
  border-radius: 7px;
  background: #fff8dc;
  color: #80651d;
}

.setting-list {
  display: grid;
  gap: 8px;
}

.setting-list button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f5faf8;
  color: #143b38;
  text-align: left;
}

.setting-list span {
  color: #65817c;
  font-size: 13px;
  font-weight: 900;
}

.setting-list strong {
  color: #143b38;
  font-size: 13px;
  font-weight: 900;
}

.bottom-nav {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: 100%;
  height: calc(68px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  padding-top: 9px;
  padding-bottom: env(safe-area-inset-bottom);
  background: #ffffff;
  border-top: 1px solid #e7efec;
}

.bottom-nav button {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  background: transparent;
  color: #6b817c;
  font-size: 12px;
  font-weight: 700;
}

.bottom-nav button.active {
  color: #136f63;
  font-weight: 900;
}

.nav-icon {
  position: relative;
  width: 25px;
  height: 25px;
  display: block;
  color: currentColor;
}

.nav-pond {
  border-radius: 8px;
  background: rgba(39, 153, 165, 0.18);
  border: 2px solid currentColor;
  overflow: hidden;
}

.nav-pond::before,
.nav-pond::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.32;
}

.nav-pond::before {
  top: 8px;
}

.nav-pond::after {
  top: 15px;
}

.nav-device::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 6px;
  bottom: 4px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.nav-device::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 2px;
  height: 6px;
  border-radius: 4px 4px 0 0;
  background: currentColor;
}

.nav-alarm::before {
  content: "!";
  position: absolute;
  inset: 2px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}

.nav-user::before,
.nav-user::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid currentColor;
}

.nav-user::before {
  top: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.nav-user::after {
  bottom: 2px;
  width: 18px;
  height: 10px;
  border-radius: 12px 12px 4px 4px;
}

.detail-screen {
  padding-bottom: 28px;
}

.detail-hero {
  text-align: center;
  padding-bottom: 26px;
}

.detail-title-row {
  margin-top: 0;
}

.detail-status-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.status-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #a9dcd2;
  border-radius: 50%;
  background: #c9eee6;
  color: #17655c;
}

.status-refresh-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-refresh-button.is-disabled {
  opacity: 0.48;
}

.status-refresh-button.is-querying svg {
  animation: status-refresh-spin 0.8s linear infinite;
}

.status-refresh-button[hidden],
.control-panel[hidden] {
  display: none;
}

@keyframes status-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.back-button {
  width: 28px;
  height: 32px;
  background: transparent;
  color: #143b38;
  font-size: 34px;
  line-height: 26px;
}

.detail-heading {
  flex: 1;
  margin-left: 6px;
  text-align: left;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-name-row {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.detail-alias-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #a9dcd2;
  border-radius: 9px;
  background: #c9eee6;
  color: #17655c;
}

.detail-alias-edit svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-alias-edit[hidden] {
  display: none;
}

.detail-title-row h2 {
  margin: 0;
  font-size: 23px;
}

.detail-title-row .detail-device-id {
  display: inline-block;
  color: inherit;
  font-size: 21px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.alias-editor-card {
  gap: 14px;
}

.alias-editor-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6c817d;
  font-size: 12px;
}

.alias-editor-meta strong {
  color: #17655c;
  white-space: nowrap;
}

.alias-editor-meta strong.is-invalid {
  color: #c7372f;
}

.alias-editor-actions {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1fr;
  gap: 10px;
}

.alias-editor-actions button {
  min-height: 48px;
  border-radius: 12px;
  font-weight: 800;
}

.alias-editor-clear {
  border: 1px solid #d4e5e1;
  background: #f2f7f6;
  color: #647f7a;
}

.detail-icon {
  border: 0;
  padding: 0;
  width: 82px;
  height: 82px;
  margin: 22px auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 24px;
  font-weight: 900;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.detail-icon.is-clickable {
  cursor: pointer;
}

.detail-icon.is-switch {
  width: 224px;
  height: 90px;
  border-radius: 28px;
}

.detail-icon.is-clickable:active {
  transform: scale(0.96);
}

.detail-icon.is-disabled {
  cursor: default;
}

.detail-icon .device-icon {
  width: 82px;
  height: 82px;
  font-size: 24px;
}

.detail-icon .device-icon.detail-switch-icon {
  box-sizing: border-box;
  width: 212px;
  height: 82px;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 5px 12px rgba(25, 78, 68, 0.12);
}

.detail-switch-icon.detail-switch-on {
  border: 2px solid #28b84a;
  background: #2fc34f;
  color: #ffffff;
}

.detail-switch-icon.detail-switch-off {
  border: 2px solid #242424;
  background: #e3e5e6;
  color: #111111;
}

.detail-switch-icon.detail-switch-unknown {
  border: 2px solid #879491;
  background: #e7eceb;
  color: #667976;
}

.detail-switch-icon.detail-switch-fault {
  border: 3px solid #181400;
  background: linear-gradient(135deg, #ffdc32, #ffc400);
  color: #161200;
  box-shadow: 0 6px 18px rgba(126, 91, 0, 0.3);
}

.detail-switch-knob {
  position: absolute;
  top: 50%;
  width: 60px;
  height: 60px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(20, 45, 39, 0.14);
}

.detail-switch-on .detail-switch-knob {
  right: 10px;
}

.detail-switch-off .detail-switch-knob {
  left: 10px;
  background: #111111;
  box-shadow: none;
}

.detail-switch-unknown .detail-switch-knob {
  left: 10px;
}

.detail-switch-warning-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 66px;
  height: 60px;
  transform: translateY(-50%);
  overflow: visible;
}

.detail-switch-warning-icon path {
  fill: #111000;
}

.detail-switch-warning-icon rect,
.detail-switch-warning-icon circle {
  fill: #ffd21f;
}

.detail-switch-label {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  font-weight: 1000;
  letter-spacing: -1px;
  white-space: nowrap;
}

.detail-switch-on .detail-switch-label {
  left: 14px;
  right: 82px;
}

.detail-switch-off .detail-switch-label,
.detail-switch-unknown .detail-switch-label {
  left: 82px;
  right: 14px;
}

.detail-switch-fault .detail-switch-label {
  left: 78px;
  right: 10px;
  font-size: 25px;
  letter-spacing: 0;
  color: #161200;
  text-shadow: none;
}

.detail-icon .device-icon.oxygen::before {
  width: 16px;
  height: 16px;
  left: 24px;
  top: 30px;
}

.detail-icon .device-icon.oxygen::after {
  width: 19px;
  height: 19px;
  right: 24px;
  bottom: 22px;
  box-shadow: -9px -22px 0 -5px rgba(255, 255, 255, 0.9);
}

.main-reading {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
}

.main-reading[hidden] {
  display: none;
}

.detail-meta {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: wrap;
}

.detail-position {
  color: #64807b;
  font-size: 13px;
  font-weight: 700;
}

.panel {
  margin: 16px var(--page-gutter) 0;
  padding: 16px;
}

.video-panel {
  margin: 16px var(--page-gutter) 0;
  padding: 0;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(19, 111, 99, 0.18), rgba(110, 88, 217, 0.24)),
    #173d3a;
  border: 1px solid #d7e8e4;
}

.video-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-fullscreen-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 72px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(4, 32, 29, 0.78);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.video-fullscreen-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-fullscreen-button:active {
  transform: scale(0.96);
}

.video-frame:fullscreen,
.video-frame:-webkit-full-screen,
.video-frame.is-mobile-fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
  background: #000000;
}

.video-frame.is-mobile-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.video-frame:fullscreen img,
.video-frame:-webkit-full-screen img,
.video-frame.is-mobile-fullscreen img {
  object-fit: contain;
}

.video-frame:fullscreen .video-fullscreen-button,
.video-frame:-webkit-full-screen .video-fullscreen-button,
.video-frame.is-mobile-fullscreen .video-fullscreen-button {
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  min-width: 78px;
  height: 40px;
  background: rgba(18, 18, 18, 0.72);
}

body.video-fullscreen-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.video-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.video-actions p {
  margin: 0 2px;
  color: #6c817d;
  font-size: 12px;
  font-weight: 700;
}

.video-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.video-replay-button,
.video-refresh-button {
  min-width: 96px;
  height: 34px;
  border-radius: 8px;
  background: #e5f5f1;
  color: #17655c;
  font-size: 13px;
  font-weight: 900;
}

.video-replay-button {
  background: #fff1c5;
  color: #8a5a00;
  border: 1px solid #f0ce72;
}

.video-replay-button:disabled {
  opacity: 0.6;
}

.video-replay-button:active,
.video-refresh-button:active {
  transform: scale(0.98);
}

.video-replay-panel {
  background: #fffdf7;
}

.video-replay-panel .panel-title-row {
  align-items: flex-start;
}

.video-replay-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.video-replay-note,
.video-replay-status {
  margin: 5px 0 0;
  color: #6c817d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.video-replay-status {
  min-height: 18px;
  margin-top: 12px;
}

.video-replay-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #866012;
  background: #fff1c5;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.video-replay-close {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d8e7e3;
  border-radius: 999px;
  background: #ffffff;
  color: #54726c;
  font-size: 12px;
  font-weight: 900;
}

.video-replay-close:active {
  transform: scale(0.97);
}

.video-replay-player-wrap {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #d9e8e2;
  border-radius: 10px;
  background: #061b18;
}

.video-replay-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #061b18;
}

.video-replay-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.video-replay-item {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #d8e7e3;
  border-radius: 10px;
  background: #f4f9f7;
  color: #264b46;
  text-align: left;
}

.video-replay-item.is-active {
  border-color: #1d9d84;
  background: #e4f6ef;
  box-shadow: inset 3px 0 0 #1ca889;
}

.video-replay-item-date {
  color: #174a43;
  font-size: 13px;
  font-weight: 900;
}

.video-replay-item-meta,
.video-replay-item-completeness {
  color: #6c817d;
  font-size: 11px;
  font-weight: 700;
}

.video-replay-item-completeness.is-incomplete {
  color: #ad6d17;
}

.photo-wall-panel {
  background: #fbfefd;
}

.photo-wall-note {
  color: #6c817d;
  font-size: 12px;
  font-weight: 800;
}

.photo-wall-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.photo-wall-item {
  position: relative;
  min-width: 0;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #eef6f3;
  border: 1px solid #d7e8e4;
}

.photo-wall-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.photo-wall-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.photo-wall-button:disabled {
  cursor: default;
}

.photo-wall-item.is-loaded .photo-wall-button {
  cursor: zoom-in;
}

.photo-wall-button:focus-visible {
  outline: 2px solid #17a36b;
  outline-offset: -2px;
}

.photo-wall-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 3px;
  background: rgba(15, 50, 46, 0.68);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.photo-wall-missing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #78908b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.photo-wall-item.is-loaded img {
  opacity: 1;
}

.photo-wall-item.is-loaded .photo-wall-missing {
  display: none;
}

.photo-wall-item.is-missing figcaption {
  background: rgba(120, 144, 139, 0.18);
  color: #617773;
}

.photo-preview {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 28, 25, 0.88);
}

.photo-preview[hidden] {
  display: none;
}

.photo-preview img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  border-radius: 8px;
  object-fit: contain;
  background: #000000;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.photo-preview img[hidden] {
  display: none;
}

.photo-preview-missing {
  width: min(360px, 86vw);
  height: min(240px, 34vh);
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #071c19;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.photo-preview-missing[hidden] {
  display: none;
}

.photo-preview-close {
  position: fixed;
  right: 18px;
  top: max(18px, env(safe-area-inset-top));
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #173d3a;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.photo-preview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(360px, 100%);
  margin-top: 14px;
}

.photo-preview-nav {
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #173d3a;
  font-size: 13px;
  font-weight: 900;
}

.photo-preview-play {
  background: #c9eee6;
  color: #17655c;
}

.photo-preview-nav:active {
  transform: scale(0.98);
}

.photo-preview-caption {
  margin-top: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

body.photo-preview-open {
  overflow: hidden;
}

.qr-scanner {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(7, 28, 25, 0.88);
}

.qr-scanner[hidden] {
  display: none;
}

.qr-scanner-card {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 12px;
  background: #fbfefd;
  padding: 12px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.36);
}

.qr-scanner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #173d3a;
}

.qr-scanner-head strong {
  font-size: 18px;
}

.qr-scanner-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef6f3;
  color: #173d3a;
  font-size: 24px;
  line-height: 1;
}

.qr-video-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #102724;
}

#qrScannerVideo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 56vh;
  object-fit: cover;
}

.qr-scanner-frame {
  position: absolute;
  left: 50%;
  top: 43%;
  width: min(62vw, 230px);
  aspect-ratio: 1;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.22);
}

#qrScannerStatus {
  margin: 9px 2px 0;
  color: #5f7671;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.qr-manual-button {
  width: 100%;
  height: 40px;
  margin-top: 9px;
  border-radius: 8px;
  background: #17655c;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.qr-manual-button[hidden] {
  display: none;
}

.qr-manual-button:active {
  transform: scale(0.98);
}

.qr-manual-panel {
  margin-top: 9px;
}

.qr-manual-panel[hidden] {
  display: none;
}

.qr-manual-panel label {
  display: block;
  margin: 0 2px 6px;
  color: #173d3a;
  font-size: 13px;
  font-weight: 900;
}

.qr-digit-entry {
  position: relative;
}

.qr-manual-panel input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  opacity: 0.02;
  outline: none;
}

.qr-digit-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 14px repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.qr-digit-separator {
  height: 40px;
  display: grid;
  place-items: center;
  color: #52736d;
  font-size: 22px;
  line-height: 1;
  font-style: normal;
  font-weight: 900;
}

.qr-digit-slots span {
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #c9ded9;
  border-radius: 8px;
  background: #ffffff;
  color: #173d3a;
  font-size: 18px;
  font-weight: 900;
}

.qr-digit-slots span.is-filled {
  border-color: #8ecfc4;
  background: #eefbf8;
}

.qr-digit-slots span.is-active {
  border-color: #17a36b;
  box-shadow: 0 0 0 3px rgba(23, 163, 107, 0.14);
}

.qr-manual-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 10px;
  margin-top: 10px;
}

.qr-manual-confirm,
.qr-manual-cancel {
  height: 38px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.qr-manual-confirm {
  background: #17655c;
  color: #ffffff;
}

.qr-manual-cancel {
  background: #eef6f3;
  color: #17655c;
}

.qr-scanner.is-manual-only .qr-video-wrap,
.qr-scanner.is-manual-only .qr-scanner-frame,
.qr-scanner.is-manual-only #qrScannerStatus,
.qr-scanner.is-manual-only .qr-manual-button {
  display: none;
}

.qr-scanner.is-manual-only .qr-manual-panel {
  margin-top: 2px;
}

@media (max-height: 700px) {
  .qr-scanner {
    align-items: flex-start;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .qr-scanner-card {
    max-height: calc(100vh - 16px);
    padding: 10px;
  }

  .qr-scanner-head {
    margin-bottom: 8px;
  }

  .qr-scanner-head strong {
    font-size: 16px;
  }

  .qr-scanner-close {
    width: 30px;
    height: 30px;
    font-size: 22px;
  }

  #qrScannerVideo {
    aspect-ratio: 1 / 1;
    max-height: 48vh;
  }

  .qr-scanner-frame {
    top: 40%;
    width: min(54vw, 190px);
    border-width: 2px;
    transform: translate(-50%, -50%);
  }

  #qrScannerStatus {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.35;
  }

  .qr-manual-button {
    height: 38px;
    margin-top: 7px;
    font-size: 14px;
  }
}

.delete-confirm {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 45, 42, 0.48);
}

.delete-confirm[hidden] {
  display: none;
}

.delete-confirm-card {
  width: min(340px, 100%);
  border-radius: 12px;
  padding: 20px;
  background: #fbfefd;
  box-shadow: 0 20px 48px rgba(16, 45, 42, 0.22);
}

.delete-confirm-card strong {
  display: block;
  color: #173d3a;
  font-size: 19px;
  font-weight: 900;
}

.delete-confirm-card p {
  margin: 12px 0 18px;
  color: #64807b;
  font-size: 14px;
  line-height: 1.6;
}

.delete-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.delete-confirm-cancel,
.delete-confirm-ok {
  height: 42px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.delete-confirm-cancel {
  background: #edf4f2;
  color: #52706c;
}

.delete-confirm-ok {
  background: #b83228;
  color: white;
}

.auth-dialog-card {
  max-height: min(680px, calc(100dvh - 32px));
  overflow-y: auto;
}

.auth-dialog .delete-confirm-ok {
  background: #136f63;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: #526b67;
  font-size: 13px;
  font-weight: 900;
}

.auth-field input,
.auth-field select {
  width: 100%;
  height: 42px;
  border: 1px solid #cedfdb;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #173d3a;
  font-size: 14px;
  outline: none;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: #136f63;
  box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.12);
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  padding-right: 58px;
}

.password-input-wrap button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 48px;
  height: 34px;
  border-radius: 6px;
  background: #edf4f2;
  color: #526b67;
  font-size: 12px;
  font-weight: 900;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
  color: #526b67;
  cursor: pointer;
}

.auth-remember input {
  width: 19px;
  height: 19px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #136f63;
}

.auth-remember span {
  display: grid;
  gap: 2px;
}

.auth-remember strong {
  color: #294f49;
  font-size: 13px;
  font-weight: 900;
}

.auth-remember small {
  color: #7a918d;
  font-size: 11px;
  line-height: 1.35;
}

.auth-message {
  min-height: 20px;
  margin: 8px 0 12px !important;
  color: #b83228 !important;
  font-size: 12px !important;
  font-weight: 800;
}

@media (max-width: 360px) {
  .profile-card {
    gap: 10px;
  }

  .avatar {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .profile-action {
    min-width: 66px;
    padding: 0 9px;
  }
}

.panel h3 {
  color: #173d3a;
  font-size: 18px;
}

.panel p {
  margin-top: 12px;
  color: #6c817d;
  font-size: 13px;
}

.mqtt-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2f1;
  color: #70827f;
  font-size: 12px;
  font-weight: 900;
}

.mqtt-status.is-ready {
  background: #d7f2eb;
  color: #17655c;
}

.device-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.device-status-row .mqtt-status,
.device-status-row .device-online-status {
  box-sizing: border-box;
  height: 28px;
  min-height: 0;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.toggle.is-unknown {
  background: #eef2f1;
}

.toggle.is-unknown span {
  transform: translateX(14px);
}

.device-online-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2f1;
  color: #70827f;
  font-size: 12px;
  font-weight: 900;
}

.device-online-status.is-checking {
  background: #e8f0ff;
  color: #2477e8;
}

.device-online-status.is-online {
  background: #d7f2eb;
  color: #17655c;
}

.device-online-status.is-offline {
  background: #ffe8e3;
  color: #b83228;
}

.device-online-status.is-stale {
  background: #fff1cf;
  color: #9a5b00;
}

.current-panel {
  background: #fbfefd;
}

.overcurrent-panel {
  background: #fbfefd;
}

.overcurrent-alert-message {
  box-sizing: border-box;
  margin-top: 14px !important;
  border: 1px solid #ef9a51;
  border-left: 6px solid #d63429;
  border-radius: 10px;
  padding: 13px 14px;
  background: #fff2df;
  color: #b42318 !important;
  font-size: 17px !important;
  line-height: 1.4;
  font-weight: 1000 !important;
}

.overcurrent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.overcurrent-actions label {
  display: grid;
  gap: 6px;
  color: #6d817d;
  font-size: 13px;
  font-weight: 800;
}

.overcurrent-actions input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(176, 220, 213, 0.9);
  border-radius: 8px;
  padding: 0 12px;
  color: #0d403b;
  font-size: 18px;
  font-weight: 900;
}

.overcurrent-actions .soft-action,
.overcurrent-actions .plain-action {
  width: 100%;
  height: 46px;
}

.overcurrent-actions .plain-action {
  grid-column: 1 / -1;
}

.overcurrent-actions .overcurrent-ack-alert {
  min-height: 52px;
  border: 2px solid #c82e25;
  background: linear-gradient(135deg, #e54538, #bd211b);
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(190, 36, 29, 0.24);
  animation: overcurrent-ack-pulse 1.15s ease-in-out infinite;
}

@keyframes overcurrent-ack-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 5px 14px rgba(190, 36, 29, 0.2);
  }

  50% {
    transform: scale(1.025);
    box-shadow: 0 8px 22px rgba(190, 36, 29, 0.48);
  }
}

@media (prefers-reduced-motion: reduce) {
  .overcurrent-actions .overcurrent-ack-alert {
    animation: none;
  }
}

.overcurrent-status {
  min-height: 18px;
  margin-top: 10px;
  color: #0f766b;
  font-size: 13px;
  font-weight: 800;
}

.schedule-panel {
  display: grid;
  gap: 16px;
}

.schedule-panel[hidden] {
  display: none;
}

.schedule-note {
  margin: 4px 0 0;
  color: #6f8985;
  font-size: 13px;
}

.schedule-master,
.schedule-slot-enable {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #176f64;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-master input,
.schedule-slot-enable input {
  width: 20px;
  height: 20px;
  accent-color: #168c79;
}

.schedule-slots {
  display: grid;
  gap: 10px;
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6f8985;
  font-size: 13px;
}

.schedule-panel > *,
.schedule-toolbar > span {
  min-width: 0;
}

.schedule-toolbar > span {
  flex: 1 1 auto;
}

.schedule-toolbar button {
  flex: 0 0 auto;
  width: auto;
  min-width: 112px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: #dff3ef;
  color: #147668;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.schedule-toolbar button:disabled {
  opacity: 0.4;
}

.schedule-slot {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 92px 36px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #cce2de;
  border-radius: 14px;
  background: #f5fbf9;
}

.schedule-slot > * {
  min-width: 0;
}

.schedule-slot label:not(.schedule-slot-enable) {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: #6f8985;
  font-size: 12px;
}

.schedule-slot input[type="time"],
.schedule-slot select {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #bcd9d4;
  border-radius: 10px;
  background: #fff;
  color: #123f3b;
  font: inherit;
}

.schedule-slot input[type="time"] {
  padding-right: 0;
  padding-left: 0;
  text-align: center;
}

.schedule-slot input[type="time"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: center;
}

.schedule-slot select.schedule-action-on {
  border-color: #9fd8c3;
  background-color: #e4f7ef;
  color: #12705a;
}

.schedule-slot select.schedule-action-off {
  border-color: #e8b8b3;
  background-color: #fcebea;
  color: #a53d35;
}

.schedule-delete {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f3e8e6;
  color: #b54d40;
  font-size: 22px;
}

.schedule-empty {
  padding: 26px 14px;
  border: 1px dashed #bdd9d4;
  border-radius: 14px;
  color: #78918c;
  text-align: center;
  font-size: 13px;
}

.schedule-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.schedule-actions button {
  min-height: 48px;
}

.schedule-status {
  margin: 0;
  color: #6f8985;
  font-size: 13px;
}

.schedule-events {
  display: grid;
  gap: 6px;
}

.schedule-event {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #eef7f5;
  color: #6f8985;
  font-size: 12px;
}

@media (max-width: 420px) {
  .schedule-slot {
    grid-template-columns: 40px minmax(0, 1fr) 88px 32px;
    gap: 7px;
    padding: 10px 8px;
  }

  .schedule-delete {
    width: 32px;
    height: 32px;
  }
}

.current-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: #c9eee6;
  color: #17655c;
  font-size: 12px;
  font-weight: 900;
}

.current-badge.is-on {
  background: #c9eee6;
  color: #17655c;
}

.current-badge.is-off {
  background: #edf4f2;
  color: #64807b;
}

.current-badge.is-unknown {
  background: #fff0d8;
  color: #9a5d14;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.phase-card {
  min-width: 0;
  border-radius: 8px;
  padding: 12px 8px;
  background: #eef8f5;
  border: 1px solid #d5ebe6;
  text-align: center;
}

.phase-card span,
.phase-card strong {
  display: block;
}

.phase-card span {
  color: #64807b;
  font-size: 12px;
  font-weight: 800;
}

.phase-card strong {
  margin-top: 6px;
  color: #123d3a;
  font-size: 20px;
  line-height: 1.2;
}

.realtime-current-chart {
  margin-top: 16px;
  border-radius: 8px;
  padding: 10px;
  background: #f7fbfa;
  border: 1px solid #dcebe7;
}

.chart-title-row,
.curve-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title-row {
  color: #173d3a;
  font-size: 13px;
  font-weight: 900;
}

.chart-time {
  color: #78918c;
  font-size: 11px;
  font-weight: 700;
}

#currentCurve {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.curve-bg {
  fill: #ffffff;
}

.curve-grid-line {
  stroke: #e4efec;
  stroke-width: 1;
}

.curve-axis {
  stroke: #cfe2dd;
  stroke-width: 1;
}

.curve-line {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.curve-value-label {
  font-size: 10px;
  font-weight: 800;
}

.curve-legend {
  justify-content: flex-start;
  gap: 14px;
  margin-top: 6px;
  color: #64807b;
  font-size: 11px;
  font-weight: 800;
}

.curve-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.curve-legend span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.curve-legend .phase-a::before {
  background: #17a36b;
}

.curve-legend .phase-b::before {
  background: #2477e8;
}

.curve-legend .phase-c::before {
  background: #ef7b45;
}

.toggle {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  padding: 4px;
  background: #d9e5e1;
}

.toggle span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.toggle.is-on {
  background: #136f63;
}

.toggle.is-on span {
  transform: translateX(22px);
}

.toggle:disabled,
.toggle.is-disabled,
.soft-action:disabled,
.soft-action.is-disabled,
.plain-action:disabled,
.plain-action.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.toggle:disabled,
.toggle.is-disabled {
  background: #cfd8d5;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.soft-action,
.plain-action {
  height: 34px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.soft-action {
  background: #eaf6f3;
  color: #136f63;
}

.plain-action {
  background: #f3f6f5;
  color: #526b67;
}

.chart {
  height: 92px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 18px;
  margin: 18px 4px 0;
  padding-top: 8px;
  background:
    linear-gradient(#e8f0ed 1px, transparent 1px) 0 24px / 100% 38px no-repeat,
    linear-gradient(#e8f0ed 1px, transparent 1px) 0 62px / 100% 38px no-repeat;
}

.chart span {
  display: block;
  border-radius: 5px;
  background: #8fc8f7;
}

.chart .current {
  background: #2477e8;
}

.info-panel dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.info-panel dl > div {
  min-width: 0;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid #deece8;
  border-radius: 10px;
  background: #f5faf8;
}

.info-panel dt,
.info-panel dd {
  display: block;
  margin: 0;
}

.info-panel dt {
  color: #78918c;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
}

.info-panel dd {
  max-width: 100%;
  color: #173d3a;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.info-panel .mqtt-status,
.info-panel .device-online-status {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.info-panel .device-online-status {
  flex-wrap: wrap;
  align-items: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-panel [hidden] {
  display: none;
}

.info-panel dl > .device-location-info {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.device-location-info dd {
  color: #0f675e;
  font-size: clamp(16px, 3.8vw, 20px);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.device-location-info small {
  color: #718985;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 360px) {
  .info-panel dl {
    grid-template-columns: 1fr;
  }
}

.bottom-cta {
  width: calc(100% - (var(--page-gutter) * 2));
  height: 48px;
  margin: 28px var(--page-gutter) 0;
  border-radius: 8px;
  background: #136f63;
  color: white;
  font-size: 15px;
  font-weight: 900;
}

.bottom-cta.danger {
  background: #b83228;
}

.bottom-cta.device-log-cta {
  border: 1px solid #92c9c1;
  background: #eaf7f4;
  color: #136f63;
}

.bottom-cta.device-log-cta + .bottom-cta {
  margin-top: 12px;
}

@media (min-width: 520px) {
  .app-shell {
    width: 430px;
  }

  .app-shell {
    height: 844px;
    border-radius: 34px;
    box-shadow: 0 24px 80px rgba(20, 56, 52, 0.2);
  }

  .screen {
    height: 844px;
  }
}
#userAdminCard {
  display: none !important;
}
