/* ================================================
   真贋鑑定マニュアル
   Style: nanobanana/31_staff_manual_style
   - Clean, professional, super readable
   - White base × Navy × Gold accent
   - やる気が出る配色
   ================================================ */

:root {
  /* ── Base Colors (nanobanana / staff-manual-style) ── */
  --bg:         #FAF9F6;      /* アイボリーオフホワイト */
  --bg-card:    #FFFFFF;
  --bg-panel:   #1E3A5F;      /* ディープネイビー（ヘッダー） */
  --bg-hover:   #F2EFE9;
  --border:     #E2DDD6;
  --border-strong: #C4BAB0;

  /* ── Text ── */
  --text:       #1A1A1A;      /* ディープチャコール（読みやすさ最優先） */
  --text-muted: #5A524B;      /* ウォームグレーブラウン */
  --text-light: #9A9088;
  --text-on-navy: #FFFFFF;

  /* ── Accent ── */
  --gold:       #B8860B;      /* 本物感のある深いゴールド */
  --gold-bg:    #FBF5E0;
  --gold-bright:#C8960F;
  --accent:     #B8860B;      /* brand.html 参照用エイリアス */

  /* ── Status Colors ── */
  --danger:     #C62828;
  --warning:    #E65100;
  --info:       #1565C0;
  --success:    #2E7D32;

  /* ── Priority ── */
  --priority-critical-bg:   #FFEBEE;
  --priority-critical-text: #C62828;
  --priority-critical-bar:  #C62828;

  --priority-high-bg:   #FFF3E0;
  --priority-high-text: #E65100;
  --priority-high-bar:  #F57C00;

  --priority-medium-bg:   #E3F2FD;
  --priority-medium-text: #1565C0;
  --priority-medium-bar:  #1976D2;

  /* ── Risk ── */
  --risk-high:   #C62828;
  --risk-medium: #E65100;
  --risk-low:    #2E7D32;

  /* ── Layout ── */
  --radius:    6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --shadow:    0 2px 12px rgba(26,26,26,0.08);
  --shadow-sm: 0 1px 4px rgba(26,26,26,0.06);
  --shadow-lg: 0 4px 24px rgba(26,26,26,0.12);

  /* ── Typography ── */
  --font:       'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --font-serif: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif;
  --font-mono:  'SF Mono', 'Courier New', monospace;

  /* ── Touch ── */
  --min-touch: 44px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img, svg { display: block; }

/* ── Layout ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header (ネイビー・権威感) ── */
.site-header {
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
}
.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 1;
}
.site-header .logo-icon {
  width: 34px;
  height: 34px;
  background: var(--gold);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.site-header .logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-on-navy);
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.site-header .logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  margin-top: 1px;
}
.header-actions { display: flex; gap: 8px; }

/* ── Page Title Area ── */
.page-title-bar {
  background: var(--bg-card);
  border-bottom: 3px solid var(--gold);
  padding: 24px 20px 20px;
  margin-bottom: 24px;
}
.page-title-bar h1 {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--bg-panel);
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.page-title-bar p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: var(--min-touch);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 2px 6px rgba(184,134,11,0.35);
}
.btn-primary:hover {
  background: var(--gold-bright);
  box-shadow: 0 4px 10px rgba(184,134,11,0.45);
}

