@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap');
:root {
  color-scheme:light;
  --paper:#fbfaf7;
  --ink:#292622;
  --muted:#77736b;
  --line:#e6e2da;
  --accent:#8c343d;
  --soft:#f2e8e5;
  --green:#4c7662;
  font-family:'DM Sans',system-ui,sans-serif;
  font-size:15px
}

* {
  box-sizing:border-box
}

body {
  margin:0;
  background:var(--paper);
  color:var(--ink)
}

button,textarea,input {
  font:inherit
}

button,a,textarea {
  outline-offset:5px
}

button {
  cursor:pointer;
  color:inherit
}

button:disabled {
  cursor:wait;
  opacity:.5
}

a {
  color:var(--accent)
}

[hidden] {
  display:none!important
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%)
}

.skip-link {
  position:fixed;
  top:-70px;
  left:20px;
  background:white;
  padding:12px;
  z-index:20
}

.skip-link:focus {
  top:10px
}

.sidebar {
  position:fixed;
  inset:0 auto 0 0;
  width:248px;
  padding:34px 26px;
  background:#f2f0ea;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column
}

.brand {
  display:flex;
  gap:12px;
  align-items:center;
  color:var(--ink);
  text-decoration:none;
  font-size:17px;
  line-height:1.25;
  letter-spacing:-.5px
}

.brand strong {
  font-weight:600
}

.brand-icon {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border:1px solid #c9b8ac;
  border-radius:50%;
  font-size:28px;
  color:var(--accent)
}

.new-chat {
  margin-top:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid #d8d0c5;
  background:transparent;
  border-radius:8px;
  padding:12px 8px;
  font-size:13px;
  font-weight:500
}

.new-chat:hover {
  background:#eae5db
}

.new-chat span {
  font-size:20px
}

.sidebar-context {
  margin-top:44px
}

.eyebrow {
  font-size:10px;
  letter-spacing:1.6px;
  font-weight:600;
  color:var(--muted)
}

.sidebar-context .eyebrow {
  font-size:8px;
  letter-spacing:1.3px
}

.sidebar-context h2 {
  font-size:14px;
  font-weight:600;
  margin-top:14px
}

.sidebar-context p,.sidebar-bottom p {
  font-size:12px;
  line-height:1.8;
  color:var(--muted)
}

.sidebar-bottom {
  margin-top:auto
}

.sidebar-bottom a {
  font-size:11px;
  text-decoration:none
}

.live-label {
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  color:var(--green)
}

.live-label span {
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--green)
}

.workspace {
  margin-left:248px;
  min-height:100dvh;
  display:flex;
  flex-direction:column
}

.topbar {
  height:76px;
  flex-shrink:0;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 38px;
  font-size:12px;
  color:var(--muted)
}

.scope-badge {
  font-size:10px;
  letter-spacing:1px;
  border:1px solid var(--line);
  border-radius:5px;
  padding:5px 9px
}

main {
  flex:1;
  width:100%;
  max-width:980px;
  margin:auto;
  padding:0 44px
}

.welcome {
  max-width:730px;
  margin:57px auto 38px;
  text-align:center
}

.welcome-symbol {
  font-size:42px;
  line-height:1;
  color:var(--accent);
  margin-bottom:23px
}

.welcome>.eyebrow {
  font-size:9px;
  letter-spacing:1.8px
}

h1 {
  font-family:'Libre Caslon Display',Georgia,serif;
  font-size:clamp(44px,4.6vw,67px);
  line-height:1.03;
  letter-spacing:-1.9px;
  font-weight:400;
  margin:19px 0 20px
}

h1 em {
  font-weight:400;
  color:var(--accent)
}

.welcome-copy {
  max-width:500px;
  margin:0 auto;
  font-size:14px;
  line-height:1.85;
  color:var(--muted)
}

.suggestions {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:37px;
  text-align:left
}

.suggestions button {
  padding:17px 16px 20px;
  background:transparent;
  border:1px solid var(--line);
  border-radius:10px;
  text-align:left;
  transition:background .15s,border-color .15s
}

