/* Dark by default and unapologetically so: this is read in a garage, often in
   poor light, often one-handed, sometimes with dirty hands. Tap targets are
   large, contrast is high, and nothing important is smaller than 16px. */
:root {
  --bg: #16181c;
  --surface: #1f2329;
  --surface-2: #272c33;
  --line: #333941;
  --text: #eef1f5;
  --dim: #98a2b0;
  --accent: #ffb020;      /* the colour of every tool brand for a reason */
  --accent-ink: #241a05;
  --good: #46c07a;
  --warn: #ff7a5c;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overscroll-behavior-y: none;
}
body { padding-bottom: env(safe-area-inset-bottom); }

/* ------------------------------------------------------------------ gate */
.gate {
  min-height: 100dvh; display: flex; flex-direction: column;
  justify-content: center; gap: 14px; padding: 32px 24px; max-width: 460px; margin: 0 auto;
}
.gate h1 { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
.gate p { margin: 0; color: var(--dim); }
input, button, select, textarea { font: inherit; }
input[type=password], input[type=search], input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  border: 0; border-radius: var(--radius); padding: 14px 18px;
  background: var(--surface-2); color: var(--text); cursor: pointer;
  min-height: 48px;   /* thumb-sized, always */
}
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
button.ghost { background: transparent; border: 1px solid var(--line); }
.msg { min-height: 1.4em; color: var(--warn); font-size: 15px; }

/* ------------------------------------------------------------------ tabs */
main { padding: 16px 16px 92px; max-width: 720px; margin: 0 auto; }
.tab[hidden] { display: none; }

#nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#nav button {
  flex: 1; background: none; border-radius: 0; color: var(--dim);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; padding: 9px 2px; min-height: 58px;
}
#nav button span { font-size: 19px; line-height: 1; }
#nav button.on { color: var(--accent); }

/* -------------------------------------------------------------- identify */
.shoot { padding: 8px 0 18px; }
.shutter {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 210px; border-radius: 22px; cursor: pointer;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 2px dashed var(--line);
}
.shutter:active { border-color: var(--accent); }
.shutter-icon { font-size: 54px; color: var(--accent); line-height: 1; }
.shutter-label { font-size: 19px; font-weight: 650; }
.shutter-sub { color: var(--dim); font-size: 14px; }

/* The answer is the whole point of the app, so it is the biggest thing on the
   screen and readable at arm's length. */
.answer {
  background: var(--surface); border-radius: 18px; padding: 20px;
  border-left: 5px solid var(--accent); margin-bottom: 14px;
}
.answer.unsure { border-left-color: var(--dim); }
.answer .where { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; }
.answer .what { color: var(--dim); font-size: 15px; }
.answer .why { color: var(--dim); font-size: 13px; margin-top: 8px; }

/* ------------------------------------------------------------------ list */
.card {
  display: flex; gap: 13px; align-items: center; background: var(--surface);
  border-radius: var(--radius); padding: 12px; margin-bottom: 9px;
  border: 1px solid transparent; text-align: left; width: 100%;
}
.card:active { border-color: var(--line); }
.card img, .thumb {
  width: 58px; height: 58px; border-radius: 10px; object-fit: cover;
  background: var(--surface-2); flex: none;
}
.thumb { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 22px; }
.card .body { min-width: 0; flex: 1; }
.card .name { font-weight: 620; }
.card .loc { color: var(--accent); font-size: 14px; }
.card .sub { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--dim); }
.pill.out { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.pill.low { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }

h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.09em;
     color: var(--dim); margin: 22px 0 9px; font-weight: 620; }
h2:first-child { margin-top: 4px; }
.empty { color: var(--dim); text-align: center; padding: 40px 20px; }
.hint { color: var(--dim); font-size: 13px; margin: 8px 2px 16px; }
.searchbar { display: flex; gap: 9px; }
.searchbar input { flex: 1; }
.row { display: flex; gap: 9px; margin-top: 10px; }
.row > * { flex: 1; }
.spinner { text-align: center; padding: 34px; color: var(--dim); }

/* ----------------------------------------------------------------- sheet */
.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; z-index: 50;
}
.sheet-inner {
  background: var(--surface); width: 100%; max-height: 88dvh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(26px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
}
.sheet h3 { margin: 0 0 4px; font-size: 21px; }
.sheet label { display: block; font-size: 13px; color: var(--dim); margin: 12px 0 5px; }
.sheet img.hero { width: 100%; max-height: 240px; object-fit: contain; border-radius: 12px; background: var(--bg); }

.toast {
  position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 999px; z-index: 60; font-size: 15px;
}

@media (prefers-color-scheme: light) {
  /* The garage is dim; the app stays dark on purpose. Light mode only softens
     the extremes so it is not a black hole on a bright phone outdoors. */
  :root { --bg: #101215; }
}
