/* 公式 LINE トーク画面デモ（/line-demo）専用。
   このページでしか使わないため、全ページ共通の CSS には載せずここに閉じる。 */

/* ── 導入 ── */
.ld-hero { padding: var(--sp-10) 0 var(--sp-6); max-width: 780px; }
.ld-eyebrow {
  font-size: var(--fs-xs); letter-spacing: .18em; font-weight: 700;
  color: var(--amber-700); margin: 0 0 var(--sp-3);
}
.ld-title {
  font-size: clamp(26px, 4.4vw, 40px); line-height: 1.35; margin: 0 0 var(--sp-4);
  color: var(--ink-900);
}
.ld-lead { font-size: var(--fs-lg); line-height: 1.9; color: var(--ink-700); margin: 0 0 var(--sp-5); }
.ld-howto {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none;
  margin: 0 0 var(--sp-5); padding: 0;
}
.ld-howto li {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink-700);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 7px 14px 7px 7px;
}
.ld-howto-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: var(--r-full);
  background: var(--amber-500); color: var(--ink-900);
  font-size: var(--fs-xs); font-weight: 700;
}
.ld-disclaimer {
  margin: 0; padding: var(--sp-4); border-radius: var(--r-card);
  background: var(--amber-050); border: 1px solid var(--amber-300);
  font-size: var(--fs-base); line-height: 1.8; color: var(--ink-700);
}
.ld-disclaimer strong { color: var(--amber-700); }

/* ── 二段組（左: 端末 / 右: 解説）── */
.ld-stage {
  display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: var(--sp-8); align-items: start; padding: var(--sp-8) 0 var(--sp-10);
}

/* ── 端末フレーム ── */
.ld-phone {
  display: flex; flex-direction: column; height: 640px;
  background: #8ea3b8; border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow-float); border: 1px solid rgba(20, 21, 23, .12);
}
.ld-phonebar {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); background: var(--paper);
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.ld-phonebar-back { color: var(--ink-600); font-size: var(--fs-xl); line-height: 1; }
.ld-phonebar-name { font-weight: 700; font-size: var(--fs-md); color: var(--ink-900); }
.ld-phonebar-badge {
  margin-left: auto; font-size: var(--fs-2xs); font-weight: 700;
  color: var(--amber-700); background: var(--amber-050);
  border: 1px solid var(--amber-300); border-radius: var(--r-pill); padding: 2px 8px;
}

.ld-chat {
  flex: 1 1 auto; overflow-y: auto; padding: var(--sp-4) var(--sp-3) var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
  scroll-behavior: smooth; overscroll-behavior: contain;
}
.ld-daymark, .ld-syslog { margin: 0; text-align: center; }
.ld-daymark span, .ld-syslog {
  display: inline-block; font-size: var(--fs-2xs); color: #fff;
  background: rgba(20, 21, 23, .28); border-radius: var(--r-pill); padding: 3px 12px;
}
.ld-syslog { font-size: var(--fs-2xs); }

.ld-row { display: flex; gap: var(--sp-2); max-width: 100%; }
.ld-row-bot { justify-content: flex-start; align-items: flex-start; }
.ld-row-user { justify-content: flex-end; align-items: flex-end; }
.ld-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--r-full);
  background: var(--paper); border: 1px solid rgba(255, 255, 255, .6);
}
/* LINE と同じく、同じ相手の連続発言ではアイコンを出さない（位置は揃える） */
.ld-row-cont .ld-avatar { visibility: hidden; }
.ld-row-cont { margin-top: calc(var(--sp-3) * -1 + 2px); }

.ld-bubble {
  max-width: 78%; padding: 9px 13px; border-radius: 18px;
  font-size: var(--fs-base); line-height: 1.7; white-space: pre-wrap;
  word-break: break-word; box-shadow: 0 1px 1px rgba(20, 21, 23, .08);
}
.ld-bubble-bot { background: var(--paper); color: var(--ink-900); border-top-left-radius: 4px; }
.ld-bubble-user { background: #8de055; color: #10240b; border-bottom-right-radius: 4px; }

/* 入力中インジケータ */
.ld-typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.ld-typing span {
  width: 6px; height: 6px; border-radius: var(--r-full); background: var(--ink-400);
  animation: ld-blink 1.2s infinite ease-in-out;
}
.ld-typing span:nth-child(2) { animation-delay: .18s; }
.ld-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes ld-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ld-typing span { animation: none; }
  .ld-chat { scroll-behavior: auto; }
  .ld-cue-arrow::before,
  .ld-phone[data-hint="on"] .ld-fbtn-primary,
  .ld-phone[data-hint="on"] .ld-qr { animation: none; }
}

