/* The website's AI assistant: chat button and panel (chat.js builds the markup).
   Loaded after styles.css and uses its tokens. Dark panel, gold accents, mono
   labels, to match the "scanner" hero. */

.kc-launcher, .kc-panel { position: fixed; right: clamp(0.8rem, 2vw, 1.6rem); bottom: clamp(0.8rem, 2vw, 1.6rem); z-index: 200; }
.kc-launcher {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 48px;
  padding: 0.75rem 1.1rem; border-radius: 999px; cursor: pointer;
  background: var(--night); color: var(--paper); border: 1px solid rgba(244, 183, 64, 0.55);
  font-family: var(--mono); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 0 2.2rem -0.6rem rgba(244, 183, 64, 0.7), 0 1rem 2rem -1rem rgba(0, 0, 0, 0.7);
  transition: transform .25s var(--ease), box-shadow .25s;
}
/* Keep the hero's flow strip from running under the button. */
.has-chat .flow-inner { padding-right: 16rem; }
.kc-launcher:hover { transform: translateY(-2px); box-shadow: 0 0 2.6rem -0.4rem rgba(244, 183, 64, 0.9), 0 1rem 2rem -1rem rgba(0, 0, 0, 0.7); }
.kc-launcher.kc-hide, .kc-panel[hidden], .kc-panel [hidden] { display: none; }
.kc-launcher:focus-visible, .kc-panel button:focus-visible, .kc-panel a:focus-visible, .kc-input:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }

.kc-panel {
  width: min(24rem, calc(100vw - 1.6rem)); max-height: min(36rem, calc(100vh - 2rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--night); color: var(--paper); border: 1px solid rgba(244, 183, 64, 0.4); border-radius: 0.8rem;
  box-shadow: 0 0 3.5rem -1rem rgba(244, 183, 64, 0.55), 0 2rem 4rem -1.5rem rgba(0, 0, 0, 0.85);
  font-size: 0.92rem;
}
.kc-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.8rem 0.9rem 0.8rem 1.1rem; border-bottom: 1px solid var(--rule-dark); }
.kc-title { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.kc-title b { font-weight: 700; color: var(--ink); background: var(--gold-bright); border-radius: 0.25rem; padding: 0.1rem 0.4rem; letter-spacing: 0.06em; }
.kc-close { width: 2.4rem; height: 2.4rem; border: 0; border-radius: 0.4rem; background: transparent; color: var(--paper); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.kc-close:hover { background: rgba(255, 255, 255, 0.08); }

.kc-learn { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.85rem; cursor: pointer; }
.kc-learn input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; flex: none; accent-color: currentColor; }
.kc-gate { padding: 1.1rem; display: grid; gap: 0.8rem; justify-items: start; line-height: 1.55; color: rgba(251, 250, 247, 0.85); }
.kc-small { font-size: 0.8rem; }
.kc-panel a { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }

.kc-log { flex: 1; min-height: 12rem; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.kc-msg { max-width: 88%; padding: 0.65rem 0.85rem; border-radius: 0.7rem; line-height: 1.5; overflow-wrap: anywhere; }
.kc-msg p { white-space: pre-wrap; }
.kc-msg small { display: block; font-family: var(--mono); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-bright); margin-bottom: 0.25rem; }
.kc-bot { align-self: flex-start; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--rule-dark); border-bottom-left-radius: 0.2rem; }
.kc-me { align-self: flex-end; background: var(--gold-bright); color: var(--ink); border-bottom-right-radius: 0.2rem; }
.kc-typing { display: inline-flex; gap: 0.3rem; padding: 0.9rem 0.85rem; }
.kc-typing i { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--gold-bright); animation: kc-dot 1.1s ease-in-out infinite; }
.kc-typing i:nth-child(2) { animation-delay: 0.15s; }
.kc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes kc-dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-0.2rem); } }
.kc-suggest { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.kc-suggest button { min-height: 40px; padding: 0.45rem 0.8rem; border-radius: 999px; cursor: pointer; background: transparent; color: var(--paper); border: 1px solid rgba(244, 183, 64, 0.5); font-size: 0.82rem; text-align: left; }
.kc-suggest button:hover { background: rgba(244, 183, 64, 0.14); }

.kc-form { display: flex; gap: 0.5rem; align-items: flex-end; padding: 0.7rem 0.8rem; border-top: 1px solid var(--rule-dark); }
.kc-input { flex: 1; min-height: 46px; max-height: 8rem; padding: 0.7rem 0.8rem; border-radius: 0.5rem; border: 1px solid var(--rule-dark); background: rgba(0, 0, 0, 0.35); color: var(--white); font: inherit; font-size: 1rem; resize: none; }
.kc-input::placeholder { color: rgba(251, 250, 247, 0.45); }
.kc-send { min-height: 46px; padding: 0 1rem; border: 0; border-radius: 0.5rem; background: var(--gold-bright); color: var(--ink); font-weight: 700; cursor: pointer; }
.kc-send[disabled], .kc-input[disabled] { opacity: 0.55; cursor: default; }
.kc-foot { padding: 0 1rem 0.8rem; font-size: 0.72rem; line-height: 1.5; color: rgba(251, 250, 247, 0.55); }

@media (max-width: 600px) {
  .kc-panel { right: 0; left: 0; bottom: 0; width: 100%; max-height: 85vh; border-radius: 0.8rem 0.8rem 0 0; border-bottom: 0; }
  .kc-launcher span { max-width: 9.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
