/* 食べ痩せダイエット 確認チェックリスト
   クリーム／ベージュ系 + 白い角丸カード。配色は元資料（PDF）から採取。 */
:root {
  --bg: #f6efe4;
  --card: #ffffff;
  --beige: #e9d9c1;
  --label: #d9bb9b;
  --line: #e4d8c8;
  --text: #5f4e44;
  --muted: #8a776b;
  --accent: #b5835a;      /* ボタン・進捗バー */
  --accent-dark: #9a6b45;
  --done: #6f9a6b;        /* 確認済み */
  --done-bg: #edf4ea;
  --todo: #b97a79;        /* 未確認（元資料の「推奨」の色） */
  --todo-bg: #f8eeec;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(120, 90, 60, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Zen Maru Gothic", "BIZ UDPGothic", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px calc(40px + env(safe-area-inset-bottom));
  outline: none;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

/* 言葉の途中で改行しない。改行できるのは <wbr>（app.js の phrase()）の位置だけ。
   入りきらない場合だけ、はみ出し防止のため途中でも改行する */
.phrase { word-break: keep-all; overflow-wrap: anywhere; }


/* ===== トップ ===== */
.top-hero { padding: 16px 4px 16px; }
.top-hero h1 { font-size: 27px; line-height: 1.35; margin-top: 10px; letter-spacing: .04em; }

/* ブランド表記：「食べ痩せダイエット」「by miwa」の2行とも左揃え */
.brand {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  line-height: 1.25; color: var(--accent-dark);
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .08em; }
.brand-by { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin-top: 1px; }
.hero-text { font-size: 15px; color: var(--muted); margin-top: 8px; }

.progress-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
}
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.progress-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.progress-count { font-size: 15px; font-weight: 700; }
.progress-count strong { font-size: 28px; color: var(--accent-dark); margin-right: 2px; }
.progress-bar {
  height: 12px; margin-top: 8px; border-radius: 999px; background: #efe5d7; overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; border-radius: inherit; background: var(--accent);
  transition: width .4s ease;
}
.progress-note { margin-top: 10px; font-size: 14px; color: var(--muted); }
.progress-note strong { color: var(--todo); }
.is-complete .progress-bar span { background: var(--done); }
.complete-msg {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
  background: var(--done-bg); color: #4d7a4a; font-weight: 700; font-size: 17px;
  border-radius: 12px; padding: 12px 14px;
}
.complete-icon {
  flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--done); color: #fff;
  display: grid; place-items: center;
}
.complete-icon svg { width: 20px; height: 20px; }

.item-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 14px 14px 14px; text-decoration: none; min-height: 76px;
  border: 2px solid transparent;
  transition: transform .1s ease;
}
.item-card:active { transform: scale(.98); }
.item-card:focus-visible { border-color: var(--accent); outline: none; }
.item-no {
  flex: 0 0 38px; height: 38px; border-radius: 50%;
  background: var(--beige); color: var(--accent-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.item-card.is-done .item-no { background: var(--done-bg); color: var(--done); }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-title { font-weight: 700; font-size: 17px; line-height: 1.45; }
.item-lead { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.item-arrow { flex: 0 0 auto; font-size: 26px; line-height: 1; color: #c9b8a5; padding-left: 2px; }
.item-status {
  align-self: flex-start; margin-bottom: 3px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px;
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
}
.item-status svg { width: 14px; height: 14px; }
.item-status.done { background: var(--done-bg); color: #4d7a4a; }
.item-status.todo { background: var(--todo-bg); color: #a3605f; }

.storage-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.7; padding: 0 4px; }
.storage-warn { margin-top: 8px; font-size: 13px; color: #a3605f; padding: 0 4px; }

/* ===== 説明ページ ===== */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  margin: -12px -16px 0; padding: 10px 16px;
  background: rgba(246, 239, 228, 0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.back-link {
  text-decoration: none; font-weight: 700; font-size: 15px; color: var(--accent-dark);
  padding: 8px 12px 8px 4px; min-height: 44px; display: inline-flex; align-items: center;
}
.pager { font-size: 14px; font-weight: 700; color: var(--muted); }

/* 説明ページ上部の確認状況メーター（トップの進捗バーと同じ配色・1行のコンパクト表示） */
.mini-progress {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 8px 14px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
}
.mini-label { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.mini-progress .progress-bar { flex: 1; min-width: 50px; height: 10px; margin-top: 0; }
.mini-count { flex: 0 0 auto; font-size: 13px; font-weight: 700; white-space: nowrap; }
.mini-count strong { font-size: 17px; color: var(--accent-dark); margin-right: 1px; }
.mini-progress.is-complete .progress-bar span { background: var(--done); }
.mini-progress.is-complete .mini-count strong { color: var(--done); }
.item-head { padding: 12px 4px 14px; }
.item-head h1 { font-size: 24px; line-height: 1.4; display: flex; gap: .3em; }
.item-mark { flex: 0 0 auto; }

/* 説明画像はほぼ画面幅いっぱいに表示（文字を拡大せず読めるように左右の余白を小さく） */
.sheets { display: flex; flex-direction: column; gap: 12px; margin: 0 -8px; }
.sheet {
  margin: 0; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.sheet img { display: block; width: 100%; height: auto; }
/* fullWidth の項目：画像を画面幅いっぱいに表示（アプリ側の角丸・影・左右余白をなくす） */
.sheets.is-full { margin: 0 -16px; gap: 8px; }
.sheets.is-full .sheet { border-radius: 0; box-shadow: none; }


.confirm-card {
  margin-top: 22px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; border: 2px solid var(--line);
  transition: border-color .2s ease, background-color .2s ease;
}
.confirm-card.is-checked { border-color: var(--done); background: #fbfdfa; }
.confirm {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  min-height: 56px; position: relative;
}
.confirm input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.confirm .box {
  flex: 0 0 36px; height: 36px; border-radius: 10px; border: 2.5px solid #c9b8a5; background: #fff;
  display: grid; place-items: center; color: transparent; transition: all .15s ease;
}
.confirm .box svg { width: 26px; height: 26px; }
.confirm input:checked + .box { background: var(--done); border-color: var(--done); color: #fff; }
.confirm input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.confirm-text { font-size: 19px; font-weight: 700; }
.btn-next {
  margin-top: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 54px; padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; line-height: 1.4;
  text-decoration: none; box-shadow: 0 3px 0 var(--accent-dark);
}
.btn-next span { font-size: 17px; }
.btn-next small { font-size: 12.5px; font-weight: 500; opacity: .92; }
.btn-next:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn-next[hidden] { display: none; }

.item-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 18px;
}
.item-nav a {
  font-size: 14px; font-weight: 700; color: var(--accent-dark); text-decoration: none;
  min-height: 44px; display: flex; align-items: center; padding: 0 4px;
}
.item-nav a:nth-child(2) { justify-content: center; }
.item-nav a:last-child { justify-content: flex-end; }

.noscript { padding: 24px; }

@media (min-width: 768px) {
  #app { padding-top: 24px; }
  .sheets, .sheets.is-full { margin: 0; }
  .sheets.is-full .sheet { border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
