/* Layout: one narrow column, one decision per screen, a fixed action bar at the bottom for the thumb. */
:root {
  --bg: #eef0f2; --surface: #ffffff; --ink: #15191e; --muted: #5a636e; --line: #d5dae0;
  --sel: #a8670c; --sel-bg: #fbf1df;
  --warn: #9a4b00; --warn-bg: #fff3df; --danger: #b42318; --danger-bg: #fdeceb; --ok: #17693c; --ok-bg: #e5f3ea;
  --info-bg: #e9eef5;
  --rp: #5b2a86; --pt: #00857d; --sod: #c2410c;
  --f-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --f-num: "Barlow Condensed", "Arial Narrow", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1215; --surface: #181c21; --ink: #eef1f4; --muted: #9aa4af; --line: #2b323a;
  --sel: #e9a640; --sel-bg: #2c2312;
  --warn: #f2a54d; --warn-bg: #2b2011; --danger: #ff7a70; --danger-bg: #2e1817; --ok: #55c98a; --ok-bg: #12271b;
  --info-bg: #1d242d;
  --rp: #b58ae0; --pt: #33c7bc; --sod: #f3854a; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1215; --surface: #181c21; --ink: #eef1f4; --muted: #9aa4af; --line: #2b323a;
  --sel: #e9a640; --sel-bg: #2c2312;
  --warn: #f2a54d; --warn-bg: #2b2011; --danger: #ff7a70; --danger-bg: #2e1817; --ok: #55c98a; --ok-bg: #12271b;
  --info-bg: #1d242d;
  --rp: #b58ae0; --pt: #33c7bc; --sod: #f3854a; color-scheme: dark; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.6; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--sel); outline-offset: 2px; }
h1, h2 { text-wrap: balance; margin: 0; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }

header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: none; }
.brand span { white-space: nowrap; }
.brand b { font-size: 15px; letter-spacing: .04em; }
.brand span { font-size: 12px; color: var(--muted); }
.cust { font-size: 13px; color: var(--muted); text-align: right; }
.cust b { display: block; color: var(--ink); font-size: 14px; }

.proto { margin-top: 12px; font-size: 13px; color: var(--muted); background: var(--info-bg); border-radius: 8px; padding: 8px 12px; }

ol.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 16px 0 8px; }
ol.steps li { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); text-align: center; }
ol.steps li::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 5px; }
ol.steps li.done::before { background: var(--ink); }
ol.steps li.now { color: var(--ink); font-weight: 700; }
ol.steps li.now::before { background: var(--sel); }
ol.steps li.skip { text-decoration: line-through; opacity: .6; }

main { padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.q { font-size: 22px; font-weight: 700; margin-top: 8px; }
.sub { color: var(--muted); font-size: 14px; margin: -8px 0 0; }

.list { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card { display: flex; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 16px; transition: border-color .12s; }
.card:hover { border-color: var(--muted); }
.card[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-bg); }
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
/* メーカーロゴ：ロゴ自身の地色の板に載せる（テーマに関係なく同じ見た目） */
.logo { flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--lbg); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); padding: 8px 10px; box-sizing: border-box; }
.logo.sm { padding: 3px 5px; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo.lg { width: 132px; height: 76px; align-self: center; }
.logo.sm { width: 76px; height: 32px; border-radius: 5px; vertical-align: middle; }
.line .mk { display: flex; align-items: center; gap: 8px; }
@media (max-width: 420px) { .logo.lg { width: 108px; height: 64px; } }
.pimg { flex: none; width: 76px; height: 100px; align-self: center; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 8px; padding: 6px; }
.pimg img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pimg svg { width: 52px; height: 66px; display: block; }
.pimg img.plogo { width: 100%; height: auto; padding: 4px; border-radius: 4px; }
.swatch { width: 10px; flex: none; align-self: stretch; border-radius: 5px; background: var(--c); }
.card .en { font-family: var(--f-num); font-size: 15px; letter-spacing: .08em; color: var(--c); font-weight: 700; }
.card .nm { font-size: 20px; font-weight: 700; line-height: 1.3; }
.card .ds { font-size: 13px; color: var(--muted); }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; color: var(--muted); background: var(--surface); }
.chip.fix { border-color: var(--c); color: var(--c); font-weight: 700; }
.price { font-size: 15px; font-weight: 700; }
.arrow { align-self: center; font-size: 22px; color: var(--muted); }

