:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #0d1117;
  color: #f0f6fc;
  overflow: hidden;
}

.app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

.viewer-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
}

.viewer-stage {
  width: 100%;
  height: 100%;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-stage:active {
  cursor: grabbing;
}

miris-scene,
miris-stream {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.controls {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 20px);
  z-index: 10;
}

.controls button {
  border: 1px solid #6e7681;
  background: rgba(13, 17, 23, 0.92);
  color: #f0f6fc;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
}

.controls button:hover {
  background: rgba(56, 139, 253, 0.4);
}

.controls button.is-active {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #ffffff;
}

.view-tool-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #6e7681;
  background: rgba(13, 17, 23, 0.92);
  color: #f0f6fc;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1;
}

.view-tool-toggle input[type="checkbox"] {
  margin: 0;
}

@media (max-width: 640px) {
  .controls {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    gap: 6px;
  }

  .controls button,
  .view-tool-toggle {
    padding: 7px 10px;
    font-size: 11px;
  }
}
