/* 瀬戸内造園 AIチャット相談 */

.szchat{
  --sz-green:#2f5e39;
  --sz-green-dark:#24512e;
  --sz-gold:#a5825a;
  --sz-bg:#f2efe6;
  --sz-card:#fbfaf5;
  --sz-ink:#2b2b28;
  --sz-line:#e6e1d3;
  font-family:'Zen Kaku Gothic New','Hiragino Kaku Gothic ProN',sans-serif;
  color:var(--sz-ink);
}

/* ===== 開くボタン ===== */
.szchat-launch{
  position:fixed;left:24px;bottom:24px;z-index:850;
  display:flex;align-items:center;gap:10px;
  padding:10px 16px 10px 10px;
  background:#fff;border:1px solid var(--sz-green);border-radius:4px;
  cursor:pointer;transition:background .2s;
}
.szchat-launch:hover{background:var(--sz-card)}
.szchat-launch-face{width:44px;height:44px;border-radius:50%;object-fit:cover;flex:none;display:block;background:var(--sz-bg)}
.szchat-launch-txt{display:flex;flex-direction:column;align-items:flex-start;line-height:1.3;text-align:left}
.szchat-launch-txt b{font:700 16px/1.3 inherit;color:var(--sz-green)}
.szchat-launch-txt small{font:500 13px/1.4 inherit;color:var(--sz-ink)}
.szchat[data-open="1"] .szchat-launch{display:none}

/* ===== 本体 ===== */
.szchat-panel{
  position:fixed;left:24px;bottom:24px;z-index:851;
  width:380px;max-width:calc(100vw - 32px);
  height:min(600px,calc(100vh - 120px));
  display:flex;flex-direction:column;
  background:var(--sz-bg);border:1px solid var(--sz-green);border-radius:4px;
  overflow:hidden;
}
.szchat-panel[hidden]{display:none}

.szchat-head{
  display:flex;align-items:center;gap:10px;
  padding:12px 14px;background:var(--sz-green);color:#fff;flex:none;
}
.szchat-head-face{width:36px;height:36px;border-radius:50%;object-fit:cover;flex:none;display:block;background:#fff}
.szchat-head-txt{flex:1;min-width:0;line-height:1.3}
.szchat-head-txt b{display:block;font:700 16px/1.3 inherit;color:#fff}
.szchat-head-txt small{display:block;font:500 13px/1.4 inherit;color:#fff}
.szchat-close{
  flex:none;width:32px;height:32px;display:flex;align-items:center;justify-content:center;
  background:transparent;border:1px solid rgba(255,255,255,.7);border-radius:4px;color:#fff;cursor:pointer;
}
.szchat-close:hover{background:var(--sz-green-dark)}

/* ===== 会話 ===== */
.szchat-log{
  flex:1;overflow-y:auto;padding:16px 14px;
  display:flex;flex-direction:column;gap:14px;
  font:500 16px/1.75 inherit;
  -webkit-overflow-scrolling:touch;
}
.szchat-row{display:flex;gap:8px;align-items:flex-start}
.szchat-row.-me{justify-content:flex-end}
.szchat-face{width:32px;height:32px;border-radius:50%;flex:none;object-fit:cover;display:block;background:#fff;border:1px solid var(--sz-line)}
.szchat-bubble{
  max-width:82%;padding:10px 13px;border-radius:4px;
  background:#fff;border:1px solid var(--sz-line);
  white-space:pre-wrap;word-break:break-word;
}
.szchat-row.-me .szchat-bubble{background:var(--sz-green);border-color:var(--sz-green);color:#fff}
.szchat-bubble a{color:var(--sz-green);text-decoration:underline;font-weight:700}
.szchat-row.-me .szchat-bubble a{color:#fff}
.szchat-bubble.-error{border-color:#8a1f1f}

.szchat-link{
  display:inline-block;margin-top:8px;padding:6px 12px;
  background:var(--sz-gold);color:#fff;border-radius:4px;
  font:700 14px/1.5 inherit;text-decoration:none;
}
.szchat-link:hover{background:#b3924f;color:#fff}

.szchat-wait{display:flex;gap:5px;align-items:center;padding:4px 0}
.szchat-wait span{width:7px;height:7px;background:var(--sz-green);border-radius:50%;animation:szchat-blink 1.2s infinite}
.szchat-wait span:nth-child(2){animation-delay:.2s}
.szchat-wait span:nth-child(3){animation-delay:.4s}
@keyframes szchat-blink{0%,60%,100%{opacity:.25}30%{opacity:1}}
@media (prefers-reduced-motion:reduce){.szchat-wait span{animation:none;opacity:.6}}

/* ===== 質問の例 ===== */
.szchat-chips{
  flex:none;display:flex;flex-wrap:wrap;gap:6px;
  padding:0 14px 10px;
}
.szchat-chips:empty{display:none}
.szchat-chip{
  background:#fff;border:1px solid var(--sz-line);border-radius:4px;
  padding:6px 10px;font:500 14px/1.5 inherit;color:var(--sz-ink);cursor:pointer;
}
.szchat-chip:hover{border-color:var(--sz-green);background:var(--sz-card)}

/* ===== 入力 ===== */
.szchat-form{
  flex:none;display:flex;gap:8px;align-items:flex-end;
  padding:10px 14px;background:#fff;border-top:1px solid var(--sz-line);
}
.szchat-form textarea{
  flex:1;resize:none;max-height:120px;
  padding:9px 10px;border:1px solid var(--sz-line);border-radius:4px;
  font:500 16px/1.6 inherit;color:var(--sz-ink);background:#fff;
}
.szchat-form textarea:focus{outline:2px solid var(--sz-green);outline-offset:1px}
.szchat-send{
  flex:none;width:44px;height:44px;display:flex;align-items:center;justify-content:center;
  background:var(--sz-gold);color:#fff;border:none;border-radius:4px;cursor:pointer;
}
.szchat-send:hover{background:#b3924f}
.szchat-send:disabled{background:#cfc7b7;cursor:default}

.szchat-note{
  flex:none;margin:0;padding:8px 14px 12px;background:#fff;
  font:500 12px/1.6 inherit;color:var(--sz-ink);border-top:1px solid var(--sz-line);
}

/* ===== スマホ ===== */
@media (max-width:900px){
  .szchat-launch{left:12px;bottom:60px;padding:8px 12px 8px 8px}
  .szchat-launch-face{width:36px;height:36px}
  .szchat-launch-txt b{font-size:15px}
  .szchat-launch-txt small{font-size:12px}
  .szchat-panel{
    left:8px;right:8px;bottom:56px;width:auto;max-width:none;
    height:min(78vh,calc(100vh - 100px));
  }
  .szchat-bubble{max-width:86%}
}

.szchat .screen-reader-text{
  position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);
  white-space:nowrap;
}
