:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --text: #f2f6fb;
  --muted: #9aa8b8;
  --line: #30363d;
  --accent: #49d3a7;
  --accent-2: #6fb7ff;
  --warning: #ffcc66;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100svh;
  grid-template-rows: minmax(420px, 58svh) auto;
}

.camera-panel {
  position: relative;
  overflow: hidden;
  background: #05070a;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  inset: 17% 7% 20%;
  border: 2px solid color-mix(in srgb, var(--accent), transparent 22%);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(5, 7, 10, 0.2);
  pointer-events: none;
}

.topbar,
.status-strip {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  top: max(14px, env(safe-area-inset-top));
}

.status-strip {
  bottom: 18px;
  min-height: 44px;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(12px);
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2.4rem);
  line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.icon-button {
  width: 54px;
  min-width: 54px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.72);
  color: var(--text);
}

.status-dot {
  width: 10px;
  min-width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 18px currentColor;
}

.status-dot.ready {
  background: var(--accent);
}

.status-dot.error {
  background: #ff7a7a;
}

.answer-panel {
  padding: 20px max(18px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.confidence {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

h2 {
  margin: 10px 0 12px;
  font-size: 1.2rem;
  line-height: 1.25;
}

.answer {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 750;
  line-height: 1.25;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.35;
}

@media (min-width: 820px) {
  .app-shell {
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    grid-template-rows: 100svh;
  }

  .answer-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 34px;
  }
}
