:root {
  --accent:#faa822;
  --accent-dark:#8c5705;
  --ink:#272b28;
  --muted:#73796f;
  --bg:#f8f6f1;
  --paper:#fff;
  --border:#e6e5de;
  --sidebar:#242a27;
  --danger:#a83f32;
  --radius:14px;
  --sidebar-w:250px;
  --source-w:320px;
  color-scheme:light
}

* {
  box-sizing:border-box
}

html,body {
  margin:0;
  height:100%;
  font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  background:var(--bg);
  color:var(--ink)
}

button,input,textarea {
  font:inherit
}

button,a,input,textarea {
  -webkit-tap-highlight-color:transparent
}

button {
  cursor:pointer
}

button:disabled {
  cursor:not-allowed
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible {
  outline:2px solid var(--accent-dark);
  outline-offset:4px
}

button svg,a svg {
  pointer-events:none
}

svg {
  width:19px;
  height:19px;
  flex-shrink:0
}

a {
  color:inherit
}

h1,h2,h3,p {
  margin-top:0
}

[hidden] {
  display:none!important
}

.muted {
  color:var(--muted)
}

.eyebrow {
  font-size:10px;
  font-weight:700;
  letter-spacing:.14em;
  color:var(--muted);
  display:block
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap
}

.icon-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  width:36px;
  height:36px;
  flex-shrink:0
}

.icon-btn:hover {
  background:#eeeee8;
  color:var(--ink)
}

.icon-btn:disabled {
  opacity:.35
}

.primary-btn,.secondary-btn,.danger-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border-radius:9px;
  padding:10px 15px;
  font-size:13px;
  font-weight:600;
  min-height:40px
}

.primary-btn {
  background:var(--accent);
  border:1px solid var(--accent);
  color:var(--ink)
}

.primary-btn:hover {
  background:#f0a01a
}

.secondary-btn {
  background:var(--paper);
  border:1px solid var(--border);
  color:var(--ink)
}

.secondary-btn:hover {
  border-color:#b6b9ae;
  background:#fafaf7
}

.danger-btn {
  background:var(--danger);
  color:#fff;
  border:1px solid var(--danger)
}

.text-btn {
  background:none;
  border:0;
  color:var(--accent-dark);
  padding:2px 0;
  font-size:12px;
  font-weight:600;
  text-decoration:none;
  cursor:pointer
}

.text-btn:hover {
  text-decoration:underline
}

.brand-lockup {
  display:flex;
  align-items:center;
  gap:11px;
  text-decoration:none;
  font-size:17px;
  font-weight:650;
  letter-spacing:-.4px;
  line-height:1.2
}

.brand-icon {
  width:36px;
  height:36px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--accent);
  color:#252a26;
  font-family:Georgia,serif;
  font-size:16px;
  font-weight:700;
  letter-spacing:-1px;
  flex-shrink:0
}

.brand-caption {
  display:block;
  font:8px/1.5 -apple-system,"Segoe UI",sans-serif;
  letter-spacing:.15em;
  margin-top:4px
}

.boot-screen {
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:var(--muted)
}

/* Sign in */
.auth-screen {
  min-height:100dvh;
  display:grid;
  grid-template-columns:1.08fr 1fr
}

.auth-intro {
  background:#ecebdd;
  padding:42px 8%;
  position:relative;
  display:flex;
  flex-direction:column
}

.auth-story {
  max-width:470px;
  margin:auto 0;
  padding:46px 0
}

.auth-story h1 {
  font:normal clamp(40px,4vw,60px)/1.08 Georgia,"Times New Roman",serif;
  letter-spacing:-2px;
  margin:20px 0
}

.auth-story>p {
  color:#64705e;
  font-size:15px;
  line-height:1.8;
  max-width:350px
}

.auth-paper {
  background:#fcfcf7;
  border:1px solid #dadccd;
  border-radius:14px;
  box-shadow:0 16px 40px #3441320a;
  padding:23px 26px;
  margin:30px 0;
  max-width:360px;
  transform:rotate(-2deg)
}

.paper-label {
  font-size:9px;
  letter-spacing:.15em;
  color:var(--muted)
}

.paper-question {
  font:21px Georgia,serif;
  margin:12px 0 18px
}

.paper-rule {
  border-top:1px solid var(--border);
  margin:15px 0
}