.suggestions button:hover {
  background:white;
  border-color:#c9b8ac
}

.suggestions strong {
  display:block;
  font-size:12px;
  font-weight:600;
  margin:14px 0 7px
}

.suggestions button>span:last-child {
  font-size:11px;
  line-height:1.65;
  color:var(--muted);
  display:block
}

.suggestion-icon {
  font-size:21px;
  color:var(--accent)
}

.composer-area {
  position:sticky;
  bottom:0;
  width:100%;
  padding:18px 44px 13px;
  background:linear-gradient(transparent,var(--paper) 18px);
  margin-top:auto;
  z-index:3
}

.quota-notice {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid #decfae;
  border-radius: 12px;
  color: #6b4f24;
  background: #fff8eb;
  font-size: 13px;
  line-height: 1.5;
}

.quota-notice p { margin: 0; }
#quota-countdown { font-weight: 600; font-variant-numeric: tabular-nums; }

.composer {
  max-width:840px;
  margin:auto;
  border:1px solid #d8d1c7;
  border-radius:16px;
  background:#fffefc;
  box-shadow:0 5px 30px #4f413008;
  padding:17px 20px 13px
}

.composer:focus-within {
  border-color:#ae807c;
  box-shadow:0 0 0 3px #8c343d08
}

textarea {
  display:block;
  resize:none;
  border:0;
  outline:none;
  width:100%;
  min-height:54px;
  max-height:180px;
  background:transparent;
  color:var(--ink);
  line-height:1.7;
  font-size:14px;
  padding:0
}

textarea::placeholder {
  color:#969088
}

.composer-tools {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:9px
}

.composer-tools>div {
  display:flex;
  align-items:center;
  gap:8px
}

.attach-button {
  background:none;
  border:0;
  padding:6px 0;
  font-size:11px;
  color:#6d675e;
  display:flex;
  align-items:center;
  gap:5px
}

.attach-button span {
  font-size:20px
}

.optional {
  font-size:9px;
  color:#969088
}

.send-button {
  width:37px;
  height:37px;
  background:var(--accent);
  color:white;
  border:0;
  border-radius:10px;
  font-size:24px
}

.send-button:hover {
  background:#742931
}

.keyboard-hint {
  font-size:10px;
  color:#9c958c;
  margin-right:6px
}

.composer-note,.disclaimer {
  max-width:820px;
  margin:10px auto 0;
  text-align:center;
  font-size:9px;
  line-height:1.6;
  color:#8b857d
}

.disclaimer {
  margin-top:3px;
  font-size:8px
}

.attachment {
  display:inline-flex;
  align-items:center;
  gap:12px;
  background:var(--soft);
  color:var(--accent);
  font-size:11px;
  padding:5px 10px;
  border-radius:6px;
  margin-bottom:12px;
  max-width:100%
}

.attachment span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.attachment button {
  border:0;
  background:none;
  font-size:18px
}

.stop-button {
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  padding:8px 12px;
  font-size:12px
}

.upload-status {
  font-size:12px;
  text-align:center;
  color:var(--accent);
  margin:10px auto;
  max-width:800px
}

.connection-notice {
  border:1px solid #dfd3ba;
  background:#f9f3e5;
  border-radius:8px;
  padding:12px 16px;
  font-size:12px;
  line-height:1.6;
  margin:20px auto 0;
  max-width:840px
}

.conversation {
  max-width:840px;
  margin:28px auto 12px
}

.message {
  margin-bottom:32px;
  scroll-margin-top:20px
}

.message.user {
  display:flex;
  justify-content:flex-end
}

.user-bubble {
  max-width:86%;
  background:#efeae3;
  border-radius:15px 15px 3px 15px;
  padding:14px 18px;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:14px;
  line-height:1.8
}

.assistant-label {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  font-weight:600;
  letter-spacing:.2px;
  margin-bottom:15px;
  color:var(--accent)
}

.assistant-mark {
  font-size:21px
}