.btn-navy {
  background: var(--bg-panel);
  color: #fff;
  box-shadow: 0 2px 6px rgba(30,58,95,0.3);
}
.btn-navy:hover { background: #163052; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--bg-panel); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b71c1c; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm  { padding: 6px 14px; font-size: 12px; min-height: 34px; }
.btn-lg  { padding: 14px 32px; font-size: 16px; min-height: 52px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }

.card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.card-clickable:hover {
  box-shadow: var(--shadow);
  border-color: var(--gold);
  transform: translateY(-1px);
}
.card-clickable:active { transform: scale(0.99); }

/* ── Section Header ── */
.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* カテゴリ */
.badge-bag     { background: #E3F2FD; color: #1565C0; }
.badge-watch   { background: #F3E5F5; color: #6A1B9A; }
.badge-jewelry { background: #FFF8E1; color: #F57F17; }

/* リスク */
.badge-risk-high   { background: #FFEBEE; color: var(--risk-high); }
.badge-risk-medium { background: #FFF3E0; color: var(--risk-medium); }
.badge-risk-low    { background: #E8F5E9; color: var(--risk-low); }

/* 優先度 */
.badge-critical {
  background: var(--priority-critical-bg);
  color: var(--priority-critical-text);
}
.badge-high {
  background: var(--priority-high-bg);
  color: var(--priority-high-text);
}
.badge-medium {
  background: var(--priority-medium-bg);
  color: var(--priority-medium-text);
}

/* ── Search ── */
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 13px 16px 13px 46px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  min-height: var(--min-touch);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.search-input::placeholder { color: var(--text-light); }
.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,134,11,0.12);
}

/* ── Category Tabs ── */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { background: var(--bg-hover); color: var(--text); }
.tab-btn.active {
  background: var(--bg-panel);
  color: #fff;
  border-color: var(--bg-panel);
}

/* ── Brand Grid ── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
@media (max-width: 480px) {
  .brand-grid { grid-template-columns: 1fr; }
}

.brand-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.brand-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.brand-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.brand-card-name {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--bg-panel);
  line-height: 1.3;
}
.brand-card-name-ja {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}
.brand-card-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.brand-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* 難易度 */
.difficulty { display: flex; gap: 3px; }
.difficulty-star { font-size: 14px; }
.difficulty-star.active { color: var(--gold); }
.difficulty-star.inactive { color: var(--border-strong); }

/* ── CheckPoint Cards ── */
.checkpoint-card {
  border-left: 4px solid var(--border-strong);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 16px 18px;
  background: var(--bg-card);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
/* priority class names from JS: critical / high / medium */
.checkpoint-card.critical {
  border-left-color: var(--priority-critical-bar);
  background: #FFFAFB;
}
.checkpoint-card.high {
  border-left-color: var(--priority-high-bar);
  background: #FFFDF8;
}
.checkpoint-card.medium {
  border-left-color: var(--priority-medium-bar);
  background: #F8FBFF;
}

.checkpoint-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-dot.critical { background: var(--priority-critical-bar); }
.priority-dot.high     { background: var(--priority-high-bar); }
.priority-dot.medium   { background: var(--priority-medium-bar); }

.checkpoint-title {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.4;
}
.checkpoint-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 10px;
}

/* ── Checkpoint Images (良い例 / だめな例) ── */
.cp-images { margin: 12px 0 8px; }
.cp-img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cp-img-box {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  position: relative;
}
.cp-img-box img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.cp-img-label {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 6px;
  letter-spacing: 0.04em;
}
.cp-img-label.good { background: #E8F5E9; color: #1B5E20; }
.cp-img-label.bad  { background: #FFEBEE; color: #7F1D1D; }
.cp-img-box.cp-img-good { border-color: #A5D6A7; }
.cp-img-box.cp-img-bad  { border-color: #FFCDD2; }

/* NG例・コツ（JSクラス名: fake-pattern / tips-text） */
.fake-pattern {
  font-size: 13px;
  color: var(--danger);
  background: #FFEBEE;
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 8px 12px;
  margin-top: 8px;
  line-height: 1.65;
}
.fake-pattern::before {
  content: '⚠ NG例：';
  font-weight: 700;
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tips-text {
  font-size: 13px;
  color: #1A5276;
  background: #EBF5FB;
  border-left: 3px solid #2E86C1;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 8px 12px;
  margin-top: 6px;
  line-height: 1.65;
}
.tips-text::before {
  content: '💡 コツ：';
  font-weight: 700;
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* ── Red Flags ── */
.red-flags-list {
  background: #FFEBEE;
  border: 1.5px solid #FFCDD2;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}
.red-flags-list h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.red-flag-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #FFCDD2;
  font-size: 14px;
  color: #7F1D1D;
  line-height: 1.5;
  font-weight: 600;
}
.red-flag-item:last-child { border-bottom: none; }
.red-flag-item::before {
  content: '✗';
  color: var(--danger);
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Checklist Steps ── */
.checklist-step {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.checklist-step.status-pass   { border-color: var(--success); background: #F1F8F1; }
.checklist-step.status-fail   { border-color: var(--danger);  background: #FFF5F5; }
.checklist-step.status-review { border-color: var(--warning); background: #FFFAF0; }

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-panel);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }

.step-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.step-action-btn {
  padding: 9px 4px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  min-height: var(--min-touch);
}
.step-action-btn:hover { background: var(--bg-hover); }
.step-action-btn.selected-pass   { background: var(--success); color: #fff; border-color: var(--success); }
.step-action-btn.selected-fail   { background: var(--danger);  color: #fff; border-color: var(--danger); }
.step-action-btn.selected-review { background: var(--warning); color: #fff; border-color: var(--warning); }

/* ── Progress Bar ── */
.progress-wrap { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 99px; background: var(--gold); transition: width 0.3s; }
.progress-bar.complete { background: var(--success); }

/* ── Verdict Banner ── */
.verdict-banner {
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 18px;
  font-weight: 800;
  margin: 20px 0;
}
.verdict-pass    { background: #E8F5E9; color: #1B5E20; border: 2px solid var(--success); }
.verdict-fail    { background: #FFEBEE; color: #7F1D1D; border: 2px solid var(--danger); }
.verdict-review  { background: #FFF8E1; color: #7C4700; border: 2px solid var(--warning); }
.verdict-icon { font-size: 32px; }

/* ── Info Table ── */
.info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-table th {
  background: var(--bg-panel);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.info-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  line-height: 1.6;
  vertical-align: top;
}
.info-table tr:last-child td { border-bottom: none; }
.info-table tr:nth-child(even) td { background: #FAFCFF; }
.info-table th:first-child { border-radius: var(--radius) 0 0 0; }
.info-table th:last-child  { border-radius: 0 var(--radius) 0 0; }

/* ── Compare Table (本物 vs 偽物) ── */
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th {
  padding: 10px 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.compare-table th.authentic { background: #E8F5E9; color: #1B5E20; }
.compare-table th.fake      { background: #FFEBEE; color: #7F1D1D; }
.compare-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
  vertical-align: top;
}
.compare-table td.authentic { background: #FAFFFA; color: var(--text); }
.compare-table td.fake      { background: #FFFAFA; color: var(--text); }

/* ── Flowchart ── */
.flow-node {
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 auto 8px;
  max-width: 480px;
  box-shadow: var(--shadow-sm);
}
.flow-node.active { border-color: var(--gold); background: var(--gold-bg); }
.flow-node.result-pass   { border-color: var(--success); background: #E8F5E9; color: #1B5E20; }
.flow-node.result-fail   { border-color: var(--danger);  background: #FFEBEE; color: #7F1D1D; }
.flow-node.result-review { border-color: var(--warning); background: #FFF8E1; color: #7C4700; }

.flow-connector {
  text-align: center;
  color: var(--text-muted);
  font-size: 22px;
  margin: 4px 0;
}
.flow-choices { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.flow-choice-btn {
  flex: 1;
  max-width: 200px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.15s;
  min-height: var(--min-touch);
}
.flow-choice-btn:hover { background: var(--bg-panel); color: #fff; border-color: var(--bg-panel); }

/* ── AI Chat (実際のJS: #ai-chat-btn / #ai-chat-panel) ── */
#ai-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  background: var(--bg-panel);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(30,58,95,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.15s, box-shadow 0.15s;
}
#ai-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(30,58,95,0.45);
}
#ai-chat-btn svg { stroke: #fff !important; }

#ai-chat-panel {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 340px;
  max-height: 55vh;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
}
#ai-chat-panel.open { display: flex; }

.chat-header {
  background: var(--bg-panel);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.chat-header-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.chat-header-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}
.chat-header-close:hover { color: #fff; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 85%;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-msg.ai {
  background: var(--bg-hover);
  color: var(--text);
  border-radius: 14px 14px 14px 4px;
  align-self: flex-start;
}
.chat-msg.user {
  background: var(--bg-panel);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  align-self: flex-end;
  margin-left: auto;
}

.chat-suggestions {
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.suggest-chip {
  padding: 5px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.suggest-chip:hover {
  background: var(--bg-panel);
  color: #fff;
  border-color: var(--bg-panel);
}

.chat-input-wrap {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  resize: none;
  outline: none;
  line-height: 1.4;
}
.chat-input:focus { border-color: var(--gold); }
.chat-send-btn {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--gold-bright); }
.chat-send-btn svg { stroke: #fff !important; }

/* ── Sticky Footer (checklist) ── */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 2px solid var(--border);
  padding: 12px 16px;
  z-index: 80;
  box-shadow: 0 -2px 8px rgba(26,26,26,0.08);
}
.sticky-footer .inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-progress { display: flex; flex-direction: column; gap: 4px; }
.footer-progress-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.progress-bar-wrap { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; min-width: 120px; }
.progress-bar-fill { height: 100%; background: var(--gold); border-radius: 99px; transition: width 0.3s; }
.flex-1 { flex: 1; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* ── Tags / Pills ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Alert Box ── */
.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin: 12px 0;
}
.alert-danger  { background: #FFEBEE; color: #7F1D1D; border-left: 4px solid var(--danger); }
.alert-warning { background: #FFF8E1; color: #7C4700; border-left: 4px solid var(--warning); }
.alert-info    { background: #E3F2FD; color: #1A3A6A; border-left: 4px solid var(--info); }
.alert-success { background: #E8F5E9; color: #1B5E20; border-left: 4px solid var(--success); }

/* ── Tabs (Detail page) ── */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 20px;
}
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--bg-panel); border-bottom-color: var(--gold); }

/* ── Market Prices ── */
.market-prices-card {
  background: var(--bg-card);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 12px;
}
.market-prices-header {
  background: var(--gold-bg);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(184,134,11,0.2);
}
.market-prices-updated {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0;
}
.market-prices-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 480px) {
  .market-prices-stats { grid-template-columns: repeat(2, 1fr); }
}
.market-stat {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
}
.market-stat:last-child { border-right: none; }
.market-stat-label { font-size: 10px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.market-stat-value { font-size: 15px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.market-stat-value.low  { color: var(--success); }
.market-stat-value.high { color: var(--danger); }
.market-items { padding: 10px 14px; }
.market-items-label { font-size: 10px; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.market-item-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.market-item-row:last-child { border-bottom: none; }
.market-item-name  { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-item-price { font-weight: 700; color: var(--text); font-family: var(--font-mono); flex-shrink: 0; }
.market-item-site  { font-size: 10px; color: var(--text-light); background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }

/* ── Prices Tab ── */
.prices-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
  margin-bottom: 10px;
}
.prices-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.prices-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--border);
}
.prices-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.prices-table tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }
.cond-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
}
.cond-S { background: #D4EDDA; color: #155724; }
.cond-A { background: #CCE5FF; color: #004085; }
.cond-B { background: #FFF3CD; color: #856404; }
.cond-C { background: #F8D7DA; color: #721C24; }
.site-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.site-chip {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  padding: 4px 10px;
  color: var(--text-muted);
}
.site-chip-count {
  font-weight: 700;
  color: var(--text);
  margin-left: 4px;
}
.market-item-list-full { }
.market-item-row-full {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  flex-wrap: wrap;
}
.market-item-row-full:last-child { border-bottom: none; }
.market-item-name-full {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: calc(100% - 140px);
}
.market-item-price-full {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.market-item-link {
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid var(--gold);
  border-radius: 4px;
}
.market-item-link:hover { background: var(--gold-bg); }
.prices-disclaimer {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  padding: 8px 0 4px;
  margin-top: 4px;
}
.prices-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.prices-empty-icon {
  color: var(--border);
  margin-bottom: 16px;
}
.prices-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.prices-empty-desc {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
}
.prices-loading { }
.mb-14 { margin-bottom: 14px; }

/* ── Transaction History (画像付き取引履歴) ── */
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.hist-card:last-child { border-bottom: none; }
.hist-img-wrap {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}
.hist-img-wrap.hist-img-error {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
}
.hist-img-wrap.hist-img-error::after {
  content: '?';
  font-size: 20px;
  color: var(--border);
}
.hist-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hist-info {
  flex: 1;
  min-width: 0;
}
.hist-name {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hist-meta {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.price-type-sold {
  font-size: 10px;
  font-weight: 700;
  background: #D4EDDA;
  color: #155724;
  padding: 1px 6px;
  border-radius: 4px;
}
.price-type-listing {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 4px;
}
.hist-site {
  font-size: 10px;
  color: var(--text-light);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 4px;
}
.hist-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hist-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}
.hist-link {
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  padding: 1px 6px;
  border: 1px solid var(--gold);
  border-radius: 4px;
}
.hist-link:hover { background: var(--gold-bg); }

/* ── Print CSS ── */
@media print {
  .site-header, .ai-fab, .ai-panel, .header-actions { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .checkpoint-card { break-inside: avoid; }
  .btn { display: none; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  :root { --min-touch: 48px; }
  html { font-size: 16px; }
  .container { padding: 0 14px; }
  .brand-grid { grid-template-columns: 1fr; }
  .step-actions { grid-template-columns: repeat(3, 1fr); }
  .ai-panel { width: calc(100vw - 32px); right: 16px; }
}

/* ── Utility ── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-gold    { color: var(--gold); }
.font-bold    { font-weight: 700; }
.font-black   { font-weight: 900; }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 12px; }
