@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;450;500;600&display=swap');

:root {
  --bg: #F6F2EB;
  --bg-2: #F0E9DD;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #FFFFFF;
  --border: rgba(28, 25, 22, 0.08);
  --border-strong: rgba(28, 25, 22, 0.14);
  --text: #1C1916;
  --muted: #8A8379;
  --user-bg: #221C18;
  --user-text: #F7F5F0;
  --accent: #D4621A;
  --accent-2: #E8874A;
  --accent-3: #F0A35E;
  --accent-light: #FDF0E8;
  --grad-warm: linear-gradient(135deg, #D4621A 0%, #E8874A 50%, #F0A35E 100%);
  --shadow-sm: 0 1px 2px rgba(28, 25, 22, 0.06);
  --shadow-md: 0 8px 30px -8px rgba(28, 25, 22, 0.16);
  --shadow-lg: 0 24px 60px -18px rgba(28, 25, 22, 0.28);
  --shadow-glow: 0 8px 28px -6px rgba(212, 98, 26, 0.45);
  --radius: 20px;
  --radius-lg: 26px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Animated aurora background ─────────────────────────────── */
body {
  position: relative;
  background:
    radial-gradient(1200px 800px at 100% -10%, #FBEFE2 0%, transparent 55%),
    radial-gradient(1000px 700px at -10% 110%, #F2E7F0 0%, transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

body::before {
  width: 46vmax;
  height: 46vmax;
  top: -14vmax;
  right: -10vmax;
  background: radial-gradient(circle at 30% 30%, #F4A968, #D4621A 70%);
  animation: drift1 22s ease-in-out infinite alternate;
}

body::after {
  width: 40vmax;
  height: 40vmax;
  bottom: -16vmax;
  left: -12vmax;
  background: radial-gradient(circle at 70% 70%, #E9C3F0, #B98AD6 75%);
  opacity: 0.35;
  animation: drift2 26s ease-in-out infinite alternate;
}

@keyframes drift1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-6vmax, 6vmax) scale(1.15); }
}
@keyframes drift2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5vmax, -5vmax) scale(1.2); }
}

/* ── App shell ──────────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  height: 100dvh;
  padding: 16px;
  gap: 16px;
}

/* ── Sidebar (desktop) ──────────────────────────────────────── */
#sidebar {
  width: 268px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.side-top { display: flex; flex-direction: column; gap: 22px; }

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--grad-warm);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s;
}
.new-chat-btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 12px 30px -6px rgba(212, 98, 26, 0.55); }
.new-chat-btn:active { transform: translateY(0); }

.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

.acct-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b322c, #211b17);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}

.account .js-user-email {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main column ────────────────────────────────────────────── */
#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Topbar (mobile only) ───────────────────────────────────── */
#topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.topbar-actions { display: flex; gap: 8px; }

.header-brand { display: flex; align-items: center; gap: 12px; }

.rufus-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
}

.rufus-avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(212, 98, 26, 0.25);
  animation: pulseRing 3s ease-out infinite;
}

@keyframes pulseRing {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}

.header-brand-text { display: flex; flex-direction: column; gap: 1px; }

