/* ============================================================
   ガチャ沼交換ナビ（交換掲示板）専用スタイル
   style.css の CSS変数（--color-* / --radius / --shadow）を前提にする。
   掲示板の3画面（ハブ・投稿フォーム・募集詳細）でしか使わないので分離。
   ============================================================ */

.ex-testing-note {
  margin: 0 0 14px;
  padding: 8px 12px;
  font-size: .8rem;
  color: var(--color-muted);
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

/* ── ボタン・フォーム部品 ── */
.ex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.ex-btn:hover { filter: brightness(.98); }
.ex-btn:disabled { opacity: .6; cursor: wait; }
.ex-btn--wide { width: 100%; box-sizing: border-box; margin-bottom: 10px; }
.ex-btn--primary { color: #fff; background: var(--color-accent, #e07a3a); border-color: transparent; }
.ex-btn--ghost { background: var(--color-bg); }
.ex-btn--danger { color: #8a2424; background: #fdeeee; border-color: #f0c0c0; }
.ex-btn--flea { color: #fff; background: #ff0033; border-color: transparent; }
.ex-btn--x { color: #fff; background: #000; border-color: transparent; }
.ex-btn--copy { color: #fff; background: #06c755; border-color: transparent; }
.ex-btn--line { color: #fff; background: #06c755; border-color: transparent; }
.ex-btn.is-done { background: #e8f6ec; color: #1a6b32; border-color: #b7e0c2; }

.ex-label {
  display: block;
  margin: 14px 0 4px;
  font-size: .86rem;
  font-weight: 700;
}
.ex-req {
  margin-left: 6px;
  padding: 1px 6px;
  font-size: .7rem;
  font-weight: 700;
  color: #8a2424;
  background: #fdeeee;
  border-radius: 4px;
}
.ex-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
  font-size: .95rem;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.ex-input:focus {
  outline: 2px solid color-mix(in srgb, var(--color-accent, #e07a3a) 45%, transparent);
  outline-offset: 1px;
}
.ex-textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.ex-note { margin: 6px 0 0; font-size: .78rem; line-height: 1.6; color: var(--color-muted); }
.ex-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ex-status-msg {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: .86rem;
  line-height: 1.5;
}
.ex-status-msg.is-ok { background: #e8f6ec; color: #1a6b32; border: 1px solid #b7e0c2; }
.ex-status-msg.is-err { background: #fdeeee; color: #8a2424; border: 1px solid #f0c0c0; }

/* ── ハブ ── */
.ex-hub-cta { margin: 16px 0 22px; }
.ex-how { margin: 22px 0; }
.ex-how-list { margin: 8px 0 0; padding-left: 1.3em; font-size: .9rem; line-height: 1.8; }
.ex-rules { margin-top: 28px; }
.ex-rules-list { margin: 8px 0 0; padding-left: 1.2em; font-size: .86rem; line-height: 1.9; }

.ex-card-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ex-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ex-card:hover { border-color: var(--color-accent); }
.ex-card-img {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--color-bg);
}
.ex-card-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-card-badges,
.ex-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ex-card-pair {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.45;
}
.ex-card-role { display: block; }
.ex-swap--vert { display: block; font-size: .95rem; line-height: 1.1; color: var(--color-accent, #e07a3a); }
.ex-card-pair b,
.ex-summary-row b {
  display: inline-block;
  margin-right: 3px;
  padding: 0 5px;
  font-size: .72rem;
  color: #fff;
  background: var(--color-muted);
  border-radius: 3px;
  vertical-align: middle;
}
.ex-card-meta { font-size: .76rem; color: var(--color-muted); }
.ex-card-status,
.ex-status {
  display: inline-block;
  padding: 1px 8px;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--color-stock-bg);
  color: var(--color-stock);
}
.ex-card-status--talking, .ex-status--talking { background: var(--color-refill-bg); color: var(--color-refill); }
.ex-card-status--done, .ex-status--done,
.ex-card-status--expired, .ex-status--expired { background: var(--color-bg); color: var(--color-muted); }
.ex-empty { padding: 28px 12px; text-align: center; color: var(--color-muted); font-size: .9rem; }

.ex-badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: .74rem;
  font-weight: 700;
  color: #4b3ba8;
  background: #eeeaff;
  border-radius: 999px;
}
.ex-badge--sm { font-size: .68rem; }
.ex-badge-note { margin-left: 5px; font-weight: 400; font-size: .66rem; opacity: .75; }

/* ── 投稿フォーム ── */
.ex-stepbar {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: .72rem;
  color: var(--color-muted);
}
.ex-stepbar li {
  flex: 1;
  padding: 5px 2px;
  text-align: center;
  background: var(--color-bg);
  border-radius: 4px;
}
.ex-stepbar li.is-current { color: #fff; background: var(--color-accent, #e07a3a); font-weight: 700; }
.ex-stepbar li.is-done { color: var(--color-stock); background: var(--color-stock-bg); }
.ex-step-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; }
.ex-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: .82rem;
  color: #fff;
  background: var(--color-accent, #e07a3a);
  border-radius: 50%;
}
.ex-step-nav { display: flex; gap: 8px; margin-top: 18px; }
.ex-step-nav .ex-btn { flex: 1; }

.ex-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  background: var(--color-bg);
  border-radius: var(--radius);
}
.ex-preview-img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; }
.ex-preview-title { margin: 0; font-size: .86rem; line-height: 1.5; }

/* フリマ側の記載をそのまま見せる行（色や種類の指定を条件欄へ書き写してもらう） */
.ex-hint {
  margin: 0 0 10px;
  padding: 8px 11px;
  font-size: .84rem;
  line-height: 1.6;
  background: var(--color-bg);
  border-left: 3px solid var(--color-accent, #e07a3a);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ex-chips-empty { margin: 0; font-size: .8rem; color: var(--color-muted); }
.ex-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 10px;
  font-size: .84rem;
  font-weight: 700;
  background: var(--color-accent-bg);
  border-radius: 999px;
}
.ex-chip--free { background: var(--color-refill-bg); }
.ex-entry-cta { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 10px; }
.ex-picked-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border, #e5ddd4);
  border-radius: var(--radius);
}
.ex-picked-img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3eee8;
  flex-shrink: 0;
}
.ex-picked-main { flex: 1; min-width: 0; }
.ex-picked-title {
  margin: 0 0 8px;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
}
.ex-btn--entry {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: .95rem;
  color: #fff;
  background: var(--color-accent, #e07a3a);
  border-color: transparent;
}
.ex-lineup {
  margin: 0 0 10px;
  padding: 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border, #e5ddd4);
  border-radius: var(--radius);
}
.ex-lineup-head { margin: 0 0 8px; font-size: .82rem; font-weight: 700; }
.ex-lineup-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-lineup-btn {
  padding: 6px 10px;
  font-size: .8rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--color-border, #e5ddd4);
  border-radius: 999px;
  cursor: pointer;
}
.ex-lineup-btn.is-on,
.ex-lineup-btn--any.is-on { background: var(--color-accent-bg); border-color: var(--color-accent, #e07a3a); }
.ex-lineup-btn--hint { box-shadow: 0 0 0 2px rgba(224, 122, 58, .35); }
.ex-chip-x {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: .9rem;
  line-height: 1;
  color: var(--color-muted);
  background: rgba(255, 255, 255, .7);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.ex-free-tag {
  margin-left: 5px;
  padding: 0 5px;
  font-size: .68rem;
  font-weight: 700;
  color: var(--color-refill);
  background: var(--color-refill-bg);
  border-radius: 3px;
}

.ex-suggest {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ex-suggest li + li { border-top: 1px solid var(--color-border); }
.ex-suggest-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: .88rem;
  text-align: left;
  color: var(--color-text);
  background: #fff;
  border: none;
  cursor: pointer;
}
.ex-suggest-btn:hover { background: var(--color-accent-bg); }
.ex-suggest-btn--free { color: var(--color-refill); font-weight: 700; }

.ex-opct { margin-top: 18px; padding: 12px; background: var(--color-bg); border-radius: var(--radius); }
.ex-check { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; font-weight: 700; }
.ex-summary { margin-top: 18px; padding: 12px; background: var(--color-accent-bg); border-radius: var(--radius); }
.ex-summary h3 { margin: 0 0 6px; font-size: .92rem; }
.ex-summary-row { margin: 4px 0; font-size: .86rem; line-height: 1.6; word-break: break-all; }
.ex-agree { margin: 16px 0 0; font-size: .78rem; color: var(--color-muted); }
.ex-login-promo {
  margin: 14px 0;
  padding: 10px 12px;
  font-size: .82rem;
  line-height: 1.6;
  background: var(--color-accent-bg);
  border-radius: var(--radius);
}

.ex-done { padding: 6px 0 20px; }
.ex-done-head { margin: 0 0 4px; font-size: 1.15rem; }
.ex-done-sub { margin: 0 0 16px; font-size: .88rem; color: var(--color-muted); }
.ex-done-manage {
  margin-top: 18px;
  padding: 12px;
  background: var(--color-refill-bg);
  border: 1px solid #f0dca0;
  border-radius: var(--radius);
}
.ex-done-manage h3 { margin: 0 0 6px; font-size: .92rem; }
.ex-done-manage .ex-input { margin: 8px 0; font-size: .8rem; }

/* ── 募集詳細 ── */
.ex-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; }
.ex-detail-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 1.05rem;
  line-height: 1.45;
}
.ex-title-role { display: block; }
.ex-swap { color: var(--color-accent, #e07a3a); font-weight: 700; }
.ex-closed-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: .86rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.ex-pair { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.ex-pair-col {
  flex: 1 1 220px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.ex-pair-head { margin: 0 0 6px; font-size: .92rem; }
.ex-item-list { list-style: none; margin: 0; padding: 0; }
.ex-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: .9rem;
  line-height: 1.4;
}
.ex-item-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3eee8;
  flex-shrink: 0;
}
.ex-body, .ex-flea, .ex-share, .ex-owner, .ex-comments { margin: 22px 0; }
.ex-body h2, .ex-flea h2, .ex-share h2, .ex-owner h2, .ex-comments h2 { margin: 0 0 8px; font-size: 1rem; }
.ex-body p { margin: 0; font-size: .92rem; line-height: 1.8; }
.ex-flea-row { display: flex; gap: 12px; align-items: flex-start; }
.ex-flea-thumb {
  position: relative;
  flex: 0 0 auto;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
}
.ex-flea-thumb img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; }
.ex-flea-zoom {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.6;
}
[data-ex-zoom] { cursor: zoom-in; }

/* 拡大表示（出品写真は小さいと種類が判別できない） */
.ex-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .84);
  cursor: zoom-out;
}
.ex-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.ex-lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 40px;
  height: 40px;
  padding: 0;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  cursor: pointer;
}
.ex-flea-main { min-width: 0; }
.ex-flea-title { margin: 0 0 8px; font-size: .88rem; line-height: 1.5; }
.ex-owner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* いまの状態のボタンは押しても変化がないので、押せないことを見せる */
.ex-owner-actions .ex-btn.is-current {
  opacity: 1;
  cursor: default;
  color: var(--color-accent, #e07a3a);
  border-color: var(--color-accent, #e07a3a);
  background: #fff;
}
.ex-share .ex-btn { margin: 0 8px 8px 0; }

.ex-comment-list { margin: 0; padding: 0; list-style: none; }
.ex-comment {
  margin-bottom: 8px;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.ex-comment--author {
  background: var(--color-accent-bg);
  border-color: color-mix(in srgb, var(--color-accent, #e07a3a) 30%, #fff);
}
.ex-comment--empty { color: var(--color-muted); font-size: .86rem; }
.ex-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: .76rem;
  color: var(--color-muted);
}
.ex-comment-id { font-weight: 700; color: var(--color-muted); }
.ex-comment-name { font-weight: 700; color: var(--color-text); }
.ex-comment-del {
  padding: 0;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  color: #8a2424;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}
.ex-comment-author-tag {
  padding: 0 5px;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent, #e07a3a);
  border-radius: 3px;
}
.ex-comment-time { margin-left: auto; }
.ex-comment-body { margin: 0; font-size: .9rem; line-height: 1.7; word-break: break-word; }
.ex-report-btn {
  padding: 0;
  font: inherit;
  font-size: .72rem;
  color: var(--color-muted);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}
.ex-comment-form { margin-top: 14px; padding: 12px; background: var(--color-bg); border-radius: var(--radius); }
.ex-quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-quick {
  padding: 6px 10px;
  font: inherit;
  font-size: .78rem;
  color: var(--color-accent);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
}
.ex-comment-form .ex-btn { margin-top: 10px; }
.ex-detail-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  font-size: .76rem;
  color: var(--color-muted);
}
.ex-detail-date { margin-left: auto; }
.ex-detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 480px) {
  .ex-detail-title { font-size: 1.05rem; }
  .ex-flea-row { flex-direction: column; }
  .ex-flea-thumb img { width: 96px; height: 96px; }
  .ex-step-nav { flex-direction: column-reverse; }
}

/* ── 商品ページの交換区画（GO後のみ表示） ── */
.item-ex { margin: 28px 0; }
.item-ex-meta { margin: 6px 0 12px; font-size: .86rem; color: var(--color-muted); }
.item-ex-cta { margin: 14px 0 0; font-size: .88rem; }
.item-ex-more { margin-top: 10px; }
.item-ex-more summary {
  cursor: pointer;
  font-size: .88rem;
  font-weight: 700;
  color: var(--color-accent);
}
.item-ex-more .ex-card-list { margin-top: 10px; }
