:root {
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --conversation-width: 820px;
  --primary: #0b6ffb;
  --primary-soft: #eaf3ff;
  --ink: #14233a;
  --muted: #71809a;
  --line: #dbe4ef;
  --sidebar: #f7f9fc;
  color: var(--ink);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html,
body { min-width: 320px; min-height: 100%; margin: 0; }

body { min-height: 100vh; overflow-x: hidden; }

button,
textarea,
input { font: inherit; }

button,
.attachment-button { min-height: 44px; }

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
.attachment-button:focus-visible,
.attachment-button:has(#image-input:focus-visible) {
  outline: 3px solid rgba(11, 111, 251, 0.22);
  outline-offset: 2px;
}

button { color: inherit; }

.app-shell { min-height: 100vh; background: #fff; }

.history-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 18px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar-brand,
.sidebar-user,
.header-title,
.topbar-context,
.context-strip,
.quick-actions,
.composer,
.composer-actions,
.card-header,
.card-footer {
  display: flex;
  align-items: center;
}

.sidebar-brand { gap: 10px; padding: 0 8px 18px; }
.sidebar-brand > div { min-width: 0; }
.sidebar-close { display: none; flex: 0 0 auto; width: 44px; margin-left: auto; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; place-items: center; }
.sidebar-close:hover { background: #edf3fb; }

.brand-logo { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }

.sidebar-brand strong,
.sidebar-brand span,
.sidebar-user strong,
.sidebar-user span { display: block; }

.sidebar-brand strong { font-size: 15px; letter-spacing: 0.01em; }
.sidebar-brand span { margin-top: 1px; color: var(--muted); font-size: 12px; }

.new-chat-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 1px solid #cbd9ed;
  border-radius: 12px;
  color: #075ecf;
  background: #fff;
  box-shadow: 0 2px 8px rgba(22, 53, 94, 0.04);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.new-chat-button:hover { border-color: #99bff0; background: #fafdff; }

.planned-modules { display: grid; gap: 7px; margin-top: 14px; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.sidebar-section-heading strong { color: #596981; font-size: 11px; font-weight: 680; letter-spacing: 0.04em; }
.sidebar-section-heading span { padding: 3px 6px; border-radius: 999px; color: #765613; background: #fff3cf; font-size: 9px; font-weight: 700; }
.planned-module {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 64px;
  padding: 9px 10px;
  border: 1px solid #e1e7ef;
  border-radius: 11px;
  color: #536177;
  background: #fbfcfe;
  text-align: left;
}
.planned-module-copy { min-width: 0; }
.planned-module-copy strong,
.planned-module-copy small { display: block; }
.planned-module-copy strong { color: #415069; font-size: 12px; font-weight: 650; }
.planned-module-copy small { margin-top: 4px; color: #687991; font-size: 12px; line-height: 1.4; }
.planned-module-note { margin: 0 5px; color: #765613; font-size: 12px; line-height: 1.45; }

.history-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
}

.history-search img { opacity: 0.62; }
.history-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.history-search input::placeholder { color: #9aa7b8; }

.history-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 0; scrollbar-width: thin; }
.history-group + .history-group { margin-top: 15px; }
.history-group h2 { margin: 0 8px 6px; color: #8a97a9; font-size: 11px; font-weight: 650; letter-spacing: 0.06em; }

.history-item {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.history-item:hover { background: #edf3fb; }
.history-item.is-active { background: #e7f1ff; }
.history-item strong,
.history-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item strong { font-size: 13px; font-weight: 620; }
.history-item span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.history-empty,
.history-disabled { margin: 8px; padding: 12px 10px; border-radius: 10px; color: var(--muted); background: #edf2f8; font-size: 12px; line-height: 1.5; text-align: center; }

.sidebar-footer { padding-top: 10px; border-top: 1px solid var(--line); }
.sidebar-user { gap: 9px; padding: 5px 6px; }
.user-avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--primary); font-size: 12px; place-items: center; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user div span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.logout-button { width: 100%; min-height: 44px; margin-top: 10px; border: 1px solid #d8e2ef; border-radius: 10px; color: #4e6079; background: #fff; cursor: pointer; font-size: 12px; }
.logout-button:hover { border-color: #a9c8ef; color: #075ecf; background: #f7fbff; }
.logout-error { margin: 8px 4px 0; color: #b42318; font-size: 11px; line-height: 1.45; text-align: center; }
.site-footer { margin-top: 9px; color: #9aa7b8; font-size: 10px; text-align: center; }
.site-footer a,
.login-beian a { color: inherit; text-decoration: none; }
.site-footer a:hover,
.login-beian a:hover { color: var(--primary); text-decoration: underline; }

.sidebar-scrim { display: none; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); background: #fff; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--topbar-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.header-title { min-width: 0; gap: 10px; }
.mobile-brand-pill { display: none; }
.sidebar-toggle { display: none; width: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; place-items: center; }
.sidebar-toggle:hover { background: #f1f5fa; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 10px; }
h1 { margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }

.topbar-context { justify-content: flex-end; gap: 22px; min-width: 0; }
.topbar-context p { min-width: 0; margin: 0; }
.topbar-context p span,
.topbar-context p strong { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-context p span { color: var(--muted); font-size: 9px; }
.topbar-context p strong { margin-top: 2px; font-size: 11px; font-weight: 620; }

.mode-badge { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #cde0fb; border-radius: 999px; color: #075ecf; background: #f2f7ff; font-size: 10px; font-weight: 650; }

.demo-warning { margin: 0; padding: 7px 16px; border-bottom: 1px solid #f1d59d; color: #745014; background: #fff9ec; font-size: 11px; font-weight: 620; text-align: center; }
.demo-warning[hidden] { display: none; }

.data-refresh-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}
.data-refresh-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; min-width: 0; }
.data-refresh-status p { min-width: 0; margin: 0; }
.data-refresh-status span,
.data-refresh-status strong { display: block; overflow-wrap: anywhere; }
.data-refresh-status span { color: var(--muted); font-size: 9px; }
.data-refresh-status strong { margin-top: 2px; font-size: 11px; font-weight: 650; }
.data-refresh-status small { grid-column: 1 / -1; color: #607089; font-size: 10px; line-height: 1.45; }
.data-refresh-status[data-state="FAILED"] small { color: #9a3412; }
.data-refresh-status[data-state="SUCCEEDED"] small { color: #1d6b46; }
.data-refresh-button { min-height: 44px; padding: 0 15px; border: 1px solid #a9c8ef; border-radius: 10px; color: #075ecf; background: #fff; cursor: pointer; font-size: 12px; font-weight: 650; }
.data-refresh-button:hover:not(:disabled) { background: #edf5ff; }
.data-refresh-button:disabled { cursor: not-allowed; opacity: 0.62; }

.content-stage {
  min-height: calc(100vh - var(--topbar-height) - 29px);
  padding: 24px 32px 208px;
  background:
    radial-gradient(circle at 50% 83%, rgba(196, 224, 255, 0.6) 0, rgba(226, 240, 255, 0.34) 20%, rgba(255, 255, 255, 0) 49%),
    #fff;
}

.conversation-column { width: min(var(--conversation-width), 100%); margin: 0 auto; }

.context-strip { justify-content: space-between; gap: 18px; margin-bottom: 28px; padding: 9px 12px; border: 1px solid #e4ebf3; border-radius: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.76); font-size: 11px; }
.context-strip p { margin: 0; }
.context-strip p:first-child { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; color: #516078; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #27a765; box-shadow: 0 0 0 3px rgba(39, 167, 101, 0.11); }

.conversation { display: grid; gap: 16px; }

.welcome-message { display: flex; align-items: flex-start; gap: 14px; padding: 26px 18px; border: 0; background: transparent; box-shadow: none; }
.assistant-mark { display: grid; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #0b6ffb, #57a2ff); box-shadow: 0 6px 16px rgba(11, 111, 251, 0.2); font-size: 11px; font-weight: 750; place-items: center; }
.welcome-message h2 { margin: 1px 0 9px; font-size: 23px; font-weight: 580; letter-spacing: -0.02em; }
.welcome-message p,
.welcome-message small { margin: 0; }
.welcome-message p { color: #526178; font-size: 14px; line-height: 1.7; }
.welcome-message small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }

.message,
.fact-card,
.evidence-card,
.confirmation-card,
.notice-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 7px 24px rgba(31, 61, 104, 0.07); }
.notice-card { padding: 16px; }
.notice-card p { margin: 7px 0 0; color: #526178; line-height: 1.6; }
.message { justify-self: end; max-width: 82%; padding: 11px 15px; border-color: #d5e5fb; background: #edf5ff; line-height: 1.55; }
.fact-card,
.evidence-card,
.confirmation-card { overflow: hidden; }

.history-snapshot { padding: 18px; border: 1px solid #cfe0f6; border-radius: 16px; background: #f7fbff; box-shadow: 0 7px 24px rgba(31, 61, 104, 0.06); }
.history-snapshot-label { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #075ecf; background: #e6f1ff; font-size: 10px; font-weight: 700; }
.history-snapshot-query { margin: 12px 0 0; color: var(--ink); font-weight: 650; }
.history-snapshot-summary,
.history-snapshot-time { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.rerun-button { min-height: 44px; margin-top: 13px; padding: 0 14px; border: 0; border-radius: 9px; color: #fff; background: var(--primary); cursor: pointer; font-weight: 650; }
.rerun-button:hover { background: #075fd8; }

.candidate-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 16px 16px; }
.candidate-choice { min-height: 44px; padding: 7px 12px; border: 1px solid #a9c7ed; border-radius: 999px; color: #075ecf; background: #f4f8ff; cursor: pointer; }
.candidate-choice:hover { background: #e8f2ff; }
.candidate-choice:disabled { cursor: wait; opacity: 0.6; }

.card-header,
.card-footer { justify-content: space-between; gap: 12px; padding: 14px 16px; }
.card-header { border-bottom: 1px solid #edf1f5; }
.card-header h2 { margin: 0; font-size: 16px; }
.card-header span { color: var(--muted); font-size: 11px; }
.card-status { color: #8b5e12 !important; font-weight: 650; }
.fact-list { display: grid; grid-template-columns: minmax(110px, 0.38fr) 1fr; margin: 0; }
.fact-list dt,
.fact-list dd { margin: 0; padding: 10px 16px; border-bottom: 1px solid #f0f3f7; }
.fact-list dt { color: var(--muted); font-size: 12px; }
.fact-list dd { overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.fact-value-price { color: var(--primary); font-size: 18px !important; }
.fact-value-stock { color: #1d6b46; }
.fact-details { border-bottom: 1px solid #edf1f5; }
.fact-details summary { min-height: 44px; padding: 13px 16px; color: #075ecf; cursor: pointer; font-size: 12px; font-weight: 650; }
.fact-details[open] summary { border-bottom: 1px solid #edf1f5; }
.fact-list-secondary dt,
.fact-list-secondary dd { background: #fbfcfe; }
.limitations { margin: 0; padding: 11px 16px; color: #7a5314; background: #fff9eb; font-size: 12px; }
.card-footer { flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.copy-button,
.confirm-button { padding: 0 15px; border: 0; border-radius: 9px; color: #fff; background: var(--primary); cursor: pointer; }

.document-item { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.document-item + .document-item { margin-top: 12px; }
.document-item[data-status="EXCLUDED"] { opacity: 0.65; }
.document-item-status { color: #64717d; font-size: 13px; }
.document-row-form .exclude-button { margin-left: 8px; }
.document-item .field-grid input { min-width: 0; width: 100%; }
.confirmation-body { padding: 16px; }
.attachment-name { margin: 0 0 0.75rem; color: #425466; overflow-wrap: anywhere; }
.document-evidence { display: grid; gap: 0.5rem; padding: 0.75rem; border: 1px solid #d8dde3; border-radius: 0.5rem; background: #f4f6f8; }
.document-evidence:empty { display: none; }
.document-evidence p { margin: 0; overflow-wrap: anywhere; }
.ocr-preview { display: block; width: min(100%, 280px); max-height: 180px; margin-bottom: 12px; border-radius: 8px; object-fit: contain; background: #f4f6f8; }
.ocr-text { padding: 10px; border-radius: 8px; background: #f4f6f8; white-space: pre-wrap; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.field-grid label { display: grid; gap: 5px; color: #5d6a74; font-size: 12px; }
.field-grid input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #cbd5dd; border-radius: 8px; color: var(--ink); background: #fff; }
.warning-list { color: #8b5e12; font-size: 13px; }

.processing-stage { position: fixed; right: 28px; bottom: 148px; z-index: 45; padding: 9px 13px; border-radius: 999px; color: #fff; background: #243651; box-shadow: 0 6px 18px rgba(23, 33, 43, 0.2); font-size: 12px; }

.composer-dock { position: fixed; right: 0; bottom: 0; left: var(--sidebar-width); z-index: 15; padding: 8px 32px 12px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96) 18%, #fff 48%); }
.quick-actions { width: min(var(--conversation-width), 100%); gap: 8px; margin: 0 auto 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.quick-actions::-webkit-scrollbar { display: none; }
.quick-actions button { flex: 0 0 auto; min-height: 44px; padding: 0 13px; border: 1px solid #d8e2ef; border-radius: 999px; color: #4e6079; background: rgba(255, 255, 255, 0.96); box-shadow: 0 3px 10px rgba(31, 61, 104, 0.04); cursor: pointer; font-size: 12px; }
.quick-actions button:hover { border-color: #a9c8ef; color: #075ecf; background: #f7fbff; }

.composer { position: relative; width: min(var(--conversation-width), 100%); min-height: 58px; margin: 0 auto; padding: 7px 8px 7px 10px; border: 1px solid #cad8ea; border-radius: 28px; background: #fff; box-shadow: 0 12px 34px rgba(36, 75, 125, 0.15); }
.attachment-button { display: grid; flex: 0 0 auto; width: 44px; padding: 0; border: 0; border-radius: 50%; color: #64748b; background: transparent; cursor: pointer; place-items: center; }
.attachment-button:hover { background: #f0f5fb; }
#image-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 126px; padding: 10px 8px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 1.45; }
.composer textarea::placeholder { color: #9aa7b8; }
.composer-actions { flex: 0 0 auto; }
.send-button { display: grid; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--primary); box-shadow: 0 5px 14px rgba(11, 111, 251, 0.28); cursor: pointer; place-items: center; }
.send-button:hover { background: #075fd8; }
.send-button img { filter: brightness(0) invert(1); }
.composer-note { margin: 7px 0 0; color: #97a3b4; font-size: 9px; text-align: center; }

.suggest-panel { position: absolute; right: 0; bottom: calc(100% + 10px); left: 0; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid #cbd5dd; border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(32, 49, 62, 0.14); }
.suggest-panel[hidden] { display: none; }
.suggest-option { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.suggest-option:hover,
.suggest-option:focus-visible { background: #f0f6fa; }
.suggest-kind { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; color: #164f7c; background: #e8f3fa; font-size: 11px; }
.suggest-kind.customer { color: #285c3c; background: #eaf6ee; }
.suggest-label { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.suggest-empty { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 13px; }

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

.login-shell { display: grid; min-height: 100vh; padding: 24px 16px; place-items: center; background: linear-gradient(160deg, #10234a 0%, #173f7d 60%, #1a5fb4 100%); }
.login-card { display: grid; gap: 10px; width: min(420px, 100%); padding: 32px 28px; border-radius: 18px; background: #fff; box-shadow: 0 18px 48px rgba(8, 20, 44, 0.35); text-align: center; }
.login-logo { justify-self: center; width: 56px; height: 56px; border-radius: 14px; }
.login-company,
.login-hint,
.login-error,
.login-note,
.login-beian { margin: 0; }
.login-company { color: #6c7780; font-size: 12px; letter-spacing: 0.08em; }
.login-card h1 { color: var(--ink); font-size: 22px; }
.login-hint { color: #4a5763; font-size: 14px; }
.login-card form { display: grid; gap: 10px; margin-top: 8px; }
.login-card input { min-height: 46px; padding: 10px 14px; border: 1px solid #bdc9d2; border-radius: 10px; text-align: center; letter-spacing: 0.12em; }
.login-card .send-button { width: 100%; border-radius: 10px; }
.login-error { color: #a13232; font-size: 13px; }
.login-note,
.login-beian { color: #8a95a0; font-size: 12px; }

@media (max-width: 1120px) {
  .source-context { display: none; }
  .topbar-context { gap: 15px; }
}

@media (max-width: 760px) {
  .app-shell,
  .workspace { min-height: 100dvh; }
  .history-sidebar { width: min(78vw, 280px); box-shadow: 12px 0 34px rgba(29, 48, 76, 0.16); transform: translateX(-100%); transition: transform 180ms ease; }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .history-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-scrim { display: block; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(20, 35, 58, 0.24); }
  .workspace { margin-left: 0; }
  .app-header { height: 72px; padding: max(8px, env(safe-area-inset-top)) 12px 0; border-bottom: 0; background: rgba(255, 255, 255, 0.9); }
  .header-title { gap: 10px; }
  .header-title > div { display: none; }
  .mobile-brand-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid #edf1f6; border-radius: 999px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 5px 18px rgba(31, 61, 104, 0.08); font-size: 15px; font-weight: 680; }
  .sidebar-toggle { display: grid; border: 1px solid #edf1f6; border-radius: 50%; background: rgba(255, 255, 255, 0.96); box-shadow: 0 5px 18px rgba(31, 61, 104, 0.08); }
  .sidebar-close { display: grid; }
  .planned-modules { display: none; }
  .topbar-context { gap: 6px; overflow: hidden; }
  .topbar-context p { display: none; }
  .topbar-context p:first-child { display: flex; align-items: center; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid #edf1f6; border-radius: 999px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 5px 18px rgba(31, 61, 104, 0.06); }
  .topbar-context p:first-child span { display: none; }
  .topbar-context p:first-child strong { max-width: 74px; margin: 0; font-size: 11px; }
  .topbar-context .mode-badge { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; box-shadow: 0 5px 18px rgba(31, 61, 104, 0.06); }
  .data-refresh-panel { grid-template-columns: 1fr; gap: 8px; padding: 9px 14px; }
  .data-refresh-status { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .data-refresh-button { width: 100%; }
  .context-strip { display: none; }
  .content-stage { min-height: calc(100dvh - 72px); padding: 8px 14px calc(184px + env(safe-area-inset-bottom)); }
  .welcome-message { flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: calc(100dvh - 304px); padding: 28px 12px; text-align: center; }
  .assistant-mark { width: 64px; height: 64px; border-radius: 50%; font-size: 14px; }
  .welcome-message h2 { margin: 0 0 10px; font-size: 22px; }
  .welcome-message p { max-width: 330px; font-size: 13px; line-height: 1.65; }
  .welcome-message small { display: none; }
  .composer-dock { left: 0; padding: 8px 10px calc(9px + env(safe-area-inset-bottom)); }
  .quick-actions { flex-wrap: nowrap; overflow-x: auto; padding: 3px 1px; }
  .quick-actions button { min-height: 44px; padding: 0 14px; }
  .workspace:has(.conversation > :not(.welcome-message)) .quick-actions { display: none; }
  .workspace:has(.conversation > :not(.welcome-message)) .content-stage { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .processing-stage { bottom: calc(145px + env(safe-area-inset-bottom)); }
  .composer { min-height: 64px; padding: 9px 8px; border-radius: 32px; }
  .composer textarea { min-height: 44px; padding: 10px 6px; font-size: 14px; }
}

@media (max-width: 350px) {
  .topbar-context .mode-badge { display: none; }
  .topbar-context p:first-child strong { max-width: 92px; }
}

@media (max-width: 390px) {
  .history-sidebar {
    position: fixed;
    padding: 14px 12px 12px;
  }

  .sidebar-brand { padding-bottom: 13px; }
  .brand-logo { width: 32px; height: 32px; }
  .history-search { margin-top: 11px; }
  .app-header { height: 72px; padding: max(8px, env(safe-area-inset-top)) 10px 0; }
  .demo-warning { padding: 6px 10px; font-size: 10px; }
  .data-refresh-status { grid-template-columns: 1fr; }
  .content-stage { padding: 8px 14px calc(184px + env(safe-area-inset-bottom)); }
  .context-strip { align-items: flex-start; gap: 8px; margin-bottom: 14px; padding: 8px 10px; }
  .context-strip p:last-child { text-align: right; }
  .welcome-message { gap: 16px; padding: 24px 8px; }
  .assistant-mark { width: 64px; height: 64px; border-radius: 50%; }
  .message { max-width: 90%; }
  .field-grid { grid-template-columns: 1fr; }
  .fact-list { grid-template-columns: minmax(86px, 0.42fr) 1fr; }
  .fact-list dt,
  .fact-list dd { padding: 9px 12px; }
  .processing-stage { right: 14px; bottom: calc(145px + env(safe-area-inset-bottom)); }
  .composer-dock { padding: 6px 10px calc(9px + env(safe-area-inset-bottom)); }
  .quick-actions button { padding: 0 12px; }
  .composer { min-height: 64px; padding-right: 6px; padding-left: 6px; border-radius: 32px; }
  .composer textarea { min-height: 44px; padding-right: 4px; padding-left: 4px; font-size: 14px; }
  .composer-note { margin-top: 5px; }
}
.assistant-summary {
  margin: 0;
  padding: 16px 18px 4px;
  color: var(--text-primary, #172033);
  font-size: 15px;
  line-height: 1.65;
}
