/* AIRR Agent: floating recommender panel.
 *
 * Light only, deliberately. The theme has no dark mode, so a prefers-color-scheme
 * block here would put a dark panel on a light page for anyone whose OS is set to
 * dark, which is the exact bug that shipped once already on the PDP.
 */

.airr-agent,
.airr-agent-launch{
  --ag-ground:#f4f6f8; --ag-card:#fff; --ag-card2:#eef1f5;
  --ag-ink:#12161e; --ag-ink2:#3a434f; --ag-muted:#657084;
  --ag-rule:#dde3ea; --ag-accent:#2b4acb; --ag-accent-soft:#e8ecfb;
  --ag-radius:12px;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  box-sizing:border-box;
}
.airr-agent *,.airr-agent *::before,.airr-agent *::after{box-sizing:border-box}

/* WordPress core class, used on the input label. Not defined anywhere else in
   this theme, so the label would otherwise render as loose text in the panel. */
.screen-reader-text{
  position:absolute!important;width:1px;height:1px;overflow:hidden;
  clip:rect(1px,1px,1px,1px);clip-path:inset(50%);white-space:nowrap;
}

/* ------------------------------------------------------------- launcher -- */

.airr-agent-launch{
  position:fixed;right:18px;bottom:18px;z-index:9998;
  display:inline-flex;align-items:center;gap:8px;
  padding:11px 16px;border:0;border-radius:999px;cursor:pointer;
  background:var(--ag-accent);color:#fff;
  font-size:.92rem;font-weight:600;line-height:1;
  box-shadow:0 6px 20px rgba(18,22,30,.22);
}
.airr-agent-launch:hover{background:#233ea8}
.airr-agent-launch:focus-visible{outline:3px solid var(--ag-accent-soft);outline-offset:2px}
.airr-agent-mark{font-size:.9em;opacity:.9}
.airr-agent-launch-label{white-space:nowrap}

/* Inline placement: the block version sits in the flow, not pinned to a corner. */
.airr-agent-inline{margin:20px 0}
.airr-agent-launch--inline{position:static;box-shadow:none;padding:12px 18px}

/* When the panel is open the floating launcher would sit on top of it. */
.airr-agent-open .airr-agent-launch:not(.airr-agent-launch--inline){display:none}

/* ---------------------------------------------------------------- panel -- */

.airr-agent{
  position:fixed;right:18px;bottom:18px;z-index:9999;
  display:flex;flex-direction:column;
  width:min(400px,calc(100vw - 36px));max-height:min(640px,calc(100vh - 36px));
  background:var(--ag-card);color:var(--ag-ink);
  border:1px solid var(--ag-rule);border-radius:var(--ag-radius);
  box-shadow:0 18px 48px rgba(18,22,30,.26);
  overflow:hidden;
}
.airr-agent[hidden]{display:none}

.airr-agent-head{
  display:flex;align-items:center;gap:10px;
  padding:12px 14px;background:var(--ag-accent);color:#fff;flex:0 0 auto;
}
.airr-agent-title{display:flex;flex-direction:column;line-height:1.25;flex:1 1 auto;min-width:0}
.airr-agent-title strong{font-size:.98rem;font-weight:700}
.airr-agent-title span{font-size:.76rem;opacity:.85}
.airr-agent-close{
  flex:0 0 auto;width:28px;height:28px;border:0;border-radius:6px;cursor:pointer;
  background:rgba(255,255,255,.16);color:#fff;font-size:1.15rem;line-height:1;
}
.airr-agent-close:hover{background:rgba(255,255,255,.28)}

.airr-agent-log{
  flex:1 1 auto;overflow-y:auto;padding:14px;background:var(--ag-ground);
  display:flex;flex-direction:column;gap:12px;
}

/* -------------------------------------------------------------- messages -- */

.airr-agent-msg{max-width:100%}
.airr-agent-msg p{margin:0;font-size:.9rem;line-height:1.5}

.airr-agent-msg--you{align-self:flex-end;max-width:85%}
.airr-agent-msg--you p{
  background:var(--ag-accent);color:#fff;
  padding:8px 12px;border-radius:14px 14px 3px 14px;
}
.airr-agent-msg--bot p{color:var(--ag-ink2)}
.airr-agent-intro{font-weight:600;color:var(--ag-ink)!important;margin-bottom:10px!important}
.airr-agent-thinking p{color:var(--ag-muted);font-style:italic}

.airr-agent-why{
  margin-top:9px!important;padding-top:8px;border-top:1px dashed var(--ag-rule);
  font-size:.76rem!important;color:var(--ag-muted)!important;line-height:1.45!important;
}

/* ----------------------------------------------------------------- cards -- */

.airr-agent-cards{display:flex;flex-direction:column;gap:7px;margin-top:2px}

.airr-agent-card{
  display:flex;align-items:flex-start;gap:10px;
  padding:9px 10px;background:var(--ag-card);
  border:1px solid var(--ag-rule);border-radius:9px;
  text-decoration:none;color:var(--ag-ink);
}
.airr-agent-card:hover{border-color:var(--ag-accent);background:var(--ag-accent-soft)}

.airr-agent-logo{
  flex:0 0 auto;width:34px;height:34px;border-radius:7px;object-fit:contain;
  background:var(--ag-card2);padding:3px;
}
.airr-agent-initials{
  flex:0 0 auto;display:grid;place-items:center;width:34px;height:34px;border-radius:7px;
  background:var(--ag-card2);color:var(--ag-muted);font-size:.72rem;font-weight:700;
}

.airr-agent-cardbody{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 auto}
.airr-agent-name{font-size:.9rem;font-weight:650;line-height:1.3}
.airr-agent-desc{
  font-size:.78rem;color:var(--ag-muted);line-height:1.4;
  overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
}
.airr-agent-meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:3px;
  font-size:.76rem;color:var(--ag-muted);
}
.airr-agent-meta b{color:var(--ag-ink);font-weight:700}
.airr-agent-meta em{font-style:normal;color:var(--ag-ink2)}
.airr-agent-score .airr-stars{font-size:.78rem}
.airr-agent-cat{
  padding:1px 7px;border-radius:999px;background:var(--ag-card2);color:var(--ag-muted);
  font-size:.7rem;
}

