/* ヲタログの見た目
   ==================================================================
   ここは店ではなく**台帳**です。売り買いする場所ではなく、
   「何があるか」「自分は持っているか」「いくらが相場か」を調べて
   記録する道具です。通販サイトの作り（大きな赤い値段、買うボタン、
   派手な帯）はそのまま当てはまりません。

   使う人がやりたいことは3つ。見た目はこの順に合わせます。

     1. 推しのグッズを探す   → 写真が見やすく、キャラクターから辿れる
     2. 持っているか確かめる → 持ち物の印が流し見で分かる
     3. 相場を知る           → 数字が桁で揃い、比べやすい

   作りの方針
     - 細い罫と余白で整える。影と丸みは最小限。台帳らしく静かに。
     - 数字は等幅で揃える（font-variant-numeric: tabular-nums）。
     - 色は1色だけ差す。選んでいるものと、持ち物の印に使う。

   並び
     1. 下地      色・字・間隔の決めごと
     2. 骨格      ヘッダー、幅、余白
     3. 部品      ボタン、チップ、札、表、選択欄
     4. 画面      トップ、カタログ、商品、コレクション
     5. 狭い画面  スマートフォン向けの差し替え
   ================================================================== */

/* ---------- 1. 下地 ---------- */
:root {
  --bg: #f8f5f1;
  --card: #fff;
  --ink: #241e1b;
  --muted: #6f625b;
  --rule: #eadfd8;
  --rule-dark: #d6c7bd;
  --accent: #b9472d;
  --accent-dark: #96361f;
  --accent-soft: #fce9e2;
  --own: #35734f;
  --own-soft: #e4f0e8;
  --new-soft: #fff2cc;

  --gap: 16px;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img { max-width: 100%; }
h1 { font-size: 19px; margin: 0; letter-spacing: .02em; }
h2 { font-size: 15px; margin: 28px 0 10px; }

/* 数字は桁で揃える。値段や日付を縦に見比べるため。 */
.price, .num, .listings td { font-variant-numeric: tabular-nums; }
.note { font-size: 12px; color: var(--muted); }
.scroller { overflow-x: auto; }
.review-table { table-layout: fixed; width: 100%; }
.review-table td { overflow-wrap: anywhere; white-space: normal; }
.review-table textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.review-table label { display: block; margin-top: 10px; }
@media (max-width: 700px) {
  .review-table, .review-table tbody { display: block; width: 100%; }
  .review-table tr:first-child { display: none; }
  .review-table tr { display: block; padding: 12px; border-bottom: 1px solid var(--rule); }
  .review-table td { display: block; padding: 6px 0; border: 0; }
  .review-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
}

/* ---------- 2. 骨格 ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

.site-head { background: var(--card); border-bottom: 1px solid var(--rule); }
.site-head .bar { display: flex; align-items: center; gap: 18px; height: 56px; }
.brand { font-weight: 700; font-size: 19px; text-decoration: none; color: var(--ink); letter-spacing: .08em; }
.site-head nav { margin-left: auto; display: flex; gap: 16px; font-size: 13px; }
.site-head nav a { text-decoration: none; color: var(--muted); }
.site-head nav a:hover { color: var(--accent); }
.badge {
  display: inline-block; margin-left: 4px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700;
}

main { padding: 18px 0 48px; }
.site-foot {
  border-top: 1px solid var(--rule); background: var(--card);
  padding: 18px 0; font-size: 12px;
}
.site-foot a { color: var(--muted); }
.crumbs { margin: 0 0 12px; font-size: 12px; color: var(--muted); }

/* ---------- 3. 部品 ---------- */
input[type=text], input[type=search], input[type=url], input[type=number],
input[type=date], input[type=email], input[type=password], select, textarea {
  padding: 7px 10px;
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: inherit;
}
input:focus, select:focus, textarea:focus, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
button:hover { background: var(--accent-dark); }
button.ghost { background: #fff; color: var(--accent); }

.chip {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--rule-dark);
  border-radius: 999px;
  font-size: 12.5px;
  text-decoration: none;
  color: inherit;
  background: #fff;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-on { background: var(--accent-soft); border-color: #a9b6d4; color: var(--accent); }

/* 札。カテゴリのような短い分類を商品に添える。 */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 0 6px;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  color: var(--muted);
  background: #fff;
}
.tag.is-own { border-color: var(--own); color: var(--own); }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li {
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--card);
  margin-bottom: 8px;
}

.empty {
  color: var(--muted);
  padding: 56px 16px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.listings { width: 100%; border-collapse: collapse; background: var(--card); }
.listings th, .listings td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--rule);
}
.listings th { background: #f7f7f5; font-size: 12.5px; font-weight: 700; white-space: nowrap; }

.pager { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 26px; }

/* 候補が多い欄を選ぶ部品。全部並べると探せないので、文字で絞れるようにする。
   JavaScript が動かなくても、候補がそのまま並ぶだけで選択はできる。 */
.picker-head { padding: 0 12px 8px; }
.picker-filter {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  font-size: 13px;
}
.picker-list {
  display: flex;
  flex-direction: column;
  max-height: 216px;
  overflow-y: auto;
  padding: 0 6px 8px;
}
.picker-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
}
/* display を指定すると、ブラウザ既定の [hidden]{display:none} に勝ってしまう。
   絞り込みで hidden を付けても消えなかったので、ここで打ち消す。 */
.picker-item[hidden] { display: none; }
.picker-item:hover { background: var(--accent-soft); }
.picker-item input { margin: 0; flex: 0 0 auto; }
.picker-label { min-width: 0; }
.picker-note { margin-left: auto; padding-left: 8px; text-align: right; font-size: 11px; color: var(--muted); }
.picker-empty { padding: 8px 12px; margin: 0; }
/* 選んだものは上に集める。何を選んだか一目で分かるように。 */
.picker-item.is-picked { background: var(--accent-soft); order: -1; }

