/* 物件探し依頼フォーム。デザインは ChatGPT のカンプ＋仕様（design/comp-sp-chatgpt.png・spec.md）に準拠 */
:root {
  --primary: #009B58;
  --primary-dark: #006B3D;
  --primary-light: #E8F7EE;
  --accent-line: #06C755;
  --text: #17252B;
  --text-sub: #64747B;
  --border: #DDE6E2;
  --bg: #FFFFFF;
  --bg-soft: #F3F8F4;
  --error: #DC3545;
  --required: #F06470;
  --optional: #EDF1F2;
  --focus-ring: rgba(0, 155, 88, .16);
  --shadow-card: 0 4px 18px rgba(23, 37, 43, .055);
  --shadow-footer: 0 -4px 16px rgba(23, 37, 43, .07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-family: "Zen Maru Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); background: var(--bg-soft); line-height: 1.7; font-weight: 500; }
input, select, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
#app { max-width: 480px; margin: 0 auto; background: var(--bg); min-height: calc(100vh - 56px); }

/* ヘッダー */
.hd { position: sticky; top: 0; z-index: 100; height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.hd .logo { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 17px; max-width: 480px; width: 100%; padding: 0 16px; }
.hd .logo b { color: var(--primary); font-weight: 900; }

/* ステップ表示 */
.steps { position: sticky; top: 56px; z-index: 90; background: #fff; padding: 14px 16px 10px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; }
.steps li { flex: 1; text-align: center; }
.steps button { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; min-height: 44px; cursor: default; }
.steps button:not([disabled]) { cursor: pointer; }
.steps i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #EDF1F2; color: var(--text-sub); transition: background .25s; }
.steps span { font-size: 11px; color: var(--text-sub); line-height: 1.2; }
.steps li.done i { background: var(--primary); color: #fff; font-size: 0; }
.steps li.done i::after { content: "✓"; font-size: 14px; }
.steps li.now i { background: var(--primary); color: #fff; }
.steps li.now span { color: var(--text); font-weight: 700; }
.bar { height: 4px; border-radius: 999px; background: #EDF1F2; margin-top: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .25s ease; }

/* フォーム本体 */
form { padding: 8px 16px 150px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.lead-box { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 14px; text-align: center; border-radius: 12px; padding: 10px 12px; margin: 4px 0 20px; }
.ttl { font-size: 22px; line-height: 1.45; margin: 16px 0 8px; }
.group { font-size: 13px; color: var(--primary-dark); background: var(--bg-soft); border-radius: 8px; padding: 6px 12px; margin: 28px 0 16px; }
.step > .group:first-child { margin-top: 8px; }
.field { margin-bottom: 24px; scroll-margin-top: 140px; }
.lbl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 700; line-height: 1.5; margin: 0 0 8px; padding-left: 10px; border-left: 4px solid var(--primary); }
.req, .opt { font-style: normal; font-size: 10px; line-height: 18px; height: 18px; padding: 0 6px; border-radius: 4px; font-weight: 700; }
.req { background: var(--required); color: #fff; }
.opt { background: var(--optional); color: var(--text-sub); }
.count { font-size: 12px; color: var(--primary); font-weight: 700; }
.hint { font-size: 12px; color: var(--text-sub); margin: -2px 0 10px; line-height: 1.6; }
.sub-lbl { font-size: 12px; font-weight: 700; color: var(--text-sub); margin: 14px 0 8px; }
.note { font-size: 12px; color: var(--text-sub); line-height: 1.6; }
.note a { color: var(--primary-dark); }
.center { text-align: center; }

input[type=text], input[type=tel], select, textarea {
  width: 100%; height: 52px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 0 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 12px 14px; line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: #A2AEB3; }
input:focus, select:focus, textarea:focus { border: 2px solid var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); padding-left: 13px; }
.field.bad input, .field.bad textarea { border: 2px solid var(--error); background: #FFF7F7; }
.err { color: var(--error); font-size: 12px; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
.err::before { content: "⚠ "; }

.search { display: flex; gap: 8px; }
.search input { flex: 1; padding-left: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2364747B' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 14px center; }
.search input:focus { padding-left: 39px; }
.btn-mini { flex: none; height: 52px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--primary); background: #fff; color: var(--primary-dark); font-weight: 700; }
.picked { background: var(--bg-soft); border-radius: 12px; padding: 4px 12px 12px; margin-top: 14px; }
.picked .sub-lbl { color: var(--primary-dark); }

.unit { display: flex; align-items: center; gap: 8px; }
.unit input { flex: 1; font-variant-numeric: tabular-nums; }
.unit.short input { max-width: 140px; flex: none; }
.unit span { flex: none; font-size: 14px; color: var(--text-sub); }

/* チップ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.chips button[aria-checked=true] { background: var(--primary-light); border: 2px solid var(--primary); color: var(--primary-dark); font-weight: 700; padding: 0 13px; }
.chips button[aria-checked=true]::before { content: "✓"; font-weight: 900; }
.chips.eq button { flex: 1; justify-content: center; }
.chips .more { display: none; }
.chips.open .more { display: inline-flex; }
.chips .tag { background: #fff; border-color: var(--primary); color: var(--primary-dark); font-weight: 700; }
.chips .tag::after { content: "×"; margin-left: 4px; color: var(--text-sub); }
.link-more { background: none; border: 0; color: var(--primary-dark); font-size: 13px; font-weight: 700; padding: 10px 0; min-height: 44px; }

/* タイル（駅徒歩） */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles button { min-height: 72px; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 20px; position: relative; }
.tiles button span { font-size: 13px; }
.tiles .wide { grid-column: span 2; }
.tiles button[aria-checked=true] { background: var(--primary-light); border: 2px solid var(--primary); color: var(--primary-dark); font-weight: 700; }
.tiles button[aria-checked=true]::after { content: "✓"; position: absolute; top: 4px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ラジオカード */
.radios { display: grid; gap: 8px; }
.radios button { min-height: 48px; border: 1px solid var(--border); border-radius: 10px; background: #fff; text-align: left; padding: 0 14px 0 44px; font-size: 14px; position: relative; }
.radios button::before { content: ""; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid #B8C4C0; background: #fff; }
.radios button[aria-checked=true] { background: var(--primary-light); border: 2px solid var(--primary); font-weight: 700; color: var(--primary-dark); padding-left: 43px; }
.radios button[aria-checked=true]::before { border-color: var(--primary); background: radial-gradient(var(--primary) 0 4px, #fff 5px); left: 13px; }

/* スイッチ・チェック */
.switch, .check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; cursor: pointer; }
.switch input, .check input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: #CBD5D1; position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }
.check span { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #B8C4C0; background: #fff; flex: none; display: grid; place-items: center; }
.check input:checked + span { background: var(--primary); border-color: var(--primary); }
.check input:checked + span::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 900; }
.switch input:focus-visible + span, .check input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus-ring); }
.pet { display: grid; grid-template-columns: 1fr 96px; gap: 8px; margin: 4px 0 8px 32px; }
.pet label { font-size: 12px; color: var(--text-sub); display: grid; gap: 4px; }

/* 確認 */
.card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.card-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-hd h3 { font-size: 14px; margin: 0; padding-left: 8px; border-left: 3px solid var(--primary); }
.edit { background: none; border: 0; color: var(--primary-dark); font-size: 13px; font-weight: 700; min-height: 44px; padding: 0 4px; }
.edit:hover, .edit:focus-visible { text-decoration: underline; }
.card dl { margin: 0; display: grid; grid-template-columns: 7.5em 1fr; gap: 4px 8px; font-size: 13px; }
.card dt { color: var(--text-sub); }
.card dd { margin: 0; word-break: break-all; }

/* 固定フッター */
.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; background: #fff; box-shadow: var(--shadow-footer); padding: 12px 16px calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 35% 1fr; gap: 10px; max-width: 480px; margin: 0 auto; }
.btn-back, .btn-next { height: 54px; border-radius: 999px; font-size: 16px; font-weight: 700; }
.btn-back { background: #fff; border: 1.5px solid var(--border); color: var(--text-sub); }
.btn-next { background: var(--primary); border: 0; color: #fff; box-shadow: 0 4px 12px rgba(0,155,88,.25); }
.btn-next::after { content: " →"; }
.btn-next[disabled] { opacity: .7; }
.btn-next.loading::after { content: ""; display: inline-block; width: 16px; height: 16px; margin-left: 8px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .8s linear infinite; }
.foot.first { grid-template-columns: 1fr; }
.foot.first .btn-back { display: none; }
.saved { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 11px; color: var(--text-sub); }

/* 送信後 */
#doneView { padding: 16px 16px 40px; }
.anim { text-align: center; margin: 8px 0 4px; }
.anim img { width: 100%; max-width: 320px; height: auto; }
.state[data-state=completed] .anim img { max-width: 240px; }
.state[data-state=searching] .anim img { animation: float 2.4s ease-in-out infinite; }
.big { font-size: 24px; line-height: 1.45; text-align: center; color: var(--primary-dark); margin: 4px 0 12px; font-weight: 700; }
.big .num { font-size: 44px; line-height: 1.15; letter-spacing: -.02em; color: var(--primary); font-variant-numeric: tabular-nums; }
.desc { font-size: 14px; text-align: center; color: var(--text-sub); margin: 0 0 20px; }
.dots { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); opacity: .3; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
.status-box, .member, .info { background: var(--bg-soft); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.status-box .sub-lbl, .member .sub-lbl { margin-top: 0; color: var(--primary-dark); }
.status { list-style: none; margin: 0; padding: 0; }
.status li { position: relative; padding: 6px 0 6px 30px; font-size: 14px; color: var(--text-sub); }
.status li::before { content: ""; position: absolute; left: 0; top: 9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #C5D0CC; background: #fff; }
.status li.done { color: var(--text); }
.status li.done::before { background: var(--primary); border-color: var(--primary); }
.status li.done::after { content: "✓"; position: absolute; left: 5px; top: 7px; color: #fff; font-size: 12px; font-weight: 900; }
.status li.now { color: var(--text); font-weight: 700; }
.status li.now::before { border: 2px dashed var(--primary); animation: spin 2s linear infinite; }
.no-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.no-row strong { font-size: 28px; line-height: 1.3; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.btn-copy { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.btn-line { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 10px 20px; border-radius: 999px; background: var(--accent-line); color: #fff; font-weight: 700; font-size: 16px; line-height: 1.4; text-decoration: none; box-shadow: 0 6px 16px rgba(6,199,85,.3); margin: 18px 0 8px; }
.line-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--accent-line); font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.info { background: #fff; border: 1px solid var(--border); margin-top: 18px; }
.info.soft { background: var(--bg-soft); border: 0; margin-top: 0; }
.info p, .info ul { font-size: 13px; margin: 0 0 8px; }
.info ul { padding-left: 1.2em; }
.info-ttl { font-weight: 700; color: var(--primary-dark); }
.btn-outline { display: block; text-align: center; height: 50px; line-height: 48px; border-radius: 999px; border: 1.5px solid var(--primary); color: var(--primary-dark); text-decoration: none; font-weight: 700; margin: 20px 24px 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 481px) { body { padding-bottom: 0; } #app { box-shadow: var(--shadow-card); } }
.linked { display: grid; gap: 4px; text-align: center; background: var(--primary-light); border: 2px solid var(--primary); border-radius: 14px; padding: 14px 16px; margin: 18px 0 8px; color: var(--primary-dark); }
.linked b { font-size: 17px; }
.linked span { font-size: 13px; }

/* LINE の中（LIFF）で開いたとき：マイページへの導線 */
.linked .btn-outline { margin: 10px 0 0; background: #fff; }
