/* ============================================================================
 * upload.css — scan entry page (Stage 2c). Mirrors iOS UploadView sections.
 * Tokens only (mp-design.css). 3 steps: image → about you → translate.
 * ========================================================================== */
/* 2026-07-09 社長指摘「Purchase history 下の余白が広すぎる」: mp-nav.js が body{padding-bottom:96px} を
   全ページ注入しており旧 134px と加算で 230px の二重クリアランスになっていた → 合計 134px (本来意図) に是正 */
.up-screen { min-height: 100dvh; background: var(--mp-bg); padding-bottom: 38px; }
.up-wrap { max-width: none;  /* 2026-07-09 社長指示「フル幅で」 */ margin: 0 auto; padding: 0 var(--mp-space-lg) var(--mp-space-base); }

.up-head { padding: var(--mp-space-lg) 0 var(--mp-space-base); }
.up-head .eyebrow { font-family: var(--mp-font-eyebrow); font-size: var(--mp-fs-eyebrow); letter-spacing:.14em;
  text-transform: uppercase; color: var(--mp-text-soft); }
.up-head h1 { font-family: var(--mp-font-display); font-size: calc(28px * var(--mp-scale)); font-weight: 700; color: var(--mp-text); margin-top: 4px; }
.up-head p { font-size: var(--mp-fs-caption); color: var(--mp-text-soft); margin: 6px 0 0; }

.up-section { background: var(--mp-surface); border: 1px solid var(--mp-border); border-radius: var(--mp-radius-lg);
  padding: var(--mp-space-lg); margin-bottom: var(--mp-space-xl); }
/* 2026-07-02 社長指示: ステップ1(画像読み込み)は iOS 同様 枠カードなし・地の上に直接 */
.up-section.sec1 { background: transparent; border: none; border-radius: 0; padding: 0; }
.up-section.sec1 > .label { font-family: var(--mp-font-display); font-weight: 500; font-size: calc(17px * var(--mp-scale)); }

/* 2026-07-02 社長指示: iOS UploadView.stepsIndicator と同一のステップ表示(①読み込み—②翻訳完了) */
.up-steps { display: flex; align-items: flex-start; justify-content: center; padding: var(--mp-space-sm) 0; }
.up-steps .st-node { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.up-steps .st-c { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--mp-bg-soft); border: 1px solid var(--mp-border); color: var(--mp-text-mute);
  font-family: var(--mp-font-num); font-size: 13px; font-weight: 700; }
