.akira-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.akira-chat-fab:hover { transform: scale(1.06); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32); }
.akira-chat-fab:focus-visible { outline: 3px solid #ffd54f; outline-offset: 3px; }
.akira-chat-fab[aria-expanded="true"] { transform: rotate(90deg); }

.akira-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 172px;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 210px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.akira-chat-panel[data-open="true"] {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.akira-chat-header {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.akira-chat-header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.akira-chat-header p { margin: 2px 0 0; font-size: 11px; opacity: 0.85; }
.akira-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.akira-chat-close:hover { background: rgba(255, 255, 255, 0.15); }

.akira-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f6f8fc;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.55;
}
.akira-chat-msg {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.akira-chat-msg-user {
  align-self: flex-end;
  background: #1a73e8;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.akira-chat-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: #222;
  border: 1px solid #e3e7ee;
  border-bottom-left-radius: 4px;
}
.akira-chat-msg-error {
  align-self: stretch;
  background: #fff3f3;
  color: #b71c1c;
  border: 1px solid #f5c2c2;
  font-size: 13px;
  text-align: center;
}
.akira-chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e3e7ee;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.akira-chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #9aa3ad;
  animation: akira-chat-bounce 1.2s infinite ease-in-out;
}
.akira-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.akira-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes akira-chat-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.akira-chat-form {
  border-top: 1px solid #e3e7ee;
  padding: 10px;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.akira-chat-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid #d6dbe3;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  max-height: 100px;
  outline: none;
}
.akira-chat-form textarea:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15); }
.akira-chat-send {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.akira-chat-send:hover:not(:disabled) { background: #0d5fcc; }
.akira-chat-send:disabled { background: #b3c5dc; cursor: not-allowed; }

.akira-chat-disclaimer {
  font-size: 10px;
  color: #6b7480;
  text-align: center;
  padding: 6px 10px 8px;
  background: #fff;
  border-top: 1px solid #f0f2f5;
}
.akira-chat-disclaimer a { color: #1a73e8; text-decoration: none; }
.akira-chat-disclaimer a:hover { text-decoration: underline; }

.akira-chat-lead-btn {
  display: block;
  margin: 0;
  padding: 10px 14px;
  border: none;
  border-top: 1px solid #e3e7ee;
  background: linear-gradient(135deg, #ff7043 0%, #f4511e 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.02em;
}
.akira-chat-lead-btn[hidden] { display: none !important; }
.akira-chat-lead-btn:hover { filter: brightness(1.05); }
.akira-chat-lead-btn:focus-visible { outline: 2px solid #ffd54f; outline-offset: -2px; }

.akira-chat-msg-system {
  align-self: stretch;
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
  font-size: 13px;
  text-align: center;
  font-weight: 500;
}

.akira-chat-lead-card {
  align-self: stretch;
  background: #fff;
  border: 1px solid #ffccbc;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.akira-chat-lead-title {
  font-size: 14px;
  font-weight: 700;
  color: #d84315;
}
.akira-chat-lead-desc {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
}
.akira-chat-lead-fields { display: flex; flex-direction: column; gap: 8px; }
.akira-chat-lead-fields input,
.akira-chat-lead-fields textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d6dbe3;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  resize: vertical;
}
.akira-chat-lead-fields input:focus,
.akira-chat-lead-fields textarea:focus {
  border-color: #ff7043;
  box-shadow: 0 0 0 2px rgba(255, 112, 67, 0.15);
}
.akira-chat-lead-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
}
.akira-chat-lead-status {
  font-size: 12px;
  color: #555;
  text-align: center;
  min-height: 1.2em;
}
.akira-chat-lead-status.err { color: #c62828; }
.akira-chat-lead-buttons { display: flex; gap: 8px; }
.akira-chat-lead-cancel,
.akira-chat-lead-submit {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.akira-chat-lead-cancel {
  background: #f0f2f5;
  color: #555;
}
.akira-chat-lead-cancel:hover { background: #e3e7ee; }
.akira-chat-lead-submit {
  background: #ff7043;
  color: #fff;
}
.akira-chat-lead-submit:hover:not(:disabled) { background: #f4511e; }
.akira-chat-lead-submit:disabled,
.akira-chat-lead-cancel:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .akira-chat-panel {
    right: 12px;
    bottom: 162px;
    width: calc(100vw - 24px);
    height: calc(100vh - 200px);
  }
  .akira-chat-fab { right: 18px; bottom: 96px; width: 54px; height: 54px; font-size: 24px; }
}
