:root {
  color-scheme: light;
  --ink: #1d2b47;
  --muted: #5d6c86;
  --blue: #26417c;
  --blue-hover: #1c3262;
  --paper: #f8faff;
  --sidebar: #edf2fa;
  --line: #d9e2f0;
  --selected: #dce6f7;
  --error: #9a3c35;
  --error-bg: #fcf1ee;
  --content-width: 760px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { overscroll-behavior: none; }
.boot, .login-page, .chat-app { position: fixed; top: var(--app-top, 0px); left: 0; width: 100%; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: var(--blue); text-underline-offset: .22em; }
button, a, input, textarea { outline: none; }
:focus-visible { outline: 3px solid #6081bd; outline-offset: 3px; }
input:focus-visible, textarea:focus-visible { outline: none; }
::selection { background: #d4e1fb; color: #172d58; }
input, textarea { caret-color: var(--blue); }
[hidden] { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.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; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--blue); text-decoration: none; font-size: 22px; font-weight: 650; letter-spacing: -.025em; width: fit-content; }
.brand img { display: block; }
.button { display: inline-flex; min-height: 44px; justify-content: center; align-items: center; gap: 9px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 10px; background: transparent; font-size: 14px; font-weight: 550; transition: background 160ms ease, border-color 160ms ease; }
.button:hover { background: #e4ebf7; border-color: #bacbe5; }
.button:active { background: #dce5f5; }
.button-primary { color: white; background: var(--blue); border-color: var(--blue); }
.button-primary:hover { color: white; background: var(--blue-hover); border-color: var(--blue-hover); }
.button-primary:disabled { color: #e2e8f3; background: #667ba5; border-color: #667ba5; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); transition: background 160ms ease, color 160ms ease; }
.icon-button:hover { color: var(--blue); background: #dde6f4; }
.icon-button:active { background: #d1ddf0; }
.icon-button:disabled { opacity: .45; }
.text-button { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.text-button:hover { color: #142b59; }
.mobile-only { display: none; }

.boot { display: flex; height: var(--app-height, 100dvh); flex-direction: column; justify-content: center; align-items: center; padding: 24px; text-align: center; }
.boot p { margin: 25px 0; max-width: 28em; font-size: 14px; color: var(--muted); }
.login-page { height: var(--app-height, 100dvh); overflow-y: auto; }
.login-layout { display: flex; min-height: 100%; max-width: 1000px; margin: 0 auto; padding: max(40px, env(safe-area-inset-top)) 48px max(28px, env(safe-area-inset-bottom)); flex-direction: column; }
.login-brand { flex: 0 0 auto; }
.login-content { display: grid; grid-template-columns: 1fr 360px; gap: 0 100px; align-content: center; flex: 1; padding: 64px 0 88px; }
.login-content > h1 { align-self: end; font-size: 36px; line-height: 1.45; margin: 0; letter-spacing: -.025em; font-weight: 600; }
.login-intro { color: var(--muted); font-size: 16px; line-height: 1.9; margin: 20px 0 0; }
.login-form { grid-column: 2; grid-row: 1 / 4; padding: 0; }
.login-form h2 { font-size: 21px; line-height: 1.5; margin: 0; font-weight: 650; }
.login-hint { margin: 8px 0 28px; font-size: 13px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; margin-top: 19px; }
.field label { color: #34445f; font-size: 14px; font-weight: 550; }
.field input { width: 100%; height: 48px; padding: 10px 13px; color: var(--ink); border: 1px solid #b9c7dc; border-radius: 8px; background: #fff; transition: border-color 160ms, box-shadow 160ms; }
.field input:focus { border-color: #6585bd; box-shadow: 0 0 0 3px #dfe8f8; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.login-submit { margin-top: 26px; width: 100%; justify-content: space-between; min-height: 48px; padding: 11px 17px; }
.form-error { margin: 16px 0 0; color: var(--error); font-size: 13px; line-height: 1.7; }
.login-footer { margin: 0; font-size: 12px; color: #66748b; }

.chat-app { display: grid; grid-template-columns: 256px minmax(0, 1fr); width: 100%; height: var(--app-height, 100dvh); }
.sidebar { display: flex; min-height: 0; flex-direction: column; padding: max(26px, env(safe-area-inset-top)) 17px max(16px, env(safe-area-inset-bottom)); background: var(--sidebar); border-right: 1px solid var(--line); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.sidebar-top .brand { font-size: 21px; }
.new-conversation { justify-content: flex-start; color: var(--blue); border-color: #b9c9e3; background: #f6f9ff; margin: 29px 0 28px; padding-left: 13px; }
.new-conversation .icon { width: 19px; }
.history-heading { padding: 0 11px 10px; color: var(--muted); font-size: 12px; font-weight: 550; }
.history { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0 20px; scrollbar-width: thin; scrollbar-color: #bdcce4 transparent; }
.history-item { position: relative; display: flex; width: 100%; flex-direction: column; gap: 4px; padding: 12px 11px; margin: 2px 0; text-align: left; color: #43536d; border: 0; border-radius: 8px; background: transparent; }
.history-item:hover { background: #e1e9f6; }
.history-item[aria-current="page"] { color: var(--blue); background: var(--selected); }
.history-item-title { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.6; }
.history-item time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history-empty { margin: 6px 11px; max-width: 17em; font-size: 13px; line-height: 1.8; color: var(--muted); }
.history-error { margin: 6px 11px; font-size: 13px; line-height: 1.7; color: var(--error); }
.history > .skeleton { margin: 15px 11px; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; border-top: 1px solid var(--line); padding: 13px 0 0 9px; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; color: #4f5f79; }
.account > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account .icon { width: 17px; height: 17px; }

.workspace { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--paper); }
.topbar { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-height: 83px; padding: max(17px, env(safe-area-inset-top)) 40px 15px; border-bottom: 1px solid #e6ebf4; }
.conversation-heading { min-width: 0; flex: 1; }
.conversation-heading h1 { margin: 0; color: #2c3d5b; font-weight: 600; font-size: 15px; line-height: 1.65; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.save-state { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; line-height: 1.6; margin: 3px 0 0; }
.save-state .icon { width: 12px; height: 12px; stroke-width: 1.9; }
.save-state.is-error { color: var(--error); }
.conversation-viewport { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #bfcde2 transparent; scroll-padding-top: 25px; }
.welcome { display: flex; width: min(calc(100% - 80px), var(--content-width)); min-height: min(470px, 100%); margin: 0 auto; padding: min(9vh, 72px) 0 38px; flex-direction: column; align-items: flex-start; justify-content: center; }
.welcome-mark { width: 34px; height: 34px; margin-bottom: 25px; color: var(--blue); stroke-width: 1.35; }
.welcome h2 { margin: 0; font-size: 27px; line-height: 1.5; letter-spacing: -.025em; font-weight: 600; }
.welcome > p { color: var(--muted); font-size: 15px; line-height: 1.85; margin: 13px 0 0; }
.phone-break { display: none; }
.suggestions { display: flex; flex-direction: column; align-self: stretch; gap: 0; margin-top: 31px; max-width: 460px; }
.suggestion { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 54px; padding: 13px 0; color: #3f5578; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 14px; line-height: 1.7; transition: color 160ms, padding 160ms; }
.suggestion:first-child { border-top: 1px solid var(--line); }
.suggestion .icon { width: 17px; height: 17px; color: #6780a9; }
.suggestion:hover { color: var(--blue); padding-left: 5px; }
.suggestion:active { background: #edf2fb; }
.messages { width: min(calc(100% - 80px), var(--content-width)); margin: 0 auto; padding: 35px 0 44px; }
.messages:empty { display: none; }
.message { min-width: 0; margin: 0 0 34px; scroll-margin-top: 24px; }
.message:last-child { margin-bottom: 0; }
.message-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.message-author { font-size: 13px; color: #3e5275; font-weight: 650; }
.message-time { font-size: 11px; color: #6d7890; font-variant-numeric: tabular-nums; }
.message-user { display: flex; flex-direction: column; align-items: flex-end; margin-bottom: 29px; }
.message-user .message-header { justify-content: flex-end; }
.message-user .message-content { max-width: 100%; padding: 13px 17px; background: #e8eef9; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.85; }
.message-assistant .message-content { font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: 0 0 16px; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4, .message-content h5, .message-content h6 { color: #243a61; font-weight: 650; line-height: 1.65; margin: 27px 0 11px; }
.message-content h1 { font-size: 21px; }
.message-content h2 { font-size: 19px; }
.message-content h3 { font-size: 16px; }
.message-content h4, .message-content h5, .message-content h6 { font-size: 15px; }
.message-content ul, .message-content ol { padding-left: 1.6em; margin: 10px 0 18px; }
.message-content li { margin: 5px 0; padding-left: 2px; }
.message-content li > p { margin-bottom: 8px; }
.message-content blockquote { margin: 19px 0; padding: 11px 16px; color: #566782; background: #eef3fb; border-radius: 8px; }
.message-content blockquote p { margin: 0; }
.message-content a { overflow-wrap: anywhere; }
.message-content a:hover { color: #112c62; }
.message-content code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; background: #eaf0f9; color: #294a7c; font-size: .86em; padding: .16em .3em; border-radius: 4px; }
.message-content pre { max-width: 100%; overflow-x: auto; margin: 19px 0; padding: 17px 19px; background: #eaf0f9; border-radius: 10px; line-height: 1.75; scrollbar-width: thin; scrollbar-color: #b4c5de transparent; }
.message-content pre code { display: block; padding: 0; min-width: max-content; background: transparent; font-size: 12px; }
.message-content .table-scroll { max-width: 100%; overflow-x: auto; margin: 19px 0; border: 1px solid var(--line); border-radius: 8px; scrollbar-width: thin; scrollbar-color: #b4c5de transparent; }
.message-content table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.8; font-variant-numeric: tabular-nums; }
.message-content td, .message-content th { min-width: 100px; max-width: 360px; padding: 10px 13px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: normal; }
.message-content th { background: #edf2fa; color: #314a73; font-weight: 600; }
.message-content tr:last-child td { border-bottom: 0; }
.message-content hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.message-content img { max-width: 100%; height: auto; border-radius: 8px; }
.message-attachments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(100%, 440px); margin: 0 0 10px; }
.message-attachments.is-single { display: block; width: min(100%, 360px); }
.message-attachment { min-width: 0; margin: 0; }
.message-attachment > a { display: block; overflow: hidden; border-radius: 10px; background: var(--user-message, #e8eef9); }
.message-attachment img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.message-attachments.is-single img { max-height: 340px; aspect-ratio: auto; object-fit: contain; }
.image-load-retry { max-width: 100%; white-space: normal; text-align: left; font-size: 12px; }
.tool-progress { display: flex; flex-direction: column; gap: 7px; margin: 0 0 15px; padding: 0; list-style: none; }
.tool-progress li { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.tool-progress .icon { width: 14px; height: 14px; }
.tool-progress .tool-failed { color: var(--error); }
.thinking { display: flex; align-items: center; gap: 9px; min-height: 30px; color: var(--muted); font-size: 13px; }
.progress-indicator { width: 13px; height: 13px; flex: 0 0 auto; border: 1.5px solid #c5d3e8; border-top-color: var(--blue); border-radius: 50%; animation: turn 1s linear infinite; }
.message-failure { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; background: var(--error-bg); color: var(--error); border-radius: 8px; font-size: 13px; line-height: 1.8; }
.message-failure .icon { margin-top: 3px; width: 16px; height: 16px; }
.message-failure p { margin: 0; }
.message-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.message-actions .text-button { display: inline-flex; align-items: center; gap: 6px; }
.message-actions .icon { width: 14px; height: 14px; }
.conversation-loading { width: min(calc(100% - 80px), var(--content-width)); margin: 45px auto; }
.skeleton { height: 13px; width: 87%; margin: 15px 0; border-radius: 4px; background: #e0e7f3; animation: breathe 1.8s ease-in-out infinite alternate; }
.skeleton-short { width: 24%; margin-bottom: 31px; }
.skeleton-medium { width: 61%; }

.composer-area { position: relative; flex: 0 0 auto; width: min(calc(100% - 80px), var(--content-width)); margin: 0 auto; padding: 0 0 max(18px, env(safe-area-inset-bottom)); }
.composer { display: flex; flex-direction: column; gap: 8px; padding: 9px; background: #fff; border: 1px solid #b6c6df; border-radius: 14px; transition: border-color 160ms, box-shadow 160ms; }
.composer-row { display: flex; width: 100%; min-width: 0; align-items: flex-end; gap: 8px; }
.composer:focus-within { border-color: #7492c3; box-shadow: 0 0 0 3px #e4ebf8; }
.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: min(180px, calc(var(--app-height, 100dvh) * .28)); padding: 10px 7px; resize: none; border: 0; border-radius: 0; color: var(--ink); background: transparent; font-size: 16px; line-height: 1.5; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #bdcce4 transparent; }
.composer textarea::placeholder { color: #65748d; opacity: 1; }
.attachment-button { flex: 0 0 44px; color: var(--blue); }
.attachment-button:hover { background: #edf2fa; }
.draft-attachments { display: flex; gap: 10px; width: 100%; min-width: 0; padding: 3px 3px 0; }
.draft-attachment { flex: 1 1 0; min-width: 0; max-width: 136px; }
.draft-attachment-preview { position: relative; display: flex; height: 88px; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #edf2fa; color: var(--muted); }
.draft-attachment-preview > img { width: 100%; height: 100%; object-fit: cover; }
.attachment-remove { position: absolute; inset-block-start: 0; inset-inline-end: 0; color: var(--blue); background: #ffffffed; border-radius: 0 8px 0 8px; }
.attachment-remove:hover { background: #fff; }
.attachment-remove .icon { width: 17px; height: 17px; }
.draft-attachment-copy { min-width: 0; padding: 5px 1px 0; }
.attachment-status { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.draft-attachment.is-error .attachment-status { color: var(--error); }
.attachment-progress { display: block; appearance: none; width: 100%; height: 3px; margin-top: 5px; border: 0; border-radius: 4px; overflow: hidden; background: #dce6f7; accent-color: var(--blue); }
.attachment-progress::-webkit-progress-bar { background: #dce6f7; }
.attachment-progress::-webkit-progress-value { background: var(--blue); }
.attachment-progress::-moz-progress-bar { background: var(--blue); }
.attachment-retry { padding: 5px 1px; font-size: 12px; }
.attachment-notice { align-self: stretch; margin: 0; padding: 0 4px; color: var(--error); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.send-button { display: flex; width: 44px; height: 44px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 10px; border: 0; border-radius: 9px; color: white; background: var(--blue); transition: background 160ms; }
.send-button:hover { background: var(--blue-hover); }
.send-button:active { background: #112854; }
.send-button:disabled { color: #7487a6; background: #e6ecf6; }
.send-button .icon { width: 22px; height: 22px; stroke-width: 1.9; }
.composer-meta { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px 0; font-size: 11px; color: #63728a; }
.connection-notice { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 3px 10px; background: #edf2fa; border-radius: 8px; color: #546986; }
.connection-notice > .icon { width: 15px; height: 15px; }
.connection-notice > p { flex: 1; margin: 0; font-size: 12px; line-height: 1.7; }
.connection-notice .text-button { font-size: 12px; }
.jump-to-latest { position: absolute; left: 50%; top: -53px; transform: translateX(-50%); padding: 8px 13px; min-height: 44px; white-space: nowrap; background: var(--paper); font-size: 12px; }
.jump-to-latest .icon { width: 15px; height: 15px; }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes breathe { from { opacity: .55; } to { opacity: 1; } }

@media (min-width: 1600px) {
  .chat-app { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  .chat-app { display: block; }
  .workspace { height: 100%; }
  .sidebar { position: fixed; z-index: 30; top: var(--app-top, 0px); bottom: auto; height: var(--app-height, 100dvh); left: 0; width: min(310px, calc(100% - 48px)); padding-top: max(14px, env(safe-area-inset-top)); transform: translateX(-100%); visibility: hidden; transition: transform 220ms var(--ease-out), visibility 220ms; }
  .chat-app.sidebar-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop { position: fixed; z-index: 29; top: var(--app-top, 0px); left: 0; width: 100%; height: var(--app-height, 100dvh); padding: 0; border: 0; border-radius: 0; background: #152e5766; }
  .sidebar-top { padding-right: 0; }
  .new-conversation { margin-top: 22px; }
  .topbar { min-height: 73px; gap: 8px; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 9px max(10px, env(safe-area-inset-left)); }
  .conversation-heading h1 { font-size: 14px; }
  .save-state { font-size: 11px; margin-top: 1px; }
  .welcome { width: calc(100% - 44px); min-height: min(440px, 100%); padding: min(7vh, 49px) 0 25px; }
  .welcome-mark { margin-bottom: 22px; width: 31px; height: 31px; }
  .welcome h2 { font-size: 23px; }
  .welcome > p { font-size: 14px; margin-top: 12px; }
  .phone-break { display: block; }
  .suggestions { margin-top: 27px; max-width: none; }
  .suggestion { min-height: 53px; font-size: 13px; gap: 9px; }
  .messages { width: calc(100% - 36px); padding: 25px 0 35px; }
  .message { margin-bottom: 29px; }
  .message-user { margin-bottom: 27px; }
  .message-user .message-content { padding: 11px 14px; }
  .message-assistant .message-content { font-size: 15px; }
  .message-content pre { padding: 14px; }
  .message-content td, .message-content th { min-width: 100px; padding: 9px 11px; }
  .composer-area { width: calc(100% - 24px); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .composer { gap: 5px; padding: 6px; border-radius: 12px; }
  .composer-row { gap: 5px; }
  .draft-attachments { gap: 8px; }
  .draft-attachment-preview { height: 82px; }
  .composer textarea { padding: 10px 7px; }
  .composer-meta { justify-content: center; padding-top: 7px; font-size: 11px; }
  .keyboard-open .composer-meta { display: none; }
  .keyboard-open .composer-area { padding-bottom: 8px; }
  .keyboard-hint { display: none; }
  .conversation-loading { width: calc(100% - 40px); }
  .connection-notice { padding-left: 9px; margin-bottom: 9px; }
  .connection-notice > .icon { display: none; }
  .login-layout { padding: max(27px, env(safe-area-inset-top)) 27px max(20px, env(safe-area-inset-bottom)); }
  .login-brand { font-size: 23px; }
  .login-content { display: flex; flex-direction: column; padding: 43px 0 42px; max-width: 420px; width: 100%; margin: auto; }
  .login-content > h1 { align-self: flex-start; font-size: 28px; line-height: 1.45; }
  .login-intro { font-size: 14px; line-height: 1.8; margin: 13px 0 0; }
  .login-form { margin-top: 36px; }
  .login-form h2 { font-size: 18px; }
  .login-hint { margin: 6px 0 22px; font-size: 12px; }
  .login-footer { font-size: 11px; }
}

@media (max-height: 580px) and (max-width: 760px) {
  .welcome { padding-top: 25px; }
  .welcome-mark { display: none; }
  .welcome > p { margin-top: 7px; }
  .suggestions { margin-top: 18px; }
  .composer-meta { display: none; }
}

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

.message-content .archived-image-preview { display: block; width: auto; max-width: min(100%, 640px); max-height: 480px; margin-top: 12px; object-fit: contain; border: 1px solid var(--line); }

/* Chat workspace: quiet surfaces, one action color, and a stable column shared with the composer. */
.chat-app {
  --ink: #242b28;
  --muted: #54615b;
  --blue: #205f50;
  --blue-hover: #194c3f;
  --sidebar: #f1f3ef;
  --paper: #faf9f6;
  --selected: #dfebe4;
  --line: #dce2dc;
  --user-message: #e7efe9;
  color: var(--ink);
}
.chat-app .brand, .history-item[aria-current="page"] { color: var(--ink); }
.chat-app .sidebar { padding-inline: 16px; }
.chat-app .sidebar-top { margin-bottom: 21px; }
.chat-app .new-conversation { margin: 0 0 6px; color: var(--blue); background: #fff; border-color: var(--line); }
.chat-app .new-conversation:hover, .chat-app .icon-button:hover { background: var(--selected); }
.calendar-entry { display: flex; align-items: center; gap: 11px; min-height: 44px; margin-bottom: 21px; padding: 0 13px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 550; color: var(--ink); }
.calendar-entry:hover { background: var(--selected); }
.calendar-entry .icon { width: 19px; height: 19px; }
.history-heading { font-weight: 650; }
.history-item { border-radius: 10px; color: var(--ink); }
.history-item:hover { background: #e7ebe6; }
.topbar { min-height: 65px; border-color: var(--line); background: var(--paper); padding-block: max(10px, env(safe-area-inset-top)) 10px; }
.topbar-calendar { min-width: 44px; padding: 7px; color: var(--muted); }
.conversation-heading h1, .message-author { color: var(--ink); }
.conversation-viewport { scrollbar-color: #c7d0c8 transparent; }
.welcome { min-height: min(540px, 100%); padding-bottom: 24px; }
.welcome-mark { display: block; width: 46px; height: 46px; margin-bottom: 16px; }
.welcome h2 { font-size: clamp(25px, 3.4vw, 36px); font-weight: 650; }
.welcome > p { margin-top: 9px; }
.suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: none; margin-top: 24px; }
.suggestion, .suggestion:first-child { padding: 12px; gap: 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; transition: background 140ms; }
.suggestion:hover { padding-left: 12px; background: #f0f5f1; }
.suggestion > span { flex: 1; min-width: 0; }
.suggestion strong, .suggestion small { display: block; }
.suggestion small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.suggestion .icon { color: var(--blue); }
.suggestion .suggestion-arrow { color: var(--muted); }
.message-header { align-items: center; gap: 8px; }
.message-mark { display: block; border-radius: 7px; }
.message-time { color: var(--muted); }
.message-user .message-content { max-width: min(88%, 630px); background: var(--user-message); border-radius: 16px 16px 4px 16px; }
.message-content blockquote, .message-content pre, .message-content code, .message-content th { color: #29483c; background: #eef2ed; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4, .message-content h5, .message-content h6 { color: var(--ink); }
.message-content.is-streaming { white-space: pre-wrap; }
.stream-cursor { display: block; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--blue); animation: breathe 1s ease-in-out infinite alternate; }
.message-tools { width: fit-content; max-width: 100%; margin: 2px 0 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.message-tools summary { min-height: 26px; line-height: 26px; cursor: pointer; }
.message-tools .tool-progress { margin: 4px 0 6px; }
.composer { border-color: #becbc3; border-radius: 17px; box-shadow: 0 2px 10px #24372d0a; }
.composer:focus-within { border-color: #548a77; box-shadow: 0 0 0 3px #dcebe1; }
.composer textarea::placeholder, .composer-meta { color: var(--muted); }
.send-button:active { background: #163e34; }
.send-button:disabled { color: #586b61; background: #e5ece7; }
.jump-to-latest { box-shadow: 0 2px 8px #24372d12; }
@media (max-width: 760px) {
  .chat-app .sidebar-top { margin-bottom: 16px; }
  .topbar { min-height: 57px; padding-block: max(6px, env(safe-area-inset-top)) 6px; }
  .topbar-calendar { min-height: 44px; }
  .messages, .welcome, .composer-area { width: calc(100% - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))); }
  .welcome { min-height: min(430px, 100%); }
  .suggestions { grid-template-columns: 1fr; gap: 7px; }
  .suggestion, .suggestion:first-child { min-height: 47px; padding-block: 7px; }
  .suggestion > span { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 9px; }
  .suggestion small { margin: 0; }
  .message-user .message-content { max-width: 94%; }
}
@media (max-height: 580px) and (max-width: 760px) {
  .welcome-mark { display: none; }
  .suggestions { margin-top: 14px; }
}
