/* The original view contracts remain intact; this layer supplies the new design. */
:root {
  --bg:#f5f9f8; --surface:#fff; --ink:#232c32; --text:#232c32; --muted:#78868d; --faint:#a0acb1;
  --line:#e4ece9; --accent:#2f9b82; --accent-soft:#e3f4ee; --accent-ink:#247762;
  --ok:#2f9b82; --ok-soft:#edf8f4; --lock:#9aa8ad; --shadow:none; --shadow-sm:none;
  --radius:8px; --sidebar:224px;
}
* { letter-spacing:0!important; }
body { font-size:14px; line-height:1.65; }
button,input,textarea,select,a { -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible { outline:3px solid #a4dccc; outline-offset:3px; }
button { display:inline-flex; align-items:center; justify-content:center; gap:7px; transition:background .15s,color .15s,border-color .15s; }
button:disabled { opacity:.5; cursor:not-allowed; }
input,select,textarea { min-width:0; max-width:100%; }
h1,h2,h3,p { overflow-wrap:anywhere; }
a { color:var(--accent-ink); }
.lucide { display:inline-block; flex:0 0 auto; object-fit:contain; vertical-align:middle; }
.character { object-fit:contain; display:block; max-width:100%; height:auto; }
.skip-link { position:fixed; z-index:200; left:12px; top:-80px; padding:10px 16px; background:#fff; }
.skip-link:focus { top:10px; }
.sidebar { padding:28px 16px 18px; box-shadow:none; z-index:70; }
.side-brand { margin:0; padding:0 0 27px; border:none; text-decoration:none; color:var(--ink); gap:10px; }
.brand-art { width:46px; height:46px; flex:0 0 46px; overflow:hidden; border-radius:50%; background:var(--accent-soft); }
.brand-art img { width:58px; max-width:none; margin:-4px 0 0 -6px; }
.side-brand .name { display:block; font-size:21px; font-weight:750; }
.side-brand .role { display:block; font-size:10px; margin-top:4px; }
.sidebar nav { display:flex; flex-direction:column; gap:7px; }
.nav-item { min-height:44px; border-radius:8px; font-size:13px; padding:11px 12px; color:#65747a; font-weight:500; gap:13px; }
.nav-item .lbl { text-align:left; }
.nav-item .lucide { opacity:.6; }
.nav-item:hover { background:#f1f7f4; }
.nav-item.active { background:#e0f3ed; color:var(--accent-ink); box-shadow:none; font-weight:650; }
.nav-item.active .lucide { opacity:1; }
.nav-badge { min-width:19px; height:19px; font-size:10px; font-weight:600; }
.side-foot { padding-top:15px; margin-top:auto; }
.side-direction { display:flex; flex-direction:column; gap:7px; padding:10px 10px 18px; }
.eyebrow { color:var(--accent-ink); font-size:11px; font-weight:650; }
.side-direction .eyebrow { color:var(--muted); }
.side-direction strong { font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.side-status { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--muted); }
.side-status i { width:6px; height:6px; border-radius:50%; background:var(--accent); }
.legacy-link { display:block; margin:14px 12px 0; color:var(--muted); font-size:10px; text-decoration:none; }
.topbar { min-height:80px; padding:17px 32px; background:#fff; backdrop-filter:none; gap:12px; }
.topbar>div:first-of-type { flex:1; min-width:0; }
.topbar h1 { font-size:18px; font-weight:650; }
.topbar .sub { font-size:11px; color:var(--muted); }
.stage-pill { border-radius:5px; padding:4px 10px; font-size:11px; white-space:nowrap; }
.content { padding:28px 32px 40px; scroll-behavior:smooth; }
.page { gap:20px; max-width:1600px; min-height:0; }
.page-wide { height:auto; }
.page-narrow { max-width:1060px; }
.page-chat { max-width:none; height:100%; }
.primary,.ghost { border-radius:6px; padding:10px 15px; min-height:40px; font-size:12px; font-weight:600; box-shadow:none; }
.primary { background:var(--accent); }
.primary:hover { background:#27866f; filter:none; }
.primary .lucide { filter:brightness(0) invert(1); }
.ghost { border-color:var(--line); color:#5b6b72; }
.soft-button { background:var(--accent-soft); color:var(--accent-ink); padding:7px 12px; border-radius:5px; font-size:12px; }
.text-button { padding:0; color:var(--accent-ink); font-size:12px; justify-content:flex-start; }
.icon-button { width:38px; height:38px; padding:0; border:1px solid var(--line); border-radius:6px; flex:0 0 auto; }
.mobile-menu { display:none; }
.nav-backdrop { position:fixed; inset:0; background:rgba(25,44,37,.28); z-index:65; }
.card,.rail-card,.tool-card,.stat { box-shadow:none; border-radius:8px; background:#fff; }
.hero,.quote-card,.streak-card,.tip-card,.action-card,.locked-card,.summary-card { background:#fff; box-shadow:none; }
.avatar { background:var(--accent-soft); box-shadow:none; padding:0; overflow:hidden; }
.avatar .character { width:100%; height:100%; object-fit:cover; }
.floating-bot { width:56px; height:56px; border:1px solid var(--line); background:#fff; box-shadow:none; padding:0; overflow:hidden; right:22px; bottom:20px; }
.floating-bot .character { width:100%; height:100%; object-fit:cover; }
.badge { border-radius:4px; padding:3px 7px; font-size:10px; font-weight:550; }
.row { align-items:center; }
.center-note { font-size:13px; color:var(--muted); }
.section-title { display:flex; align-items:center; gap:10px; font-size:12px; font-weight:650; margin:0; color:#51636a; }
.connection-error { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:50px 20px; }
.connection-error .character { width:180px; }
.connection-error h2 { font-size:22px; }
.connection-error p { margin:0 0 20px; }
.toast { border-radius:6px; background:#233f35; box-shadow:none; font-size:12px; max-width:calc(100vw - 32px); }
.modal { border-radius:8px; box-shadow:none; max-width:min(800px,calc(100vw - 28px)); }
.modal-backdrop { background:rgba(25,44,37,.35); z-index:100; }
.modal-head { background:#fff; }
.modal-body { overflow-wrap:anywhere; }
.progress,.deck-progress .bar { background:#e8f0ec; border-radius:4px; }
.progress>span,.deck-progress .bar>span { background:var(--accent); border-radius:4px; }
.progress-fill { background:var(--accent)!important; }

/* Home: real research state, no synthetic knowledge/mastery scores. */
.home-welcome { position:relative; min-height:252px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #dceee6; padding:22px 24px 28px 5px; }
.welcome-copy { min-width:0; max-width:720px; position:relative; z-index:1; }
.welcome-copy h2 { font-size:32px; line-height:1.4; font-weight:700; margin:10px 0 13px; }
.welcome-copy p { font-size:13px; color:#73828a; max-width:620px; line-height:1.9; margin:0; }
.welcome-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:24px; }
.welcome-character { width:245px; height:245px; flex:0 0 245px; }
.home-columns { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:30px; }
.home-main,.home-aside { display:flex; flex-direction:column; gap:14px; min-width:0; }
.band-title { display:flex; gap:16px; align-items:center; padding:4px 0 1px; }
.band-title h3 { margin:0; font-size:12px; font-weight:650; white-space:nowrap; }
.band-title>span { height:1px; background:var(--line); flex:1; }
.today-action,.home-action { display:flex; align-items:center; gap:16px; padding:18px; background:#fff; border:1px solid var(--line); border-radius:8px; text-align:left; min-height:88px; width:100%; }
.home-action { justify-content:flex-start; }
.home-action:hover { border-color:#a9d6c5; background:#fbfefd; }
.today-action strong,.home-action strong { font-size:13px; font-weight:650; display:block; }
.today-action p,.home-action .grow>span { display:block; color:var(--muted); font-size:11.5px; margin:4px 0 0; line-height:1.7; }
.today-action>.lucide,.home-action>.lucide:first-child { opacity:.6; }
.journey-stages { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.journey-stage { padding:14px 0 16px; border-top:2px solid var(--line); display:flex; flex-direction:column; gap:8px; }
.journey-stage.current { border-color:var(--accent); }
.journey-number { color:var(--muted); font-size:10px; }
.journey-stage.current .journey-number { color:var(--accent-ink); }
.journey-stage strong { font-size:12px; font-weight:600; }
.journey-stage p { font-size:11px; color:var(--muted); margin:0; line-height:1.8; }
.overview-stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.overview-stat { background:#fff; border:1px solid var(--line); border-radius:8px; padding:18px 16px; display:flex; flex-direction:column; gap:7px; }
.overview-stat strong { font-size:28px; font-weight:650; line-height:1.3; }
.overview-stat span { font-size:11px; color:var(--muted); }
.research-overview { padding:17px 0; border-bottom:1px solid var(--line); }
.research-overview .row { gap:7px; }
.research-overview h3 { font-size:12px; margin:0; }
.research-title { display:block; font-size:13px; font-weight:600; margin:15px 0; }
.concept-preview { display:flex; flex-direction:column; gap:12px; padding:0 0 16px; }
.concept-preview>div { display:flex; gap:8px; align-items:center; font-size:11px; }
.concept-preview small { margin-left:auto; font-size:9px; color:var(--accent-ink); }
.concept-dot { width:5px; height:5px; background:#71bba2; border-radius:50%; flex:0 0 auto; }
.research-summary h3 { font-size:12px; }
.research-summary p { font-size:12px; color:#73828a; line-height:1.9; }
.companion-note { display:flex; align-items:center; gap:10px; padding-top:5px; }
.companion-note img { width:95px; flex:0 0 95px; }
.companion-note p { font-size:11px; color:#73828a; line-height:1.9; }

/* Conversation and onboarding share the same evidence/action components. */
.page-fill { height:100%; min-height:0; }
.page-fill .dash-grid { min-height:0; }
.dash-grid { grid-template-columns:minmax(0,1fr) 280px; gap:26px; }
.chat-grid { background:#fff; border:1px solid var(--line); border-radius:8px; padding:0; gap:0; }
.chat-grid .chat-wrap { padding:22px; min-width:0; }
.chat-grid .dash-rail { border-left:1px solid var(--line); background:#fbfdfc; padding:20px; gap:20px; }
.chat-grid .rail-card { padding:0; background:transparent; border:0; border-radius:0; }
.chat-grid .tip-card { display:flex; flex-direction:column; align-items:start; }
.chat-stream { padding:10px 0 20px; gap:22px; }
.msg { max-width:94%; min-width:0; }
.msg>div:not(.avatar) { min-width:0; }
.msg.her .bubble { border:0; background:#f4f8f6; box-shadow:none; color:#3b4b51; }
.bubble { font-size:13px; line-height:1.9; border-radius:8px; overflow-wrap:anywhere; }
.msg.me .bubble { background:#e0f3eb; color:#2d5548; }
.composer { border-top:1px solid var(--line); gap:8px; }
.composer textarea { height:56px; border-radius:6px; padding:11px 12px; font-size:13px; }
.composer>.primary { flex:0 0 auto; }
.chip { font-size:11px; border-radius:5px; padding:6px 10px; }
.intent-chips { margin-bottom:12px; gap:6px; }
.quick-link { border:0; border-radius:5px; padding:10px 0; background:transparent; color:#5a6f68; font-size:12px; justify-content:flex-start; }
.quick-link:hover { background:var(--accent-soft); }
.quick-list { gap:2px; }
.chat-action,.agent-action-card { border-radius:6px; background:#eff8f3; border-color:#d7ebdf; }
.sources { font-size:12px; }
.context-facts { display:flex; flex-direction:column; gap:12px; padding-top:17px; margin-top:17px; border-top:1px solid var(--line); }
.context-facts strong { font-size:12px; }
.context-facts p { font-size:11px; color:var(--muted); line-height:1.9; margin:0; }
.context-facts>.character { width:135px; margin:0 auto; }
.recommendation-companion { padding:0 8px 15px; text-align:center; }
.recommendation-companion .character { width:180px; margin:0 auto; }
.recommendation-companion h3 { font-size:13px; }
.recommendation-companion p { font-size:11px; color:var(--muted); line-height:1.8; }
.paper>h3 { font-size:17px; line-height:1.65; }
.paper .abs,.paper .ai-digest { font-size:12px; line-height:1.9; margin-top:14px; }
.paper .ai-digest { border-radius:6px; }
.paper .ai-digest .tag { border-radius:4px; }
.ring { background:conic-gradient(var(--accent) calc(var(--p)*1%),#e7efeb 0); }
.paper .reason { font-size:11px; border-radius:5px; background:#f0f8f3; padding:10px; }
.paper .meta { font-size:10px; line-height:1.8; }
.paper-original { display:inline-flex; align-items:center; gap:5px; align-self:start; font-size:10px; color:var(--accent-ink); margin-top:7px; text-decoration:none; }
.studio-setup-disclosure>summary { cursor:pointer; font-size:12px; font-weight:600; padding:0 0 16px; }
body[data-view="onboarding"] .sidebar,
body[data-view="onboarding"] .mobile-menu,
body[data-view="onboarding"] .nav-backdrop { display:none; }
body[data-view="onboarding"] .topbar { padding-left:max(24px,calc((100% - 1040px)/2)); padding-right:max(24px,calc((100% - 1040px)/2)); }
body[data-view="onboarding"] .content { padding:32px 24px 48px; }
.onboard-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:80px; align-items:center; max-width:960px; margin:auto; min-height:100%; }
.onboard-portrait { min-width:0; padding:16px 0; }
.onboard-portrait img { width:240px; height:auto; max-height:none; margin:0 auto 20px; }
.onboard-portrait h2 { font-size:24px; margin:8px 0; line-height:1.5; }
.onboard-portrait p { font-size:13px; color:var(--muted); line-height:1.9; max-width:350px; }
.onboard { max-width:none; }
.onboard>.hero { display:none; }
.onboard>.card { border:0; padding:0; background:transparent; border-radius:0; }
.onboard h2 { font-size:20px; margin-bottom:8px; }
.depth-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.depth-chip { border-radius:6px; min-height:76px; font-size:12px; padding:13px; text-align:left; align-items:start; justify-content:center; }
.depth-chip.active { border-color:var(--accent); background:var(--accent-soft); }
.depth-hint { font-size:10px; }
.onboard .form-grid { gap:12px; }
.field input,.field select,.field textarea { border-radius:6px; padding:10px 11px; font-size:13px; }
.onboard-chat { max-width:none; height:100%; min-height:0; }
.onboard-confirm { max-height:55vh; border-radius:6px; padding:15px; }
.onboard-layout.chat-layout { height:100%; min-height:0; align-items:stretch; }
.onboard-layout.chat-layout .onboard-portrait { align-self:center; }
.onboard-layout .chat-stream { padding-right:4px; }
.answer-chip { border-radius:5px!important; font-size:11px; }

/* Recommendations: compact cards, same decisions and long-running ingestion. */
body[data-view="papers"] .page-fill { height:auto; overflow:visible; }
body[data-view="papers"] .page-fill .dash-grid { height:auto; overflow:visible; }
body[data-view="papers"] .dash-main { overflow:visible; }
body[data-view="papers"] [data-deckpane] { overflow:visible; }
.seg-tabs { background:#eaf2ee; border-radius:6px; padding:4px; gap:3px; }
.seg-tab { font-size:12px; border-radius:4px; padding:9px 10px; }
.seg-tab.active { box-shadow:none; }
.seg-count { height:18px; font-size:10px; }
.deck-scroll { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; overflow:visible; scroll-snap-type:none; padding:0; align-items:start; }
.paper { min-height:0!important; height:auto!important; border-radius:8px; padding:20px!important; box-shadow:none; background:#fff; }
.paper-visual { display:none!important; }
.paper-title { font-size:17px!important; line-height:1.7!important; }
.paper .deck-actions { flex-wrap:wrap; gap:8px; }
.paper .deck-actions button { flex:1; min-width:90px; font-size:11px; padding:9px; border-radius:5px; }
.deck-done,.deck-sentinel { grid-column:1/-1; border-radius:8px; }
.deck-done .big { font-size:30px; }
.deck-head { gap:10px; flex-wrap:wrap; margin:16px 0; }
.deck-head .t { font-size:15px; }
.deck-head .s { font-size:11px; }
.deck-progress .bar { flex:0 0 70px; }
.rail-card { padding:17px; }
.rail-card h3 { font-size:12px; }
.dash-rail .tip-card { border:0; background:transparent; padding:0; }
.ingest-manual,.ingest-box { font-size:12px; border-radius:6px; }
.im-actions { flex-wrap:wrap; }

/* Evidence library retains its two modes and all source/claim operations. */
.cog-library { padding-top:0; }
.cog-topic-head { margin:0; }
.cog-topic-head h2 { font-size:21px; }
.cog-topic-head .muted { font-size:11px; }
.cog-mode-switch,.cog-group-toggle { border-radius:5px; background:#e8f1ec; }
.cog-mode,.cog-group-toggle button { border-radius:4px; font-size:11px; padding:7px 10px; }
.cog-mode.active,.cog-group-toggle button.active { box-shadow:none; }
.cog-workspace { grid-template-columns:180px minmax(0,1fr) 305px; gap:22px; }
.cog-organizer { padding:4px 12px 16px 0; border:0; background:transparent; border-radius:0; top:0; }
.cog-thread { font-size:12px; padding:10px; min-width:0; overflow-wrap:anywhere; align-items:start; border-radius:5px; }
.cog-thread:hover { background:#edf5f0; }
.cog-aside-title { font-size:10px; }
.cog-chat { border:0; border-left:1px solid var(--line); border-radius:0; padding:0 0 0 20px; background:transparent; top:0; max-height:calc(100dvh - 145px); }
.cog-chat .lib-ask-row { flex-direction:column; }
.lib-ask-row textarea { border-radius:6px; font-size:12px; }
.lib-grid { grid-template-columns:repeat(auto-fill,minmax(min(100%,290px),1fr)); gap:12px; }
.lib-item { border-radius:7px; padding:16px; }
.lib-item h3 { font-size:13px; line-height:1.75; }
.lib-toolbar { margin:0; }
.search { border-radius:6px; background:#fff; }
.cog-center { min-width:0; }
.cog-paper-organize { flex-wrap:wrap; }
.cog-thread-select { width:100%; flex:1 1 100%; border-radius:5px; }
.cog-source-card { border-radius:5px; background:#f8fbf9; }
.cog-claims { background:transparent; border:0; padding:0 0 15px; border-bottom:1px solid var(--line); border-radius:0; }
.cog-answer-group { border-radius:7px; }
.source-modal { width:900px; }
.source-highlight { background:#d2eee0; color:#234d3e; }
.cog-feed-focus { border-radius:5px; padding:9px; font-size:10px; }
.cog-reading { padding:22px; }
.activity-button { padding:14px 0; margin-top:8px; }
.activity-row { display:flex; align-items:center; gap:16px; padding:14px 0; border-bottom:1px solid var(--line); }
.activity-row strong { display:block; font-size:12px; }
.activity-row small { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.claim-actions { margin-top:12px; }
.claim-actions button { min-height:30px; font-size:11px; padding:5px 10px; }
.source-markdown { overflow-wrap:anywhere; white-space:pre-wrap; }
.cog-board-head { flex-wrap:wrap; }

/* Writing: setup, then sources / manuscript / agent console. */
.studio-intro { display:flex; align-items:center; justify-content:space-between; gap:24px; border-bottom:1px solid var(--line); padding:0 0 20px; }
.studio-intro h2 { margin:0 0 8px; font-size:24px; }
.studio-intro p { color:var(--muted); margin:0; font-size:12px; }
.studio-intro img { width:115px; height:115px; flex:0 0 115px; }
.studio-setup { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:24px; }
.studio-setup .tool-card { padding:0; border:0; border-radius:0; background:transparent; margin:0!important; }
.studio-setup .tool-card+.tool-card { border-left:1px solid var(--line); padding-left:24px; }
.tool-card h3 { font-size:17px; }
.tool-card .em { display:none; }
.tool-card>p { font-size:12px!important; line-height:1.9!important; }
.tool-card input,.tool-card select { border-radius:6px!important; font-size:12px; background:#fff; }
.studio-output { padding:0; background:transparent; border:0; }
.studio-workspace { display:grid; grid-template-columns:190px minmax(0,1fr) 300px; gap:0; margin-top:18px; border:1px solid var(--line); background:#fff; border-radius:8px; align-items:start; }
.studio-navigation { padding:20px 14px; min-width:0; position:sticky; top:0; max-height:calc(100dvh - 160px); overflow:auto; }
.studio-navigation h3 { font-size:11px; margin:0 0 14px; color:var(--muted); }
.studio-navigation .nav-section { display:block; width:100%; padding:9px 6px; text-align:left; color:#52675e; font-size:11px; line-height:1.8; border-radius:4px; }
.studio-navigation .nav-section:hover { background:#edf7f1; }
.studio-references { border-top:1px solid var(--line); padding-top:18px; margin-top:18px; }
.studio-reference { padding:10px 0; border-bottom:1px solid #edf3ef; font-size:10px; line-height:1.8; overflow-wrap:anywhere; }
.studio-reference strong { display:block; color:#4d675a; font-weight:500; }
.studio-reference small { color:var(--muted); }
.manuscript { min-width:0; padding:22px 28px!important; border:0; border-left:1px solid var(--line); border-right:1px solid var(--line); border-radius:0; box-shadow:none; }
.manuscript-tabs { display:flex; gap:6px; padding-bottom:18px; margin-bottom:18px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.manuscript-tabs button { border-radius:4px!important; font-size:11px!important; padding:7px 9px!important; }
.manuscript h3 { font-size:19px; margin-top:25px; line-height:1.6; }
.manuscript>div { overflow-wrap:anywhere; }
.manuscript [data-paragraph] { border-radius:4px!important; }
.studio-console { padding:20px!important; border:0; border-radius:0; box-shadow:none; position:sticky!important; top:0!important; min-width:0; max-height:calc(100dvh - 160px); overflow:auto; }
.studio-console .primary,.studio-console .ghost { font-size:11px; border-radius:5px; }
.studio-console textarea { border-radius:5px!important; font-size:12px; }
.studio-console .context-header { display:flex; align-items:center; gap:8px; margin-bottom:15px; }
.studio-console .context-header img { width:34px; height:34px; border-radius:50%; object-fit:cover; }
.studio-console .context-header strong { font-size:12px; }
.review-history { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr)); gap:12px; }
.review-history .card { margin:0!important; }
.review-item { flex-direction:column; align-items:stretch!important; }
.review-item>div { min-width:0; }
.review-item button { white-space:nowrap; min-width:126px; }
.manuscript cite { background:var(--accent-soft); color:var(--accent-ink); border-radius:4px; padding:2px 5px; font-size:10px; font-style:normal; }

/* Research settings: open sections rather than a stack of floating panels. */
body[data-view="settings"] .page { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:26px 36px; }
body[data-view="settings"] .page>.card { background:transparent; border:0; border-radius:0; padding:0 0 22px; border-bottom:1px solid var(--line); }
body[data-view="settings"] .page>.card:nth-child(4) { grid-column:1/-1; }
body[data-view="settings"] .card h2 { font-size:17px; }
body[data-view="settings"] input,body[data-view="settings"] select,body[data-view="settings"] textarea { border-radius:5px!important; font-size:12px; }
.count-chip { border-radius:5px; }
.dir-grid { gap:12px; }

@media(min-width:1700px) {
  :root { --sidebar:240px; }
  .content { padding:30px 48px 44px; }
  .home-welcome { min-height:280px; }
  .welcome-character { width:275px; height:275px; flex-basis:275px; }
  .home-columns { grid-template-columns:minmax(0,1fr) 380px; gap:36px; }
  .cog-workspace { grid-template-columns:200px minmax(0,1fr) 350px; }
  .studio-workspace { grid-template-columns:220px minmax(0,1fr) 340px; }
}
@media(max-width:1250px) {
  :root { --sidebar:196px; }
  .sidebar { padding-left:12px; padding-right:12px; }
  .side-brand .name { font-size:19px; }
  .side-brand .role { font-size:9px; }
  .brand-art { width:38px; height:38px; flex-basis:38px; }
  .brand-art img { width:49px; }
  .content { padding:24px; }
  .topbar { padding:16px 24px; }
  .home-columns { grid-template-columns:minmax(0,1fr) 270px; gap:22px; }
  .welcome-character { width:200px; height:200px; flex-basis:200px; }
  .welcome-copy h2 { font-size:28px; }
  .dash-grid { grid-template-columns:minmax(0,1fr) 230px; gap:18px; }
  .cog-workspace { grid-template-columns:155px minmax(0,1fr) 255px; gap:14px; }
  .cog-chat { grid-column:auto; position:sticky; max-height:calc(100dvh - 145px); padding-left:14px; }
  .cog-chat .lib-ask-row { flex-direction:column; }
  .cog-chat .intent-chips { display:grid; }
  .studio-workspace { grid-template-columns:155px minmax(0,1fr) 260px; }
  .manuscript { padding:20px!important; }
  .studio-console { padding:16px!important; }
  .onboard-layout { gap:30px; }
}
@media(max-width:1050px) {
  .dash-grid { grid-template-columns:minmax(0,1fr); height:auto; }
  .chat-grid .dash-rail { display:none; }
  .chat-grid,.chat-grid .chat-wrap { height:100%; }
  .page-fill .dash-grid.chat-grid { height:100%; }
  body[data-view="papers"] .dash-rail { display:none; }
  .cog-workspace { grid-template-columns:160px minmax(0,1fr); }
  .cog-chat { grid-column:1/-1; position:static; max-height:none; border-left:0; border-top:1px solid var(--line); padding:20px 0 0; }
  .cog-chat .lib-ask-row { flex-direction:row; }
  .cog-chat .intent-chips { display:flex; }
  .cog-chat .lib-ask-row .primary { width:auto; }
  .studio-workspace { grid-template-columns:150px minmax(0,1fr); }
  .studio-console { grid-column:1/-1; position:static!important; max-height:none; border-top:1px solid var(--line); }
  .manuscript { border-right:0; }
  .home-columns { grid-template-columns:minmax(0,1fr); }
  .home-aside { display:grid; grid-template-columns:1fr 1fr; align-items:start; gap:16px 24px; }
  .home-aside>.band-title { grid-column:1/-1; }
  .home-aside .research-overview { grid-row:2/4; grid-column:2; }
  .onboard-layout { grid-template-columns:1fr; max-width:680px; gap:20px; }
  .onboard-portrait { display:flex; gap:20px; align-items:center; padding:0; }
  .onboard-portrait img { width:105px; height:auto; order:2; margin:0 0 0 auto; flex:0 0 auto; }
  .onboard-portrait h2 { font-size:22px; }
  .onboard-portrait p { font-size:12px; }
  .onboard-layout.chat-layout { display:flex; flex-direction:column; height:100%; }
  .chat-layout .onboard-portrait { display:none; }
}
@media(max-width:760px) {
  :root { --sidebar:240px; }
  .sidebar { position:fixed; inset:0 auto 0 0; transform:translateX(-100%); transition:transform .2s; padding:24px 16px; }
  .nav-open .sidebar { transform:translateX(0); }
  .side-brand .name { font-size:21px; }
  .side-brand .role { font-size:10px; }
  .brand-art { width:46px; height:46px; flex-basis:46px; }
  .brand-art img { width:58px; }
  .mobile-menu { display:inline-flex; }
  .topbar { padding:12px 16px; min-height:70px; }
  .topbar h1 { font-size:16px; }
  .topbar .sub { font-size:10px; }
  .stage-pill { font-size:9px; padding:4px 6px; }
  .content { padding:18px 16px 30px; }
  .page { gap:18px; }
  .home-welcome { padding:6px 0 22px; min-height:220px; gap:10px; align-items:center; }
  .welcome-copy h2 { font-size:25px; margin-top:9px; }
  .welcome-copy { flex:1; }
  .welcome-copy p { font-size:12px; }
  .welcome-character { width:130px; height:150px; flex-basis:130px; }
  .welcome-actions { gap:8px; margin-top:15px; }
  .welcome-actions button { font-size:11px; padding:8px 10px; min-height:35px; }
  .home-columns { gap:22px; }
  .home-aside { display:flex; }
  .home-action,.today-action { padding:14px; gap:11px; min-height:82px; }
  .today-action { flex-wrap:wrap; }
  .today-action>.grow { flex-basis:60%; }
  .today-action>.soft-button { margin-left:34px; }
  .journey-stages { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .overview-stats { width:100%; }
  .research-overview { width:100%; }
  .chat-grid .chat-wrap { padding:14px; }
  .msg { max-width:100%; gap:7px; }
  .msg .avatar { width:27px; height:27px; }
  .bubble { font-size:12px; padding:10px 12px; }
  .composer textarea { font-size:12px; }
  .composer>.primary { min-width:40px; padding:9px; }
  .intent-chips .chip { font-size:10px; padding:5px 7px; }
  .deck-scroll { grid-template-columns:1fr; }
  .seg-tab { font-size:11px; padding:8px 5px; }
  .paper { padding:17px!important; }
  .paper-title { font-size:16px!important; }
  .cog-workspace { grid-template-columns:minmax(0,1fr); gap:17px; }
  .cog-organizer { position:static; padding:0; flex-direction:row; flex-wrap:wrap; gap:6px; }
  .cog-organizer>.cog-aside-title { flex-basis:100%; }
  .cog-group-toggle { margin:0; }
  .cog-thread { font-size:11px; padding:7px 9px; }
  .cog-thread small { display:none; }
  .cog-mode-switch { width:100%; }
  .cog-mode { flex:1; font-size:11px; }
  .cog-chat { grid-column:auto; }
  .cog-chat .lib-ask-row { flex-direction:column; }
  .cog-chat .lib-ask-row .primary { width:100%; }
  .cog-topic-head { gap:10px; align-items:start; flex-direction:column; }
  .cog-topic-head h2 { font-size:19px; }
  .lib-grid { grid-template-columns:minmax(0,1fr); }
  .studio-intro { gap:14px; padding-bottom:15px; }
  .studio-intro h2 { font-size:21px; }
  .studio-intro img { width:85px; height:85px; flex-basis:85px; }
  .studio-setup { grid-template-columns:minmax(0,1fr); gap:22px; }
  .studio-setup .tool-card+.tool-card { padding:20px 0 0; border-left:0; border-top:1px solid var(--line); }
  .studio-workspace { grid-template-columns:minmax(0,1fr); }
  .studio-navigation { position:static; max-height:none; padding:15px; border-bottom:1px solid var(--line); }
  .studio-navigation details:not([open]) .studio-reference { display:none; }
  .studio-navigation .nav-section { display:inline-block; width:auto; padding:4px 8px; }
  .studio-references { max-height:180px; overflow:auto; margin-top:10px; padding-top:10px; }
  .manuscript { border:0; padding:18px!important; }
  .manuscript h3 { font-size:17px; }
  .studio-console { grid-column:auto; }
  .studio-console button { max-width:100%; }
  body[data-view="settings"] .page { grid-template-columns:minmax(0,1fr); }
  body[data-view="settings"] .page>.card:nth-child(4) { grid-column:auto; }
  .onboard-portrait { gap:10px; }
  .onboard-portrait img { width:80px; height:auto; }
  .onboard-portrait h2 { font-size:21px; }
  .onboard-portrait p { font-size:11px; }
  .onboard .form-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .depth-grid { gap:8px; }
  .depth-chip { font-size:11px; padding:11px; }
  .floating-bot { width:46px; height:46px; right:15px; bottom:15px; }
  .onboard-confirm { max-height:56vh; padding:12px; }
}
@media(max-width:390px) {
  .welcome-character { width:94px; height:130px; flex-basis:94px; }
  .welcome-copy h2 { font-size:23px; }
  .welcome-copy .eyebrow { font-size:10px; }
  .stage-pill { display:none; }
  .onboard .form-grid { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
