:root {
  --c-main: #1f7a4d;
  --c-main-d: #145c38;
  --c-main-l: #e7f3ec;
  --c-accent: #d9822b;
  --c-text: #1d2521;
  --c-muted: #66706b;
  --c-line: #dde3df;
  --c-bg: #f4f6f5;
  --c-card: #fff;
  --c-err: #c62828;
  --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px; line-height: 1.6;
}
h1 { font-size: 1.25rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--c-muted); }
.note { color: var(--c-muted); font-size: .82rem; margin-top: .75rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

.hd { background: var(--c-main); color: #fff; position: sticky; top: 0; z-index: 20; }
.hd-in { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: baseline; gap: 10px; }
.logo { font-weight: 800; letter-spacing: .12em; }
.hd-sub { font-size: .8rem; opacity: .9; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 140px; }
.card { background: var(--c-card); border-radius: var(--r); padding: 20px 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.sec-title { font-size: .9rem; font-weight: 700; color: var(--c-main-d); border-left: 4px solid var(--c-main); padding-left: 8px; margin: 20px 0 10px; }
.sec-title:first-child { margin-top: 0; }

/* ステップ表示 */
.steps { position: sticky; top: 44px; z-index: 15; background: #fff; border-bottom: 1px solid var(--c-line); }
.steps ol { list-style: none; display: flex; max-width: 640px; margin: 0 auto; padding: 8px 8px; gap: 4px; }
.steps li { flex: 1; text-align: center; font-size: .68rem; color: var(--c-muted); }
.steps li::before { content: attr(data-n); display: block; width: 22px; height: 22px; line-height: 22px; margin: 0 auto 2px; border-radius: 50%; background: var(--c-line); color: #fff; font-weight: 700; font-size: .72rem; }
.steps li.on { color: var(--c-main-d); font-weight: 700; }
.steps li.on::before, .steps li.done::before { background: var(--c-main); }

/* フォーム */
.fld { display: block; margin-bottom: 14px; }
.lbl { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 4px; }
.lbl em { font-style: normal; font-size: .7rem; background: var(--c-err); color: #fff; border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.lbl em.opt { background: var(--c-muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=search], select {
  width: 100%; font-size: 16px; padding: 11px 12px; border: 1px solid #c4ccc7; border-radius: 8px; background: #fff; color: inherit;
  -webkit-appearance: none; appearance: none; min-height: 46px;
}
select { background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus { outline: 2px solid var(--c-main); outline-offset: 0; border-color: var(--c-main); }
input[readonly] { background: #f0f2f1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .fld { margin-bottom: 14px; }
.hint { font-size: .78rem; color: var(--c-muted); margin-top: 3px; }
.ferr { color: var(--c-err); font-size: .8rem; margin-top: 3px; }
.invalid input, .invalid select { border-color: var(--c-err); background: #fff6f6; }
.err { color: var(--c-err); background: #fdecec; border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--c-line); border-radius: 8px; margin-bottom: 14px; background: #fafbfa; cursor: pointer; }
.chk input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--c-main); }
.chk.invalid { border-color: var(--c-err); }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 1rem; font-weight: 700; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--c-main); background: #fff; color: var(--c-main-d); cursor: pointer; min-height: 48px; text-decoration: none; }
.btn.primary { background: var(--c-main); color: #fff; }
.btn.primary:disabled { background: #9fb8aa; border-color: #9fb8aa; }
.btn.block { display: flex; width: 100%; }
.btn.sm { font-size: .82rem; padding: 6px 12px; min-height: 34px; }
.btn.link { border: none; background: none; padding: 4px 6px; min-height: 0; font-size: .85rem; text-decoration: underline; }

/* セグメント（注文区分・口座種別） */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.seg label { border: 2px solid var(--c-line); border-radius: 10px; padding: 10px 8px; text-align: center; background: #fff; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg b { display: block; font-size: .98rem; }
.seg small { color: var(--c-muted); font-size: .72rem; }
.seg label.on { border-color: var(--c-main); background: var(--c-main-l); }
.seg.invalid label { border-color: var(--c-err); }

/* 商品 */
.plist { display: grid; gap: 12px; }
.prod { background: #fff; border-radius: var(--r); padding: 12px; display: grid; grid-template-columns: 96px 1fr; gap: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 2px solid transparent; }
.prod.sel { border-color: var(--c-main); }
.prod img { width: 96px; height: 96px; object-fit: contain; background: #fafafa; border-radius: 8px; }
.prod .noimg { width: 96px; height: 96px; border-radius: 8px; background: #eef1ef; display: flex; align-items: center; justify-content: center; color: #9aa59f; font-size: .7rem; }
.pname { font-weight: 700; line-height: 1.35; }
.pname small { display: block; font-weight: 400; color: var(--c-muted); font-size: .78rem; }
.pcat { font-size: .72rem; color: var(--c-muted); margin: 2px 0 6px; white-space: pre-line; }
.prices { display: flex; gap: 10px; flex-wrap: wrap; font-size: .82rem; }
.prices span { white-space: nowrap; }
.prices .act { color: var(--c-main-d); font-weight: 700; font-size: .95rem; }
.prices .ip { color: var(--c-muted); }
.pfoot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pfoot details { flex: 1; font-size: .8rem; }
.pfoot summary { color: var(--c-main-d); cursor: pointer; }
.pdetail { grid-column: 1 / -1; font-size: .8rem; background: #f7f9f8; border-radius: 8px; padding: 10px; white-space: pre-line; }
.pdetail h4 { margin: 0 0 2px; font-size: .78rem; color: var(--c-main-d); }
.pdetail p { margin-bottom: 8px; }
.qty { display: flex; align-items: center; border: 1px solid var(--c-line); border-radius: 999px; overflow: hidden; flex: none; }
.qty button { width: 40px; height: 38px; border: none; background: #fff; font-size: 1.2rem; color: var(--c-main-d); cursor: pointer; }
.qty button:disabled { color: #c9d0cc; }
.qty span { min-width: 28px; text-align: center; font-weight: 700; }

/* 下部の固定バー */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--c-line); z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
.bar-in { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.bar .sum { flex: 1; font-size: .78rem; line-height: 1.35; color: var(--c-muted); }
.bar .sum b { font-size: 1.1rem; color: var(--c-text); }
.bar .btn { min-width: 120px; }
.bar .back { min-width: 0; }

/* 郵便番号の候補・銀行検索 */
.cands { border: 1px solid var(--c-line); border-radius: 8px; overflow: hidden; margin: -6px 0 14px; }
.cands button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: none; border-bottom: 1px solid var(--c-line); background: #fff; font-size: .92rem; cursor: pointer; }
.cands button:last-child { border-bottom: none; }
.cands button small { color: var(--c-muted); margin-left: 6px; }
.chosen { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--c-main); background: var(--c-main-l); border-radius: 8px; margin-bottom: 14px; }
.chosen small { color: var(--c-muted); margin-left: 6px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.quick button { font-size: .8rem; padding: 6px 10px; border: 1px solid var(--c-line); border-radius: 999px; background: #fff; cursor: pointer; }

/* 確認画面 */
.conf { margin: 0; }
.conf div { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef1ef; font-size: .92rem; }
.conf dt { color: var(--c-muted); font-size: .82rem; }
.conf dd { margin: 0; word-break: break-all; }
.conf-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.conf-hd h2 { margin: 0; }
.olines { font-size: .9rem; }
.olines div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef1ef; }
.olines .tot { font-weight: 700; font-size: 1.05rem; border-bottom: none; }
.brand { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 4px; padding: 1px 8px; background: var(--c-main-l); color: var(--c-main-d); margin-left: 6px; }
.free { color: var(--c-accent); font-weight: 700; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--c-main); color: #fff; font-size: 2rem; line-height: 64px; margin: 0 auto 12px; }
.overlay { position: fixed; inset: 0; background: rgba(255,255,255,.8); z-index: 50; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; font-weight: 700; color: var(--c-main-d); }
.spin { width: 42px; height: 42px; border: 4px solid var(--c-main-l); border-top-color: var(--c-main); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