.paper-line {
  height:5px;
  background:#e7e9df;
  border-radius:3px;
  margin-bottom:10px;
  width:96%
}

.paper-line.short {
  width:70%
}

.paper-source {
  display:inline-block;
  margin-top:13px;
  padding:5px 10px;
  border-radius:6px;
  background:#fef0d8;
  color:var(--accent-dark);
  font-size:11px
}

.auth-benefits {
  display:flex;
  flex-direction:column;
  gap:10px;
  font-size:12px;
  color:#596454
}

.auth-benefits span:before {
  content:'✓';
  display:inline-block;
  margin-right:10px;
  color:#657359
}

.auth-footnote {
  color:#78816f;
  font-size:11px;
  margin:20px 0 0
}

.auth-panel {
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px
}

.auth-card {
  width:100%;
  max-width:350px
}

.auth-card h2 {
  font:normal 35px Georgia,serif;
  letter-spacing:-1px;
  margin:13px 0 10px
}

.auth-card>.muted {
  font-size:13px;
  margin-bottom:30px
}

.auth-form {
  display:flex;
  flex-direction:column;
  gap:8px
}

.auth-form label {
  font-size:12px;
  font-weight:600;
  margin-top:12px
}

.auth-form input {
  width:100%;
  height:47px;
  padding:12px 13px;
  border:1px solid #dddfd4;
  border-radius:9px;
  background:#fff;
  color:var(--ink)
}

.auth-form small {
  font-size:11px;
  color:var(--muted)
}

.password-field {
  position:relative
}

.password-field input {
  padding-right:46px
}

.password-field .icon-btn {
  position:absolute;
  right:6px;
  top:6px
}

.auth-form .primary-btn {
  margin-top:17px;
  justify-content:space-between;
  padding:13px 16px;
  font-size:14px
}

.auth-form .primary-btn:disabled {
  opacity:.6
}

.form-error {
  color:var(--danger);
  background:#fff0eb;
  border-radius:8px;
  padding:10px 12px;
  font-size:12px;
  margin:8px 0 0
}

.auth-toggle {
  text-align:center;
  margin:24px 0 0;
  font-size:12px;
  color:var(--muted)
}

.auth-note {
  text-align:center;
  border-top:1px solid var(--border);
  margin:28px 0 0;
  padding-top:20px;
  font-size:11px;
  color:var(--muted)
}

/* Workspace */
.app {
  display:flex;
  height:100vh;
  height:100dvh;
  overflow:hidden
}

.sidebar-left {
  width:var(--sidebar-w);
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  background:var(--sidebar);
  color:#e6e9e0
}

.sidebar-header {
  height:83px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 21px
}

.sidebar-header .brand-caption {
  color:#a1aaa0
}

.new-chat-btn {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  background:var(--accent);
  color:#252a26;
  margin:0 18px;
  border:0;
  border-radius:9px;
  padding:11px;
  font-size:12px;
  font-weight:650
}

.new-chat-btn:hover {
  background:#ffb839
}

.new-chat-btn:disabled {
  opacity:.5
}

.nav-library {
  display:flex;
  align-items:center;
  gap:10px;
  border:0;
  background:none;
  color:#d2d9ce;
  margin:11px 18px;
  padding:11px 9px;
  font-size:12px;
  text-align:left;
  border-radius:8px
}

.nav-library:hover {
  background:#343c36
}

.nav-library small {
  margin-left:auto;
  border:1px solid #4a544a;
  border-radius:6px;
  min-width:22px;
  text-align:center;
  color:#bfc9b8;
  font-size:10px
}

.history-heading {
  display:flex;
  justify-content:space-between;
  padding:20px 22px 12px;
  color:#a8b29f;
  font-size:9px;
  font-weight:600;
  letter-spacing:.1em;
  border-top:1px solid #3a433a
}

.history-heading span:last-child {
  letter-spacing:0
}

.search-field {
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  border-radius:9px;
  padding:0 11px;
  background:#fff
}

.search-field>span {
  display:flex
}

.search-field svg {
  width:16px;
  height:16px
}

.search-field input {
  border:0;
  background:none;
  color:inherit;
  padding:10px 0;
  width:100%;
  min-width:0;
  font-size:12px;
  outline-offset:1px
}

.search-field:focus-within {
  border-color:#b68c3b
}

