﻿:root, [data-bs-theme] { --bs-primary: var(--accent-primary); --bs-primary-rgb: var(--accent-primary-rgb); --bs-link-color: var(--accent-primary); --bs-link-color-rgb: var(--accent-primary-rgb); --bs-body-bg: var(--bg-base); --bs-body-color: var(--text-primary); --bs-secondary-color: var(--text-muted); --bs-border-color: var(--border-default); --bs-body-font-family: var(--font-sans); --bs-font-monospace: var(--font-mono); }
body { line-height: 1.6; } a { text-underline-offset: .2em; } .app-navbar { background: var(--bg-surface); border-bottom: 1px solid var(--border-default); padding: .9rem 0; }
.navbar-brand { letter-spacing: -.04em; font-size: 1.35rem; color: var(--text-primary); } .brand-dot { color: var(--accent-primary); } .brand-mark { display:inline-grid; place-items:center; width:2.25rem; height:2.25rem; border-radius:.7rem; background:var(--accent-primary); color:#fff; font-size:1rem; margin-right:.35rem; }
.card { --bs-card-bg: var(--bg-surface); --bs-card-border-color: var(--border-default); box-shadow: var(--shadow); } .btn { font-weight: 600; border-radius: .7rem; } .btn-primary { --bs-btn-bg:#245be8; --bs-btn-border-color:#245be8; --bs-btn-hover-bg:#1749c5; --bs-btn-hover-border-color:#1749c5; --bs-btn-color:#fff; } .btn-sm { min-height: 38px; }
.form-control,.form-select { padding:.7rem .85rem; border-radius:.65rem; } .form-label { font-weight:600; } .form-text,.text-muted { color:var(--text-muted)!important; } :focus-visible { outline:3px solid var(--accent-primary); outline-offset:3px; }
.skip-link { position:absolute; top:-5rem; left:1rem; z-index:1000; background:var(--bg-surface); padding:.5rem; } .skip-link:focus { top:1rem; }
.hero { position:relative; overflow:hidden; background:var(--hero-bg); color:var(--hero-text); border-radius:1.75rem; padding:clamp(2rem,6vw,5rem); } .hero:after { content:""; position:absolute; width:28rem; height:28rem; border:1px solid rgba(139,186,255,.18); border-radius:50%; right:-10rem; top:-12rem; box-shadow:0 0 0 4rem rgba(119,168,255,.04),0 0 0 8rem rgba(119,168,255,.035); pointer-events:none; }
.hero h1 { font-size:clamp(2.7rem,6vw,5.3rem); line-height:1.05; letter-spacing:-.065em; max-width:12ch; font-weight:700; } .hero p { color:#c9d9f4; max-width:36rem; font-size:1.1rem; } .hero .eyebrow { color:#a7c7ff; } .hero-content { position:relative; z-index:1; } .eyebrow { text-transform:uppercase; letter-spacing:.13em; font-size:.75rem; font-weight:700; color:var(--accent-primary); } .section-title { font-size:clamp(1.9rem,3vw,3rem); letter-spacing:-.045em; font-weight:700; } .feature-card { height:100%; padding:1.6rem; border:1px solid var(--border-default); border-radius:1.2rem; background:var(--bg-surface); } .feature-icon { display:grid; place-items:center; height:3rem; width:3rem; border-radius:.85rem; color:var(--accent-primary); background:var(--soft-blue); font-size:1.25rem; margin-bottom:1.4rem; } .feature-card h3 { font-size:1.1rem; font-weight:700; } .feature-card p { color:var(--text-muted); margin-bottom:0; }
.auth-layout { max-width:1050px; margin:auto; } .auth-intro { border-radius:1.5rem; padding:clamp(2rem,4vw,3.5rem); background:var(--hero-bg); color:#fff; height:100%; } .auth-intro h1 { font-size:clamp(2.2rem,4vw,3.8rem); letter-spacing:-.05em; line-height:1.1; } .auth-intro p { color:#c9d9f4; } .auth-card { padding:clamp(1.5rem,4vw,3rem); border:1px solid var(--border-default); border-radius:1.5rem; background:var(--bg-surface); box-shadow:var(--shadow); }
.chat-bubble { max-width:min(100%, 48rem); } .chat-answer { white-space:pre-wrap; } .list-group-item.active { color:#fff; background:#245be8; border-color:#245be8; } .chat-bubble.bg-primary { background-color:#245be8!important; } .table { --bs-table-bg:transparent; } .tool-actions { flex-wrap:wrap; }
@media (max-width: 575px) { .nav-actions .btn-sm { font-size:.75rem; } .navbar-brand { font-size:1.1rem; } .hero { border-radius:1.1rem; } .hero h1 { font-size:2.65rem; } .auth-intro { display:none; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition-duration:.01ms!important; animation-duration:.01ms!important; } }

/* Study workspace */
.chat-workspace { display:grid; grid-template-columns:minmax(180px, 220px) minmax(0, 1fr) minmax(220px, 260px); gap:1rem; align-items:start; }
.chat-sidebar, .study-sidebar, .chat-main { background:var(--bg-surface); border:1px solid var(--border-default); border-radius:1.15rem; }
.chat-sidebar, .study-sidebar { padding:1.15rem; }
.chat-sidebar .list-group-item { border-radius:.7rem; margin-bottom:.4rem; }
.chat-main { min-height:calc(100vh - 12rem); display:flex; flex-direction:column; overflow:hidden; }
.chat-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:1.25rem 1.5rem; border-bottom:1px solid var(--border-default); }
.chat-conversation { flex:1; padding:1.5rem; min-height:18rem; }
.pending-question { display:flex; justify-content:flex-end; margin-bottom:1rem; }
.chat-welcome { text-align:center; max-width:28rem; margin:clamp(3rem, 10vh, 7rem) auto; }
.chat-welcome h2 { font-size:1.6rem; font-weight:700; letter-spacing:-.04em; }
.chat-welcome-icon { display:grid; place-items:center; width:3.5rem; height:3.5rem; margin:0 auto 1rem; border-radius:1rem; color:var(--accent-primary); background:var(--soft-blue); font-size:1.5rem; }
#chat-form { margin:0 1.5rem 1.5rem; padding:1rem; border:1px solid var(--border-default); border-radius:1rem; background:var(--bg-base); }
#chat-form textarea { resize:vertical; background:var(--bg-surface); }
.chat-options summary { cursor:pointer; color:var(--accent-primary); font-weight:600; }
.study-source { border:1px solid var(--border-default); border-radius:.8rem; padding:.85rem; margin-bottom:.75rem; overflow-wrap:anywhere; }
.study-source-title { font-weight:600; color:var(--text-primary); text-decoration:none; }
.study-source-actions, .document-study-links { display:flex; flex-wrap:wrap; gap:.45rem .8rem; margin-top:.6rem; font-size:.82rem; }
.study-source-actions a, .document-study-links a { font-weight:600; }
.study-library-link { display:inline-block; margin-top:.5rem; font-weight:600; }
@media (max-width: 991px) { .chat-workspace { grid-template-columns:minmax(0, 1fr) minmax(200px, 250px); } .chat-sidebar { grid-column:1 / -1; } .chat-main { min-height:38rem; } }
@media (max-width: 700px) { .chat-workspace { display:flex; flex-direction:column; } .chat-sidebar, .chat-main, .study-sidebar { width:100%; } .chat-main { min-height:32rem; } .chat-heading { padding:1rem; } .chat-conversation { padding:1rem; } #chat-form { margin:0 1rem 1rem; } }

/* Workspace refinements */
.chat-workspace { gap:1.25rem; }
.chat-sidebar, .study-sidebar { padding:1.3rem; min-width:0; }
.chat-main { box-shadow:var(--shadow); }
.chat-heading h1 { overflow-wrap:anywhere; letter-spacing:-.035em; }
.chat-workspace .btn, .library-workspace .btn { display:inline-flex; align-items:center; justify-content:center; gap:.45rem; text-align:center; min-height:44px; }
.chat-history summary { display:flex; align-items:center; gap:.5rem; padding:.65rem .15rem; cursor:pointer; font-size:.875rem; font-weight:700; list-style:none; }
.chat-history summary::-webkit-details-marker { display:none; }
.chat-history summary::before { content:'›'; color:var(--text-muted); font-size:1.2rem; line-height:1; transition:transform .15s ease; }
.chat-history[open] summary::before { transform:rotate(90deg); }
.chat-history-count { margin-left:auto; color:var(--text-muted); font-size:.75rem; }
.chat-history-list, .study-source-list { overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--border-default) transparent; }
.chat-history-list { max-height:18rem; padding: .2rem .2rem .2rem 0; }
.chat-history-list .list-group-item { min-width:0; padding:.55rem .65rem; font-size:.875rem; }
.chat-history-list .btn { min-height:36px; min-width:36px; }
.study-source-list { max-height:min(48vh, 30rem); margin:.5rem -.35rem .5rem 0; padding:.15rem .35rem .15rem 0; }
.study-source { background:var(--bg-base); padding:1rem; }
.study-source-title { display:flex; align-items:flex-start; gap:.55rem; line-height:1.4; }
.study-source-title i { color:var(--accent-primary); flex:none; }
.study-source-actions { gap:.4rem; }
.study-source-actions a { padding:.35rem .5rem; border-radius:.5rem; background:var(--soft-blue); text-decoration:none; }
.study-source-actions a:hover { text-decoration:underline; }
.chat-conversation { overflow-wrap:anywhere; }
#chat-form { padding:1.15rem; }
#chat-form textarea { min-height:5rem; }
.chat-options summary { padding:.35rem 0; }
.library-intro { padding:clamp(1.25rem, 3vw, 2rem); border:1px solid var(--border-default); border-radius:1.15rem; background:var(--bg-surface); }
.library-intro p { max-width:48rem; }
.library-table th, .library-table td { padding:1rem; vertical-align:middle; }
.library-table th { font-size:.75rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; }
.library-table td:first-child { min-width:15rem; overflow-wrap:anywhere; }
.document-study-links { gap:.5rem; }
.document-study-links a { padding:.25rem .45rem; border-radius:.4rem; background:var(--soft-blue); text-decoration:none; }
@media (max-width:700px) { .chat-sidebar, .study-sidebar { padding:1rem; } .study-source-list { max-height:18rem; } .chat-heading { align-items:flex-start; } .chat-heading .btn { flex:none; } .library-table th, .library-table td { padding:.8rem; } }
@media (max-width:575px) { .app-navbar .container { display:flex; flex-direction:column; align-items:stretch; gap:.65rem; } .nav-actions { justify-content:flex-start!important; width:100%; } .nav-actions .btn-sm { font-size:.8rem; } .chat-heading { flex-wrap:wrap; } .chat-workspace, .chat-main, .chat-sidebar, .study-sidebar { min-width:0; } }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color:var(--accent-primary); --bs-btn-border-color:var(--accent-primary); }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color:var(--text-muted); --bs-btn-border-color:var(--text-muted); }
@media (max-width:700px) {
  .library-table { overflow:visible; }
  .library-table table, .library-table tbody, .library-table tr, .library-table td { display:block; width:100%; }
  .library-table thead { display:none; }
  .library-table tr { padding:1rem; border-bottom:1px solid var(--border-default); }
  .library-table tr:last-child { border-bottom:0; }
  .library-table td, .library-table td:first-child { display:flex; align-items:center; justify-content:space-between; gap:1rem; min-width:0; padding:.35rem 0; border:0; text-align:right!important; }
  .library-table td::before { content:attr(data-label); color:var(--text-muted); font-size:.8rem; font-weight:600; text-align:left; }
  .library-table td:first-child { display:block; text-align:left!important; padding-bottom:.75rem; }
  .library-table td:first-child::before { display:none; }
}

.generation-status {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--border-default);
  border-radius: .75rem;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.generation-status .spinner-border {
  color: var(--accent-primary);
  flex-shrink: 0;
}
