:root {
  --bg: #fffdf5; --card: #ffffff; --text: #3d3a33; --sub: #8a8576;
  --lemon: #f6e27a; --lemon-deep: #e8c93a; --green: #6fa86b; --pink: #f3a6bd; --line: #ece6d3;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif; font-size: 16px; line-height: 1.6; }
#app { max-width: 520px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 20px; margin: 8px 0 16px; }
h2 { font-size: 17px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.sub { color: var(--sub); font-size: 13px; }
.loading { text-align: center; color: var(--sub); margin-top: 40vh; }
input[type=text], input[type=number], input[type=time], select, textarea {
  width: 100%; font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-family: inherit;
}
textarea { min-height: 80px; }
button { font-family: inherit; font-size: 16px; cursor: pointer; }
.btn { background: var(--green); color: #fff; border: none; border-radius: 999px; padding: 12px 20px; width: 100%; font-weight: bold; }
.btn:disabled { opacity: .5; }
.btn-sub { background: #fff; color: var(--green); border: 1px solid var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; }
.chip.on { background: var(--lemon); border-color: var(--lemon-deep); font-weight: bold; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.label { font-weight: bold; margin: 12px 0 6px; display: block; }
.check { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.check input { width: 22px; height: 22px; }
.daybar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.daybar button { background: none; border: none; font-size: 22px; padding: 4px 12px; color: var(--green); }
.daybar button:disabled { color: var(--line); }
.status { text-align: center; font-size: 13px; color: var(--sub); min-height: 20px; }
.error { color: #c0392b; font-size: 14px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; background: none; border: none; padding: 8px 0 10px; font-size: 11px; color: var(--sub); position: relative; }
.tabs button .ic { display: block; font-size: 22px; }
.tabs button.on { color: var(--green); font-weight: bold; }
.badge { position: absolute; top: 4px; right: 22%; background: #e74c3c; color: #fff; border-radius: 999px; font-size: 10px; padding: 0 6px; }
.water { text-align: center; }
.water .tree { font-size: 56px; line-height: 1.2; }
.water .ml { font-size: 24px; font-weight: bold; }
.forest { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; text-align: center; }
.forest > * { font-family: inherit; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; font-size: 26px; }
.forest small { display: block; font-size: 10px; color: var(--sub); }
.forest button { cursor: pointer; }
.forest button:active { background: var(--lemon); }
.meal img { width: 100%; border-radius: 12px; display: block; margin-bottom: 8px; }
.advice { background: #f4f9ef; border-radius: 12px; padding: 12px; white-space: pre-wrap; font-size: 15px; }
.comment { border-left: 4px solid var(--lemon-deep); padding-left: 12px; white-space: pre-wrap; }
.comment.new { background: #fff8d6; }
.chart-box { height: 200px; }
.celebrate { background: var(--lemon); border-radius: 12px; padding: 8px; text-align: center; font-weight: bold; }

/* ふりかえりの「今週のまとめ」 */
.wsum-title { font-weight: bold; margin-bottom: 8px; }
.wsum dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
.wsum dt { color: var(--sub); font-size: 14px; white-space: nowrap; }
.wsum dd { margin: 0; font-size: 15px; }
.daycard .wsum { background: #fffbea; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }

/* すばやく2回タップしても画面が拡大されないように */
button, .chip, label, input, select, textarea, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* 水分のボタンは大きめにして、続けて押しやすく */
.water .row { justify-content: center; gap: 10px; }
.water .chip { min-width: 76px; min-height: 48px; font-size: 18px; font-weight: bold; -webkit-user-select: none; user-select: none; }
.water .chip:active { background: var(--lemon); }
