/* LearningAI — LLM side panel. All classes prefixed lp- to avoid collisions. */
#lp-tab {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 9998; cursor: pointer; border: none;
  writing-mode: vertical-rl; text-orientation: mixed;
  background: linear-gradient(135deg, #34d399, #0f766e);
  color: #fff; font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700; font-size: 14px; letter-spacing: 0.08em;
  padding: 18px 10px; border-radius: 12px 0 0 12px;
  box-shadow: -4px 0 18px rgba(0,0,0,0.35);
}
#lp-tab:hover { filter: brightness(1.1); }
#lp-panel {
  position: fixed; top: 0; right: 0; height: 100dvh;
  width: min(420px, 94vw); z-index: 9999;
  display: flex; flex-direction: column;
  background: #0a1622; color: #e6f3ef;
  border-left: 1px solid rgba(148,163,184,0.2);
  box-shadow: -24px 0 60px rgba(0,0,0,0.5);
  transform: translateX(105%); transition: transform 0.28s ease;
  font-family: 'Inter', system-ui, sans-serif;
}
#lp-panel.lp-open { transform: translateX(0); }
.lp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(148,163,184,0.16);
  background: rgba(15,23,42,0.9);
}
.lp-head .lp-title { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.lp-head .lp-title span { color: #34d399; }
.lp-head .lp-sub { font-size: 12px; color: #9eb8b1; margin-top: 2px; }
.lp-head .lp-btns { display: flex; gap: 8px; }
.lp-icon-btn {
  background: transparent; border: 1px solid rgba(148,163,184,0.25);
  color: #e6f3ef; border-radius: 9px; width: 32px; height: 32px;
  cursor: pointer; font-size: 15px; line-height: 1;
}
.lp-icon-btn:hover { border-color: #34d399; }
#lp-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lp-msg { max-width: 92%; padding: 10px 13px; border-radius: 13px; font-size: 14px; line-height: 1.65; }
.lp-msg.lp-user { align-self: flex-end; background: #0f766e; color: #fff; border-bottom-right-radius: 4px; }
.lp-msg.lp-ai { align-self: flex-start; background: rgba(15,23,42,0.95); border: 1px solid rgba(148,163,184,0.16); border-bottom-left-radius: 4px; }
.lp-msg.lp-ai pre {
  background: #020617; border: 1px solid rgba(148,163,184,0.2); border-radius: 8px;
  padding: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; margin: 8px 0;
}
.lp-msg.lp-ai code { font-family: ui-monospace, Menlo, monospace; }
.lp-msg.lp-ai p { margin: 0 0 8px; }
.lp-msg.lp-ai p:last-child { margin-bottom: 0; }
.lp-msg.lp-ai ul { margin: 6px 0; padding-left: 20px; }
.lp-msg.lp-ai li { margin-bottom: 4px; }
.lp-msg.lp-typing { color: #9eb8b1; font-style: italic; }
.lp-msg.lp-error { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.4); color: #fcd34d; align-self: stretch; max-width: 100%; }
#lp-settings { display: none; padding: 16px; border-bottom: 1px solid rgba(148,163,184,0.16); background: rgba(15,23,42,0.6); }
#lp-settings.lp-show { display: block; }
#lp-settings label { display: block; font-size: 12px; color: #9eb8b1; margin: 10px 0 5px; text-transform: uppercase; letter-spacing: 0.08em; }
#lp-settings input, #lp-settings select {
  width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: #020617; border: 1px solid rgba(148,163,184,0.25); color: #e6f3ef;
  font-family: inherit;
}
#lp-settings .lp-note { font-size: 12px; color: #9eb8b1; line-height: 1.6; margin-top: 10px; }
#lp-inputbar { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(148,163,184,0.16); background: rgba(15,23,42,0.9); }
#lp-input {
  flex: 1; padding: 11px 13px; border-radius: 12px; font-size: 14px; resize: none;
  background: #020617; border: 1px solid rgba(148,163,184,0.25); color: #e6f3ef;
  font-family: inherit; max-height: 110px;
}
#lp-input:focus { outline: none; border-color: #34d399; }
#lp-send {
  background: linear-gradient(135deg, #34d399, #0f766e); color: #fff; border: none;
  border-radius: 12px; padding: 0 18px; font-weight: 700; font-size: 14px; cursor: pointer;
  font-family: inherit;
}
#lp-send:disabled { opacity: 0.5; cursor: default; }
.lp-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.lp-suggest button {
  background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.3);
  color: #a7f3d0; border-radius: 999px; padding: 7px 12px; font-size: 12.5px;
  cursor: pointer; font-family: inherit;
}
.lp-suggest button:hover { background: rgba(52,211,153,0.16); }
@media (max-width: 640px) { #lp-tab { font-size: 12px; padding: 14px 8px; } }
