/* ═══════════════════════════════════════════════════
   Interdiamant AI Product Advisor — Widget Styles v2
   All colours driven by CSS custom properties set by PHP
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Chakra+Petch:ital,wght@0,300;0,400;0,600;1,300&family=Inter:wght@400;500;600&display=swap');
/* Orbitron = widget chrome | Chakra Petch = product cards | Inter = chat messages */
/* InterDiamant: Orbitron = chrome/headings, Inter = body/chat text */

/* ── Defaults (overridden by inline style from PHP) ── */
#ida-wrap {
  --ida-primary: #E9530D;
  --ida-bg:      #000000;
  --ida-panel:   #111111;
  --ida-edge:    #2A2A2A;
  --ida-gray:    #B3B2B2;
  --ida-mid:     #1A1A1A;
}

@keyframes ida-fadein { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
@keyframes ida-open   { from{opacity:0;transform:scale(.9) translateY(14px)} to{opacity:1;transform:scale(1) translateY(0)} }
@keyframes ida-pulse  { 0%,100%{box-shadow:0 0 0 0 rgba(233,83,13,.65)} 60%{box-shadow:0 0 0 14px rgba(233,83,13,0)} }
@keyframes ida-bounce { 0%,80%,100%{transform:scale(.65);opacity:.4} 40%{transform:scale(1);opacity:1} }

/* ── Wrapper ── */
#ida-wrap { position:fixed; bottom:28px; right:28px; left:auto; z-index:99999; }

/* ── FAB ── */
#ida-trigger { position:relative; }

#ida-fab {
  width:  var(--ida-fab-size, 62px);
  height: var(--ida-fab-size, 62px);
  background: var(--ida-primary);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  clip-path:    var(--ida-fab-shape,  polygon(0 0,100% 0,100% calc(100% - 13px),calc(100% - 13px) 100%,0 100%));
  border-radius:var(--ida-fab-radius, 0px);
  animation:    var(--ida-fab-animation, ida-pulse) 2.5s ease-in-out infinite;
  transition: transform var(--ida-anim,.2s), clip-path var(--ida-anim,.2s);
}
#ida-fab:hover  { transform:scale(1.08); }
#ida-fab:focus  { outline:2px solid #fff; outline-offset:2px; }

/* ── Tooltip ── */
#ida-tooltip {
  position:absolute; bottom:calc(100% + 11px); right:0;
  background:var(--ida-bg); border:1px solid var(--ida-primary);
  color:#fff; padding:6px 12px; white-space:nowrap;
  font-family:'Orbitron',sans-serif; font-weight:700; font-size:12px;
  letter-spacing:.12em; text-transform:uppercase;
  pointer-events:none; transition:opacity var(--ida-anim,.6s);
}
#ida-tooltip::after {
  content:''; position:absolute; bottom:-5px; right:17px;
  width:8px; height:8px; background:var(--ida-bg);
  border-right:1px solid var(--ida-primary); border-bottom:1px solid var(--ida-primary);
  transform:rotate(45deg);
}

/* ── Panel ── */
#ida-panel {
  width:380px; height:580px;
  background:var(--ida-bg); border:1px solid var(--ida-edge);
  display:flex; flex-direction:column;
  position:relative; overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.85),0 0 0 1px rgba(233,83,13,.1);
  clip-path:polygon(0 0,100% 0,100% calc(100% - 16px),calc(100% - 16px) 100%,0 100%);
}
#ida-panel.ida-panel-open { animation:ida-open var(--ida-anim,.32s) cubic-bezier(.34,1.56,.64,1) both; }

.ida-scanlines {
  position:absolute; inset:0;
  background-image:repeating-linear-gradient(0deg,rgba(255,255,255,.013) 0,rgba(255,255,255,.013) 1px,transparent 1px,transparent 4px);
  pointer-events:none; z-index:0;
}

/* ── Header ── */
#ida-header {
  background:var(--ida-bg); border-bottom:2px solid var(--ida-primary);
  padding:0 16px; display:flex; align-items:center; justify-content:space-between;
  height:60px; flex-shrink:0; position:relative; z-index:1;
}
.ida-header-left  { display:flex; align-items:center; gap:10px; }
.ida-header-right { display:flex; align-items:center; gap:12px; }

.ida-brand {
  font-family:'Orbitron',sans-serif; font-weight:900; font-size:18px;
  letter-spacing:.13em; text-transform:uppercase; color:#fff; line-height:1;
}
.ida-sub { font-size:10px; color:var(--ida-gray); letter-spacing:.15em; text-transform:uppercase; margin-top:3px; }

.ida-status { display:flex; align-items:center; gap:5px; font-size:10px; color:#22c55e; }
.ida-dot    { width:6px; height:6px; border-radius:50%; background:#22c55e; flex-shrink:0; }

#ida-close { background:none; border:none; cursor:pointer; color:var(--ida-gray); padding:4px; display:flex; transition:color .2s; }
#ida-close:hover { color:#fff; }
#ida-close:focus { outline:1px solid var(--ida-primary); }

/* ── Messages ── */
#ida-messages {
  flex:1; overflow-y:auto; padding:16px 16px 8px;
  display:flex; flex-direction:column;
  position:relative; z-index:1;
  scrollbar-width:thin; scrollbar-color:var(--ida-edge) transparent;
}
#ida-messages::-webkit-scrollbar       { width:4px; }
#ida-messages::-webkit-scrollbar-thumb { background:var(--ida-edge); border-radius:2px; }

/* Welcome */
#ida-welcome { animation:ida-fadein .4s ease; }
.ida-welcome-card {
  background:var(--ida-panel); border:1px solid var(--ida-edge);
  padding:16px; margin-bottom:16px;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%);
}
.ida-welcome-title {
  font-family:'Orbitron',sans-serif; font-weight:800; font-size:22px;
  letter-spacing:.06em; color:#fff; text-transform:uppercase;
  line-height:1.1; margin-bottom:8px;
}
.ida-welcome-body { font-size:13px; color:var(--ida-gray); line-height:1.65; }
.ida-divider { height:2px; background:linear-gradient(90deg,var(--ida-primary),transparent); margin-bottom:14px; }
.ida-qs-label {
  font-family:'Orbitron',sans-serif; font-weight:700; font-size:10px;
  letter-spacing:.18em; color:var(--ida-gray); text-transform:uppercase; margin-bottom:8px;
}
#ida-quick { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:4px; }

