/* ============================================================
   貴金属査定システム — 高級テーマ（黒 × ダークネイビー × ゴールド）
   ------------------------------------------------------------
   見本画像（1672×941）に合わせた見た目だけの上書きです。
   app.css の後に読み込みます。機能・処理・データには触れません。
   既存のクラス名にそのまま被せています。
============================================================ */

:root {
  /* 見本の基準値。既存のトークンを塗り替えて全体を寄せます */
  --bg:        #010813;
  --bg2:       #0b1422;
  --card:      rgba(10,18,31,.88);
  --card2:     #091423;
  --text:      #e9edf3;
  --muted:     #9da6b3;
  --line:      rgba(128,143,164,.30);

  --theme:      #e5ad32;
  --theme-dark: #b57a18;
  --on-theme:   #11151a;

  /* 追加 */
  --gold:        #e5ad32;
  --gold-light:  #f3c54b;
  --gold-dark:   #b57a18;
  --purple:      #7453d6;
  --green:       #41c96b;
  --border:      rgba(128,143,164,.30);
  --border-gold: rgba(229,173,50,.65);
  --bg-input:    #091423;
  --bg-panel:    #07101c;

  --radius-card:   15px;
  --radius-button: 9px;
}

/* ============ 地：ネイビーのグラデーション＋ごく薄い流線 ============ */
html, body { background: #010813; }
body {
  background:
    radial-gradient(1200px 680px at 12% -8%, rgba(24,38,62,.55), transparent 60%),
    radial-gradient(1200px 760px at 108% 4%, rgba(30,26,60,.40), transparent 55%),
    linear-gradient(160deg, #06101d 0%, #030a15 45%, #01060e 100%);
  background-attachment: fixed;
}
/* 薄いゴールドの波形。目立たせない（opacity 0.05前後） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'><g fill='none' stroke='%23e5ad32' stroke-width='1.4'><path d='M-50 240 C 300 120 560 360 900 240 S 1500 120 1700 260'/><path d='M-50 430 C 340 300 620 560 980 430 S 1520 300 1700 450'/><path d='M-50 640 C 300 520 640 760 1000 630 S 1540 520 1700 660'/><path d='M-50 120 C 360 40 640 220 1020 120 S 1540 40 1700 150'/></g></svg>");
  background-size: cover;
}
/* 本体は地より前に置く */
#appShell { position: relative; z-index: 1; }

/* ============ ヘッダー・ナビ（見本に合わせて暗く・控えめに） ============ */
.header {
  background: linear-gradient(180deg, rgba(9,17,29,.96), rgba(4,10,20,.96));
  color: var(--gold-light);
  border-bottom: 1px solid var(--border);
  padding: 8px 40px;
}
.header .brand { color: var(--gold-light); }
.header .brand img { background: transparent; }
.user-chip { background: rgba(229,173,50,.12); color: var(--gold-light); }
.icon-btn { color: var(--gold-light); }
.admin-mark { color: var(--gold); }

.nav {
  background: linear-gradient(180deg, rgba(6,13,24,.96), rgba(3,9,18,.96));
  border-bottom: 1px solid var(--border);
  padding: 0 34px;
}
.nav button { color: var(--muted); }
.nav button.active { color: var(--gold-light); }

/* ============ 全体の器：横いっぱい・見本の余白 ============ */
.main {
  max-width: none;
  padding: 26px 40px 34px;
  margin: 0;
}

/* ============================================================
   ① 上部 相場カード（4枚・横一列）
============================================================ */
.souba-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 16px;
}
.souba-cell {
  position: relative; overflow: hidden; min-width: 0;
  min-height: 132px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);           /* 左だけの帯をやめて全周の枠に */
  background: linear-gradient(135deg, rgba(13,22,37,.96), rgba(3,11,23,.96));
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset;
}
/* 金属ごとのアクセント */
.souba-cell .s-ic { flex: 0 0 auto; width: 62px; display: flex; justify-content: center; }
.souba-cell .s-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.souba-cell .s-name {
  font-size: 17px; font-weight: 600; color: #cdd4de; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.souba-cell .s-val {
  font-size: clamp(26px, 2.63vw, 45px); font-weight: 600; line-height: 1.02; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap;
}
.souba-cell .s-val small { font-size: clamp(14px, 1.25vw, 20px); font-weight: 500; color: var(--muted); margin-left: 8px; }
.souba-cell .s-diff  { font-size: clamp(13px, 1vw, 16px); font-variant-numeric: tabular-nums; }
.souba-cell .s-manual{ font-size: clamp(13px, 1vw, 16px); color: var(--muted); }
.souba-cell.empty .s-val { font-size: clamp(24px, 2.4vw, 40px); color: #c6cdd6; }

/* 金 */
.souba-cell.m-gold {
  border-color: var(--border-gold);
  background:
    radial-gradient(150px 120px at 8% 0%, rgba(229,173,50,.22), transparent 70%),
    linear-gradient(135deg, rgba(28,23,12,.96), rgba(8,10,16,.96));
  box-shadow: 0 0 22px rgba(229,173,50,.10), 0 0 0 1px rgba(229,173,50,.10) inset;
}
.souba-cell.m-gold .s-val { color: var(--gold-light); }
/* プラチナ */
.souba-cell.m-pt .s-val { color: #e7ecf2; }
/* パラジウム */
.souba-cell.m-pd {
  border-color: rgba(116,83,214,.60);
  background:
    radial-gradient(160px 130px at 8% 0%, rgba(116,83,214,.22), transparent 70%),
    linear-gradient(135deg, rgba(18,16,34,.96), rgba(6,9,20,.96));
}
.souba-cell.m-pd .s-val { color: #d7ccff; }
/* 銀 */
.souba-cell.m-silver .s-val { color: #dfe4ea; }

.s-up { color: #ff6b6b; }
.s-down { color: #7cc4f0; }

/* インゴットの絵 */
.ingot { width: 66px; height: 48px; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }

/* ============ 相場の出所 ============ */
.souba-meta {
  font-size: 18px; color: #aab1bc; margin: 2px 2px 0;
}

/* ============================================================
   ② STEP ナビ（4分割・つながった帯）
============================================================ */
.stepper {
  display: flex; gap: 6px; overflow: visible;
  margin: 18px 0 0;
}
.st-step {
  flex: 1 1 0; min-width: 0; min-height: 105px;
  flex-direction: row; justify-content: center; gap: 14px;
  background: linear-gradient(180deg, rgba(11,20,34,.92), rgba(5,12,22,.92));
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted); font-size: 20px; font-weight: 600;
  /* 右側が「>」型につながって見える形（控えめに） */
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%, 22px 50%);
  padding: 0 10px 0 26px;
}
.stepper .st-step:first-child {
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%);
  padding-left: 22px;
}
.st-step .st-no {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--muted); font-weight: 700; font-size: 20px;
}
.st-step .st-lab { display: inline-flex; align-items: center; gap: 8px; }
.st-step .st-lab i { font-size: 18px; }

/* 既定（未選択）は落ち着いたグレー。急かさない */
.st-step.miss { color: var(--muted); border-color: var(--border); }
.st-step.miss .st-no { background: rgba(255,255,255,.04); color: var(--muted); }

/* 選択中：ゴールド */
.st-step.on {
  color: var(--gold-light); border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(35,28,12,.9), rgba(16,14,10,.9));
  box-shadow: 0 0 18px rgba(229,173,50,.10);
}
.st-step.on .st-no {
  background: rgba(229,173,50,.10); border-color: var(--border-gold); color: var(--gold-light);
}
.st-step.on .st-lab { font-weight: 700; }

/* 済み（④など）：緑 */
.st-step.done { color: #cfe9d7; border-color: rgba(65,201,107,.45); }
.st-step.done .st-no { background: rgba(65,201,107,.14); border-color: rgba(65,201,107,.55); color: var(--green); }
.st-step.done .st-lab i { color: var(--green); font-size: 18px; }

/* ============================================================
   ③ メイン入力パネル（見えている工程カード＝1つ）
============================================================ */
#stepInput .step-card {
  position: relative; overflow: hidden;
  margin-top: 22px;
  padding: 34px 38px 46px;
  background: rgba(4,13,25,.94);
  border: 1px solid var(--border-gold);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-card);
  box-shadow: none;
}
/* 右側の薄いゴールド装飾線（::before に。::after はスクロール末尾の余白に使う） */
#stepInput .step-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='400' viewBox='0 0 600 400'><g fill='none' stroke='%23e5ad32' stroke-width='1' opacity='0.10'><path d='M620 40 C 480 90 520 210 380 250 S 200 330 120 400'/><path d='M640 120 C 520 160 540 260 430 300'/></g></svg>");
  background-repeat: no-repeat; background-position: right top; background-size: 460px auto;
}
/* スクロールする工程で、末尾の要素（コンビの「行を足す」など）が枠の下ぎわに
   めり込まないよう、確実な余白を入れる（Safariは容器のpadding-bottomを
   スクロール末尾で無視することがあるため、中身側に余白を持たせる） */