.history-search {
  margin:0 18px 12px;
  background:#2b332d;
  border-color:#3b453b;
  color:#adb7a7
}

.history-search input::placeholder {
  color:#9ca898
}

.chat-list {
  flex:1;
  overflow:auto;
  padding:0 10px 14px
}

.history-group {
  font-size:10px;
  color:#a2ada0;
  padding:10px 11px 6px
}

.chat-list-item {
  display:flex;
  align-items:center;
  gap:4px;
  border-radius:8px;
  margin:3px 0
}

.chat-list-item:hover {
  background:#333c35
}

.chat-list-item.active {
  background:#3b4738
}

.chat-select {
  display:flex;
  align-items:center;
  gap:9px;
  background:none;
  border:0;
  color:#cdd5c6;
  padding:11px;
  min-width:0;
  flex:1;
  text-align:left;
  font-size:12px
}

.chat-select svg {
  width:15px;
  height:15px;
  color:#859780
}

.chat-list-item.active .chat-select {
  color:#ffce78
}

.chat-select .title {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.delete-btn {
  width:31px;
  height:31px;
  color:#a0ad98;
  margin-right:4px;
  opacity:0
}

.chat-list-item:hover .delete-btn,.chat-list-item:focus-within .delete-btn {
  opacity:1
}

.delete-btn svg {
  width:15px;
  height:15px
}

.delete-btn:hover {
  background:#4e4537;
  color:#ffd19b
}

.sidebar-empty {
  padding:15px 12px;
  color:#a4b19d;
  font-size:12px;
  line-height:1.8
}

.sidebar-footer {
  display:flex;
  align-items:center;
  gap:10px;
  border-top:1px solid #3a433a;
  padding:17px 18px
}

.user-avatar {
  width:32px;
  height:32px;
  border-radius:50%;
  background:#45523e;
  color:#dce6d3;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  flex-shrink:0
}

.user-info {
  display:flex;
  flex-direction:column;
  flex:1;
  min-width:0;
  font-size:12px
}

.user-info>span {
  overflow:hidden;
  text-overflow:ellipsis
}

.user-info small {
  font-size:9px;
  color:#a1ad9a;
  margin-top:3px
}

.sidebar-footer .icon-btn {
  color:#b4beaa
}

.sidebar-footer .icon-btn:hover {
  background:#3b4538;
  color:#fff
}

.chat-main {
  flex:1;
  min-width:0;
  position:relative;
  display:flex;
  flex-direction:column;
  background:var(--bg)
}

.chat-header {
  height:82px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 30px;
  border-bottom:1px solid var(--border);
  background:#fbfaf7
}

.header-left {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0
}

.header-left>div {
  min-width:0
}

.chat-header .eyebrow {
  font-size:8px
}

.chat-header h1 {
  font-size:14px;
  font-weight:600;
  letter-spacing:-.2px;
  margin:5px 0 0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:40vw
}

.header-actions {
  display:flex;
  gap:7px;
  align-items:center
}

.header-actions .secondary-btn {
  font-size:11px;
  padding:8px 11px;
  min-height:35px
}

.header-actions .secondary-btn svg {
  width:15px;
  height:15px
}

.context-bar {
  min-height:39px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 30px;
  border-bottom:1px solid var(--border);
  font-size:11px;
  color:var(--muted);
  background:#f2f2e9
}

.context-bar.selected {
  background:#f3ecd9
}

.context-bar>span {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.context-bar .text-btn {
  font-size:10px;
  white-space:nowrap
}

.context-bar strong {
  color:#696747;
  font-weight:600
}

.thread {
  flex:1;
  min-height:0;
  overflow:auto;
  scroll-behavior:smooth;
  padding:25px 0 15px;
  overscroll-behavior:contain
}

.empty-state {
  max-width:730px;
  margin:10px auto 24px;
  padding:0 35px
}

.welcome-mark {
  display:flex;
  align-items:center;
  gap:9px;
  font-size:10px;
  color:#8b6b35;
  margin-bottom:18px
}

.welcome-mark svg {
  width:20px;
  height:20px
}

.empty-state h2 {
  font:normal clamp(26px,2.6vw,35px)/1.2 Georgia,serif;
  letter-spacing:-1px;
  margin:0 0 12px
}

.empty-hint {
  font-size:13px;
  color:var(--muted);
  line-height:1.8;
  max-width:465px;
  margin:0 0 24px
}

.example-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:30px
}

.example-btn {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:7px;
  position:relative;
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  padding:17px;
  text-align:left;
  color:var(--ink);
  min-height:90px;
  transition:border-color .15s,transform .15s
}

.example-btn:hover {
  border-color:#d7ab61;
  transform:translateY(-2px)
}

.example-btn>svg {
  color:#b98835;
  width:18px;
  height:18px
}

.example-btn strong {
  font-size:12px;
  font-weight:600
}

.example-btn small {
  font-size:11px;
  color:var(--muted);
  line-height:1.6
}

.example-arrow {
  position:absolute;
  right:15px;
  top:17px;
  color:#b1b5a9
}

.library-preview-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px
}