.ida-qp {
  background:transparent; border:1px solid var(--ida-edge);
  color:var(--ida-gray); font-size:11.5px; padding:5px 10px;
  cursor:pointer; font-family:'Orbitron',sans-serif;
  font-weight:600; letter-spacing:.06em; text-transform:uppercase;
  transition:border-color .2s,color .2s;
}
.ida-qp:hover { border-color:var(--ida-primary); color:var(--ida-primary); }
.ida-qp:focus { outline:1px solid var(--ida-primary); }

/* Message rows */
.ida-row      { display:flex; margin-bottom:12px; animation:ida-fadein .25s ease; }
.ida-row-user { justify-content:flex-end; }
.ida-row-bot  { justify-content:flex-start; }

.ida-bot-avatar {
  width:28px; height:28px; background:var(--ida-primary);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; margin-right:8px; align-self:flex-end;
}

.ida-bubble { max-width:78%; padding:10px 14px; font-size:13.5px; line-height:1.6; font-family:'Inter',sans-serif; }
.ida-bubble-user {
  background:var(--ida-primary); color:#000; font-weight:600;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%);
}
.ida-bubble-bot {
  background:var(--ida-edge); color:var(--ida-gray);
  clip-path:polygon(0 0,100% 0,100% 100%,8px 100%,0 calc(100% - 8px));
}
.ida-link { color:var(--ida-primary); text-decoration:underline; text-decoration-style:dotted; font-weight:600; }
.ida-link:hover { text-decoration-style:solid; }

/* Typing indicator */
#ida-typing { display:flex; align-items:flex-end; padding:0 16px 8px; position:relative; z-index:1; }
.ida-typing-dots {
  background:var(--ida-edge); padding:12px 16px;
  clip-path:polygon(0 0,100% 0,100% 100%,8px 100%,0 calc(100% - 8px));
  display:flex; gap:5px; align-items:center;
}
.ida-typing-dots span { display:block; width:6px; height:6px; border-radius:50%; background:var(--ida-primary); }
.ida-typing-dots span:nth-child(1) { animation:ida-bounce 1.2s ease-in-out 0s infinite; }
.ida-typing-dots span:nth-child(2) { animation:ida-bounce 1.2s ease-in-out .2s infinite; }
.ida-typing-dots span:nth-child(3) { animation:ida-bounce 1.2s ease-in-out .4s infinite; }

/* ── Input row ── */
.ida-input-rule { height:1px; background:var(--ida-edge); flex-shrink:0; position:relative; z-index:1; }

#ida-input-row {
  padding:12px 16px 16px; display:flex; gap:8px;
  background:var(--ida-bg); flex-shrink:0; align-items:flex-end;
  position:relative; z-index:1;
}
#ida-input {
  flex:1; background:var(--ida-mid); border:1px solid var(--ida-edge);
  color:#fff; padding:10px 12px; font-size:13.5px;
  font-family:'Inter',sans-serif; line-height:1.5;
  resize:none; max-height:100px; overflow-y:auto;
  transition:border-color .2s; scrollbar-width:thin;
}
#ida-input::placeholder { color:#555; }
#ida-input:focus        { outline:none; border-color:var(--ida-primary); }

#ida-send {
  width:42px; height:42px; background:var(--ida-primary);
  border:none; cursor:pointer; display:flex; align-items:center;
  justify-content:center; color:#000; flex-shrink:0;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%);
  transition:background .2s;
}
#ida-send:hover:not(:disabled) { filter:brightness(1.12); }
#ida-send:disabled { opacity:.35; cursor:not-allowed; }
#ida-send:focus    { outline:2px solid #fff; outline-offset:2px; }

/* ── Footer ── */
#ida-footer {
  text-align:center; padding:0 16px 10px;
  font-size:10px; color:#333; position:relative; z-index:1;
}
#ida-footer a { color:#444; text-decoration:none; }
#ida-footer a:hover { color:var(--ida-primary); }

/* ── Responsive ── */
@media (max-width:440px) {
  #ida-wrap  { bottom:16px; right:16px !important; left:16px !important; }
  #ida-panel { width:calc(100vw - 32px); height:520px; }
  #ida-tooltip { display:none; }
}

@media (prefers-reduced-motion:reduce) {
  #ida-fab,
  .ida-typing-dots span,
  #ida-panel.ida-panel-open,
  .ida-row { animation:none !important; }
}

/* ═══════════════════════════════════════════════════
   RETURNING CUSTOMER — Personalised welcome screen
═══════════════════════════════════════════════════ */

/* ── Personal greeting card ─────────────────────── */
.ida-personal-card {
  background: var(--ida-panel);
  border: 1px solid var(--ida-edge);
  padding: 14px;
  margin-bottom: 4px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  animation: ida-fadein .35s ease;
  transition: opacity .3s, transform .3s;
}
.ida-card-dismissed {
  opacity: 0;
  transform: translateY(-8px);
}

