:root {
  color-scheme: dark;
  --green: #0f8a5f;
  --green-soft: #2be078;
  --red: #ff4141;
  --gold: #d9a229;
  --bg: #020403;
  --panel: rgba(13, 17, 15, 0.76);
  --panel-strong: rgba(19, 23, 21, 0.88);
  --line: rgba(255, 255, 255, 0.13);
  --line-green: rgba(43, 224, 120, 0.24);
  --text: #f6faf7;
  --muted: rgba(246, 250, 247, 0.64);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(15, 138, 95, 0.22), transparent 34rem),
    radial-gradient(circle at 90% 24%, rgba(43, 224, 120, 0.08), transparent 24rem),
    linear-gradient(145deg, #000 0%, #06100c 45%, #000 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  color: inherit;
  font: inherit;
}

.app-shell {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) clamp(16px, 4vw, 32px) max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-icon {
  display: grid;
  width: clamp(66px, 14vw, 92px);
  height: clamp(66px, 14vw, 92px);
  place-items: center;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 18px rgba(43, 224, 120, 0.28));
}

.brand-lockup strong {
  display: block;
  color: #7df0a6;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 0.95;
  white-space: nowrap;
}

.brand-lockup small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(1.05rem, 3.5vw, 1.55rem);
  font-weight: 700;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 13px 22px;
  border: 1px solid rgba(43, 224, 120, 0.18);
  border-radius: 999px;
  background: rgba(43, 224, 120, 0.09);
  color: var(--green-soft);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.online-pill span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 7px rgba(43, 224, 120, 0.1);
}

.online-pill strong {
  font-size: clamp(1rem, 3.2vw, 1.45rem);
}

.online-pill.is-offline {
  border-color: rgba(255, 65, 65, 0.24);
  background: rgba(255, 65, 65, 0.08);
  color: var(--red);
}

.panel {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 32%),
    var(--panel);
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 18px 22px;
}

.panel-title h2 {
  margin: 0;
  color: #5ee785;
  font-size: clamp(1rem, 3.8vw, 1.45rem);
  line-height: 1.1;
  text-transform: uppercase;
}

.icon {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: #42dd73;
}

.camera-icon::before,
.camera-icon::after {
  content: "";
  position: absolute;
  border: 3px solid currentColor;
}

.camera-icon::before {
  inset: 5px 8px 5px 0;
  border-radius: 5px;
}

.camera-icon::after {
  top: 9px;
  right: 0;
  width: 8px;
  height: 8px;
  border-left: 0;
  transform: skewY(-25deg);
}

.printer-icon::before {
  content: "";
  position: absolute;
  inset: 4px 3px 3px;
  border: 3px solid currentColor;
  border-radius: 5px;
}

.printer-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 9px;
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.plug-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  width: 12px;
  height: 12px;
  border: 3px solid currentColor;
  border-radius: 0 0 8px 8px;
}

.plug-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 12px;
  height: 14px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
  border-radius: 4px 4px 0 0;
}

.bulb-icon::before {
  content: "";
  position: absolute;
  inset: 1px 6px 8px;
  border: 3px solid currentColor;
  border-radius: 50% 50% 42% 42%;
}

.bulb-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 2px;
  height: 8px;
  border-top: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
}

.lamp-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 14px;
  height: 12px;
  border: 3px solid currentColor;
  border-radius: 50% 50% 4px 4px;
  transform: rotate(-28deg);
}

.lamp-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 2px;
  width: 18px;
  height: 19px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: skewX(-20deg);
}

.icon-button {
  display: grid;
  width: 50px;
  height: 50px;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
}

.camera-frame {
  position: relative;
  aspect-ratio: 16 / 7.55;
  margin: 0 18px 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: #070908;
}

.camera-frame video,
.camera-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.8) contrast(1.05);
}

.camera-frame video {
  z-index: 1;
  background: #050706;
}

.camera-frame img {
  z-index: 0;
}

.camera-frame.is-live img {
  display: none;
}

.camera-offline {
  position: absolute;
  z-index: 2;
  inset: auto 16px 16px;
  display: none;
  padding: 10px 12px;
  border: 1px solid rgba(255, 65, 65, 0.28);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.66);
  color: var(--red);
  font-weight: 800;
}

.camera-frame.is-offline .camera-offline {
  display: block;
}

.printer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 26px;
  padding: 0 22px 26px;
}

.print-details {
  padding: 22px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.state-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--green-soft);
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 900;
}

.state-line span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: currentColor;
}

.state-line.is-idle,
.state-line.is-offline {
  color: var(--muted);
}

.state-line.is-error {
  color: var(--red);
}

.print-details h3 {
  min-height: 1.35em;
  margin: 0 0 18px;
  color: white;
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  font-weight: 700;
}

