:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #1d232b;
  color: #f4f7fb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: #1d232b;
}

body { min-height: 100dvh; }

button, input { font: inherit; }

button { cursor: pointer; }

.hidden { display: none !important; }

.panel {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.brand h1 {
  font-size: clamp(24px, 5vw, 34px);
  margin: 0 0 4px;
}

.brand p, .card p {
  margin: 0;
  color: #aeb8c8;
  line-height: 1.45;
}

.badge {
  border: 1px solid #ffffff;
  color: #ffffff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.card {
  border: 1px solid #333c48;
  background: #242b35;
  border-radius: 16px;
  padding: 20px;
  margin: 14px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.card.compact {
  padding: 16px 18px;
  font-size: 14px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.state-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #64748b;
  margin-top: 5px;
  box-shadow: 0 0 0 5px rgba(100,116,139,.12);
}

.dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34,197,94,.12);
}

label {
  display: block;
  margin: 14px 0;
  color: #dbe5f2;
  font-weight: 650;
}

input[type="text"],
input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid #333c48;
  border-radius: 10px;
  background: #14181f;
  color: #e9f1fb;
  padding: 12px;
}

.hint {
  font-size: 13px;
  color: #a3a3a3;
  line-height: 1.4;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 11px;
  padding: 12px 16px;
  font-weight: 750;
}

.primary {
  background: #ffffff;
  color: #1d232b;
}

.secondary {
  background: #333c48;
  color: #edf4ff;
}

.danger {
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.target-preview {
  width: min(100%, 360px);
  max-height: 280px;
  object-fit: contain;
  background: #0e1116;
  border-radius: 12px;
  border: 1px solid #333c48;
  margin-top: 16px;
}

.progress-box {
  margin-top: 14px;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  color: #b8bfc9;
  font-size: 13px;
  margin-bottom: 8px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #2c333d;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: #ffffff;
  transition: width .15s linear;
}

.message {
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  background: #262d38;
  color: #e5e9ee;
  white-space: pre-line;
}

.message.error {
  background: #000000;
  color: #ffffff;
  border: 1px solid #ffffff;
}

.ar-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  overflow: hidden;
}

.ar-container,
.ar-container a-scene {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.ar-topbar {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ar-status {
  background: rgba(7,10,16,.72);
  backdrop-filter: blur(10px);
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.14);
}

.small-button {
  padding: 9px 12px;
  background: rgba(7,10,16,.78);
  color: white;
  border: 1px solid rgba(255,255,255,.18);
}

.scan-guide {
  pointer-events: none;
  position: fixed;
  z-index: 950;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  text-shadow: 0 2px 8px #000;
}

.scan-frame {
  width: min(72vw, 390px);
  aspect-ratio: 1.45;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.12);
}

.scan-guide p {
  margin: 16px;
  padding: 8px 12px;
  background: rgba(0,0,0,.45);
  border-radius: 999px;
}

.audio-fallback {
  position: fixed;
  z-index: 1100;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #fff;
  color: #1d232b;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}

code {
  background: #14181f;
  border: 1px solid #333c48;
  padding: 1px 5px;
  border-radius: 5px;
}

@media (max-width: 600px) {
  .panel { padding-top: 18px; }
  .card { padding: 16px; }
  .actions button { flex: 1 1 auto; }
}