.ida-personal-greeting {
  font-size: 13.5px;
  color: #fff;
  line-height: 1.6;
  margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.ida-chips-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--ida-gray);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Product chips ──────────────────────────────── */
.ida-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ida-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ida-bg);
  border: 1px solid var(--ida-edge);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color .2s, opacity .2s;
  position: relative;
  user-select: none;
}
.ida-chip:hover:not(.ida-chip-oos) { border-color: var(--ida-primary); }
.ida-chip.ida-chip-deselected     { opacity: .45; }
.ida-chip.ida-chip-oos            { opacity: .55; cursor: default; }

/* Product image */
.ida-chip-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ida-edge);
}
.ida-chip-img-placeholder {
  width: 36px;
  height: 36px;
  background: var(--ida-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Product info */
.ida-chip-info { flex: 1; min-width: 0; }
.ida-chip-name {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.ida-chip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.ida-chip-qty   { font-size: 11px; color: var(--ida-primary); font-weight: 700; }
.ida-chip-price { font-size: 11px; color: var(--ida-gray); }
.ida-chip-oos-badge {
  display: inline-block;
  font-size: 9px;
  color: #f87171;
  border: 1px solid #f87171;
  padding: 1px 5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Checkmark on right */
.ida-chip-check {
  color: var(--ida-primary);
  flex-shrink: 0;
  display: flex;
  transition: opacity .2s;
}
.ida-chip.ida-chip-deselected .ida-chip-check { opacity: 0; }

/* ── Cart action buttons ─────────────────────────── */
.ida-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.ida-cart-btn {
  width: 100%;
  background: var(--ida-primary);
  color: #000;
  border: none;
  padding: 11px 16px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  transition: filter .2s, opacity .2s;
}
.ida-cart-btn:hover:not(:disabled) { filter: brightness(1.1); }
.ida-cart-btn:disabled { opacity: .55; cursor: not-allowed; }
.ida-cart-btn-done   { background: #22c55e !important; color: #fff !important; }
.ida-cart-btn-disabled { background: var(--ida-edge) !important; color: var(--ida-gray) !important; }

.ida-browse-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--ida-edge);
  color: var(--ida-gray);
  padding: 7px 16px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, color .2s;
}
.ida-browse-btn:hover { border-color: var(--ida-gray); color: #fff; }

/* ── Cart status feedback ───────────────────────── */
.ida-cart-status {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.ida-status-loading { color: var(--ida-gray); }
.ida-status-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.ida-status-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.ida-status-warning { background: rgba(250,204,21,.1); border: 1px solid rgba(250,204,21,.3); color: #fde047; }

.ida-cart-link { color: var(--ida-primary); text-decoration: underline; text-decoration-style: dotted; font-weight: 600; }

/* ═══════════════════════════════════════════════════
   PROACTIVE AUTO-OPEN  — distinct from manual open
   Slower, authority-building slide up from the bottom
═══════════════════════════════════════════════════ */

@keyframes ida-auto-slide-up {
  0%   { opacity: 0;   transform: translateY(32px) scale(0.96); }
  60%  { opacity: 1;   transform: translateY(-4px)  scale(1.01); }
  100% { opacity: 1;   transform: translateY(0)     scale(1);    }
}

/* Attention-ring on the trigger before auto-open fires */
@keyframes ida-attention {
  0%   { box-shadow: 0 0 0 0   rgba(233,83,13,.8); }
  50%  { box-shadow: 0 0 0 18px rgba(233,83,13,0); }
  100% { box-shadow: 0 0 0 0   rgba(233,83,13,0); }
}

#ida-panel.ida-auto-open {
  animation: ida-auto-slide-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Stronger glow on the FAB right before auto-open (applied briefly by JS) */
#ida-fab.ida-pre-open {
  animation: ida-attention 0.9s ease 2;
}

/* ═══════════════════════════════════════════════════
   XAI EXPLANATION CARD  — appended to bot recommendations
═══════════════════════════════════════════════════ */

.ida-xai-card {
  margin-top: 10px;
  border: 1px solid rgba(233,83,13,.25);
  border-left: 3px solid var(--ida-primary);
  background: rgba(233,83,13,.06);
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  overflow: hidden;
}

/* ── Header ── */
.ida-xai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(233,83,13,.15);
  background: rgba(233,83,13,.08);
}
.ida-xai-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ida-primary);
}
.ida-xai-conf {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Matched factors ── */
.ida-xai-factors { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 5px; }

.ida-xai-factor {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.4;
}
.ida-xai-req {
  color: #ddd;
  flex-shrink: 0;
  max-width: 45%;
  font-size: 11px;
}
.ida-xai-arrow {
  color: rgba(233,83,13,.6);
  flex-shrink: 0;
  font-size: 11px;
}
.ida-xai-match {
  color: #bbb;
  flex: 1;
  font-size: 11px;
}
.ida-xai-check {
  color: #4ade80;
  font-size: 11px;
  flex-shrink: 0;
  font-weight: 700;
}
.ida-xai-factor-plain { color: #bbb; }

/* ── Alternatives ── */
.ida-xai-alts {
  padding: 4px 10px 6px;
  border-top: 1px solid rgba(233,83,13,.1);
}
.ida-xai-alts-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 4px;
}
.ida-xai-alt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
}
.ida-xai-alt::before { content: '↔'; color: rgba(233,83,13,.5); flex-shrink: 0; }
.ida-xai-alt-name   { color: #ddd; font-weight: 600; white-space: nowrap; }
.ida-xai-alt-reason { color: #888; }

/* ── Caveat ── */
.ida-xai-caveat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border-top: 1px solid rgba(233,83,13,.1);
  font-size: 11px;
  color: #fde68a;
  line-height: 1.45;
}
.ida-xai-caveat-icon { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   ESCALATION CARD  — WhatsApp handoff
═══════════════════════════════════════════════════ */

.ida-escalate-card {
  margin-top: 10px;
  border: 1px solid rgba(37,211,102,.3);
  border-left: 3px solid #25D366;
  background: rgba(37,211,102,.06);
  overflow: hidden;
}
.ida-escalate-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(37,211,102,.1);
  border-bottom: 1px solid rgba(37,211,102,.15);
}
.ida-escalate-icon    { font-size: 16px; flex-shrink: 0; }
.ida-escalate-heading {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #25D366;
}
.ida-escalate-body {
  padding: 8px 12px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.55;
}
.ida-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 12px 12px;
  padding: 10px 16px;
  background: #25D366;
  color: #000;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%);
  transition: filter .2s;
}
.ida-wa-btn:hover { filter: brightness(1.1); }

/* ═══════════════════════════════════════════════════
   Feature 1 — Inline Add to Cart card
═══════════════════════════════════════════════════ */

.ida-inline-atc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(233,83,13,.3);
  border-left: 3px solid var(--ida-primary);
  background: rgba(233,83,13,.06);
}
.ida-inline-atc-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ida-inline-atc-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.ida-inline-atc-btn {
  background: var(--ida-primary);
  color: #000;
  border: none;
  padding: 7px 13px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .2s, background .3s;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%);
  white-space: nowrap;
}
.ida-inline-atc-btn:hover:not(:disabled) { filter: brightness(1.1); }
.ida-inline-atc-btn:disabled { opacity: .75; cursor: default; }
.ida-inline-atc-view {
  font-size: 11px;
  color: var(--ida-primary);
  text-decoration: underline;
  text-decoration-style: dotted;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   Feature 2 — Comparison table
═══════════════════════════════════════════════════ */

.ida-compare-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(233,83,13,.2);
}
.ida-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: 'Inter', sans-serif;
  min-width: 280px;
}
.ida-compare-table thead tr {
  background: var(--ida-primary);
}
.ida-compare-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ida-compare-table thead th.ida-compare-feat { color: rgba(0,0,0,.7); background: rgba(0,0,0,.15); }
.ida-compare-table thead th.ida-compare-prod { color: #000; }

.ida-compare-table tbody td {
  padding: 7px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: #ccc;
  vertical-align: top;
  line-height: 1.4;
}
.ida-compare-table tbody tr.ida-compare-even td { background: rgba(255,255,255,.03); }
.ida-compare-table tbody td.ida-compare-feat-cell {
  font-weight: 600;
  color: #aaa;
  background: rgba(0,0,0,.2);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   CUSTOM DRILL CONFIGURATOR CARD
═══════════════════════════════════════════════════ */

.ida-config-card {
  margin-top: 10px;
  border: 1px solid rgba(233,83,13,.25);
  border-left: 3px solid var(--ida-primary);
  background: rgba(0,0,0,.5);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
.ida-config-card.ida-config-complete {
  border-color: #4ade80;
  border-left-color: #4ade80;
}

/* ── Header ── */
.ida-config-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: rgba(233,83,13,.1);
  border-bottom: 1px solid rgba(233,83,13,.15);
}
.ida-config-complete .ida-config-header {
  background: rgba(74,222,128,.08);
  border-bottom-color: rgba(74,222,128,.2);
}
.ida-config-icon  { font-size: 18px; flex-shrink: 0; }
.ida-config-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ida-primary);
}
.ida-config-complete .ida-config-title { color: #4ade80; }
.ida-config-sub { font-size: 10px; color: #555; margin-top: 1px; }

/* ── Spec rows ── */
.ida-config-specs { padding: 8px 0 4px; }
.ida-config-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 13px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.ida-config-row:last-of-type { border-bottom: none; }
.ida-config-pending { opacity: .5; }
.ida-config-check  { color: #4ade80; font-size: 11px; flex-shrink: 0; width: 12px; }
.ida-config-empty  { color: #444; }
.ida-config-lbl    { color: #888; min-width: 140px; flex-shrink: 0; }
.ida-config-val    { color: #fff; font-weight: 600; flex: 1; }
.ida-config-collecting { color: #444; font-weight: 400; font-style: italic; }
.ida-config-progress {
  padding: 6px 13px;
  font-size: 10px; color: #555;
  letter-spacing: .06em; text-transform: uppercase;
  border-top: 1px solid rgba(255,255,255,.04);
}

/* ── Complete state ── */
.ida-config-summary {
  padding: 8px 13px;
  font-size: 12px; color: #aaa; line-height: 1.5;
  border-top: 1px solid rgba(74,222,128,.15);
  font-style: italic;
}
.ida-config-submitted {
  padding: 10px 13px;
  font-size: 12px; color: #4ade80; line-height: 1.6;
  border-top: 1px solid rgba(74,222,128,.2);
}
.ida-config-submitted small { color: #555; }

/* ── Contact form ── */
.ida-config-form {
  padding: 10px 13px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ida-config-form-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
  color: #4ade80; margin-bottom: 2px;
}
.ida-config-input {
  background: #0d0d0d; border: 1px solid #2a2a2a;
  color: #fff; padding: 7px 10px;
  font-family: 'Inter', sans-serif; font-size: 12px;
  outline: none; transition: border-color .2s;
  width: 100%; box-sizing: border-box;
}
.ida-config-input:focus { border-color: #4ade80; }
.ida-config-input::placeholder { color: #444; }
.ida-config-textarea { resize: vertical; min-height: 50px; }
.ida-config-submit-btn {
  background: #4ade80; color: #000; border: none;
  padding: 10px 14px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800; font-size: 12px;
  letter-spacing: .07em; text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%);
  transition: filter .2s;
}
.ida-config-submit-btn:hover:not(:disabled) { filter: brightness(1.1); }
.ida-config-submit-btn:disabled { opacity: .6; cursor: default; }

/* ── Footer link ── */
.ida-config-link {
  display: block;
  padding: 8px 13px;
  font-size: 10.5px; color: #555;
  text-decoration: none;
  border-top: 1px solid rgba(255,255,255,.04);
  transition: color .2s;
}
.ida-config-link:hover { color: var(--ida-primary); }

/* ── Dismiss (×) button on FAB ──────────────────────────────────────────
   Always visible — small × badge anchored to the top-right of the FAB.
   No hover required; works on desktop, tablet and mobile.
──────────────────────────────────────────────────────────────────────── */

#ida-trigger {
  position: relative;
  display: inline-block;
}

#ida-dismiss {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #888;
  border: 2px solid #000;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, transform .15s;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,.6);
}

#ida-dismiss:hover,
#ida-dismiss:focus-visible {
  background: #dc2626;
  color: #fff;
  transform: scale(1.15);
  outline: none;
}

#ida-dismiss:active {
  transform: scale(.95);
}

/* ── Custom drill CTA card ──────────────────────────────────────────
   Replaces the old in-chat spec collector. Shown when the AI
   detects a custom drill request and outputs <custom_drill/> tag.
──────────────────────────────────────────────────────────────────── */
.ida-drill-cta {
  margin: 10px 0 4px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-left: 3px solid #E9530D;
  padding: 14px 16px;
}
.ida-drill-cta-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .12em;
  color: #E9530D;
  margin-bottom: 6px;
}
.ida-drill-cta-sub {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 12px;
}
.ida-drill-cta-btn {
  display: inline-block;
  background: #E9530D;
  color: #000;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 16px;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%);
  transition: filter .15s;
}
.ida-drill-cta-btn:hover { filter: brightness(1.1); color: #000; }

/* ═══════════════════════════════════════════════════════════════
   CUSTOM DRILL CONFIGURATOR PANEL
   Sticky spec panel between the chat header and message list.
   Tracks AI-gathered specs in real time; shows quote form when
   all 5 specs are confirmed.
═══════════════════════════════════════════════════════════════ */

/* Panel container */
#ida-drill-panel {
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  max-height: 360px;
  overflow-y: auto;
  transition: max-height .3s ease;
}

/* Compact header bar */
#ida-dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 2;
}
#ida-dp-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #E9530D;
  display: flex;
  align-items: center;
  gap: 6px;
}
#ida-dp-progress {
  font-size: 10px;
  color: #555;
  font-family: 'Orbitron', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ida-dp-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #222;
  transition: background .25s;
}
.ida-dp-dot-ok { background: #E9530D; }

/* Complete state — header turns green-tinted */
#ida-drill-panel.ida-dp-complete #ida-dp-header { background: #010a03; border-bottom-color: #14532d; }
#ida-drill-panel.ida-dp-complete #ida-dp-title  { color: #22c55e; }

/* Spec rows */
.ida-dp-rows { padding: 10px 14px 6px; display: flex; flex-direction: column; gap: 5px; }
.ida-dp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  padding: 4px 0;
  border-bottom: 1px solid #111;
}
.ida-dp-row:last-child { border-bottom: none; }
.ida-dp-check { font-size: 11px; width: 14px; flex-shrink: 0; }
.ida-dp-row-ok .ida-dp-check { color: #22c55e; }
.ida-dp-row-pending .ida-dp-check { color: #333; }
.ida-dp-lbl { color: #666; width: 90px; flex-shrink: 0; font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 10px; }
.ida-dp-val { color: #ccc; flex: 1; font-size: 11.5px; }
.ida-dp-row-pending .ida-dp-val { color: #333; }
.ida-dp-row-pending .ida-dp-val em { font-style: normal; color: #333; }

/* Progress bar */
.ida-dp-bar-wrap { height: 2px; background: #111; margin: 8px 14px 4px; }
.ida-dp-bar { height: 100%; background: #E9530D; transition: width .4s ease; }
.ida-dp-hint { font-size: 10px; color: #444; text-align: center; padding: 6px 14px 10px; font-style: italic; }

/* Quote form (shown when complete) */
.ida-dp-form { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.ida-dp-input {
  background: #050505;
  border: 1px solid #1a1a1a;
  color: #ccc;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12px;
  width: 100%;
  outline: none;
  border-radius: 0;
  transition: border-color .15s;
}
.ida-dp-input:focus { border-color: #E9530D; }
.ida-dp-textarea { resize: none; min-height: 48px; }
.ida-dp-submit {
  background: #E9530D;
  color: #000;
  border: none;
  padding: 9px 16px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%);
  transition: filter .15s;
}
.ida-dp-submit:hover:not(:disabled) { filter: brightness(1.1); }
.ida-dp-submit:disabled { opacity: .6; cursor: not-allowed; }
.ida-dp-alt-link {
  font-size: 10px;
  color: #555;
  text-align: center;
  text-decoration: none;
  padding: 2px 0;
  display: block;
  transition: color .15s;
}
.ida-dp-alt-link:hover { color: #E9530D; }

/* Submitted state */
.ida-dp-submitted { text-align: center; padding: 16px 14px; }
.ida-dp-submitted-icon  { font-size: 24px; color: #22c55e; margin-bottom: 8px; }
.ida-dp-submitted-title { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #22c55e; margin-bottom: 6px; }
.ida-dp-submitted-sub   { font-size: 11.5px; color: #888; margin-bottom: 6px; }
.ida-dp-submitted-contact { font-size: 10.5px; color: #555; }
.ida-dp-submitted-contact a { color: #E9530D; text-decoration: none; }

/* ── Zero-party classification buttons (Idea 4) ──────────
   Shown once in the welcome panel before any chat starts.
   Three choices: contractor / distributor / personal.
──────────────────────────────────────────────────────── */
.ida-zp-wrap {
  padding: 10px 16px 14px;
  border-top: 1px solid #1a1a1a;
  margin-top: 4px;
}
.ida-zp-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 8px;
}
.ida-zp-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ida-zp-btn {
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
  color: #aaa;
  padding: 9px 14px;
  text-align: left;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  display: flex;
  align-items: center;
  gap: 8px;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%);
}
.ida-zp-btn::before {
  content: '→';
  color: #333;
  font-size: 11px;
  transition: color .15s;
}
.ida-zp-btn:hover {
  border-color: #E9530D;
  color: #fff;
  background: #0f0f0f;
}
.ida-zp-btn:hover::before { color: #E9530D; }

/* ── Volume Quote Offer Card ──────────────────────────
   Rendered in chat when AI emits a <quote_offer> tag.
   Shows the volume pricing, discount, and quote form.
──────────────────────────────────────────────────────── */
.ida-quote-card {
  margin: 10px 0 4px;
  background: #050505;
  border: 1px solid #1a1a1a;
  border-top: 2px solid #E9530D;
  overflow: hidden;
}
.ida-quote-card-head {
  padding: 9px 14px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #E9530D;
}
.ida-quote-card-body { padding: 12px 14px; }
.ida-quote-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #0f0f0f;
  color: #888;
}
.ida-quote-line span  { color: #666; }
.ida-quote-line strong{ color: #ccc; }
.ida-quote-total      { padding: 8px 0; margin-top: 2px; }
.ida-quote-total span  { font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #555; }
.ida-quote-total strong{ font-family: 'Orbitron', sans-serif; font-size: 20px; font-weight: 900; color: #fff; }
.ida-quote-divider { height: 1px; background: #1a1a1a; margin: 10px 0; }
.ida-quote-input {
  display: block;
  width: 100%;
  background: #000;
  border: 1px solid #1a1a1a;
  border-radius: 0;
  color: #ccc;
  font-family: inherit;
  font-size: 12px;
  padding: 7px 10px;
  margin-bottom: 6px;
  outline: none;
  transition: border-color .15s;
}
.ida-quote-input:focus { border-color: #E9530D; }
.ida-quote-submit {
  width: 100%;
  background: #E9530D;
  color: #000;
  border: none;
  padding: 10px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%);
  transition: filter .15s;
  margin-top: 4px;
}
.ida-quote-submit:hover:not(:disabled) { filter: brightness(1.1); }
.ida-quote-submit:disabled { opacity: .6; cursor: not-allowed; }
.ida-quote-validity { font-size: 10px; color: #444; text-align: center; margin-top: 8px; }

/* ── Quote Promo Badge & Tooltip ─────────────────────────
   Passive badge on the FAB when volume tiers are available.
   Tooltip auto-dismisses. Proactive bubble highlight.
──────────────────────────────────────────────────────── */

/* Pulsing orange dot on the FAB */
.ida-qp-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  background: #E9530D;
  border-radius: 50%;
  border: 2px solid #000;
  animation: ida-qp-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}
@keyframes ida-qp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233,83,13,.5); }
  50%       { box-shadow: 0 0 0 7px rgba(233,83,13,0); }
}

/* Floating tooltip near FAB */
.ida-qp-tip {
  position: absolute;
  bottom: 72px;
  right: 0;
  background: #000;
  border: 1px solid #E9530D;
  color: #E9530D;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 12px;
  white-space: nowrap;
  cursor: pointer;
  animation: ida-qp-slide-in .25s ease;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%);
  z-index: 201;
  transition: opacity .35s ease, transform .35s ease;
}
.ida-qp-tip:hover { background: #0a0a0a; }
.ida-qp-tip-hide  { opacity: 0; transform: translateY(6px); }

@keyframes ida-qp-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Proactive bot bubble — slightly highlighted vs normal bot bubbles */
.ida-bubble-proactive {
  border-left: 2px solid #E9530D;
  background: #0a0a0a;
}

/* ── Stall & Escalate message bubble ──────────────────────
   Server-generated message when buyer hits the negotiation
   limit. Visually distinct: red-left border, dark tint.
──────────────────────────────────────────────────────── */
.ida-bubble-stall {
  border-left: 3px solid #ef4444;
  background: #0a0505;
}
.ida-bubble-stall strong { color: #E9530D; }

/* ── Bundle Offer Card ───────────────────────────────────
   Shown when AI emits <bundle_offer> — stands firm on
   primary price, offers accessories at discount.
──────────────────────────────────────────────────────── */
.ida-bundle-card {
  margin: 10px 0 4px;
  background: #050505;
  border: 1px solid #1a1a1a;
  border-top: 2px solid #f59e0b;
  overflow: hidden;
}
.ida-bundle-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  gap: 8px;
  flex-wrap: wrap;
}
.ida-bundle-head-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f59e0b;
}
.ida-bundle-head-save {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #22c55e;
}
.ida-bundle-body { padding: 10px 14px 14px; }
.ida-bundle-primary {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 5px 0 8px;
  border-bottom: 1px solid #111;
  margin-bottom: 8px;
}
.ida-bundle-primary-label { color: #666; font-style: italic; }
.ida-bundle-primary-note  { color: #444; }
.ida-bundle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #0d0d0d;
  gap: 8px;
  font-size: 12px;
}
.ida-bundle-row:last-of-type { border-bottom: none; margin-bottom: 4px; }
.ida-bundle-acc-name { color: #ccc; flex: 1; }
.ida-bundle-prices   { display: flex; align-items: baseline; gap: 4px; flex-shrink: 0; }
.ida-bundle-list     { color: #444; font-size: 11px; text-decoration: line-through; }
.ida-bundle-disc     { color: #22c55e; font-weight: 700; }
.ida-bundle-pct      { color: #22c55e; font-size: 10px; }
.ida-bundle-divider  { height: 1px; background: #1a1a1a; margin: 10px 0; }
.ida-bundle-submit {
  width: 100%;
  background: #f59e0b;
  color: #000;
  border: none;
  padding: 10px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%);
  transition: filter .15s;
  margin-top: 4px;
}
.ida-bundle-submit:hover:not(:disabled) { filter: brightness(1.1); }
.ida-bundle-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Behaviour: admin-configured overrides ────────────────
   Applied by JS based on Widget → Behaviour settings.
──────────────────────────────────────────────────────── */

/* Force fullscreen panel on all viewport sizes */
.ida-force-fullscreen #ida-panel {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}

/* ── Desktop panel force-close ────────────────────────────────────────
   Applied by closeChat() on desktop. Beats animation fill-mode and any
   display:flex rule via higher specificity + !important.
──────────────────────────────────────────────────────────────────────── */
#ida-panel.ida-force-closed {
  display:     none !important;
  animation:   none !important;
  visibility:  hidden !important;
  pointer-events: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE PREMIUM BOTTOM SHEET  (≤ 767px)
   Desktop: completely unchanged.
   Mobile:  FAB → centred pill · panel → bottom sheet · swipe-to-dismiss
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Wrap: covers full viewport so backdrop can fill it ── */
  #ida-wrap {
    bottom:  0 !important;
    right:   0 !important;
    left:    0 !important;
    width:   auto;
    pointer-events: none;          /* doesn't block page when closed */
  }

  /* ── Backdrop ── */
  .ida-backdrop {
    position: fixed; inset: 0; z-index: -1;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0; pointer-events: none;
    transition: opacity .35s ease;
  }
  .ida-wrap-open .ida-backdrop  { opacity: 1; pointer-events: auto; }

  /* ── FAB → centred pill with label ── */
  #ida-fab {
    position: fixed !important;
    bottom: max(24px, env(safe-area-inset-bottom, 24px)) !important;
    left: 50% !important; right: auto !important;
    transform: translateX(-50%) !important;
    width: auto !important; height: 54px !important;
    padding: 0 22px;
    border-radius: 100px !important;
    clip-path: none !important;
    flex-direction: row; gap: 10px;
    box-shadow: 0 6px 32px rgba(233,83,13,.45), 0 2px 8px rgba(0,0,0,.7);
    transition: transform .28s ease, opacity .28s ease, box-shadow .2s;
    white-space: nowrap;
    pointer-events: auto;
  }
  #ida-fab:active {
    transform: translateX(-50%) scale(.96) !important;
    box-shadow: 0 3px 16px rgba(233,83,13,.35);
  }
  .ida-wrap-open #ida-fab {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(16px) !important;
    pointer-events: none !important;
  }

  /* FAB label text added by JS */
  .ida-fab-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase;
    color: #000; line-height: 1;
  }

  /* ── Dismiss button: floats top-right when sheet open ── */
  #ida-dismiss {
    position: fixed !important;
    top:   max(16px, env(safe-area-inset-top, 16px)) !important;
    right: 16px !important;
    left:  auto !important;
    bottom: auto !important;
    z-index: 10002;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    clip-path: none;
    opacity: 0; pointer-events: none;
    transition: opacity .28s ease, background .15s;
  }
  #ida-dismiss:active { background: rgba(255,255,255,.18); }
  .ida-wrap-open #ida-dismiss { opacity: 1; pointer-events: auto; }

  /* ── Bottom sheet panel ── */
  #ida-panel {
    display: flex !important; /* always in layout on mobile — transform controls visibility */
    position: fixed !important;
    top: auto !important;  bottom: 0 !important;
    left: 0 !important;    right: 0 !important;
    width: 100% !important;
    height: calc(100dvh - 40px) !important;
    border-radius: 20px 20px 0 0 !important;
    clip-path: none !important;
    animation: none !important;
    transform: translateY(102%);
    transition: transform .42s cubic-bezier(.34,1.25,.64,1);
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    pointer-events: none;
  }
  #ida-panel.ida-panel-open {
    transform: translateY(0) !important;
    animation: none !important;
    pointer-events: auto;
  }

  /* ── Sheet handle bar ── */
  .ida-sheet-handle {
    width: 36px; height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.12);
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* ── Smooth momentum scrolling in messages ── */
  #ida-messages { -webkit-overflow-scrolling: touch; }

  /* ── Input row: above iPhone home indicator ── */
  #ida-input-row {
    padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
  }

  /* ── Remove desktop tap-highlight artefacts ── */
  #ida-fab, .ida-qp-btn, .ida-send-btn,
  button, [role="button"] {
    -webkit-tap-highlight-color: transparent;
  }

  /* ── Tooltip: hide on mobile ── */
  #ida-tooltip { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   CONVERSATION RESUME PROMPT
   Non-intrusive card that appears near the FAB when the visitor
   returns after an extended absence.
═══════════════════════════════════════════════════════════════ */

#ida-resume-card {
  position: fixed;
  bottom: calc(24px + 60px + 12px);  /* above desktop FAB */
  right: 24px;
  width: 300px;
  background: #0D0D0D;
  border: 1px solid #E9530D;
  border-radius: 4px;
  padding: 14px 16px;
  z-index: 9998;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  font-family: inherit;
  animation: ida-resume-slide-in .35s cubic-bezier(.34,1.25,.64,1);
}
@keyframes ida-resume-slide-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

#ida-resume-close {
  position: absolute;
  top: 8px; right: 8px;
  background: transparent; border: none;
  color: #555; font-size: 12px; cursor: pointer; padding: 4px;
  line-height: 1;
}
#ida-resume-close:hover { color: #ccc; }

.ida-resume-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.ida-resume-dot {
  width: 8px; height: 8px;
  border-radius: 50%; background: #E9530D; flex-shrink: 0;
}
.ida-resume-header strong {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  color: #fff;
}
.ida-resume-time {
  font-size: 11px; color: #666; margin-bottom: 6px; padding-left: 16px;
}
.ida-resume-preview {
  font-size: 12px; color: #888;
  font-style: italic;
  margin-bottom: 12px; padding-left: 16px;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ida-resume-btns {
  display: flex; gap: 8px;
}
#ida-resume-yes {
  flex: 1;
  background: #E9530D; color: #000;
  border: none; border-radius: 2px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 8px 12px; cursor: pointer;
  transition: background .15s;
}
#ida-resume-yes:hover { background: #ff6b1a; }
#ida-resume-no {
  background: transparent; color: #555;
  border: 1px solid #2a2a2a; border-radius: 2px;
  font-size: 11px; padding: 8px 10px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
#ida-resume-no:hover { color: #ccc; border-color: #444; }

/* Mobile: full-width card above the FAB pill */
@media (max-width: 767px) {
  #ida-resume-card {
    bottom: max(90px, env(safe-area-inset-bottom, 90px) + 70px);
    left: 16px; right: 16px; width: auto;
  }
}

/* ── Widget: ATC card product name — Chakra Petch ── */
.ida-inline-atc-name {
  font-family: 'Chakra Petch', sans-serif !important;
  font-weight: 600;
  text-transform: none;
  letter-spacing: .02em;
}

/* ── Equipment Profile Chip ─────────────────────────────────────────
   Shows above the input when the AI already has the visitor's machine
   profile loaded. Reduces friction by confirming no re-explanation needed.
─────────────────────────────────────────────────────────────────── */
.ida-eq-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(22,163,74,.1);
  border-top: 1px solid rgba(22,163,74,.25);
  font-size: 11px;
  flex-wrap: wrap;
  animation: ida-chip-in .25s ease;
}
@keyframes ida-chip-in {
  from { opacity:0; transform:translateY(4px); }
  to   { opacity:1; transform:translateY(0); }
}
.ida-eq-chip-icon { color: #16a34a; font-size: 12px; flex-shrink:0; }
.ida-eq-chip-machine { color: #fff; font-weight: 700; font-family: 'Orbitron',sans-serif; font-size: 10px; letter-spacing:.04em; }
.ida-eq-chip-attrs { display:flex; gap:4px; }
.ida-eq-chip-attrs span {
  background: rgba(22,163,74,.15);
  border: 1px solid rgba(22,163,74,.3);
  color: #86efac;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
}
.ida-eq-chip-note { color: #555; font-size: 10px; flex:1; min-width:100%; margin-top:2px; }

/* ═══════════════════════════════════════════════════════════════════
   READABILITY — AI advisor widget text, sized for all ages.
   Chat is the primary interaction surface — text must be effortless.
═══════════════════════════════════════════════════════════════════ */

/* Chat bubbles — the most-read text in the entire widget */
.ida-bubble {
  font-size: 15px !important;
  line-height: 1.65 !important;
}

/* Input field — comfortable typing size */
#ida-input {
  font-size: 15px !important;
  line-height: 1.5 !important;
}

/* Quick-start prompt buttons */
.ida-qp {
  font-size: 13px !important;
  line-height: 1.45 !important;
  padding: 9px 14px !important;
}

/* Welcome body copy */
.ida-welcome-body,
.ida-personal-greeting {
  font-size: 14px !important;
  line-height: 1.6 !important;
}

/* Personalised greeting */
.ida-personal-greeting {
  font-size: 14px !important;
}

/* Product reorder chips */
.ida-chip-name {
  font-size: 13px !important;
  line-height: 1.4 !important;
}
.ida-chip-price,
.ida-chip-qty {
  font-size: 12px !important;
}

/* Add-to-cart card inside chat */
.ida-inline-atc-name {
  font-size: 13px !important;
  line-height: 1.4 !important;
}
.ida-inline-atc-btn,
.ida-cart-btn {
  font-size: 13px !important;
}

/* Escalate / contact card */
.ida-escalate-heading {
  font-size: 14px !important;
}
.ida-escalate-body {
  font-size: 13px !important;
  line-height: 1.55 !important;
}

/* Zero-point (segment) buttons */
.ida-zp-btn {
  font-size: 13.5px !important;
  padding: 9px 16px !important;
}

/* Equipment chip — secondary but should be readable */
.ida-eq-chip {
  font-size: 12px !important;
}
.ida-eq-chip-machine {
  font-size: 11px !important;
}
.ida-eq-chip-note {
  font-size: 11px !important;
  line-height: 1.5 !important;
}
