:root {
  --green: #2f4f2f; --green-2: #3f6b3f; --bg: #f4f6f1; --card: #fff; --line: #d6dccf;
  --text: #1d231c; --muted: #5d6658; --danger: #b3261e; --warn-bg: #fff4d6; --ok: #1e7b34;
  --radius: 12px;
  font-family: system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.6; }
body { padding-bottom: env(safe-area-inset-bottom); }
h1 { font-size: 1.35rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.1rem; margin: .2rem 0 .8rem; }
a { color: var(--green-2); }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app-header { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.header-row { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem .2rem; gap: .5rem; }
.brand { display: flex; flex-direction: column; line-height: 1.3; }
.brand small { opacity: .85; font-size: .78rem; }
.net { font-size: .75rem; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; }
.net.on { background: #cfe9cf; color: #174017; }
.net.off { background: #ffd8a8; color: #5a3100; }
.top-nav { display: flex; overflow-x: auto; gap: .2rem; padding: 0 .6rem .4rem; }
.top-nav a { color: #fff; text-decoration: none; padding: .45rem .75rem; border-radius: 8px; white-space: nowrap; font-size: .92rem; }
.top-nav a:hover, .top-nav a:focus { background: rgba(255,255,255,.15); }
.header-actions { display: flex; align-items: center; gap: .4rem; flex: none; }
.nav-logout { background: none; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 8px;
  padding: .2rem .55rem; font-size: .8rem; white-space: nowrap; cursor: pointer; }
.nav-logout:hover, .nav-logout:focus { background: rgba(255,255,255,.15); }

.page { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 7rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.banner { padding: .7rem 1rem; border-radius: 10px; margin: .6rem 1rem; font-size: .9rem; }
.banner.error { background: #fdecec; color: #8a1c1c; border: 2px solid #e08080; }
.banner.error p { margin: .3rem 0 0; }
.banner.warn { background: var(--warn-bg); color: #5a4100; border: 1px solid #f1d58a; }
.page .banner { margin: 0 0 1rem; }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; }

.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .9rem; flex: 1; min-width: 0; }
.field-label { font-weight: 600; font-size: .92rem; }
input, select, textarea {
  font: inherit; font-size: 16px; padding: .65rem .7rem; border: 1px solid #b9c2b2; border-radius: 10px;
  background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 3px solid #9cc79c; border-color: var(--green-2); }
input[readonly] { background: #eef1ea; }
.pw-wrap { display: flex; gap: .4rem; align-items: stretch; }
.pw-wrap input { flex: 1; min-width: 0; }
.pw-toggle { flex: none; white-space: nowrap; min-width: 3.6rem; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: .82rem; display: block; }
.hint.warn { color: #7a5200; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: .2rem 0 .6rem; }
.error-box ul { background: #fdecea; border: 1px solid #f3b7b2; color: var(--danger); border-radius: 10px; padding: .7rem 1rem .7rem 2rem; }
.check { display: flex; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; font: inherit; font-size: .95rem;
  padding: .6rem 1rem; border-radius: 10px; border: 1px solid #9fae96; background: #fff; color: var(--text);
  cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn:hover { background: #eef3ea; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-2); }
/* LINE ログイン (LINE のブランドカラー) */
.btn.line { background: #06c755; border-color: #06c755; color: #fff; font-weight: 700; }
.btn.line:hover { background: #05b34c; }
.btn.danger { color: var(--danger); border-color: #e3aaa5; }
.btn.small { padding: .3rem .7rem; font-size: .85rem; min-height: 36px; }
.btn.block { display: flex; width: 100%; margin-bottom: .8rem; }
.btn.big { font-size: 1.1rem; padding: 1rem; }
.btn.link { border: none; background: none; color: var(--green-2); text-decoration: underline; width: 100%; }

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.row .field { min-width: 130px; }
.actions { margin-top: .6rem; }
.center { display: flex; justify-content: center; margin: .8rem 0; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: .8rem 1rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .4rem; color: var(--green); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin-top: .8rem; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafbf8; }
.photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo figcaption { padding: .4rem; display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; }
.photo select { padding: .3rem; font-size: .85rem; }
.loc-info { margin: .6rem 0; padding: .6rem .8rem; background: #f2f6ef; border-radius: 10px; font-size: .9rem; }

.sticky-actions {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  padding: .5rem 1rem calc(.6rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: .3rem; z-index: 5;
}
.sticky-actions .row { width: 100%; max-width: 760px; justify-content: flex-end; }
.sticky-actions .btn { flex: 1; }
.save-state { font-size: .75rem; color: var(--muted); }

.report-list, .user-list, .plain { list-style: none; padding: 0; margin: 0; }
.report-card { background: #fff; border: 1px solid var(--line); border-left: 6px solid #c8cfc0; border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .7rem; }
.report-card.status-ready { border-left-color: #e0a100; }
.report-card.status-sent { border-left-color: var(--ok); }
.meta { color: var(--muted); font-size: .88rem; }
.meta.small { font-size: .78rem; }
.badge { font-size: .75rem; padding: .1rem .6rem; border-radius: 99px; background: #e6eae2; white-space: nowrap; }
.badge.ready { background: #ffe9b0; color: #5a3d00; }
.badge.sent { background: #d4edd8; color: #134d20; }
.badge.admin { background: #dfe6ff; color: #1e3478; }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }
.drive-box .row { margin-bottom: .3rem; }
.user.disabled { opacity: .65; }
.plain li { padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; gap: .5rem; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: 0 0 1rem; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.link-card { margin-top: .8rem; padding: .8rem; background: #f2f6ef; border-radius: 10px; }
code.link, code.secret { display: block; word-break: break-all; background: #fff; border: 1px dashed #9fae96; padding: .5rem; border-radius: 8px; margin: .4rem 0; font-size: .8rem; }
code.secret { font-size: 1.05rem; letter-spacing: .05em; text-align: center; }
.qr { image-rendering: pixelated; max-width: 240px; width: 100%; height: auto; border: 1px solid var(--line); }
details { margin: .6rem 0; }
summary { cursor: pointer; color: var(--green-2); }

table.audit { width: 100%; border-collapse: collapse; background: #fff; font-size: .82rem; margin-bottom: 1rem; display: block; overflow-x: auto; }
table.audit th, table.audit td { border-bottom: 1px solid var(--line); padding: .4rem .5rem; text-align: left; white-space: nowrap; }
table.audit tr.warn td { background: #fff1ef; }
.mono { font-family: ui-monospace, monospace; }

.toast { position: fixed; left: 50%; bottom: 6rem; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #263326; color: #fff; padding: .7rem 1.1rem; border-radius: 10px; max-width: 90vw; transition: .25s; z-index: 50; font-size: .92rem; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }

/* ---- v1.1 追加 ---- */
.banner.mock { background: #e8f0ff; color: #1e3478; border: 1px solid #b7c8f2; }
.auth-card .banner { margin: 0 0 1rem; }
.badge.draft { background: #e6eae2; }
.badge.withdrawn { background: #f3dcda; color: #7a1d16; }
.badge.correction { background: #fde2c4; color: #6b3a00; }
.report-card.status-draft { border-left-color: #9aa58f; }
.report-card.status-withdrawn { border-left-color: #b3261e; opacity: .75; }
.row.tight { gap: .3rem; flex-wrap: nowrap; }
fieldset.correction { border-color: #f0b46a; background: #fff8ef; }
ol.steps { padding-left: 1.3rem; font-size: .9rem; }
ol.steps li { margin-bottom: .4rem; }
.kv.review { grid-template-columns: 7.5em 1fr; }
.btn.danger.block { background: #fff; }

/* 承認待ちの申請 */
.card.requests { border: 2px solid #e0b100; }
.request { display: grid; gap: .3rem; padding: .6rem 0; border-bottom: 1px solid #eee; }
.request input { width: 100%; }

/* 通知の記録 */
pre.note { white-space: pre-wrap; font-family: inherit; font-size: .85rem; background: #f6f7f4; padding: .5rem; border-radius: 6px; margin: .2rem 0 .6rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 560px; }

/* 狩猟シーズンの記録 */
.season-card { border: 2px solid var(--green-2); }
.season-card h2 { margin: 0; }
.section-title { font-size: 1rem; margin: 1.4rem 0 .6rem; color: var(--muted); }
.counter { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.counter-label { font-size: .92rem; }
.counter-ctl { display: flex; align-items: center; gap: .3rem; flex: none; }
.counter-ctl .btn { min-width: 44px; min-height: 44px; font-size: 1.2rem; padding: 0; }
.count-input { width: 4.2rem; text-align: center; font-size: 1.1rem; padding: .4rem; }
.counter-grid { display: grid; grid-template-columns: 1fr; gap: 0 1rem; margin-bottom: .6rem; }
@media (min-width: 640px) { .counter-grid { grid-template-columns: repeat(3, 1fr); } }
.choice-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.choice { display: flex; align-items: center; gap: .35rem; border: 1px solid #b9c2b2; border-radius: 10px; padding: .5rem .8rem; background: #fff; cursor: pointer; min-height: 44px; }
.choice input { width: auto; margin: 0; }
.choice:has(input:checked) { background: #e3efe0; border-color: var(--green-2); font-weight: 600; }
.mesh-input { max-width: 8rem; font-size: 1.3rem; letter-spacing: .3em; text-align: center; }
.other-row { display: grid; grid-template-columns: 1fr; gap: .3rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.catch-row { background: #fafbf8; }
.count-group { margin: .2rem 0 .8rem; }
.count-group-title { display: flex; align-items: baseline; gap: .6rem; padding: .3rem .5rem; background: #eef3ea; border-radius: 8px; }
.count-group-title strong { color: var(--green); }
.count-group .counter { padding-left: .6rem; }
.count-group .counter-label { font-size: 1.05rem; min-width: 3em; }
.photo-sets { display: grid; gap: .6rem; }
.photo-part { border-top: 1px solid var(--line); padding: .7rem 0; display: grid; gap: .5rem; }
.photo-part:first-child { border-top: none; padding-top: 0; }
.photo-part-title { color: var(--green); }
.photo-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.photo-tile { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafbf8; }
.photo-tile-img { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; background: #fff; }
.photo-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile figcaption { padding: .4rem; display: grid; gap: .3rem; font-size: .85rem; }
.photo-tile .row { gap: .3rem; }