dl {
  display: grid;
  gap: 15px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

dt {
  color: var(--muted);
  font-size: clamp(0.92rem, 2.8vw, 1.08rem);
}

dd {
  margin: 0;
  color: #53e47e;
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.print-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.ring {
  position: relative;
  display: grid;
  width: clamp(148px, 30vw, 204px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(10, 13, 12, 1) 0 56%, transparent 57%),
    conic-gradient(#44d96d calc(var(--progress) * 1%), rgba(255, 255, 255, 0.16) 0);
  box-shadow: 0 0 38px rgba(15, 138, 95, 0.17);
}

.ring::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ring span {
  font-size: clamp(3rem, 9vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
}

.ring small {
  position: absolute;
  transform: translate(58px, 14px);
  font-size: clamp(1.1rem, 3.5vw, 1.55rem);
}

.print-actions > p {
  margin: 18px 0 22px;
  color: var(--green-soft);
  font-size: clamp(1.1rem, 3.8vw, 1.45rem);
  font-weight: 800;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.action-button {
  min-height: 112px;
  border: 0;
  border-radius: 12px;
  color: white;
  font-size: clamp(0.95rem, 3vw, 1.12rem);
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 16px 34px rgba(0, 0, 0, 0.28);
}

.action-button span {
  display: block;
  margin-bottom: 9px;
  font-size: 2rem;
}

.action-button.resume {
  background: linear-gradient(145deg, #5fe786, #168b55);
}

.action-button.pause {
  background: linear-gradient(145deg, #e5b33e, #a36d14);
}

.action-button.stop {
  background: linear-gradient(145deg, #ee4b48, #a71919);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8) brightness(0.58);
  opacity: 0.6;
}

.power-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.85fr);
  gap: 22px;
  align-items: center;
  padding: 0 22px 24px;
}

.power-state {
  display: flex;
  align-items: center;
  gap: 16px;
}

.round-icon {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 50%;
  background: rgba(43, 224, 120, 0.16);
}

.power-state strong {
  display: block;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
}

.power-state small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: clamp(0.94rem, 2.8vw, 1.1rem);
}

.danger-wide {
  min-height: 82px;
  border: 1px solid rgba(255, 65, 65, 0.22);
  border-radius: 12px;
  background: rgba(255, 65, 65, 0.035);
  color: var(--red);
  font-size: clamp(0.95rem, 3vw, 1.22rem);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.light-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.9fr;
  gap: 18px;
  padding: 0 22px 24px;
}

.light-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 3px;
  min-height: 112px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 18px;
  text-align: left;
  cursor: pointer;
}

.light-card .icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
}

.light-card strong {
  align-self: end;
  font-size: clamp(1rem, 3vw, 1.25rem);
}

.light-card small {
  align-self: start;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  font-weight: 800;
}

.light-card.is-on small {
  color: var(--green-soft);
}

.light-card i {
  position: relative;
  grid-row: 1 / 3;
  width: 56px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.light-card i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  transition: transform 0.2s ease;
}

.light-card.is-on i {
  background: linear-gradient(90deg, #1b9f5f, #62ea86);
}

.light-card.is-on i::after {
  transform: translateX(22px);
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 90px;
  color: var(--muted);
  font-size: clamp(0.95rem, 3vw, 1.18rem);
  font-weight: 700;
  text-align: center;
}

footer span {
  color: var(--green-soft);
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(18px);
}

.confirm-modal.is-open {
  display: grid;
}

.confirm-box {
  width: min(100%, 440px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 38%),
    #0b0f0d;
  padding: 26px;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.52);
}

.confirm-box > p:first-child {
  margin: 0 0 10px;
  color: var(--green-soft);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.confirm-box h2 {
  margin: 0;
  font-size: 1.5rem;
}

.confirm-box p {
  color: var(--muted);
  line-height: 1.5;
}

.confirm-box div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.ghost-button,
.danger-button {
  min-height: 52px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.danger-button {
  border: 1px solid rgba(255, 65, 65, 0.28);
  background: linear-gradient(145deg, #ee4b48, #a71919);
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .online-pill {
    padding: 10px 14px;
  }

  .printer-grid,
  .power-row,
  .light-grid {
    grid-template-columns: 1fr;
  }

  .print-actions {
    padding-top: 4px;
  }
}

@media (max-width: 500px) {
  .app-shell {
    padding-inline: 12px;
  }

  .topbar {
    gap: 10px;
  }

  .brand-lockup {
    gap: 10px;
  }

  .online-pill strong {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .panel {
    margin-top: 16px;
    border-radius: 15px;
  }

  .camera-frame {
    aspect-ratio: 16 / 9.2;
    margin: 0 12px 12px;
  }

  .panel-title,
  .printer-grid,
  .power-row,
  .light-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .action-row {
    gap: 10px;
  }

  .action-button {
    min-height: 92px;
  }

  .light-card {
    min-height: 96px;
  }
}
