:root {
  --green: #009b4a;
  --green-dark: #00773a;
  --green-pale: #e8f6ee;
  --orange: #f39800;
  --ink: #233029;
  --muted: #6b7a71;
  --line: #e3e9e5;
  --bg: #f3f6f4;
  --card: #ffffff;
  --semantic: #7c5cd6;
  --radius: 14px;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: linear-gradient(135deg, #0a6b3c 0%, #0d8a4e 45%, #0a5c36 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.stage { display: flex; gap: 56px; align-items: center; padding: 32px; }

.back-link {
  display: inline-block; margin-bottom: 14px; color: #cdebd9; text-decoration: none;
  font-size: 12.5px; border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; padding: 5px 12px;
}
.back-link:hover { background: rgba(255,255,255,0.12); }

/* ---- ランチャー（デモ選択トップ） ---- */
.launcher-body { padding: 32px 16px; align-items: flex-start; }
.launcher { width: min(960px, 100%); margin: 0 auto; color: #fff; }
.launcher-head { text-align: center; margin: 24px 0 30px; }
.launcher-head h1 { font-size: 48px; letter-spacing: 0.04em; }
.launcher-head h1 span { color: var(--orange); }
.launcher-head p { margin-top: 12px; font-size: 16px; line-height: 1.6; }
.launcher-head .sub { font-size: 13px; opacity: 0.8; }
.launch-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.launch-card {
  background: #fff; color: var(--ink); border-radius: 20px; padding: 26px 24px;
  text-decoration: none; box-shadow: 0 16px 44px rgba(0,0,0,0.28);
  border-top: 6px solid var(--green2, #009b4a);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex; flex-direction: column;
}
.launch-card.search { border-top-color: var(--green); }
.launch-card.recipe { border-top-color: var(--orange); }
.launch-card:hover { transform: translateY(-4px); box-shadow: 0 22px 56px rgba(0,0,0,0.36); }
.lc-icon { font-size: 40px; }
.lc-title { font-size: 22px; font-weight: 800; margin: 8px 0 6px; }
.lc-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.lc-points { list-style: none; margin: 14px 0 0; display: grid; gap: 7px; }
.lc-points li { font-size: 12px; color: var(--ink); padding-left: 18px; position: relative; line-height: 1.45; }
.lc-points li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.lc-go { margin-top: 18px; font-weight: 800; color: var(--green-dark); font-size: 14px; }
.launch-card.recipe .lc-go { color: #c77700; }
.launcher-foot { text-align: center; margin-top: 28px; font-size: 12px; opacity: 0.85; }
.launcher-foot .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.launcher-foot .dot.live { background: #7CFC9A; }
.launcher-foot .dot.offline { background: var(--orange); }
@media (max-width: 720px) {
  .launch-cards { grid-template-columns: 1fr; }
  .launcher-head h1 { font-size: 38px; }
}

.stage-side { color: #fff; max-width: 360px; }
.stage-side h1 { font-size: 40px; letter-spacing: 0.04em; margin-bottom: 12px; }
.stage-side .lead { font-size: 18px; line-height: 1.5; margin-bottom: 24px; }
.stage-side .sub { font-size: 13px; opacity: 0.75; }
.feature-list { list-style: none; display: grid; gap: 14px; }
.feature-list li {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
}
.feature-list b { font-size: 14px; }
.side-status { margin-top: 18px; font-size: 12px; opacity: 0.85; }
.side-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.side-status .dot.live { background: #7CFC9A; }
.side-status .dot.offline { background: var(--orange); }

/* ---- スマホフレーム ---- */
.phone {
  width: 393px;
  height: 800px;
  background: var(--bg);
  border-radius: 44px;
  border: 10px solid #1a1f1c;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 22px; background: #1a1f1c; border-radius: 12px; z-index: 50;
}

.app-header {
  background: var(--green);
  color: #fff;
  padding: 40px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-title { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 26px; background: #fff; border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; }
.brand { font-weight: 700; font-size: 17px; line-height: 1.1; }
.brand-sub { font-size: 10px; opacity: 0.85; }
#user-select {
  border: none; border-radius: 8px; padding: 6px 8px; font-size: 11px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink); max-width: 132px;
}

.screen { flex: 1; overflow-y: auto; position: relative; }
.tab { display: none; padding: 14px 14px 18px; }
.tab.active { display: block; }
#tab-chat.active { display: flex; flex-direction: column; height: 100%; }

/* ---- 検索 ---- */
.search-box { display: flex; gap: 8px; }
.search-box input {
  flex: 1; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 13px; background: var(--card);
}
.search-box input:focus { outline: none; border-color: var(--green); }
.search-box button, .chat-box button {
  background: var(--green); color: #fff; border: none; border-radius: 12px;
  padding: 0 16px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.search-box button:active, .chat-box button:active { background: var(--green-dark); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 11.5px; cursor: pointer; color: var(--muted);
}
.chip:hover { border-color: var(--green); color: var(--green); }

/* ---- 会話型検索のAI表示 ---- */
.ai-thinking { font-size: 11px; color: var(--semantic); padding: 8px 4px 0; }
.context-line {
  margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  background: #efe9ff; color: var(--semantic); font-size: 11px; line-height: 1.5;
}
.context-line b { font-weight: 800; }
.context-line button {
  margin-left: 6px; border: 1px solid var(--semantic); background: var(--card);
  color: var(--semantic); border-radius: 999px; padding: 2px 9px; font-size: 10px; cursor: pointer;
}
.ai-comment {
  margin-top: 8px; padding: 9px 12px; border-radius: 10px;
  background: var(--green-pale); color: var(--green-dark); font-size: 11.5px; font-weight: 700;
}
.sugg-label { font-size: 10.5px; color: var(--muted); align-self: center; }
.chip.sugg { border-color: var(--semantic); color: var(--semantic); }
#search-suggestions { margin-top: 12px; }

.cards { display: grid; gap: 10px; margin-top: 10px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 10px 12px;
  display: flex; gap: 10px; align-items: center;
  box-shadow: 0 1px 4px rgba(20, 40, 30, 0.06);
  cursor: pointer;
}
.card .thumb {
  width: 52px; height: 52px; border-radius: 12px; font-size: 26px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--green-pale);
}
.card .info { flex: 1; min-width: 0; }
.card .name { font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.card .meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.card .price { color: var(--green-dark); font-weight: 800; font-size: 13px; }
.card .price small { font-weight: 400; color: var(--muted); }
.card .tag {
  font-size: 9px; background: var(--green-pale); color: var(--green-dark);
  border-radius: 4px; padding: 1.5px 5px;
}
.card .match {
  font-size: 9px; border-radius: 4px; padding: 1.5px 5px; font-weight: 700;
}
.card .match.semantic { background: #efe9ff; color: var(--semantic); }
.card .match.lexical { background: #eef1ef; color: var(--muted); }
.card .match.both { background: #fff3e0; color: #c77700; }
.card .match.commerce { background: #e8f0fe; color: #1a73e8; }

/* ---- 検索エンジン切替トグル ---- */
/* パターンが5つ並ぶので折り返さず横スクロールさせる（折り返すと縦積みで読めない） */
.engine-toggle {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.engine-toggle::-webkit-scrollbar { display: none; }
.et-label { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.et-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font-size: 11px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.et-btn.active { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
.vertex-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #e8f0fe; color: #1a4480; font-size: 11px; line-height: 1.6; }
/* 会話型フィルタの選択肢（追加質問への回答候補） */
.chip-sm { display: inline-block; margin: 2px 3px 0 0; padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid #c6d8f5; font-size: 10px; }
.card .reason { font-size: 10px; color: var(--semantic); margin-top: 3px; }
.card .add {
  border: none; background: var(--orange); color: #fff; font-weight: 800;
  width: 30px; height: 30px; border-radius: 50%; font-size: 17px; cursor: pointer; flex-shrink: 0;
}
.card .add:active { transform: scale(0.92); }

.section-title { font-size: 15px; margin-bottom: 4px; }
.section-note { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.empty { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 0; }

/* ---- チャット ---- */
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 16px;
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.bubble.user { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--card); border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(20,40,30,0.06); }
.bubble.thinking { color: var(--muted); }
.bubble.thinking .dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.chat-products { align-self: stretch; display: grid; gap: 8px; }
.chat-products .card { padding: 8px 10px; }
.tool-note { font-size: 10px; color: var(--muted); align-self: flex-start; padding-left: 6px; }

/* ---- レシピ→お買い物リスト ---- */
.recipe-plan {
  align-self: stretch; background: var(--card); border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(20,40,30,0.06); display: grid; gap: 7px;
}
.recipe-head { font-size: 11.5px; font-weight: 800; color: var(--green-dark); }
.recipe-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.rp-need { width: 92px; flex-shrink: 0; line-height: 1.25; }
.rp-need b { display: block; }
.rp-need span { font-size: 10px; color: var(--semantic); font-weight: 700; }
.rp-arrow { color: var(--orange); font-weight: 800; flex-shrink: 0; }
.rp-prod { flex: 1; display: flex; align-items: center; gap: 5px; min-width: 0; }
.rp-prod.muted { color: var(--muted); }
.rp-emoji { font-size: 16px; flex-shrink: 0; }
.rp-name { flex: 1; min-width: 0; line-height: 1.25; }
.rp-name em { color: var(--orange); font-style: normal; font-weight: 800; }
.rp-price { font-weight: 800; color: var(--green-dark); white-space: nowrap; }
.chat-box { display: flex; gap: 8px; padding-top: 8px; }
.chat-box input {
  flex: 1; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 13px; background: var(--card);
}
.chat-box input:focus { outline: none; border-color: var(--green); }

/* ---- カート ---- */
.cart-list { display: grid; gap: 8px; }
.cart-row {
  background: var(--card); border-radius: 12px; padding: 9px 12px;
  display: flex; align-items: center; gap: 9px; font-size: 12px;
}
.cart-row .thumb { width: 38px; height: 38px; font-size: 19px; border-radius: 9px; background: var(--green-pale); display: grid; place-items: center; }
.cart-row .nm { flex: 1; font-weight: 600; line-height: 1.3; }
.cart-row .qty { color: var(--muted); }
.cart-row .sub { font-weight: 800; color: var(--green-dark); white-space: nowrap; }
.cart-row .rm { border: none; background: none; color: #c44; font-size: 14px; cursor: pointer; }
.cart-total {
  margin-top: 14px; padding: 12px 14px; background: var(--card); border-radius: 12px;
  font-size: 14px; font-weight: 800; display: flex; justify-content: space-between;
}
.order-btn {
  width: 100%; margin-top: 12px; padding: 13px; border: none; border-radius: 12px;
  background: var(--orange); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer;
}

/* ---- タブバー ---- */
.tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px 14px;
}
.tabbtn {
  border: none; background: none; font-size: 19px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  padding: 6px 0; position: relative; border-radius: 10px;
}
.tabbtn span { font-size: 10px; }
.tabbtn.active { color: var(--green); font-weight: 700; }
.badge {
  position: absolute; top: 2px; right: 22%;
  background: var(--orange); color: #fff; font-size: 9px; font-style: normal;
  border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px;
}

/* ---- トースト・モーダル ---- */
.toast {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12.5px;
  padding: 10px 18px; border-radius: 999px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.modal {
  position: fixed; inset: 0; background: rgba(10, 25, 16, 0.45); z-index: 150;
  display: grid; place-items: center;
}
.modal-body {
  background: var(--bg); border-radius: 18px; width: min(420px, 92vw);
  max-height: 80vh; overflow-y: auto; padding: 16px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 14px; }
.modal-head button { border: none; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }

@media (max-width: 900px) {
  .stage { flex-direction: column; gap: 20px; padding: 12px; }
  .stage-side { display: none; }
  .phone { width: 100vw; height: 100dvh; border-radius: 0; border: none; }
}
