:root {
  --accent: #0d9488;         /* 面の色 */
  --accent-dark: #0f766e;    /* 文字色に使う濃い方（白背景で5:1以上） */
  --accent-light: #ccfbf1;
  --accent-ink: #134e4a;
  --danger: #b91c1c;
  --ink: #17202a;
  --muted: #4b5563;          /* 白背景で7:1。補足文はこれ以上薄くしない */
  --faded: #6b7280;          /* 完了済みの文字。白背景で4.8:1 */
  --line: #d8dee6;
  --surface: #f4f6f8;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

.screen { display: none; }
.screen.active { display: block; }

:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
  border-radius: 6px;
}
[data-focus]:focus { outline: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

fieldset { border: 0; }
legend, .field-label {
  display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; padding: 0;
}

/* ---------- ヘッダー ----------
   進捗と滞在条件を同じ固定ブロックに入れ、本文と重ならないようにする */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: max(10px, env(safe-area-inset-top)) 16px 0;
}
.topbar-row { display: flex; align-items: center; gap: 12px; }
.btn-back {
  border: none; background: none; font-size: 16px; color: var(--accent-dark);
  padding: 8px 4px; min-height: 44px; cursor: pointer; font-weight: 700; font-family: inherit;
}
.progress-label { font-size: 16px; font-weight: 800; margin-left: auto; }
.progress-track {
  height: 10px; background: var(--surface); border-radius: 99px;
  margin: 8px 0 10px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s ease; }

.stay-bar {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center;
  margin: 0 -16px; padding: 10px 16px;
  background: var(--accent-light); border-top: 1px solid #a7ded5;
}
.stay-chip {
  background: var(--accent-dark); color: #fff; font-size: 14px; font-weight: 800;
  padding: 4px 12px; border-radius: 99px;
}
.stay-need { font-size: 14px; color: var(--accent-ink); }
.stay-need strong { font-weight: 800; }

/* ---------- ホーム ---------- */
.home { padding: 36px 20px 40px; text-align: center; }
.home h1 { font-size: 30px; font-weight: 800; }
.home .date { color: var(--muted); font-size: 16px; margin-top: 8px; }
.home .prop { color: var(--muted); font-size: 15px; margin-top: 2px; }

.field { text-align: left; margin: 24px 0 20px; }
.field > label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.field input[type="text"], .field input[type="number"], .field textarea {
  width: 100%; font-size: 17px; font-family: inherit;
  padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent-dark); }
.field textarea { min-height: 84px; resize: vertical; }

.status-line { font-size: 15px; color: var(--danger); min-height: 22px; text-align: left; margin-bottom: 8px; }