#stepInput .step-card::after { content: ""; display: block; height: 8px; }
#stepInput .step-card > * { position: relative; z-index: 1; }

/* タイトル */
#stepInput .step-card h3 {
  font-size: 31px; font-weight: 700; color: #e7b33f;
  margin: 0 0 0; display: flex; align-items: center; gap: 18px;
}
#stepInput .step-card h3 .step-no {
  width: 48px; height: 48px; margin-right: 0; font-size: 24px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
  color: #11151a; box-shadow: 0 2px 10px rgba(229,173,50,.25);
}

/* 説明文章 */
#stepInput .step-card > .form-hint {
  font-size: 19px; line-height: 1.8; color: #aeb5c0; font-weight: 400;
  margin: 22px 0 0; max-width: 1120px;
}
#stepInput .step-card > .form-hint b { color: #cdd4de; font-weight: 700; }

/* ============ 入力の一列（5ブロック） ============ */
/* 上ぞろえにすること。下ぞろえ（flex-end）だと、いちばん背の高い
   コンビ商品の枠に他の4列が引きずられて下がり、説明文のすぐ下に
   150px以上の空きができる（2026-09-11 利用者の指摘）。 */
#stepInput .inline-row {
  display: flex; align-items: flex-start; flex-wrap: nowrap;
  gap: 26px; margin-top: 10px;
}
#stepInput .inline-item { gap: 12px; }
#stepInput .inline-item > .form-label {
  font-size: 19px; font-weight: 600; color: #e1e5eb; margin: 0;
}
/* おおよその割り当て：写真16 / 総重量15 / 石22 / 区分27 / コンビ20 */
#stepInput .inline-item:nth-child(1) { flex: 0 1 16%; }
#stepInput .inline-item:nth-child(2) { flex: 0 1 15%; }
#stepInput .inline-item:nth-child(3) { flex: 0 1 22%; }
#stepInput .inline-item:nth-child(4) { flex: 1 1 27%; }
#stepInput .inline-item:nth-child(5) { flex: 0 1 20%; }

