/* NOTE series design system. Theme colors (--primary --accent --highlight) are injected per category. */
:root {
  --bg: #F5F3EE; --surface: #FFFFFF; --ink: #17191F; --muted: #5E6470; --line: #E4E0D6;
  --primary: #E8452C; --accent: #1F4FD8; --highlight: #FFC93C;
  --fit: #138A55; --check: #C77C02;
  --fit-ink: #0E7448; --check-ink: #7A4B00; --ng: #B8321F;
  --radius: 14px; --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(23, 25, 31, .06), 0 2px 8px rgba(23, 25, 31, .05);
  --shadow-2: 0 4px 10px rgba(23, 25, 31, .08), 0 12px 28px rgba(23, 25, 31, .10);
  --primary-d: color-mix(in srgb, var(--primary) 80%, #000);
  --hl-soft: color-mix(in srgb, var(--highlight) 28%, #fff);
  --font-head: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-body: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
@media (min-width: 720px) { body { font-size: 16px; } }
body.has-savebar { padding-bottom: 88px; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, .logo-name, .tile-name, .hero-q { font-family: var(--font-head); font-weight: 800; line-height: 1.3; letter-spacing: .01em; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 1em; height: 1em; }
.only-mobile { display: inline-flex; }
@media (min-width: 960px) { .only-mobile { display: none !important; } }

/* ---- header / footer ---- */
.ad-note { background: var(--ink); color: #fff; text-align: center; font-size: 12px; padding: 4px 12px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-height: 44px; }
.logo-ic { width: 30px; height: 30px; color: var(--primary); stroke-width: 1.8; }
.logo-name { font-size: 20px; letter-spacing: .04em; }
.logo-series { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; line-height: 18px; display: none; }
@media (min-width: 480px) { .logo-series { display: inline-block; } }
.saved-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; border: 1px solid var(--line); }
.saved-link:hover { border-color: var(--primary); }
.count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--line); color: var(--ink); font-size: 13px; display: inline-grid; place-items: center; }
.count.on { background: var(--primary-d); color: #fff; }
.site-footer { margin-top: 56px; padding: 28px 0 40px; border-top: 1px solid var(--line); background: var(--surface); }
.foot { display: grid; gap: 8px; }
.foot-brand { font-family: var(--font-head); font-weight: 800; font-size: 18px; }
.foot-brand small { font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.foot nav a { display: inline-block; min-height: 44px; line-height: 44px; }

/* ---- tags / badges (price-tag shape) ---- */
.tag, .badge, .tier {
  position: relative; display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  padding: 2px 10px 2px 17px; background: var(--highlight); color: var(--ink);
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
.tag::before, .badge::before, .tier::before { content: ""; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--surface); }
.badge { position: absolute; left: 0; top: 8px; z-index: 1; font-size: 12.5px; padding: 3px 12px 3px 18px; }
.b-fit { background: var(--fit-ink); color: #fff; }
.b-check { background: #FFD98A; color: #4A2F00; }
.tier { font-size: 11px; margin-left: 6px; vertical-align: 1px; padding: 0 8px 0 15px; background: #E7EDFF; color: #17358F; }
.tier::before { left: 6px; width: 4px; height: 4px; margin-top: -2px; background: #fff; }
.t-retail { background: #FFEBC2; color: #6A4200; }
.t-unordered { background: #ECEAE4; color: var(--muted); }

/* ---- buttons / forms ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 2px solid transparent; font-weight: 700; text-decoration: none; text-align: center; line-height: 1.3;
  transition: transform .15s, box-shadow .15s, background-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary-d); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { box-shadow: var(--shadow-2); }
.btn-sub { background: #E7EDFF; color: #17358F; }
.btn-line { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--primary); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 13px; margin: 2px 0; }
.link-btn { background: none; border: 0; color: var(--accent); text-decoration: underline; min-height: 44px; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--bg); display: inline-grid; place-items: center; }
input[type=number], input[type=search], select {
  min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 12px; width: 100%;
}
input[type=number]:focus, input[type=search]:focus, select:focus { border-color: var(--accent); }
.dim-inputs, .space-row label { position: relative; }
.dim-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.dim-inputs[hidden], .sel[hidden] { display: none; }
.dim-inputs label, .space-row label { display: grid; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); position: relative; }
.dim-inputs label i, .space-row label i { position: absolute; right: 8px; bottom: 11px; font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); pointer-events: none; }
/* 狭い欄でも数字が見えるよう、余白を詰めて上下ボタンを消す */
.dim-inputs input, .space-row input { padding-left: 8px; padding-right: 28px; min-width: 0; -moz-appearance: textfield; appearance: textfield; }
.dim-inputs input::-webkit-inner-spin-button, .dim-inputs input::-webkit-outer-spin-button,
.space-row input::-webkit-inner-spin-button, .space-row input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 700; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.knob { width: 44px; height: 26px; border-radius: 13px; background: #C9C5B9; position: relative; transition: background .2s; flex: none; }
.knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .knob { background: var(--fit-ink); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- hero ---- */
.hero {
  position: relative; padding: 28px 0 40px; overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(23, 25, 31, .09) 1.4px, transparent 1.6px) 0 0 / 20px 20px,
    linear-gradient(180deg, #FFF3CC 0%, #FBEBD0 55%, var(--bg) 100%);
}
.hero::before, .hero::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; pointer-events: none; }
.hero::before { bottom: 18px; background: repeating-linear-gradient(135deg, rgba(232, 69, 44, .22) 0 8px, transparent 8px 16px); opacity: .6; }
.hero::after { bottom: 0; height: 18px; background: linear-gradient(180deg, transparent, var(--bg)); }
.hero-in { position: relative; z-index: 1; }
.eyebrow { margin-bottom: 10px; }
.hero-title {
  display: inline; font-size: clamp(27px, 7.4vw, 50px); line-height: 1.5;
  background: linear-gradient(transparent 66%, color-mix(in srgb, var(--highlight) 75%, transparent) 66%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.lead { margin: 14px 0 0; max-width: 40em; color: #3A3F4A; font-size: 14px; }
.hero-q { margin: 24px 0 12px; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.hero-q::after { content: ""; flex: 1; height: 0; border-top: 3px dotted rgba(23, 25, 31, .25); }
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .preset-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 900px) { .preset-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .preset-grid { grid-template-columns: repeat(6, 1fr); } }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 12px 12px; min-height: 44px;
  background: var(--surface); border: 2.5px solid var(--surface); border-radius: 20px; box-shadow: var(--shadow-1);
  text-decoration: none; color: var(--ink); transition: transform .18s, border-color .18s, box-shadow .18s; position: relative;
}
.tile:hover, .tile.is-on { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tile.is-on { background: #FFF8F6; }
.tile.is-on::after { content: "選択中"; position: absolute; right: 10px; top: 10px; font-size: 11px; font-weight: 700; color: #fff; background: var(--primary-d); border-radius: 999px; padding: 0 8px; }
.tile-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--hl-soft); display: grid; place-items: center; margin-bottom: 6px; color: var(--ink); }
.tile-ic .ic { width: 30px; height: 30px; }
.tile-ic.big { width: 64px; height: 64px; }
.tile-ic.big .ic { width: 38px; height: 38px; }
.tile-name { font-size: 15px; line-height: 1.35; }
.tile-sub { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 6px; }
.tile .tag { font-size: 11px; }
.space-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; align-items: end; margin-top: 16px; padding: 14px;
  background: rgba(255, 255, 255, .85); border: 2px dashed rgba(23, 25, 31, .25); border-radius: 18px;
}
.space-title { grid-column: 1 / -1; font-family: var(--font-head); font-weight: 800; font-size: 15px; }
.space-row .btn { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .space-row { grid-template-columns: auto repeat(3, minmax(90px, 140px)) auto; justify-content: start; gap: 10px 14px; }
  .space-title { grid-column: auto; align-self: center; }
  .space-row .btn { grid-column: auto; }
}

/* ---- finder ---- */
.finder { padding-top: 24px; }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbox input { min-height: 52px; padding-left: 44px; border-radius: 999px; font-size: 16px; box-shadow: var(--shadow-1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips[hidden] { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 14px; border-radius: 999px; background: #FFF1EE; border: 1.5px solid var(--primary); color: var(--ink); font-size: 13px; font-weight: 700; text-align: left; }
.chip:hover { background: #FFE3DD; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 12px 0 8px; }
.count-line { font-weight: 700; font-size: 14px; flex: 1 1 100%; }
@media (min-width: 720px) { .count-line { flex: 1 1 auto; } }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sort select { width: auto; padding-right: 8px; font-weight: 700; }
.layout { display: block; }
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
  .sidebar { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; }
}
.filter-panel { display: grid; gap: 14px; }
.sidebar .filter-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.f-group { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.f-group h3 { font-size: 14px; font-weight: 800; }
.f-hint { font-size: 12px; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 44px; text-align: center; font-size: 12.5px; font-weight: 700; border-radius: 9px; padding: 0 4px; line-height: 1.3; }
.seg input:checked + span { background: var(--surface); box-shadow: var(--shadow-1); color: var(--primary-d); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); }
.row-btns { display: flex; align-items: center; gap: 8px; }
.row-btns .btn { min-height: 44px; }
.checks { display: grid; gap: 0; }
.checks.scroll { max-height: 240px; overflow: auto; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary-d); margin: 0; flex: none; }
.check-t { flex: 1; line-height: 1.35; }
.check small { color: var(--muted); }
.chip-set { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; }
.swatch[aria-pressed=true] { border-color: var(--primary); background: #FFF1EE; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .3); background: #ddd; }
.c-clear { background: linear-gradient(135deg, #fff 40%, #cfe7f5 40% 60%, #fff 60%); }
.c-black { background: #1d1d1f; } .c-white { background: #fff; } .c-natural { background: #D9B77E; }
.c-brown { background: #7A4B2A; } .c-gray { background: #9A9DA3; } .c-other { background: conic-gradient(#e8452c, #ffc93c, #1f4fd8, #e8452c); }
.sel { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }

/* ---- bottom sheet ---- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(23, 25, 31, .5); }
dialog.sheet { margin: auto 0 0; padding: 0; border: 0; width: 100%; max-width: 640px; max-height: 90vh; border-radius: 22px 22px 0 0; background: var(--surface); left: 50%; transform: translateX(-50%); }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .25s ease-out; }
@keyframes sheet-up { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 18px; }
.sheet-body { overflow: auto; padding: 14px 16px; flex: 1; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }

/* ---- result groups / cards ---- */
.group { margin-top: 22px; }
.group-h { font-size: 19px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 12px; }
.group-h small, .block h2 small { font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--muted); }
.group-sub { font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--muted); }
.g-fit .group-h { color: var(--fit-ink); }
.g-check .group-h { color: var(--check-ink); }
.g-unknown { background: var(--surface); border: 1px dashed #bdb8aa; border-radius: var(--radius); padding: 0 14px; }
.g-unknown summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; gap: 10px; font-weight: 800; font-family: var(--font-head); font-size: 16px; }
.g-unknown summary small { font-family: var(--font-body); color: var(--muted); font-weight: 700; font-size: 13px; }
.g-unknown .group-body { padding-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) and (max-width: 1199px) { .layout .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--line); display: grid; place-items: center; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.card-media img.broken, .gal-main img.broken, .cmp-photo img.broken, .thumb img.broken { visibility: hidden; }
.img-failed { background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9b4a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20.5V9.5a5.5 5.5 0 0 1 5.5-5.5h5A5.5 5.5 0 0 1 20 9.5v11z'/><path d='M2.5 20.5h19M8 8.5v4'/></svg>") center / 38% no-repeat; }
.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; width: 100%; color: #8B8678; font-size: 11px; line-height: 1.4; text-align: center; background: repeating-linear-gradient(135deg, #FBFAF6 0 10px, #F5F3EC 10px 20px); }
.ph-ic { width: 40px; height: 40px; stroke-width: 1.5; }
.save-btn { position: absolute; right: 2px; top: 2px; z-index: 3; width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.save-btn::before { content: ""; position: absolute; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.save-btn .ic { position: relative; width: 20px; height: 20px; }
.save-btn:hover { color: var(--primary); }
.save-btn[aria-pressed=true] { color: var(--primary); }
.save-btn[aria-pressed=true] .ic { fill: var(--primary); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card-brand { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.card-name { font-size: 14px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card-name a { color: var(--ink); text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-model { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-size { font-size: 12.5px; margin-top: 4px; line-height: 1.7; }
.card-size .kind { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; line-height: 1.5; margin-right: 2px; }
.card-size b, .u { font-variant-numeric: tabular-nums; }
.u { font-size: 11.5px; margin-left: 1px; }
.cnote { display: inline-block; margin-left: 6px; font-size: 11.5px; color: var(--check-ink); font-weight: 700; }
.card-margin { font-size: 12px; color: #2E4A3C; line-height: 1.7; }
.card-margin .lbl { font-weight: 800; color: var(--fit-ink); }
.mg { white-space: nowrap; }
.mg.tight { background: var(--hl-soft); border-radius: 4px; padding: 0 3px; font-weight: 800; color: var(--ink); }
.mg em { font-style: normal; font-size: 10.5px; margin-left: 2px; color: var(--primary-d); }
.card-flag { font-size: 11.5px; font-weight: 700; color: var(--check-ink); background: #FFF4DB; border-radius: 6px; padding: 1px 6px; align-self: flex-start; margin-top: 2px; }
.more { display: flex; margin: 18px auto 0; }
.empty-state, .card-grid .empty { background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 18px; text-align: center; color: var(--muted); margin-top: 20px; display: grid; gap: 14px; justify-items: center; }
.empty-state[hidden] { display: none; }

/* ---- sticky save bar / toast ---- */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(23, 25, 31, .12); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.savebar[hidden] { display: none; }
.savebar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.savebar-thumbs { display: flex; gap: 6px; overflow: hidden; }
.sb-thumb { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; color: var(--muted); }
.sb-thumb img { width: 100%; height: 100%; object-fit: contain; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- sub pages ---- */
.crumbs { font-size: 12.5px; margin: 14px 0 8px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--muted); }
.crumbs li + li::before { content: "＞"; margin: 0 6px; font-size: 10px; color: #A6A296; }
.crumbs a { display: inline-block; padding: 8px 0; }
.page-head { padding: 20px 0 6px; }
.page-head.slim { padding-top: 24px; }
.page-head h1 { font-size: clamp(22px, 5.5vw, 32px); }
.preset-head { background: linear-gradient(180deg, #FFF3CC, var(--bg)); padding-bottom: 20px; }
.ph-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; }
.intro { max-width: 46em; }
.need-box { margin-top: 12px; }
.need-box b { font-size: 18px; }
.block { margin-top: 36px; }
.block h2 { font-size: 21px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cta-block { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 10px; justify-items: start; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; }
.chip-link:hover { border-color: var(--primary); }
.prose { max-width: 760px; }
.prose p + p { margin-top: 10px; }
.defs { display: grid; gap: 4px 0; }
.defs dt { font-weight: 800; margin-top: 8px; }
.defs dd { margin: 0; color: #3A3F4A; }

/* item */
.item-grid { display: grid; gap: 20px; margin-top: 4px; }
@media (min-width: 900px) { .item-grid { grid-template-columns: 55fr 45fr; gap: 36px; align-items: start; } .item-media { position: sticky; top: 76px; } }
.gallery { display: grid; gap: 10px; }
.gal-main { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 0; overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow-1); }
.gal-main img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.ph-big { flex-direction: column; gap: 10px; cursor: default; background: repeating-linear-gradient(135deg, #FBFAF6 0 14px, #F5F3EC 14px 28px); color: #8B8678; text-align: center; padding: 20px; }
.ph-big .ph-ic { width: 72px; height: 72px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.thumb { flex: none; width: 64px; height: 64px; padding: 2px; background: #fff; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb[aria-current=true] { border-color: var(--primary); }
.item-brand { color: var(--muted); font-weight: 700; font-size: 13px; }
.item-name { font-size: clamp(22px, 5.4vw, 30px); margin: 2px 0 4px; }
.item-model { color: var(--muted); font-size: 14px; }
.h-sm { font-size: 15px; margin: 18px 0 8px; font-family: var(--font-body); font-weight: 800; }
.dims { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.dims th, .dims td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.dims tr:first-child th, .dims tr:first-child td { border-top: 0; }
.dims th { width: 7em; font-weight: 800; background: #FAF9F5; white-space: nowrap; }
.dims .num { font-size: 17px; font-variant-numeric: tabular-nums; }
.dims .axes { display: block; font-size: 11px; color: var(--muted); }
.dims .tier { margin: 0 6px 4px 0; }
.dims .qual { display: block; font-size: 11.5px; color: var(--muted); }
.dims .cnote { margin: 0 6px 0 0; }
.cta { display: grid; gap: 10px; margin: 18px 0; }
@media (min-width: 480px) { .cta { grid-template-columns: 1fr 1fr; } .cta .btn-primary { grid-column: 1 / -1; } }
.save-big[aria-pressed=true] { border-color: var(--primary); background: #FFF1EE; }
.save-big[aria-pressed=true] .ic { fill: var(--primary); color: var(--primary); }
.attrs { display: grid; gap: 6px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.attrs div { display: grid; grid-template-columns: 4.5em 1fr; gap: 8px; }
.attrs dt { color: var(--muted); font-weight: 700; }
.attrs dd { margin: 0; }
.attrs small { color: var(--muted); }
.editor-note { margin-top: 14px; padding: 12px 14px; background: #FFF8DF; border-radius: var(--radius-sm); font-size: 14px; }

.checker { margin-top: 36px; background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 18px 16px; }
.checker h2 { font-size: 22px; }
.checker h2::before { content: ""; display: inline-block; width: 10px; height: 22px; border-radius: 3px; background: var(--primary); margin-right: 10px; vertical-align: -3px; }
.checker-grid { display: grid; gap: 18px; margin-top: 14px; }
@media (min-width: 800px) { .checker-grid { grid-template-columns: 320px 1fr; gap: 28px; align-items: start; } .checker { padding: 24px; } }
.checker-form { display: grid; gap: 8px; align-content: start; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.checker-out { display: grid; gap: 12px; min-height: 80px; }
.verdict { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; }
.v-badge { font-family: var(--font-head); font-weight: 800; font-size: 20px; }
.v-text { font-size: 14px; }
.v-fits { background: #E3F5EB; color: #0B5535; }
.v-check { background: #FFF1CF; color: #5E3A00; }
.v-no { background: #FDE6E1; color: #8E2415; }
.v-unknown { background: #ECEAE4; color: #3A3F4A; }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th, .mtable td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.mtable thead th { font-size: 12px; color: var(--muted); }
.mtable tbody th { font-weight: 800; }
.mtable .m { font-weight: 800; font-variant-numeric: tabular-nums; }
.mtable .m.tight { background: var(--hl-soft); }
.mtable .m.neg { color: var(--ng); }
.mtable em { font-style: normal; font-size: 11px; margin-left: 4px; color: var(--primary-d); }
.iso-fig { display: grid; justify-items: center; gap: 6px; background: #FBFAF6; border-radius: 14px; padding: 10px; }
.iso { width: 100%; max-width: 440px; height: auto; }
.iso .floor { fill: #ECE8DC; }
.iso .back { fill: none; stroke: #8B8678; stroke-width: 1.2; stroke-dasharray: 4 4; }
.iso .cs { fill: var(--accent); fill-opacity: .07; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.iso .ob { fill: var(--o); stroke: var(--o); stroke-width: 1.4; stroke-linejoin: round; }
.iso .ob-t { fill-opacity: .3; } .iso .ob-r { fill-opacity: .6; } .iso .ob-l { fill-opacity: .45; }
.obj-ok { --o: var(--fit-ink); } .obj-ng { --o: var(--ng); }
.dim-l { font-size: 11.5px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: #FBFAF6; stroke-width: 3px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.key-case { border: 2px solid var(--accent); background: rgba(31, 79, 216, .1); }
.key-obj { background: var(--fit-ink); opacity: .6; margin-left: 6px; }
.sources { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.sources summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-weight: 800; }
.sources-body { padding-bottom: 14px; display: grid; gap: 14px; }
.src h4 { font-size: 14px; }
.src ul { margin-top: 4px; display: grid; gap: 6px; font-size: 13px; color: #3A3F4A; }
.src .loc { color: var(--muted); font-size: 12px; }
.src .qual { font-size: 12px; color: var(--muted); }
.disclaimer { margin-top: 14px; }
dialog.zoom { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible; }
dialog.zoom img { max-width: 96vw; max-height: 90vh; background: #fff; border-radius: 12px; padding: 8px; object-fit: contain; }
.zoom-close { position: absolute; right: 6px; top: 6px; background: #fff; box-shadow: var(--shadow-2); z-index: 2; }

/* compare */
.cmp-scroll { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
.cmp-scroll[hidden] { display: none; }
.cmp { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.cmp th, .cmp td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 14px; min-width: 168px; }
.cmp tbody th, .cmp thead th.corner { position: sticky; left: 0; z-index: 2; min-width: 84px; width: 84px; background: #FAF9F5; font-weight: 800; font-size: 13px; }
.cmp thead th { background: var(--surface); vertical-align: bottom; }
.cmp thead th.corner { z-index: 3; }
.cmp-photo { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: var(--muted); }
.cmp-photo img { width: 100%; height: 100%; object-fit: contain; }
.cell-brand, .cell-model { display: block; font-size: 12px; color: var(--muted); }
.cell-name { font-weight: 800; display: block; margin: 2px 0; }
.cell-fact { margin-bottom: 6px; }
.cell-fact b { font-variant-numeric: tabular-nums; font-size: 15px; }
.na { color: var(--muted); }
.cmp td.hi { background: #FFE2DB; box-shadow: inset 0 3px 0 var(--primary); }
.cmp td.lo { background: #DCE6FF; box-shadow: inset 0 3px 0 var(--accent); }
.hl { padding: 0 8px; border-radius: 4px; font-weight: 800; }
.hl.hi { background: #FFE2DB; } .hl.lo { background: #DCE6FF; }
.rm { font-size: 12.5px; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover, .tile:hover, .btn:hover { transform: none; }
}

@media (max-width: 519px) {
  .dims, .dims tbody { display: block; }
  .dims tr { display: grid; grid-template-columns: 5.5em 1fr; border-top: 1px solid var(--line); }
  .dims tr:first-child { border-top: 0; }
  .dims th, .dims td { border-top: 0 !important; }
  .dims th { width: auto; }
  .dims td:last-child { grid-column: 1 / -1; padding-top: 0; }
}
.savebar .btn { white-space: nowrap; padding: 0 16px; }

/* ---- round 2 ---- */
.card-grid > li { display: flex; }
.card-grid > li > .card { flex: 1; }
.card-media { display: block; overflow: hidden; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.card-media .ph { position: absolute; inset: 0; }
.card-name { min-height: 0; }
.card-body { gap: 2px; }
.card-size { margin-top: auto; padding-top: 6px; }
.card-model + .card-size, .card-name + .card-size { margin-top: auto; }
.gal-main { display: block; }
.gal-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 10px; }
.gal-main.ph-big { display: flex; position: relative; align-items: center; justify-content: center; }
.mtable .m.pos { color: var(--fit-ink); }
.mtable .m.tight { color: var(--check-ink); }
.eyebrow .tag { font-size: 12px; }
.hero-title { word-break: keep-all; overflow-wrap: anywhere; }
.attrs small { display: inline; }

@media (max-width: 639px) {
  .hero { padding: 16px 0 24px; }
  .hero-title { font-size: 26px; line-height: 1.5; }
  .lead { font-size: 13px; margin-top: 8px; }
  .hero-q { margin: 14px 0 8px; font-size: 17px; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile { align-items: center; justify-content: center; text-align: center; min-height: 84px; padding: 8px 4px; border-radius: 16px; gap: 0; }
  .tile-ic { width: 40px; height: 40px; margin-bottom: 4px; }
  .tile-ic .ic { width: 24px; height: 24px; }
  .tile-sub, .tile .tag { display: none; }
  .tile-name { font-size: 12px; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
  .tile.is-on::after { display: none; }
  .space-row { margin-top: 12px; padding: 10px; }
}

/* ---- round 3 ---- */
.mg.warn { background: #FFDFA0; color: #4A2F00; border-radius: 4px; padding: 0 3px; font-weight: 800; }
.mg.tight { background: #E6F0B4; color: #33410A; border-radius: 4px; padding: 0 3px; font-weight: 800; }
.mg.neg { background: #FDE6E1; color: var(--ng); border-radius: 4px; padding: 0 3px; font-weight: 800; }
.mg em { color: inherit; opacity: .85; }
.mtable .m.warn { background: #FFDFA0; color: #4A2F00; }
.mtable .m.tight { background: #E6F0B4; color: #33410A; }
.mtable .m.neg { background: #FDE6E1; color: var(--ng); }
.mtable .m em { color: inherit; }
.card-feats { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.fb { font-size: 10.5px; font-weight: 700; line-height: 1.5; padding: 0 7px; border-radius: 999px; background: #EEF2FF; color: #1D3A9E; border: 1px solid #D5DDF8; white-space: nowrap; }
.feat-list { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 14px; }
.feat-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.feat-list .fname { color: var(--muted); font-weight: 700; min-width: 5.5em; }
.feat-list .tier { margin: 0; }
.picks { margin-top: 18px; }
.picks .group-h, .picks h2 { color: var(--primary-d); }
.pick { flex-direction: column; gap: 6px; }
.pick-reason { font-size: 12.5px; background: #FFF8DF; border-radius: 8px; padding: 6px 10px; line-height: 1.55; }
.picks-grid { margin-top: 4px; }
.n-short { display: none; }
.toast.has-link { pointer-events: auto; }
.toast a { color: #FFD76A; font-weight: 700; }
.clear-saved { font-size: 12px; min-width: 44px; }
.ord { display: flex; gap: 6px; margin-bottom: 4px; }
.ord-btn { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 800; }
.ord-btn:disabled { opacity: .35; cursor: default; }
#cmp-clear { float: right; margin-top: 4px; }
.iso .sil { fill: var(--o); fill-opacity: .8; stroke: var(--o); stroke-width: 1; }
.iso .sil * { fill: inherit; stroke: inherit; }
@media (max-width: 639px) {
  .tile-name .n-full { display: none; }
  .tile-name .n-short { display: inline; }
  .tile-name:not(:has(.n-short)) .n-full { display: inline; }
}
.iso .sil { fill: #fff; fill-opacity: .85; stroke: var(--o); stroke-width: 1.6; }

.pr-tag { display: inline-block; margin-left: 6px; padding: 0 5px; font-size: 10px; line-height: 16px; border: 1px solid currentColor; border-radius: 3px; opacity: .8; vertical-align: middle; }
