/* parts.swingby.works — デザイン刷新 v2（design_handoff_parts_site_redesign/README.md「Design Tokens」）
   ライトテーマのみ。外部フォント・第三者読み込みなし。影・アニメーションなし。
   クラス名は index.html / app.js / scripts/build_pages.py で共有する契約。 */
:root {
  color-scheme: light;
  --bg: #ffffff; --fg: #1b1f27; --muted: #5d6470; --faint: #8a8f98;
  --line: #e3dfd5; --input-line: #b9b2a3; --chip-line: #cfc9bc;
  --card: #faf9f6; --shop: #f2f1ec; --sel: #e6f2f2;
  --accent: #155e63; --accent-hover: #0e4347; --yellow: #f3d03e; --bar: #7a8290;
  --cond-bg: #fbf1dc; --cond-line: #c9962a; --cond-fg: #7a4a00;
  --sample-line: #d6d1c6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--fg); text-wrap: pretty;
  font: 16px/1.7 system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}
header, main, footer { max-width: 46rem; margin-inline: auto; padding-inline: 16px; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }
:where(a, button, input, select, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
input::placeholder { color: var(--faint); }
p { margin: 0 0 8px; }
h1 { font-size: 30px; line-height: 1.3; font-weight: 750; margin: 0 0 10px; }
h2 { font-size: 19px; line-height: 1.4; font-weight: 700; margin: 6px 0 10px; }
.note { font-size: 13px; color: var(--muted); }
.faint { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ヘッダー: ロゴ + 2行（サイト名 / URL） */
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: inherit; letter-spacing: .01em; }
.brand svg { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 15px; }
.brand-url { font-size: 11px; font-weight: 500; color: var(--faint); letter-spacing: .02em; }
header nav { display: flex; gap: 16px; font-size: 14px; }

.pr-notice { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* ヒーロー: 小ラベル / H1 / リード + 線画 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 0 8px; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--accent); }
.lede { margin: 0; color: var(--muted); }
.tape-mark { flex: none; stroke: var(--fg); fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }

/* ステップ: 番号列 40px + 本文 */
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 750; font-size: 17px; border: 2px solid var(--chip-line); color: var(--faint); background: transparent;
}
.step-num.on { border-color: var(--fg); background: var(--fg); color: #fff; }
.step-body { min-width: 0; }
.placeholder { margin: 0; color: var(--faint); font-size: 14px; }

/* Step 1: 機種のプルダウン。選んだ時点で Step 2 が開くのでボタンはない */
.search-form { display: flex; }
.search-form select {
  flex: 1 1 14rem; min-width: 0; max-width: 100%; min-height: 50px; padding: 0 44px 0 14px; font: inherit; font-size: 18px;
  border: 1.5px solid var(--input-line); border-radius: 8px; background: #fff; color: inherit; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1f27' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
.search-form select:disabled { color: var(--faint); cursor: progress; }
.coverage-line { margin: 8px 0 0; }

/* Step 2: 結果カード */
.result { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.model-name { font-size: 22px; font-weight: 750; letter-spacing: .01em; }
.status { font-size: 13px; color: var(--muted); }
.result > p { margin: 10px 0 4px; }
.series-block { margin-top: 14px; }
.series-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.series-name { font-weight: 700; }
.quote { font-size: 13px; color: var(--muted); }
.widths { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  min-width: 76px; min-height: 64px; padding: 8px 10px 6px; border-radius: 8px; border: 1.5px solid var(--chip-line);
  background: #fff; color: var(--fg); font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.width-list { margin: 0; font-size: 16px; font-weight: 600; }
.tile-bar-wrap { display: flex; align-items: center; height: 36px; }
.tile-bar { display: block; width: 44px; height: var(--bar-h, 3px); background: var(--bar); border-radius: 1px; }
.tile-label { font-size: 14px; font-weight: 500; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); color: var(--accent); }
.tile[aria-pressed="true"] .tile-bar { background: var(--accent); }
.tile[aria-pressed="true"] .tile-label { font-weight: 750; }
.ratio-note { margin: 10px 0 0; font-size: 12px; color: var(--faint); }
.source { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.cta {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none;
}
.cta:hover { color: #fff; background: var(--accent-hover); }
.result .cta { margin-top: 14px; }

/* 条件付き */
.conditional { margin-top: 12px; background: var(--cond-bg); border: 1px solid var(--cond-line); border-radius: 10px; padding: 14px 16px; }
.cond-head { font-weight: 700; color: var(--cond-fg); margin: 0; }
.conditional p { margin: 6px 0 0; }
.conditional .note { margin: 4px 0 0; }
.conditional label { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 44px; cursor: pointer; }
.conditional input[type="checkbox"] { flex: none; width: 18px; height: 18px; accent-color: var(--cond-fg); margin: 0; }
.reveal { font-size: 14px; }

/* Step 3: 品番カード格子 */
.sel-intro { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.sel-intro strong { color: var(--fg); }
/* min(250px, 100%) で 320px 幅でもステップ本文からはみ出さない（Codex 指摘） */
.sku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.sku { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.label-sample {
  height: var(--sample-h, 22px); border: 1px solid var(--sample-line); border-radius: 3px;
  display: flex; align-items: center; padding: 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; overflow: hidden;
}
.label-sample.clear { background: repeating-conic-gradient(#e3e3e3 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.sku-part { font-weight: 750; font-size: 17px; letter-spacing: .01em; }
.sku-spec { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sku-offers { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.offer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px;
  min-height: 44px; padding: 8px 12px; border-radius: 8px; background: var(--shop); text-decoration: none; color: inherit; font-size: 14px;
}
.offer:hover { color: inherit; }
.offer .shop { overflow-wrap: anywhere; line-height: 1.35; flex: 1 1 9rem; }
.offer .go { flex: none; display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.pr-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--chip-line); border-radius: 99px; padding: 0 6px; }
.no-offer { font-size: 13px; color: var(--faint); }
.offers-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.offers-note strong { color: var(--fg); }

/* 機種一覧: ピル */
.models { padding: 24px 0 8px; border-top: 1px solid var(--line); }
.models h2 { margin: 0 0 4px; }
.models .note { margin: 0 0 10px; }
.model-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 99px; /* README は 40px だが「守る前提」の 44px を優先 */
  border: 1px solid var(--chip-line); background: #fff; color: inherit; font-size: 14px; text-decoration: none;
}
.pill:hover { color: inherit; border-color: var(--input-line); }

/* 機種ページ・静的ページ */
.crumb { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.crumb + h1 { font-size: 28px; margin: 12px 0 16px; }
.doc { max-width: 40rem; }
.doc h1 { font-size: 28px; margin: 24px 0 8px; }
.doc .doc-lede { color: var(--muted); margin: 0 0 12px; }
.doc h2 { margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc h2.plain { padding-top: 0; border-top: 0; margin-top: 20px; }
.doc ul { margin: 0 0 8px; padding-left: 1.2em; }
.doc ul.rules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.doc ul.rules li { padding: 12px 0; border-top: 1px solid var(--line); }
.doc ul.rules li:last-child { border-bottom: 1px solid var(--line); }
.doc ul.rules + p { margin-top: 12px; }
.doc code { font-size: .95em; }

footer { border-top: 1px solid var(--line); margin-top: 28px; padding-block: 16px 32px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
footer p { margin: 0; }

@media (max-width: 36rem) {
  h1 { font-size: 26px; }
  .tape-mark { width: 120px; height: 85px; }
  .search-form select { flex-basis: 100%; font-size: 16px; }
  .tile { min-width: 68px; }
}
@media (max-width: 22rem) {
  .tape-mark { display: none; }
}