.header-brand h1 {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #2B2420 30%, #D4621A 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-brand span {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.ghost-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s, color 0.15s, background 0.15s;
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ghost-btn.danger:hover {
  border-color: #d9534f;
  color: #d9534f;
}

/* ── Messages ───────────────────────────────────────────────── */
#messages {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 8px 8px;
  scrollbar-gutter: stable both-edges;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.message-row {
  display: flex;
  gap: 11px;
  align-items: flex-end;
  animation: msgIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message-row.user { flex-direction: row-reverse; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
  margin-bottom: 2px;
}

.message {
  max-width: 76%;
  padding: 13px 17px;
  border-radius: var(--radius);
  font-size: 0.94rem;
  line-height: 1.65;
}

.message-row.rufus .message {
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-md);
}

.message-row.user .message {
  background: linear-gradient(160deg, #2E2620, #1A1512);
  color: var(--user-text);
  border-bottom-right-radius: 6px;
  box-shadow: 0 10px 26px -10px rgba(28, 25, 22, 0.5);
}

.message p { margin-bottom: 9px; }
.message p:last-child { margin-bottom: 0; }
.message ul, .message ol { padding-left: 20px; margin-bottom: 9px; }
.message li { margin-bottom: 5px; }
.message h1, .message h2, .message h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  margin: 4px 0 8px;
  line-height: 1.3;
}
.message h1 { font-size: 1.25em; }
.message h2 { font-size: 1.15em; }
.message h3 { font-size: 1.05em; }
.message code {
  background: var(--accent-light);
  color: #B14E12;
  padding: 1.5px 6px;
  border-radius: 6px;
  font-size: 0.85em;
  font-family: 'SF Mono', ui-monospace, monospace;
}
.message pre {
  background: #1B1714;
  color: #F2EDE6;
  padding: 14px 16px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 0.85em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.message pre code { background: none; padding: 0; color: inherit; }
.message strong { font-weight: 600; }
.message a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 98, 26, 0.3);
  transition: border-color 0.15s;
}
.message a:hover { border-color: var(--accent); }
.message-row.user .message a { color: var(--accent-3); border-bottom-color: rgba(240, 163, 94, 0.4); }
.message blockquote {
  border-left: 3px solid var(--accent-2);
  padding: 2px 0 2px 14px;
  margin: 12px 0;
  color: #6b4a36;
  font-style: italic;
}

/* ── Rich response formatting (Rufus only) ─────────────────── */

/* Section headings */
.message-row.rufus .message h1,
.message-row.rufus .message h2,
.message-row.rufus .message h3 {
  letter-spacing: -0.01em;
  margin-top: 16px;
}
.message-row.rufus .message > div > :first-child { margin-top: 0; }
.message-row.rufus .message h2 {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.message-row.rufus .message h3 { color: #B14E12; }

/* Divider — gradient line with a centered accent node */
.message hr {
  border: none;
  height: 1px;
  margin: 20px 0;
  background: linear-gradient(90deg, transparent, var(--border-strong) 18%, var(--border-strong) 82%, transparent);
  position: relative;
  overflow: visible;
}
.message hr::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 0 4px var(--surface-solid), 0 0 10px rgba(212, 98, 26, 0.4);
}

/* Diamond bullet lists */
.message-row.rufus .message ul {
  list-style: none;
  padding-left: 2px;
  margin: 10px 0;
}
.message-row.rufus .message ul > li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
}
.message-row.rufus .message ul > li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--grad-warm);
  transform: rotate(45deg);
  box-shadow: 0 1px 4px rgba(212, 98, 26, 0.4);
}

/* Numbered steps rendered as a connected "pathway" */
.message-row.rufus .message ol {
  list-style: none;
  padding-left: 2px;
  margin: 12px 0;
  counter-reset: step;
}
.message-row.rufus .message ol > li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 16px;
  counter-increment: step;
}
.message-row.rufus .message ol > li:last-child { margin-bottom: 4px; }
.message-row.rufus .message ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-warm);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  z-index: 1;
}
.message-row.rufus .message ol > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 28px;
  bottom: -16px;
  width: 2px;
  background: linear-gradient(var(--accent-3), rgba(212, 98, 26, 0.12));
}
/* keep nested lists tidy */
.message-row.rufus .message li > ul,
.message-row.rufus .message li > ol { margin: 8px 0 4px; }

/* Tables */
.message table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.88em;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}
.message th, .message td {
  padding: 9px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.message th {
  background: var(--accent-light);
  color: #B14E12;
  font-weight: 600;
}
.message tbody tr:last-child td { border-bottom: none; }
.message tbody tr:nth-child(even) { background: rgba(28, 25, 22, 0.025); }

/* ── Typing indicator ──────────────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 2px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-warm);
  animation: bounce 1.3s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0) scale(0.85); opacity: 0.45; }
  30% { transform: translateY(-7px) scale(1); opacity: 1; }
}

/* ── Tool / search loader ──────────────────────────────────── */
.tool-loader {
  display: flex;
  align-items: center;
  gap: 11px;
}

.tool-orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(from 90deg, var(--accent), var(--accent-3), var(--accent) 85%, transparent);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: spin 0.85s linear infinite;
}

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