.library-preview-heading h3 {
  font-size:11px;
  font-weight:600;
  margin:0
}

.library-preview-heading span {
  color:var(--muted);
  font-size:10px
}

.case-preview-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px
}

.case-preview {
  border:1px solid var(--border);
  background:transparent;
  border-radius:9px;
  padding:11px 13px;
  text-align:left;
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  color:var(--ink)
}

.case-preview:hover {
  background:#fff;
  border-color:#d5c59e
}

.case-initial {
  background:#e9ebe1;
  color:#77816a;
  width:31px;
  height:31px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  font:12px Georgia,serif;
  flex-shrink:0
}

.case-preview>span:last-child {
  min-width:0
}

.case-preview strong {
  display:block;
  font-size:11px;
  font-weight:600;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.case-preview small {
  font-size:9px;
  color:var(--muted)
}

.empty-footer {
  display:flex;
  align-items:center;
  gap:7px;
  font-size:10px;
  color:#92968a;
  margin:21px 0 0
}

.empty-footer svg {
  width:13px;
  height:13px
}

/* Answers */
.msg-row {
  max-width:800px;
  padding:0 36px;
  margin:0 auto 28px
}

.msg-role {
  display:flex;
  align-items:center;
  gap:9px;
  font-size:11px;
  font-weight:600;
  color:#7b806f;
  margin-bottom:11px
}

.msg-role .answer-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:8px;
  background:#fbe7bd;
  color:#9a6b22
}

.answer-icon svg {
  width:15px;
  height:15px
}

.msg-row.user {
  display:flex;
  flex-direction:column;
  align-items:flex-end
}

.msg-row.user .msg-role {
  font-size:10px
}

.msg-row.user .msg-bubble {
  background:#eaece2;
  border:1px solid #e0e4d6;
  border-radius:14px 14px 4px 14px;
  padding:12px 17px;
  max-width:88%;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:14px;
  line-height:1.75
}

.msg-row.assistant .msg-bubble {
  font-size:14px;
  line-height:1.85;
  overflow-wrap:anywhere
}

.msg-bubble p {
  margin:0 0 14px
}

.msg-bubble p:last-child {
  margin-bottom:0
}

.msg-bubble ul,.msg-bubble ol {
  padding-left:23px;
  margin:8px 0 18px
}

.msg-bubble li {
  padding-left:3px;
  margin-bottom:9px
}

.msg-bubble h2,.msg-bubble h3,.msg-bubble h4 {
  font-size:16px;
  line-height:1.5;
  font-weight:650;
  margin:22px 0 10px
}

.msg-bubble h2:first-child,.msg-bubble h3:first-child {
  margin-top:0
}

.msg-bubble strong {
  font-weight:650
}

.msg-bubble code {
  font:12px ui-monospace,SFMono-Regular,monospace;
  background:#eaece4;
  padding:2px 5px;
  border-radius:4px
}

.msg-bubble pre {
  overflow:auto;
  background:#eaece4;
  border-radius:10px;
  padding:15px
}

.msg-bubble pre code {
  padding:0;
  background:none
}

.table-wrap {
  max-width:100%;
  overflow:auto;
  margin:15px 0
}

.msg-bubble table {
  border-collapse:collapse;
  font-size:12px;
  width:100%;
  background:#fff
}

.msg-bubble th,.msg-bubble td {
  border:1px solid var(--border);
  padding:9px 11px;
  text-align:left;
  min-width:110px
}

.msg-bubble th {
  background:#efefe6;
  font-weight:600
}

.msg-bubble blockquote {
  margin:16px 0;
  border-left:3px solid #d5ba84;
  padding:5px 0 5px 15px;
  color:#676e5f
}

