/* Layout and sage palette adapted from the supplied rag-psychology frontend. */
:root {
  color-scheme: light;
  --bg: #f6f5f1; --surface: #fffefa; --sidebar: #edf1e8;
  --text: #243b32; --muted: #65776c; --border: #dfe5da;
  --accent: #376b54; --accent-hover: #295640; --on-accent: #fff;
  --soft: #e7efe1; --user: #e0ebd9; --danger: #a33e3e;
  --border-strong: #bdcdbc; --surface-hover: #f0f3eb; --accent-ghost: #376b5417; --radius-sm: 10px;
  --input-bg: #ffffffb3; --input-bg-focus: #fff; --plant-1: #bed0af; --plant-2: #7fa386; --plant-3: #d8dfb8;
  --risk: #fff5e2; --risk-text: #795a23; --shadow: 0 20px 55px #243b3214; --shadow-card: 0 10px 28px #243b320d;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; --font-display: "STKaiti", "KaiTi", "FZKai-Z03", serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121815; --surface: #1a211d; --sidebar: #161d19;
  --text: #e6ece7; --muted: #a1b2a7; --border: #303c34;
  --accent: #8fd0b0; --accent-hover: #a6ddc2; --on-accent: #0f1c16;
  --soft: #243029; --user: #263b30; --danger: #f3a4a4;
  --border-strong: #3c4a42; --surface-hover: #212a25; --accent-ghost: #8fd0b024;
  --input-bg: #ffffff0a; --input-bg-focus: #1f2823; --plant-1: #3d5245; --plant-2: #315a45; --plant-3: #4a5a3c;
  --risk: #332a17; --risk-text: #e8cf9a; --shadow: 0 20px 55px #0003; --shadow-card: 0 12px 30px #0002;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 var(--font-body); }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; background: var(--surface); color: var(--text); }
button:hover { background: var(--soft); }
button:disabled { cursor: default; opacity: .55; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover { background: var(--accent-hover); }
button.danger, .error { color: var(--danger); }
button.icon { border: 0; background: transparent; padding: 4px 8px; font-size: 20px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, textarea { min-width: 0; width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
input:focus, textarea:focus { outline: 3px solid var(--soft); border-color: var(--accent); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
textarea { resize: vertical; }
svg { width: 20px; height: 20px; display: block; }
h1, h2, h3, p { margin-top: 0; }
small, .muted { color: var(--muted); }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--accent); color: var(--on-accent); transform: translateY(-150%); transition: transform .2s ease; }
.skip-link:focus { transform: translateY(0); }
.auth-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(45px, 8vw, 130px);
  background: var(--bg);
  padding: 88px 40px 50px;
  overflow: auto;
}
.auth-page::before, .auth-page::after { content: ""; position: absolute; pointer-events: none; border-radius: 50%; filter: blur(2px); opacity: .65; }
.auth-page::before { width: 340px; height: 340px; left: -110px; top: 12%; background: radial-gradient(circle, var(--soft), transparent 70%); }
.auth-page::after { width: 420px; height: 420px; right: -160px; bottom: -170px; background: radial-gradient(circle, var(--accent-ghost), transparent 72%); }
.auth-intro {
  width: 390px;
  max-width: 100%;
}
.intro-kicker {
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.auth-intro h1 {
  font-size: clamp(32px, 4vw, 47px);
  font-weight: 550;
  line-height: 1.45;
  letter-spacing: -0.04em;
  margin: 23px 0;
  font-family: var(--font-display);
  font-weight: 600;
}
.auth-intro p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.95;
  margin: 0 0 16px;
}
.auth-intro .intro-caption { font-size: 13px; }
.intro-plant {
  width: 200px;
  height: 115px;
  position: relative;
  margin: 30px 0 5px;
}
.intro-plant span {
  position: absolute;
  bottom: 0;
  left: 70px;
  width: 64px;
  height: 90px;
  background: var(--plant-1);
  border-radius: 70px 0 70px 0;
  transform: rotate(-35deg);
  transform-origin: bottom right;
}
.intro-plant span:nth-child(2) {
  background: var(--plant-2);
  transform: rotate(32deg);
  left: 74px;
}
.intro-plant span:nth-child(3) {
  background: var(--plant-3);
  left: 7px;
  width: 48px;
  height: 62px;
  transform: rotate(-55deg);
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 430px;
  max-width: 100%;
  flex-shrink: 0;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.auth-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  margin: 0 auto 18px;
  box-shadow: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.auth-logo svg { display: block; }
.auth-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
  line-height: 1.6;
}
.auth-field { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s ease;
}
.input-wrap input {
  width: 100%;
  padding: 11px 12px 11px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  font-family: inherit;
}
.input-wrap input::placeholder { color: var(--muted); }
.input-wrap input:hover { border-color: var(--border-strong); }
.input-wrap input:focus {
  border-color: var(--accent);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 4px var(--accent-ghost);
}
.input-wrap:focus-within .input-icon { color: var(--accent); }
.input-wrap.has-toggle input { padding-right: 42px; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.password-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.password-toggle:active {
  transform: translateY(-50%) scale(0.94);
}
.auth-submit {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  margin-top: 4px;
  position: relative;
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  overflow: hidden;
}
.auth-submit:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px var(--accent-ghost);
}
.auth-submit:active:not(:disabled) { transform: translateY(0); }
.auth-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.auth-submit:disabled { opacity: 0.72; cursor: not-allowed; }
.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span { padding: 0 12px; }
.auth-switch {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--accent);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.auth-switch:hover {
  border-color: var(--accent);
  background: var(--accent-ghost);
}
.auth-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.auth-foot {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}
.auth-brand, .auth-theme { position: absolute; top: 24px; z-index: 1; color: var(--muted); font-size: 13px; }
.auth-brand { left: 40px; display: flex; align-items: center; gap: 12px; }
.auth-theme { right: 40px; }
.auth-logo svg { width: 34px; height: 34px; }
.password-toggle[aria-pressed="true"] { color: var(--accent); }
.input-wrap input::-ms-reveal, .input-wrap input::-ms-clear { display: none; }
.auth-form .error, .auth-form .notice { margin: 0 0 12px; font-size: 13px; }
dialog label:not(.toggle-row) { display: block; color: var(--muted); font-size: 12px; margin: 16px 0 6px; }
.app-shell { height: 100dvh; display: flex; flex-direction: column; }
.topbar { flex-shrink: 0; height: 76px; border-bottom: 1px solid var(--border); padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { display: block; font-size: 17px; line-height: 1.3; font-family: var(--font-display); font-weight: 600; }
.brand small { display: block; font-size: 11px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: 22px; flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-actions button { font-size: 13px; }
.home-link { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; background: var(--surface); }
.home-link:hover { background: var(--soft); }
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--sidebar); }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: #b0ac91; box-shadow: 0 0 0 3px var(--soft); }
.connection[data-status="ready"] i { background: #20c563; }
.connection[data-status="unavailable"] i { background: var(--danger); }
.mobile-toggle { display: none; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr) 260px; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 16px 16px; min-height: 0; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 18px; }
.new-chat { padding: 5px 11px; font-size: 19px; }
.session-search { position: relative; margin: 0 2px 12px; }
.session-search span { position: absolute; top: 13px; left: 11px; color: var(--muted); }
.session-search svg { width: 16px; height: 16px; }
.session-search input { font-size: 13px; padding: 10px 8px 10px 34px; }
.session-list { overflow-y: auto; flex: 1; }
.session { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; border-radius: 10px; }
.session.active { background: var(--user); }
.session-select { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 12px; }
.session-select span { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session.active .session-select span { font-weight: 600; color: var(--accent); }
.session-select small { font-size: 11px; }
.session-delete { border: 0; padding: 8px; background: transparent; color: var(--muted); margin-right: 4px; }
.empty-sessions { padding: 14px; color: var(--muted); font-size: 13px; }
.sidebar-foot { padding: 16px 8px 0; margin: 0; font-size: 11px; color: var(--muted); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: radial-gradient(ellipse at 50% -10%, var(--soft), transparent 55%); }
.chat-toolbar { flex-shrink: 0; min-height: 80px; padding: 18px 32px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--border); }
#chat-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.support-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--accent); background: var(--soft); border-radius: 20px; padding: 4px 10px; }
.support-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.toolbar-actions { display: flex; gap: 12px; margin-left: auto; flex-shrink: 0; }
.toolbar-actions button { font-size: 14px; }
.export-menu { position: relative; }
.export-menu summary { list-style: none; cursor: pointer; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 14px; white-space: nowrap; }
.export-menu summary::-webkit-details-marker { display: none; }
.export-menu summary:hover { background: var(--soft); }
.export-menu summary[aria-disabled="true"] { cursor: default; opacity: .55; }
.export-options { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; z-index: 30; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.export-options button { display: block; width: 100%; text-align: left; border: 0; white-space: nowrap; }
.chat-area { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 28px; padding: 36px 24px; background: radial-gradient(circle at 78% 0%, var(--accent-ghost), transparent 28%), radial-gradient(circle at 12% 60%, var(--soft), transparent 24%); }
.welcome { max-width: 640px; margin: 7vh auto 20px; text-align: center; }
.welcome-symbol { color: var(--accent); font-size: 40px; margin-bottom: 14px; }
.welcome h1 { font-size: clamp(25px, 3vw, 32px); margin-bottom: 10px; letter-spacing: -.02em; font-family: var(--font-display); font-weight: 600; }
.welcome p { color: var(--muted); }
.prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 32px 0 24px; }
.prompts button { text-align: left; padding: 17px; background: var(--surface); }
.welcome small { display: block; font-size: 12px; }
.message { display: flex; align-items: flex-start; gap: 14px; max-width: 1200px; margin: 0 auto 32px; content-visibility: auto; contain-intrinsic-size: 0 220px; }
.message-content { min-width: 0; flex: 1; }
.message-avatar { width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border-radius: 9px; margin-top: 30px; flex-shrink: 0; }
.message-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.message-heading span { font-weight: 600; }
.message-body { overflow-wrap: anywhere; padding: 20px 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); font-size: 16px; line-height: 1.85; box-shadow: var(--shadow-card); }
.assistant.compact .message-body { width: fit-content; max-width: min(100%, 640px); padding: 14px 18px; }
.message.user { justify-content: flex-end; }
.user .message-content { flex: 0 1 auto; max-width: 85%; }
.user .message-heading { justify-content: flex-end; }
.user .message-body { background: var(--user); border-color: var(--border-strong); white-space: pre-wrap; padding: 14px 18px; }
.message-body p { margin-bottom: 20px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body h3 { font-size: 16px; margin: 22px 0 10px; }
.message-body h3:first-child { margin-top: 0; }
.message-body ul, .message-body ol { padding-left: 24px; margin: 8px 0 12px; }
.message-body li { margin-bottom: 6px; }
.message-body pre { padding: 14px; border-radius: 10px; background: var(--soft); overflow-x: auto; white-space: pre; }
.message-body code { font-size: 13px; background: var(--soft); border-radius: 4px; padding: 2px 4px; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 12px; color: var(--muted); margin-top: 14px; }
.badge { background: var(--soft); border-radius: 6px; padding: 3px 8px; color: var(--accent); }
.copy-answer { font-size: 11px; padding: 3px 8px; background: transparent; }
.message-details { margin-top: 12px; color: var(--muted); font-size: 12px; }
.message-details summary { cursor: pointer; }
.message-details p { margin: 6px 0; }
.collaboration-summary { max-width: 680px; margin-top: 16px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--sidebar); font-size: 13px; }
.collaboration-summary > strong { display: block; margin-bottom: 12px; }
.collaboration-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); }
.collaboration-stats b { margin-left: 6px; color: var(--text); font-weight: 600; }
.collaboration-agents { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.collaboration-agents span { padding: 3px 10px; border-radius: 20px; background: var(--soft); color: var(--accent); }
.collaboration-warning { margin: 12px 0 0; color: var(--risk-text); background: var(--risk); border-radius: 8px; padding: 8px 10px; }
.timing-table { overflow-x: auto; margin: 12px 0; }
.timing-table table { width: 100%; border-collapse: collapse; text-align: left; }
.timing-table caption { text-align: left; font-weight: 600; margin-bottom: 6px; }
.timing-table th, .timing-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.timing-table td:nth-child(3), .timing-table td:nth-child(4) { white-space: nowrap; }
.message-error, .crisis-note { background: var(--risk); color: var(--risk-text); padding: 10px 13px; border-radius: 10px; margin-top: 12px; font-size: 13px; }
.answer-suggestions { background: var(--soft); border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-top: 12px; }
.answer-suggestions ul { margin: 6px 0 0; padding-left: 20px; }
.typing { color: var(--muted); }
.typing::after { content: " ···"; animation: breathe 1.5s ease-in-out infinite; }
.streaming-caret { display: inline-block; width: 3px; height: 1em; margin-left: 6px; vertical-align: -.1em; border-radius: 2px; background: var(--accent); animation: caret-blink 1s step-end infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
@keyframes breathe { 50% { opacity: .35; } }
.composer-wrap { width: 100%; max-width: 1280px; align-self: center; flex-shrink: 0; padding: 16px 24px 14px; }
.composer { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 25px #243b3208; padding: 12px 16px 12px 20px; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.composer textarea { border: 0; padding: 8px 0; background: transparent; resize: none; max-height: 160px; min-height: 52px; font-size: 16px; flex: 1; }
.composer textarea:focus { outline: none; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 12px 30px var(--accent-ghost); transform: translateY(-1px); }
.composer-bottom { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.composer-bottom small { font-size: 11px; }
.composer-bottom .primary { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 14px; }
.composer-note { font-size: 12px; text-align: center; color: var(--muted); margin: 8px 0 0; }
.composer-note span { margin-left: 0; }
.fixed-disclaimer { display: none; align-items: baseline; gap: 10px; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 11px; line-height: 1.7; }
.fixed-disclaimer strong { flex-shrink: 0; color: var(--accent); }
.fixed-disclaimer p { margin: 0; }
.chat-error { font-size: 13px; margin: 6px 0; }
.jump-latest { display: block; margin: 0 auto 8px; padding: 5px 12px; font-size: 12px; }
.support-panel { background: var(--surface); border-left: 1px solid var(--border); padding: 26px 20px; overflow-y: auto; }
.support-panel h2 { font-size: 15px; margin: 0 4px 32px; }
.support-card { border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 18px; margin-bottom: 22px; }
.support-card h3 { font-size: 14px; margin-bottom: 14px; }
.disclaimer-card p { font-size: 12px; line-height: 1.85; color: var(--muted); margin: 0; }
.support-note { font-size: 14px; line-height: 1.9; color: var(--muted); border: 1px solid var(--border); background: var(--sidebar); border-radius: 8px; padding: 14px; margin: 0; }
.support-card dl { font-size: 12px; margin: 0 0 8px; }
.support-card dl div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); padding: 10px 0; }
.support-card dt { color: var(--muted); }
.support-card dd { margin: 0; font-weight: 600; }
.support-card button { font-size: 11px; padding: 7px 10px; }
.support-footer { color: var(--muted); font-size: 11px; padding: 0 4px; line-height: 1.8; }
.support-card, .session, .prompts button, .composer, .topbar-actions button, .toolbar-actions button, .new-chat, .composer-bottom .primary, .jump-latest, .support-card button, .home-link {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.composer:focus-within { box-shadow: 0 8px 24px var(--accent-ghost); }
@media (hover: hover) and (pointer: fine) {
  .support-card:hover, .prompts button:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
  .session:hover, .session:focus-within { transform: translateY(-1px); background: var(--surface); box-shadow: 0 4px 12px var(--accent-ghost); }
  .session.active:hover, .session.active:focus-within { background: var(--user); }
  .topbar-actions button:hover:not(:disabled), .topbar-actions .home-link:hover, .toolbar-actions button:hover:not(:disabled), .new-chat:hover:not(:disabled), .composer-bottom .primary:hover:not(:disabled), .jump-latest:hover, .support-card button:hover:not(:disabled) {
    transform: translateY(-1px); box-shadow: 0 5px 15px var(--accent-ghost);
  }
  .auth-logo:hover { transform: scale(1.05) rotate(-3deg); }
}
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-heading h2, dialog > h2 { font-family: var(--font-display); font-weight: 600; }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 25px; width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: var(--shadow); }
dialog::backdrop { background: #101a1466; }
dialog h2 { font-size: 20px; margin-bottom: 15px; }
dialog p { font-size: 14px; }
.dialog-heading button { border: 0; background: transparent; font-size: 22px; }
.dialog-actions { justify-content: flex-end; margin-top: 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.toggle-row small { display: block; font-size: 12px; }
#toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 100; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px 20px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
@media (max-width: 1150px) { .workspace { grid-template-columns: 260px minmax(0, 1fr); } .support-panel { display: none; } .fixed-disclaimer { display: flex; } }

@media (max-width: 800px) {
  .auth-page { flex-direction: column; gap: 24px; padding: 78px 20px 30px; justify-content: flex-start; }
  .auth-brand { left: 20px; top: 26px; font-size: 11px; }
  .auth-theme { right: 20px; top: 18px; }
  .auth-theme button { font-size: 12px; }
  .auth-intro { width: 430px; }
  .auth-intro h1 { font-size: 29px; margin: 10px 0; }
  .auth-intro h1 br { display: none; }
  .auth-intro p, .intro-plant { display: none; }
  .auth-card { width: 430px; padding: 26px; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 64px auto 0 0; width: min(300px, calc(100% - 48px)); z-index: 21; box-shadow: 30px 0 80px #0002; }
  .workspace:not(.sidebar-open) .sidebar { display: none; }
  .sidebar-backdrop { position: fixed; inset: 64px 0 0; z-index: 20; border: 0; border-radius: 0; background: #101a1455; }
  .mobile-toggle { display: inline-block; }
  .topbar { height: 64px; padding: 10px 12px; gap: 6px; }
  .brand { gap: 5px; }
  .brand-mark, .account-name, .connection { display: none; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 10px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions button { padding: 7px 8px; font-size: 11px; }
  .home-link { font-size: 11px; padding: 7px 8px; }
  .chat-toolbar { padding: 10px 16px; min-height: 58px; gap: 8px; }
  .support-chip { display: none; }
  .toolbar-actions { gap: 6px; }
  .toolbar-actions button { padding: 7px 10px; font-size: 12px; }
  .export-menu summary { padding: 7px 10px; font-size: 12px; }
  .chat-area { padding: 22px 16px; }
  .message { gap: 8px; margin-bottom: 28px; }
  .message-avatar { width: 26px; height: 26px; margin-top: 30px; }
  .message-body { font-size: 15px; padding: 14px; }
  .composer-wrap { padding: 10px 12px max(12px, env(safe-area-inset-bottom)); }
  .composer { padding: 10px 10px 10px 14px; gap: 6px; }
  .composer textarea { font-size: 15px; min-height: 52px; }
  .composer-bottom { gap: 6px; }
  .composer-bottom .primary { width: 44px; height: 44px; }
  .composer-bottom small { font-size: 10px; }
  .composer-note { font-size: 10px; }
  .composer-note span { display: block; margin: 2px 0 0; }
  .fixed-disclaimer { gap: 7px; padding: 8px 10px; font-size: 10px; }
  .welcome { margin-top: 3vh; }
  .welcome p { font-size: 14px; }
  .prompts { gap: 9px; margin: 24px 0; }
  .prompts button { padding: 12px; font-size: 13px; }
}
@media (min-width: 801px) { .sidebar-backdrop { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .support-card:hover, .prompts button:hover, .session:hover, .session:focus-within, .topbar-actions button:hover, .toolbar-actions button:hover, .new-chat:hover, .composer-bottom .primary:hover, .jump-latest:hover, .support-card button:hover, .auth-logo:hover { transform: none !important; }
}

@media (max-width: 480px) { .auth-card { padding: 26px 20px 20px; border-radius: 18px; } .auth-title { font-size: 22px; } }