.up-steps .st-l { font-size: calc(11px * var(--mp-scale)); color: var(--mp-text-mute); white-space: nowrap; } /* iOS UploadView stepNode body(11)×scale。旧+3px手調整はスケール非適用の対症療法だったため置換 */
.up-steps .st-node.active .st-c { background: var(--mp-cta-fill); border-color: transparent; color: #fff; }
.up-steps .st-node.active .st-l { color: var(--mp-text); font-weight: 600; }
/* 2026-07-14 社長指示: 読み込み↔翻訳完了の連結線を画面幅で可変に(旧 min(130px,34vw)固定は広い画面で不釣り合い)。
   flex で伸び、 上限720pxで中央寄せ = 狭い画面はフィット、 広い画面は程よく広がる。 */
.up-steps .st-line { flex: 1 1 auto; max-width: 720px; min-width: 80px; height: 1px; background: var(--mp-border); margin: 14px 4px 0; }
.up-section > .label { display:flex; align-items:center; gap:8px; font-family: var(--mp-font-display);
  font-weight: 500; font-size: calc(17px * var(--mp-scale)); color: var(--mp-text); margin-bottom: var(--mp-space-base); }
.up-section .num { width: 24px; height: 24px; border-radius: 50%; background: var(--mp-cta-fill); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-family: var(--mp-font-num); font-size: 13px; flex:none; }

/* image picker */
/* iOS uploadButtonLabel(filled) parity(2026-06-30/07-02 社長指示): 横並び→二段縦積み、柔赤塗り(primary 82%)・白文字・枠なし */
.img-actions { display: grid; grid-template-columns: 1fr; gap: var(--mp-space-sm); }
.img-actions.single { grid-template-columns: 1fr; }
.img-btn { display:flex; flex-direction:row; align-items:center; justify-content:center; gap:8px; padding: 14px;
  border: none; border-radius: var(--mp-radius-base);
  background: color-mix(in srgb, var(--mp-cta-fill) 82%, var(--mp-bg));
  color: #fff; font: inherit; font-size: calc(14px * var(--mp-scale)); font-weight: 600; cursor: pointer;
  transition: opacity var(--mp-anim-fast); }
.img-btn .ic { color: #fff; display:flex; }
.img-btn .ic svg { width: 20px; height: 20px; display: block; }
.img-btn:active { opacity: .88; }

/* simple-version promo box (iOS try_simple)
   2026-07-09 社長指示「iOSと同じデザイン・文字の詰まり具合に」: iOS 実装値へ機械合わせ
   (カードpadding 12 / 本文13px / 雷13px相当15px / アイコン間隔8 / 段落間6 / 行間詰め) */
.simple-promo { background: var(--mp-bg-soft); border-radius: var(--mp-radius-lg); padding: 12px; margin-bottom: var(--mp-space-base); }
.simple-promo .sp-body { display:flex; gap:8px; }
.simple-promo .sp-ic { color: var(--mp-primary); flex:none; margin-top:2px; }
.simple-promo .sp-ic svg { width:15px; height:15px; }
.simple-promo .sp-txt p { margin:0; font-size: calc(13px * var(--mp-scale)); color: var(--mp-text); line-height:1.4; letter-spacing:-0.3px; }
.simple-promo .sp-txt p.muted { color: var(--mp-text-soft); margin-top:6px; }
/* iOS parity(2026-06-30 社長指示): 赤背景→白背景・赤枠1.5px・赤字、高さ詰め(24→13)。
   2026-07-08 iOS parity(f84dbc5): #fff直書きはダークで白浮き → surface(テーマ追従、normalは白系で不変) */
.simple-promo .sp-cta { display:flex; align-items:center; justify-content:center; gap:6px; width:100%;
  padding: 13px; border:1.5px solid var(--mp-primary); border-radius: var(--mp-radius-base); background: var(--mp-surface);
  color: var(--mp-primary); font: inherit; font-weight:600; font-size:calc(17px * var(--mp-scale)); letter-spacing:-0.3px; cursor:pointer; text-decoration:none; margin-bottom: 14px; }
.simple-promo .sp-cta svg { width:18px; height:18px; }
.thumbs { display:grid; grid-template-columns:repeat(3, 1fr); gap: var(--mp-space-sm); margin-top: var(--mp-space-sm); }
.thumb { position: relative; width: auto; height: 100px; border-radius: var(--mp-radius-sm); overflow: hidden; border:1px solid var(--mp-border); }
.thumb img { width:100%; height:100%; object-fit: cover; }
/* 2026-07-08 社長指示「料理画像の横に + ボタン」: 追加タイル */
.thumb-add { display:flex; align-items:center; justify-content:center; border:1.5px dashed color-mix(in srgb, var(--mp-primary) 55%, transparent);
  background: color-mix(in srgb, var(--mp-primary) 5%, transparent); color: var(--mp-primary);
  font-size: calc(24px * var(--mp-scale, 1.35)); font-weight: 500; cursor: pointer; overflow: hidden; }
.thumb-add:active { transform: scale(.96); }
/* 2026-07-08 社長指示「バツ印が小さすぎ・見えにくい」: 20→28px + 白縁 + 影で明色画像上でも視認 (iOS parity) */
.thumb .rm { position:absolute; top:4px; right:4px; width:28px; height:28px; border-radius:50%;
  border:1.5px solid #fff; background: rgba(0,0,0,.65); color:#fff; cursor:pointer;
  font-size:17px; line-height:1; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.up-hint { font-size: calc(12px * var(--mp-scale)); color: var(--mp-text-faint); margin-top: var(--mp-space-sm); } /* iOS body(12)×scale */

/* fields */
.row { display:flex; flex-direction:column; gap:6px; margin-bottom: var(--mp-space-base); }
.row label { font-size: var(--mp-fs-caption); font-weight:500; color: var(--mp-text-soft); }
.row input, .row select { width:100%; font: inherit; font-size: var(--mp-fs-body); color: var(--mp-text);
  background: var(--mp-surface); border:1px solid var(--mp-border); border-radius: var(--mp-radius-base); padding: 12px 13px; }
.row input:focus, .row select:focus { outline:none; border-color: var(--mp-primary); }
.row-2 { display:grid; grid-template-columns: 1fr 1fr; gap: var(--mp-space-base); }

/* toggle list */
.toggle { display:flex; align-items:center; justify-content:space-between; padding: 10px 0; border-bottom:1px solid var(--mp-border-subtle); }
.toggle:last-child { border-bottom:none; }
.toggle .t-label { font-size: var(--mp-fs-body); color: var(--mp-text); }
.sw { position:relative; width:46px; height:28px; flex:none; }
.sw input { opacity:0; width:0; height:0; }
.sw .track { position:absolute; inset:0; background: var(--mp-border); border-radius: var(--mp-radius-pill); transition: background var(--mp-anim-fast); }
.sw .knob { position:absolute; top:3px; left:3px; width:22px; height:22px; background:#fff; border-radius:50%; transition: transform var(--mp-anim-fast); }
.sw input:checked + .track { background: var(--mp-primary); }
.sw input:checked + .track + .knob { transform: translateX(18px); }

/* segmented (menu type / mode) */
.seg { display:grid; grid-template-columns:1fr 1fr; gap: var(--mp-space-sm); }
.seg .opt { border:1px solid var(--mp-border); border-radius: var(--mp-radius-base); padding: var(--mp-space-base); cursor:pointer; }
.seg .opt.active { border-color: var(--mp-primary); background: var(--mp-primary-soft); }
.seg .opt .t { font-weight:700; font-size: var(--mp-fs-body); color: var(--mp-text); }
.seg .opt .s { font-size: var(--mp-fs-eyebrow); color: var(--mp-text-soft); margin-top:2px; }
.seg .opt .time { font-family: var(--mp-font-num); font-size: var(--mp-fs-eyebrow); color: var(--mp-primary-deep); margin-top:4px; }

/* sticky translate bar */
/* sits above the bottom nav (mp-nav ≈ 62px tall) */
.up-bar { position: fixed; left:0; right:0; bottom: calc(84px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--mp-bg) 38%); border:none;
  padding: 14px var(--mp-space-lg) var(--mp-space-sm); }
.up-bar .inner { max-width: none;  /* 2026-07-09 フル幅 */ margin:0 auto; }
.btn-translate { width:100%; display:flex; align-items:center; justify-content:center; gap:8px; font: inherit;
  font-size: var(--mp-fs-body-lg); font-weight:700; color:#fff; background: var(--mp-cta-fill); border:none;
  border-radius: var(--mp-radius-base); padding: 15px; cursor:pointer; transition: opacity var(--mp-anim-fast), transform var(--mp-anim-fast); }
.btn-translate:active { transform: scale(.99); }
.btn-translate[disabled] { opacity:.4; cursor:default; }
.bar-hint { text-align:center; font-size: var(--mp-fs-eyebrow); color: var(--mp-text-faint); margin-top:6px; }
.up-error { color: var(--mp-danger); font-size: var(--mp-fs-caption); text-align:center; margin-top:6px; }

.spinner { width:18px; height:18px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%;
  display:inline-block; animation: mp-spin .45s linear infinite; } /* 2026-07-14 社長指示: 回転を速く=頑張ってる感 */
@keyframes mp-spin { to { transform: rotate(360deg); } }

/* ===== iOS UploadView section 2 + finalize (after image added) ===== */
/* 2026-07-03 社長指示: セクション2も枠カードなし・全幅(iOS同様)、②と見出しの間隔を確保 */
#after-images .up-section { background: transparent; border: none; border-radius: 0; padding: 0; }
.sec2-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.sec2-head .label { display:flex; align-items:flex-start; gap:12px; font-family:var(--mp-font-body);
  font-weight:700; font-size:var(--mp-fs-body-lg); color:var(--mp-text); }
.sec2-head .label .num { margin-top:2px; }

/* 2026-07-20 社長指示「レストラン名を入力してください の文字サイズ、今日のご気分と合わせて」:
   ③ は .up-section > .label (display フォント 17px) が当たり、 ② の .sec2-head .label
   (body フォント 700 / --mp-fs-body-lg) と別体裁になっていた。 ② に揃える。
   ★間隔は #resto-card 側の margin-top:12px で確保 (※AI 自動検出の注記との分離)。 */
.up-section > .label.sec3-label {
  font-family: var(--mp-font-body); font-weight: 700; font-size: var(--mp-fs-body-lg);
  align-items: flex-start; gap: 12px;
}
.up-section > .label.sec3-label .num { margin-top: 2px; }
.reset-btn { background:none; border:none; color:var(--mp-text-soft); font:inherit; font-size:var(--mp-fs-caption);
  cursor:pointer; display:flex; align-items:center; gap:4px; flex:none; white-space:nowrap; padding:4px; }
.reset-btn svg { width:14px; height:14px; }

/* inline preference rows: icon + label + input */
.pref-row { display:flex; align-items:center; gap:8px; border:1px solid var(--mp-border); border-radius:var(--mp-radius-base);
  padding:2px 12px; margin-bottom:var(--mp-space-sm); background:var(--mp-bg-soft); }
.pref-row .pic { color:var(--mp-primary); flex:none; display:flex; }
.pref-row .pic svg { width:18px; height:18px; }
.pref-row .plabel { font-size:calc(12px * var(--mp-scale)); font-weight:500; color:var(--mp-text-mute); flex:none; min-width:64px; }
.pref-row input { flex:1; border:none; background:none; font:inherit; font-size:var(--mp-fs-body); color:var(--mp-text); padding:8px 0; min-width:0; }
/* 2026-07-05 a11y(WCAG 2.4.7): キーボードfocus時のみ可視リング(マウス時は非表示で見た目維持) */
.pref-row input:focus-visible { outline: 2px solid var(--mp-primary); outline-offset: 1px; }
.pref-row input::placeholder { color:var(--mp-text-faint); }

/* finalize: pink-tinted group box around destination/currency + translate + estimate */
.finalize { border:1.5px solid color-mix(in srgb, var(--mp-primary) 35%, transparent); border-radius:var(--mp-radius-lg); background:none;
  padding:var(--mp-space-base); margin-top:var(--mp-space-base); }
.fin-box { border:1px solid var(--mp-border); border-radius:var(--mp-radius-base); background:var(--mp-surface); overflow:hidden; margin-bottom:var(--mp-space-base); }
.fin-row { display:flex; align-items:center; gap:10px; padding:12px 14px; }
.fin-row .fic { color:var(--mp-primary); flex:none; display:flex; } .fin-row .fic svg { width:18px; height:18px; }
.fin-row .flabel { font-family:var(--mp-font-eyebrow); font-size:calc(14px * var(--mp-scale)); color:var(--mp-text-mute);
  flex:0 1 auto; min-width:0; line-height:1.35; } /* 2026-07-09 iOS parity: 長い値のためラベルも折返し可に (旧 nowrap) */
/* 2026-07-03「日本円がずれる」: flexのmin-width:auto(=最長optionの内容幅が下限)でselectが
   行の右端からはみ出していた → min-width:0+縮小可で行内に収める(値は右揃えのまま) */
.fin-row select { margin-left:auto; flex:0 1 auto; min-width:0; border:none; background:none; font:inherit;
  font-size:calc(15px * var(--mp-scale)); font-weight:600;
  color:var(--mp-text); text-align:right; text-align-last:right; cursor:pointer; max-width:55%; }
/* 2026-07-09 社長指示「インドネシアルピアが見えない→改行して表示」: select は単行しか描けないため
   折返し可能な表示スパン+透明 select オーバーレイ (値は右揃えで複数行、iOS と同じ見え方) */
.fin-row .fsel { position:relative; margin-left:auto; flex:0 1 auto; min-width:0; max-width:58%;
  display:flex; align-items:center; gap:4px; }
.fin-row .fsel-disp { min-width:0; font-size:calc(15px * var(--mp-scale)); font-weight:600; color:var(--mp-text);
  text-align:right; line-height:1.35; }
.fin-row .fsel-chev { flex:none; width:14px; height:14px; color:var(--mp-text-faint); }
.fin-row .fsel select { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; margin:0; max-width:none; }
.fin-divider { height:1px; background:var(--mp-border); margin:0 14px; }
.btn-translate-inline { width:100%; display:flex; align-items:center; justify-content:center; gap:8px; font:inherit;
  font-size:calc(16px * var(--mp-scale)); font-weight:600; color:#fff; background:var(--mp-cta-fill); border:none;
  border-radius:var(--mp-radius-base); padding:14px; cursor:pointer; transition:opacity var(--mp-anim-fast); }
.btn-translate-inline:active { transform:scale(.99); }
.btn-translate-inline[disabled] { opacity:.4; cursor:default; }
.estimate-text { font-size:calc(12px * var(--mp-scale)); font-weight:600; color:var(--mp-primary); line-height:1.5; margin-top:var(--mp-space-sm); }

/* ============================================================
   2026-07-17 社長指示「③ レストラン名を入力してください (任意)」= FOOD-PAAN 対策 (iOS UploadRestaurantSection と対)
   翻訳前ゆえ選択を預かるだけ。 文字は全て calc(Npx * var(--mp-scale)) (生px禁止)。
   ============================================================ */
.resto-pick { width:100%; display:flex; align-items:center; gap:10px; margin-top:8px;
  padding:12px 14px; border:none; border-radius:var(--mp-radius-base); background:var(--mp-bg-soft);
  cursor:pointer; text-align:left; font-family:var(--mp-font-body); }
.resto-pick .ic { flex:none; width:16px; height:16px; color:var(--mp-primary); }
.resto-pick .ic svg { width:16px; height:16px; display:block; }
.resto-pick .tx { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.resto-pick .tx > span { font-size:calc(15px * var(--mp-scale)); color:var(--mp-text-soft);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.resto-pick.picked .tx > span { color:var(--mp-text); font-weight:600; }
.resto-pick .tx small { font-size:calc(11px * var(--mp-scale)); color:var(--mp-text-soft);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.resto-pick .chev { flex:none; font-size:calc(14px * var(--mp-scale)); color:var(--mp-text-soft); }

/* 店検索シート。 result-actions.js が動的注入する .mp-sheet 系は結果画面専用で upload には無いため、
   同じ体裁をここに持つ(結果画面の定義と一致させてある。 片方を直す時はもう片方も見ること)。 */
.mp-sheet-bg { position:fixed; inset:0; z-index:70; background:rgba(0,0,0,.4); display:flex; align-items:flex-end; }
.mp-sheet { width:100%; max-height:85vh; overflow:auto; background:var(--mp-bg);
  border-radius:var(--mp-radius-lg) var(--mp-radius-lg) 0 0; padding:var(--mp-space-lg); }
.mp-sheet h3 { font-family:var(--mp-font-display); font-size:var(--mp-fs-title); margin:0 0 var(--mp-space-base); }
.mp-sheet .field { margin-bottom:var(--mp-space-base); }
.mp-sheet input { width:100%; font:inherit; padding:11px; border:1px solid var(--mp-border);
  border-radius:var(--mp-radius-base); background:var(--mp-surface); color:var(--mp-text); }
.mp-sheet .cancel { width:100%; margin-top:8px; padding:12px; border:none; background:none;
  color:var(--mp-text-soft); font-size:calc(14px * var(--mp-scale)); cursor:pointer; }
.mp-place-res { border:1px solid var(--mp-border-subtle); border-radius:var(--mp-radius-base); margin-top:6px; }
.mp-place-res div { padding:12px; border-bottom:1px solid var(--mp-border-subtle); cursor:pointer;
  font-size:var(--mp-fs-caption); }
.mp-place-res div:last-child { border-bottom:none; }