.answer-text {
  font-size:14px;
  line-height:1.85;
  white-space:pre-wrap;
  margin:0 0 18px;
  overflow-wrap:anywhere
}

.progress-line {
  color:var(--muted);
  font-size:13px;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:40px
}

.spinner {
  width:13px;
  height:13px;
  border:1.5px solid #dccac3;
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin 1s linear infinite
}

@keyframes spin {
  to {
    transform:rotate(360deg)
  }
}

.result-list {
  display:grid;
  gap:14px
}

.result-card {
  border:1px solid var(--line);
  border-radius:12px;
  background:#fffefc;
  padding:21px 23px
}

.result-top {
  display:flex;
  align-items:start;
  justify-content:space-between;
  gap:14px
}

.result-card h3 {
  font-size:17px;
  font-weight:600;
  margin:0;
  line-height:1.4
}

.result-card h3 a {
  text-decoration:none;
  color:var(--ink)
}

.result-card h3 a:hover {
  color:var(--accent)
}

.entity-tag {
  flex-shrink:0;
  border-radius:5px;
  padding:4px 7px;
  background:var(--soft);
  color:var(--accent);
  font-size:9px;
  letter-spacing:.5px;
  text-transform:uppercase
}

.result-title {
  font-size:11px;
  color:var(--muted);
  line-height:1.6;
  margin:7px 0 12px
}

.result-reason {
  font-size:13px;
  line-height:1.85;
  margin:12px 0 15px
}

.source-details {
  font-size:11px;
  border-top:1px solid var(--line);
  padding-top:12px
}

.source-details summary {
  cursor:pointer;
  color:var(--green);
  line-height:1.7
}

.source-details blockquote {
  margin:14px 0 8px;
  border-left:2px solid #d9c4b7;
  padding-left:13px;
  color:#686157;
  font-size:12px;
  line-height:1.8;
  overflow-wrap:anywhere
}

.source-link {
  font-size:10px;
  line-height:1.6;
  overflow-wrap:anywhere
}

.source-link a {
  text-decoration:none
}

.checked-time {
  color:var(--muted);
  margin-left:8px
}

.card-footer {
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-top:15px;
  color:var(--muted);
  font-size:10px;
  line-height:1.7
}

.card-footer a {
  text-decoration:none;
  overflow-wrap:anywhere
}

.card-footer .recruiting {
  margin-left:auto
}

.search-audit {
  margin-top:20px;
  font-size:11px;
  color:var(--muted);
  line-height:1.8
}

.search-audit summary {
  cursor:pointer
}

.search-audit p {
  margin:8px 0
}

.search-audit ul {
  padding-left:18px
}

.search-audit a {
  overflow-wrap:anywhere
}

.warning-note {
  padding:12px 15px;
  border-radius:8px;
  background:#f6f0e6;
  font-size:12px;
  line-height:1.8;
  margin-top:14px;
  color:#786344
}

.affiliation-notice {
  padding:12px 15px;
  border-radius:8px;
  background:#f6f0e6;
  border-left:3px solid #c79a4a;
  margin-top:14px;
  color:#786344
}

.affiliation-message {
  font-size:12px;
  line-height:1.8;
  margin:0 0 8px
}

.follow-up {
  margin-top:20px;
  font-size:13px;
  line-height:1.8
}

.followups {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px
}

.followups button {
  border:1px solid var(--line);
  border-radius:20px;
  background:transparent;
  padding:7px 12px;
  font-size:11px
}

.followups button:hover {
  background:#efeae3
}

.message-error {
  color:var(--accent);
  font-size:13px;
  line-height:1.8
}

.retry-button {
  display:block;
  margin-top:10px;
  border:1px solid var(--line);
  border-radius:7px;
  background:white;
  padding:7px 12px;
  font-size:12px
}

@media(min-width:1600px) {
  .welcome {
    margin-top:90px
  }
}

@media(max-width:1100px) {
  .sidebar {
    width:210px;
    padding:28px 20px
  }
  .workspace {
    margin-left:210px
  }
  main {
    padding:0 28px
  }
  .composer-area {
    padding-right:28px;
    padding-left:28px
  }
  .welcome {
    margin-top:40px
  }
  .suggestions {
    gap:8px
  }
  .suggestions button {
    padding:14px 12px
  }
}