/* はかりの写真（点線枠） */
#stepInput .inline-item #weightPhoto { min-height: 0; display: block; }
#stepInput #weightPhoto .ph-cell { gap: 10px; }
#stepInput #weightPhoto .ph-btn {
  width: 100%; min-width: 190px; height: 75px; min-height: 75px;
  border: 1px dashed rgba(222,173,59,.75);
  background: rgba(8,15,27,.7);
  border-radius: var(--radius-button);
  color: var(--gold-light); font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
#stepInput #weightPhoto .ph-btn i { color: var(--gold-light); font-size: 20px; }

/* 総重量・石 の数値欄 */
#stepInput .inline-item .big-input.w-num,
#stepInput .stone-cell .big-input {
  width: 100%;
  height: 76px; min-height: 76px;
  background: #091424;
  border: 1px solid rgba(110,128,151,.45);
  border-radius: var(--radius-button);
  font-size: 40px !important; font-weight: 700;
  text-align: right; padding: 0 22px 0 16px;
  color: #e2b354;
}
#stepInput .inline-item .w-num { width: 100%; }

/* 石など：入力＋電卓 */
#stepInput .stone-cell { gap: 10px; align-items: stretch; }
#stepInput .stone-cell .big-input { flex: 1 1 auto; }
#stepInput .stone-cell .calc-btn {
  flex: 0 0 62px; width: 62px; height: 76px; min-height: 76px;
  background: #0b1422; border: 1px solid rgba(181,143,61,.45);
  border-radius: var(--radius-button); color: var(--gold-light); font-size: 22px;
}

/* 区分 3択 */
#stepInput .kind-tabs { gap: 12px; }
#stepInput .kind-tabs button {
  flex: 1 1 0; min-width: 0; height: 70px; min-height: 70px;
  border-radius: var(--radius-button);
  border: 1px solid rgba(110,128,151,.40);
  background: #0a1423; color: #c1c6cf; font-size: 18px; font-weight: 600;
}
#stepInput .kind-tabs button.active {
  background: linear-gradient(180deg, #f1c04b, #d99c22);
  border-color: rgba(229,173,50,.65); color: #11151a; font-weight: 700;
  box-shadow: 0 2px 12px rgba(229,173,50,.22);
}

/* コンビ商品 */
#stepInput .inline-item .combi-btn {
  width: 100%; height: 70px; min-height: 70px;
  background: #0b1422; border: 1px solid rgba(181,143,61,.45);
  border-radius: var(--radius-button); color: #d4d7de; font-size: 18px; font-weight: 600;
  justify-content: center;
}