.inline-cite {
  display:inline-flex;
  vertical-align:baseline;
  align-items:center;
  justify-content:center;
  font-size:9px;
  font-weight:700;
  line-height:1;
  min-width:20px;
  height:20px;
  margin:0 2px;
  border:1px solid #e5d1a9;
  border-radius:5px;
  background:#fbefdb;
  color:#8c621e;
  padding:0 4px
}

.inline-cite:hover {
  background:var(--accent);
  border-color:var(--accent);
  color:#252a26
}

.inline-cite.pending {
  cursor:default;
  color:#979b8f;
  background:#efefe8;
  border-color:#e1e3d8
}

.msg-meta {
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  margin-top:15px;
  font-size:10px;
  color:var(--muted)
}

.msg-meta .case-tag {
  font-size:10px;
  color:#7c836e;
  max-width:230px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.cite-toggle {
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:10px;
  font-weight:600;
  border:1px solid #dedfce;
  border-radius:7px;
  background:#f4f4eb;
  padding:6px 9px;
  color:#68744e
}

.cite-toggle svg {
  width:13px;
  height:13px
}

.cite-toggle:hover {
  background:#eaeedc;
  border-color:#b8c59d
}

.copy-answer {
  width:29px;
  height:29px
}

.copy-answer svg {
  width:14px;
  height:14px
}

.msg-row.abstained .msg-bubble {
  border-left:3px solid #bfaa7f;
  padding:10px 15px;
  background:#f2eee3;
  border-radius:0 8px 8px 0;
  color:#6f695c
}

.answer-status {
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:12px;
  padding:10px 0
}

.status-dot {
  width:7px;
  height:7px;
  background:var(--accent);
  border-radius:50%;
  animation:pulse 1.4s infinite
}

.status-time {
  font-variant-numeric:tabular-nums;
  color:#989f8e;
  font-size:10px;
  margin-left:4px
}

@keyframes pulse {
  0%,100% {
    opacity:.35
  }
  50% {
    opacity:1
  }
}

.answer-error {
  color:var(--danger);
  font-size:12px;
  margin-top:10px
}

.retry-btn {
  margin-top:8px
}

.answer-ended {
  font-size:11px;
  color:var(--muted)
}

.jump-latest {
  position:absolute;
  bottom:175px;
  left:50%;
  transform:translateX(-50%);
  padding:9px 15px;
  border:1px solid var(--border);
  border-radius:20px;
  background:#fff;
  box-shadow:0 3px 15px #262b2810;
  font-size:11px;
  z-index:5;
  color:var(--ink)
}

/* Composer */
.composer-area {
  padding:0 30px 17px;
  flex-shrink:0;
  width:100%;
  max-width:820px;
  margin:0 auto;
  background:var(--bg)
}

.ask-form {
  border:1px solid #d7d9ca;
  border-radius:14px;
  background:#fff;
  box-shadow:0 4px 16px #272b2805;
  overflow:hidden
}

.ask-form:focus-within {
  border-color:#bb9854;
  box-shadow:0 0 0 2px #d8b56812
}

#question-input {
  display:block;
  width:100%;
  min-height:58px;
  max-height:160px;
  resize:none;
  padding:17px 18px 8px;
  border:0;
  background:none;
  color:var(--ink);
  font-size:13px;
  line-height:1.7;
  outline:none
}

#question-input::placeholder {
  color:#959a8e
}

.composer-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:5px 10px 10px 18px
}

.composer-bottom>span {
  font-size:10px;
  color:#8a927e;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.composer-bottom>span strong {
  color:#71785d;
  font-weight:500
}

#ask-submit {
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:9px;
  background:var(--accent);
  color:var(--ink);
  flex-shrink:0
}

#ask-submit:disabled {
  background:#eceee5;
  color:#aab29e
}

#ask-submit.loading svg {
  animation:spin 1.4s linear infinite
}

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

.composer-note {
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:9px;
  color:#92988a;
  padding:10px 1px 0
}

.keyboard-hint {
  white-space:nowrap
}

.composer-note>span:first-child {
  max-width:410px
}

/* Sources */
.sidebar-right {
  width:var(--source-w);
  flex-shrink:0;
  background:#f0f1e7;
  border-left:1px solid #e1e3d6;
  display:flex;
  flex-direction:column
}

