/* ============================================================
   chatbot.css — floating idle iron assistant
============================================================ */

#iichat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  font-family: var(--font-body);
  color: var(--ink);
}

.iichat__fab {
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 18px 12px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-sm);
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.iichat__fab:hover { background: var(--brand-deep); transform: translateY(-1px); }
.iichat__fab:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
}

.iichat__panel {
  position: fixed;
  bottom: 76px;
  right: 20px;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 120px));
  background: var(--paper);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.iichat__panel[hidden] { display: none; }

.iichat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-2);
  background: var(--paper-2);
}
.iichat__head-title {
  font-weight: 700;
  font-size: var(--t-body);
  margin: 0;
  color: var(--ink);
}
.iichat__head-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 2px 0 0;
}
.iichat__close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
}
.iichat__close:hover { color: var(--ink); }

.iichat__log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.iichat__msg {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 86%;
  word-wrap: break-word;
}
.iichat__msg--user {
  background: var(--brand);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.iichat__msg--bot {
  background: var(--paper-2);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-2);
}
.iichat__msg--bot a {
  color: var(--brand-deep);
  text-decoration: underline;
}

.iichat__typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}
.iichat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-soft);
  display: inline-block;
  animation: iichat-bounce 1.2s infinite;
}
.iichat__typing span:nth-child(2) { animation-delay: 0.15s; }
.iichat__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes iichat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.iichat__suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}
.iichat__suggest:empty { padding: 0; }
.iichat__chip {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-muted);
  border: 1px solid var(--border-2);
  cursor: pointer;
}
.iichat__chip:hover { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand-soft); }

.iichat__form {
  display: flex;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-2);
  background: var(--paper);
  align-items: flex-end;
}
.iichat__label { position: absolute; left: -9999px; }
.iichat__form textarea {
  flex: 1 1 auto;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r);
  background: var(--paper);
  resize: none;
  color: var(--ink);
}
.iichat__form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(249 115 22 / 0.12);
}
.iichat__send {
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--r);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.iichat__send:hover { background: var(--brand-deep); }
.iichat__send:disabled { background: var(--ink-soft); cursor: not-allowed; }

@media (max-width: 480px) {
  .iichat__panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  #iichat { bottom: 16px; right: 16px; }
}