.vbtn { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.vbtn:hover { border-color: var(--muted); }
.vbtn[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-bg); }
.vbtn .num { font-size: 38px; font-weight: 700; line-height: 1; }
.vbtn small { font-size: 12px; color: var(--muted); }

.qgrid { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); }
.qbtn { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; min-height: 64px; font-family: var(--f-num); font-size: 30px; font-weight: 700; }
.qbtn[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-bg); }

.picked { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 10px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.picked .nm { font-weight: 700; }
.picked .num { font-size: 26px; font-weight: 700; }
.picked .ds { color: var(--muted); font-size: 13px; }

.total-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.total-line .big { font-family: var(--f-num); font-size: 40px; font-weight: 700; line-height: 1; }
.total-line .ds { color: var(--muted); font-size: 14px; }

.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; border: 1px solid transparent; }
.alert b { display: block; font-size: 15px; margin-bottom: 2px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert.danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.alert.info { background: var(--info-bg); color: var(--ink); }

.line { background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--c); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.line .mk { font-size: 13px; font-weight: 700; color: var(--c); letter-spacing: .04em; }
.line .nm { font-size: 19px; font-weight: 700; line-height: 1.3; }
.line .spec { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.line .visc { font-family: var(--f-num); font-size: 34px; font-weight: 700; line-height: 1.1; }
.line .fixed { font-size: 12px; color: var(--muted); }
.line .qty { text-align: right; align-self: center; }
.line .qty .num { font-size: 44px; font-weight: 700; line-height: 1; }
.line .qty span { font-size: 15px; margin-left: 2px; }
.line .sub2 { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed var(--line); padding-top: 8px; font-size: 14px; color: var(--muted); }
.line .acts { display: flex; gap: 8px; }
.mini { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; }
.mini.del { color: var(--danger); }

.sum { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-variant-numeric: tabular-nums; }
.sum .t { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.sum .r { text-align: right; }

.ship { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; }
.ship div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.ship div:last-child { border-bottom: 0; }
.ship b { color: var(--c); }
.ship span { text-align: right; }

.agree { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 2px solid var(--sel); border-radius: 12px; padding: 14px 16px; font-weight: 700; cursor: pointer; }
.agree input { width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--sel); flex: none; }

.cd { background: var(--surface); border: 2px solid var(--sel); border-radius: 14px; padding: 18px 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.cd .num { font-size: 72px; font-weight: 700; line-height: 1; }
.cd .bar2 { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.cd .bar2 i { display: block; height: 100%; background: var(--sel); }
.cd p { margin: 0; font-size: 14px; color: var(--muted); }
.status { display: flex; flex-direction: column; gap: 8px; }
.status div { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.status b { display: block; font-size: 15px; }

.repeat { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1.5px dashed var(--muted); border-radius: 12px; padding: 12px 16px; }
.repeat .body { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }
.repeat .body b { display: block; color: var(--ink); font-size: 16px; }

footer.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
footer.bar .wrap { display: flex; gap: 10px; }
footer.bar:empty { display: none; }
.btn { min-height: 56px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 700; }
.btn.primary { flex: 1; background: var(--ink); color: var(--surface); border-color: var(--ink); font-size: 18px; }
.btn.danger { flex: 1; color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

details.demo { margin: 0 0 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 14px; font-size: 14px; }
details.demo summary { cursor: pointer; color: var(--muted); }
.demo-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.demo-now { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