.sources-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:26px 20px 8px
}

.sources-heading .eyebrow {
  font-size:8px
}

.sources-heading h2 {
  font-size:16px;
  letter-spacing:-.3px;
  margin:7px 0 0
}

.sources-heading h2 span {
  font-size:10px;
  font-weight:500;
  color:#7b826e;
  margin-left:5px;
  border:1px solid #d7ddc8;
  border-radius:5px;
  padding:2px 5px
}

.sources-description {
  font-size:11px;
  line-height:1.8;
  color:#7a826d;
  padding:0 20px;
  margin:4px 0 20px
}

.citation-blocks {
  overflow:auto;
  flex:1;
  padding:0 15px 20px
}

.citation-block {
  display:block;
  width:100%;
  border:1px solid #dfe3d4;
  border-radius:11px;
  background:#fff;
  margin-bottom:10px;
  padding:15px;
  text-align:left;
  color:var(--ink)
}

.citation-block:hover {
  border-color:#b9bd9e;
  box-shadow:0 3px 10px #272b2805
}

.citation-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px
}

.cite-marker {
  width:23px;
  height:23px;
  border-radius:6px;
  background:#fbead0;
  color:#956820;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  font-weight:700
}

.citation-top>span:last-child {
  font-size:10px;
  color:#829171;
  display:flex;
  align-items:center;
  gap:5px
}

.citation-top svg {
  width:13px;
  height:13px
}

.cite-loc {
  font-size:11px;
  font-weight:600;
  line-height:1.8;
  display:block;
  text-transform:none;
  overflow-wrap:anywhere
}

.cite-page {
  color:var(--muted);
  font-size:10px;
  display:block;
  margin-top:7px
}

.cite-badges {
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  margin-top:9px
}

.badge {
  font-size:9px;
  color:#8f662e;
  background:#f8ecd5;
  border-radius:5px;
  padding:3px 6px
}

.no-image {
  font-size:10px;
  color:#919780;
  margin-top:10px
}

.citation-block:disabled {
  opacity:.8;
  cursor:default
}

/* Dialogs */
dialog {
  padding:0;
  border:1px solid var(--border);
  border-radius:17px;
  background:#fcfbf8;
  color:var(--ink);
  box-shadow:0 25px 100px #1e241e35;
  max-height:90dvh;
  max-width:calc(100vw - 32px)
}

dialog::backdrop {
  background:#20272070;
  backdrop-filter:blur(3px)
}

.dialog-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding:25px 25px 0
}

.dialog-heading h2 {
  font:normal 25px Georgia,serif;
  letter-spacing:-.5px;
  margin:9px 0 5px
}

.dialog-heading .eyebrow {
  font-size:9px
}

.dialog-heading p {
  font-size:11px;
  margin:6px 0 0
}

.case-dialog {
  width:580px;
  padding-bottom:17px
}

.case-dialog>.muted {
  font-size:12px;
  margin:10px 25px 18px
}

.case-search {
  margin:0 25px 18px
}

.case-list {
  max-height:55dvh;
  overflow:auto;
  padding:0 25px
}

.case-card {
  display:flex;
  align-items:center;
  gap:13px;
  width:100%;
  margin-bottom:9px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  text-align:left;
  padding:15px;
  color:var(--ink)
}

.case-card:hover {
  border-color:#c8ae75;
  background:#fffcf6
}

.case-card .case-initial {
  width:39px;
  height:43px
}

.case-card-info {
  min-width:0;
  flex:1
}

.case-card strong {
  display:block;
  font-size:13px;
  font-weight:600
}

.case-card .case-number {
  font-size:11px;
  color:#8a6b3a;
  display:block;
  margin:3px 0
}

.case-card .case-details {
  font-size:10px;
  color:var(--muted);
  display:block
}

.case-card>svg {
  color:#a3a992;
  width:16px;
  height:16px
}

.dialog-footnote {
  font-size:10px;
  color:var(--muted);
  margin:13px 25px 0
}

.case-no-results {
  padding:24px 0;
  color:var(--muted);
  font-size:13px;
  text-align:center
}

.scan-dialog {
  width:850px
}

.scan-dialog[open] {
  display:flex;
  flex-direction:column;
  height:88dvh
}

.scan-dialog .dialog-heading {
  flex-shrink:0;
  padding-bottom:15px
}