@media(max-width:760px) {
  .sidebar {
    position:static;
    width:auto;
    flex-direction:row;
    padding:14px 19px;
    border-right:0;
    border-bottom:1px solid var(--line);
    align-items:center;
    justify-content:space-between
  }
  .brand {
    font-size:13px;
    gap:9px
  }
  .brand-icon {
    width:32px;
    height:32px;
    font-size:22px
  }
  .sidebar-context,.sidebar-bottom {
    display:none
  }
  .new-chat {
    margin:0;
    padding:7px 10px;
    font-size:11px
  }
  .new-chat span {
    font-size:17px
  }
  .workspace {
    margin-left:0;
    min-height:calc(100dvh - 70px)
  }
  .topbar {
    height:45px;
    padding:0 20px;
    font-size:10px
  }
  .scope-badge {
    font-size:8px
  }
  main {
    padding:0 20px
  }
  .welcome {
    margin:35px auto 26px
  }
  .welcome-symbol {
    font-size:32px;
    margin-bottom:20px
  }
  .welcome>.eyebrow {
    font-size:7px;
    letter-spacing:1.2px
  }
  h1 {
    font-size:48px;
    letter-spacing:-1.4px
  }
  .welcome-copy {
    font-size:12px;
    max-width:370px
  }
  .suggestions {
    margin-top:26px;
    grid-template-columns:1fr;
    text-align:left;
    gap:8px
  }
  .suggestions button {
    padding:12px 15px;
    display:grid;
    grid-template-columns:28px 1fr;
    column-gap:8px
  }
  .suggestion-icon {
    grid-row:span 2;
    align-self:center
  }
  .suggestions strong {
    margin:0 0 3px;
    font-size:11px
  }
  .suggestions button>span:last-child {
    font-size:10px
  }
  .composer-area {
    padding:12px 13px 10px
  }
  .composer {
    padding:13px 15px 10px;
    border-radius:13px
  }
  textarea {
    font-size:16px;
    min-height:52px
  }
  .keyboard-hint {
    display:none
  }
  .composer-note {
    font-size:8px;
    max-width:370px
  }
  .disclaimer {
    font-size:7px;
    max-width:370px
  }
  .result-card {
    padding:16px
  }
  .result-card h3 {
    font-size:16px
  }
  .card-footer .recruiting {
    margin-left:0;
    width:100%
  }
  .user-bubble {
    font-size:13px
  }
  .conversation {
    margin-top:22px
  }
  .connection-notice {
    font-size:11px
  }
  .answer-text {
    font-size:13px
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation:none!important;
    scroll-behavior:auto!important;
    transition:none!important
  }
}

/* Save and compare */
.save-button {
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:20px;
  background:transparent;
  padding:7px 13px;
  font-size:11px;
  color:var(--ink);
  cursor:pointer
}

.save-button:hover:not(:disabled) {
  background:#efeae3
}

.save-button[aria-pressed="true"] {
  border-color:var(--accent);
  background:var(--soft);
  color:var(--accent)
}

.save-button:disabled {
  color:var(--muted);
  cursor:not-allowed;
  opacity:.65
}

.saved-tray {
  max-width:840px;
  margin:0 auto 10px;
  padding:10px 14px;
  border:1px solid #d8d1c7;
  border-radius:14px;
  background:#fffefc;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px 16px;
  flex-wrap:wrap
}

.saved-tray[hidden] {
  display:none
}

.saved-main {
  display:flex;
  align-items:center;
  gap:8px 12px;
  flex-wrap:wrap;
  min-width:0
}

.saved-count {
  font-size:11px;
  font-weight:600;
  color:var(--accent)
}

.saved-chips {
  display:flex;
  gap:6px;
  flex-wrap:wrap
}

.saved-chip {
  display:inline-flex;
  align-items:center;
  gap:4px;
  max-width:220px;
  padding:3px 4px 3px 10px;
  border-radius:14px;
  background:var(--soft);
  font-size:11px
}

