:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #222521;
  background: #f5f5f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #242620;
  --muted: #878981;
  --line: #e9e9e3;
  --paper: #fff;
  --ground: #f5f5f2;
  --accent: #4255ce;
  --accent-light: #eef0ff;
  --green: #3e9a6a;
  --serif: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; }
html, body, #app { width: 100%; min-width: 320px; min-height: 100%; height: 100%; margin: 0; }
body { background: var(--ground); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #4255ce50; outline-offset: 2px; }
button { cursor: pointer; }
.app-shell { display: flex; width: 100%; min-height: 100vh; height: 100%; overflow: hidden; }
.sidebar { z-index: 4; display: flex; flex: 0 0 248px; flex-direction: column; height: 100%; padding: 27px 17px 16px; background: #fcfcfa; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 0 32px 7px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 11px; color: #fff; background: var(--accent); font: 800 23px var(--serif); box-shadow: 0 5px 12px #4255ce29; }
.brand-name { font: 700 15px var(--serif); letter-spacing: -.55px; }
.brand-name span { color: #777a72; font-weight: 500; }
.new-note { display: flex; align-items: center; gap: 11px; min-height: 43px; margin-bottom: 30px; padding: 0 14px; border: 1px solid #e7e8e4; border-radius: 8px; background: #fff; color: #353730; text-align: left; font-size: 13px; font-weight: 600; box-shadow: 0 2px 5px #33330a06; transition: .18s ease; }
.new-note:hover { border-color: #c9cdf2; background: #fbfbff; transform: translateY(-1px); }
.new-note span { color: var(--accent); font-size: 21px; line-height: 1; }
.nav-label, .eyebrow { color: #a0a197; font: 600 9px 'DM Sans', sans-serif; letter-spacing: 1.35px; }
.nav-label { margin: 0 9px 10px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { position: relative; display: flex; width: 100%; align-items: center; gap: 12px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #74766f; text-align: left; font-size: 12px; font-weight: 500; transition: .16s ease; }
.nav-item:hover { background: #f5f5f2; color: #34362f; }
.nav-item.active { background: #eeeffb; color: #3f50c3; font-weight: 600; }
.nav-icon { display: inline-grid; width: 18px; place-items: center; color: #8b8d85; font-size: 17px; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-count { margin-left: auto; color: #a1a29b; font: 500 10px 'DM Sans', sans-serif; }
.sidebar-bottom { margin-top: auto; }
.privacy-note { display: flex; gap: 10px; align-items: center; margin: 0 2px 20px; padding: 12px 10px; border: 1px solid #e9eee6; border-radius: 8px; background: #f9fbf7; }
.privacy-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #62ad7b; box-shadow: 0 0 0 3px #62ad7b1e; }
.privacy-note b, .privacy-note small { display: block; }
.privacy-note b { margin-bottom: 4px; color: #5b695b; font-size: 10px; font-weight: 600; }
.privacy-note small { color: #969a91; font-size: 9px; }
.settings-link { margin-bottom: 18px; }
.sidebar-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 3px 0; border-top: 1px solid #efefe9; color: #aaa99f; font-size: 9px; }
.sidebar-footer span { color: #999dd2; font: 600 8px 'DM Sans', sans-serif; letter-spacing: .75px; }
.main-area { display: flex; min-width: 0; flex: 1; flex-direction: column; height: 100%; }
.topbar { z-index: 2; display: flex; flex: none; align-items: center; justify-content: space-between; height: 61px; padding: 0 33px; border-bottom: 1px solid #eaeae5; background: #f8f8f5; }
.breadcrumbs { display: flex; align-items: center; gap: 11px; color: #a1a199; font-size: 11px; }
.breadcrumbs b { color: #484a43; font-weight: 600; }
.crumb-sep { color: #c9c9c1; }
.top-actions { display: flex; align-items: center; gap: 17px; }
.local-badge { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid #e8ece5; border-radius: 20px; background: #fff; color: #74796d; font-size: 10px; }
.local-badge i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #63ac7b; }
.avatar { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid #e3e4dd; border-radius: 50%; background: #eceefa; color: #4c5fc9; font: 600 11px 'DM Sans', sans-serif; }
.mobile-menu { display: none; border: 0; background: transparent; color: #666; font-size: 18px; }
.view { min-height: 0; flex: 1; overflow: auto; }
.home-wrap, .page-wrap { width: min(100%, 1100px); margin: 0 auto; padding: 44px 50px 48px; }
.welcome-row { position: relative; display: flex; min-height: 188px; align-items: center; justify-content: space-between; overflow: hidden; padding: 20px 36px 24px 37px; border: 1px solid #eaebe5; border-radius: 12px; background: linear-gradient(116deg, #fff 1%, #fff 58%, #f4f4fc 100%); }
.welcome-row .eyebrow { display: flex; align-items: center; gap: 8px; color: #888da8; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: #7787df; }
.welcome-row h1, .page-heading h1 { margin: 14px 0 7px; color: #242620; font: 700 29px var(--serif); letter-spacing: -1.2px; }
.lead, .page-heading p { margin: 0; color: #8b8c84; font-size: 12px; }
.welcome-art { position: relative; width: 214px; height: 151px; flex: none; margin-right: 20px; }
.art-core, .welcome-orb { position: absolute; z-index: 2; display: grid; width: 61px; height: 61px; place-items: center; border-radius: 21px; background: linear-gradient(145deg, #6474df, #384dbf); color: #fff; font: 800 40px var(--serif); box-shadow: 0 10px 26px #4155c942; }
.art-core { top: 45px; left: 76px; transform: rotate(-8deg); }
.orbit { position: absolute; border: 1px solid #daddf1; border-radius: 50%; transform: rotate(-22deg); }
.orbit-one { top: 37px; left: 28px; width: 161px; height: 79px; }
.orbit-two { top: 17px; left: 54px; width: 111px; height: 119px; transform: rotate(38deg); }
.spark { position: absolute; color: #aab2e9; }
.spark-a { top: 23px; left: 39px; font-size: 20px; }
.spark-b { right: 19px; bottom: 29px; color: #d6bc87; font-size: 15px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 20px 0 43px; }
.quick-card { display: flex; min-width: 0; align-items: center; gap: 12px; min-height: 75px; padding: 13px 14px; border: 1px solid #e9e9e4; border-radius: 9px; background: #fff; text-align: left; transition: .18s ease; }
.quick-card:hover { border-color: #cfd3ee; box-shadow: 0 5px 17px #262c5810; transform: translateY(-2px); }
.quick-chat { background: #f9f9ff; border-color: #e6e7f2; }
.quick-icon { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 9px; background: #eeefff; color: #5364d3; font-size: 19px; }
.note-icon { background: #eff4ee; color: #61906a; font-size: 17px; }
.file-icon { background: #f5f1e9; color: #af8c4f; font-size: 17px; }
.quick-card b, .quick-card small { display: block; }
.quick-card b { overflow: hidden; margin-bottom: 5px; color: #41433c; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.quick-card small { overflow: hidden; color: #9b9c95; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quick-arrow { margin-left: auto; color: #afb1ab; font-size: 14px; }
.section-head, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; }
.section-head h2 { margin: 8px 0 0; font: 650 17px var(--serif); letter-spacing: -.35px; }
.text-action { padding: 5px 0; border: 0; background: transparent; color: #81847c; font-size: 10px; }
.text-action span { padding-left: 4px; color: #5869cf; }
.recent-grid, .notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.note-card { display: flex; min-width: 0; min-height: 166px; flex-direction: column; padding: 16px; border: 1px solid #eaeae5; border-radius: 9px; background: #fff; text-align: left; transition: .18s ease; }
.note-card:hover { border-color: #cfd3ee; box-shadow: 0 7px 19px #2529460c; transform: translateY(-2px); }
.note-card-top { display: flex; justify-content: space-between; margin-bottom: 14px; }
.note-type { padding: 4px 6px; border-radius: 4px; background: #f4f5fa; color: #9299c7; font: 600 8px 'DM Sans', sans-serif; letter-spacing: .8px; }
.note-more { color: #b9bbb4; font-size: 13px; }
.note-card > b { overflow: hidden; margin-bottom: 7px; color: #41423c; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.note-card p { display: -webkit-box; overflow: hidden; min-height: 31px; margin: 0; color: #999a92; font-size: 10px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.note-date { margin-top: auto; padding-top: 15px; color: #b0b1aa; font-size: 9px; }
.empty-card { display: flex; min-height: 205px; flex-direction: column; align-items: center; justify-content: center; margin-top: 17px; padding: 24px; border: 1px dashed #e0e1db; border-radius: 10px; background: #fafaf8; text-align: center; }
.empty-illustration { display: grid; width: 39px; height: 39px; place-items: center; margin-bottom: 9px; border-radius: 13px; background: #f0f1fb; color: #6c7bd3; font-size: 20px; }
.empty-card h3 { margin: 4px 0 5px; color: #494b44; font-size: 12px; font-weight: 600; }
.empty-card p { max-width: 360px; margin: 0 0 14px; color: #9b9c94; font-size: 10px; line-height: 1.7; }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 35px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; box-shadow: 0 3px 8px #4255ce21; transition: .16s ease; }
.primary-btn:hover { background: #3447bd; box-shadow: 0 4px 12px #4255ce35; }
.primary-btn span { opacity: .7; font-size: 13px; }
.home-footnote { display: flex; align-items: center; gap: 8px; margin-top: 28px; color: #a1a198; font-size: 9px; }
.tiny-shield { color: #79a181; font-size: 9px; }
.page-wrap { padding-top: 40px; }
.page-heading { align-items: center; margin-bottom: 28px; }
.page-heading h1 { margin: 9px 0 5px; font-size: 27px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 13px; }
.search-field { display: flex; width: min(340px, 75%); height: 35px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #e7e8e2; border-radius: 6px; background: #fff; color: #999; }
.search-field span { font-size: 19px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: #4c4e48; font-size: 10px; }
.search-field input::placeholder { color: #afb0aa; }
.result-count { color: #a1a29a; font-size: 10px; }
.notes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 13px; }
.empty-card.compact { min-height: 230px; margin-top: 0; }
.editor-wrap { width: min(100%, 1050px); height: 100%; min-height: 600px; margin: 0 auto; padding: 20px 46px 44px; background: #fff; }
.editor-top { display: flex; align-items: center; gap: 16px; min-height: 42px; border-bottom: 1px solid #efefe9; }
.back-link { padding: 6px 0; border: 0; background: transparent; color: #777971; font-size: 10px; }
.back-link:hover { color: var(--accent); }
.save-state { color: #91968e; font-size: 9px; }
.editor-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.quiet-btn, .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: 31px; padding: 0 10px; border: 1px solid #e7e8e2; border-radius: 6px; background: #fff; color: #777971; font-size: 10px; transition: .15s ease; }
.quiet-btn:hover, .icon-button:hover { border-color: #cfd3ee; color: #4b5dc5; }
.icon-button { width: 31px; padding: 0; font-size: 16px; }
.icon-button.danger:hover { border-color: #ebc9c6; color: #bd5146; }
.note-title-input { width: 100%; margin-top: 29px; padding: 0; border: 0; outline: 0; color: #252720; font: 700 27px var(--serif); letter-spacing: -.7px; }
.note-title-input::placeholder { color: #c8c9c1; }
.editor-meta { display: flex; gap: 8px; margin: 9px 0 22px; color: #a2a39c; font-size: 9px; }
.editor-grid { display: grid; min-height: 390px; grid-template-columns: 1fr 1fr; gap: 30px; }
.note-content-input { width: 100%; min-height: 380px; resize: vertical; padding: 17px; border: 1px solid #edeee8; border-radius: 7px; outline: none; background: #fdfdfb; color: #454740; font: 12px/1.9 'DM Sans', 'Noto Sans SC', sans-serif; }
.note-content-input:focus { border-color: #ccd0f0; }
.markdown-preview { min-width: 0; overflow: auto; padding: 9px 3px; color: #55574f; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { color: #30322c; font-family: var(--serif); }
.markdown-preview h1 { font-size: 21px; }.markdown-preview h2 { font-size: 17px; }.markdown-preview h3 { font-size: 14px; }
.markdown-preview code, .message-content code { padding: 2px 4px; border-radius: 3px; background: #f1f1ed; color: #745d9b; font: 11px ui-monospace, monospace; }
.markdown-preview ul, .message-content ul { padding-left: 19px; }
.empty-preview { color: #b1b2ab; }
.library-tip { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 14px; border: 1px solid #e8eaf3; border-radius: 7px; background: #fafaff; }
.library-tip > span { display: grid; width: 17px; height: 17px; flex: none; place-items: center; border-radius: 50%; background: #eeeffb; color: #606fc7; font: 600 10px Georgia, serif; }
.library-tip p { margin: 0; color: #777b8a; font-size: 10px; line-height: 1.7; }
.document-list { border: 1px solid #ebebe6; border-radius: 8px; background: #fff; }
.document-row { display: flex; align-items: center; gap: 13px; min-height: 77px; padding: 12px 15px; border-bottom: 1px solid #f0f0eb; }
.document-row:last-child { border-bottom: 0; }
.document-icon { display: grid; width: 36px; height: 39px; flex: none; place-items: center; border: 1px solid #e9eaf2; border-radius: 5px; background: #f8f8fc; color: #7a83ba; font: 600 8px 'DM Sans', sans-serif; }
.document-details { min-width: 0; flex: 1; }
.document-details b, .document-details small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-details b { margin-bottom: 4px; color: #4c4e47; font-size: 11px; font-weight: 600; }
.document-details small { margin-bottom: 3px; color: #999b93; font-size: 9px; }
.document-details .doc-date { color: #b0b1aa; font-size: 8px; }
.danger { color: #aa8a87; }
.chat-layout { display: grid; width: 100%; height: 100%; min-height: 550px; grid-template-columns: 222px minmax(0, 1fr); }
.chat-history { overflow: auto; padding: 23px 13px; border-right: 1px solid #ebebe5; background: #fafaf8; }
.chat-history-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 14px; border-bottom: 1px solid #ecece7; }
.chat-history-head .eyebrow { margin-bottom: 5px; font-size: 8px; }
.chat-history-head b { color: #4e5049; font-size: 12px; }
.chat-history-head .icon-button { width: 27px; min-height: 27px; font-size: 15px; }
.history-item { display: block; width: 100%; margin-top: 5px; padding: 9px 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
.history-item:hover, .history-item.selected { background: #f0f1f8; }
.history-item b, .history-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item b { margin-bottom: 5px; color: #60615b; font-size: 10px; font-weight: 500; }
.history-item small, .history-empty { color: #aaaba3; font-size: 8px; }
.history-empty { padding: 16px 5px; line-height: 1.7; }
.chat-main { position: relative; display: flex; min-width: 0; flex-direction: column; background: #fdfdfb; }
.chat-title { display: flex; align-items: center; gap: 10px; min-height: 57px; padding: 0 24px; border-bottom: 1px solid #eeeee9; }
.chat-orb { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: #eff0fd; color: #5e6dcd; font-size: 15px; }
.chat-title b, .chat-title small { display: block; }
.chat-title b { color: #4c4e48; font-size: 10px; font-weight: 600; }
.chat-title small { margin-top: 3px; color: #a0a199; font-size: 8px; }
.chat-clear { min-height: 27px; margin-left: auto; font-size: 9px; }
.messages { width: min(100%, 800px); flex: 1; overflow: auto; align-self: center; padding: 27px 32px 13px; scroll-behavior: smooth; }
.message { display: flex; gap: 11px; margin-bottom: 26px; }
.message-avatar { display: grid; width: 26px; height: 26px; flex: none; place-items: center; border-radius: 9px; background: #edf0fc; color: #4e60c8; font: 700 14px var(--serif); }
.user-message .message-avatar { background: #f1f1ed; color: #77786f; font-size: 9px; }
.message-body { min-width: 0; flex: 1; }
.message-role { margin: 3px 0 8px; color: #5d5f57; font-size: 9px; font-weight: 600; }
.message-role span { margin-left: 7px; color: #b0b1a9; font-size: 8px; font-weight: 400; }
.message-content { color: #55574f; font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; }
.message-content p { margin: 0 0 8px; }
.user-message .message-content { white-space: pre-wrap; }
.composer-wrap { width: min(100% - 46px, 752px); align-self: center; padding-bottom: 15px; }
.context-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.context-select { display: flex; max-width: 240px; align-items: center; gap: 5px; color: #81847a; }
.context-select span { color: #8591cd; font-size: 12px; }
.context-select select { max-width: 215px; border: 0; outline: none; background: transparent; color: #7b7d74; font-size: 9px; }
.context-hint { color: #b0b1aa; font-size: 8px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 9px 10px 8px 14px; border: 1px solid #e6e7e2; border-radius: 9px; background: #fff; box-shadow: 0 3px 12px #262c580a; }
.composer:focus-within { border-color: #cbd0f2; box-shadow: 0 3px 14px #424fc714; }
.composer textarea { width: 100%; max-height: 150px; resize: none; border: 0; outline: none; background: transparent; color: #484a43; font-size: 10px; line-height: 1.7; }
.composer textarea::placeholder { color: #a9aaa3; }
.send-btn { display: grid; width: 29px; height: 29px; flex: none; place-items: center; border: 0; border-radius: 7px; background: var(--accent); color: #fff; font-size: 19px; transition: .16s ease; }
.send-btn:hover { background: #3548bd; }
.send-btn.stop { background: #f0f0ed; color: #65675f; font-size: 11px; }
.composer-note { margin-top: 7px; color: #afb0a8; text-align: center; font-size: 8px; }
.chat-welcome { display: flex; width: min(100%, 500px); flex: 1; flex-direction: column; align-items: center; justify-content: center; align-self: center; padding: 30px; text-align: center; }
.welcome-orb { position: static; width: 48px; height: 48px; margin-bottom: 21px; border-radius: 17px; font-size: 29px; }
.chat-welcome .eyebrow { color: #888da8; }
.chat-welcome h2 { margin: 12px 0 8px; color: #30322c; font: 700 21px var(--serif); letter-spacing: -.6px; }
.chat-welcome p { max-width: 350px; margin: 0 0 20px; color: #93958d; font-size: 10px; line-height: 1.8; }
.setup-nudge { margin-top: 16px; padding: 7px 10px; border: 0; background: transparent; color: #7479a5; font-size: 9px; }
.settings-wrap { max-width: 875px; }
.settings-card { margin-bottom: 16px; padding: 21px 23px; border: 1px solid #e9e9e4; border-radius: 9px; background: #fff; }
.settings-card-head { display: flex; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid #f0f0eb; }
.settings-icon { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 10px; background: #eff0fd; color: #5c6acd; font-size: 17px; }
.settings-icon.data-icon { background: #eff5ef; color: #659271; }
.settings-card-head h2 { margin: 0 0 4px; color: #484a43; font-size: 12px; font-weight: 600; }
.settings-card-head p { margin: 0; color: #999a92; font-size: 9px; line-height: 1.6; }
.settings-form { display: grid; max-width: 580px; gap: 15px; padding: 17px 0 5px; }
.settings-form label { display: grid; gap: 6px; color: #62645c; font-size: 10px; font-weight: 600; }
.settings-form label > span { margin-left: 5px; color: #a7a8a0; font-size: 8px; font-weight: 400; }
.settings-form input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid #e8e9e3; border-radius: 5px; outline: none; background: #fdfdfb; color: #4e5049; font: 10px 'DM Sans', 'Noto Sans SC', sans-serif; }
.settings-form input:focus { border-color: #cbd0f2; background: #fff; }
.secret-field { position: relative; }
.secret-field input { padding-right: 54px; }
.reveal-secret { position: absolute; top: 0; right: 3px; height: 34px; padding: 0 8px; border: 0; background: transparent; color: #8b8f9d; font-size: 9px; }
.settings-actions { display: flex; align-items: center; gap: 10px; margin-top: 1px; }
.settings-callout { display: flex; gap: 9px; margin-top: 13px; padding: 10px 12px; border-radius: 5px; background: #f7f8fb; color: #8a8da0; }
.settings-callout > span { font-size: 12px; }
.settings-callout p { margin: 0; font-size: 8px; line-height: 1.7; }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; }
.import-backup { position: relative; overflow: hidden; }
.import-backup input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.danger-text { color: #a7726d; }
.settings-footnote { margin: 20px 0 10px; color: #aaaba4; text-align: center; font-size: 8px; }
.toast-region { position: fixed; z-index: 10; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { max-width: min(380px, calc(100vw - 35px)); padding: 11px 15px; border: 1px solid #e4e5df; border-radius: 7px; background: #fff; color: #50524a; box-shadow: 0 6px 22px #20221918; font-size: 10px; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.sidebar-scrim { display: none; }
.load-error { max-width: 500px; margin: 15vh auto; padding: 30px; text-align: center; }
.load-error h1 { font: 700 22px var(--serif); }.load-error p { color: #777; font-size: 12px; }

@media (max-width: 1000px) {
  .home-wrap, .page-wrap { padding-right: 30px; padding-left: 30px; }
  .welcome-row { padding-left: 27px; }
  .welcome-art { margin-right: 0; transform: scale(.86); transform-origin: right center; }
  .quick-card { gap: 9px; padding-right: 9px; padding-left: 10px; }
  .quick-card small { font-size: 8px; }
  .chat-layout { grid-template-columns: 190px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  html, body, #app { height: auto; min-height: 100%; }
  .app-shell { min-height: 100dvh; height: 100dvh; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 255px; height: 100dvh; transform: translateX(-103%); transition: transform .2s ease; box-shadow: 8px 0 28px #1c201017; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.visible { position: fixed; z-index: 3; inset: 0; display: block; background: #1b1d2180; }
  .topbar { height: 55px; gap: 10px; padding: 0 15px; }
  .mobile-menu { display: inline-grid; width: 27px; height: 30px; place-items: center; }
  .breadcrumbs { margin-right: auto; gap: 7px; font-size: 10px; }
  .top-actions { gap: 9px; }
  .local-badge { padding: 5px 7px; font-size: 8px; }
  .avatar { width: 25px; height: 25px; }
  .home-wrap, .page-wrap { padding: 22px 17px 34px; }
  .welcome-row { min-height: 168px; padding: 20px 17px; }
  .welcome-row h1 { max-width: 220px; font-size: 23px; }
  .lead { max-width: 225px; font-size: 10px; line-height: 1.65; }
  .welcome-art { position: absolute; right: -17px; bottom: -3px; width: 135px; margin: 0; transform: scale(.76); transform-origin: bottom right; opacity: .8; }
  .quick-grid { grid-template-columns: 1fr; gap: 7px; margin: 12px 0 32px; }
  .quick-card { min-height: 60px; padding: 9px 11px; }
  .quick-card b { font-size: 10px; }.quick-card small { font-size: 8px; }
  .quick-icon { width: 31px; height: 31px; }
  .section-head h2 { font-size: 15px; }
  .recent-grid, .notes-grid { grid-template-columns: 1fr; gap: 8px; }
  .note-card { min-height: 139px; }
  .home-footnote { align-items: flex-start; line-height: 1.65; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 24px; }.page-heading p { max-width: 230px; font-size: 9px; line-height: 1.6; }
  .page-heading > .primary-btn { flex: none; min-height: 32px; padding: 0 9px; font-size: 9px; }
  .toolbar { margin-top: 14px; }
  .editor-wrap { min-height: 100%; padding: 13px 16px 30px; }
  .editor-top { gap: 10px; }.editor-top > .save-state { display: none; }
  .editor-actions { gap: 5px; }.quiet-btn { padding: 0 8px; }
  .note-title-input { margin-top: 22px; font-size: 23px; }
  .editor-grid { grid-template-columns: 1fr; gap: 12px; }
  .note-content-input { min-height: 280px; }.markdown-preview { min-height: 100px; padding: 8px; }
  .chat-layout { min-height: 0; grid-template-columns: 1fr; }
  .chat-history { display: flex; max-height: 57px; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 7px 10px; border-right: 0; border-bottom: 1px solid #ebebe5; }
  .chat-history-head { flex: none; gap: 7px; padding: 0 3px 0 0; border: 0; }
  .chat-history-head > div { display: none; }
  .chat-history-head .icon-button { width: 30px; min-height: 30px; }
  .history-item { flex: none; width: 112px; margin: 0; padding: 5px 8px; }
  .history-item b { max-width: 100%; margin-bottom: 3px; font-size: 8px; }
  .history-item small { font-size: 7px; }
  .chat-main { min-height: 0; }
  .chat-welcome { padding: 24px; }
  .chat-title { min-height: 51px; padding: 0 14px; }
  .messages { padding: 20px 13px 10px; }
  .composer-wrap { width: calc(100% - 24px); padding-bottom: 10px; }
  .context-hint { display: none; }
  .settings-card { padding: 16px 14px; }
  .settings-card-head { align-items: flex-start; }
  .settings-callout p { font-size: 8px; }
}
@media (max-width: 390px) {
  .local-badge { gap: 4px; font-size: 7px; }
  .welcome-art { right: -36px; opacity: .55; }
  .welcome-row h1 { font-size: 21px; }
  .page-heading > .primary-btn { font-size: 8px; }
  .chat-welcome h2 { font-size: 18px; }
}
