/* 畑で片手で使う前提。日なたで読めるよう明度差を強くとる */
:root {
  --canvas:#FAF8F3; --surface:#fff; --ink:#1B1B18; --muted:#6B6B63; --line:#E3E0D8;
  --green:#2E7D32; --green-dark:#1B5E20; --amber:#E08700; --red:#C62828;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; }
body {
  margin:0; background:var(--canvas); color:var(--ink);
  font-family:system-ui,-apple-system,"Hiragino Sans","Noto Sans JP",sans-serif;
  font-size:17px; line-height:1.7; overscroll-behavior:none;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.mono { font-variant-numeric:tabular-nums; }
[hidden] { display:none !important; }

/* ---- 入力の画面 ---- */
.pane { max-width:420px; margin:0 auto; padding:14vh 28px 40px; text-align:center; }
.pane h1 { font-size:27px; font-weight:700; color:var(--green); margin:0 0 8px; }
.pane p { color:var(--muted); margin:0 0 22px; font-size:16px; }
.pane input {
  width:100%; font:inherit; font-size:26px; font-weight:600; text-align:center; letter-spacing:1px;
  padding:16px 12px; border:1px solid var(--line); border-radius:16px;
  background:var(--surface); color:var(--ink);
}
.pane input:focus-visible { outline:2px solid var(--green); outline-offset:1px; }
.pane .phone { font-size:22px; font-weight:600; color:var(--ink); }
.go {
  width:100%; margin-top:16px; padding:19px; font:inherit; font-size:20px; font-weight:700;
  background:var(--green); color:#fff; border:none; border-radius:16px; cursor:pointer;
}
.go:disabled { opacity:.55; cursor:default; }
.back { margin-top:12px; background:none; border:none; color:var(--muted);
  font:inherit; font-size:15px; text-decoration:underline; cursor:pointer; }
.err { color:var(--red); font-size:15px; margin-top:12px; }

/* ---- 記録の画面 ---- */
/* 1画面に収める。現場でスクロールさせない */
main { height:100dvh; display:flex; flex-direction:column; padding:0 20px 14px; overflow:hidden; }
header { display:flex; align-items:center; justify-content:space-between;
  padding:10px 2px 4px; font-size:14px; font-weight:600; color:var(--muted);
  flex:0 0 auto; -webkit-user-select:none; user-select:none; }

/* **縦に積むものが増えたら、丸ボタンが縮む。**
   出退勤と今日の一覧を足したとき、丸ボタンが押し出されて
   見出しが緊急に、丸が一覧に被った。**はみ出させず、縮ませる。**
   min-height:0 を親子とも入れないと、flex は中身の大きさで止まる */
.stage { flex:1 1 auto; min-height:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:12px; overflow:hidden; }
.headline { margin:0; font-size:21px; font-weight:600; text-align:center;
  flex:0 0 auto; min-height:1.6em;
  display:flex; align-items:center; color:var(--muted); }
.headline.listening { color:var(--green); }
.headline.working { color:var(--amber); }

.big {
  /* **丸のままで小さくする。**max-height で押しつぶすと楕円になる。
     出退勤と今日の一覧を足したぶん、取り分を 40dvh から 30dvh に下げた */
  width:min(68vw, 26dvh, 280px); flex:0 0 auto;
  aspect-ratio:1; border-radius:50%; border:none; cursor:pointer;
  background:var(--green); color:#fff; font:inherit; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:8px; padding:20px;
  box-shadow:0 8px 24px -8px rgba(46,125,50,.5); transition:transform .09s ease, background .2s ease;
}
.big:active { transform:scale(.96); }
.big span { font-size:29px; font-weight:700; line-height:1.3; text-align:center; }
.big small { font-size:19px; font-weight:500; opacity:.92; }
.big.listening { animation:pulse 1.6s ease-out infinite; }
.big.working { background:var(--amber); box-shadow:0 8px 24px -8px rgba(224,135,0,.5); }
.big:disabled { background:var(--line); color:var(--muted); box-shadow:none; }
@keyframes pulse {
  0% { box-shadow:0 0 0 0 rgba(46,125,50,.45); }
  100% { box-shadow:0 0 0 26px rgba(46,125,50,0); }
}
/* 空のときの場所取りは最小限に。**縦に積むものが増えた。**
   ここで2.6行ぶん空けていたせいで、見出しが圃場の帯に被った */
.foot { margin:0; min-height:1.4em; font-size:20px; text-align:center; color:var(--ink); font-weight:600; }
.foot.faded { color:var(--muted); font-weight:400; }
.foot .pend { display:block; font-size:15px; color:var(--amber); font-weight:600; margin-top:4px; }

/* 直近3件。控えなので小さく */
/* **一覧だけをスクロールさせる。**
   以前は新しい3件しか出していなかったので、
   「さっき喋ったぶんが入ったか」を確かめるには事務所の画面を開くしかなかった
   （森島農園さんの要望）。全部出して、ここだけ指で送れるようにする。
   丸ボタンを押し出さないよう、高さは画面の3割までに抑える */
.today { list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column;
  gap:5px; flex:0 1 auto; max-height:24dvh; overflow-y:auto;
  -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.today::-webkit-scrollbar { display:none; }
.today li { background:var(--surface); border:1px solid var(--line); border-radius:10px;
  padding:8px 12px; font-size:15px; cursor:pointer; flex:0 0 auto; }
.today .line { display:flex; justify-content:space-between; gap:10px; }
.today .w { font-weight:600; }
/* まだ事務所で確かめていない記録。**あることは見せるが、決まった顔はさせない** */
.today .w.pending { font-weight:500; color:var(--muted); }
.today .t { color:var(--muted); font-size:15px; }
/* **喋った言葉をその場で確かめられるように。**
   自分の入れたものが正しく届いたか、現場で見たいという声があった */
.today .said { margin-top:6px; font-size:14px; color:var(--muted); line-height:1.6; }
.today .said[hidden] { display:none; }

/* **いちばん上に置く。**下に置くと、履歴や圃場の向こう側になる。
   ただし高さは抑える。上にあると手が触れやすいので、
   押した先の画面で「本当に押したか」を確かめる作りにしてある */
.sos { width:100%; height:60px; flex:0 0 auto; margin:2px 0 8px; border:none; border-radius:16px; background:var(--red);
  color:#fff; font:inherit; font-size:23px; font-weight:700; cursor:pointer; }

/* ---- 出退勤 ---- */
/* **タイムカードの代わり。**打つのは朝と夕の2回だけなので、場所は取らない */
.punch { flex:0 0 auto; margin-top:10px; padding-top:10px;
  border-top:1px solid var(--line); }
.punch[hidden] { display:none; }
.punchrow { display:flex; gap:8px; }
.punchrow button {
  flex:1; min-height:56px; border:none; border-radius:14px; font:inherit;
  font-size:20px; font-weight:700; cursor:pointer;
  background:var(--green); color:#fff;
}
.punchrow button.quiet { background:var(--surface); color:var(--ink); border:1px solid var(--line); }
.punchrow button:active { filter:brightness(.92); }
.punchrow button:disabled { background:var(--line); color:var(--muted); }
.punchnote { margin:0 2px 6px; font-size:15px; color:var(--muted); min-height:1.2em; }
.sos:active { filter:brightness(.92); }

.sosfull { position:fixed; inset:0; background:var(--red); color:#fff; z-index:30;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:16px; padding:32px 28px; text-align:center; }
.sosfull .t { font-size:30px; font-weight:700; margin:0; }
.sosfull .s { font-size:19px; margin:0; opacity:.95; }
.sosfull .c { font-size:52px; font-weight:300; margin:0; }
.sosfull .n { position:absolute; bottom:40px; left:28px; right:28px; font-size:15px; opacity:.85; }
.sosfull .go { background:#fff; color:#8E1B1B; max-width:320px; }

#toast { position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(12px);
  background:var(--ink); color:var(--canvas); font-size:15px; padding:11px 20px; border-radius:999px;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:40; }
#toast.on { opacity:1; transform:translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { * { animation:none !important; transition:none !important; } }

/* ---- いまいる場所 ---- */
/* 押さなくても記録はできる。必須に見せない見た目にする */
/* 見出しは置かない。選ばれていれば緑、選ばれていなければ薄い枠で足りる */
.place { padding:2px 2px 0; flex:0 0 auto; }
.place .chips { display:flex; gap:7px; }
.place button {
  font:inherit; font-size:15px; padding:7px 14px; border-radius:999px; cursor:pointer;
  background:var(--surface); color:var(--muted); border:1px solid var(--line);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:11em;
}
.place button.on {
  background:var(--green); color:#fff; border-color:var(--green); font-weight:700;
}
.place button.more { color:var(--muted); }
header a { color:var(--green); font-size:14px; text-decoration:none; font-weight:600; }
#recaptcha { display:flex; justify-content:center; margin-top:16px; }
#recaptcha:empty, #recaptcha[hidden] { display:none; }
.pane .sub { margin:-4px 0 20px; color:var(--muted); font-size:15px; }

/* チェックが入るまで送信は押せない。何が足りないのかを短く添える */
.pane .hint { margin:10px 0 0; color:var(--muted); font-size:14px; }

/* 開いた直後。ログイン済みかどうかが分かるまでの、静かな待ち時間 */
.boot { display:flex; align-items:center; justify-content:center; height:100dvh; }
.boot h1 { margin:0; font-size:30px; font-weight:700; color:var(--green); }
.boot[hidden] { display:none; }

/* 電話番号を入れる前に読めるところへ置く */
.pane .legal { margin:22px 0 0; font-size:13px; line-height:1.8; color:var(--muted); }
.pane .legal a { color:var(--muted); }

/* 言葉の切り替え。入口にだけ置く。畑の画面には出さない */
.langpick { margin:18px 0 0; }
.langpick select { font:inherit; font-size:15px; padding:8px 12px; border-radius:10px;
  border:1px solid var(--line); background:var(--surface); color:var(--muted); }
