/* ============ タンク郎AI チャット ============ */
.tkc-launcher, .tkc-hint, .tkc-panel, .tkc-panel button, .tkc-panel textarea { font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; }
.tkc-launcher {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 1000;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px; border: none; border-radius: 999px;
  background: #0f1b2d; color: #fff; font: inherit; font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(15,27,45,.28); cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.tkc-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15,27,45,.34); }
.tkc-launcher img { width: 40px; height: 40px; border-radius: 50%; background: #fff; }
.tkc-launcher .dot { position: absolute; top: 6px; left: 38px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid #0f1b2d; }
.tkc-open .tkc-launcher { display: none; }

.tkc-hint {
  position: fixed; right: 20px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1000;
  max-width: 260px; padding: 12px 34px 12px 14px; border-radius: 14px;
  background: #fff; color: #0f1b2d; font-size: 14px; line-height: 1.6;
  border: 1px solid #e2e8f0; box-shadow: 0 10px 30px rgba(15,27,45,.14);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.tkc-hint.show { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.tkc-hint button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: none; background: none; color: #94a3b8; font-size: 16px; line-height: 1; cursor: pointer; border-radius: 50%; }
.tkc-hint button:hover { background: #f1f5f9; color: #334155; }
.tkc-open .tkc-hint { display: none; }

.tkc-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 1001;
  width: 384px; height: min(640px, calc(100vh - 40px)); height: min(640px, calc(100dvh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15,27,45,.25);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; color: #334155;
  opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; pointer-events: none; visibility: hidden;
  transition: opacity .2s, transform .2s, visibility 0s .2s;
}
.tkc-open .tkc-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .2s, transform .2s; }
@media (max-width: 560px) {
  .tkc-panel { right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: none; }
  .tkc-launcher { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .tkc-hint { right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); }
}

.tkc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid #e2e8f0; background: #fff; padding-top: max(12px, env(safe-area-inset-top)); }
.tkc-head img { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #e2e8f0; }
.tkc-head .t { flex: 1; min-width: 0; line-height: 1.35; }
.tkc-head b { display: block; color: #0f1b2d; font-size: 15px; }
.tkc-head small { display: flex; align-items: center; gap: 5px; color: #64748b; font-size: 12px; }
.tkc-head small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.tkc-icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: none; border-radius: 10px; background: none; color: #64748b; cursor: pointer; }
.tkc-icon-btn:hover { background: #f1f5f9; color: #0f1b2d; }
.tkc-icon-btn svg { width: 20px; height: 20px; }

.tkc-body { flex: 1; overflow-y: auto; padding: 16px; background: #f6f8fb; overscroll-behavior: contain; }
.tkc-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; }
.tkc-row.user { justify-content: flex-end; }
.tkc-row .av { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #e2e8f0; flex-shrink: 0; background: #fff; }
.tkc-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.75; word-break: break-word; overflow-wrap: anywhere; }
.tkc-row.bot .tkc-msg { background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-bottom-left-radius: 6px; }
.tkc-row.user .tkc-msg { background: #2563eb; color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.tkc-msg p { margin: 0 0 6px; }
.tkc-msg p:last-child { margin-bottom: 0; }
.tkc-msg ul, .tkc-msg ol { margin: 4px 0 6px; padding-left: 1.3em; }
.tkc-msg li { margin: 2px 0; }
.tkc-msg a { color: #2563eb; }
.tkc-msg a[href^="http"] { word-break: break-all; }
.tkc-msg a[href^="tel:"] { white-space: nowrap; }
.tkc-msg strong { color: #0f1b2d; }
.tkc-msg pre { margin: 6px 0; padding: 10px; background: #0f1b2d; color: #e2e8f0; border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; }
.tkc-msg code { font-family: Consolas, Menlo, monospace; font-size: .92em; }
.tkc-msg :not(pre) > code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.tkc-msg.err { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.tkc-msg .retry { margin-top: 8px; padding: 6px 12px; border: 1px solid #fdba74; background: #fff; color: #9a3412; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }

.tkc-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.tkc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: tkc-b 1.2s infinite ease-in-out; }
.tkc-typing i:nth-child(2) { animation-delay: .15s; }
.tkc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tkc-b { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.tkc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px 36px; }
.tkc-chip { padding: 8px 14px; border: 1px solid #bcd0f7; background: #fff; color: #1d4ed8; border-radius: 999px; font: inherit; font-size: 13.5px; line-height: 1.4; cursor: pointer; text-align: left; transition: background .15s; }
.tkc-chip:hover { background: #eaf1ff; }

.tkc-cta { display: flex; gap: 8px; margin: 0 0 12px 36px; flex-wrap: wrap; }
.tkc-cta a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.tkc-cta .line { background: #06c755; color: #fff; }
.tkc-cta .tel { background: #fff; color: #0f1b2d; border: 1px solid #e2e8f0; }

.tkc-foot { border-top: 1px solid #e2e8f0; background: #fff; padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); }
.tkc-form { display: flex; align-items: flex-end; gap: 8px; background: #f6f8fb; border: 1px solid #e2e8f0; border-radius: 16px; padding: 6px 6px 6px 14px; transition: border-color .15s, box-shadow .15s; }
.tkc-form:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.tkc-form textarea { flex: 1; min-width: 0; border: none; outline: none; resize: none; background: transparent; font: inherit; font-size: 16px; line-height: 1.5; color: #0f1b2d; max-height: 120px; padding: 6px 0; }
.tkc-send { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border: none; border-radius: 12px; background: #2563eb; color: #fff; cursor: pointer; transition: background .15s, opacity .15s; }
.tkc-send:hover { background: #1d4ed8; }
.tkc-send:disabled { opacity: .35; cursor: default; }
.tkc-send svg { width: 18px; height: 18px; }
.tkc-note { margin: 6px 4px 0; font-size: 11px; color: #94a3b8; line-height: 1.5; }