/* ============================================================
   ④ 下部 操作バー
============================================================ */
#stepInput .step-foot {
  /* 画面下に貼り付けて、はみ出ても「次へ／確認へ」が必ず押せるようにする */
  position: sticky; bottom: 0; z-index: 20;
  margin-top: 18px; padding: 14px 0 10px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(2,8,16,0), rgba(2,8,16,.94) 24%);
  gap: 14px; flex-wrap: nowrap;
}
/* 左：戻る・次へ */
#stepInput .step-foot #stepPrev {
  width: 160px; min-width: 160px; height: 70px;
  background: #081320; border: 1px solid rgba(110,128,151,.40);
  color: #d7dbe2; border-radius: var(--radius-button); font-size: 19px; font-weight: 600;
  justify-content: center;
}
#stepInput .step-foot #stepNext {
  width: 310px; min-width: 310px; height: 70px;
  background: linear-gradient(180deg, #f0c24d, #dda32c);
  color: #11151a; border-radius: var(--radius-button);
  font-size: 22px; font-weight: 700; justify-content: center;
  box-shadow: 0 3px 16px rgba(229,173,50,.24);
}
#stepInput .step-foot #commitBtn {
  height: 70px; min-width: 260px; border-radius: var(--radius-button);
  background: linear-gradient(180deg, #f0c24d, #dda32c); color: #11151a;
  font-size: 20px; font-weight: 700; justify-content: center;
}

/* 右：やり直す・確認へ・見本・お客様画面 */
/* 右側の3つ（やり直す・確認へ・一覧）は高さ・幅を統一 */
#stepInput .step-foot #draftClearBtn,
#stepInput .step-foot #toConfirmBtn,
#stepInput .step-foot #toListBtn {
  height: 70px; min-height: 70px; width: 152px; min-width: 152px;
  padding: 0 12px; justify-content: center;
  border-radius: var(--radius-button); font-size: 18px; font-weight: 600;
}
/* やり直す・一覧：ダーク */
#stepInput .step-foot #draftClearBtn,
#stepInput .step-foot #toListBtn {
  background: #081320; border: 1px solid rgba(110,128,151,.40); color: #d7dbe2;
}
#stepInput .step-foot #draftClearBtn i,
#stepInput .step-foot #toListBtn i { color: #c9cfd8; }
/* 確認へ：緑 */
#stepInput .step-foot #toConfirmBtn {
  background: linear-gradient(180deg, #276c38, #184b2b);
  border: 1px solid rgba(89,190,104,.70); color: #eafff0; font-weight: 700;
}
#stepInput .step-foot #toConfirmBtn i { color: #bff2cd; }

/* ============================================================
   レスポンシブ：横長を保つ。狭くなったら破綻せず折り返す
============================================================ */
@media (max-width: 1360px) {
  .souba-cell { padding: 0 18px; gap: 12px; }
  .souba-cell .s-ic { width: 54px; }
  .ingot { width: 62px; height: 44px; }
  .main { padding: 22px 26px 28px; }
}
/* iPad横（1194〜1366が実機）：入力の一列を横に保ちつつ、中身を素直に縮める */
@media (max-width: 1400px) {
  #stepInput .inline-item .big-input.w-num,
  #stepInput .stone-cell .big-input { font-size: clamp(26px, 3vw, 40px) !important; padding: 0 14px; }
  #stepInput .kind-tabs button { font-size: 16px; white-space: nowrap; padding: 0 6px; }
  #stepInput #weightPhoto .ph-btn { font-size: 16px; white-space: nowrap; }
}
@media (max-width: 1180px) {
  #stepInput .inline-row { gap: 16px; }
  #stepInput .inline-item:nth-child(1) { flex: 0 1 15%; }
  #stepInput .inline-item:nth-child(2) { flex: 0 1 14%; }
  #stepInput .inline-item:nth-child(3) { flex: 0 1 20%; }
  #stepInput .inline-item:nth-child(4) { flex: 1 1 28%; }
  #stepInput .inline-item:nth-child(5) { flex: 0 1 18%; }
  #stepInput #weightPhoto .ph-btn { min-width: 0; }
  #stepInput .stone-cell .calc-btn { flex-basis: 54px; width: 54px; }
}
/* これより狭いときだけ、崩さず折り返す（縦1列にはしない） */
@media (max-width: 1000px) {
  .main { padding: 18px 18px 26px; }
  #stepInput .inline-row { flex-wrap: wrap; gap: 18px; }
  #stepInput .inline-item:nth-child(1) { flex: 1 1 40%; }
  #stepInput .inline-item:nth-child(2) { flex: 1 1 26%; }
  #stepInput .inline-item:nth-child(3) { flex: 1 1 26%; }
  #stepInput .inline-item:nth-child(4) { flex: 1 1 55%; }
  #stepInput .inline-item:nth-child(5) { flex: 1 1 40%; }
  #stepInput .step-foot { flex-wrap: wrap; }
  .st-step { font-size: 16px; }
}
@media (max-width: 760px) {
  .souba-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   仕上げ：金属の光沢・奥行き（見本の高級感に寄せる）
============================================================ */
.ingot { width: 70px; height: 50px; filter: drop-shadow(0 5px 7px rgba(0,0,0,.5)); }

/* 相場カード：上辺にごく薄い光の線、金カードは弱い発光を強める */
.souba-cell::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}
.souba-cell.m-gold::before { background: linear-gradient(90deg, transparent, rgba(246,200,76,.5), transparent); }

