:root {
  --bg: #f4f5f2; --fg: #17201a; --muted: #5d6b61; --card: #fff; --line: #d6dbd4;
  --accent: #1d6b3a; --accent-fg: #fff; --warn: #b45309; --bad: #b91c1c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111613; --fg: #e8ede9; --muted: #9aa79e; --card: #1b221d; --line: #2e3831;
          --accent: #3fa866; --accent-fg: #06110a; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: #1d3b2a; color: #fff; }
.brand { font-weight: 700; letter-spacing: .02em; }
.sync { display: flex; gap: 8px; align-items: center; border: 1px solid #ffffff55; background: transparent;
  color: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; }
.dot.on { background: #4ade80; } .dot.off { background: #f87171; }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 32px); }
.notice { background: #fff7ed; color: #7c2d12; border: 1px solid #fdba74; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.fld em { font-weight: 400; font-style: normal; }
input { width: 100%; font: inherit; font-size: 20px; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.pt-row { display: flex; gap: 8px; }
.pt-row input { text-align: center; font-size: 26px; font-weight: 700; }
.step { flex: 0 0 64px; font-size: 30px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.hint { display: block; min-height: 1.2em; margin-top: 4px; color: var(--accent); font-size: 14px; }
.shoot { width: 100%; display: flex; gap: 12px; align-items: center; justify-content: center;
  padding: 22px; font: inherit; font-size: 22px; font-weight: 700; border: 0; border-radius: 14px;
  background: var(--accent); color: var(--accent-fg); margin-top: 6px; }
.shoot svg { width: 30px; height: 30px; fill: currentColor; }
.shoot:active { transform: scale(.98); }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; text-decoration: underline;
  display: block; margin: 10px auto 0; padding: 6px; }
.gps { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0 18px; }
h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px; }
.recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.recent li { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; }
.recent img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.recent .meta { flex: 1; font-size: 14px; }
.recent .st { font-size: 12px; color: var(--muted); }
.recent .st.ok { color: var(--accent); } .recent .st.err { color: var(--bad); }
.foot { text-align: center; margin-top: 24px; font-size: 14px; color: var(--muted); }
.foot a { color: inherit; }

.picker { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.pick-head { display: flex; gap: 12px; align-items: center; }
.pick-head img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: #0002; }
.pick-head h2 { margin: 0; font-size: 22px; color: var(--fg); text-transform: none; letter-spacing: 0; }
.pick-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.note { margin: 12px 0 4px; font-size: 17px; }
.picker h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tbtn { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px; text-align: left;
  font: inherit; font-size: 17px; font-weight: 600; color: var(--fg); background: var(--card);
  border: 2px solid var(--line); border-radius: 12px; }
.tbtn svg { flex: 0 0 30px; width: 30px; height: 30px; }
.tbtn small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tbtn:active { transform: scale(.97); }
.tbtn.big { width: 100%; min-height: 80px; font-size: 20px; border-color: var(--accent); margin-top: 10px; }
.tbtn.big .go { margin-left: auto; color: var(--accent); font-size: 15px; }
.cancel { width: 100%; margin-top: 18px; padding: 14px; background: none; border: 1px solid var(--line);
  border-radius: 12px; color: var(--bad); font: inherit; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%);
  z-index: 30; background: #111; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 16px;
  max-width: calc(100% - 32px); box-shadow: 0 6px 20px #0005; }
[hidden] { display: none !important; }
