/* ─── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: #fff7ed;
  color: #1c1917;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────── */
header {
  background: #ea580c;
  color: #fff;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(234,88,12,.35);
}
.header-inner { max-width: 900px; width: 100%; margin: 0 auto; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }

/* ─── Main ───────────────────────────────────────── */
main { max-width: 900px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }

/* ─── Hero ───────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 1.5rem; }
.hero-icon { font-size: 3rem; margin-bottom: .5rem; }
.hero h1 { font-size: 1.75rem; font-weight: 800; color: #ea580c; margin-bottom: .5rem; }
.description { color: #57534e; font-size: .95rem; line-height: 1.7; }

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.badge {
  display: inline-block;
  padding: 5px 13px;
  background: #ffedd5;
  color: #9a3412;
  border: 1.5px solid #fdba74;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Card base ──────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
  margin-bottom: 1rem;
}
.card h2 { font-size: 1.05rem; font-weight: 700; color: #ea580c; margin-bottom: .75rem; }

/* ─── Search area ────────────────────────────────── */
.search-row {
  display: flex;
  gap: .6rem;
}
.search-row input[type="text"] {
  flex: 1;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  padding: .7rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1c1917;
  background: #fafaf9;
  outline: none;
  transition: border-color .15s;
}
.search-row input[type="text"]:focus { border-color: #ea580c; background: #fff; }
.search-row input[type="text"]::placeholder { color: #a8a29e; }

.btn-search {
  padding: .7rem 1.4rem;
  background: #ea580c;
  color: #fff;
  border: none; border-radius: 10px;
  font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: background .15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-search:hover { background: #c2410c; }
.btn-search:disabled { background: #d6d3d1; cursor: not-allowed; }

.search-hint {
  font-size: .76rem;
  color: #a8a29e;
  margin-top: .5rem;
  line-height: 1.5;
}

/* ─── Loading ────────────────────────────────────── */
#loading {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #78716c;
  font-size: .92rem;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #fed7aa;
  border-top-color: #ea580c;
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty / Error state ────────────────────────── */
#empty-state {
  text-align: center;
  padding: 2rem;
  color: #a8a29e;
  font-size: .9rem;
  line-height: 1.7;
}

/* ─── Summary bar ────────────────────────────────── */
.summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
  align-items: center;
}
.sum-chip {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.sum-chip.all   { background: #f5f5f4; color: #44403c; }
.sum-chip.info  { background: #dbeafe; color: #1d4ed8; }
.sum-chip.comm  { background: #ffedd5; color: #c2410c; }
.sum-chip.trans { background: #dcfce7; color: #15803d; }
.sum-chip.nav   { background: #ede9fe; color: #6d28d9; }
.sum-chip .chip-num {
  font-size: .9rem;
  font-weight: 800;
}

/* ─── Toolbar (filters + actions) ───────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .85rem;
}
.filter-tabs { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1; }
.filter-tab {
  padding: .28rem .75rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: #57534e;
  background: #fff;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
}
.filter-tab:hover { border-color: #fb923c; }
.filter-tab.active { background: #ea580c; border-color: #ea580c; color: #fff; }
.filter-tab .tab-count { font-size: .72rem; opacity: .85; margin-left: .2rem; }

.toolbar-actions { display: flex; gap: .4rem; }
.btn-sm {
  padding: .3rem .7rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 7px;
  background: #fff;
  font-size: .78rem;
  font-weight: 600;
  color: #57534e;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-sm:hover { background: #f5f5f4; border-color: #d6d3d1; }

/* ─── Search within results ──────────────────────── */
.result-search-wrap {
  position: relative;
  margin-bottom: .75rem;
}
.result-search-wrap input {
  width: 100%;
  padding: .45rem .85rem .45rem 2.2rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  color: #1c1917;
  background: #fafaf9;
  outline: none;
  transition: border-color .15s;
}
.result-search-wrap input:focus { border-color: #ea580c; }
.result-search-icon {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  color: #a8a29e; font-size: .85rem; pointer-events: none;
}

/* ─── Keyword table ──────────────────────────────── */
.table-wrap { overflow-x: auto; }
.kw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  table-layout: fixed;
}
.kw-table colgroup col:nth-child(1) { width: auto; }
.kw-table colgroup col:nth-child(2) { width: 110px; }
.kw-table colgroup col:nth-child(3) { width: 70px; }

.kw-table thead th {
  background: #fff7ed;
  color: #57534e;
  font-weight: 700;
  padding: .45rem .75rem;
  text-align: left;
  border-bottom: 1.5px solid #fed7aa;
  white-space: nowrap;
}
.kw-table tbody tr {
  border-bottom: 1px solid #f0efed;
  transition: background .1s;
}
.kw-table tbody tr:hover { background: #fffbf5; }
.kw-table tbody tr:last-child { border-bottom: none; }

.kw-cell { padding: .45rem .75rem; }
.kw-text { font-weight: 500; word-break: break-all; }

.badges { display: inline-flex; gap: .3rem; margin-left: .4rem; flex-wrap: wrap; vertical-align: middle; }
.src-badge {
  font-size: .65rem; font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: #f0fdf4; color: #15803d;
  border: 1px solid #bbf7d0;
  vertical-align: middle;
}
.lt-badge {
  font-size: .65rem; font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: #eff6ff; color: #1d4ed8;
  border: 1px solid #bfdbfe;
  vertical-align: middle;
}

.intent-cell { padding: .45rem .75rem; }
.intent-badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  padding: .18rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.action-cell { padding: .35rem .5rem; text-align: center; }
.btn-copy-kw {
  padding: .22rem .55rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 6px;
  background: #fff;
  font-size: .72rem;
  font-weight: 700;
  color: #57534e;
  cursor: pointer;
  transition: background .12s, color .12s;
  font-family: inherit;
  min-width: 52px;
}
.btn-copy-kw:hover { background: #fff7ed; border-color: #fb923c; color: #ea580c; }
.btn-copy-kw.copied { background: #dcfce7; border-color: #86efac; color: #15803d; }

/* ─── No results in filter ───────────────────────── */
.no-filter-result {
  text-align: center;
  padding: 1.5rem;
  color: #a8a29e;
  font-size: .88rem;
}

/* ─── Toast ──────────────────────────────────────── */
#kw-toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #1c1917; color: #fff;
  padding: .6rem 1.2rem;
  border-radius: 8px; font-size: .85rem; font-weight: 600;
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
#kw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Info cards ─────────────────────────────────── */
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .65rem; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .15rem; font-size: .88rem; }
.tip-text p { font-size: .8rem; color: #78716c; line-height: 1.55; }

/* ━━━ 活用シーン ━━━ */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.scene-item {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.scene-item strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.3rem;
}
.scene-item p {
  font-size: 0.8rem;
  color: #78716c;
  line-height: 1.55;
  margin: 0;
}

/* ━━━ 関連ツール ━━━ */
.related-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.related-tool-item {
  display: block;
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: #1c1917;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.related-tool-item:hover {
  border-color: #ea580c;
  box-shadow: 0 2px 8px rgba(234,88,12,0.15);
}
.related-tool-item span {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}
.related-tool-item small {
  display: block;
  font-size: 0.75rem;
  color: #78716c;
  font-weight: 400;
  margin-top: 0.25rem;
}

/* ─── Intent legend ──────────────────────────────── */
.intent-legend {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-top: .75rem;
}
.legend-item {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; color: #44403c;
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

/* ─── Amazon ─────────────────────────────────────── */
.amazon-card h2 { margin-bottom: 0.2rem; }
.amazon-note { font-size: 0.8rem; color: #a8a29e; margin-bottom: .85rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
.amazon-item {
  display: block; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 0.85rem; text-decoration: none; color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.amazon-item:hover {
  border-color: #FF9900; box-shadow: 0 2px 8px rgba(255,153,0,0.15); transform: translateY(-1px);
}
.amazon-item-icon { font-size: 1.6rem; margin-bottom: 0.3rem; }
.amazon-item-name { font-size: 0.85rem; font-weight: bold; margin-bottom: 0.18rem; }
.amazon-item-desc { font-size: 0.74rem; color: #888; line-height: 1.5; margin-bottom: 0.4rem; }
.amazon-item-link { font-size: 0.76rem; color: #FF9900; font-weight: bold; }

/* ─── Footer ─────────────────────────────────────── */
footer {
  text-align: center; padding: 1.5rem 1rem;
  font-size: .82rem; color: #a8a29e;
  border-top: 1px solid #e7e5e4; margin-top: auto;
}
footer a { color: #ea580c; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .3rem; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.4rem; }
  .search-row { flex-direction: column; }
  .btn-search { width: 100%; }
  .tips-grid { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
  .related-tools { grid-template-columns: 1fr; }
  .amazon-grid { grid-template-columns: 1fr; }
  .kw-table colgroup col:nth-child(2) { width: 90px; }
  .kw-table colgroup col:nth-child(3) { width: 58px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: flex-end; }
}
@media (max-width: 420px) {
  .summary-bar { gap: .35rem; }
  .sum-chip { font-size: .76rem; padding: .25rem .55rem; }
}

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #ea580c; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }
