/* HIKOTA E-SHOP 検索改善・AIコンシェルジュ デモ
   配色は実サイト（eshop.hikota.com）のCSSから採取した値を使用 */

:where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote, figcaption, td, th) {
  word-break: auto-phrase;
  text-wrap: pretty;
}
:where(h1, h2, h3) { text-wrap: balance; }
.nw { white-space: nowrap; }

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --pink: #dc6782;
  --pink-deep: #b94a66;
  --pink-pale: #fdf2f5;
  --pink-soft: #f7d9e2;
  --blue: #0e52a2;
  --ink: #1b1b1b;
  --sub: #696969;
  --mute: #949494;
  --line: #e6e2e3;
  --bg: #f7f6f6;
  --white: #fff;
  --good: #2f7d5d;
  --bad: #c0483f;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.05);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.8;
}

/* ---------- デモであることの明示バー ---------- */
.demo-bar {
  background: #2b2b2b;
  color: #f0eeee;
  font-size: 12px;
  letter-spacing: .04em;
  padding: 7px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.demo-bar strong { color: #fff; font-weight: 600; }
.demo-bar .tag {
  background: rgba(255,255,255,.13);
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11px;
}
.demo-bar .spacer { flex: 1; }
.demo-bar button {
  background: none; border: 1px solid rgba(255,255,255,.35); color: #f0eeee;
  font-size: 11px; padding: 3px 10px; border-radius: 3px; cursor: pointer;
  font-family: inherit;
}
.demo-bar button:hover { background: rgba(255,255,255,.12); }

/* ---------- サイトヘッダー（実サイト再現） ---------- */
.site-head {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-head .row {
  max-width: 1240px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 22px;
}
.site-head .logo { height: 34px; width: auto; display: block; }
.site-head .logo-fallback {
  font-size: 19px; font-weight: 700; letter-spacing: .06em; color: var(--ink);
}
.site-head .tel { font-size: 12px; color: var(--sub); margin-left: auto; text-align: right; line-height: 1.5; }
.site-head .tel b { font-size: 15px; color: var(--ink); }

/* ---------- タブ ---------- */
.tabs {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.tabs .row { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; }
.tabs button {
  background: none; border: none; font-family: inherit; font-size: 14px;
  padding: 15px 20px 13px; cursor: pointer; color: var(--sub);
  border-bottom: 2px solid transparent; font-weight: 600; letter-spacing: .02em;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--pink-deep); border-bottom-color: var(--pink); }

/* ---------- レイアウト ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
.panel { display: none; }
.panel.active { display: block; }

.lead-block { margin-bottom: 20px; }
.lead-block h2 {
  font-size: 20px; font-weight: 700; letter-spacing: .02em; margin-bottom: 6px;
}
.lead-block p { font-size: 13.5px; color: var(--sub); }

/* ---------- 検索窓 ---------- */
.searchbar {
  background: var(--white); border: 1px solid var(--line); border-radius: 6px;
  padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.searchbar .field { display: flex; gap: 8px; }
.searchbar input[type="search"] {
  flex: 1; font-family: inherit; font-size: 15px; padding: 10px 14px;
  border: 1px solid #d6d1d2; border-radius: 4px; outline: none; min-width: 0;
}
.searchbar input[type="search"]:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(220,103,130,.13); }
.searchbar button.go {
  background: var(--pink); color: #fff; border: none; font-family: inherit;
  font-size: 14px; font-weight: 600; padding: 0 26px; border-radius: 4px; cursor: pointer;
  letter-spacing: .06em;
}
.searchbar button.go:hover { background: var(--pink-deep); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; align-items: center; }
.chips .label { font-size: 12px; color: var(--mute); margin-right: 2px; }
.chip {
  background: var(--white); border: 1px solid #dcd7d8; border-radius: 999px;
  font-family: inherit; font-size: 12.5px; padding: 5px 14px; cursor: pointer; color: var(--sub);
}
.chip:hover { border-color: var(--pink); color: var(--pink-deep); background: var(--pink-pale); }

/* ---------- 比較スコアボード ---------- */
.scoreboard {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
  margin-bottom: 18px;
}
.score {
  background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 13px 16px;
}
.score .k { font-size: 11.5px; color: var(--mute); letter-spacing: .04em; }
.score .v { font-size: 26px; font-weight: 700; line-height: 1.3; margin-top: 2px; }
.score .v small { font-size: 13px; font-weight: 600; color: var(--sub); }
.score.win .v { color: var(--good); }
.score.lose .v { color: var(--bad); }
.score .sub { font-size: 11.5px; color: var(--mute); }

/* ---------- 2カラム比較 ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }

.col { background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.col > header { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.col.before > header { background: #f4f2f2; }
.col.after > header { background: var(--pink-pale); }
.col > header h3 { font-size: 14.5px; font-weight: 700; letter-spacing: .02em; }
.col.after > header h3 { color: var(--pink-deep); }
.col > header .meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.col .body { padding: 6px 0; max-height: 620px; overflow-y: auto; }

.explain {
  padding: 9px 16px; font-size: 12px; line-height: 1.7; color: var(--sub);
  background: #fbfafa; border-bottom: 1px solid var(--line);
}
.explain b { color: var(--ink); }
.explain .exp-tag {
  display: inline-block; background: var(--pink-pale); color: var(--pink-deep);
  border-radius: 3px; padding: 0 6px; font-size: 11px; margin-right: 4px;
}

/* ---------- 商品行 ---------- */
.item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid #f1eeef; align-items: center;
}
.item:last-child { border-bottom: none; }
.item .rank { display: none; }
.item .thumb {
  width: 52px; height: 52px; object-fit: contain; background: #fafafa;
  border: 1px solid #f0eded; border-radius: 3px;
}
.item .info { min-width: 0; }
.item .nm { font-size: 13px; font-weight: 600; line-height: 1.5; }
.item .sb { font-size: 11.5px; color: var(--mute); margin-top: 1px; }
.item .pr { font-size: 13.5px; font-weight: 700; white-space: nowrap; text-align: right; }
.item .pr .st { display: block; font-size: 10.5px; font-weight: 500; color: var(--mute); }
.item.is-noise { background: #fdfcfc; }
.item.is-noise .nm { color: #8d8788; font-weight: 500; }

.badge {
  display: inline-block; font-size: 10.5px; border-radius: 3px; padding: 0 6px;
  margin-right: 4px; line-height: 1.7; font-weight: 600; vertical-align: 1px;
}
.badge.name { background: #e7f2ec; color: var(--good); }
.badge.cat  { background: #e8eff8; color: var(--blue); }
.badge.desc { background: #fbeaea; color: var(--bad); }
.badge.brand{ background: #f2eef7; color: #6c56a0; }
.badge.out  { background: #f2f0f0; color: var(--mute); }
.badge.disc { background: #f7e9e9; color: #a05050; }

.section-split {
  padding: 8px 16px; font-size: 11.5px; color: var(--mute);
  background: #faf9f9; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* ---------- チャット ---------- */
.chat-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .chat-layout { grid-template-columns: 1fr; } }

.chat {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  /* 画面内に収め、ページ全体ではなく会話部分だけがスクロールするようにする */
  height: calc(100vh - 250px);
  min-height: 440px;
  max-height: 760px;
}
.chat .ch-head {
  background: var(--pink); color: #fff; padding: 12px 18px;
  display: flex; align-items: center; gap: 9px;
}
.chat .ch-head .dot { width: 8px; height: 8px; border-radius: 50%; background: #8ce0b0; }
.chat .ch-head .t { font-size: 14px; font-weight: 600; }
.chat .ch-head .s { font-size: 11.5px; opacity: .85; margin-left: auto; }
.chat .ch-body { flex: 1; overflow-y: auto; padding: 18px; background: #fbfafa; }
.chat .ch-foot { border-top: 1px solid var(--line); padding: 11px 14px; background: #fff; }
.chat .ch-foot .field { display: flex; gap: 8px; }
.chat .ch-foot input {
  flex: 1; font-family: inherit; font-size: 14px; padding: 9px 13px;
  border: 1px solid #d6d1d2; border-radius: 20px; outline: none; min-width: 0;
}
.chat .ch-foot input:focus { border-color: var(--pink); }
.chat .ch-foot button {
  background: var(--pink); color: #fff; border: none; border-radius: 20px;
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 0 20px; cursor: pointer;
}
.chat .ch-foot button:hover { background: var(--pink-deep); }

.bub { max-width: 86%; margin-bottom: 13px; word-break: auto-phrase; text-wrap: pretty; }
.bub .txt {
  border-radius: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.75;
  white-space: pre-wrap;
}
.bub.user { margin-left: auto; }
.bub.user .txt { background: var(--pink-soft); border-bottom-right-radius: 3px; }
.bub.ai .txt { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.bub.ai .txt.typing { color: var(--mute); font-style: normal; }

.pcard {
  display: grid; grid-template-columns: 54px 1fr; gap: 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-top: 8px;
}
.pcard img { width: 54px; height: 54px; object-fit: contain; background: #fafafa; border-radius: 3px; }
.pcard .lb {
  display: inline-block; background: var(--pink); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 3px; padding: 0 6px; margin-right: 5px; line-height: 1.7; vertical-align: 1px;
}
.pcard .nm { font-size: 13px; font-weight: 600; line-height: 1.5; }
.pcard .br { font-size: 11.5px; color: var(--mute); }
.pcard .rs { font-size: 11.5px; color: var(--sub); line-height: 1.65; margin-top: 4px;
  padding-left: 8px; border-left: 2px solid var(--pink-soft); }
.pcard .fo { display: flex; align-items: baseline; gap: 9px; margin-top: 5px; flex-wrap: wrap; }
.pcard .pz { font-size: 14px; font-weight: 700; }
.pcard .vr { font-size: 11px; color: var(--mute); }
.pcard .link { font-size: 11.5px; color: var(--pink-deep); text-decoration: none; }
.pcard .link:hover { text-decoration: underline; }

.notice {
  margin-top: 8px; padding: 8px 12px; border-radius: 6px; font-size: 12px; line-height: 1.65;
}
.notice.guard    { background: #fff6e8; color: #8a5d18; }
.notice.escalate { background: #eaf1fa; color: #2a4f83; }
.notice.log      { background: #f2f0f6; color: #57508a; }

.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.quick button {
  background: #fff; border: 1px solid var(--pink-soft); color: var(--pink-deep);
  border-radius: 999px; font-family: inherit; font-size: 12px; padding: 5px 13px; cursor: pointer;
}
.quick button:hover { background: var(--pink-pale); }

/* ---------- 処理の内訳パネル ---------- */
.side { position: sticky; top: 62px; max-height: calc(100vh - 250px); overflow-y: auto; }
.side .box {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; margin-bottom: 12px;
}
.side .box > h3 {
  font-size: 12.5px; font-weight: 700; padding: 11px 15px; border-bottom: 1px solid var(--line);
  background: #fafafa; letter-spacing: .03em;
}
.side .box .in { padding: 13px 15px; font-size: 12.5px; line-height: 1.75; color: var(--sub); }
.trace-item {
  padding-left: 17px; position: relative; margin-bottom: 7px; font-size: 12px; line-height: 1.7;
}
.trace-item::before {
  content: ""; position: absolute; left: 3px; top: 8px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--pink-soft);
}
.trace-item:last-child { margin-bottom: 0; }
.trace-empty { color: var(--mute); font-size: 12px; }

.legend { font-size: 11.5px; line-height: 1.9; color: var(--sub); }
.legend .k { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* ---------- 効果まとめ表 ---------- */
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
table.metrics { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
table.metrics th {
  background: #f6f4f4; text-align: left; padding: 10px 14px; font-weight: 700;
  border-bottom: 1px solid var(--line); font-size: 12.5px; white-space: nowrap;
}
table.metrics td { padding: 10px 14px; border-bottom: 1px solid #f2efef; vertical-align: middle; }
table.metrics tr:last-child td { border-bottom: none; }
table.metrics .q { font-weight: 700; }
table.metrics .bad-n { color: var(--bad); font-weight: 700; }
table.metrics .good-n { color: var(--good); font-weight: 700; }
table.metrics .arrow { color: var(--mute); padding: 0 4px; }

.lost-list { margin-top: 20px; }
.lost-list .lost-item {
  display: flex; align-items: baseline; gap: 12px; padding: 9px 14px;
  border-bottom: 1px solid #f2efef; font-size: 13px; background: #fff;
}
.lost-list .lost-item:last-child { border-bottom: none; }
.lost-list .pz { font-weight: 700; white-space: nowrap; min-width: 76px; text-align: right; color: var(--pink-deep); }
.lost-list .nm { flex: 1; min-width: 0; }
.lost-list .cat { font-size: 11.5px; color: var(--mute); white-space: nowrap; }

.foot-note {
  margin-top: 22px; font-size: 11.5px; color: var(--mute); line-height: 1.8;
  border-top: 1px solid var(--line); padding-top: 14px;
}

.loading { padding: 60px 20px; text-align: center; color: var(--mute); font-size: 14px; }