/* ── Flex メッセージ ── */
.ld-flex {
  max-width: 82%; background: var(--paper); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 21, 23, .16);
}
.ld-fbox { display: flex; }
.ld-ftext { margin: 0; line-height: 1.65; }
.ld-fimg { display: block; max-width: 100%; height: auto; }
.ld-fsep { border: 0; border-top: 1px solid var(--border); margin: 0; }

.ld-fbtn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.4;
  padding: 10px 12px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  font-family: inherit; transition: filter var(--dur) var(--ease);
}
.ld-fbtn:hover { filter: brightness(.95); }
.ld-fbtn-primary { background: var(--amber-500); color: var(--ink-900); }
.ld-fbtn-secondary { background: #eceff1; color: var(--ink-900); }
.ld-fbtn-link { background: transparent; color: var(--ink-600); }

/* ── 「あなたの番です」の合図 ──
   デモを静止画のモックだと思われないよう、次にできる操作を毎ターン明示する。 */
.ld-cue {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--sp-2);
  margin: var(--sp-3) var(--sp-3) 0; padding: 5px 6px 5px 5px;
  border-radius: var(--r-pill); background: rgba(20, 21, 23, .5);
  font-size: var(--fs-xs); color: #fff;
}
.ld-cue-turn {
  flex: 0 0 auto; font-weight: 700; color: var(--ink-900);
  background: var(--amber-500); border-radius: var(--r-pill); padding: 3px 10px;
}
.ld-cue-what { flex: 1 1 auto; font-weight: 700; }
.ld-cue[hidden] { display: none; }
.ld-cue-arrow { flex: 0 0 auto; font-weight: 700; padding-right: 6px; }
.ld-cue-arrow::before { content: "↓"; display: block; animation: ld-nudge 1.6s infinite ease-in-out; }
.ld-phone[data-turn="card"] .ld-cue-arrow::before { content: "↑"; animation-direction: reverse; }
@keyframes ld-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* 最初の 1 タップまでは、押せる場所そのものを目立たせる。 */
@keyframes ld-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 176, 32, .55); }
}
.ld-phone[data-hint="on"][data-turn="card"] .ld-row-bot:last-child .ld-fbtn-primary,
.ld-phone[data-hint="on"][data-turn="tap"] .ld-qr {
  animation: ld-attention 1.8s infinite ease-in-out;
}

/* 自由入力の番は、入力欄そのものを光らせる（ここに書けると分かるように）。 */
.ld-phone[data-turn="type"] .ld-input,
.ld-phone[data-turn="both"] .ld-input { box-shadow: inset 0 2px 0 0 var(--amber-500); }
.ld-phone[data-turn="type"] .ld-textbox,
.ld-phone[data-turn="both"] .ld-textbox {
  border-color: var(--amber-500); background: var(--paper);
}

/* ── 例文チップ（押すと入力欄に入る。送信はしない）── */
.ld-examples {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--sp-2);
  margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  background: var(--paper); border-top: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ld-examples[hidden] { display: none; }