.btn-primary {
  display: block; width: 100%; min-height: 64px;
  background: var(--accent-dark); color: #fff; border: none; border-radius: 16px;
  font-size: 20px; font-weight: 800; font-family: inherit; cursor: pointer;
}
.btn-primary:active { background: #115e56; }
.btn-primary:disabled { background: #98a2b3; }
.btn-ghost {
  display: block; width: 100%; min-height: 52px; margin-top: 12px;
  background: #fff; color: var(--accent-dark); border: 2px solid var(--accent-dark);
  border-radius: 14px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.btn-ghost:disabled { color: var(--faded); border-color: var(--line); }

/* ---------- 人数・泊数 ---------- */
.num-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.num-btn {
  min-height: 56px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: 20px; font-weight: 800;
  font-family: inherit; cursor: pointer;
}
.num-btn.on { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.stepper { display: flex; align-items: center; gap: 14px; }
.step-btn {
  flex: 0 0 62px; height: 62px; border-radius: 14px;
  border: 2px solid var(--accent-dark); background: #fff; color: var(--accent-dark);
  font-size: 30px; font-weight: 800; font-family: inherit; line-height: 1; cursor: pointer;
}
.step-btn:disabled { border-color: var(--line); color: #98a2b3; }
.step-value {
  flex: 1; text-align: center; font-size: 30px; font-weight: 800;
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
}
.step-value small { font-size: 17px; font-weight: 700; color: var(--muted); }

/* ---------- 必要数 ---------- */
.needs-card { background: var(--accent-light); border-radius: 16px; padding: 16px 18px; margin-bottom: 24px; text-align: left; }
.needs-head { font-size: 15px; font-weight: 800; color: var(--accent-ink); margin-bottom: 10px; }
.needs-list { display: flex; flex-direction: column; gap: 6px; }
.needs-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; }
.needs-row span { color: var(--accent-ink); }
.needs-row strong { font-size: 21px; font-weight: 800; color: var(--accent-ink); }
.needs-note {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #8fd3c8;
  font-size: 13px; color: var(--accent-ink); line-height: 1.5;
}

/* ---------- チェック ---------- */
.check-body { padding: 18px 16px 120px; }
.intro { font-size: 16px; color: var(--ink); margin-bottom: 20px; }

.item { border-bottom: 1px solid var(--line); padding: 4px 0; }
.item:last-child { border-bottom: none; }

.check {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 16px 4px; background: none; border: none;
  font-family: inherit; font-size: 17px; text-align: left; color: var(--ink); cursor: pointer;
}
.check:active { background: var(--surface); }

.num {
  flex: 0 0 26px; width: 26px; height: 26px; margin-top: 4px;
  background: var(--surface); color: var(--muted);
  border-radius: 50%; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.box {
  flex: 0 0 34px; width: 34px; height: 34px; margin-top: 1px;
  border: 2.5px solid #6b7280; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; font-weight: 900;
}
.body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.label { font-weight: 700; line-height: 1.45; }
.hint { font-size: 14px; color: var(--muted); line-height: 1.5; }

.item.done .box { background: var(--accent-dark); border-color: var(--accent-dark); }
.item.done .num { background: var(--accent-light); color: var(--accent-ink); }
.item.done .label { color: var(--faded); text-decoration: line-through; }
.item.done .hint { color: var(--faded); }

/* ---------- 見本写真 ---------- */
.photo-thumb {
  display: block; width: calc(100% - 72px); margin: 0 0 16px 72px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 0; overflow: hidden; font-family: inherit; cursor: pointer; text-align: left;
}
.photo-thumb img { display: block; width: 100%; height: 140px; object-fit: cover; background: var(--surface); }
.photo-thumb .cap { display: block; padding: 9px 12px; font-size: 14px; font-weight: 700; color: var(--accent-dark); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.93);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; gap: 16px;
}
.lightbox img { max-width: 100%; max-height: 66vh; object-fit: contain; border-radius: 10px; }
.lb-caption { color: #fff; font-size: 18px; font-weight: 700; text-align: center; }
.lb-close { max-width: 240px; margin-top: 0; background: #fff; }

/* ---------- 報告 ---------- */
.record { padding: 22px 20px 120px; }
.record h2 { font-size: 25px; font-weight: 800; margin-bottom: 10px; }
.done-lead { font-size: 16px; color: var(--muted); margin-bottom: 14px; }
.done-caution { font-size: 14px; color: var(--muted); margin-top: 14px; }

.report-preview {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 15px; line-height: 1.7;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 20px;
}

.supply-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  min-height: 46px; padding: 9px 15px; border-radius: 99px;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  font-size: 15px; font-family: inherit; cursor: pointer;
}
.chip.on { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; font-weight: 700; }

.money { display: flex; align-items: center; gap: 10px; }
.money input { flex: 1; }
.money span { font-size: 18px; font-weight: 700; color: var(--muted); }

.file-btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; padding: 10px 14px;
  border: 2px dashed var(--accent-dark); border-radius: 14px;
  background: #fff; color: var(--accent-dark); font-size: 17px; font-weight: 700; cursor: pointer;
}
.file-btn:active { background: var(--accent-light); }
.receipt-status { font-size: 14px; color: var(--muted); margin-top: 8px; min-height: 20px; }
.receipt-box { margin-top: 4px; }
.receipt-empty { font-size: 14px; color: var(--muted); }
.receipt-img {
  display: block; width: 100%; max-height: 320px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px;
}
.receipt-note {
  font-size: 14px; color: var(--muted); line-height: 1.5;
  background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-top: 12px;
}

/* ---------- 下部バー ---------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

/* 読み込み失敗時 */
.fatal { padding: 40px; text-align: center; font-size: 17px; line-height: 1.8; }
