/* 商品画像の一括整備の体験版。色は common/base.css のトークンだけを使う */
.pi { max-width: 1200px; margin: 0 auto; padding: 20px var(--gutter) 56px; }

/* 作業の流れ（1→2→3） */
.pi-steps { display: flex; align-items: center; gap: 10px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; margin: 0 auto 22px; box-shadow: var(--shadow-s); }
.pi-steps button { display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 8px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.pi-steps button:disabled { cursor: default; opacity: .55; }
.pi-steps button:not(:disabled):hover { background: var(--sunken); color: var(--ink); }
.pi-steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); font-size: 13px; }
.pi-steps button[aria-current="step"] { background: var(--brand); color: #fff; }
.pi-steps button[aria-current="step"] .n { background: var(--accent); color: #fff; }
.pi-steps button.done .n { background: var(--ok-soft); color: var(--ok); }
.pi-steps-line { width: 22px; height: 2px; background: var(--line-2); flex: none; }

.scr-head { max-width: 760px; margin-bottom: 18px; }
.scr-head h2 { font-size: 24px; font-weight: 800; line-height: 1.4; }
.scr-lead { margin-top: 6px; color: var(--ink-2); line-height: 1.85; }
.pane-lead { margin: 0 0 14px; max-width: 820px; font-size: 14.5px; }
.sub-h { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.btn-big { min-height: 50px; padding: 0 26px; font-size: 16px; border-radius: 12px; }

/* 1. 届いた写真 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-s); display: grid; gap: 1px; }
.stat .l { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.stat b { font-size: 24px; line-height: 1.3; font-weight: 800; }
.stat .s { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.stat.warn b { color: var(--warn); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.photo-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.photo-card .ph { aspect-ratio: 4 / 3; background: var(--sunken); display: grid; place-items: center; overflow: hidden; }
.photo-card .ph img { width: 100%; height: 100%; object-fit: contain; }
.photo-card .meta { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; min-width: 0; }
.photo-card .fn { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-card .dim { font-size: 11.5px; color: var(--ink-3); }
.photo-card .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-card .chip { height: auto; min-height: 20px; padding: 1px 7px; font-size: 11px; white-space: normal; line-height: 1.4; }
.pick-foot {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 16px; margin: 20px calc(var(--gutter) * -1) 0; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: rgba(246, 244, 238, .94); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
}
.pick-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; flex: 1; }

/* 整備中 */
.running { position: fixed; inset: 0; z-index: 1050; display: grid; place-items: center; background: rgba(22, 36, 44, .45); padding: 16px; }
.running-card { width: min(380px, 100%); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-l); padding: 22px 24px 20px; text-align: center; }
.running-thumb { position: relative; width: 168px; height: 126px; margin: 0 auto; border-radius: 8px; overflow: hidden; background: var(--sunken); }
.running-thumb img { width: 100%; height: 100%; object-fit: contain; }
.scan { position: absolute; left: 0; right: 0; height: 26px; background: linear-gradient(rgba(194, 106, 23, 0), rgba(194, 106, 23, .45), rgba(194, 106, 23, 0)); animation: scan 1s ease-in-out infinite alternate; }
@keyframes scan { from { top: -10px; } to { top: 110px; } }
.running-title { margin-top: 14px; font-weight: 800; font-size: 16px; }
.running-phase { margin-top: 2px; font-size: 14px; color: var(--accent-deep); font-weight: 600; min-height: 1.6em; }
.running-bar { height: 6px; border-radius: 3px; background: var(--sunken); margin-top: 10px; overflow: hidden; }
.running-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.running-count { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.running-note { margin-top: 8px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }

/* 2. 前後を見比べる */
.seg { display: flex; gap: 6px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); width: fit-content; max-width: 100%; margin-bottom: 14px; box-shadow: var(--shadow-s); }
.seg button { display: flex; align-items: baseline; gap: 8px; padding: 8px 16px; border-radius: var(--r-s); font-weight: 700; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button b { font-size: 15px; }
.seg button:hover { background: var(--sunken); }
.seg button[aria-selected="true"] { background: var(--brand); color: #fff; }
.seg .seg-ok[aria-selected="false"] b { color: var(--ok); }
.seg .seg-warn[aria-selected="false"] b { color: var(--warn); }
.seg .seg-bad[aria-selected="false"] b { color: var(--bad); }

.strip-hint { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-3); }
.strip-hint .sp-only { display: none; }
.strip-wrap { margin: 0 calc(var(--gutter) * -1) 14px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: thin; }
.strip { display: flex; gap: 8px; padding: 2px 0 8px; width: max-content; }
.strip button { position: relative; width: 66px; flex: none; border-radius: 8px; border: 2px solid transparent; padding: 0; background: var(--surface); box-shadow: var(--shadow-s); overflow: hidden; }
.strip button img { width: 100%; height: 62px; object-fit: cover; }
.strip button .sname { display: block; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; background: var(--sunken); color: var(--ink-3); }
.strip button[aria-current="true"] { border-color: var(--accent); }
.strip button[aria-current="true"] .sname { background: var(--accent-soft); color: var(--accent-deep); }

.cmp-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; min-width: 0; box-shadow: var(--shadow-s); }
.cmp-panel { max-width: 560px; }
.cmp { --p: 50%; position: relative; aspect-ratio: 1 / 1; width: 100%; border-radius: var(--r-m); overflow: hidden; background: var(--sunken); user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.cmp-layer { position: absolute; inset: 0; display: grid; place-items: center; }
.cmp-layer img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cmp-before { background: var(--sunken); }
.cmp-after { background: var(--surface); clip-path: inset(0 0 0 var(--p)); }
.cmp-tag { position: absolute; top: 10px; z-index: 2; font-size: 12px; font-weight: 800; padding: 3px 11px; border-radius: 999px; pointer-events: none; }
.cmp-tag.l { left: 10px; background: var(--brand); color: #fff; }
.cmp-tag.r { right: 10px; background: var(--accent); color: #fff; }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--p); width: 3px; margin-left: -1.5px; background: var(--surface); box-shadow: 0 0 0 1px rgba(23, 57, 74, .28); z-index: 3; pointer-events: none; }
.cmp-handle .grip { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--accent-deep); }
.cmp-handle .grip svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cmp input[type="range"] { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; background: transparent; touch-action: pan-y; }
.cmp input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 40px; }
.cmp input[type="range"]::-moz-range-thumb { width: 2px; height: 40px; border: 0; }
.cmp:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmp-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.cmp-pos { font-size: 13px; color: var(--ink-3); font-weight: 600; }

.info-panel { padding: 18px; }
.info-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-weight: 800; font-size: 16px; margin-bottom: 10px; }
.info-name .from { color: var(--ink-3); font-weight: 600; overflow-wrap: anywhere; }
.info-name .to { color: var(--ink); overflow-wrap: anywhere; }
.info-name .arrow { color: var(--accent); width: 20px; height: 20px; }
.info-panel .sub-h { margin-top: 18px; }
.done-list { list-style: none; display: grid; gap: 6px; font-size: 13.5px; }
.done-list li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.55; }
.done-list .ico { color: var(--ok); margin-top: 3px; width: 16px; height: 16px; }
.mall-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mall-tabs button { padding: 8px 4px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.mall-tabs button:hover { background: var(--sunken); }
.mall-tabs button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.mall-spec { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fact { padding: 3px 10px; border-radius: 999px; background: var(--sunken); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fact.wm { background: var(--accent-soft); color: var(--accent-deep); }
.fact.nowm { background: var(--ok-soft); color: var(--ok); }
.weight { margin-top: 12px; }
.w-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; align-items: center; }
.w-l { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.w-bars { display: grid; gap: 4px; }
.wb { display: block; height: 10px; border-radius: 5px; }
.wb.before { background: var(--line-2); }
.wb.after { background: var(--accent); }
.w-note { margin-top: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }

/* 要撮り直し・台帳にない画像 */
.ng-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.ng-card { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; padding: 12px; background: var(--surface); border: 1.5px solid var(--warn-line); border-radius: var(--r-m); box-shadow: var(--shadow-s); }
.ng-card.orphan { border-color: var(--bad-line); }
.ng-img { aspect-ratio: 1 / 1; background: var(--sunken); border-radius: var(--r-s); overflow: hidden; display: grid; place-items: center; align-self: start; }
.ng-img img { width: 100%; height: 100%; object-fit: contain; }
.ng-body { min-width: 0; display: grid; gap: 6px; align-content: start; }
.ng-name { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.ng-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.ng-foot { font-size: 12px; color: var(--ink-3); line-height: 1.5; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.gauge { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
.g-l { color: var(--ink-3); font-weight: 600; }
.g-bar { position: relative; height: 8px; border-radius: 4px; background: var(--sunken); }
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--ok); }
.g-fill.bad { background: var(--bad); }
.g-mark { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.g-v { font-weight: 800; white-space: nowrap; }
.g-v small { font-weight: 600; color: var(--ink-3); margin-left: 6px; font-size: 11.5px; }
.note-card { margin-top: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.note-card .missing { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

/* 3. 登録データにまとめる */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-s); display: grid; gap: 1px; }
.tile .l { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.tile b { font-size: 26px; line-height: 1.25; font-weight: 800; }
.tile .s { font-size: 12px; color: var(--ink-3); }
.tile.ok b { color: var(--ok); } .tile.bad b { color: var(--bad); }
.ex-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; box-shadow: var(--shadow-s); }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dl-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); }
.dl-card h4 { margin: 0; font-size: 15px; font-weight: 800; }
.dl-card p { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; flex: 1; }
.dl-card .btn { margin-top: 6px; }
.ex-note { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; display: grid; gap: 2px; }
.preview { margin-top: 24px; }
.table-wrap { margin-top: 10px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.table-wrap th { background: var(--brand); color: #fff; font-weight: 700; text-align: left; padding: 7px 9px; white-space: nowrap; }
.table-wrap td { padding: 6px 9px; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.table-wrap td.wrap { white-space: normal; min-width: 260px; max-width: 380px; }
.table-wrap td.r { text-align: right; }
.table-wrap .empty { color: var(--ink-3); }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-group { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); border-left: 4px solid var(--line-2); }
.check-group.bad { border-left-color: var(--bad); }
.check-group.warn { border-left-color: var(--warn-line); }
.check-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 800; }
.cg-note { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.check-group ul { list-style: none; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.55; }
.check-group li { overflow-wrap: anywhere; }
.check-group .why { display: block; font-size: 12px; color: var(--ink-3); }

@media (min-width: 901px) {
  .strip-wrap { overflow-x: visible; }
  .strip { flex-wrap: wrap; width: auto; }
}
@media (max-width: 900px) {
  .strip-hint .sp-only { display: inline; }
  .cmp-grid { grid-template-columns: minmax(0, 1fr); }
  .cmp-panel { max-width: none; }
  .stats, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pi { padding-top: 14px; }
  .pi-steps { gap: 2px; padding: 4px; width: 100%; justify-content: space-between; margin-bottom: 18px; }
  .pi-steps button { flex-direction: column; gap: 2px; padding: 5px 4px; font-size: 11.5px; flex: 1; border-radius: 14px; }
  .pi-steps-line { width: 10px; }
  .scr-head h2 { font-size: 20px; }
  .scr-lead { font-size: 14px; line-height: 1.8; }
  .stat b, .tile b { font-size: 21px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pick-foot { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; }
  .pick-note { font-size: 11.5px; }
  .btn-big { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1; min-width: 0; flex-direction: column; align-items: center; gap: 0; padding: 7px 4px; font-size: 12.5px; white-space: normal; line-height: 1.35; text-align: center; }
  .panel { padding: 12px; border-radius: var(--r-m); }
  .info-panel { padding: 14px; }
  .info-name { font-size: 15px; }
  .ng-grid { grid-template-columns: minmax(0, 1fr); }
  .ng-card { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .gauge { grid-template-columns: 66px minmax(0, 1fr); }
  .gauge .g-v { grid-column: 1 / -1; }
  .ex-box { padding: 14px; }
  .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .dl-card .btn { width: 100%; }
  .mall-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