.ld-examples::-webkit-scrollbar { display: none; }
.ld-examples-label {
  flex: 0 0 auto; font-size: var(--fs-2xs); font-weight: 700; color: var(--ink-600);
}
.ld-examples-chips { display: flex; gap: var(--sp-2); }
.ld-example {
  flex: 0 0 auto; white-space: nowrap; cursor: pointer; font-family: inherit;
  font-size: var(--fs-2xs); color: var(--ink-700); background: var(--paper);
  border: 1px dashed var(--ink-400); border-radius: var(--r-pill); padding: 5px 11px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ld-example:hover { background: var(--amber-050); border-color: var(--amber-500); }

/* ── クイックリプライ ── */
.ld-quick {
  flex: 0 0 auto; display: flex; gap: var(--sp-2); overflow-x: auto;
  padding: var(--sp-3); background: transparent;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ld-quick[hidden] { display: none; }
.ld-quick::-webkit-scrollbar { display: none; }
.ld-qr {
  flex: 0 0 auto; white-space: nowrap; cursor: pointer; font-family: inherit;
  font-size: var(--fs-sm); font-weight: 700; color: var(--line-500);
  background: var(--paper); border: 1px solid var(--line-500);
  border-radius: var(--r-pill); padding: 7px 14px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ld-qr:hover { background: var(--line-500); color: #fff; }
.ld-qr:active, .ld-fbtn:active, .ld-example:active { transform: translateY(1px); }

/* ── 入力欄 ── */
.ld-input {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3); background: var(--paper); border-top: 1px solid var(--border);
}
.ld-examples:not([hidden]) + .ld-input { border-top: 0; padding-top: 0; }
.ld-textbox {
  flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: var(--fs-base);
  padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: #f5f5f6; color: var(--ink-900);
}
.ld-textbox:focus { outline: 2px solid var(--amber-500); outline-offset: 1px; }
.ld-send {
  flex: 0 0 auto; padding: 9px 16px; border-radius: var(--r-pill);
  border: 0; background: var(--line-500); color: #fff; cursor: pointer;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 700; line-height: 1.4;
  transition: filter var(--dur) var(--ease);
}
.ld-send:hover:not(:disabled) { filter: brightness(.94); }
.ld-send:active:not(:disabled) { transform: translateY(1px); }
.ld-send:disabled, .ld-textbox:disabled { opacity: .5; cursor: not-allowed; }
.ld-phone-note {
  margin: var(--sp-3) 0 0; font-size: var(--fs-xs); color: var(--ink-400); text-align: center;
}

/* ── 右カラム ── */
.ld-side { display: flex; flex-direction: column; gap: var(--sp-4); }
.ld-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: var(--sp-5); box-shadow: var(--shadow-card);
}
.ld-card-title { margin: 0 0 var(--sp-3); font-size: var(--fs-lg); color: var(--ink-900); }
.ld-step {
  margin: 0 0 var(--sp-2); font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: .06em; color: var(--amber-700);
}
.ld-explain { margin: 0; font-size: var(--fs-base); line-height: 1.9; color: var(--ink-700); }

.ld-facts { margin: 0 0 var(--sp-3); display: grid; gap: var(--sp-2); }
.ld-fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  padding-bottom: var(--sp-2); border-bottom: 1px dashed var(--border);
}
.ld-fact dt { font-size: var(--fs-sm); color: var(--ink-600); margin: 0; }
.ld-fact dd { margin: 0; font-size: var(--fs-md); font-weight: 700; color: var(--ink-900); }
.ld-note { margin: 0; font-size: var(--fs-xs); line-height: 1.8; color: var(--ink-400); }

.ld-actions { display: flex; flex-direction: column; gap: var(--sp-3); }
.ld-reset {
  font-family: inherit; font-size: var(--fs-base); font-weight: 700; cursor: pointer;
  padding: 12px 18px; border-radius: var(--r-pill); color: var(--ink-700);
  background: var(--paper); border: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
}
.ld-reset:hover { background: var(--paper-hover); }

/* ── 補足 ── */
.ld-faq { padding: 0 0 var(--sp-12); }
.ld-faq-title { font-size: var(--fs-xl); margin: 0 0 var(--sp-5); color: var(--ink-900); }
.ld-faq-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-4);
}
.ld-faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: var(--sp-5);
}
.ld-faq-item h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); color: var(--ink-900); }
.ld-faq-item p { margin: 0; font-size: var(--fs-sm); line-height: 1.9; color: var(--ink-700); }

@media (max-width: 900px) {
  .ld-stage { grid-template-columns: 1fr; }
  .ld-phone-wrap { max-width: 420px; margin: 0 auto; width: 100%; }
}
@media (max-width: 640px) {
  .ld-hero { padding-top: var(--sp-6); }
  .ld-phone { height: 560px; border-radius: 20px; }
  .ld-bubble, .ld-flex { max-width: 84%; }
}