/* 金色のボタン・丸は「磨いた金属」に：上辺の内側ハイライト＋弱い発光 */
#stepInput .step-card h3 .step-no,
#stepInput .kind-tabs button.active,
#stepInput .step-foot #stepNext,
#stepInput .step-foot #commitBtn {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 6px rgba(120,80,10,.25),
              0 3px 14px rgba(229,173,50,.22);
}
#stepInput .step-foot #toConfirmBtn {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 3px 14px rgba(30,90,45,.28);
}
/* パネル内側の淡い光（上が少し明るい） */
#stepInput .step-card {
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(229,173,50,.06), transparent 60%),
    rgba(4,13,25,.94);
}

/* ============================================================
   画面に収める：縦が短い端末（iPad横・ノート）向けに詰める
   ------------------------------------------------------------
   縦に余裕がある大画面は、見本どおりのゆったりした寸法のまま。
   縦が足りないときだけ、比率を保ったまま全体を縮めて1画面に収めます。
============================================================ */
@media (max-height: 1080px) {
  .main { padding: 14px 40px 16px; }
  .souba-cell { min-height: 104px; }
  .souba-cell .s-val { font-size: clamp(24px, 2.4vw, 40px); }
  .ingot { width: 62px; height: 44px; }
  .souba-meta { font-size: 16px; margin-top: 0; }
  .stepper { min-height: 0; margin-top: 12px; }
  .st-step { min-height: 74px; font-size: 18px; }
  .st-step .st-no { width: 40px; height: 40px; font-size: 18px; }

  #stepInput .step-card { margin-top: 12px; padding: 18px 30px 22px; }
  #stepInput .step-card h3 { font-size: 26px; gap: 14px; }
  #stepInput .step-card h3 .step-no { width: 42px; height: 42px; font-size: 21px; }
  #stepInput .step-card > .form-hint { font-size: 16px; line-height: 1.55; margin-top: 12px; }
  #stepInput .inline-row { margin-top: 10px; }
  #stepInput .inline-item { gap: 8px; }
  #stepInput .inline-item > .form-label { font-size: 17px; }
  #stepInput .inline-item .big-input.w-num,
  #stepInput .stone-cell .big-input { height: 62px; min-height: 62px; font-size: clamp(24px, 2.3vw, 34px) !important; }
  #stepInput .stone-cell .calc-btn { height: 62px; min-height: 62px; }
  #stepInput .kind-tabs button { height: 60px; min-height: 60px; }
  #stepInput .inline-item .combi-btn { height: 60px; min-height: 60px; }
  #stepInput #weightPhoto .ph-btn { height: 62px; min-height: 62px; }

  #stepInput .step-foot { margin-top: 14px; padding: 14px 0 6px; }
  #stepInput .step-foot #stepPrev { height: 60px; }
  #stepInput .step-foot #stepNext { height: 60px; }
  #stepInput .step-foot #toConfirmBtn,
  #stepInput .step-foot #draftClearBtn,
  #stepInput .step-foot #toListBtn { height: 60px; min-height: 60px; }
}

/* さらに縦が短いとき（ノート1366×768 など） */
@media (max-height: 780px) {
  .header { padding: 5px 40px; }
  .nav button { padding: 9px 18px 8px; min-height: 42px; }
  .main { padding: 10px 34px 12px; }
  .souba-cell { min-height: 92px; }
  .souba-cell .s-val { font-size: clamp(22px, 2.2vw, 36px); }
  .ingot { width: 50px; height: 38px; }
  .st-step { min-height: 64px; }
  #stepInput .step-card { padding: 14px 26px 18px; margin-top: 10px; }
  #stepInput .step-card h3 { font-size: 24px; }
  #stepInput .step-card > .form-hint { margin-top: 10px; }
  #stepInput .inline-row { margin-top: 8px; }
}