.airr-agent-more{
  display:inline-block;margin-top:9px;font-size:.8rem;font-weight:600;
  color:var(--ag-accent);text-decoration:none;
}
.airr-agent-more:hover{text-decoration:underline}

/* ------------------------------------------------------- chips and input -- */

.airr-agent-chips{
  flex:0 0 auto;display:flex;flex-wrap:wrap;gap:6px;
  padding:10px 14px 0;background:var(--ag-ground);
}
.airr-agent-chip{
  padding:5px 11px;border:1px solid var(--ag-rule);border-radius:999px;cursor:pointer;
  background:var(--ag-card);color:var(--ag-ink2);font-size:.78rem;line-height:1.3;
}
.airr-agent-chip:hover{border-color:var(--ag-accent);color:var(--ag-accent);background:var(--ag-accent-soft)}

.airr-agent-form{
  flex:0 0 auto;display:flex;gap:7px;padding:10px 14px;background:var(--ag-ground);
}
.airr-agent-input{
  flex:1 1 auto;min-width:0;padding:9px 12px;
  border:1px solid var(--ag-rule);border-radius:8px;background:var(--ag-card);
  color:var(--ag-ink);font-size:.88rem;font-family:inherit;
}
.airr-agent-input:focus{outline:none;border-color:var(--ag-accent);box-shadow:0 0 0 3px var(--ag-accent-soft)}
.airr-agent-send{
  flex:0 0 auto;width:38px;border:0;border-radius:8px;cursor:pointer;
  background:var(--ag-accent);color:#fff;font-size:1.05rem;line-height:1;
}
.airr-agent-send:hover{background:#233ea8}

.airr-agent-foot{
  flex:0 0 auto;margin:0;padding:0 14px 12px;background:var(--ag-ground);
  font-size:.7rem;color:var(--ag-muted);line-height:1.4;
}

/* ------------------------------------------------------------------ small -- */

@media (max-width:520px){
  .airr-agent{
    right:0;bottom:0;left:0;width:100%;max-height:82vh;
    border-radius:var(--ag-radius) var(--ag-radius) 0 0;border-bottom:0;
  }
  .airr-agent-launch{right:12px;bottom:12px;padding:10px 14px;font-size:.86rem}
}

@media (prefers-reduced-motion:reduce){
  .airr-agent,.airr-agent-launch{transition:none}
}