.scan-dialog h2 {
  font:600 15px -apple-system,"Segoe UI",sans-serif;
  line-height:1.5;
  max-width:630px;
  overflow-wrap:anywhere
}

.scan-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:9px 22px;
  background:#f1f1e8;
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  flex-shrink:0;
  font-size:11px;
  color:var(--muted)
}

.scan-toolbar>div {
  display:flex;
  align-items:center;
  gap:7px
}

.scan-toolbar .icon-btn {
  width:29px;
  height:29px
}

.scan-toolbar .text-btn {
  font-size:10px;
  margin-left:8px
}

.image-modal-body {
  overflow:auto;
  background:#e8eae2;
  flex:1;
  padding:22px;
  min-height:0
}

.image-modal-body>p {
  color:#747d65;
  text-align:center;
  padding:25px;
  font-size:12px
}

#image-modal-img {
  display:block;
  width:100%;
  height:auto;
  max-width:none;
  box-shadow:0 3px 12px #22282115
}

.confirm-dialog {
  width:410px;
  padding:28px
}

.confirm-dialog h2 {
  font-size:20px;
  letter-spacing:-.4px;
  margin:14px 0 12px
}

.confirm-dialog p {
  font-size:13px;
  color:var(--muted);
  line-height:1.8
}

.confirm-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:25px
}

.confirm-actions button {
  font-size:11px;
  padding:9px 12px
}

.toast {
  position:fixed;
  bottom:23px;
  left:50%;
  transform:translateX(-50%);
  z-index:100;
  padding:12px 20px;
  border-radius:10px;
  background:#293328;
  color:#f2f5ec;
  box-shadow:0 4px 20px #22282120;
  font-size:12px;
  max-width:calc(100vw - 30px);
  text-align:center
}

.mobile-only {
  display:none
}

@media(min-width:1700px) {
  .empty-state {
    margin-top:7vh
  }
  .thread {
    padding-top:35px
  }
}

@media(max-width:1200px) {
  :root {
    --sidebar-w:225px;
    --source-w:280px
  }
  .sidebar-header {
    padding:0 17px
  }
  .brand-lockup {
    font-size:16px
  }
  .chat-header {
    padding:0 23px
  }
  .context-bar {
    padding-left:23px;
    padding-right:23px
  }
  .empty-state,.msg-row {
    padding-left:25px;
    padding-right:25px
  }
  .keyboard-hint {
    display:none
  }
  .composer-area {
    padding-left:24px;
    padding-right:24px
  }
  .auth-intro {
    padding-left:8%;
    padding-right:8%
  }
}

@media(max-width:1050px) {
  .case-preview-grid {
    grid-template-columns:repeat(2,1fr)
  }
  .sidebar-right {
    position:fixed;
    right:0;
    top:0;
    bottom:0;
    z-index:25;
    width:330px;
    max-width:90vw;
    box-shadow:-10px 0 40px #272b2820
  }
  .empty-state {
    max-width:680px
  }
  .chat-header h1 {
    max-width:38vw
  }
}