/* ============================================================
   相場カードのアイコンを実写にする（違和感なく：暗い背景を枠へ溶かす）
============================================================ */
.souba-cell .s-ic { width: 92px; position: relative; }
.souba-cell .s-photo {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center 47%;
  display: block; border-radius: 12px;
  /* 写真の暗い縁を丸くフェードさせ、地金だけがカードに浮かぶように */
  -webkit-mask-image: radial-gradient(ellipse 70% 78% at 50% 48%, #000 50%, rgba(0,0,0,0) 100%);
          mask-image: radial-gradient(ellipse 70% 78% at 50% 48%, #000 50%, rgba(0,0,0,0) 100%);
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.5));
}
/* 実写が入っているときは、描いたバー（フォールバック）を隠す */
.souba-cell .s-ic .s-photo ~ .s-fallback { display: none; }
/* 実写に合わせて、見出しは少しだけ詰める（パラジウムを1行に収める） */
.souba-cell .s-name { font-size: 16px; }
/* 「本日の相場 K24」が主、（金・税込）は小さく添える */
.souba-cell .s-name .s-sub { font-size: .72em; font-weight: 500; opacity: .75; margin-left: 2px; }
@media (max-height: 1080px) { .souba-cell .s-ic { width: 80px; } }
@media (max-width: 1360px) { .souba-cell .s-ic { width: 78px; } }

/* ============================================================
   相場カードのアイコンを「見本似の情景SVG」に合わせる（縦長）
============================================================ */
.souba-cell .s-ic { width: 76px; }
.souba-cell .ingot {
  width: 100%; height: auto; aspect-ratio: 100 / 122;
  filter: drop-shadow(0 6px 11px rgba(0,0,0,.55));
}
@media (max-height: 1080px) { .souba-cell .s-ic { width: 66px; } }
@media (max-width: 1360px)  { .souba-cell .s-ic { width: 66px; } }

/* ============================================================
   スマホ縦（幅が狭い端末）
   ------------------------------------------------------------
   PC・iPad横は横長のまま。狭い縦画面では、無理に横へ詰めず
   素直に縦へ積み替えます。※このブロックは最後に置いて優先させます。
============================================================ */
@media (max-width: 640px) {
  .header { padding: 8px 14px; }
  .header .brand span { font-size: 15px; }
  .nav { padding: 0 6px; }
  .nav button span { font-size: 12px; }
  .main { padding: 12px 12px 22px; }

  /* 相場カード：2列（2×2）にして、中身をコンパクトに */
  .souba-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
  .souba-cell { min-height: 0; padding: 12px 12px; gap: 9px; align-items: center; }
  .souba-cell .s-ic { width: 40px; }
  .souba-cell .ingot { filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
  .souba-cell .s-name { font-size: 11.5px; }
  .souba-cell .s-val { font-size: 22px; }
  .souba-cell .s-val small { font-size: 11px; margin-left: 3px; }
  .souba-cell.empty .s-val { font-size: 20px; }
  .souba-cell .s-diff, .souba-cell .s-manual { font-size: 10.5px; }
  .souba-meta { font-size: 12px; }

  /* ステップ：チェブロンをやめて小さな横並び（入り切らなければ横スクロール） */
  .stepper { gap: 5px; overflow-x: auto; margin-top: 12px; }
  .st-step {
    min-height: 50px; font-size: 11px; gap: 4px; padding: 0 4px;
    clip-path: none; border-radius: 8px; flex: 1 1 0; min-width: 0;
  }
  .st-step .st-lab { white-space: nowrap; }
  .stepper .st-step:first-child { clip-path: none; padding: 0 4px; }
  .st-step .st-no { width: 26px; height: 26px; font-size: 12px; flex: 0 0 auto; }
  .st-step .st-lab i { font-size: 12px; }

  /* パネル */
  #stepInput .step-card { padding: 16px 14px 18px; margin-top: 12px; border-left-width: 3px; }
  #stepInput .step-card h3 { font-size: 20px; gap: 10px; }
  #stepInput .step-card h3 .step-no { width: 34px; height: 34px; font-size: 17px; }
  #stepInput .step-card > .form-hint { font-size: 14px; line-height: 1.6; margin-top: 12px; }

  /* 入力5ブロック：縦積み・全幅（横へ詰めない） */
  #stepInput .inline-row { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 14px; }
  #stepInput .inline-item,
  #stepInput .inline-item:nth-child(1),
  #stepInput .inline-item:nth-child(2),
  #stepInput .inline-item:nth-child(3),
  #stepInput .inline-item:nth-child(4),
  #stepInput .inline-item:nth-child(5) { width: 100%; flex: none; }
  #stepInput .inline-item > .form-label { font-size: 16px; }
  #stepInput .inline-item .big-input.w-num,
  #stepInput .stone-cell .big-input { height: 58px; min-height: 58px; font-size: 30px !important; }
  #stepInput .stone-cell .calc-btn { height: 58px; min-height: 58px; flex-basis: 58px; width: 58px; }
  #stepInput .kind-tabs button { height: 54px; min-height: 54px; font-size: 16px; }
  #stepInput .inline-item .combi-btn { height: 54px; min-height: 54px; }
  #stepInput #weightPhoto .ph-btn { height: 58px; min-height: 58px; }

  /* 下部バー：固定はやめて折り返し。次へ・確認へを大きく */
  #stepInput .step-foot {
    position: static; flex-wrap: wrap; gap: 10px; padding: 14px 0 6px; background: transparent;
  }
  .step-foot-sp { display: none; }
  #stepInput .step-foot #stepPrev { width: auto; min-width: 0; flex: 1 1 34%; height: 54px; font-size: 16px; }
  #stepInput .step-foot #stepNext { width: auto; min-width: 0; flex: 1 1 58%; height: 54px; font-size: 18px; }
  #stepInput .step-foot #commitBtn { width: 100%; min-width: 0; height: 56px; }
  #stepInput .step-foot #toConfirmBtn,
  #stepInput .step-foot #draftClearBtn,
  #stepInput .step-foot #toListBtn { flex: 1 1 30%; width: auto; min-width: 0; height: 52px; padding: 0 10px; }

  /* 確認画面などの2列フォームは1列に */
  .form-grid { grid-template-columns: 1fr; }
}