/* 商品の札。カード表示と台帳表示で中身は同じ、並べ方だけ変える。 */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--rule-dark); }
/* 写真はグッズの見分けに要る。読めなくても高さが変わらないよう枠を先に取る。 */
.card .thumb {
  position: relative;
  aspect-ratio: 1;
  background: #fff;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card .thumb .none {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; color: #bdbdb8;
}
/* 持ち物の印は写真の上に出す。流し見で分かることが大事。 */
.own-mark {
  position: absolute; top: 6px; left: 6px;
  background: var(--own); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 2px;
}
.card .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
/* 名前は3行まで。長さがまちまちでもカードの高さが揃う。 */
.card .name {
  font-size: 12.5px;
  line-height: 1.45;
  text-decoration: none;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .name:hover { color: var(--accent); text-decoration: underline; }
.card .kinds { display: flex; flex-wrap: wrap; gap: 3px; }
.card .spacer { flex: 1; }
/* 定価や発売日が無い商品でも高さを揃える。並べたとき段差が出ないように。 */
.card .meta { font-size: 11.5px; color: var(--muted); min-height: 17px; }
.price { font-size: 15px; font-weight: 700; }
.price .unit { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.price.unknown { font-size: 13px; font-weight: 400; color: var(--muted); }
.price.sold-out { color: #8a5528; font-size: 13px; font-weight: 700; }
.price.reached { color: var(--own); }

/* 一覧からその場で登録・解除する。商品ページを開かずに済ませるため。 */
.marks { display: flex; gap: 6px; flex-wrap: wrap; }
.marks form { display: contents; }
.mark {
  min-height: 32px; padding: 5px 7px; font-size: 12px; font-weight: 400;
  border: 1px solid var(--rule-dark); border-radius: 3px;
  background: #fff; color: var(--muted); cursor: pointer;
}
.mark:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.mark.on { border-color: var(--own); color: var(--own); background: #f2f7f4; font-weight: 700; }
.mark.on:hover { border-color: var(--own); color: var(--own); }
.mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* タッチ操作では小さな札ではなく、指で選べる操作面を確保する。 */
@media (max-width: 760px), (pointer: coarse) {
  .marks .mark { min-height: 44px; }
  .grid .marks { flex-direction: column; }
  .grid .marks .mark { width: 100%; }
}
.collection-filter { max-width: 320px; margin-bottom: 16px; }
.collection-filter .facets { position: static; }
.fav-row { display: inline-flex; align-items: center; gap: 3px; }
.fav-row form { display: contents; }
.ghost.tiny { padding: 2px 8px; font-size: 12px; width: auto; }
.star {
  padding: 1px 5px; font-size: 13px; line-height: 1.2;
  border: 1px solid var(--rule-dark); border-radius: 3px;
  background: #fff; color: var(--muted); cursor: pointer; font-weight: 400;
}
.star:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.star.on { color: #c8912a; border-color: #d9be86; background: #fdf8ee; }

/* ---------- 4. 画面 ---------- */

/* 4-1. トップ。何があるかより先に、どこから辿るかを見せる。 */
.lead {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: var(--gap);
}
.lead h1 { font-size: 22px; margin-bottom: 4px; }
.lead .searchbar { margin: 14px 0 0; padding: 0; border: 0; background: none; }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap); }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel > h2 { margin: 0; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--rule); }
.panel .links { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.panel .links a { text-decoration: none; }
.picker.wide { width: 100%; }
.picker-list.tall { max-height: 260px; }
.count { color: var(--muted); font-size: 11px; margin-left: 3px; }

/* 4-2. カタログ。左に絞り込み、右に結果。 */
.searchbar {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
}
.searchbar input { flex: 1; min-width: 0; font-size: 15px; padding: 9px 12px; }

.catalog { display: grid; grid-template-columns: 214px minmax(0, 1fr); gap: 18px; align-items: start; }

.facets {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 12px;
}
.facet { border-top: 1px solid var(--rule); }
.facet:first-of-type { border-top: 0; }
.facet > summary {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary::before { content: "＋"; color: var(--muted); font-weight: 400; font-size: 11px; }
.facet[open] > summary::before { content: "－"; }
.facet > summary:hover { background: var(--accent-soft); }
.facet-badge {
  margin-left: auto;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.facet-actions {
  padding: 12px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.facet-actions button { width: 100%; }
.facet-actions a { text-align: center; font-size: 12px; }

.results-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.applied { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.view-switch {
  margin-left: auto;
  display: flex;
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  overflow: hidden;
}
.view-switch a { padding: 4px 13px; font-size: 13px; text-decoration: none; color: var(--muted); background: #fff; }
.view-switch a + a { border-left: 1px solid var(--rule-dark); }
.view-switch a.on { background: var(--accent); color: #fff; font-weight: 700; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }

/* 台帳表示。列を揃えて、縦に見比べられるようにする。 */
.rows { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.rows .card { flex-direction: row; border: 0; border-top: 1px solid var(--rule); border-radius: 0; }
.rows .card:first-child { border-top: 0; }
.rows .thumb { width: 68px; flex: 0 0 68px; border-bottom: 0; border-right: 1px solid var(--rule); }
.rows .body { flex-direction: row; align-items: center; gap: 14px; padding: 7px 12px; }
.rows .name { -webkit-line-clamp: 2; flex: 1 1 auto; min-width: 0; }
.rows .kinds { flex: 0 0 auto; justify-content: flex-end; max-width: 190px; }
.rows .spacer { display: none; }
.rows .price { flex: 0 0 96px; text-align: right; }
.rows .meta { flex: 0 0 104px; text-align: right; }

/* 4-3. 商品ページ。買い物かごではなく、価格を比べて記録する調査票として組む。 */
.product-page { max-width: 100%; margin: 0 auto; }
.product-hero {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 42px);
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--rule);
}
.product-visual {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  background: #fafafa;
}
.product-visual img { width: 100%; height: 100%; object-fit: contain; }
.product-no-image { color: #aaa; font-size: 12px; }
.product-intro { min-width: 0; align-self: center; }
.product-eyebrow { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; font-size: 12px; }
.product-eyebrow a { text-decoration: none; }
.product-intro h1 { font-size: clamp(20px, 2.2vw, 27px); line-height: 1.45; letter-spacing: .015em; }
.product-name-note { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.product-name-note.warn { color: #8a5528; }
.price-lead { display: flex; flex-direction: column; align-items: flex-start; margin: 14px 0 12px; }
.price-lead > span:first-child { color: var(--muted); font-size: 12px; font-weight: 700; }
.price-lead > strong { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.25; font-variant-numeric: tabular-nums; }
.price-lead > strong small { margin-left: 2px; font-size: .45em; }
.price-lead .price-unavailable { color: var(--muted); font-size: 24px; }
.price-lead .price-sold-out { color: #8a5528; font-size: 24px; }
.price-lead .stock-summary { margin-top: 3px; color: var(--own); font-size: 12px; font-weight: 700; }
.price-lead .stock-guidance { margin-top: 3px; color: var(--muted); font-size: 11px; }
.price-lead > small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.product-quick-facts { display: flex; flex-wrap: wrap; margin: 0 0 14px; padding: 8px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.product-quick-facts div { min-width: 110px; padding: 2px 20px 2px 0; }
.product-quick-facts dt { color: var(--muted); font-size: 11px; }
.product-quick-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.product-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.product-actions form { margin: 0; }
.product-actions button { min-height: 40px; }
.product-actions button.secondary,
.offer-cta.secondary { background: #fff; color: var(--accent); }
.product-actions button.on { border-color: var(--own); color: var(--own); background: #f2f7f4; }
.hero-wish { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%; padding-top: 10px; }
.hero-wish label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.hero-wish input { width: 112px; min-height: 44px; font-size: 16px; }
.hero-wish .text-button { min-height: 44px; padding: 8px 16px; background: #fff; color: var(--accent); font-size: 13px; }
.hero-wish .note { flex-basis: 100%; margin: 0; }
.product-login { min-height: 40px; }

.product-section { margin-top: 14px; padding: 22px; background: var(--card); border: 1px solid var(--rule); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 0; line-height: 1.35; }
.section-heading h2 { font-size: 20px; }
.section-heading h3 { font-size: 17px; }
.section-kicker { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.availability-count { color: var(--own); font-size: 12px; font-weight: 700; }
.availability-count.sold-out { color: #8a5528; }
.offer-list { border-top: 1px solid var(--rule-dark); }
.offer { display: grid; grid-template-columns: minmax(150px, 1fr) 150px 110px 128px; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.offer.unavailable { color: var(--muted); }
.offer-shop, .offer-price { display: flex; flex-direction: column; }
.offer-shop span, .offer time { color: var(--muted); font-size: 11px; }
.offer-price strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.stock { font-size: 11px; }
.stock-available { color: var(--own); font-weight: 700; }
.offer-cta { padding: 8px 10px; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: #fff; text-align: center; text-decoration: none; font-weight: 700; }
.data-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.market-history { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--rule); }
.section-heading.compact { margin-bottom: 14px; }
.chart-stats { display: flex; flex-wrap: wrap; margin-bottom: 14px; }
.chart-stats div { min-width: 125px; padding-right: 28px; }
.chart-stats span { display: block; color: var(--muted); font-size: 10px; }
.chart-stats strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.price-chart-wrap { overflow-x: auto; padding: 8px 12px 4px; background: #fff; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.price-chart { display: block; width: 100%; height: auto; min-width: 540px; }
.chart-axis { stroke: #aaa; stroke-width: 1; }
.chart-grid { stroke: #ddd; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart-label { fill: #666; font-size: 12px; }
.history-waiting { padding: 22px; border: 1px solid var(--rule); background: #fafafa; }
.history-waiting strong, .history-waiting span { display: block; }
.history-waiting span { margin-top: 2px; color: var(--muted); font-size: 12px; }

.product-facts { margin: 0; border-top: 1px solid var(--rule); }
.product-facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.product-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.product-facts dd { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.product-maintenance { display: flex; gap: 18px; margin-top: 16px; font-size: 12px; }
.product-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.related-tile { min-width: 0; }
.related-image { display: grid; place-items: center; aspect-ratio: 1; background: #fafafa; border: 1px solid var(--rule); text-decoration: none; overflow: hidden; }
.related-image img { width: 100%; height: 100%; object-fit: contain; transition: transform .15s ease; }
.related-image:hover img { transform: scale(1.025); }
.related-image span { color: #aaa; font-size: 11px; }
.related-name { display: -webkit-box; margin-top: 7px; overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.45; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.related-name:hover { color: var(--accent); text-decoration: underline; }
.related-tile > strong { display: block; margin-top: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.related-heading { margin-top: 30px; }

@media (min-width: 980px) {
  .product-page { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, .85fr); gap: 14px; align-items: start; }
  .product-page > .crumbs, .product-page > .product-hero,
  .product-page > .product-section:not(.market-section):not(.product-detail-section) { grid-column: 1 / -1; }
  .product-page > .crumbs { margin-bottom: 0; }
  .product-page > .product-hero { margin-top: 0; }
  .product-page > .market-section { grid-column: 1; }
  .product-page > .product-detail-section { grid-column: 2; }
  .chart-layout { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; }
  .chart-stats { display: grid; gap: 10px; margin: 0; }
  .chart-stats div { min-width: 0; padding: 0; }
  .price-chart { min-width: 0; }
}

/* 4-4. 書き込む画面（商品を直す・商品を足す）
   PCでは横幅を使って「入口／本体」「説明／入力」を並べる。スマホ用の細い
   フォームを左端に置くだけの画面にしない。 */
.form-page { max-width: 1120px; margin: 0 auto; }
.form-page > h1 { margin-bottom: 16px; font-size: 25px; }
.panel-body { padding: 20px; }
.form-page .field { margin-bottom: 18px; }
.form-page .field > label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.form-page .errors { color: #a33; font-size: 12px; }
.form-page .actions { display: flex; align-items: center; gap: 14px; }
.form-page input[type=text], .form-page input[type=url],
.form-page input[type=number], .form-page input[type=date],
.form-page select, .form-page textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .field-aliases, .form-grid .field-categories,
.form-grid .field-ips, .form-grid .field-characters,
.form-grid .field-tags, .form-grid .field-note,
.form-grid > .actions { grid-column: 1 / -1; }
.add-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.add-quick { position: sticky; top: 92px; }
.add-quick input[type=url] { width: 100%; }
.add-manual .panel-body > .note, .add-quick .panel-body > .note { margin-top: 0; }
.edit-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.edit-context { position: sticky; top: 92px; padding: 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
.edit-context > strong { display: block; margin: 5px 0 18px; line-height: 1.55; }
.edit-context .callout { margin-bottom: 0; }
.edit-form { min-width: 0; }
/* 選ぶ欄は枠で囲う。どこからどこまでが1つの欄か分かるように。 */
.form-page .picker {
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  background: var(--card);
  padding-top: 8px;
}
.form-page .picker .picker-head { padding: 0 8px 8px; }

/* 問い合わせは説明と入力を一つのPC画面として構成する。 */
.contact-page { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 570px); justify-content: center; gap: 42px; max-width: 1000px; margin: 20px auto 0; align-items: start; }
.contact-intro { padding-top: 18px; }
.contact-intro h1 { margin: 5px 0 12px; font-size: 28px; }
.contact-intro > p:not(.crumbs) { color: var(--muted); line-height: 1.8; }
.contact-notes { margin: 24px 0 0; padding: 18px 20px 18px 38px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 12px; }
.contact-notes li + li { margin-top: 8px; }
.contact-form-card .panel-body { padding: 22px; }
.contact-form-card .field { margin-bottom: 18px; }
.contact-form-card label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.contact-form-card select, .contact-form-card input, .contact-form-card textarea { width: 100%; }
.contact-form-card textarea { min-height: 190px; resize: vertical; }
.contact-form-card .errors { margin-top: 4px; color: #a33; font-size: 12px; }

.callout.warn { border-left-color: #b4532a; }
.callout {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}

/* 4-4b. 一緒に登録する画面 */
.together { max-width: 760px; margin: 24px auto 0; }
.registration-summary { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.registration-check { display: grid; place-items: center; flex: 0 0 40px; height: 40px; color: var(--own); background: var(--own-soft); border-radius: 50%; font-size: 22px; }
.registration-summary h1 { font-size: 22px; }
.registration-product { margin: 8px 0; font-weight: 700; overflow-wrap: anywhere; }
.registration-summary .note { margin: 8px 0 0; font-size: 13px; }
.registration-error { padding: 12px 14px; border-left: 3px solid #a33; background: #fff5f3; color: #a33; }
.wish-removal-choice { display: flex; align-items: flex-start; gap: 10px; padding: 14px; cursor: pointer; }
.wish-removal-choice input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; }
.wish-removal-choice .note { display: block; margin-top: 4px; }
.together-group { margin: 16px 0; }
.together-group h2 {
  margin: 0; padding: 8px 10px 8px 14px; font-size: 13px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 8px;
}
.pick-all { margin-left: auto; padding: 3px 12px; font-size: 12px; }
.together-group .group-note { margin: 0; padding: 8px 14px 0; }
.together .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--rule); }
.together .actions > * { min-height: 44px; padding: 10px 24px; font-size: 14px; }
.buy-fields { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 14px; }
.buy-fields .field { margin: 0; flex: 1 1 200px; min-width: 0; }
.buy-fields input { width: 100%; min-height: 44px; font-size: 16px; }
.buy-fields label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }

/* 4-5. 一覧の表（修正の確認、履歴） */
.table-page .listings { border: 1px solid var(--rule); border-radius: var(--radius); }
.nowrap { white-space: nowrap; }
.inline-form { display: inline; }

/* ---------- 5. 狭い画面 ---------- */
/* 広い画面では、絞り込みは常に開いたまま出す（開閉の見出しは隠す）。 */
.facets-toggle { display: none; }
/* 広い画面では畳む見出しを出さない。開閉そのものは picker.js が面倒を見る
   （閉じた <details> の中身は、新しいブラウザだとCSSでは出せないため）。 */
@media (max-width: 760px) {
  .catalog { grid-template-columns: 1fr; }
  .facets { position: static; }
  /* 絞り込みは畳んでおく。開くまで商品が下に押し出されない。 */
  .facets-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  .facets-toggle::-webkit-details-marker { display: none; }
  .facets-toggle::after { content: "▾"; margin-left: auto; color: var(--muted); }
  .facets[open] > .facets-toggle::after { content: "▴"; }
  .facets[open] > .facets-toggle { border-bottom: 1px solid var(--rule); }
  .picker-list { max-height: 42vh; }

  /* 見出し・件数・並び替え・表示切替が1行に入らないので折り返す。 */
  .results-head { flex-wrap: wrap; gap: 6px 10px; }
  .results-head h1 { flex: 0 0 auto; }
  .view-switch { margin-left: auto; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
  .figures { flex-direction: column; }
  .figure { border-right: 0; border-bottom: 1px solid var(--rule); }
  .figure:last-child { border-bottom: 0; }
  .site-head .bar { height: auto; padding: 8px 0; flex-wrap: wrap; gap: 8px 14px; }
  .site-head nav { margin-left: 0; width: 100%; gap: 14px; }
  .rows .body { flex-wrap: wrap; gap: 2px 12px; }
  .rows .name { flex: 1 1 100%; }
  .rows .kinds { justify-content: flex-start; }
  .rows .price, .rows .meta { flex: 0 0 auto; text-align: left; }

  .product-hero { grid-template-columns: minmax(220px, 34%) minmax(0, 1fr); gap: 24px; }
  .product-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lead { padding: 18px 16px; }
}

/* ---------- マイページのタブ ----------
   コレクション・ほしい・お気に入り・値下がりは、どれも「自分の記録」です。
   ナビに4つ並べるのをやめ、ここで切り替えます。

   **横に溢れさせません。** 幅400pxでも4つ収まるよう、文字を詰めて折り返し
   可能にしてあります。溢れるくらいなら2段になったほうが押せます。 */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 var(--gap);
  border-bottom: 1px solid var(--rule);
}
.tabs a {
  padding: 9px 14px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  white-space: nowrap;
  font-size: 14px;
}
.tabs a:hover { color: var(--ink); background: var(--accent-soft); }
.tabs a.on {
  color: var(--ink);
  font-weight: 700;
  background: var(--card);
  border-color: var(--rule);
  /* 下の罫線を1px分だけ消して、選んでいるタブと中身を繋げる */
  margin-bottom: -1px;
  border-bottom: 1px solid var(--card);
}

/* ---------- 押させたい導線 ---------- */
.button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 700;
}
.button:hover { background: var(--accent-dark); }

/* 探し終えた位置に置く、控えめな追加の導線。 */
.add-hint {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid var(--rule);
  text-align: center;
}

@media (max-width: 480px) {
  .tabs a { padding: 9px 10px; font-size: 13px; }

  .product-page { margin: 0 -16px; }
  .product-page .crumbs { padding: 0 16px; }
  .product-hero { grid-template-columns: 1fr; gap: 18px; padding: 16px; border-left: 0; border-right: 0; }
  .product-visual { max-height: 310px; }
  .product-intro h1 { font-size: 20px; }
  .price-lead { margin: 18px 0 14px; }
  .price-lead > strong { font-size: 34px; }
  .product-quick-facts div { min-width: 50%; padding-right: 10px; }
  .product-actions, .product-actions > form { width: 100%; }
  .product-actions button, .product-login { width: 100%; text-align: center; }
  .hero-wish { display: grid; grid-template-columns: 1fr auto; }
  .hero-wish label { justify-content: flex-start; }
  .hero-wish .note { grid-column: 1 / -1; }
  .product-section { margin-top: 10px; padding: 20px 16px; border-left: 0; border-right: 0; }
  .section-heading h2 { font-size: 18px; }
  .offer { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; }
  .offer-price { align-items: flex-end; text-align: right; }
  .offer time { align-self: center; }
  .offer-cta { min-width: 122px; }
  .market-history { margin-top: 26px; padding-top: 22px; }
  .chart-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .chart-stats div { min-width: 0; padding: 0; }
  .chart-stats strong { font-size: 13px; }
  .price-chart-wrap { margin-right: -16px; border-right: 0; }
  .product-facts > div { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
  .product-strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; scroll-snap-type: x proximity; }
  .related-tile { flex: 0 0 148px; scroll-snap-align: start; }

  /* 150pxほどの札を2列にすると、長い商品名も値段も読めません。
     狭い画面では写真と情報を横に並べ、1商品を1行として比べます。 */
  .grid { grid-template-columns: 1fr; }
  .grid .card { flex-direction: row; min-height: 132px; }
  .grid .card .thumb {
    width: 132px;
    flex: 0 0 132px;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }
  .grid .card .body { min-width: 0; }
  .grid .card .name { font-size: 13px; }

  /* 作品名を右端へ押すと、人物名が1文字幅まで潰れて縦書きになります。 */
  .picker-item { align-items: flex-start; flex-direction: column; gap: 0; }
  .picker-note { margin-left: 0; padding-left: 0; text-align: left; }

  /* 店舗が増えても横長の表を縮めない。1店舗ずつ読める札にする。 */
  .shop-listings,
  .shop-listings tbody { display: block; width: 100%; }
  .shop-listings tr:first-child { display: none; }
  .shop-listings tr {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid var(--rule);
  }
  .shop-listings tr:last-child { border-bottom: 0; }
  .shop-listings td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }
  .shop-listings td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
  }
}
.milestone-lead { display: flex; align-items: center; min-height: 180px; padding: 26px; background: linear-gradient(120deg,#fff 0 65%,var(--accent-soft) 65%); }
.milestone-lead h1 { margin-top: 5px; font-size: 27px; }
.milestone-lead > strong { display: grid; place-items: center; width: 110px; height: 110px; margin-left: auto; border-radius: 50%; background: var(--accent); color: #fff; font-size: 35px; box-shadow: 8px 8px 0 #f3b4a2; }
.milestone-list, .almost-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-top: 16px; }
.milestone-list article, .almost-list article { padding: 17px; }
.milestone-list time { color: var(--accent); font-size: 10px; }
.milestone-list h2 { margin: 5px 0; }
.almost-list header, .almost-list footer { display: flex; justify-content: space-between; gap: 10px; }
.almost-list header a { color: var(--ink); font-weight: 800; text-decoration: none; }
.almost-list .rate-bar { margin: 14px 0 8px; }
.almost-list footer { color: var(--muted); font-size: 11px; }
.almost-list footer b { color: var(--accent); }
.atlas-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.atlas-heading h1 { margin: 4px 0; font-size: 26px; }
.collection-atlas { position: relative; height: 580px; overflow: hidden; border-radius: 14px; background: #fff; }
.atlas-tile { container-type: size; position: absolute; overflow: hidden; padding: 10px; box-shadow: inset 0 0 0 2px var(--bg); background: color-mix(in srgb, var(--accent) calc(var(--owned) * .35%), #f2d0c7); color: #33231f; text-decoration: none; }
.atlas-tile strong, .atlas-tile span { display: block; }
.atlas-tile strong { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.atlas-tile span, .atlas-tile small { font-size: 9px; }
.atlas-tile b { position: absolute; right: 8px; bottom: 5px; font-size: 22px; }
.atlas-tile small { position: absolute; left: 9px; bottom: 7px; }
/* 小さな人物も面積から消さない。ただし読めない文字を重ねず、名前はリンクの
   aria相当（要素の本文）と遷移先で確認する。 */
@container (max-width: 105px) { .atlas-tile span, .atlas-tile small { display: none; } }
@container (max-width: 58px) { .atlas-tile strong { font-size: 7px; } .atlas-tile b { display: none; } }
@container (max-height: 48px) { .atlas-tile span, .atlas-tile b, .atlas-tile small { display: none; } }
@container (max-height: 25px) { .atlas-tile strong { display: none; } }
.atlas-tile-compact span, .atlas-tile-compact small { display: none; }
.atlas-tile-tiny > * { display: none !important; }
@media(max-width:760px){.milestone-list,.almost-list{grid-template-columns:1fr}.collection-atlas{height:620px}.atlas-heading{align-items:flex-start;flex-direction:column}.atlas-heading form,.atlas-heading select{width:100%}}
@media(max-width:480px){.milestone-lead{padding:20px}.milestone-lead h1{font-size:21px}.milestone-lead>strong{width:82px;height:82px;font-size:27px}.atlas-tile{padding:6px}.atlas-tile strong{font-size:9px}.atlas-tile span{display:none}.atlas-tile b{font-size:15px}.atlas-tile small{display:none}}

/* 購入履歴と年間カレンダー。利用者が入力した日付だけを表示する。 */
.collection-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.collection-tools a { padding: 14px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.collection-tools strong, .collection-tools span { display: block; }
.collection-tools span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 14px; overflow: hidden; border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
.figure { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--rule); }
.figure:last-child { border-right: 0; }
.figure .label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.figure .num, .figure .price { display: block; font-size: 20px; font-weight: 800; }
.history-heading, .calendar-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.history-heading h1, .calendar-heading h1 { font-size: 26px; }
.history-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; }
.collection-timeline { position: relative; padding-left: 42px; }
.collection-timeline::before { content: ""; position: absolute; left: 14px; top: 10px; bottom: 0; width: 3px; border-radius: 3px; background: var(--rule); }
.timeline-year { position: relative; margin: 0 0 12px -42px; padding-left: 42px; font-size: 20px; }
.timeline-year::before { content: ""; position: absolute; left: 6px; top: 2px; width: 19px; height: 19px; border: 4px solid var(--bg); border-radius: 50%; background: var(--ink); }
.timeline-month { position: relative; margin-bottom: 14px; padding: 16px; }
.timeline-month::before { content: ""; position: absolute; left: -36px; top: 19px; width: 14px; height: 14px; border: 4px solid var(--bg); border-radius: 50%; background: var(--accent); }
.timeline-month header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.timeline-month time { color: var(--accent); font-size: 12px; font-weight: 800; }
.timeline-products { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.timeline-products a { min-width: 0; color: var(--muted); text-decoration: none; }
.timeline-products img, .timeline-products a > span { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 8px; background: #f2eeea; object-fit: contain; }
.timeline-products small { display: block; margin-top: 3px; text-align: center; }
.history-summary { display: grid; align-content: start; gap: 12px; }
.history-summary section { padding: 17px; }
.history-summary span, .history-summary strong, .history-summary small { display: block; }
.history-summary span, .history-summary small { color: var(--muted); font-size: 11px; }
.history-summary strong { margin: 4px 0; font-size: 28px; }
.year-links { display: flex; gap: 12px; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 16px; }
.year-calendar { padding: 18px; }
.calendar-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.calendar-month { padding: 12px; border: 1px solid var(--rule); border-radius: 11px; }
.calendar-month h2 { margin: 0 0 7px; font-size: 13px; }
.weekday, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.weekday span { color: var(--muted); font-size: 8px; text-align: center; }
.calendar-days span { display: grid; place-items: center; height: 23px; border-radius: 4px; background: #f2eeea; color: var(--muted); font-size: 8px; }
.calendar-days .outside { visibility: hidden; }
.calendar-days .one { background: #f5c3b5; color: var(--ink); }
.calendar-days .many { background: var(--accent); color: #fff; font-weight: 800; }
.calendar-month footer { margin-top: 7px; text-align: right; font-size: 10px; }
.calendar-summary { align-self: start; padding: 18px; }
.calendar-summary h2 { margin-top: 0; }
.calendar-summary > div { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.calendar-summary span, .calendar-summary strong { display: block; }
.calendar-summary span { color: var(--muted); font-size: 11px; }
.calendar-summary strong { font-size: 27px; }
.calendar-summary .button { margin-top: 16px; text-align: center; }
@media (max-width: 760px) {
  .collection-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures { grid-template-columns: 1fr; }
  .figure { border-right: 0; border-bottom: 1px solid var(--rule); }
  .figure:last-child { border-bottom: 0; }
  .history-layout, .calendar-layout { grid-template-columns: 1fr; }
  .history-summary, .calendar-summary { order: -1; }
  .history-summary { grid-template-columns: 1fr 1fr; }
  .calendar-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .collection-tools { grid-template-columns: 1fr; }
  .history-heading, .calendar-heading { align-items: flex-start; flex-direction: column; }
  .history-summary { grid-template-columns: 1fr; }
  .collection-timeline { padding-left: 30px; }
  .collection-timeline::before { left: 7px; }
  .timeline-year { margin-left: -30px; padding-left: 30px; }
  .timeline-year::before { left: -1px; }
  .timeline-month::before { left: -31px; }
  .calendar-months { grid-template-columns: 1fr; }
}

/* ---------- アカウント ---------- */
.account-page { max-width: 520px; margin: 12px auto 0; }
.account-card {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.account-card h1 { margin-bottom: 8px; }
.account-card form > p { margin: 14px 0; }
.account-card form > p label { display: block; margin-bottom: 4px; font-weight: 700; }
.account-card form input[type=email],
.account-card form input[type=password],
.account-card form input[type=text] { width: 100%; }
.account-card .helptext { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.account-card ul.errorlist { margin: 4px 0; padding-left: 20px; color: #a33; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.account-page.account-layout { display: grid; grid-template-columns: minmax(0, 520px) minmax(260px, 350px); gap: 34px; max-width: 904px; margin-top: 42px; align-items: center; }
.account-side { padding: 24px 0; }
.account-side h2 { margin: 5px 0 10px; font-size: 24px; }
.account-side p { color: var(--muted); }
.account-side ul { margin: 20px 0 0; padding: 18px 0 18px 22px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 12px; }
.account-side li + li { margin-top: 7px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; max-width: 940px; margin: 16px auto 0; align-items: start; }
.settings-card > h2 { margin: 0; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.settings-card .panel-body { padding: 20px; }
.settings-lead { margin-top: 0; font-weight: 700; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.settings-form .field:first-of-type { grid-column: 1 / -1; }
.settings-form label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 700; }
.settings-form input, .settings-form select { width: 100%; }
.settings-form button { grid-column: 1 / -1; justify-self: start; }
.settings-form .errors { color: #a33; font-size: 12px; }
.account-settings .product-facts > div { grid-template-columns: 110px minmax(0, 1fr); }
.account-settings .actions { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; }

/* 追加の入口は2つある。URLからの取り込みと、手入力。 */
.add-ways { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.button.ghost:hover { background: var(--accent-soft); }
.req { font-size: 11px; color: #a33; font-weight: 400; }
.error { color: #a33; font-size: 12px; margin: 4px 0 0; }

/* 1枚の画面で、かんたん登録と手入力を隔てる線。 */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: calc(var(--gap) * 1.5) 0;
  color: var(--muted);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

/* 分類の見取り図。木の深さは字下げで見せる。
   スマホでも読めるように、深さ1段あたりの字下げは小さく取る。 */
.tree { list-style: none; margin: 0; padding: 8px 14px; }
.tree-row { padding: 3px 0; font-size: 13px; line-height: 1.5; }
.tree-row a { text-decoration: none; }
.tree-row a:hover { text-decoration: underline; }
.tree-empty a { color: var(--muted); }
.tree-row.depth-1 { padding-left: 14px; }
.tree-row.depth-2 { padding-left: 28px; }
.tree-row.depth-3 { padding-left: 42px; }
.tree-row.depth-1::before,
.tree-row.depth-2::before,
.tree-row.depth-3::before { content: "└ "; color: var(--muted); }
.tree .mark {
  font-size: 10px; color: var(--muted); border: 1px solid var(--rule);
  border-radius: 999px; padding: 0 6px; margin-left: 6px; white-space: nowrap;
}
.mark-hold { color: var(--accent); border-color: #a9b6d4; }

/* ---------- 公開版の共通デザイン ----------
   比較試作で採用した白・薄い生成り・コーラル・緑を全画面へ適用する。
   丸みはカードのまとまりにだけ使い、価格や件数は引き続き桁を揃える。 */
.wrap { max-width: 1340px; padding-left: 24px; padding-right: 24px; }
.site-main { min-height: calc(100vh - 132px); padding-top: 26px; padding-bottom: 80px; }
.site-head {
  position: sticky; top: 0; z-index: 50;
  border-color: var(--rule); background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.site-head .bar { height: 68px; gap: 24px; }
.brand { color: var(--accent); font-size: 20px; font-weight: 900; }
.site-head .desktop-nav { margin-left: 0; gap: 3px; }
.site-head .desktop-nav a { padding: 8px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.site-head .desktop-nav a.on { background: var(--accent); color: #fff; }
.head-search {
  width: min(330px, 30vw); margin-left: auto; padding: 9px 15px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--bg);
  color: var(--muted); font-size: 12px; text-decoration: none;
}
.head-search::before { content: "⌕"; margin-right: 8px; font-size: 15px; }
.account-link { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; text-decoration: none; }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 900; }
.mobile-nav { display: none; }
.panel { box-shadow: 0 8px 30px rgba(76,47,32,.06); }
button, .button, .offer-cta { border-radius: 999px; }
.chip { padding: 4px 10px; border-color: var(--rule); }

/* トップ */
.home-hero { padding: 36px 0 30px; text-align: center; }
.home-hero h1 { margin: 5px 0 8px; font-size: clamp(25px, 3vw, 34px); line-height: 1.35; }
.home-hero p { margin: 0; color: var(--muted); }
.hero-search { display: flex; width: min(720px, 100%); margin: 20px auto 0; border: 2px solid var(--ink); border-radius: 17px; background: #fff; box-shadow: 7px 7px 0 var(--accent-soft); overflow: hidden; text-align: left; }
.hero-search input { flex: 1; min-width: 0; padding: 16px 18px; border: 0; outline: 0; font-size: 14px; }
.hero-search button { margin: 6px; padding-left: 22px; padding-right: 22px; }
.home-entry-panel { margin-bottom: 16px; padding: 18px; }
.home-entry-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.home-entry-grid > a { min-height: 94px; padding: 14px; border-radius: 12px; background: #f3ede8; color: var(--ink); text-decoration: none; }
.home-entry-grid > a:hover { background: var(--accent-soft); }
.home-entry-grid strong, .home-entry-grid span { display: block; }
.home-entry-grid strong { font-size: 12px; }
.home-entry-grid span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; }
.home-products, .home-side { padding: 18px; }
.home-product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.home-side h2 { margin: 0 0 8px; }
.home-side > a:not(.button) { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); color: var(--ink); font-size: 11px; text-decoration: none; }
.home-side > a strong { color: var(--accent); }
.home-side .button { margin-top: 16px; text-align: center; }
.home-benefit { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 11px; }
.home-benefit::before { content: "✓"; margin-right: 7px; color: var(--own); font-weight: 900; }
.home-browse { margin-top: 25px; }
.home-browse .links { display: flex; flex-wrap: wrap; gap: 6px; }
.home-browse .picker { padding: 12px 0 4px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
.character-search { display: flex; gap: 8px; max-width: 720px; }
.character-search input { flex: 1; min-width: 0; }
.character-results { margin-top: 10px; max-width: 720px; }
.facet-guidance { margin: 0; padding: 12px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.empty-action { text-align: center; }
.empty-action h2 { margin: 0 0 8px; }
.empty-action .button { display: inline-block; margin-top: 10px; }

/* 商品ページ：販売状態を見出しの段階で区別する。 */
.product-page { max-width: 1180px; }
.product-hero, .product-section { border-radius: 18px; box-shadow: 0 8px 30px rgba(76,47,32,.05); }
.offer-groups { display: grid; gap: 14px; }
.offer-group { overflow: hidden; border: 1px solid var(--rule); border-radius: 12px; }
.offer-group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 14px; background: #f5f1ed; }
.offer-group-new .offer-group-head { background: var(--new-soft); }
.offer-group-used .offer-group-head { background: #f0ece8; }
.offer-group-marketplace .offer-group-head { background: #f1eef8; }
.offer-group-buyback .offer-group-head { background: var(--own-soft); }
.offer-group-head > div { display: flex; align-items: center; gap: 8px; }
.offer-group-head h3 { margin: 0; font-size: 13px; }
.offer-group-head > strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.condition-badge { padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.condition-used { background: #ded6d0; color: #5d514a; }
.condition-new { background: #ffdfa0; color: #805500; }
.condition-marketplace { background: #ded8ee; color: #59487a; }
.condition-buyback { background: #cfe4d7; color: #2f6748; }
.offer-group .offer-list { border-top: 0; }
.offer-group .offer { padding-left: 14px; padding-right: 14px; }
.offer-group .offer:first-child { border-top: 1px solid var(--rule); }
.product-facts dd .chip, .fav-row .chip { background: var(--bg); }

@media (max-width: 760px) {
  body { padding-bottom: 64px; }
  .wrap { padding-left: 12px; padding-right: 12px; }
  .site-main { padding-top: 16px; padding-bottom: 28px; }
  .site-head .bar { height: 58px; padding: 0 12px; flex-wrap: nowrap; }
  .desktop-nav, .head-search { display: none !important; }
  .account-link { margin-left: auto; }
  .account-link span:last-child { display: none; }
  .form-page > h1 { font-size: 21px; }
  .add-layout, .edit-layout, .contact-page { grid-template-columns: 1fr; gap: 14px; }
  .add-quick, .edit-context { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field, .form-grid > .actions { grid-column: 1; }
  .panel-body { padding: 15px; }
  .contact-page { margin-top: 0; }
  .contact-intro { padding-top: 0; }
  .contact-intro h1 { font-size: 23px; }
  .contact-notes { margin-top: 16px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-form { grid-template-columns: 1fr; }
  .settings-form .field, .settings-form button { grid-column: 1; }
  .account-page.account-layout { grid-template-columns: 1fr; gap: 14px; margin-top: 0; }
  .account-side { padding: 8px 4px; }
  .account-side h2 { font-size: 20px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; height: 64px; border-top: 1px solid var(--rule); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
  .mobile-nav a { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); font-size: 9px; text-decoration: none; }
  .mobile-nav a b { font-size: 17px; line-height: 1; }
  .mobile-nav a.on { color: var(--accent); }
  .home-hero { padding: 22px 0 24px; }
  .home-hero h1 { font-size: 24px; }
  .home-hero p { font-size: 11px; }
  .hero-search { box-shadow: 5px 5px 0 var(--accent-soft); }
  .hero-search input { padding: 13px; }
  .hero-search button { padding: 8px 14px; }
  .home-entry-panel, .home-products, .home-side { padding: 13px; }
  .home-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-entry-grid > a { min-height: 78px; }
  .home-layout { grid-template-columns: 1fr; }
  .home-side { order: -1; }
  .home-product-grid { grid-template-columns: 1fr; }
  .character-search { flex-direction: column; }
  .section-heading { flex-wrap: wrap; }
  .product-hero { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .product-visual { width: 100%; max-height: none; overflow: hidden; aspect-ratio: 1; }
  .product-visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .product-intro { width: 100%; }
  .offer-group-head { align-items: flex-start; }
  .offer-group-head > div { align-items: flex-start; }
  .offer-group-head h3 { line-height: 1.45; }
}

@media (max-width: 480px) {
  /* 共通の左右余白を16pxから12pxへ変えたため、旧商品の全幅表示も同じ値で相殺する。 */
  .product-page { margin-left: -12px; margin-right: -12px; }
  .product-page .crumbs { padding-left: 12px; padding-right: 12px; }
  .product-hero, .product-section { border-radius: 0; }
  .product-visual { max-height: none; }
  .product-strip { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .price-chart-wrap { margin-right: -12px; }
  .offer-group .offer { padding-left: 12px; padding-right: 12px; }
  .alerts-table, .alerts-table tbody { display: block; width: 100%; }
  .alerts-table tr:first-child { display: none; }
  .alerts-table tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
  .alerts-table tr:last-child { border-bottom: 0; }
  .alerts-table td { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border: 0; text-align: right; }
  .alerts-table td:first-child { display: block; padding-bottom: 9px; text-align: left; }
  .alerts-table td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 700; text-align: left; }
  .alerts-table td:first-child::before { display: block; margin-bottom: 3px; }
}
.listing-correction { max-width: 48rem; margin: 2rem auto; padding: 0 1rem; overflow-wrap: anywhere; }
.listing-correction input:not([type="checkbox"]), .listing-correction select, .listing-correction textarea { box-sizing: border-box; max-width: 100%; width: 100%; }
.listing-correction label { display: block; margin-bottom: .4rem; }
.listing-correction .helptext { display: block; font-size: .9rem; }
.offer-details .offer-shop, .offer-details .offer-price { min-width: 0; overflow-wrap: anywhere; }
/* どのページでも同じ登録画面。375pxでも画面内で入力・解除確認を完結する。 */
#record-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-sizing: border-box; border: 1px solid #ccc; border-radius: 12px; padding: 20px; overflow: auto; color: #252525; background: #fff; }
#record-dialog::backdrop { background: rgb(0 0 0 / .45); }
.record-dialog-close { display: block; margin-left: auto; }
.record-editor { max-width: 560px; margin: auto; }
.record-product-name { overflow-wrap: anywhere; }
.record-editor input:not([type=checkbox]):not([type=hidden]), .record-editor textarea { display: block; width: 100%; box-sizing: border-box; }
.record-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.record-remove { margin-top: 24px; border-top: 1px solid #ddd; padding-top: 16px; }
.record-remove summary { cursor: pointer; padding: 8px 0; }
.record-remove label { display: block; margin: 12px 0; }
.record-errors, .record-request-error { color: #942323; }
.record-notice:not(:empty) { position: fixed; bottom: 80px; left: 12px; right: 12px; margin: auto; width: fit-content; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 12px 18px; background: #21392d; color: #fff; border-radius: 8px; z-index: 20; pointer-events: none; }
.marks a.mark { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; box-sizing: border-box; }
