:root {
  --bg: #14161a;
  --card: #1e2127;
  --ink: #eef0f4;
  --muted: #9aa2ae;
  --line: #2e333c;
  --accent: #e08a2e;
  --accent-ink: #17190d;
  --out: #e08a2e;
  --in: #4ec98a;
  --danger: #ff8b8b;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap { max-width: 520px; margin: 0 auto; padding: 20px 18px 48px; }

header.top { padding: 26px 0 14px; }
header.top h1 { margin: 0; font-size: 25px; letter-spacing: -0.02em; }
header.top p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

/* ------------------------------------------------------- the big control */

/* Two targets, stacked and full width. Deliberately not side by side: these
   get tapped one-handed, with gloves on, while the other hand holds the tool,
   and a half-width button is where mis-taps come from. */
.choices { display: grid; gap: 12px; }

.shutter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 150px;
  border: 2px solid var(--accent);
  border-radius: 20px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 21px;
  font-weight: 750;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.06s ease;
}
.shutter:active { transform: scale(0.98); }
.shutter:disabled { opacity: 0.55; }
.shutter .lens { font-size: 40px; line-height: 1; }
.shutter .hint {
  font-size: 13px; font-weight: 700; opacity: 0.8;
  text-transform: uppercase; letter-spacing: 0.07em;
}

/* Coming back is the calmer, less frequent action -- give it a different
   colour so the two are never confused at a glance. */
.shutter.in {
  background: transparent;
  color: var(--in);
  border-color: var(--in);
}

input[type="file"] { display: none; }

/* ---------------------------------------------------------------- result */

.result { text-align: center; padding: 8px 0 2px; }
.result .verdict {
  font-size: 13px; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; display: inline-block; margin-bottom: 14px;
}
.result .verdict.out { background: rgba(224, 138, 46, 0.16); color: var(--out); }
.result .verdict.in  { background: rgba(78, 201, 138, 0.16); color: var(--in); }
.result .verdict.unknown { background: var(--line); color: var(--muted); }
.result h2 { margin: 0 0 6px; font-size: 27px; letter-spacing: -0.02em; }
.result .sub { color: var(--muted); font-size: 15px; margin: 0; }
.result img.shot {
  width: 100%; max-height: 260px; object-fit: cover;
  border-radius: 12px; margin: 16px 0 4px; border: 1px solid var(--line);
}

.spinner {
  width: 30px; height: 30px; margin: 22px auto 12px;
  border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- pieces */

.btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit; font-weight: 700;
  padding: 14px 20px; border-radius: 13px;
  min-height: 52px; width: 100%;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.quiet { background: transparent; color: var(--muted); border-color: transparent; font-weight: 600; }
.btn:disabled { opacity: 0.5; }
.btn + .btn { margin-top: 9px; }

label.field { display: block; margin-bottom: 15px; }
label.field .lab { display: block; font-size: 14px; font-weight: 650; margin-bottom: 7px; }
label.field .opt { color: var(--muted); font-weight: 400; }
label.field .hint { display: block; font-size: 13px; color: var(--muted); margin-top: 7px; }

input[type="text"], input[type="tel"] {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 11px; padding: 14px; min-height: 52px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.msg { padding: 12px 14px; border-radius: 11px; font-size: 15px; margin-bottom: 14px; }
.msg.err { background: rgba(255, 139, 139, 0.12); color: var(--danger); }
.msg.info { background: var(--line); color: var(--muted); }
.msg[hidden] { display: none; }

.person-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; margin-bottom: 9px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 13px;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.person-row img, .person-row .blank {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: var(--line);
}
.person-row .who { font-weight: 650; }

.mine { margin: 0; padding: 0; list-style: none; }
.mine li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px;
}
.mine li:first-child { border-top: none; }
.mine .ago { color: var(--muted); font-size: 14px; white-space: nowrap; }

.footlink { text-align: center; font-size: 14px; margin-top: 22px; }
.footlink a, .footlink button {
  color: var(--muted); background: none; border: none; font: inherit;
  text-decoration: underline; cursor: pointer; padding: 6px;
}

h2.section-title {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 12px; font-weight: 700;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f4f1; --card: #ffffff; --ink: #1a1c1f; --muted: #6b7280;
    --line: #e2e0da; --accent: #b4661a; --accent-ink: #ffffff;
    --out: #a35c12; --in: #1f7a4d; --danger: #a32c2c;
  }
}
