/* Rag LinkedIn CSS — responsive, Cloudflare Pages friendly */
:root{
  --bg:#0f172a;
  --panel:#1e293b;
  --surface:#334155;
  --text:#f1f5f9;
  --muted:#94a3b8;
  --accent:#38bdf8;
  --accent-hover:#7dd3fc;
  --danger:#f87171;
  --border:#475569;
  --radius:12px;
}

*, *::before, *::after{ box-sizing:border-box; }
html, body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height:1.5;
  height:100%;
}
a{ color:var(--accent); text-decoration:underline; text-decoration-color:rgba(56,189,248,0.4); text-underline-offset:2px; }
a:hover{ color:var(--accent-hover); }

.shell{ max-width:1100px; margin:0 auto; padding:0 1rem; }
header.shell{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1.25rem 1rem;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  background:rgba(15,23,42,0.8);
  backdrop-filter:blur(6px);
  z-index:10;
}
.brand{ display:flex; flex-direction:column; gap:2px; }
.brand .mark{
  font-weight:800; font-size:1.25rem; letter-spacing:-0.5px; background:linear-gradient(90deg,#38bdf8,#818cf8);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.brand .name{ font-weight:700; font-size:1.1rem; }
.brand .tag{ font-size:0.78rem; color:var(--muted); }

.controls{ display:flex; gap:0.5rem; flex-shrink:0; }
.btn{
  border:1px solid var(--border); background:var(--surface); color:var(--text);
  padding:0.55rem 0.9rem; border-radius:8px; font-size:0.9rem; cursor:pointer; display:flex; align-items:center; gap:0.45rem;
}
.btn:hover{ border-color:var(--accent); }
.btn:active{ transform:translateY(1px); }
.btn-outline{ background:transparent; }
.btn-outline:hover{ background:rgba(56,189,248,0.12); }

main.shell{ display:grid; grid-template-columns: 300px 1fr; gap:1.5rem; padding:2rem 1rem 3rem; min-height:60vh; }
@media (max-width: 768px){
  main.shell{ grid-template-columns:1fr; padding:1rem 1rem 2rem; }
  header.shell{ flex-direction:column; align-items:flex-start; gap:0.75rem; }
  .controls{ width:100%; justify-content:space-between; }
}

.panel{ background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:1.25rem; display:flex; flex-direction:column; gap:1rem; height:fit-content; }
.panel h2{ margin:0 0 0.25rem; font-size:1rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--muted); font-weight:600; }
.muted{ color:var(--muted); font-size:0.9rem; }
.file-list{ display:flex; flex-direction:column; gap:0.5rem; min-height:4rem; }
.file-item{
  display:flex; align-items:center; justify-content:space-between; gap:0.5rem;
  background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:0.55rem 0.75rem; font-size:0.88rem;
}
.file-name{ color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; flex:1; }
.file-rows{ color:var(--muted); font-size:0.8rem; }
.file-remove{ background:transparent; border:none; color:var(--danger); font-size:1.2rem; line-height:1; cursor:pointer; padding:0 0.2rem; }
.file-remove:hover{ text-decoration:underline; }

.stats{ display:flex; gap:1rem; margin-top:0.25rem; padding-top:0.75rem; border-top:1px solid var(--border); font-size:0.82rem; color:var(--muted); }
.stat strong{ color:var(--accent); display:block; font-size:1.1rem; }

.chat{ display:flex; flex-direction:column; gap:1rem; min-width:0; }
.messages{
  display:flex; flex-direction:column; gap:0.75rem;
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:1rem; overflow-y:auto; max-height:64vh;
}
.msg{ display:flex; gap:0.75rem; }
.msg .bubble{
  padding:0.75rem 1rem; border-radius:10px; max-width:80%; font-size:0.95rem; white-space:pre-wrap;
}
.msg-bot .bubble{ background:var(--surface); border:1px solid var(--border); color:var(--text); }
.msg-you .bubble{ background:var(--accent); color:#000; text-align:right; margin-left:auto; }

.composer{
  display:flex; gap:0.5rem; align-items:flex-end; margin-top:0.25rem;
}
.composer input{
  flex:1; background:var(--surface); border:1px solid var(--border); color:var(--text);
  padding:0.7rem 0.9rem; border-radius:8px; font-size:0.95rem; min-width:0;
}
.composer input:focus{ outline:none; border-color:var(--accent); }
.composer button{
  background:var(--accent); color:#000; border:none; border-radius:8px; padding:0.7rem 1.1rem; font-weight:700; font-size:0.95rem; cursor:pointer; white-space:nowrap;
}
.composer button:hover{ background:var(--accent-hover); }
.composer button:disabled{ opacity:0.55; cursor:not-allowed; }

.hint{ margin-top:0.4rem; font-size:0.82rem; color:var(--moted, var(--muted)); min-height:1.2em; }

footer.shell{ border-top:1px solid var(--border); padding:1rem; font-size:0.8rem; }

.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:var(--surface); border-radius:4px; border:2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover{ background:#475569; }