/* 横スクロール封じ。overflow-x:hidden は sticky を壊すので使わず、
   はみ出しは各所の minmax(0,1fr) と折り返しで防ぐ。 */
html, body { max-width: 100%; }

/* ============================================================
   工程パネルは丈のまま出す（パネルの中に閉じ込めない）
   ------------------------------------------------------------
   以前はパネルの中だけをスクロールさせていたが、iPad（縦が短い）では
   パネルが小さく潰れ、品位の金属タブ（金）が下に隠れて見えなくなった。
   そこでパネルは中身の丈のまま出し、足りなければページごとスクロールする。
   下の操作バーは sticky で常に画面下に貼り付くので、次へ／確認へは
   いつでも押せる（＝収まりと見やすさを両立）。
============================================================ */
#stepInput .step-card { overflow: visible; max-height: none; }
/* sticky の操作バーに最後の中身が隠れないよう、下に余白をとる */
#stepInput { padding-bottom: 4px; }

/* ============================================================
   ②X線：刻印の確認・磁気の確認は必ず1段に収める（折り返さない）
============================================================ */
#stepInput .st-tabs, #stepInput .mg-tabs { flex-wrap: nowrap; gap: 8px; }
#stepInput .st-tabs button, #stepInput .mg-tabs button {
  flex: 1 1 0; min-width: 0; white-space: nowrap;
  padding-left: 6px; padding-right: 6px;
}
/* スマホ縦だけは、刻印6つを1段に詰めると小さすぎるので折り返しを許す */
@media (max-width: 640px) {
  #stepInput .st-tabs { flex-wrap: wrap; }
  #stepInput .st-tabs button { flex: 1 1 30%; }
}

/* ============================================================
   ②X線：刻印の確認と磁気の確認を「横に並べて1段」にまとめる
   （タブレット・PC。スマホ縦は縦積みに戻す）
============================================================ */
#dStampMagnet { display: flex; gap: 22px; align-items: flex-start; }
#dStampMagnet > .form-row { margin-bottom: 0; }
#dStampMagnet > .form-row:nth-child(1) { flex: 4 1 0; min-width: 0; }   /* 刻印（6つ） */
#dStampMagnet > .form-row:nth-child(2) { flex: 1.4 1 0; min-width: 0; } /* 磁気（2つ） */
#dStampMagnet .st-tabs button, #dStampMagnet .mg-tabs button { font-size: 15px; }
@media (max-width: 640px) {
  #dStampMagnet { flex-direction: column; gap: 0; }
  #dStampMagnet > .form-row { margin-bottom: 14px; }
}

/* ②X線：測定器を撮る（左）と 品位の金属選択（右）を1段に */
#stepInput .tester-metal-row {
  display: flex; gap: 26px; align-items: flex-end; margin-top: 14px; flex-wrap: wrap;
}
#stepInput .tester-metal-row > #testerPhoto { flex: 0 0 auto; }
#stepInput .tester-metal-row > .metal-select { flex: 1 1 auto; min-width: 0; }
#stepInput .tester-metal-row > .metal-select .form-label { margin-bottom: 8px; }
@media (max-width: 640px) {
  #stepInput .tester-metal-row { flex-direction: column; gap: 12px; align-items: stretch; }
}

