/* 顧客データの名寄せの体験版。色は common/base.css のトークンだけを使う */
.nd { max-width: 1180px; margin: 0 auto; padding: 20px var(--gutter) 56px; }

/* 作業の流れ（1→2→3） */
.nd-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); }
.nd-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; }
.nd-steps button:disabled { cursor: default; opacity: .55; }
.nd-steps button:not(:disabled):hover { background: var(--sunken); color: var(--ink); }
.nd-steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); font-size: 13px; }
.nd-steps button[aria-current="step"] { background: var(--brand); color: #fff; }
.nd-steps button[aria-current="step"] .n { background: var(--accent); color: #fff; }
.nd-steps button.done .n { background: var(--ok-soft); color: var(--ok); }
.nd-steps-line { width: 22px; height: 2px; background: var(--line-2); flex: none; }

.scr-head { max-width: 780px; 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; }
.sub-h { font-size: 16px; font-weight: 800; margin: 26px 0 10px; }
.ex-note { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

/* タブ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-m); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 14px; white-space: nowrap; }
.tab:hover { background: var(--sunken); }
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab-n { min-width: 24px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); font-size: 12px; display: inline-grid; place-items: center; }
.tab[aria-selected="true"] .tab-n { background: var(--accent); color: #fff; }
.tab-warn:not([aria-selected="true"]) .tab-n { background: var(--warn-soft); color: var(--warn); }
.tab-lead { max-width: 820px; margin: 10px 0 14px; font-size: 13.5px; color: var(--ink-2); }

/* 1. 名簿を見る：同じお客様の例 */
.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow-s); }
.ex h3 { font-size: 17px; font-weight: 800; line-height: 1.5; }
.ex-lead { margin-top: 4px; color: var(--ink-2); font-size: 14px; line-height: 1.8; max-width: 820px; }
.ex-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.ex-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 11px 12px 12px; min-width: 0; }
.ex-src { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ex-id { font-size: 12px; color: var(--ink-3); }
.ex-card dl, .ex-after dl { margin: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 3px 8px; font-size: 13.5px; line-height: 1.55; }
.ex-card dt, .ex-after dt { color: var(--ink-3); font-size: 12px; padding-top: 1px; }
.ex-card dd, .ex-after dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.ex-swipe { display: none; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.ex-arrow { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 8px; color: var(--accent-deep); font-weight: 700; font-size: 14px; }
.ex-arrow .ico { width: 22px; height: 22px; }
.ex-after { background: var(--ok-soft); border: 1.5px solid var(--ok); border-radius: var(--r-m); padding: 11px 14px 12px; max-width: 560px; margin: 0 auto; }
.ex-after.pending { background: transparent; border: 1.5px dashed var(--line-2); color: var(--ink-3); text-align: center; font-size: 13.5px; }
.ex-after dd b { font-size: 15px; }

/* 名簿の表 */
.src-meta { margin: 10px 0 8px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); max-height: 380px; }
.src-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12.5px; }
.src-table caption { text-align: left; padding: 7px 10px; font-size: 12px; color: var(--ink-3); background: var(--sunken); position: sticky; left: 0; }
.src-table th { position: sticky; top: 0; background: var(--brand); color: #fff; font-weight: 700; text-align: left; padding: 7px 10px; white-space: nowrap; z-index: 1; }
.src-table td { padding: 6px 10px; border-top: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.src-table .rn { color: var(--ink-3); text-align: right; width: 1%; }
.src-table tr.ex-row td { background: var(--accent-soft); }
.src-table tr.ex-row td.rn { color: var(--accent-deep); font-weight: 700; }

.run-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);
}
#scrResult .run-foot { position: static; background: none; border: 0; backdrop-filter: none; margin-top: 16px; padding-top: 4px; justify-content: space-between; }
.run-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; flex: 1; }
.btn-big { min-height: 50px; padding: 0 26px; font-size: 16px; border-radius: 12px; }

/* 動いている様子 */
.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(480px, 100%); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-l); padding: 22px 24px 18px; }
.running-title { font-weight: 800; font-size: 17px; }
.stages { list-style: none; margin: 14px 0 0; display: grid; gap: 10px; }
.stages li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; color: var(--ink-3); }
.stages li b { display: block; font-size: 14px; }
.stages .st-done { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; font-weight: 400; }
.st-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; margin-top: 1px; }
.st-mark .ico { width: 14px; height: 14px; stroke-width: 3; }
li.st-now { color: var(--ink); }
li.st-now .st-mark { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
li.st-done { color: var(--ink); }
li.st-done .st-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
li.st-done b { color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }
.running-bar { height: 6px; border-radius: 3px; background: var(--sunken); margin-top: 16px; overflow: hidden; }
.running-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s ease; }
.running-note { margin-top: 8px; font-size: 12px; color: var(--ink-3); }

