/* Minimal: white page, black type, one weight of line. Deliberately
   light-only, so the tag picture always sits on white. */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6e6e6e;
  --line: #e4e4e4;
  --field: #f6f6f6;
  --error: #b42318;
  --w3w: #e11f26;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-block: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---- Mode: only a tag visit shows the app ---------------------------- */
#app, #privacy { display: none; }
#idle {
  min-height: calc(100dvh - 48px);
  display: grid;
  place-items: center;
}
#idle img { width: min(78vw, 420px); height: auto; display: block; }
[data-mode="tag"] #idle { display: none; }
[data-mode="tag"] #app { display: block; }
[data-mode="tag"] #privacy { display: block; }

/* ---- App ------------------------------------------------------------- */
main, footer { max-width: 440px; margin: 0 auto; }

/* /T/TEST: a thin strip so a test page can't be mistaken for the real one.
   app.js unhides it in test mode only. */
.test-banner {
  margin: 0 0 8px; padding: 6px 10px; border-radius: 8px;
  background: #fff4d6; color: #6b4e00; font-size: 0.85rem; text-align: center;
}

/* Language switcher: small, top right, out of the way. */
.lang { display: flex; justify-content: flex-end; align-items: center; gap: 6px; color: var(--muted); }
.lang-icon { flex: none; }
.lang select {
  font: inherit; font-size: 0.9rem; color: var(--fg);
  background: transparent; border: 0; border-radius: 6px; padding: 6px 2px; min-height: 36px; cursor: pointer;
}
.lang select:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
#home, #found-form, #thanks { display: grid; gap: 16px; padding-top: 8vh; }
#found-form { padding-top: 0; }

h1 { text-align: center; font-size: 1.75rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; }
/* Centred column: picture, titles, intro text, status and notes. Form
   fields stay left-aligned so labels line up with their inputs. */
#home > p, #thanks > p, #found-form > p:not(.error), .note { text-align: center; }
.note .link, #thanks .link { justify-self: center; }
.tag-mini { width: 96px; height: auto; display: block; justify-self: center; }
.photo { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; padding: 12px 18px;
  border: 1px solid var(--fg); border-radius: 10px;
  background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn:focus-visible, .link:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.link {
  justify-self: start; background: none; border: 0; padding: 4px 0;
  font: inherit; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.back { text-decoration: none; color: var(--muted); }

.note { display: grid; gap: 4px; color: var(--muted); }
.status { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; }

fieldset { border: 0; margin: 8px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); min-width: 0; display: grid; gap: 10px; }
legend { float: left; width: 100%; padding: 0; font-weight: 600; }
.hint, .coords { color: var(--muted); font-size: 0.9rem; }
.coords { min-height: 1.3em; margin-top: -4px; }

.map { height: 240px; width: 100%; border: 1px solid var(--line); border-radius: 10px; z-index: 0; background: var(--field); }

label { display: grid; gap: 6px; }
label > span:first-child { font-size: 0.9rem; color: var(--muted); }
input, textarea {
  width: 100%; min-height: 48px; padding: 12px;
  font: inherit; color: var(--fg);
  background: var(--field); border: 1px solid transparent; border-radius: 10px;
}
input:focus, textarea:focus { outline: none; border-color: var(--fg); background: var(--bg); }

.w3w { display: flex; align-items: center; gap: 6px; }
.w3w > span { color: var(--w3w); font-weight: 700; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--fg); }
.check span { color: var(--fg); font-size: 1rem; }

.error { color: var(--error); font-weight: 600; }

footer { text-align: center; margin-top: 48px; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }

[hidden] { display: none !important; }