@media(max-width:760px) {
  .inline-cite {
    height:26px;
    min-width:26px;
    margin:0 3px
  }
  .header-actions .icon-btn,.mobile-only {
    width:40px;
    height:40px
  }
  #ask-submit {
    width:40px;
    height:40px
  }
  .auth-screen {
    grid-template-columns:1fr
  }
  .auth-intro {
    padding:26px 26px 0;
    background:var(--bg)
  }
  .auth-story,.auth-footnote {
    display:none
  }
  .auth-panel {
    padding:45px 26px 50px;
    align-items:flex-start
  }
  .auth-card {
    max-width:420px
  }
  .sidebar-left {
    position:fixed;
    inset:0 auto 0 0;
    z-index:30;
    width:280px;
    max-width:90vw;
    transform:translateX(-100%);
    transition:transform .2s;
    box-shadow:10px 0 50px #20272030
  }
  .sidebar-left.open {
    transform:translateX(0)
  }
  .mobile-only {
    display:inline-flex
  }
  .sidebar-header .icon-btn {
    color:#a5b19c
  }
  .sidebar-scrim {
    position:fixed;
    inset:0;
    z-index:20;
    border:0;
    background:#20272060
  }
  .chat-header {
    height:72px;
    padding:0 17px
  }
  .chat-header h1 {
    font-size:12px;
    max-width:40vw
  }
  .chat-header .eyebrow {
    font-size:7px
  }
  .header-actions .secondary-btn {
    font-size:0;
    gap:0;
    padding:9px;
    min-height:34px
  }
  .header-actions .secondary-btn svg {
    width:17px;
    height:17px
  }
  .header-actions {
    gap:2px
  }
  .context-bar {
    padding:8px 20px;
    font-size:10px;
    min-height:39px
  }
  .empty-state {
    padding:0 22px;
    margin-top:26px
  }
  .empty-state h2 {
    font-size:31px
  }
  .empty-hint {
    font-size:12px
  }
  .example-btn {
    padding:14px;
    min-height:100px
  }
  .example-btn small {
    font-size:10px
  }
  .example-grid {
    gap:9px;
    margin-bottom:25px
  }
  .case-preview-grid {
    gap:7px
  }
  .case-preview {
    padding:10px 8px;
    gap:7px
  }
  .case-preview strong {
    font-size:10px
  }
  .case-preview small {
    font-size:8px
  }
  .case-initial {
    width:25px;
    height:27px;
    font-size:10px
  }
  .thread {
    padding-top:17px
  }
  .msg-row {
    padding:0 22px;
    margin-bottom:25px
  }
  .msg-row.user .msg-bubble {
    max-width:95%;
    font-size:13px
  }
  .msg-row.assistant .msg-bubble {
    font-size:13px;
    line-height:1.9
  }
  .composer-area {
    padding:0 15px 12px
  }
  .composer-note {
    font-size:8px;
    line-height:1.7;
    padding-top:8px
  }
  .composer-note>span:first-child {
    max-width:none
  }
  #question-input {
    font-size:16px;
    min-height:57px;
    padding:13px 15px 6px
  }
  .composer-bottom {
    padding-left:15px
  }
  .composer-bottom>span {
    font-size:9px
  }
  .jump-latest {
    bottom:160px
  }
  .dialog-heading {
    padding:22px 20px 0
  }
  .case-dialog>.muted,.case-search {
    margin-left:20px;
    margin-right:20px
  }
  .case-list {
    padding-left:20px;
    padding-right:20px
  }
  .case-card {
    padding:12px;
    gap:10px
  }
  .case-card strong {
    font-size:12px
  }
  .case-card .case-details {
    font-size:9px
  }
  .dialog-footnote {
    margin-left:20px;
    margin-right:20px
  }
  .scan-toolbar {
    padding:7px 14px
  }
  .scan-toolbar .text-btn {
    font-size:9px;
    margin-left:3px
  }
  .scan-toolbar>div {
    gap:3px
  }
  .image-modal-body {
    padding:12px
  }
  .scan-dialog .dialog-heading {
    padding:18px 18px 13px
  }
  .scan-dialog h2 {
    font-size:12px
  }
  .delete-btn {
    opacity:.8
  }
}

@media(max-width:380px) {
  .empty-state h2 {
    font-size:27px
  }
  .example-grid {
    grid-template-columns:1fr
  }
  .example-btn {
    min-height:85px
  }
  .case-preview-grid {
    grid-template-columns:1fr
  }
  .scan-toolbar>a {
    font-size:8px
  }
}

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


/* RNIT company attribution; the supplied logo keeps its original proportions. */
.rnit-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.rnit-logo {
  display: block;
  width: 84px;
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
}
.auth-brand-credit {
  margin-top: 18px;
}
.auth-note {
  margin-top: 24px;
  padding-top: 18px;
}
.sidebar-brand-credit {
  flex-shrink: 0;
  justify-content: center;
  padding: 0 18px 16px;
  gap: 12px;
  color: #a1ad9a;
  font-size: 9px;
}
.rnit-logo-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 7px;
  background: #fdfcf8;
}
.sidebar-brand-credit .rnit-logo {
  width: 68px;
}
.mobile-brand-credit {
  display: none;
}
@media (max-width: 760px) {
  .mobile-brand-credit {
    display: flex;
    margin-top: 9px;
    gap: 10px;
    font-size: 9px;
  }
  .mobile-brand-credit .rnit-logo {
    width: 60px;
  }
  .auth-brand-credit {
    margin-top: 16px;
  }
}
@media (max-width: 760px) {
  .jump-latest {
    bottom: 200px;
  }
}
