:root {
  color: #1c1917;
  background: #f4f1ec;
  font-family: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 20px 24px 8px;
}

h1, h2, p { margin: 0; }

h1 { font-size: 28px; letter-spacing: -0.03em; }

.kicker {
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.connection {
  font-size: 14px;
  color: #57534e;
}

main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 8px 16px 16px;
}

.panel, .stage-wrap {
  background: #fffdf9;
  border: 1px solid #e7e0d6;
  border-radius: 16px;
}

.panel { padding: 16px; }

.panel-head {
  display: flex;
  align-items: center;
}

.panel-head { justify-content: space-between; margin-bottom: 12px; }

button {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  background: #9a3412;
  color: white;
  padding: 8px 14px;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: wait; }

.devices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.devices button {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  background: #f5f0ea;
  color: #1c1917;
}

.devices button.active {
  background: #9a3412;
  color: white;
}

.devices button.active small {
  color: #fed7aa;
}

.devices button small {
  display: block;
  color: #78716c;
  margin-top: 2px;
}

.devices .empty {
  color: #78716c;
  font-size: 14px;
  padding: 8px 0;
}

.panel, .stage-wrap {
  height: 100%;
  min-height: 0;
}

.stage-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status {
  padding: 12px 16px;
  border-bottom: 1px solid #e7e0d6;
  font-size: 14px;
}

.status.error { color: #9f1239; background: #fff1f2; }

.stage {
  flex: 1;
  min-height: 0;
  width: 100% !important;
  height: 100% !important;
  background: #111;
}

.stage video,
.stage canvas {
  object-fit: contain !important;
}

.stage [id^="imou_player_icon_"]:not([id*="fullScreen"]):not([id*="icon_root"]) {
  display: none !important;
}

.status:not(.error):empty,
.status.playing {
  display: none;
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  header { align-items: start; flex-direction: column; }
  .panel, .stage-wrap { height: auto; }
  .stage { height: 56vw !important; min-height: 240px; }
}