.tool-status-text {
  font-size: 0.9rem;
  font-weight: 500;
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 35%, var(--accent) 50%, var(--muted) 65%, var(--muted) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 1.9s linear infinite;
}

@keyframes shimmer {
  from { background-position: 120% center; }
  to   { background-position: -120% center; }
}

/* ── Search badge + sources ────────────────────────────────── */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-light);
  color: #B14E12;
  border: 1px solid rgba(212, 98, 26, 0.18);
  border-radius: 999px;
  padding: 4px 12px 4px 9px;
  font-size: 0.73rem;
  font-weight: 500;
  margin-bottom: 11px;
}

.tool-badge svg { width: 13px; height: 13px; flex-shrink: 0; }

.tool-badge .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

.tool-badge .tool-count { color: var(--accent); opacity: 0.85; }

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 210px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 6px 11px;
  font-size: 0.74rem;
  font-weight: 450;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s, color 0.16s;
}

.source-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.source-chip img {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-2);
}

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

/* ── Welcome hero ──────────────────────────────────────────── */
#welcome {
  margin: auto;
  text-align: center;
  max-width: 560px;
  padding: 24px 16px;
  animation: msgIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--grad-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Fraunces', serif;
  font-size: 34px;
  font-weight: 600;
  margin: 0 auto 22px;
  box-shadow: var(--shadow-glow), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

#welcome h2 {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(120deg, #2B2420 20%, #D4621A 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#welcome > p {
  color: var(--muted);
  font-size: 0.98rem;
  margin-bottom: 26px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s, color 0.18s;
  box-shadow: var(--shadow-sm);
}

.chip:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

/* ── Input ─────────────────────────────────────────────────── */
#input-area {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 8px 18px;
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 11px 11px 11px 18px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(212, 98, 26, 0.12);
}

#input {
  flex: 1;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  resize: none;
  outline: none;
  max-height: 160px;
  line-height: 1.5;
  min-height: 24px;
  padding: 0;
  text-align: left;
}

#input::placeholder { color: var(--muted); }

#send {
  width: 40px;
  height: 40px;
  background: var(--grad-warm);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s, opacity 0.16s;
}

#send:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.06);
  box-shadow: 0 12px 30px -6px rgba(212, 98, 26, 0.55);
}
#send:active:not(:disabled) { transform: translateY(0) scale(0.96); }
#send:disabled {
  background: var(--border-strong);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.input-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 11px;
  letter-spacing: 0.01em;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
#messages::-webkit-scrollbar { width: 6px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb {
  background: rgba(28, 25, 22, 0.14);
  border-radius: 6px;
}
#messages::-webkit-scrollbar-thumb:hover { background: rgba(28, 25, 22, 0.24); }

/* ── Auth overlay ──────────────────────────────────────────── */
#auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

#auth-box {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 44px 36px 36px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: authIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes authIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#auth-box .rufus-avatar {
  width: 56px !important;
  height: 56px !important;
  font-size: 26px !important;
  margin: 0 auto 18px !important;
}

#auth-box h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 5px;
  background: linear-gradient(120deg, #2B2420 20%, #D4621A 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#auth-box p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 26px;
}

/* ── Responsive ────────────────────────────────────────────── */

/* Collapse to single column: hide sidebar, show topbar */
@media (max-width: 900px) {
  #app { padding: 10px 12px 0; gap: 10px; flex-direction: column; }
  #sidebar { display: none; }
  #topbar { display: flex; }
  .topbar-actions .ghost-btn { width: auto; padding: 7px 12px; font-size: 0.78rem; }
}

@media (max-width: 640px) {
  #app { padding: 8px 10px 0; }
  .message { max-width: 88%; }
  #topbar { padding: 9px 12px; }
  .header-brand h1 { font-size: 1.2rem; }
  #welcome h2 { font-size: 1.6rem; }
  .welcome-avatar { width: 64px; height: 64px; font-size: 28px; }
  .message-row.rufus .message ol > li { padding-left: 36px; }
}

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