.saved-chip>span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.saved-chip button {
  border:0;
  border-radius:50%;
  width:20px;
  height:20px;
  background:transparent;
  color:var(--accent);
  font-size:14px;
  line-height:1;
  cursor:pointer
}

.saved-chip button:hover {
  background:#e8d5d0
}

.saved-actions {
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:auto
}

.saved-hint {
  font-size:10px;
  color:var(--muted)
}

.link-button {
  border:0;
  background:transparent;
  padding:4px;
  font-size:11px;
  color:var(--muted);
  text-decoration:underline;
  cursor:pointer
}

.compare-open {
  border:0;
  border-radius:8px;
  background:var(--accent);
  color:#fff;
  padding:8px 16px;
  font-size:12px;
  font-weight:600;
  cursor:pointer
}

.compare-open:disabled {
  background:#cbbfb8;
  cursor:not-allowed
}

.compare-dialog {
  width:min(1100px,94vw);
  max-height:90vh;
  padding:28px 30px 30px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--paper);
  color:var(--ink);
  overflow:auto
}

.compare-dialog::backdrop {
  background:#292622a6
}

.compare-top {
  display:flex;
  justify-content:space-between;
  align-items:start;
  gap:16px;
  margin-bottom:20px
}

.compare-top h2 {
  margin:4px 0 6px;
  font-family:'Libre Caslon Display',serif;
  font-weight:400;
  font-size:28px
}

.compare-note {
  margin:0;
  font-size:12px;
  line-height:1.7;
  color:var(--muted)
}

.compare-close {
  flex-shrink:0;
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:50%;
  background:#fffefc;
  font-size:20px;
  line-height:1;
  cursor:pointer
}

.compare-grid {
  display:grid;
  grid-template-columns:repeat(var(--cols,2),minmax(0,1fr));
  column-gap:20px
}

.compare-cell {
  min-width:0;
  font-size:12px;
  line-height:1.8;
  overflow-wrap:anywhere
}

.compare-cell p {
  margin:0 0 6px
}

.compare-cell blockquote {
  margin:10px 0 4px;
  border-left:2px solid #d9c4b7;
  padding-left:12px;
  color:#686157;
  font-size:12px
}

.compare-head {
  padding-bottom:14px
}

.compare-head h3 {
  margin:8px 0 2px;
  font-size:17px;
  font-weight:600;
  line-height:1.4
}

.compare-head h3 a {
  color:var(--ink);
  text-decoration:none
}

.compare-head h3 a:hover {
  color:var(--accent)
}

.compare-head .result-title {
  margin:0 0 8px
}

.compare-remove {
  border:1px solid var(--line);
  border-radius:7px;
  background:#fffefc;
  padding:4px 10px;
  font-size:11px;
  cursor:pointer
}

.compare-field {
  grid-column:1/-1;
  margin:16px 0 6px;
  padding-top:14px;
  border-top:1px solid var(--line);
  font-size:10px;
  font-weight:600;
  letter-spacing:.6px;
  text-transform:uppercase;
  color:var(--green)
}

.compare-owner {
  display:none;
  margin-bottom:4px;
  font-size:11px;
  font-weight:600;
  color:var(--accent)
}

.compare-empty,.compare-query {
  color:var(--muted)
}

.compare-query {
  font-size:11px
}

.compare-links {
  margin:0;
  padding-left:16px
}

@media(max-width:760px) {
  .saved-tray {
    padding:9px 12px
  }
  .saved-actions {
    width:100%;
    justify-content:space-between;
    margin-left:0
  }
  .compare-dialog {
    width:100vw;
    max-width:100vw;
    max-height:100dvh;
    height:100dvh;
    border-radius:0;
    padding:20px 16px 28px
  }
  .compare-grid {
    grid-template-columns:minmax(0,1fr)
  }
  .compare-owner {
    display:block
  }
  .compare-head {
    border-top:1px solid var(--line);
    padding-top:14px
  }
}
