:root {
  --bg: #f4f1ea; --card: #fff; --ink: #1f2a20; --muted: #6b7568; --line: #e2ddd0;
  --green: #2f4a32; --green-2: #3f6343; --accent: #c8741a; --danger: #a3372c; --ok: #2d7a3e;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a15; --card: #1e251e; --ink: #ecefe8; --muted: #98a394; --line: #2c352c; --green: #5f9a65; --green-2: #74b07a; --accent: #e0953c; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
header.top h1 { font-size: 18px; margin: 0; letter-spacing: .2px; }
main { padding: 16px; display: grid; gap: 14px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 2px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 14px; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-2); outline-offset: 1px; }
button { border: 0; border-radius: 10px; padding: 12px 16px; background: var(--green); color: #fff; font-weight: 600; cursor: pointer; min-height: 44px; }
button:active { transform: scale(.98); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
button.small { padding: 6px 10px; min-height: 34px; font-size: 14px; }
button:disabled { opacity: .5; cursor: default; }
.seg { display: grid; grid-auto-flow: column; gap: 6px; }
.seg button { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.seg button.on { background: var(--green); color: #fff; border-color: var(--green); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--ink); }
.chip.turn { background: var(--accent); color: #fff; }
.chip.ok { background: var(--ok); color: #fff; }
.chip.harvest { background: var(--accent); color: #fff; }
.chip.sighting { background: var(--green-2); color: #fff; }
.chip.work { background: #6b6f9c; color: #fff; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs .in { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 640px; }
nav.tabs a { text-align: center; padding: 10px 0 8px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
nav.tabs a .ic { display: block; font-size: 22px; line-height: 1.1; }
nav.tabs a.on { color: var(--green); }
.err { color: var(--danger); font-size: 14px; min-height: 1em; }
.hunter { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.hunter:first-of-type { border-top: 0; }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.num.turn { background: var(--accent); color: #fff; }
.stands { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.stands button { background: var(--card); color: var(--ink); border: 2px solid var(--green); text-align: left; padding: 10px 12px; }
.stands button small { display: block; font-weight: 400; color: var(--muted); }
.stands button:disabled { border-color: var(--line); opacity: .6; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--line); }
.thumb { position: relative; }
.thumb button { position: absolute; top: 4px; right: 4px; min-height: 26px; padding: 0 8px; background: rgba(0,0,0,.65); }
.bell { position: relative; background: transparent; color: var(--ink); font-size: 20px; padding: 4px 8px; min-height: 36px; }
.bell b { position: absolute; top: -2px; right: -2px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: grid; place-items: center; z-index: 20; }
.lightbox img { max-width: 96vw; max-height: 92vh; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 30; font-size: 14px; }
.auth { max-width: 420px; margin: 0 auto; padding: 48px 20px; display: grid; gap: 16px; }
.auth h1 { margin: 0; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