/* ②X線：測定器を撮るボタンを大きく（縦に高く）＝はかりを撮ると同じ撮影ボックス */
#stepInput .tester-metal-row { align-items: flex-end; }
#stepInput .tester-metal-row > #testerPhoto { width: 210px; flex: 0 0 auto; }
#stepInput #testerPhoto .ph-cell { display: block; }
#stepInput #testerPhoto .ph-btn {
  width: 100%; min-width: 0; height: 94px; min-height: 94px;
  border: 1px dashed rgba(222,173,59,.75);
  background: rgba(8,15,27,.7);
  border-radius: var(--radius-button);
  color: var(--gold-light); font-size: 17px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
#stepInput #testerPhoto .ph-btn i { color: var(--gold-light); font-size: 26px; }
@media (max-width: 640px) {
  #stepInput .tester-metal-row > #testerPhoto { width: 100%; }
}

/* ②X線 品位一覧：品位コード（K24 など）を赤で目立たせる */
#stepInput .purity-btn .p-name { color: #ff6b6b; }

/* ②X線 刻印・磁気の説明文：1行固定＋少し小さく */
#dStampMagnet .form-hint { font-size: 12px; white-space: nowrap; }

/* ②X線 説明文を12pxに（この工程だけ） */
#stepInput .step-card > .form-hint.s2-hint { font-size: 12px; line-height: 1.6; }

/* ②X線 下部のコンビ「行を足す」＋説明を、もう少し小さく */
#stepInput .toolbar .combi-btn {
  padding: 7px 14px; min-height: 38px; font-size: 13.5px; border-radius: 8px;
}
#stepInput .toolbar .combi-btn i { font-size: 12px; }
#stepInput .toolbar .form-hint { font-size: 12px; }

/* ②X線 品位一覧：中の案内文（使わない設定・相場なし等）は格子の全幅に広げて1行に */
#purityGrid > .form-hint,
#purityGrid > .notice { grid-column: 1 / -1; }
#purityGrid > .form-hint { padding: 12px 2px; white-space: nowrap; }

/* ============================================================
   お客様画面：同じタブの全画面オーバーレイ（新しいウィンドウは開かない）
============================================================ */
#displayOverlay {
  position: fixed; inset: 0; z-index: 200; background: #0A0C0F;
}
#displayOverlay.hidden { display: none !important; }
#displayOverlay iframe { width: 100%; height: 100%; border: 0; display: block; }
.disp-close {
  position: fixed; top: 14px; left: 14px; z-index: 201;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(10,18,31,.85); color: #e9edf3;
  border: 1px solid rgba(229,173,50,.5); border-radius: 999px;
  padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(4px);
}
.disp-close:hover { background: rgba(20,30,46,.95); }
.disp-close i { color: var(--gold-light); }

/* ============================================================
   ①②撮影後：撮った画像を「枠の中」に重ねて1段目に固定する
   （サムネイルを次の段に伸ばして行を折り返させない）
============================================================ */
#stepInput #weightPhoto .ph-cell.has,
#stepInput #testerPhoto .ph-cell.has { position: relative; display: block; }
/* 画像は枠いっぱいに敷く */
#stepInput #weightPhoto .ph-cell.has .ph-thumb.big,
#stepInput #testerPhoto .ph-cell.has .ph-thumb.big {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  object-fit: cover; border-radius: var(--radius-button); z-index: 1;
}
/* 「撮り直す」＝枠そのもの。画像の上に重ね、文字は下に小さく */
#stepInput #weightPhoto .ph-cell.has .ph-btn,
#stepInput #testerPhoto .ph-cell.has .ph-btn {
  position: relative; z-index: 2; width: 100%;
  background: linear-gradient(transparent 48%, rgba(0,0,0,.62));
  border-style: solid; border-color: rgba(229,173,50,.65);
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9);
  justify-content: center; align-items: flex-end; padding-bottom: 7px; gap: 6px;
}
#stepInput #weightPhoto .ph-cell.has .ph-btn i,
#stepInput #testerPhoto .ph-cell.has .ph-btn i { color: #fff; }
/* × 削除は右上に重ねる */
#stepInput #weightPhoto .ph-cell.has .ph-del,
#stepInput #testerPhoto .ph-cell.has .ph-del {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  width: 30px; height: 30px; min-width: 0; min-height: 0; padding: 0;
  background: rgba(0,0,0,.55); color: #fff;
  border: 1px solid rgba(255,255,255,.3); border-radius: 50%;
}
/* 手動「読み取る」は隠す（撮影時に自動で読み取り、撮り直しでも再読み取りされる） */
#stepInput #weightPhoto .ph-cell.has .ph-read,
#stepInput #testerPhoto .ph-cell.has .ph-read { display: none; }