/* 2. 結果 */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.tile { padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-s); display: flex; flex-direction: column; gap: 1px; }
.tile-l { font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.tile b { font-size: 30px; line-height: 1.25; font-weight: 800; }
.tile b small { font-size: 14px; margin-left: 2px; font-weight: 700; }
.tile-s { font-size: 12px; color: var(--ink-3); }
.tile.brand b { color: var(--brand); } .tile.ok b { color: var(--ok); } .tile.warn b { color: var(--warn); } .tile.none b { color: var(--ink-2); }
.tile.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.tile.flash { animation: flash .9s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--accent); transform: scale(1.03); } 100% { box-shadow: 0 0 0 10px rgba(194, 106, 23, 0); transform: scale(1); } }

.pair-list { display: grid; gap: 12px; }
.pc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-s); overflow: hidden; }
.pc.review { border-color: var(--warn-line); }
.pc.decided { border-color: var(--brand-2); }
.pc-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; }
.pc-head:hover { background: var(--paper); }
.pc-title { flex: 1; min-width: 0; font-size: 15px; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.pc-title b { font-weight: 800; }
.pc-vs { color: var(--ink-3); font-size: 12.5px; }
.pc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pc-chev { flex: none; color: var(--ink-3); transition: transform .15s; }
.pc-head[aria-expanded="true"] .pc-chev, .cu-head[aria-expanded="true"] .pc-chev { transform: rotate(180deg); }
.pc-body { padding: 0 14px 14px; }
.pc-why { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rs { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; font-size: 12.5px; background: var(--sunken); color: var(--ink-2); line-height: 1.4; }
.rs b { font-weight: 800; }
.rs.pos b { color: var(--ok); } .rs.neg b { color: var(--bad); }
.pc-flag { margin: 0 0 8px; padding: 7px 10px; border-radius: var(--r-s); font-size: 13px; line-height: 1.6; }
.pc-flag b { display: block; font-size: 11.5px; margin-bottom: 1px; }
.pc-flag.warn { background: var(--warn-soft); color: var(--warn); }
.pc-flag.bad { background: var(--bad-soft); color: var(--bad); }
.cmp { border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; font-size: 13.5px; }
.cmp-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.cmp-row:first-child { border-top: 0; }
.cmp-l { padding: 6px 10px; background: var(--paper); color: var(--ink-3); font-size: 12px; }
.cmp-v { padding: 6px 10px; border-left: 1px solid var(--line); overflow-wrap: anywhere; line-height: 1.55; }
.cmp-v.same { background: var(--ok-soft); }
.cmp-v.diff { background: var(--accent-soft); }
.cmp-head { background: var(--paper); }
.cmp-h { padding: 4px 10px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--ink-3); }
.pc-ask { margin: 12px -14px -14px; padding: 12px 14px 14px; background: var(--paper); border-top: 1px solid var(--line); }
.pc.review .pc-ask { background: var(--warn-soft); border-top-color: var(--warn-line); }
.pc.decided .pc-ask { background: var(--brand-soft); border-top-color: var(--brand-2); }
.pc-q { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; line-height: 1.6; }
.pc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0; }
.pc-btn { min-height: 44px; }
.pc-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pc-btn.on:hover { background: var(--brand-2); }
.more { margin-top: 4px; }
.empty-msg { padding: 40px 20px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-l); }

