:root {
  --bg: #101418;
  --card: #1a2027;
  --line: #2c343d;
  --text: #eef2f6;
  --muted: #93a1b0;
  --accent: #35c07a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  font-size: clamp(19px, 5.2vw, 22px);
  -webkit-text-size-adjust: 100%;
}

/*
 * Touch devices size purely in vw, with no px ceiling. A phone forced into
 * desktop mode reports a ~1080px viewport at DPR 1 instead of 360px at DPR 3,
 * and any px cap then renders at a third of its intended physical size. Since
 * the screen's physical width is fixed either way, a vw value is physically
 * identical in both modes.
 */
@media (pointer: coarse), (hover: none), (max-aspect-ratio: 3 / 4) {
  html { font-size: 5.6vw; }
  body { max-width: none; }
}

body {
  margin: 0;
  padding: 0.75rem 0.75rem calc(2rem + env(safe-area-inset-bottom));
  max-width: 34rem;
  margin-inline: auto;
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

header { padding: 0.5rem 0 0.9rem; }
h1 { margin: 0; font-size: 1.6rem; }
header p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; }

.shot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 42vh;
  border: 2px dashed var(--line);
  border-radius: 1rem;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.shot img { width: 100%; height: 100%; object-fit: cover; }
#shotHint { color: var(--muted); }

button {
  width: 100%;
  min-height: 3.2rem;
  margin-top: 0.9rem;
  padding: 0.9rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #06130c;
  background: var(--accent);
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
}

button:disabled { opacity: 0.4; cursor: default; }

#status { min-height: 1.5rem; margin: 0.75rem 0 0; color: var(--muted); text-align: center; }
#status.error { color: #ff8a80; }

section {
  margin-top: 0.5rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

h2 { margin: 0; font-size: 1.3rem; }
.price { margin: 0.35rem 0 0; font-size: 2.4rem; font-weight: 700; line-height: 1.1; color: var(--accent); }
.range { margin: 0.2rem 0 0; color: var(--muted); }

dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 1rem 0 0; }
dt { color: var(--muted); }
dd { margin: 0; }

.attribution { margin: 0.3rem 0 0; color: var(--accent); font-weight: 600; }

h3 { margin: 1.25rem 0 0.5rem; font-size: 1rem; color: var(--muted); font-weight: 600; }

.comps { margin: 0; padding-left: 1.1rem; }
.comps li { margin-bottom: 0.6rem; }
.comps a { color: var(--text); overflow-wrap: anywhere; }

#notes { margin: 1rem 0 0; color: var(--muted); }
