/* Premier Academy Assistants: shared styles (brand: Knowledge #000b8c / #2b2c86, Growth #00adbb, Evolution #f4b223, Support #414042) */
@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;600&family=Maven+Pro:wght@400;500;600;700&display=swap');

:root {
  --navy: #2b2c86;
  --navy-deep: #000b8c;
  --teal: #00adbb;
  --gold: #f4b223;
  --ink: #414042;
  --bg: #f5f6fb;
  --line: #dfe2f0;
  --muted: #6b6f86;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Maven Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
body.embed { padding: 0; background: transparent; }

.app {
  width: 100%; max-width: 860px; height: calc(100vh - 32px); max-height: 940px;
  background: #fff; border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 50px rgba(0, 0, 0, .35);
}
body.embed .app { max-width: none; height: 100vh; max-height: none; border-radius: 0; box-shadow: none; }

/* header */
.hdr { background: var(--navy); color: #fff; padding: 12px 18px; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.hdr .logo { width: 54px; height: 54px; border-radius: 50%; background: #fff; padding: 3px; flex-shrink: 0; }
.hdr .logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.hdr .txt { flex: 1; min-width: 0; }
.hdr .org { font-family: 'Teko', sans-serif; font-size: 15px; letter-spacing: 2px; color: var(--gold); line-height: 1; text-transform: uppercase; }
.hdr .title { font-family: 'Teko', sans-serif; font-size: 30px; line-height: .95; letter-spacing: .5px; }
.hdr .sub { font-size: 12px; color: #bfe9ee; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr .actions { display: flex; gap: 8px; align-items: center; }
.hbtn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 12px; font: 500 12px 'Maven Pro', sans-serif; cursor: pointer; white-space: nowrap; }
.hbtn:hover { background: rgba(255,255,255,.22); }
.hbtn[hidden] { display: none; }
body.embed .hdr { padding: 10px 14px; }
body.embed .hdr .logo { width: 42px; height: 42px; }
body.embed .hdr .title { font-size: 24px; }
.bar { height: 4px; background: linear-gradient(90deg, var(--gold), var(--teal) 55%, var(--navy)); flex-shrink: 0; }

/* messages */
#messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.msg { display: flex; gap: 10px; max-width: 92%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: #fff; border: 1.5px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.av img { width: 100%; height: 100%; object-fit: contain; }
.msg.user .av { background: var(--navy); color: var(--gold); font-size: 10px; font-weight: 700; border: none; }
.bubble { padding: 11px 15px; border-radius: var(--radius); font-size: 14.5px; line-height: 1.6; min-width: 0; overflow-wrap: anywhere; }
.msg.assistant .bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px var(--radius) var(--radius) var(--radius); box-shadow: 0 1px 4px rgba(43,44,134,.06); }
.msg.user .bubble { background: var(--navy); color: #fff; border-radius: var(--radius) 4px var(--radius) var(--radius); white-space: pre-wrap; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { font-family: 'Maven Pro', sans-serif; color: var(--navy); margin: 12px 0 6px; font-size: 15px; }
.bubble h1, .bubble h2 { font-size: 16px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; }
.bubble li { margin-bottom: 3px; }
.bubble strong { color: var(--navy-deep); }
.msg.user .bubble strong { color: var(--gold); }
.bubble a { color: #00838e; }
.bubble table { border-collapse: collapse; margin: 8px 0; font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.bubble th { background: #eef0fa; color: var(--navy); }
.bubble code { background: #f0f1f7; padding: 1px 4px; border-radius: 4px; }
.bubble blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--teal); color: var(--muted); }
.file-chip { display: inline-block; font-size: 12px; background: rgba(255,255,255,.15); border-radius: 8px; padding: 3px 8px; margin: 0 4px 6px 0; }
.sources { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; }
.sources b { color: var(--navy); }
.sources a { display: block; color: #00838e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: 6px; margin-top: 6px; }
.tool { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; font: 500 11px 'Maven Pro', sans-serif; padding: 3px 8px; cursor: pointer; }
.tool:hover { color: var(--navy); border-color: var(--navy); }
.note { font-size: 12px; color: var(--muted); }
.err { color: #b3261e; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font: 500 12.5px 'Maven Pro', sans-serif; padding: 7px 13px; border: 1.5px solid var(--teal); border-radius: 999px; cursor: pointer; color: var(--navy); background: #fff; }
.chip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.typing { display: flex; gap: 5px; padding: 4px 2px; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: b 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes b { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* input */
.composer { border-top: 1px solid var(--line); background: #fff; padding: 12px 14px; flex-shrink: 0; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.attachments:empty { display: none; }
.att { font-size: 12px; background: #eef0fa; color: var(--navy); border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; gap: 6px; }
.att button { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.row { display: flex; gap: 10px; align-items: flex-end; }
#input { flex: 1; border: 1.5px solid #c9cde4; border-radius: 12px; padding: 10px 14px; font: 14.5px 'Maven Pro', sans-serif; resize: none; min-height: 44px; max-height: 160px; line-height: 1.5; color: var(--ink); outline: none; }
#input:focus { border-color: var(--navy); }
.ibtn { width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#send { background: var(--navy); } #send:hover { background: var(--teal); } #send:disabled { opacity: .35; cursor: not-allowed; }
#send svg { width: 18px; height: 18px; fill: #fff; }
#attach { background: #eef0fa; } #attach:hover { background: #dfe3f6; } #attach svg { width: 20px; height: 20px; fill: var(--navy); }
.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 6px 10px 8px; background: #fff; }

/* login */
.login { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.login form { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: 0 2px 12px rgba(43,44,134,.07); }
.login h2 { font-family: 'Teko', sans-serif; font-weight: 500; font-size: 30px; color: var(--navy); margin: 0 0 4px; }
.login p { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.login label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
.login input { width: 100%; border: 1.5px solid #c9cde4; border-radius: 10px; padding: 10px 12px; font: 14px 'Maven Pro', sans-serif; outline: none; }
.login input:focus { border-color: var(--navy); }
.login button { width: 100%; margin-top: 18px; background: var(--navy); color: #fff; border: none; border-radius: 10px; padding: 11px; font: 600 14px 'Maven Pro', sans-serif; cursor: pointer; }
.login button:hover { background: var(--teal); }
.login .msgline { min-height: 18px; font-size: 13px; margin-top: 10px; }

@media (max-width: 600px) {
  body { padding: 0; }
  .app { height: 100vh; max-height: none; border-radius: 0; }
  .hdr .sub { display: none; }
  .msg { max-width: 100%; }
}
