/* ============================================================
   コタエル デモ固有スタイル（工務店HPモック・チャットウィジェット・管理画面）
   共通部品は demo.css。ここは商品固有の追加のみ。
   ============================================================ */
:root { --wood: #b8895a; --wood-deep: #8a6540; --wood-bg: #f7f2ec; --wood-line: #e8dccd; --clay: #c9a27c; --moss: #7f8f6c; --stone: #9a8f85; --site-ink: #2b2622; --site-gray: #5b5149; }

/* ---------- 案内（3ステップ横並び） ---------- */
.kt-guide { flex-wrap: wrap; gap: 10px 22px; }
.kt-guide__i { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 220px; min-width: 0; }
.kt-stack { display: grid; gap: 18px; align-content: start; }

/* ---------- ブラウザ枠内の工務店サイト（モック） ---------- */
.kt-device .dm-device__body { height: 620px; overflow: hidden; background: #fff; }
.kt-site { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; font-size: 12.5px; line-height: 1.65; color: var(--site-ink); scrollbar-width: thin; }
.kt-site__head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--wood-line); position: sticky; top: 0; background: #fff; z-index: 2; }
.kt-site__logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 14px; white-space: nowrap; }
.kt-site__logo i { width: 22px; height: 22px; border-radius: 5px; background: var(--wood); flex-shrink: 0; }
.kt-site__nav { margin-left: auto; display: flex; gap: 14px; font-size: 11.5px; font-weight: 700; color: var(--site-gray); white-space: nowrap; }
.kt-site__hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: center; background: var(--wood); color: #fff; padding: 26px 22px; }
.kt-site__catch { font-size: 22px; font-weight: 900; line-height: 1.35; letter-spacing: .02em; margin-bottom: 8px; color: #fff; }
.kt-site__lead { font-size: 12px; color: #fff; margin-bottom: 12px; }
.kt-site__btn { display: inline-block; background: #fff; color: var(--wood-deep); font-weight: 900; font-size: 12px; padding: 7px 14px; border-radius: 999px; }
.kt-site__photo { background: var(--wood-deep); color: #fff; border-radius: 8px; min-height: 120px; display: grid; place-items: center; font-weight: 900; font-size: 12px; letter-spacing: .1em; }
.kt-site__sec { padding: 18px 22px 4px; }
.kt-site__sec h3 { font-size: 13.5px; font-weight: 900; margin-bottom: 10px; padding-left: 10px; border-left: 3px solid var(--wood); line-height: 1.4; }
.kt-works { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.kt-work p { font-size: 11px; font-weight: 700; color: var(--site-gray); margin-top: 6px; line-height: 1.5; }
.kt-work__ph { height: 68px; border-radius: 6px; background: var(--clay); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.kt-work__ph--2 { background: var(--moss); } .kt-work__ph--3 { background: var(--stone); }
.kt-site__price { margin: 14px 22px 0; background: var(--wood-bg); border: 1px solid var(--wood-line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 2px; }
.kt-site__price b { font-size: 12px; color: var(--wood-deep); }
.kt-site__price span { font-size: 16px; font-weight: 900; }
.kt-site__price small { font-size: 11px; color: var(--site-gray); font-weight: 700; }
.kt-site__co { display: grid; grid-template-columns: 78px 1fr; gap: 4px 10px; font-size: 12px; }
.kt-site__co dt { font-weight: 900; color: var(--site-gray); } .kt-site__co dd { font-weight: 700; }
.kt-site__foot { margin-top: 14px; padding: 14px 22px 96px; border-top: 1px solid var(--wood-line); font-size: 11px; font-weight: 700; color: var(--site-gray); }

/* ---------- チャットの丸ボタン ---------- */
.kt-launch { position: absolute; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 26px -8px rgba(67,56,202,.65); z-index: 5; transition: transform .25s var(--ease), filter .2s; }
.kt-launch:hover { transform: translateY(-2px); filter: brightness(1.06); }
.kt-launch svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: opacity .2s, transform .25s var(--ease); }
.kt-launch .ico-x { opacity: 0; transform: rotate(-90deg) scale(.6); }
.kt-launch.is-open .ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.kt-launch.is-open .ico-x { opacity: 1; transform: none; }
.kt-launch__tip { position: absolute; right: 82px; bottom: 28px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 900; color: var(--ink); box-shadow: var(--sh); white-space: nowrap; animation: kt-tip 2.4s var(--ease) infinite; }
.kt-launch__tip[hidden] { display: none; }
.kt-launch__tip::after { content: ""; position: absolute; right: -6px; top: 50%; width: 10px; height: 10px; background: #fff; border-right: 1px solid var(--line); border-top: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); }
@keyframes kt-tip { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }

/* ---------- チャットパネル（開閉） ---------- */
.kt-panel { position: absolute; right: 16px; bottom: 84px; z-index: 6; width: min(350px, calc(100% - 32px)); height: min(500px, calc(100% - 100px)); opacity: 0; visibility: hidden; transform: translateY(14px) scale(.98); transform-origin: bottom right; transition: opacity .25s var(--ease), transform .3s var(--ease), visibility 0s linear .3s; }
.kt-panel.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.kt-panel .dm-chat { height: 100%; min-height: 0; border-radius: 16px; box-shadow: 0 24px 50px -18px rgba(16,19,25,.45); }
.kt-panel .dm-chat__head { padding: 10px 10px 10px 14px; font-size: 13.5px; }
.kt-panel .dm-chat__head .dm-ico { stroke: #fff; }
.kt-panel__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.3; }
.kt-panel__title em { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; }
.kt-panel .dm-chat__head small { white-space: nowrap; }
.kt-panel__close { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; margin-left: 8px; flex-shrink: 0; }
.kt-panel__close svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.kt-panel .dm-chat__log { max-height: none; min-height: 0; padding: 12px; gap: 8px; }
.kt-panel .dm-msg { font-size: 13px; line-height: 1.7; padding: 9px 12px; }
.kt-panel .dm-msg .src { font-size: 11px; }
.kt-panel .dm-chat__quick { padding: 8px 10px 0; }
.kt-panel .dm-chip { padding: 4px 10px; font-size: 12px; }
.kt-panel .dm-chat__form { padding: 8px; gap: 6px; }
.kt-panel .dm-chat__form .dm-input { padding: 8px 11px; min-width: 0; }
.kt-panel .dm-chat__form .dm-btn { padding: 8px 14px; font-size: 13px; }
.kt-hform-msg { max-width: 100%; width: 100%; }
.kt-hform { display: grid; gap: 6px; margin-top: 8px; }
.kt-hform .dm-input { padding: 7px 10px; }
.kt-hform__err { font-size: 12px; font-weight: 900; color: var(--ng); }
.dm-msg--sys .lnk { background: none; }

/* ---------- 右カラム：解説・試す質問 ---------- */
.kt-steps .dm-list__item { align-items: flex-start; }
.kt-steps .dm-avatar { width: 30px; height: 30px; font-size: 13px; background: var(--p); color: #fff; }
.kt-try { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 会話ログ：結果の内訳 ---------- */
.kt-break { display: grid; gap: 14px; }
.kt-break__row { display: grid; gap: 6px; }
.kt-break__row .t { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 900; }
.kt-break__row .t small { color: var(--gray); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.kt-break__row.is-ok .dm-prog i { background: var(--ok); }
.kt-break__row.is-none .dm-prog i { background: var(--warn); }

/* ---------- 引き継ぎ：メールの例 ---------- */
.kt-mail { border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; background: #fff; }
.kt-mail__meta { background: var(--bg); padding: 10px 14px; font-size: 12.5px; display: grid; gap: 4px; border-bottom: 1px solid var(--line); font-weight: 700; }
.kt-mail__meta b { display: inline-block; min-width: 34px; color: var(--gray); margin-right: 8px; }
.kt-mail__body { padding: 14px 16px; white-space: pre-wrap; font-size: 13px; line-height: 1.8; }

/* ---------- 回答の改善 ---------- */
.kt-q { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; }
.kt-q.is-new { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-weak); }
.kt-q__rank { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.kt-q__t { font-weight: 900; font-size: 13.5px; line-height: 1.5; }
.kt-q__s { font-size: 12.5px; color: var(--gray); font-weight: 700; }
.kt-q__act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.kt-q__ans, .kt-q__saved { grid-column: 1 / -1; }
.kt-q__ans { display: grid; gap: 10px; padding-top: 4px; }
.kt-q__ans .dm-textarea { min-height: 96px; }
.kt-q__saved { background: var(--bg); border-radius: 6px; padding: 8px 12px; font-size: 13px; line-height: 1.7; }
.kt-q__saved b { display: block; font-size: 12px; color: var(--p-text); margin-bottom: 2px; }
.kt-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; background: var(--ink); color: #fff; padding: 14px 16px; border-radius: var(--r-s); overflow-x: auto; white-space: pre; margin-top: 10px; }
.kt-code b { color: #ffd9c7; font-weight: 700; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 960px) {
  .dm-side { min-width: 0; }  /* 横スクロールのナビが画面幅を押し広げないように */
  .kt-device .dm-device__body { height: 560px; }
  .kt-panel { right: 10px; bottom: 80px; width: calc(100% - 20px); height: calc(100% - 92px); }
  .kt-launch { right: 12px; bottom: 12px; }
  .kt-launch__tip { right: 78px; bottom: 24px; }
}
@media (max-width: 480px) {
  .dm-top__title { font-size: 14px; }
  .dm-demo-tag { font-size: 11px; padding: 3px 8px; }
}
@media (max-width: 600px) {
  .kt-site__nav { display: none; }
  .kt-site__hero { grid-template-columns: 1fr; padding: 20px 16px; }
  .kt-site__photo { min-height: 80px; }
  .kt-site__catch { font-size: 19px; }
  .kt-site__sec, .kt-site__foot { padding-left: 16px; padding-right: 16px; }
  .kt-site__price { margin-left: 16px; margin-right: 16px; }
  .kt-q { grid-template-columns: 30px 1fr; }
  .kt-q__act { grid-column: 2; justify-content: flex-start; }
  .kt-try .dm-btn, .kt-stack .dm-btn--accent { white-space: normal; text-align: left; }
}