.fixbox { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0 14px; }
.fixbox summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 14px; }
.fixbox[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.fixbox .ex-note { margin: 8px 0 6px; }
.fixes { list-style: none; margin: 0 0 10px; display: grid; gap: 0; font-size: 13.5px; }
.fixes li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.fixes li:first-child { border-top: 0; }
.fixes li b { font-weight: 800; }

/* 3. 統合名簿 */
.ex-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; box-shadow: var(--shadow-s); }
.out-sum { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.os-main { display: flex; align-items: baseline; gap: 12px; }
.os-from, .os-to { font-size: 15px; color: var(--ink-2); font-weight: 700; }
.os-from b { font-size: 26px; color: var(--ink-2); }
.os-to b { font-size: 40px; color: var(--ok); font-weight: 800; line-height: 1.2; }
.os-arrow { font-size: 22px; color: var(--accent); font-weight: 800; }
.os-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip b { font-weight: 800; }
.recon { margin-top: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.recon .okt { color: var(--ok); } .recon .badt { color: var(--bad); }
.ex-warn { margin-top: 12px; padding: 9px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 600; }
.ex-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 12px; }
.fchip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.fchip .num { font-size: 12px; color: var(--ink-3); }
.fchip[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.fchip[aria-selected="true"] .num { color: var(--on-brand-2); }
.cust-list { display: grid; gap: 8px; }
.cu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.cu.is-open { border-color: var(--warn-line); }
.cu-head { width: 100%; display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(0, 1fr) 24px; gap: 8px 16px; align-items: start; padding: 11px 14px; text-align: left; font-size: 13.5px; line-height: 1.55; }
.cu-head:hover { background: var(--paper); }
.cu-head i { color: var(--ink-3); font-style: normal; }
.cu-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cu-name { display: flex; flex-direction: column; }
.cu-name b { font-size: 15px; }
.cu-name small { font-size: 11.5px; color: var(--ink-3); }
.cu-st { display: flex; flex-wrap: wrap; gap: 4px; }
.cu-contact, .cu-addr { overflow-wrap: anywhere; min-width: 0; color: var(--ink-2); }
.cu-src { display: flex; flex-wrap: wrap; gap: 4px; }
.cu-head .pc-chev { align-self: center; }
.cu-detail { padding: 4px 14px 14px; border-top: 1px solid var(--line); background: var(--paper); }
.cu-detail h4 { margin: 12px 0 6px; font-size: 13px; font-weight: 800; }
.detail-single { margin-top: 10px; color: var(--ink-2); font-size: 13.5px; }
.lg { border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--surface); font-size: 13px; }
.lg-row { display: grid; grid-template-columns: 96px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1.4fr); gap: 4px 12px; padding: 7px 10px; border-top: 1px solid var(--line); line-height: 1.55; }
.lg-row > span { overflow-wrap: anywhere; min-width: 0; }
.lg-head { background: var(--sunken); font-size: 12px; color: var(--ink-3); font-weight: 700; border-top: 0; }
.lg-f { font-weight: 700; color: var(--ink-2); }
.lg-o.has { color: var(--warn); }
.lg-s, .lg-w, .lg-o { color: var(--ink-2); }
.plain { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.detail-fixes { display: flex; flex-wrap: wrap; gap: 5px; }
.detail-fixes .chip { height: auto; min-height: 24px; white-space: normal; padding: 2px 9px; }
.detail-src { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; overflow-wrap: anywhere; }
.detail-src b { color: var(--ink-2); }

@media (max-width: 900px) {
  .ex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cu-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px; }
  .cu-main { grid-column: 1 / 3; }
  .cu-src { grid-column: 1 / 3; }
  .cu-head .pc-chev { grid-column: 3; grid-row: 1; }
  .lg-row { grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr); }
  .lg-head { display: none; }
  .lg-f { grid-column: 1; }
  .lg-v { grid-column: 2 / 4; }
  .lg-s, .lg-w, .lg-o { grid-column: 1 / 4; font-size: 12.5px; }
  .lg-s::before, .lg-w::before, .lg-o::before { content: attr(data-l) "："; color: var(--ink-3); }
}
@media (max-width: 640px) {
  .nd { padding-top: 14px; }
  .nd-steps { gap: 2px; padding: 4px; width: 100%; justify-content: space-between; margin-bottom: 18px; }
  .nd-steps button { flex-direction: column; gap: 2px; padding: 5px 4px; font-size: 11.5px; flex: 1; border-radius: 14px; }
  .nd-steps-line { width: 10px; }
  .scr-head h2 { font-size: 20px; }
  .scr-lead { font-size: 14px; line-height: 1.8; }
  .ex { padding: 14px; }
  .ex h3 { font-size: 15.5px; }
  .ex-lead { font-size: 13px; }
  .ex-grid { display: flex; overflow-x: auto; scroll-snap-type: x proximity; gap: 10px; margin: 12px -14px 0; padding: 2px 14px 8px; }
  .ex-card { flex: 0 0 236px; scroll-snap-align: start; }
  .ex-swipe { display: block; }
  .tab { padding: 0 11px; font-size: 13px; min-height: 38px; gap: 6px; }
  .run-foot { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; }
  #scrResult .run-foot { align-items: stretch; }
  .run-note { font-size: 11.5px; }
  .btn-big { width: 100%; }
  .tile { padding: 10px 12px; }
  .tile b { font-size: 26px; }
  .pc-head { flex-wrap: wrap; padding: 11px 12px; gap: 6px 10px; }
  .pc-title { flex-basis: calc(100% - 34px); }
  .pc-meta { justify-content: flex-start; order: 3; flex-basis: 100%; }
  .pc-head .pc-chev { margin-left: auto; order: 2; }
  .pc-body { padding: 0 12px 12px; }
  .pc-ask { margin: 12px -12px -12px; padding: 10px 12px 12px; }
  .cmp { font-size: 13px; }
  .cmp-row { grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr); }
  .cmp-l { padding: 6px 6px; font-size: 11px; }
  .cmp-v { padding: 6px 7px; }
  .pc-btns .btn { flex: 1; min-width: 0; padding: 0 8px; }
  .ex-box { padding: 14px; }
  .os-to b { font-size: 34px; }
  .ex-btns .btn { width: 100%; white-space: normal; text-align: center; }
  .cu-head { padding: 10px 12px; gap: 6px 12px; }
  .cu-head { grid-template-columns: minmax(0, 1fr) 24px; }
  .cu-main, .cu-src { grid-column: 1; }
  .cu-contact, .cu-addr { grid-column: 1; }
  .cu-head .pc-chev { grid-column: 2; grid-row: 1; }
  .running-card { padding: 18px 18px 14px; }
}
.recon-hint { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
