@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/libre-franklin-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/libre-franklin-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/libre-franklin-latin-800-normal.woff2") format("woff2"); }

:root {
  --accent: #121212;
  --accent-soft: #f0f0f0;
  --ink: #121212;
  --muted: #5a5a5a;
  --line: #dfdfdf;
  --paper: #ffffff;
  --canvas: #ffffff;
  --soft: #f4f4f4;
  --danger: #b3101e;
  --red: #b3101e;
  --radius: 0;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --shadow: 0 2px 10px rgba(0, 0, 0, .16);
  font-size: 15px;
}

*, *::before, *::after { border-radius: 0 !important; box-shadow: none !important; }
.app-dialog, .toast, .drop-card { box-shadow: var(--shadow) !important; }
.spinner, .user-avatar { border-radius: 50% !important; }

body { background: var(--surface, #fff); color: var(--ink); font-family: var(--sans); }
.chat-shell { grid-template-columns: 272px minmax(0, 1fr); }

.sidebar { gap: 14px; border-right: 1px solid var(--ink); padding: 20px 18px 14px; background: var(--surface, #fff); }
.sidebar-brand { display: block; border-bottom: 1px solid var(--ink); box-shadow: 0 3px 0 -2px #fff, 0 4px 0 -2px var(--ink) !important; padding: 0 0 12px; margin-bottom: 4px; color: var(--ink); font-family: var(--serif); font-size: 1.45rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.05; }
.sidebar-brand .brand-mark { display: none; }
.desk-link { display: inline-block; color: var(--ink); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.desk-link::before { content: "\2190\00a0"; }
.desk-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.new-chat { justify-content: center; border: 1px solid var(--ink); background: var(--ink); padding: 9px 12px; color: #fff; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.new-chat:hover { background: #333; border-color: #333; }
.history { gap: 16px; }
.history-group h2 { border-bottom: 1px solid var(--ink); padding: 0 0 5px; margin: 0 0 2px; color: var(--ink); font-family: var(--sans); font-size: .64rem; font-weight: 800; letter-spacing: .14em; }
.history-item { border-bottom: 1px solid var(--line); }
.history-item:hover, .history-item.active { background: transparent; }
.history-item.active .history-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.history-open { padding: 8px 2px; }
.history-title { color: var(--ink); font-family: var(--serif); font-size: .92rem; font-weight: 600; line-height: 1.3; }
.history-meta { color: var(--muted); font-size: .68rem; }
.history-actions button { border: 1px solid var(--ink); background: var(--surface, #fff); color: var(--ink); font-weight: 700; }
.sidebar-footer { border-top: 1px solid var(--ink); }
.user-avatar { border: 1px solid var(--ink); background: var(--surface, #fff); color: var(--ink); font-weight: 800; }
.user-email { color: var(--ink); font-weight: 600; }

.thread-header { border-bottom: 1px solid var(--ink); padding: 18px 40px 12px; text-align: left; }
.thread-header h1 { color: var(--ink); font-family: var(--sans); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.thread { gap: 26px; padding: 34px 40px 40px; }
.thread > *, .composer > * { width: min(760px, 100%); }

.empty-state { justify-content: flex-start; gap: 18px; padding-top: 4vh; }
.empty-kicker, .example-label { margin: 0 0 8px; color: var(--red); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.example-label { margin: 14px 0 0; color: var(--ink); }
.empty-brief h2 { margin: 0 0 10px; font-family: var(--serif); font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.06; }
.empty-brief p { max-width: 60ch; margin: 0; color: var(--ink); font-family: var(--serif); font-size: 1.12rem; line-height: 1.55; }
.empty-drop { display: grid; gap: 3px; border: 1px solid var(--ink); background: var(--surface, #fff); padding: 16px 18px; text-align: left; }
.empty-drop strong { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.empty-drop span { color: var(--muted); font-size: .86rem; }
.empty-drop:hover, .empty-drop:focus-visible { background: var(--ink); color: #fff; }
.empty-drop:hover span, .empty-drop:focus-visible span { color: #ddd; }
.example-prompts { grid-template-columns: 1fr; gap: 0; border-top: 2px solid var(--ink); }
.example-prompt { border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 0; color: var(--ink); font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.example-prompt:hover { background: transparent; text-decoration: underline; text-underline-offset: 4px; }

.message { animation: none; gap: 8px; }
.message-user { align-items: stretch; margin-top: 10px; border-top: 2px solid var(--ink); padding-top: 14px; }
.message-user::before, .message-assistant:not(.provider-unavailable)::before { font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.message-user::before { content: "Question"; color: var(--red); }
.message-assistant:not(.provider-unavailable)::before { content: "Answer"; color: var(--ink); }
.message-user .bubble { max-width: none; border: 0; background: transparent; padding: 0; color: var(--ink); font-family: var(--serif); font-size: 1.85rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }
.message-assistant .bubble { border: 0; background: transparent; padding: 0; color: var(--ink); font-family: var(--serif); font-size: 1.14rem; line-height: 1.65; }
.message-assistant .bubble :is(h1, h2, h3, h4) { font-family: var(--serif); font-weight: 700; }
.cite { border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 0 1px; color: var(--ink); font-family: var(--sans); font-size: .72em; font-weight: 800; vertical-align: .18em; }
.cite:hover { background: var(--ink); color: #fff; }

.composer { background: var(--surface, #fff); border-top: 1px solid var(--ink); padding: 14px 40px 14px; }
.composer-box { border: 1px solid var(--ink); background: var(--surface, #fff); }
.composer-box:focus-within, .composer.drag-over .composer-box { border-color: var(--ink); outline: 1px solid var(--ink); }
.composer textarea { font-family: var(--serif); font-size: 1.05rem; }
.send-button { background: var(--ink); color: #fff; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.attach-button, .attach-label { color: var(--ink); font-weight: 700; }
.composer-hint { color: var(--muted); font-size: .68rem; }

.provider-banner { border: 0; border-left: 4px solid var(--red); background: var(--surface, #fff); color: var(--ink); }
.login-card { border: 0; border-top: 2px solid var(--ink); background: var(--surface, #fff); }
.login-card h1 { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; }
.primary-button { background: var(--ink); color: #fff; font-weight: 800; }
.drawer { border-left: 2px solid var(--ink); }
.drawer-header h2 { font-family: var(--serif); font-weight: 700; }

:root { --blue: #0b4f8a; --blue-deep: #08396a; --blue-tint: #eaf1f8; --accent: #0b4f8a; }
.desk-link, .empty-kicker, .message-assistant:not(.provider-unavailable)::before { color: var(--blue); }
.message-user::before { color: var(--red); }
.new-chat, .send-button, .primary-button { border-color: var(--blue); background: var(--blue); }
.new-chat:hover, .send-button:hover { border-color: var(--blue-deep); background: var(--blue-deep); }
.sidebar-brand::after { content: "Chat"; display: block; margin-top: 6px; color: var(--blue); font-family: var(--sans); font-size: .64rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.history-item.active { box-shadow: inset 3px 0 0 var(--blue) !important; padding-left: 8px; }
.history-item.active .history-title { color: var(--blue); text-decoration: none; }
.message-user { border-top-color: var(--blue); }
.cite { border-bottom-color: var(--blue); color: var(--blue); }
.cite:hover { background: var(--blue); }
.composer-box:focus-within, .composer.drag-over .composer-box { border-color: var(--blue); outline-color: var(--blue); }
.example-prompt:hover, .empty-drop:hover strong { color: var(--blue); }
.empty-drop:hover, .empty-drop:focus-visible { border-color: var(--blue); background: var(--blue-tint); color: var(--ink); }
.empty-drop:hover span, .empty-drop:focus-visible span { color: var(--muted); }
.example-prompts { border-top-color: var(--blue); }
::selection { background: var(--blue-tint); }

.composer-box { border-radius: 14px !important; overflow: hidden; }
.composer-box .send-button { border-radius: 8px !important; }
.chat-box { display: grid; gap: 2px; margin: 0; border-left: 4px solid var(--blue); background: var(--blue-tint); padding: 6px 10px 7px; color: var(--ink); font-family: var(--serif); font-size: .98rem; font-weight: 700; line-height: 1.2; }
.chat-box span { color: var(--blue); font-family: var(--sans); font-size: .6rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
