/* ============================================================
   Ask KHIT widget styles — uses the same --khit-* design tokens
   as the rest of the site (defined in assets/css/site.css).
   ============================================================ */

#ask-khit-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 500;
}

#ask-khit-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 10px;
  background: rgba(4,18,42,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(232,86,26,0.5);
  border-radius: 999px;
  color: #fff;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#ask-khit-toggle:hover {
  transform: translateY(-2px);
  background: rgba(4,18,42,0.88);
}
#ask-khit-toggle.is-open {
  background: var(--khit-orange);
  border-color: var(--khit-orange);
}

.ak-toggle-icon {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.ak-icon-open, .ak-icon-close {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ak-icon-open img { width: 24px; height: 24px; border-radius: 50%; display: block; }
.ak-icon-close {
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0;
  transform: scale(0.6);
  transition: 0.15s ease;
}
#ask-khit-toggle.is-open .ak-icon-open { opacity: 0; transform: scale(0.6); }
#ask-khit-toggle.is-open .ak-icon-close { opacity: 1; transform: scale(1); }
.ak-icon-open { transition: 0.15s ease; }

/* ── Panel ── translucent, discreet, glass-like. Hidden by default;
   only .ak-panel-open makes it visible. This avoids relying on the
   [hidden] attribute, which a same-specificity display rule can
   silently override. */
.ak-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(340px, calc(100vw - 48px));
  max-height: min(65vh, 480px);
  flex-direction: column;
  background: rgba(6,20,44,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  overflow: hidden;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}
.ak-panel.ak-panel-open {
  display: flex;
}

.ak-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.ak-panel-header button {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: var(--khit-text-soft, #b7c3d2);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 7px 12px;
  transition: 0.15s ease;
}
.ak-panel-header button:hover {
  background: var(--khit-orange);
  border-color: var(--khit-orange);
  color: #fff;
}

.ak-panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.ak-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #fff;
  font-family: var(--font-display, Inter), sans-serif;
}
.ak-subtitle {
  margin: 0 0 14px;
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--khit-text-soft, #b7c3d2);
}

.ak-cta {
  display: inline-block;
  margin-bottom: 14px;
  padding: 9px 16px;
  background: var(--khit-orange);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  border-radius: 999px;
  text-decoration: none;
}
.ak-cta:hover { background: #d14a15; }

.ak-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ak-option {
  display: block;
  width: 100%;
  padding: 10px 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--khit-text, #e8edf2);
  font-family: inherit;
  font-size: 0.85rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s ease;
}
.ak-option:hover {
  background: rgba(232,86,26,0.14);
  border-color: var(--khit-orange);
  color: #fff;
}

.ak-guardrail {
  padding: 9px 16px;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--khit-text-muted, #8a9bb0);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  #ask-khit-root { right: 16px; bottom: 16px; }
  #ask-khit-toggle .ak-toggle-label { display: none; }
  #ask-khit-toggle { padding: 10px; }
  .ak-panel { width: calc(100vw - 32px); right: -8px; max-height: min(65vh, 480px); }
}
