/* Trusted AI Advisor — floating widget styles (Sprint R1).
 * Self-contained, taiw- prefixed to avoid clashes with site CSS. Desktop + mobile. */

.taiw-launch{
  position:fixed; right:20px; bottom:20px; z-index:9998;
  display:inline-flex; align-items:center; gap:8px;
  background:#1f6feb; color:#fff; border:0; border-radius:999px;
  padding:13px 18px; font:600 14px/1 Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  box-shadow:0 8px 24px rgba(16,36,62,.28); cursor:pointer;
  transition:background .15s ease, transform .15s ease;
}
.taiw-launch:hover{ background:#1a5fd0; transform:translateY(-1px); }
.taiw-launch:focus-visible{ outline:3px solid rgba(31,111,235,.4); outline-offset:2px; }
.taiw-launch[hidden]{ display:none; }

.taiw-panel{
  position:fixed; right:20px; bottom:20px; z-index:9999;
  width:380px; max-width:calc(100vw - 32px);
  /* Adaptive desktop height: aim for 600px but shrink on shorter screens. */
  height:min(600px, calc(100vh - 40px));
  max-height:calc(100vh - 24px);
  display:none; flex-direction:column;
  background:#fff; color:#10243e; border:1px solid #e3e9f0; border-radius:16px;
  overflow:hidden; box-shadow:0 18px 50px rgba(16,36,62,.32);
  font:14px/1.5 Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
}
.taiw-panel.taiw-open{ display:flex; }

.taiw-head{ display:flex; align-items:center; gap:10px; padding:14px 16px; background:#10243e; color:#fff; flex:0 0 auto; }
.taiw-head b{ font-size:15px; display:block; }
.taiw-head .taiw-sub{ font-size:12px; color:#9db4d6; margin-top:2px; }
.taiw-close{ margin-left:auto; background:transparent; border:0; color:#9db4d6; font-size:22px; line-height:1; cursor:pointer; padding:0 4px; }
.taiw-close:hover{ color:#fff; }

.taiw-body{ flex:1 1 auto; min-height:0; overflow-y:auto; padding:16px; background:#f7f9fc; -webkit-overflow-scrolling:touch; }

.taiw-bubble{
  background:#eef4ff; border:1px solid #d7e3ff; border-radius:14px 14px 14px 4px;
  padding:11px 13px; margin:0 0 10px; max-width:92%; white-space:normal;
}
.taiw-you{
  background:#fff; border:1px solid #e3e9f0; border-radius:14px 14px 4px 14px;
  margin:0 0 10px auto; text-align:right; max-width:85%;
}

/* Recommendation reason — subtler than the main recommendation line */
.taiw-reason{
  font-size:12.5px; color:#5b6b7f; line-height:1.45;
  margin:8px 0 12px 4px; padding-left:8px; border-left:2px solid #d7e3ff;
}

.taiw-opts{ display:flex; flex-direction:column; gap:8px; margin:6px 0 4px; }
.taiw-opt{
  text-align:left; background:#fff; border:1px solid #cdd8e6; border-radius:10px;
  padding:10px 12px; cursor:pointer; color:#10243e;
  font:500 14px Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  transition:border-color .12s ease, background .12s ease;
}
.taiw-opt:hover{ border-color:#1f6feb; background:#f3f7ff; }
.taiw-opt:focus-visible{ outline:2px solid rgba(31,111,235,.45); outline-offset:1px; }
.taiw-opt.taiw-primary{ background:#1f6feb; color:#fff; border-color:#1f6feb; font-weight:600; }
.taiw-opt.taiw-primary:hover{ background:#1a5fd0; }

.taiw-field{ margin:8px 0; }
.taiw-field label{ display:block; font-size:12px; color:#5b6b7f; margin-bottom:4px; }
.taiw-field input{
  width:100%; box-sizing:border-box; padding:9px 11px;
  border:1px solid #cdd8e6; border-radius:9px;
  font:14px Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif; color:#10243e;
}
.taiw-field input:focus{ outline:none; border-color:#1f6feb; box-shadow:0 0 0 3px rgba(31,111,235,.15); }

.taiw-consent{ display:flex; gap:8px; align-items:flex-start; font-size:12px; color:#5b6b7f; margin:10px 0 2px; }
.taiw-consent input{ margin-top:2px; }
.taiw-consent-note{ font-size:11px; color:#8aa0b6; margin:0 0 16px 24px; }

.taiw-back{ background:transparent; border:0; color:#5b6b7f; font-size:12px; cursor:pointer; margin-top:8px; padding:2px 0; }
.taiw-back:hover{ color:#10243e; text-decoration:underline; }

.taiw-speak{
  display:block; background:transparent; border:0; color:#1f6feb; font-size:12px; font-weight:600;
  cursor:pointer; margin-top:6px; padding:2px 0;
}
.taiw-speak:hover{ text-decoration:underline; }

.taiw-foot{ flex:0 0 auto; padding:8px 12px; border-top:1px solid #e3e9f0; font-size:11px; color:#8aa0b6; background:#fff; text-align:center; }

/* Mobile: full-screen sheet (unchanged behavior) */
@media (max-width:520px){
  .taiw-panel{ right:0; bottom:0; width:100vw; max-width:100vw; height:100vh; height:100dvh; max-height:100vh; border-radius:0; border:0; }
  .taiw-launch{ right:14px; bottom:14px; }
  .taiw-opt{ padding:12px 14px; }   /* larger tap targets */
}

@media (prefers-reduced-motion:reduce){
  .taiw-launch{ transition:none; }
  .taiw-opt{ transition:none; }
}
