:root{color-scheme:light;font-family:Inter,"Segoe UI",system-ui,sans-serif;color:#172a32;background:#f3f6f7;font-synthesis:none;--muted:#677b85;--line:#e3eaed;--green:#137a61;--dark:#132b35}*{box-sizing:border-box}body{margin:0;font-size:14px;line-height:1.5}button,input,select{font:inherit}button{cursor:pointer;border:1px solid transparent;border-radius:8px;padding:9px 13px;font-weight:600;white-space:nowrap;transition:background .15s}button:disabled{cursor:default;opacity:.45}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #63baa5;outline-offset:3px}button:hover:not(:disabled){filter:brightness(.96)}button.primary{background:var(--green);color:white;box-shadow:0 2px 3px #0b60481a}button.secondary{background:#fff;border-color:#d5e0e4;color:#26434e}button.stop{background:#fff1ed;border-color:#f1d4c9;color:#a34728}button.quiet{background:#f3f6f7;color:#4b6571;border-color:var(--line);font-size:12px;padding:6px 10px}button.text-button{padding:0;color:var(--green);background:none;font-size:12px;white-space:normal;text-align:left}.topbar{height:82px;background:var(--dark);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 36px;gap:20px}.brand{display:flex;align-items:center;gap:13px}.brand-icon{width:39px;height:39px;display:grid;place-items:center;background:#285b59;border:1px solid #397370;border-radius:11px;font-size:22px;font-weight:750;position:relative}.brand-icon span{position:absolute;right:-3px;bottom:-5px;border:2px solid var(--dark);background:#8dd9b6;border-radius:50%;color:var(--dark);font-size:15px;line-height:20px;width:22px;text-align:center}.brand h1{font-size:18px;line-height:1.3;margin:0;font-weight:650;letter-spacing:-.3px}.brand p{margin:3px 0 0;color:#9eb8c0;font-size:11px;letter-spacing:.3px}.top-actions{display:flex;align-items:center;gap:24px}.top-actions button.secondary{background:#24424d;color:#e4f0f1;border-color:#37535e;font-size:12px}.protected{font-size:12px;color:#bfdbd6;white-space:nowrap}.protected span{color:#7bceac;font-size:9px;margin-right:6px}main{max-width:1540px;margin:auto;padding:28px 36px 35px}.intro{display:flex;justify-content:space-between;gap:24px;align-items:center;margin-bottom:23px}.eyebrow{font-size:10px;font-weight:750;letter-spacing:1.8px;color:#5c7a83;margin:0 0 5px}h2{font-weight:650;letter-spacing:-.2px}.intro h2{font-size:25px;letter-spacing:-.7px;margin:0 0 6px}.intro-copy{color:var(--muted);font-size:12px;margin:0;max-width:640px}.connection{font-size:11px;display:flex;align-items:center;gap:7px;white-space:nowrap;color:#56717a}.status-dot{width:7px;height:7px;background:#95a8ad;border-radius:50%}.connection.live .status-dot{background:#229673;box-shadow:0 0 0 4px #22967312}.connection.error .status-dot{background:#c27c37}.connection.error{color:#99672a}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.metric{background:white;border:1px solid var(--line);border-radius:10px;padding:15px 19px;box-shadow:0 2px 5px #132b3503}.metric>span{font-size:11px;color:#526c76;font-weight:600}.metric strong{display:block;font-size:29px;line-height:1.5;font-variant-numeric:tabular-nums;font-weight:650;letter-spacing:-1px}.metric small{display:block;font-size:10px;color:#84939a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.capture-panel{border:1px solid #cde2da;background:#edf7f2;border-radius:10px;padding:17px 20px;display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.capture-info{min-width:0;flex:1}.section-heading{display:flex;gap:10px;align-items:center}.section-heading h2{font-size:13px;margin:0}.badge{display:inline-block;background:#e5eef0;border:1px solid #dae4e8;padding:2px 7px;line-height:1.4;border-radius:5px;font-size:10px;font-weight:650;color:#526e7a;white-space:nowrap}.badge.good{color:#137456;background:#d9f0e3;border-color:#c9e7d6}.badge.active{color:#0c7055;background:#d8efdf;border-color:#bddcc9}.badge.warning{color:#9d6623;background:#fff2d9;border-color:#f0dfbe}.badge.danger{color:#a54c35;background:#ffede7;border-color:#f1d6cd}#capture-status{font-size:12px;margin:5px 0;color:#365c4e;overflow-wrap:anywhere}.muted{font-size:10px;color:#708a7d;margin:2px 0 0}.capture-actions{display:flex;gap:8px}.capture-actions button{font-size:11px}.progress-track{max-width:450px;background:#d1e8dc;height:4px;border-radius:3px;margin:10px 0 7px;overflow:hidden}.progress-track>div{height:100%;background:#299374;min-width:3%;width:0;transition:width .25s}.progress-track.indeterminate>div{width:28%;animation:progress 1.8s ease-in-out infinite}@keyframes progress{0%{transform:translateX(-110%)}100%{transform:translateX(450%)}}.workspace-grid{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(285px,1fr);gap:22px;align-items:start}.panel{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;box-shadow:0 2px 5px #132b3503}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:18px 19px 14px;gap:10px}.panel-header h2{font-size:14px;line-height:1.3;margin:0}.panel-header p{font-size:10px;color:#819098;margin:4px 0 0}.message-filters{display:flex;gap:8px;padding:0 19px 15px}.search{flex:1;min-width:0}.message-filters input,.message-filters select{background:#f8fafb;border:1px solid #e1e8eb;border-radius:6px;font-size:11px;padding:8px 10px;color:#46616d;height:34px}.message-filters input{width:100%}.message-filters input::placeholder{color:#93a1a8}.message-list{height:438px;min-height:220px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#cbd8de transparent;border-top:1px solid #edf1f3}.message-row{padding:15px 19px;border-bottom:1px solid #edf1f3;position:relative}.message-row:last-child{border-bottom:0}.message-top{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:5px}.message-chat{font-size:12px;font-weight:650;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0}.message-time{color:#8b9ba3;font-size:10px;white-space:nowrap}.message-body{margin:0;font-size:12px;color:#47606b;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.message-meta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:7px;font-size:9px;color:#8c9da5}.direction{background:#f0f4f6;border-radius:4px;padding:1px 5px;font-weight:600;color:#758a95}.direction.outgoing{background:#eaf5ef;color:#5c8b73}.attachment-label{color:#4f7b70}.attachment-label.warning{color:#a37737}.panel-footer{display:flex;align-items:center;gap:6px;padding:10px 19px;background:#fbfcfd;border-top:1px solid var(--line);font-size:9px;color:#83969e}.server-mark{font-size:7px;color:#7bb397}.footer-note{margin-left:auto}.side-column{display:grid;gap:18px}.chat-list{padding:0 19px 8px}.chat-row{display:flex;align-items:center;gap:10px;padding:11px 0;border-top:1px solid #edf1f3}.chat-avatar{width:31px;height:31px;display:grid;place-items:center;flex:0 0 31px;color:#3f776b;background:#e9f3ef;border:1px solid #dbeae3;border-radius:9px;font-size:10px;font-weight:700}.chat-main{min-width:0;flex:1}.chat-name{font-size:11px;font-weight:600;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chat-detail{font-size:9px;color:#94a1a8;margin-top:2px}.chat-count{font-size:10px;color:#6c8490;font-variant-numeric:tabular-nums;background:#f3f6f8;border:1px solid #e9eef1;padding:1px 6px;border-radius:5px}.health-list{margin:0 19px;padding:0 0 11px;display:grid;gap:9px}.health-list>div{display:flex;align-items:center;justify-content:space-between;gap:10px}.health-list dt{font-size:10px;color:#82939c}.health-list dd{margin:0;font-size:10px;color:#42616d;text-align:right;overflow-wrap:anywhere}.diagnostic-list{border-top:1px solid #edf1f3;max-height:172px;overflow:auto;padding:0 19px;scrollbar-width:thin}.diagnostic-row{padding:10px 0;border-bottom:1px solid #edf1f3;font-size:10px;color:#70838b}.diagnostic-row:last-child{border-bottom:0}.diagnostic-row strong{font-weight:600;color:#536b75}.diagnostic-row.warning strong{color:#a57832}.diagnostic-row.error strong{color:#b35c43}.diagnostic-row p{margin:3px 0 0;overflow-wrap:anywhere}.diagnostic-time{font-size:9px;color:#9caab1;display:block;margin-top:3px}.access-note{display:flex;gap:10px;padding:0 4px;color:#7c929c}.access-note>span{font-size:20px;line-height:1}.access-note strong{font-size:10px;color:#526e7a;font-weight:600}.access-note p{font-size:10px;line-height:1.6;margin:3px 0 7px}.access-note button{font-size:10px}.empty{padding:20px;font-size:11px;color:#8c9da5;line-height:1.7;margin:0}.chat-list>.empty,.diagnostic-list>.empty{padding:7px 0 15px}.alert{background:#fff4e6;border:1px solid #ebd6b2;border-radius:8px;color:#9e6d29;padding:10px 14px;margin-bottom:14px;font-size:12px;overflow-wrap:anywhere}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}@media(min-width:1400px){.message-list{height:530px}.metric{padding:18px 22px}}@media(max-width:1000px){.topbar{padding:0 24px}main{padding:24px}.top-actions{gap:15px}.intro h2{font-size:22px}.intro{align-items:flex-start}.connection{margin-top:19px}.capture-panel{align-items:flex-start;flex-direction:column;gap:12px}.capture-info{width:100%}.capture-actions{align-self:flex-end}.workspace-grid{gap:16px;grid-template-columns:minmax(0,1.6fr) minmax(260px,1fr)}.metrics{gap:10px}.metric{padding:12px 14px}.metric strong{font-size:26px}.metric small{font-size:9px}}@media(max-width:760px){.topbar{height:auto;min-height:76px;padding:15px 18px}.brand h1{font-size:16px}.protected{display:none}.top-actions button.secondary{font-size:10px;padding:8px 10px}main{padding:22px 18px}.intro{display:block}.intro h2{font-size:21px}.intro-copy{font-size:11px}.connection{margin-top:12px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metric strong{font-size:27px}.workspace-grid{grid-template-columns:minmax(0,1fr)}.side-column{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}.access-note{grid-column:1/-1}.message-list{height:390px}.capture-panel{padding:15px}.capture-actions{align-self:flex-start;flex-wrap:wrap}.capture-actions button{font-size:10px;padding:8px 10px}.panel-header{padding:16px}.message-row{padding:13px 16px}.message-filters{padding:0 16px 13px}.footer-note{display:none}}@media(max-width:480px){.side-column{grid-template-columns:1fr}.brand-icon{width:33px;height:33px;font-size:19px}.brand p{font-size:10px}.top-actions button.secondary{font-size:9px}.message-filters{flex-direction:column}.message-filters select{width:100%}.message-time{font-size:9px}.message-chat{font-size:11px}.message-body{font-size:11px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.integration-strip{display:flex;align-items:center;gap:28px;border:1px solid #dce7e5;border-radius:9px;background:#f9fcfb;padding:12px 17px;margin-bottom:20px}.integration-strip>div{display:flex;align-items:center;gap:10px;min-width:0}.integration-label{font-size:10px;color:#7a8f96}.integration-strip strong{font-size:11px;font-weight:600;color:#3b6661}.integration-strip>button{margin-left:auto;font-size:11px}.topbar .top-actions{gap:10px}.topbar .protected{margin-right:10px}#connections-dialog{padding:0;width:1000px;max-width:calc(100vw - 40px);max-height:calc(100vh - 40px);border:1px solid #d5e1e3;border-radius:14px;color:#213b46;background:#f4f7f8;box-shadow:0 20px 90px #08252d55;overflow:auto}#connections-dialog::backdrop{background:#0b222bb3;backdrop-filter:blur(3px)}body:has(#connections-dialog[open]){overflow:hidden}.connections-heading{display:flex;justify-content:space-between;align-items:flex-start;padding:25px 27px 18px;background:white;border-bottom:1px solid #e2eaed;gap:20px}.connections-heading h2{font-size:23px;letter-spacing:-.6px;margin:0 0 5px}.connections-heading p:not(.eyebrow){font-size:12px;color:#7a8b93;margin:0}.connections-heading>button{flex-shrink:0}.connections-note{font-size:11px;color:#758b93;margin:17px 27px 0}.connections-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:20px 27px 27px}.connection-settings-card{background:#fff;border:1px solid #dee7eb;border-radius:10px;padding:20px;min-width:0}.connection-card-heading{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;margin-bottom:18px}.connection-card-heading .eyebrow{font-size:9px;letter-spacing:1.3px;margin-bottom:5px}.connection-card-heading h3{font-size:15px;line-height:1.4;font-weight:650;letter-spacing:-.25px;margin:0}.connection-check{display:flex;align-items:flex-start;gap:8px;font-size:12px;font-weight:600;color:#375661;margin-bottom:16px;cursor:pointer}.connection-check input{margin:3px 0 0;accent-color:#147b61;flex-shrink:0}.connection-field{display:block;font-size:11px;font-weight:600;color:#45626e;margin:13px 0}.connection-field input{display:block;box-sizing:border-box;width:100%;height:39px;font-size:12px;font-weight:400;border:1px solid #d6e1e6;border-radius:7px;padding:9px 10px;color:#264550;background:#fbfcfd;margin-top:6px}.connection-field input::placeholder{color:#9aa9b0;font-size:11px}.connection-check.secondary-check{font-weight:400;color:#81929a;font-size:10px;margin:10px 0}.field-state{font-weight:400;font-size:10px;color:#6d9689;margin-left:5px}.connection-help{color:#7c8f98;font-size:11px;line-height:1.7;margin:10px 0 15px}.connection-help code{font:10px ui-monospace,monospace;color:#5e7d87}.connection-form-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:17px}.connection-form-actions button,.connection-settings-card form>button{font-size:11px;padding:9px 12px}.connection-result{font-size:11px;line-height:1.7;overflow-wrap:anywhere;border:1px solid #cce7da;background:#eef8f2;padding:10px 12px;color:#38745e;border-radius:7px;margin:13px 0 0}.connection-result.error{border-color:#ecd6c3;background:#fff6ec;color:#a27239}.connection-card-footer{border-top:1px solid #e9eef1;margin-top:19px;padding-top:13px}.connection-card-footer p{font-size:10px;line-height:1.7;color:#8c9ba2;margin:0 0 8px}.connection-card-footer button{font-size:10px}.connection-sync-details{margin:18px 0 0;border-top:1px solid #e9eef1;padding-top:13px;display:grid;gap:8px}.connection-sync-details>div{display:flex;justify-content:space-between;gap:10px;font-size:11px}.connection-sync-details dt{color:#8799a1}.connection-sync-details dd{margin:0;color:#4f6b77;text-align:right}.sync-actions{gap:7px}.sync-actions button{font-size:10px;padding:8px 10px}#connections-error{margin:16px 27px 0}@media(max-width:850px){.integration-strip{gap:15px;flex-wrap:wrap}.integration-strip>div{flex:1;white-space:nowrap}.integration-strip>button{flex-basis:100%;margin-left:0}.connections-grid{grid-template-columns:1fr}.connections-heading{padding:20px}.connections-note{margin:15px 20px 0}.connections-grid{padding:18px 20px 20px}.topbar .top-actions button{font-size:11px}}@media(max-width:600px){.topbar:has(#open-connections){height:auto;flex-wrap:wrap;gap:12px;padding-top:16px;padding-bottom:16px}.topbar .top-actions{width:100%;justify-content:flex-end}.topbar .top-actions button{font-size:10px}.integration-strip{padding:12px 14px}.integration-strip>div{flex-basis:100%}#connections-dialog{max-width:calc(100vw - 22px);max-height:calc(100vh - 22px)}.connections-heading h2{font-size:20px}.connections-grid{padding:15px}.connection-settings-card{padding:17px}}
.connection-automation{border-top:1px solid #e5ecef;margin-top:20px;padding-top:14px}.connection-automation>summary{font-size:12px;font-weight:650;color:#355c65;cursor:pointer;margin-bottom:15px}.connection-automation .connection-check{margin-bottom:13px;font-size:11px}.connection-automation form>button{font-size:11px;padding:9px 12px}
.connection-field select{display:block;box-sizing:border-box;width:100%;min-height:39px;font-size:12px;font-weight:400;border:1px solid #d6e1e6;border-radius:7px;padding:9px 10px;color:#264550;background:#fbfcfd;margin-top:6px}#connection-native-audio-controls button{font-size:11px;padding:9px 12px}#connection-audio-custom[hidden],#connection-native-audio-controls[hidden]{display:none!important}
.connection-save-status{padding:9px 11px;margin:12px 0;border:1px solid #cce7da;border-radius:7px;background:#eef8f2;color:#38745e;font-size:11px;line-height:1.6}.connection-save-status.unsaved{border-color:#ecd6c3;background:#fff6ec;color:#94662f}.connection-field .field-state{font-weight:600;color:#38745e}
.metrics{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}

#crm-integrations{margin-bottom:20px}#crm-integrations summary{cursor:pointer;font-weight:650;padding:8px 0}#crm-integrations p{font-size:12px;line-height:1.65;margin:10px 0;color:var(--muted-foreground,#a8b3cb)}#crm-integrations h3{font-size:17px;margin:8px 0 14px}#crm-integrations h4{margin:24px 0 12px}#crm-integrations .crm-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:18px 0}#crm-integrations .crm-grid>section{min-width:0;border:1px solid var(--border,#34405d);border-radius:10px;padding:20px}#crm-integrations label{display:block;font-size:12px;margin:12px 0}#crm-integrations input:not([type=checkbox]),#crm-integrations select{display:block;box-sizing:border-box;width:100%;min-height:38px;margin-top:6px;padding:8px 10px;border:1px solid var(--border,#34405d);border-radius:6px;background:var(--input,#141e34);color:var(--foreground,#edf1ff);font:inherit}#crm-integrations .crm-check{display:flex;gap:9px;align-items:center}#crm-integrations .crm-check input{accent-color:#818cf8}#crm-integrations .crm-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:end}#crm-integrations .crm-actions label{flex:1;min-width:170px}#crm-integrations button{font-size:12px;padding:8px 12px}#crm-integrations .crm-error{color:#f5a9a9}#crm-integrations li{font-size:12px;line-height:1.8;overflow-wrap:anywhere;margin:8px 0}#crm-integrations ul,#crm-integrations ol{padding-left:20px}#crm-result{overflow-wrap:anywhere}#crm-integrations .crm-help{font-size:11px}@media(max-width:850px){#crm-integrations .crm-grid{grid-template-columns:1fr}}
#crm-integrations textarea{display:block;box-sizing:border-box;width:100%;margin-top:6px;padding:10px;border:1px solid var(--border,#34405d);border-radius:6px;background:var(--input,#141e34);color:var(--foreground,#edf1ff);font:inherit;resize:vertical}#crm-integrations .crm-rule{min-width:0;margin:16px 0;padding:14px;border:1px solid var(--border,#34405d);border-radius:8px}#crm-integrations .crm-rule legend{padding:0 6px;font-weight:600}#crm-integrations [hidden]{display:none!important}#crm-uncertain-notes>div{border:1px solid #ad7635;padding:12px;border-radius:8px;margin:12px 0}#crm-uncertain-notes button{margin-right:8px}
#crm-integrations input:not([type=checkbox]),#crm-integrations select,#crm-integrations textarea{background:var(--surface-soft,#f8f9fc);color:var(--foreground,#273248);border-color:var(--border,#dfe3ed)}
#crm-integrations .crm-panel{padding:20px;border:1px solid var(--border,#dfe3ed);border-radius:12px;background:var(--card,#fff)}#crm-integrations .crm-panel-heading{display:flex;align-items:start;justify-content:space-between;gap:12px}#crm-integrations .crm-panel-heading h3{margin:0;font-size:16px}#crm-integrations .crm-panel-heading p{margin:4px 0 0}.crm-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:18px 0 12px;padding:5px;background:var(--surface-soft,#f8f9fc);border:1px solid var(--border,#dfe3ed);border-radius:8px}.crm-tabs button{background:transparent;color:var(--muted-foreground,#626e82);border:1px solid transparent;border-radius:6px}.crm-tabs button[aria-selected=true]{background:var(--card,#fff);color:var(--foreground,#273248);border-color:var(--border,#dfe3ed)}#crm-integrations .crm-tab-panel{padding-top:8px}#crm-integrations .crm-tab-panel>h4{margin:7px 0 14px}#crm-search-form input,#crm-link-form select{background:var(--card,#fff);color:var(--foreground,#273248);border-color:var(--border,#dfe3ed)}@media(max-width:560px){#crm-integrations .crm-panel{padding:15px}#crm-integrations .crm-panel-heading{align-items:stretch;flex-direction:column}.crm-tabs button{flex:1;font-size:11px;padding:7px 8px}}

#crm-integrations[data-crm-service] .crm-grid{grid-template-columns:minmax(0,1fr)}#crm-integrations[data-crm-service] .crm-grid>section{margin:0}#crm-integrations [data-crm-tab]:focus-visible{outline:2px solid var(--primary,#7565c6);outline-offset:3px}

.connection-test-log{margin:10px 0 14px;padding:9px 12px;border:1px solid var(--border,#80808060);border-radius:8px;background:var(--surface-soft,transparent);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.connection-test-log strong,.connection-test-log small{display:block}
.connection-test-log small{font-size:inherit;opacity:.8}
.connection-test-log ol{margin:6px 0 0;padding:0 0 0 20px;max-height:11rem;overflow:auto}
.connection-test-log ol:empty{display:none}
.connection-test-log li{padding:4px 0}
.connection-test-log li+li{border-top:1px solid var(--border,#80808060)}

.management-card{background:#fff;border:1px solid #e3eaed;border-radius:10px;padding:16px 20px;margin-bottom:24px}.management-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.management-heading h2{font-size:13px;margin:0}.management-heading p{font-size:11px;color:#6d838d;margin:4px 0 0}.management-auto{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#346c5d;cursor:pointer;white-space:nowrap}.management-auto input{width:17px;height:17px;accent-color:#137a61}.management-schedule{font-size:11px;color:#748b94;margin:8px 0 0}.management-card details{border-top:1px solid #edf1f3;margin-top:13px;padding-top:11px}.management-card summary{font-size:12px;font-weight:600;color:#3c6570;cursor:pointer}.management-card summary span{font-size:10px;font-weight:400;color:#82969f;margin-left:8px}.management-body{padding-top:15px}.management-tools{display:flex;align-items:end;gap:12px}.management-tools label{font-size:10px;color:#718891;display:grid;gap:5px}.management-tools input{height:35px;background:#f8fafb;border:1px solid #dfe7eb;border-radius:6px;color:#3d5d68;padding:7px 10px;font-size:11px}.management-search-label{flex:1;min-width:120px}.management-tools button{font-size:11px;min-height:35px}.management-help{font-size:10px;color:#8a9ba3;margin:11px 0}.management-list-head,.management-chat{display:grid;grid-template-columns:minmax(0,1fr) 70px 76px 78px;gap:8px;align-items:center}.management-list-head{padding:0 14px 7px;color:#8a9da5;font-size:9px}.management-list-head span:not(:first-child){text-align:center}.management-chat-list{max-height:300px;overflow:auto;overscroll-behavior:contain;border:1px solid #e4ecef;border-radius:7px;padding:0 13px;scrollbar-width:thin}.management-chat{min-height:51px;padding:8px 0;border-bottom:1px solid #edf1f3}.management-chat:last-child{border:0}.management-chat-info{min-width:0;display:grid;gap:3px}.management-chat-name{font-size:11px;color:#42616d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.management-chat-state{font-size:9px;color:#8b9da5;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.management-capture-check{display:flex;justify-content:center;align-items:center;cursor:pointer;min-height:32px}.management-capture-check input{width:16px;height:16px;accent-color:#137a61}.management-chat button{justify-self:center;max-width:100%}.management-chat .management-mark{font-size:21px;line-height:1;padding:5px 10px;min-width:37px;background:#f6f8f9;color:#a1aeb3;border-color:#e4ebee}.management-chat .management-mark.marked{color:#a47423;background:#fff7df;border-color:#eddfa9}.management-chat .management-export{font-size:10px;padding:6px 9px}.management-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:12px}.management-footer p{font-size:11px;color:#6f8992;margin:0}.management-footer p.error{color:#a35c36}.management-footer button{font-size:11px}.management-notice{font-size:11px;padding:9px 12px;background:#f4f8f9;border:1px solid #e3ecef;border-radius:6px;margin:10px 0}.management-notice.error{background:#fff5e9;border-color:#ecddc5;color:#9d6e31}.management-empty{font-size:11px;color:#8a9ca5;padding:12px 0;margin:0}@media(max-width:760px){.management-card{padding:15px 16px}.management-heading{gap:12px;align-items:flex-start}.management-auto{font-size:10px;gap:6px}.management-heading p{font-size:10px}.management-tools{flex-wrap:wrap}.management-search-label{min-width:140px}.management-tools button{font-size:10px}.management-list-head,.management-chat{grid-template-columns:minmax(0,1fr) 48px 58px 65px;gap:4px}.management-list-head{font-size:8px}.management-footer{align-items:flex-start}.management-footer p{font-size:10px}.management-card summary span{display:block;margin:4px 0 0}}@media(max-width:480px){.management-heading{display:block}.management-auto{margin-top:9px}.management-tools{align-items:stretch;display:grid;grid-template-columns:minmax(0,1fr)}.management-chat-list{padding:0 8px}.management-list-head{padding-left:9px;padding-right:9px}.management-list-head,.management-chat{grid-template-columns:minmax(0,1fr) 42px 48px 57px}.management-chat-name{font-size:10px}.management-chat-state{font-size:8px}.management-chat .management-export{font-size:9px;padding:6px}.management-footer{display:block}.management-footer button{margin-top:10px}}
.management-throttle{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:12px;font-size:11px;color:#42616d}.management-throttle label span,.management-throttle small{font-size:10px;color:#748b94}.management-throttle input{width:62px;height:32px;border:1px solid #dfe7eb;border-radius:6px;padding:5px 8px;background:#f8fafb;color:#3d5d68}.management-throttle button{font-size:10px;min-height:32px}.management-throttle small{flex-basis:100%}
.management-throttle select{min-height:32px;border:1px solid #dfe7eb;border-radius:6px;padding:5px 8px;background:#f8fafb;color:#3d5d68;font-size:11px}

.library-card{background:#fff;border:1px solid var(--line);border-radius:10px;margin-bottom:22px;overflow:hidden;box-shadow:0 2px 5px #132b3503}.library-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:19px 20px 13px}.library-heading h2{font-size:16px;margin:0}.library-heading p{font-size:11px;color:var(--muted);margin:4px 0 0}.library-heading-actions{display:flex;gap:8px}.library-heading-actions button{font-size:11px}.library-tabs{display:flex;gap:3px;padding:0 20px;border-bottom:1px solid var(--line);overflow:auto}.library-tabs button{border-radius:5px 5px 0 0;background:transparent;font-size:12px;color:#6c818a;padding:10px 13px;border-bottom:3px solid transparent}.library-tabs button[aria-selected=true]{color:#126d56;border-bottom-color:#168065;background:#f1f8f5}.library-tab-count{font-size:10px;margin-left:6px;background:#eef2f4;padding:1px 5px;border-radius:5px}.library-tools{display:flex;align-items:center;gap:12px;padding:13px 20px;background:#fbfcfc}.library-tools label{flex:1}.library-tools input{width:100%;max-width:480px;border:1px solid #dce5e8;border-radius:6px;padding:8px 10px;font-size:12px;background:#fff;color:#36525d}.library-selection{font-size:11px;color:#6a7e87}.library-notice{margin:0;padding:10px 20px;background:#edf7f2;color:#29644d;border-bottom:1px solid #d7e9df;font-size:12px;overflow-wrap:anywhere}.library-notice.error{background:#fff3e8;color:#97602b;border-bottom-color:#ecd8be}.library-workspace{display:grid;grid-template-columns:minmax(230px,1fr) minmax(280px,1.35fr)}.library-list{height:355px;overflow:auto;overscroll-behavior:contain;border-right:1px solid var(--line);scrollbar-width:thin}.library-row{display:flex;align-items:flex-start;gap:9px;padding:13px 17px;border-bottom:1px solid #edf1f3}.library-row.active{background:#f0f8f4}.library-row>input{margin:5px 0 0;accent-color:var(--green);width:15px;height:15px;flex-shrink:0}.library-row-main{flex:1;min-width:0}.library-open{display:block;width:100%;padding:0;border:0;border-radius:2px;color:#284854;background:transparent;text-align:left;white-space:normal;font-size:12px;font-weight:650;overflow-wrap:anywhere}.library-row-meta{font-size:10px;color:#81939c;display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:5px}.library-kind{font-size:9px;line-height:1.4;color:#5c7a86;background:#eff4f6;border:1px solid #e3eaee;padding:1px 5px;border-radius:4px}.library-kind.group{color:#62649a;background:#f3f0fa;border-color:#e5e0f2}.library-row-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:9px}.library-row-actions button{font-size:10px}.library-detail{height:355px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.library-detail-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:17px 20px;border-bottom:1px solid var(--line);background:#fbfcfc}.library-detail-heading h3{font-size:14px;margin:0;overflow-wrap:anywhere}.library-detail-heading p{font-size:10px;color:#83949c;margin:4px 0 0}.library-detail-heading button{font-size:10px}.library-detail .empty{padding:22px 20px}.library-stored-message{padding:12px 20px;border-bottom:1px solid #edf1f3}.library-stored-message header{display:flex;justify-content:space-between;gap:12px;font-size:10px;color:#7a909b;margin-bottom:5px}.library-stored-message header strong{font-size:11px;color:#476672}.library-stored-message p{margin:0;font-size:12px;color:#46616c;white-space:pre-wrap;overflow-wrap:anywhere}.library-stored-message .library-file{font-size:10px;color:#437967;margin-top:6px}.library-detail-links{padding:10px 20px;display:grid;gap:12px}.library-detail-links button{font-size:12px}.library-footer{padding:10px 20px;font-size:10px;color:#84949b;border-top:1px solid var(--line);background:#fbfcfc}.collection-editor{border-top:1px solid #d7e8df;border-bottom:1px solid #d7e8df;background:#f5faf7;padding:17px 20px}.collection-editor h3{font-size:14px;margin:0 0 4px}.collection-editor p{font-size:11px;color:#6e847b;margin:3px 0 12px}.collection-name-label{display:grid;gap:5px;font-size:11px;color:#3e6357;font-weight:600;max-width:500px}.collection-name-label input{border:1px solid #cadfd3;border-radius:6px;background:#fff;padding:8px 10px;color:#305346}.collection-members{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-height:180px;overflow:auto;gap:3px 20px;margin:12px 0}.collection-member{display:flex;align-items:center;gap:8px;padding:6px 0;font-size:12px;overflow-wrap:anywhere;min-width:0}.collection-member input{accent-color:var(--green);flex-shrink:0}.collection-member span{min-width:0}.collection-editor-actions{display:flex;align-items:center;gap:9px}.collection-editor-actions button{font-size:11px}.collection-editor-actions small{font-size:10px;color:#759080;margin-left:auto}.library-delete-confirm{padding:12px 20px;background:#fff6ed;border-bottom:1px solid #f1dfc9;display:flex;align-items:center;gap:10px}.library-delete-confirm p{margin:0;font-size:11px;flex:1;overflow-wrap:anywhere}.library-delete-confirm button{font-size:10px}#conversation-library [hidden]{display:none!important}@media(max-width:850px){.library-workspace{grid-template-columns:minmax(210px,1fr) minmax(250px,1.2fr)}.library-heading{align-items:flex-start}.library-heading-actions{flex-direction:column}.library-tabs{padding:0 10px}.library-tabs button{padding:9px 10px;font-size:11px}.collection-members{grid-template-columns:1fr}.library-tools{gap:8px}}@media(max-width:620px){.library-workspace{grid-template-columns:1fr}.library-list{height:260px;border-right:0;border-bottom:1px solid var(--line)}.library-detail{height:310px}.library-heading{padding:15px}.library-tabs button{font-size:10px}.library-tab-count{display:none}.library-tools{padding:10px 15px;flex-wrap:wrap}.library-delete-confirm{flex-wrap:wrap}.collection-editor-actions small{display:none}}
.library-detail-tools{display:flex;align-items:flex-start;gap:9px;flex-shrink:0}.library-category{display:grid;gap:3px;font-size:9px;color:#82969f}.library-category select{font-size:10px;color:#45626e;background:#fff;border:1px solid #dce6e9;border-radius:5px;padding:4px 5px;max-width:130px}.library-detail-tools>button{margin-top:16px}.library-unloaded{font-size:10px;color:#a27935}.library-detail-links>.library-unloaded{margin:2px 0 4px}.library-memberships{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.library-memberships:empty{display:none}.library-membership{padding:3px 7px;background:#edf5f0;border:1px solid #d7e8dc;border-radius:4px;color:#39735b;font-size:10px;text-align:left;overflow-wrap:anywhere;max-width:100%}.library-detail-heading{flex-wrap:wrap}.library-detail-heading>.library-memberships{flex-basis:100%;margin-top:0}.collection-existing{font-size:9px;color:#7b9185;white-space:nowrap}.library-tools>#collection-add-selected{font-size:11px;white-space:nowrap}@media(max-width:850px){.library-detail-tools{width:100%;justify-content:space-between}}@media(max-width:620px){.library-tools>#collection-add-selected{margin-left:auto}.library-detail-tools{flex-wrap:wrap}.library-heading-actions{flex-shrink:0}}
.library-sync-note{font-size:10px;line-height:1.6;color:#738b96;margin:2px 0 5px;padding:8px 10px;border:1px solid #e4ecef;background:#f6f9fa;border-radius:6px}
.library-enrichment{margin-top:9px;padding:9px 11px;border-left:2px solid #b9d7cc;background:#f4faf7;border-radius:0 5px 5px 0}.library-enrichment h4{margin:0 0 7px;font-size:10px;font-weight:600;color:#5a8173}.library-enrichment>strong{display:block;font-size:10px;color:#507967;margin:8px 0 3px}.library-enrichment p{font-size:11px}.library-enrichment p.library-media-warning{font-size:10px;color:#a47939;margin-top:7px}
.library-transfer-pills{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.library-transfer-pill{font-size:9px;line-height:1.5;border-radius:4px;background:#f1f4f5;color:#70838c;padding:2px 5px}.library-transfer-pill.approved{color:#34735b;background:#edf6f0}.library-transfer-pill.excluded{color:#98613c;background:#fff2e8}.library-sync-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:15px;padding:13px 20px;border-bottom:1px solid #e2eae7;background:#fff}.library-capture-control{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:600;color:#355f52;cursor:pointer}.library-capture-control input{margin:0;accent-color:#147b61;width:15px;height:15px}.library-scope-help{font-size:10px;line-height:1.6;color:#87969b;margin:7px 0 0}.library-sync-pc>button,.library-sync-spine>button{font-size:10px;padding:0;margin-top:7px;text-align:left}.library-sync-spine{border-left:1px solid #e6ede9;padding-left:15px;min-width:0}.library-scope-heading{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.library-destination{font-size:11px;font-weight:600;color:#476975}.library-scope-approval{font-size:10px;font-weight:500;color:#7d8e95}.library-scope-approval.approved{color:#31775c}.library-scope-approval.excluded{color:#9b6543}.library-scope-details{display:grid;gap:3px;font-size:10px;line-height:1.5;color:#7a8f98;margin-top:6px}.library-detail-tools{align-items:center;gap:8px}.library-detail-tools>button{margin-top:0}.library-more-options{position:relative;font-size:10px;color:#6c818b}.library-more-options>summary{padding:7px 5px;cursor:pointer;list-style:none}.library-more-options>summary::-webkit-details-marker{display:none}.library-more-options[open]>.library-category{position:absolute;right:0;top:100%;padding:12px;background:#fff;box-shadow:0 5px 20px #254d5b1a;border:1px solid #dfe9ec;border-radius:6px;z-index:2;min-width:145px}.library-more-options .library-category select{max-width:none;min-width:140px}@media(max-width:850px){.library-sync-controls{grid-template-columns:1fr;gap:10px}.library-sync-spine{border-left:0;border-top:1px solid #e6ede9;padding:10px 0 0}.library-detail-tools{width:auto;justify-content:flex-start}}@media(max-width:620px){.library-sync-controls{padding:12px 15px}.library-transfer-pill{font-size:9px}}
.library-activity{border-bottom:1px solid #e6ede9;padding:12px 20px;color:#405c67;font-size:12px}.library-activity>summary{cursor:pointer;font-weight:600}.library-activity>p{max-width:720px;color:#6c818b;line-height:1.5}.library-activity-list{display:grid;gap:8px}.library-activity-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 12px;background:#f7faf9;border:1px solid #e2ece7;border-radius:7px}.library-activity-row>div{display:grid;gap:4px;min-width:0}.library-activity-row small{color:#6c818b}.library-activity-row>button{flex-shrink:0}.library-activity-row .library-open{text-align:start;overflow-wrap:anywhere}

/* The group icon opens a floating editor without expanding the conversation list. */
.library-heading .library-heading-actions #collection-new{display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:7px;flex:0 0 36px}
.library-heading-actions #collection-new svg{display:block;pointer-events:none}
dialog#collection-editor{position:fixed;inset:auto;margin:0;box-sizing:border-box;max-width:calc(100vw - 24px);padding:20px;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--foreground);box-shadow:0 16px 48px #0003;overflow:auto}
dialog#collection-editor::backdrop{background:transparent}
dialog#collection-editor .collection-members{max-height:min(280px,35vh);overflow:auto}
dialog#collection-editor .collection-editor-actions{flex-wrap:wrap;gap:10px}
dialog#collection-editor .collection-editor-actions small{display:block;width:100%}

.library-heading .library-heading-actions #library-new-chat{display:flex;align-items:center;justify-content:center;gap:7px;height:36px;padding:0 12px;font-size:12px;border-radius:7px;white-space:nowrap}
#library-new-chat svg{flex-shrink:0}
.new-phone-chat{width:min(420px,calc(100vw - 24px));box-sizing:border-box;max-height:calc(100dvh - 24px);overflow:auto;margin:auto;padding:24px;border:1px solid var(--border);border-radius:12px;color:var(--foreground);background:var(--card);box-shadow:0 20px 60px #0004}
.new-phone-chat::backdrop{background:#10131d66}
.new-phone-chat h2{font-size:18px;margin:0 0 12px}.new-phone-chat p{font-size:13px;line-height:1.6;color:var(--muted-foreground)}
.new-phone-chat label{display:block;font-size:13px;font-weight:500;margin:20px 0 8px}.new-phone-chat input{box-sizing:border-box;width:100%;padding:12px;border:1px solid var(--border);border-radius:7px;background:var(--background);color:var(--foreground);font-size:16px}
.new-phone-chat input:focus-visible{outline:2px solid var(--primary);outline-offset:2px}.new-phone-chat-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
@media(max-width:759px){.library-heading .library-heading-actions #library-new-chat{width:36px;padding:0}.new-chat-label{display:none}}

.spine-sync-panel{margin-bottom:22px;background:#fff;border:1px solid #d8e5e1;border-radius:10px;overflow:hidden}.spine-sync-main{padding:20px}.spine-sync-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.spine-sync-heading .eyebrow{margin:0 0 3px;font-size:9px}.spine-sync-heading h2{margin:0;font-size:17px;font-weight:650}.spine-status{font-size:12px;color:#2e6f5d;background:#edf7f2;border:1px solid #d3e8dc;border-radius:6px;padding:6px 10px;white-space:nowrap}.spine-status.warning{color:#94632b;background:#fff5e9;border-color:#efddc6}.spine-status.error{color:#a14536;background:#fff0ed;border-color:#eccdc6}.spine-sync-description{color:#35535f;font-size:13px;line-height:1.7;margin:14px 0 3px;max-width:900px;overflow-wrap:anywhere}.spine-sync-scope{font-size:11px;color:#7b8e97;line-height:1.7;margin:3px 0 13px}.spine-sync-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.spine-sync-actions>button{font-size:12px}.spine-sync-actions>.text-button{margin-left:4px}.spine-sync-totals{display:flex;gap:32px;flex-wrap:wrap;border-top:1px solid #e9eef0;margin:17px 0 0;padding-top:12px}.spine-sync-totals>div{display:flex;flex-direction:column;gap:2px}.spine-sync-totals dt{font-size:10px;color:#81949d}.spine-sync-totals dd{margin:0;font-size:12px;color:#385965;font-weight:600}.spine-sync-settings{border-top:1px solid #e3ebe8;background:#fbfdfc}.spine-sync-settings>summary{padding:11px 20px;color:#587b73;font-size:11px;cursor:pointer}.spine-sync-settings-body{padding:0 20px 20px;max-width:750px}.spine-sync-settings-body form{margin-top:8px}.spine-sync-panel .connection-result{max-width:900px}.connections-grid.connections-ai-only{grid-template-columns:1fr}.spine-sync-panel [hidden]{display:none!important}@media(max-width:650px){.spine-sync-heading{align-items:flex-start;flex-direction:column;gap:9px}.spine-sync-main{padding:16px}.spine-sync-totals{gap:15px}.spine-sync-actions>button{font-size:11px}.spine-status{font-size:11px}}

.workspace-view[hidden]{display:none!important}.topbar{height:64px;padding:0 24px}.brand-icon{width:32px;height:32px;font-size:18px}.brand h1{font-size:16px}.brand p{font-size:10px}.topbar .connection{color:#bfdbd6}.topbar .connection.error{color:#f0bc8d}.topbar .top-actions{gap:20px}.workspace-tabs{display:flex;gap:7px;background:#fff;border-bottom:1px solid var(--line);padding:0 24px}.workspace-tabs button{background:none;color:#70858e;border-radius:0;padding:12px 17px 10px;font-size:12px;border-bottom:3px solid transparent}.workspace-tabs button[aria-selected=true]{border-bottom-color:#168065;color:#137456;background:#f6faf8}main{padding:16px 24px 24px}.workspace-view-heading{margin:0 0 17px}.workspace-view-heading h2{font-size:20px;margin:0 0 3px}.workspace-view-heading p{font-size:12px;color:var(--muted);margin:0}.transfer-toolbar{display:grid;grid-template-columns:1fr 1fr;background:#fff;border:1px solid var(--line);border-radius:9px;margin-bottom:14px;overflow:hidden}.transfer-toolbar>.capture-panel,.transfer-toolbar>#spine-sync-panel{border:0;border-radius:0;background:#fff;margin:0;box-shadow:none;min-width:0}.transfer-toolbar>.capture-panel{padding:14px 17px;display:flex;align-items:flex-start;flex-direction:column;gap:9px;justify-content:space-between;border-right:1px solid var(--line)}.transfer-toolbar .section-heading h2,.transfer-toolbar .spine-sync-heading h2{font-size:12px;letter-spacing:0}.transfer-toolbar #capture-status{font-size:11px;line-height:1.55;margin:7px 0 0;color:#657f88}.transfer-toolbar .capture-actions{gap:7px}.transfer-toolbar button{font-size:11px;padding:7px 10px}.transfer-toolbar .spine-sync-main{padding:14px 17px}.transfer-toolbar .spine-sync-heading{gap:9px;align-items:center;flex-wrap:wrap}.transfer-toolbar .spine-status{font-size:10px;padding:3px 7px}.transfer-toolbar .spine-sync-description{font-size:11px;line-height:1.55;margin:7px 0 9px}.transfer-toolbar .spine-sync-actions{gap:7px}.transfer-toolbar .spine-sync-actions>.text-button{font-size:10px;margin-left:0;padding:0}.transfer-toolbar .connection-result{font-size:10px;padding:5px 8px;margin-top:7px}.transfer-toolbar .progress-track{margin-bottom:0}.workspace-transfer-details{padding:13px 17px;background:#fff;border:1px solid var(--line);border-radius:9px;margin-bottom:18px}.workspace-transfer-details .spine-sync-totals{border:0;margin:0;padding:0}.workspace-transfer-details .spine-sync-scope{margin:9px 0 4px}.workspace-transfer-details .muted{color:#7b8e97}.workspace-recent-chats{font-size:11px;color:#637d87}.workspace-recent-chats>summary{cursor:pointer;padding:10px 4px}.workspace-settings-card{background:#fff;border:1px solid var(--line);border-radius:9px;margin-bottom:17px;overflow:hidden;padding:17px 20px}.workspace-settings-card>h3{font-size:14px;margin:0 0 13px}.workspace-settings-card .spine-sync-settings{border:1px solid var(--line);border-radius:7px}.workspace-settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.workspace-settings-row h3{font-size:14px;margin:0 0 4px}.workspace-settings-row p{font-size:11px;color:var(--muted);margin:0}.workspace-settings-row button,.workspace-advanced-actions button{font-size:11px}.workspace-advanced>summary{cursor:pointer;font-size:12px;color:#587780;font-weight:600}.workspace-advanced-actions{display:flex;gap:10px;flex-wrap:wrap;padding-top:15px}#workspace-conversations .library-heading p{display:none}#workspace-conversations .library-card{margin-bottom:0}#workspace-conversations .library-heading{padding:15px 17px 12px}#workspace-conversations .library-heading h2{font-size:15px}#workspace-conversations .library-list,#workspace-conversations .library-detail{height:clamp(280px,calc(100dvh - 450px),620px)}#workspace-conversations .library-footer{display:none}@media(max-width:850px){.topbar .protected{display:none}.transfer-toolbar{grid-template-columns:1fr}.transfer-toolbar>.capture-panel{border-right:0;border-bottom:1px solid var(--line);flex-direction:row;align-items:center}.transfer-toolbar .capture-info{min-width:0}.transfer-toolbar .capture-actions{flex-shrink:0}.transfer-toolbar .spine-sync-main{padding:12px 17px}.transfer-toolbar .spine-sync-description{margin:6px 0 8px}#workspace-conversations .library-list,#workspace-conversations .library-detail{height:350px}}@media(max-width:620px){.topbar{padding:12px 15px;height:auto}.topbar .top-actions{margin:0;width:auto}.topbar .connection{max-width:150px;white-space:normal;font-size:10px}.workspace-tabs{padding:0 10px}.workspace-tabs button{padding:11px 13px 9px}main{padding:12px 12px 20px}.transfer-toolbar>.capture-panel{align-items:flex-start;flex-direction:column;gap:10px}.workspace-settings-row{align-items:flex-start;flex-direction:column}.workspace-settings-card{padding:15px}.workspace-transfer-details .spine-sync-totals{gap:15px}.workspace-transfer-details .spine-sync-totals>div{min-width:125px}#workspace-conversations .library-list{height:260px}#workspace-conversations .library-detail{height:330px}}
.settings-tabs button[data-settings-service=ai]{--settings-service:#8657cb}.settings-tabs button[data-settings-service=spine]{--settings-service:#287e79}.settings-tabs button[data-settings-service=hubspot]{--settings-service:#d06a36}.settings-tabs button[data-settings-service]{color:var(--settings-service);border-color:color-mix(in srgb,var(--settings-service) 35%,var(--border))}.settings-tabs button[data-settings-service][aria-selected=true]{background:color-mix(in srgb,var(--settings-service) 12%,var(--card));border-color:var(--settings-service)}.settings-integration-hub{margin-bottom:18px;padding:20px;border:1px solid var(--border);border-radius:12px;background:var(--card)}.settings-integration-hub>div:first-child h3{margin:0;font-size:16px}.settings-integration-hub>div:first-child p{margin:4px 0 18px;color:var(--muted-foreground);font-size:12px}.settings-service-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.settings-service-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:10px;padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-soft)}.settings-service-card>span{display:grid;place-items:center;width:29px;height:29px;border-radius:9px;background:var(--accent);color:var(--primary);font-size:15px}.settings-service-card h4{margin:1px 0 3px;font-size:13px}.settings-service-card p{margin:0;color:var(--muted-foreground);font-size:11px;line-height:1.55}.settings-service-card button{grid-column:1/-1;justify-self:start;font-size:11px;padding:6px 9px}.settings-service-card.service-spine>span{background:#dcefe9;color:#287e79}.settings-service-card.service-hubspot>span{background:#fff0e6;color:#c45d2b}@media(max-width:850px){.settings-service-cards{grid-template-columns:1fr}}
.connection-section-heading h4,.connection-automation>h4,.workspace-advanced>h3{margin:0 0 14px;font-size:14px;color:var(--foreground)}.connection-automation{margin-top:22px;padding-top:18px;border-top:1px solid var(--border)}
.settings-service-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.settings-service-card{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr auto auto;gap:16px;padding:22px;background:var(--card);border-radius:14px;min-height:248px;box-sizing:border-box}.settings-service-card>.settings-service-icon{width:42px;height:42px;border-radius:12px;font-size:23px;background:color-mix(in srgb,var(--service-color,#8657cb) 12%,var(--card));color:var(--service-color,#8657cb)}.settings-service-card>.settings-service-kind{display:block;width:auto;height:auto;padding:5px 8px;border-radius:6px;background:var(--surface-soft);color:var(--muted-foreground);font-size:10px;line-height:1.4;text-align:end}.settings-service-copy{grid-column:1/-1}.settings-service-card h4{margin:0 0 8px;font-size:13px;letter-spacing:.65px}.settings-service-card p{font-size:12px;line-height:1.65}.settings-service-card .settings-service-status{grid-column:1/-1;font-size:11px;font-weight:600;color:var(--service-color,var(--muted-foreground));padding-top:12px;border-top:1px solid var(--border)}.settings-service-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.settings-service-card button{min-height:34px;font-size:11px;padding:8px 10px}.settings-service-card button:focus-visible{outline:2px solid var(--primary);outline-offset:3px}.service-ai{--service-color:#8657cb}.service-spine{--service-color:#287e79}.service-whatsapp{--service-color:#278755}.service-hubspot{--service-color:#c45d2b}.service-webhooks{--service-color:#467fbd}.settings-tabs button[data-settings-service=whatsapp]{--settings-service:#278755}.settings-tabs button[data-settings-service=webhooks]{--settings-service:#467fbd}.settings-service-card.service-request{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border:1px dashed color-mix(in srgb,var(--muted-foreground) 45%,var(--border));background:var(--surface-soft);box-shadow:none}.service-request h4{letter-spacing:0;font-size:15px}.settings-service-card.service-request>.settings-service-icon{background:var(--card);color:var(--muted-foreground);border:1px dashed var(--border)}.settings-service-card>.settings-request-note{display:block;width:auto;height:auto;background:none;color:var(--muted-foreground);font-size:10px}.workspace-connection-options{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}#settings-ai-panel .workspace-settings-row>div,#settings-whatsapp-panel .workspace-settings-row>div{min-width:0}#settings-ai-panel .workspace-settings-row>button{flex-shrink:0}#settings-ai-panel .workspace-settings-row p,#settings-whatsapp-panel .workspace-settings-row p{line-height:1.7}.settings-service-card.service-spine>.settings-service-icon,.settings-service-card.service-hubspot>.settings-service-icon{background:color-mix(in srgb,var(--service-color) 12%,var(--card));color:var(--service-color)}html[data-theme=night] .settings-service-card{--service-color:#bda6eb}html[data-theme=night] .service-spine,html[data-theme=night] .service-whatsapp{--service-color:#7fc9ab}html[data-theme=night] .service-hubspot{--service-color:#f0ad80}html[data-theme=night] .service-webhooks{--service-color:#91b9ee}@media(max-width:1150px){.settings-service-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.settings-service-cards{grid-template-columns:1fr}.settings-service-card{min-height:225px;padding:18px}.settings-integration-hub{padding:16px}#settings-ai-panel .workspace-settings-row,#settings-whatsapp-panel .workspace-settings-row{flex-wrap:wrap;gap:14px}}
html[data-theme=night] .settings-tabs button[data-settings-service=ai]{--settings-service:#bda6eb}html[data-theme=night] .settings-tabs button[data-settings-service=spine],html[data-theme=night] .settings-tabs button[data-settings-service=whatsapp]{--settings-service:#7fc9ab}html[data-theme=night] .settings-tabs button[data-settings-service=hubspot]{--settings-service:#f0ad80}html[data-theme=night] .settings-tabs button[data-settings-service=webhooks]{--settings-service:#91b9ee}.settings-service-card.service-spine>.settings-service-kind,.settings-service-card.service-hubspot>.settings-service-kind{background:var(--surface-soft);color:var(--muted-foreground)}
#settings-ai-panel #ai-connection-form{max-width:620px;padding-top:4px}#settings-ai-panel .connection-card-heading{max-width:620px;margin:24px 0 10px;align-items:center}#settings-ai-panel .connection-card-heading .eyebrow{margin:0;color:var(--muted-foreground)}#settings-ai-panel .connection-save-status{max-width:620px;box-sizing:border-box}#settings-ai-panel #settings-brain-state{margin-bottom:4px}#settings-ai-panel #ai-connection-summary{margin-top:0}#settings-ai-panel .connection-field input{font-size:13px;height:42px}#settings-ai-panel .connection-check.secondary-check{font-size:11px;line-height:1.6}#settings-ai-panel .connection-form-actions button{font-size:12px;padding:10px 14px}

.spine-request-log{border:1px solid var(--line);border-radius:9px;background:#fff;margin-bottom:17px;overflow:hidden}.spine-request-log>summary{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 17px;font-size:13px;font-weight:650;color:#365762;cursor:pointer}.spine-request-log>summary::before{content:'▸';font-size:11px;color:#739087}.spine-request-log[open]>summary::before{content:'▾'}.spine-request-log>summary>span:first-child{margin-right:auto}.spine-log-summary{font-size:10px;font-weight:400;color:#799099}.spine-log-body{border-top:1px solid #e4ecef;padding:13px 17px 15px}.spine-log-help,.spine-log-status,.spine-log-privacy,.spine-log-file{font-size:11px;line-height:1.6;color:#758b95;margin:0 0 12px}.spine-log-help{max-width:850px}.spine-log-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}.spine-log-toolbar label{display:flex;align-items:center;gap:8px;font-size:11px;color:#66818c;margin-right:auto}.spine-log-toolbar select{font-size:11px;color:#3f616b;border:1px solid #d7e3e6;border-radius:6px;background:#fff;padding:7px 9px}.spine-log-toolbar button{font-size:11px;padding:7px 10px}.spine-log-status{font-size:10px;margin-bottom:8px}.spine-log-status.error{color:#a26734}.spine-log-result{font-size:11px;line-height:1.6;border:1px solid #d6e8dd;background:#f1f8f4;color:#3c755e;border-radius:6px;padding:8px 10px;margin:0 0 10px;overflow-wrap:anywhere}.spine-log-result.error{color:#a26734;border-color:#ebd9c8;background:#fff7ef}.spine-log-list{border:1px solid #e2eaee;border-radius:7px;max-height:550px;overflow:auto;overscroll-behavior:contain}.spine-log-entry{border-bottom:1px solid #e8eef1}.spine-log-entry:last-child{border-bottom:0}.spine-log-entry>summary{display:grid;grid-template-columns:116px minmax(170px,1fr) minmax(115px,auto) 65px;gap:12px;align-items:start;padding:11px 12px;cursor:pointer;list-style:none}.spine-log-entry>summary::-webkit-details-marker{display:none}.spine-log-entry>summary:hover{background:#f6faf8}.spine-log-entry[open]>summary{background:#f5f9f7}.spine-log-time,.spine-log-duration{font-size:10px;line-height:1.6;color:#7d929d;white-space:nowrap}.spine-log-action{min-width:0}.spine-log-action strong{display:block;font-size:11px;font-weight:600;color:#365561;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spine-log-action>span{display:block;font-size:10px;color:#7c919a;margin-top:3px}.spine-log-action strong::before{content:'▸';font-size:9px;color:#83a096;margin-right:6px}.spine-log-entry[open] .spine-log-action strong::before{content:'▾'}.spine-log-outcome{justify-self:start;border:1px solid #dbe7e1;border-radius:4px;background:#f1f8f4;font-size:10px;color:#48775f;padding:2px 5px;line-height:1.5}.spine-log-outcome.pending{color:#648196;background:#f2f6fa;border-color:#dce6ee}.spine-log-entry.error .spine-log-outcome{color:#a16a35;background:#fff5ec;border-color:#efddcd}.spine-log-duration{text-align:right}.spine-log-entry-body{padding:0 14px 14px;border-top:1px solid #e5ecef}.spine-log-fields{margin:10px 0 13px;display:grid;grid-template-columns:1fr 1fr;gap:8px 20px}.spine-log-fields>div{display:grid;grid-template-columns:125px minmax(0,1fr);gap:10px;font-size:10px;line-height:1.6}.spine-log-fields dt{color:#81949e}.spine-log-fields dd{margin:0;color:#456572;overflow-wrap:anywhere}.spine-log-fields>div:nth-child(2){grid-column:1/-1}.spine-log-json{margin-top:11px}.spine-log-json h4{font-size:11px;color:#4e6d76;margin:0 0 6px;font-weight:600}.spine-log-json pre{font:10px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;color:#496571;background:#f5f8fa;border:1px solid #e2eaee;border-radius:6px;padding:10px 12px;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;max-height:300px;overflow:auto}.spine-log-entry-error{font-size:11px;line-height:1.6;color:#a16a35;overflow-wrap:anywhere;margin:10px 0}.spine-log-empty{font-size:11px;color:#82949d;padding:16px;margin:0}.spine-log-privacy{font-size:10px;margin:10px 0 0}.spine-log-file{font-size:10px;overflow-wrap:anywhere;margin:3px 0 0}#spine-request-log [hidden]{display:none!important}@media(max-width:850px){.spine-log-entry>summary{grid-template-columns:100px minmax(140px,1fr) 130px;gap:8px}.spine-log-duration{display:none}.spine-log-fields{grid-template-columns:1fr}.spine-log-fields>div:nth-child(2){grid-column:auto}.spine-log-time{white-space:normal}}@media(max-width:620px){.spine-request-log>summary{padding:12px 14px;flex-wrap:wrap;gap:5px}.spine-log-summary{flex-basis:100%;padding-left:15px}.spine-log-body{padding:12px}.spine-log-entry>summary{grid-template-columns:minmax(0,1fr) auto}.spine-log-time{grid-column:1/-1;font-size:9px}.spine-log-outcome{font-size:9px}.spine-log-fields>div{grid-template-columns:90px minmax(0,1fr)}.spine-log-toolbar label{flex-basis:100%}}

/* Digital Spine's dark palette, shared here by the local archive workspace. */
:root {
  color-scheme: dark;
  --background: oklch(0.16 0.02 265);
  --foreground: oklch(0.97 0.01 250);
  --card: oklch(0.20 0.025 265);
  --primary: oklch(0.65 0.20 275);
  --primary-glow: oklch(0.78 0.18 280);
  --secondary: oklch(0.26 0.03 265);
  --muted: oklch(0.24 0.025 265);
  --muted-foreground: oklch(0.70 0.03 260);
  --accent: oklch(0.30 0.05 270);
  --border: oklch(0.28 0.03 265);
  --sidebar: oklch(0.13 0.02 265);
  --radius: 12px;
  --line: var(--border);
  --green: var(--primary);
  --dark: var(--sidebar);
  --surface-soft: oklch(0.18 0.025 265);
  --success-text: #9ae2c1;
  --success-bg: #132e27;
  --success-line: #295044;
  --warning-text: #f4c38b;
  --warning-bg: #30271d;
  --warning-line: #59432c;
  --danger-text: #ffb1b8;
  --danger-bg: #34202a;
  --danger-line: #673545;
  color: var(--foreground);
  background: var(--background);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

body { background: var(--background); color: var(--foreground); }
::selection { background: var(--accent); color: var(--foreground); }
* { scrollbar-color: #39405a transparent; }
button { transition: background .15s, border-color .15s, color .15s; }
button:hover:not(:disabled) { filter: none; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary-glow); outline-offset: 3px;
}
button.primary {
  background: var(--primary); color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px #090b1420;
}
button.primary:hover:not(:disabled) { background: #8180ff; }
button.secondary, button.quiet, .top-actions button.secondary {
  background: var(--secondary); color: var(--foreground); border-color: var(--line);
}
button.secondary:hover:not(:disabled), button.quiet:hover:not(:disabled) {
  background: var(--accent); border-color: #535075;
}
button.stop { color: var(--danger-text); background: var(--danger-bg); border-color: var(--danger-line); }
button.text-button, .library-row-actions button, .library-detail-links button {
  color: #c1bcff; background: transparent;
}
button.text-button:hover:not(:disabled), .library-row-actions button:hover:not(:disabled) { color: #e3dfff; }
input, select, textarea,
.message-filters input, .message-filters select,
.management-tools input, .management-throttle input, .management-throttle select,
.library-tools input, .library-category select, .collection-name-label input,
.connection-field input, .connection-field select, .spine-log-toolbar select {
  color: var(--foreground); background: var(--surface-soft); border-color: var(--line);
  accent-color: var(--primary);
}
input::placeholder, textarea::placeholder, .connection-field input::placeholder,
.message-filters input::placeholder { color: #8991a8; }
select option { background: #151a29; color: var(--foreground); }
input[type="checkbox"], .management-auto input, .management-capture-check input,
.library-capture-control input, .connection-check input { accent-color: var(--primary); }

.topbar {
  height: 82px; padding-inline: 24px;
  background: linear-gradient(110deg, #151126, #0e1320 58%, #0b101a);
  border-bottom: 1px solid var(--line);
}
.brand { gap: 17px; min-width: 0; }
.brand-logo { display: block; width: 118px; height: 53px; object-fit: contain; flex-shrink: 0; }
.brand-copy { border-left: 1px solid #353146; padding-left: 17px; }
.brand h1 { color: var(--foreground); font-size: 16px; letter-spacing: -.3px; }
.brand p { color: var(--muted-foreground); font-size: 10px; }
.topbar .protected, .topbar .connection { color: #b8bfd4; }
.protected span, .connection.live .status-dot, .server-mark { color: #7bd8b5; }
.connection.live .status-dot { background: #7bd8b5; box-shadow: 0 0 0 4px #7bd8b511; }
.connection.error, .topbar .connection.error { color: var(--warning-text); }
.connection.error .status-dot { background: #edb77c; }
.workspace-tabs { background: var(--sidebar); border-color: var(--line); }
.workspace-tabs button { color: var(--muted-foreground); }
.workspace-tabs button:hover:not(:disabled) { color: var(--foreground); background: #17182a; }
.workspace-tabs button[aria-selected=true] {
  color: #c4c0ff; border-bottom-color: var(--primary); background: #1d1c35;
}
/* Dashboard width is independent of the fixed native capture viewport. */
main { max-width: none; width: 100%; }
.eyebrow { color: #a1a9bf; }
.workspace-view-heading p, .workspace-settings-row p, .library-heading p,
.intro-copy, .muted { color: var(--muted-foreground); }

/* Main surfaces and their inset layers. */
.metric, .panel, .management-card, .library-card, .spine-sync-panel,
.workspace-transfer-details, .workspace-settings-card, .spine-request-log,
.connection-settings-card, .transfer-toolbar,
.transfer-toolbar>.capture-panel, .transfer-toolbar>#spine-sync-panel,
.library-sync-controls {
  color: var(--foreground); background: var(--card); border-color: var(--line);
  box-shadow: none;
}
.metric, .panel, .management-card, .library-card, .workspace-settings-card,
.spine-request-log, .transfer-toolbar { border-radius: var(--radius); }
.capture-panel { background: #1c2037; border-color: #393757; }
.library-tools, .library-detail-heading, .library-footer, .panel-footer,
.spine-sync-settings, .connections-heading, .library-activity-row,
.library-more-options[open]>.library-category, .spine-log-json pre,
.library-sync-note, .library-enrichment, .integration-strip {
  background: var(--surface-soft); border-color: var(--line);
}
.library-activity-row { background: #151b2a; }
.library-more-options[open]>.library-category { box-shadow: 0 8px 24px #0006; }
.collection-editor { background: #191b30; border-color: #38334f; }
.library-row.active { background: #24223d; }
.library-row:not(.active):hover { background: #171e2c; }
.library-stored-message, .library-row, .library-activity,
.library-sync-controls, .library-sync-spine, .message-row, .message-list,
.chat-row, .diagnostic-list, .diagnostic-row, .management-card details,
.management-chat, .management-chat-list, .spine-sync-totals,
.connection-card-footer, .connection-sync-details, .connection-automation,
.spine-log-body, .spine-log-list, .spine-log-entry, .spine-log-entry-body {
  border-color: var(--line);
}
.transfer-toolbar>.capture-panel { border-right-color: var(--line); }
.library-list, .library-detail, .message-list, .diagnostic-list,
.management-chat-list { scrollbar-color: #39405a transparent; }

/* Copy, metadata, and labels retain a consistent readable contrast. */
.metric>span, .metric small, .panel-header p, .message-time, .message-meta,
.chat-detail, .chat-count, .health-list dt, .diagnostic-row, .diagnostic-time,
.access-note, .access-note p, .empty, .footer-note, .panel-footer,
.message-body, .message-meta, .message-filters select,
.management-heading p, .management-schedule, .management-help,
.management-card summary span, .management-list-head, .management-chat-state,
.management-footer p, .management-empty, .management-throttle,
.management-throttle label span, .management-throttle small,
.library-selection, .library-row-meta, .library-detail-heading p,
.library-footer, .library-category, .library-scope-help, .library-scope-details,
.library-scope-approval, .library-more-options, .library-activity>p,
.library-activity-row small, .collection-editor p, .collection-editor-actions small,
.collection-existing, .connection-help, .connection-card-footer p,
.connection-sync-details dt, .connections-note, .connections-heading p:not(.eyebrow),
.connection-check.secondary-check, .spine-sync-description, .spine-sync-scope,
.spine-sync-totals dt, .workspace-transfer-details .muted,
.spine-log-summary, .spine-log-help, .spine-log-status, .spine-log-privacy,
.spine-log-file, .spine-log-time, .spine-log-duration, .spine-log-action>span,
.spine-log-fields dt, .spine-log-empty, .spine-log-toolbar label,
.transfer-toolbar #capture-status { color: var(--muted-foreground); }
.metric strong, .library-open, .library-stored-message p,
.library-stored-message header strong, .management-chat-name,
.management-auto, .management-card summary, .connection-check,
.connection-field, .collection-name-label, .library-capture-control,
.library-destination, .library-activity, .spine-request-log>summary,
.spine-log-action strong, .spine-log-fields dd, .spine-log-json h4,
.spine-log-json pre, .health-list dd, .diagnostic-row strong,
.access-note strong, .connection-sync-details dd, .spine-sync-totals dd,
.connection-automation>summary, .workspace-advanced>summary,
.spine-sync-settings>summary, #capture-status { color: #dce1ef; }
.library-open:hover:not(:disabled) { color: #c4c0ff; }
.library-stored-message header { color: var(--muted-foreground); }
.library-stored-message .library-file, .attachment-label,
.library-enrichment h4, .library-enrichment>strong,
.connection-field .field-state, .field-state { color: #a9bded; }
.connection-help code { color: #c3bfff; }
.library-enrichment { border-left-color: #6b63b4; }
.integration-label, .integration-strip strong { color: var(--muted-foreground); }

/* Small badges are muted by default, with distinct semantic states. */
.badge, .direction, .library-kind, .library-tab-count, .chat-count,
.library-transfer-pill, .spine-log-outcome.pending {
  color: #bdc6dc; background: #252e43; border-color: #36415a;
}
.chat-avatar { color: #c6bfff; background: #29233e; border-color: #45385b; }
.library-kind.group, .badge.active, .direction.outgoing, .library-membership {
  color: #cbc5ff; background: #29233f; border-color: #443b63;
}
.library-tabs button { color: var(--muted-foreground); }
.library-tabs button:hover:not(:disabled) { color: var(--foreground); }
.library-tabs button[aria-selected=true] {
  color: #cbc5ff; border-bottom-color: var(--primary); background: #26213b;
}
.library-notice, .connection-result, .connection-save-status,
.spine-log-result, .badge.good, .spine-status, .spine-log-outcome,
.library-transfer-pill.approved, .library-scope-approval.approved {
  color: var(--success-text); background: var(--success-bg); border-color: var(--success-line);
}
.library-scope-approval.approved { background: transparent; }
.badge.warning, .spine-status.warning, .library-notice.error,
.connection-result.error, .connection-save-status.unsaved,
.management-notice.error, .spine-log-result.error,
.spine-log-entry.error .spine-log-outcome, .alert,
.library-transfer-pill.excluded, .library-delete-confirm {
  color: var(--warning-text); background: var(--warning-bg); border-color: var(--warning-line);
}
.badge.danger, .spine-status.error { color: var(--danger-text); background: var(--danger-bg); border-color: var(--danger-line); }
.library-scope-approval.excluded, .library-unloaded, .library-media-warning,
.library-enrichment p.library-media-warning, .diagnostic-row.warning strong,
.attachment-label.warning, .spine-log-entry-error, .spine-log-status.error,
.management-footer p.error { color: var(--warning-text); }
.diagnostic-row.error strong { color: var(--danger-text); }
.management-notice { background: var(--muted); border-color: var(--line); color: var(--foreground); }
.management-chat .management-mark { color: #acb3c7; background: var(--secondary); border-color: var(--line); }
.management-chat .management-mark.marked { color: #f4d28b; background: #3a3020; border-color: #62502f; }
.progress-track { background: #2c2947; }
.progress-track>div { background: linear-gradient(90deg, var(--primary), var(--primary-glow)); }
.spine-log-entry>summary:hover, .spine-log-entry[open]>summary { background: #202239; }
.spine-log-action strong::before, .spine-request-log>summary::before { color: #a89fe4; }

#connections-dialog { background: var(--background); color: var(--foreground); border-color: var(--line); box-shadow: 0 24px 90px #0008; }
#connections-dialog::backdrop { background: #060811c9; }
.connections-heading { border-bottom-color: var(--line); }
.connection-settings-card { background: var(--card); border-color: var(--line); }

@media(max-width:760px) {
  .topbar { min-height:82px; height:auto; padding-block:12px; }
  .brand { gap:12px; }
  .brand-logo { width:100px; height:45px; }
  .brand-copy { padding-left:12px; }
  .brand h1 { font-size:14px; }
}
@media(max-width:480px) {
  .brand-logo { width:82px; height:37px; }
  .brand-copy { border-left:0; padding-left:0; }
  .brand h1 { font-size:13px; }
  .brand p { font-size:9px; }
  .topbar .connection { max-width:110px; }
}

.outbox-panel{padding:16px;margin-bottom:16px}.outbox-panel summary{cursor:pointer;font-weight:650}.outbox-panel p{font-size:13px;line-height:1.5}.outbox-panel form{display:grid;gap:12px}.outbox-panel label{display:grid;gap:5px;font-size:13px}.outbox-panel input,.outbox-panel select,.outbox-panel textarea{width:100%;box-sizing:border-box;background:#101827;color:#e5e7eb;border:1px solid #334155;border-radius:6px;padding:9px;font:inherit}.outbox-fields{display:grid;grid-template-columns:1fr 2fr 1fr;gap:12px}.outbox-job{border-top:1px solid #334155;padding:12px 0}.outbox-job p{white-space:pre-wrap;overflow-wrap:anywhere;margin:5px 0}.outbox-job button{margin-right:8px}@media(max-width:750px){.outbox-fields{grid-template-columns:1fr}}

.library-heading-actions{flex-direction:row;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.library-context-menu{position:fixed;z-index:1000;width:220px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box;padding:6px;background:var(--card);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 40px #0006}
.library-context-menu[hidden]{display:none}.library-context-menu button{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:0;border-radius:6px;padding:8px 12px;font-size:13px;background:#fff;color:#202638;transition:background-color .15s ease,color .15s ease}
.library-context-menu{width:250px}
.library-menu-icon{width:20px;flex:0 0 20px;text-align:center;font-size:16px;line-height:1}
.library-menu-label{flex:1}.library-menu-arrow{margin-left:auto;font-size:18px}
.library-chat-badge{font-size:12px;flex:none;margin-left:5px;color:var(--primary)}
.library-context-menu button:hover:not(:disabled),.library-context-menu button:focus-visible{background:var(--primary);color:#fff}.library-context-menu button:disabled{opacity:.4;cursor:default}
.library-chat-menu-button{margin-left:auto;flex-shrink:0;font-size:21px;line-height:1;padding:3px 8px;min-width:30px;background:transparent;color:var(--muted-foreground);border:1px solid transparent}
.library-chat-menu-button:hover,.library-chat-menu-button[aria-expanded=true]{background:var(--accent);border-color:var(--border)}
.library-view-switch{display:flex;gap:3px;padding:4px;border:1px solid var(--border);border-radius:10px;background:var(--secondary)}
.library-view-switch button{font-size:12px;padding:8px 13px;border:1px solid transparent;background:transparent;color:var(--muted-foreground);white-space:nowrap}
.library-view-switch button[aria-pressed=true]{background:var(--accent);color:var(--foreground);border-color:var(--primary)}
.library-avatar{--chat-color:#7b83ff;display:inline-grid;place-items:center;flex-shrink:0;width:35px;height:35px;border-radius:10px;background:color-mix(in srgb,var(--chat-color) 20%,var(--card));color:var(--chat-color);font-size:19px;margin-right:9px;vertical-align:middle}
#library-workspace[data-layout=grid],#library-workspace[data-layout=table]{grid-template-columns:minmax(0,1fr)}
#library-workspace[data-layout=grid]>.library-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:14px;padding:18px;background:var(--sidebar);height:auto;max-height:650px;border-right:0;align-content:start}
#library-workspace[data-layout=grid] .library-row{position:relative;min-height:225px;align-items:stretch;border:1px solid var(--border);border-radius:12px;background:var(--card);padding:18px;gap:10px}
#library-workspace[data-layout=grid] .library-row.active{border-color:var(--primary);background:var(--accent)}
#library-workspace[data-layout=grid] .library-open{display:flex;gap:12px;align-items:center;font-size:14px;min-height:44px;line-height:1.5;padding-right:16px}
#library-workspace[data-layout=grid] .library-avatar{width:40px;height:40px;margin:0;font-size:22px;border-radius:50%}
#library-workspace[data-layout=grid] .library-row>input{position:absolute;right:12px;top:12px;margin:0}
#library-workspace[data-layout=grid] .library-row-main{width:100%}
#library-workspace[data-layout=grid] .library-row-meta{margin-top:9px;line-height:1.6}
#library-workspace[data-layout=grid] .library-row-actions{border-top:1px solid var(--border);padding-top:10px}
#library-workspace[data-layout=table]>.library-list{height:auto;max-height:650px;border-right:0;overflow:auto}
.library-table{border-collapse:collapse;width:100%;min-width:820px;font-size:11px;line-height:1.5;background:var(--card)}
.library-table thead{position:sticky;top:0;z-index:1;background:var(--secondary)}
.library-table th{text-align:left;color:var(--muted-foreground);font-size:10px;font-weight:600;padding:11px 10px;white-space:nowrap}
.library-table td{padding:8px 10px;border-bottom:1px solid var(--border);color:var(--muted-foreground);vertical-align:middle}
.library-table tr.active{background:var(--accent)}
.library-table tbody tr:hover{background:var(--secondary)}
.library-table .library-open{display:flex;align-items:center;min-width:180px;max-width:310px;line-height:1.5;font-size:12px}
.library-table .library-avatar{width:26px;height:26px;font-size:15px;border-radius:7px}
.library-table .library-row-actions,.library-table .library-memberships,.library-table .library-transfer-pills{margin:0}
.library-table input[type=checkbox]{width:15px;height:15px;accent-color:var(--primary)}
.library-table .library-transfer-pills{min-width:125px}
.library-table .library-memberships{min-width:95px}
.library-table .library-row-actions{min-width:170px}
.library-table .library-col-activity,.library-table .library-col-threads,.library-table .library-col-count{width:74px;text-align:center;white-space:nowrap}.library-table-count{display:inline-grid;place-items:center;min-width:24px;padding:2px 6px;border-radius:5px;background:transparent;color:var(--foreground);font-variant-numeric:tabular-nums}
#library-workspace[data-layout=grid]>.library-detail,#library-workspace[data-layout=table]>.library-detail{height:480px;border-top:1px solid var(--border)}
#library-workspace[data-layout=sidebar]{grid-template-columns:minmax(270px,.85fr) minmax(380px,1.6fr)}
#library-workspace[data-layout=sidebar]>.library-list,#library-workspace[data-layout=sidebar]>.library-detail{height:580px}
#library-workspace[data-layout=sidebar] .library-close-preview{display:none}
#library-workspace[data-layout=sidebar] .library-open{display:flex;align-items:center}
.library-close-preview{margin-left:auto;font-size:10px}
.library-thread-sync{grid-column:1/-1;margin:0;padding:10px 12px;color:var(--muted-foreground);font-size:12px}
.library-thread-goal{font-size:13px;line-height:1.6;overflow-wrap:anywhere;margin:10px 0}
.library-thread-card .library-row-main{width:100%}
.library-thread-card .library-open{font-size:16px}
.library-tools select{max-width:180px;min-height:36px;padding:7px 10px;border:1px solid var(--border);border-radius:7px;background:var(--card);color:var(--foreground);font:inherit;font-size:12px}
.library-crm-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.library-crm-chips:empty,.library-follow-up:empty{display:none}
.library-crm-tag,.library-work-status{max-width:100%;overflow-wrap:anywhere;font-size:11px;line-height:1.5;padding:3px 8px;border-radius:6px;background:var(--secondary);color:var(--muted-foreground)}
.library-work-status{background:color-mix(in srgb,#46b98a 15%,var(--card));color:#50bf92}
.library-work-status[data-status="Needs me"]{background:color-mix(in srgb,#e5ad53 15%,var(--card));color:#d59b40}
.library-work-status[data-status="Waiting"]{background:color-mix(in srgb,#8297ee 15%,var(--card));color:#8297ee}
.library-note-preview{font-size:12px;line-height:1.7;color:var(--muted-foreground);margin:12px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.library-follow-up{display:grid;gap:4px;margin-top:12px;padding-top:10px;border-top:1px solid var(--border);font-size:11px;line-height:1.5;color:var(--muted-foreground);overflow-wrap:anywhere}
.library-follow-up strong{font-size:12px;font-weight:500;color:var(--foreground)}
.library-follow-up.due>span{color:#d59b40}
.library-table .library-crm-chips,.library-table .library-follow-up{margin:0;min-width:120px}
.library-table .library-follow-up{border:0;padding:0}
#library-workspace[data-layout=grid] .library-thread-card .library-open{min-height:0}
@media(max-width:620px){.library-tabs{flex-wrap:wrap}}
@media(max-width:850px){.library-heading{flex-wrap:wrap}.library-heading-actions{width:100%;justify-content:flex-start}.library-view-switch{margin-right:auto}#library-workspace[data-layout=sidebar]{grid-template-columns:minmax(230px,.8fr) minmax(300px,1.4fr)}}
@media(max-width:620px){.library-view-switch{width:100%;margin:0}.library-view-switch button{flex:1}#library-workspace[data-layout=grid]>.library-list{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));padding:12px;gap:10px}#library-workspace[data-layout=sidebar]{grid-template-columns:1fr}#library-workspace[data-layout=sidebar]>.library-list{height:260px}#library-workspace[data-layout=sidebar]>.library-detail{height:400px}}
.library-avatar{overflow:hidden;flex-shrink:0}
.library-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.library-stored-message>header .library-message-portrait{width:24px;height:24px;margin:0;border-radius:50%}
.library-detail-heading>.library-detail-title{flex:1;min-width:0}
.library-detail-heading>.library-avatar{width:36px;height:36px;border-radius:50%;margin:0}
.focus-pinned-title{display:flex;align-items:center;gap:10px}
.focus-pinned-title .library-avatar{width:32px;height:32px;border-radius:50%}
/* WhatsApp display labels are hints until a saved contact supplies a name. */
.library-inferred-name{color:#a96618!important}
.library-inferred-label{font-size:10px;font-weight:500;color:inherit}
@media(prefers-color-scheme:dark){.library-inferred-name{color:#f3bd74!important}}

#conversation-kanban, .kanban-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.kanban-content { gap: 14px; }
.kanban-toolbar, .kanban-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.kanban-toolbar { flex: none; justify-content: space-between; padding: 2px 0 0; }
.kanban-identity { min-width: 0; max-width: 100%; }
#conversation-kanban select, .kanban-dialog select, .kanban-dialog input:not([type="checkbox"]) {
  min-width: 0;
  min-height: 35px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
}
.kanban-identity select { max-width: min(300px, 100%); font-weight: 650; }
.kanban-empty {
  display: grid;
  justify-items: start;
  gap: 9px;
  padding: clamp(20px, 5vw, 44px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.kanban-empty h2, .kanban-empty p { margin: 0; }
.kanban-status { margin: 0 0 10px; color: var(--muted-foreground); font-size: 12px; }
.kanban-status + button { align-self: start; margin-block-end: 10px; }
.kanban-error { color: var(--destructive, #b34d4d); }
.kanban-error:empty { display: none; }
.kanban-lanes {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 12px;
  padding: 2px 1px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  align-items: stretch;
  scrollbar-width: thin;
}
.kanban-lane {
  flex: 1 0 250px;
  min-width: 0;
  overflow-y: auto;
  scroll-padding-block-start: 58px;
  overscroll-behavior-block: contain;
  scrollbar-width: thin;
  border: 1px solid var(--border);
  border-block-start: 3px solid var(--lane-color);
  border-radius: 11px;
  background: var(--secondary);
}
.kanban-lane.kanban-drop-target { border-color: var(--lane-color); background: color-mix(in srgb, var(--lane-color) 12%, var(--secondary)); }
.kanban-lane-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  background: var(--secondary);
  border-block-end: 1px solid var(--border);
}
.kanban-lane-header h3 { flex: 1; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.kanban-lane-color { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--lane-color); }
.kanban-count { padding: 1px 7px; border-radius: 10px; color: var(--muted-foreground); background: var(--card); font-size: 11px; }
.kanban-lane-cards { display: grid; gap: 8px; padding: 10px; }
.kanban-more { justify-self: center; }
.kanban-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  cursor: grab;
}
.kanban-card.kanban-dragging { opacity: .45; cursor: grabbing; }
.kanban-card .kanban-card-title, .kanban-picker-results .kanban-picker-item {
  color: var(--foreground);
  background: transparent;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
}
.kanban-card .kanban-card-title { justify-self: start; padding: 0; border: 0; border-radius: 3px; font-size: 13px; }
.kanban-card-title:hover { text-decoration: underline; }
.kanban-card-detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
}
.kanban-card-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kanban-kind { color: var(--muted-foreground); font-size: 11px; }
#conversation-kanban .kanban-card-move { max-width: 70%; min-height: 29px; margin-inline-start: auto; padding: 3px 6px; font-size: 11px; cursor: pointer; }
.kanban-item-time { display: block; color: var(--muted-foreground); font-size: 11px; font-weight: 400; }
.kanban-content[aria-busy="true"] .kanban-card-move { pointer-events: none; opacity: .65; }
.kanban-dialog {
  width: min(550px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--foreground);
  background: var(--card);
  box-shadow: 0 18px 66px #0004;
}
.kanban-dialog::backdrop { background: #0007; }
.kanban-dialog h2 { margin: 0 0 15px; font-size: 20px; }
.kanban-dialog h3 { margin: 2px 0 0; font-size: 14px; }
.kanban-form, .kanban-column-fields { display: grid; gap: 10px; }
.kanban-form > label, .kanban-picker-filters > label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.kanban-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin: 0;
  padding: 8px 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.kanban-types legend, .kanban-check { font-size: 12px; }
.kanban-check { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.kanban-check input { accent-color: var(--primary); }
.kanban-column-field { display: grid; grid-template-columns: minmax(0, 1fr) 42px repeat(3, 31px); gap: 6px; }
.kanban-dialog .kanban-column-color { width: 100%; padding: 4px 5px; cursor: pointer; }
.kanban-column-field button { padding: 3px; }
.kanban-form > button { justify-self: start; }
.kanban-hint, .kanban-dialog .kanban-error { margin: 0; font-size: 12px; }
.kanban-hint { color: var(--muted-foreground); }
.kanban-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-block-start: 8px; }
.kanban-dialog-actions .kanban-delete { margin-inline-end: auto; color: var(--destructive, #b34d4d); }
.kanban-picker-filters { display: flex; flex-wrap: wrap; gap: 7px; align-items: end; margin-block-end: 12px; }
.kanban-picker-filters input { flex: 1 1 160px; }
.kanban-picker-filters select { max-width: 175px; }
.kanban-picker-results { display: grid; gap: 4px; padding: 4px; max-height: min(370px, 45dvh); overflow-y: auto; }
.kanban-picker-results .kanban-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  font-size: 12px;
}
.kanban-picker-item:hover { background: var(--secondary); }
@media (max-width: 600px) {
  .kanban-lane { flex-basis: 210px; }
  .kanban-actions button { font-size: 12px; padding-inline: 8px; }
  .kanban-dialog { padding: 14px; }
}

.media-policy{font-size:12px;color:var(--muted-foreground);line-height:1.6;max-width:920px}.media-toolbar{display:flex;align-items:end;gap:12px;margin:18px 0}.media-toolbar label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:var(--muted-foreground)}.media-toolbar label:first-child{flex:1}.media-toolbar input,.media-toolbar select{min-height:38px;width:100%;background:var(--card);border:1px solid var(--line);border-radius:6px;padding:8px 10px;color:var(--foreground)}.media-toolbar select{min-width:130px}.media-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:14px;align-items:start}.media-card{background:var(--card);border:1px solid var(--line);border-radius:9px;padding:17px;overflow-wrap:anywhere;min-width:0}.media-card header{display:flex;align-items:start;justify-content:space-between;gap:12px}.media-card h3{font-size:14px;margin:0;line-height:1.5}.media-kind-badge{background:var(--accent);color:var(--primary-glow);border-radius:12px;padding:3px 8px;font-size:10px;text-transform:uppercase;flex-shrink:0}.media-metadata,.media-file-status{font-size:11px;line-height:1.6;color:var(--muted-foreground)}.media-caption,.media-notes p{white-space:pre-wrap;line-height:1.7;font-size:13px;margin:7px 0}.media-notes{border-top:1px solid var(--line);padding-top:10px;margin-top:12px}.media-notes h4{font-size:11px;color:var(--primary-glow);margin:0}.media-notes p{max-height:300px;overflow:auto}.media-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.media-error{color:var(--warning-text);font-size:12px;line-height:1.6}.media-pagination{display:flex;justify-content:center;align-items:center;gap:18px;margin:20px 0;font-size:12px}#media-status{font-size:12px;min-height:20px;color:var(--muted-foreground)}#media-status.media-error{color:var(--warning-text)}.media-empty{color:var(--muted-foreground);padding:36px;text-align:center}.media-actions button:disabled{opacity:.55;cursor:default}@media(max-width:650px){.media-toolbar{flex-wrap:wrap}.media-toolbar label:first-child{flex-basis:100%}.media-card{padding:13px}}
.media-results{grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr))}.media-card{padding:0 0 14px;overflow:hidden;cursor:pointer}.media-card>header,.media-card>.media-metadata,.media-card>.media-card-excerpt,.media-card>.media-file-status{margin:12px 15px 0}.media-card-title{display:block;padding:0;background:none;border:0;text-align:start;color:var(--foreground);font-weight:600;font-size:13px;overflow-wrap:anywhere}.media-card-title:focus-visible{outline:2px solid var(--primary);outline-offset:3px}.media-card-excerpt{font-size:12px;line-height:1.65;color:var(--muted-foreground);white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.media-preview{height:190px;background:var(--background);display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.media-original{display:block;max-width:100%;width:100%;height:100%;object-fit:contain}.media-sticker-preview img{padding:20px}.media-preview-fallback{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;color:var(--muted-foreground);font-size:12px;padding:16px;text-align:center}.media-file-icon{font-size:40px;color:var(--primary)}.media-audio-preview{flex-direction:column;gap:8px;padding:12px}.media-audio-preview .media-preview-fallback{padding:0}.media-audio-preview audio{width:100%;height:40px}.media-detail-dialog{box-sizing:border-box;width:min(1040px,calc(100vw - 24px));max-height:calc(100dvh - 24px);margin:auto;padding:0 24px 24px;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--foreground);overflow:auto;box-shadow:0 20px 60px #0005}.media-detail-dialog::backdrop{background:#10131d99}.media-detail-heading{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:18px;background:var(--card);padding:18px 0}.media-detail-heading h2{font-size:18px;overflow-wrap:anywhere;margin:0}.media-detail-heading>button{font-size:24px;flex-shrink:0}.media-detail-status{font-size:12px;color:var(--muted-foreground);margin:0 0 12px}.media-detail-status:empty{display:none}.media-detail-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}.media-detail-visual,.media-detail-information{min-width:0}.media-preview-full{height:auto;min-height:180px;border-radius:8px}.media-preview-full .media-original{max-height:65vh;object-fit:contain}.media-preview-full.media-audio-preview{min-height:180px}.media-notes header{display:flex;align-items:center;justify-content:space-between;gap:12px}.media-notes h3{font-size:13px;margin:0;color:var(--primary)}.media-detail-information .media-notes p{max-height:none;overflow:visible;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text;cursor:text}.media-detail-information .media-caption{user-select:text;-webkit-user-select:text}.media-detail-dialog .media-actions{gap:8px}.media-detail-dialog .media-actions button{font-size:12px}.media-detail-dialog .media-metadata{margin-top:0}@media(max-width:700px){.media-detail-body{grid-template-columns:minmax(0,1fr)}.media-detail-dialog{padding:0 16px 18px}.media-preview-full .media-original{max-height:45vh}}
.media-preview-placeholder,.media-skeleton-line{background:linear-gradient(100deg,var(--secondary) 25%,color-mix(in srgb,var(--card) 45%,white) 45%,var(--secondary) 65%);background-size:220% 100%;animation:media-skeleton-shimmer 1.35s ease-in-out infinite}.media-preview-placeholder{position:absolute;inset:0;z-index:1;pointer-events:none}.media-card-skeleton{pointer-events:none}.media-card-skeleton .media-preview-placeholder{position:relative;inset:auto;height:190px}.media-skeleton-line{height:11px;margin:14px 15px 0;border-radius:5px}.media-skeleton-title{width:58%;height:14px}.media-skeleton-short{width:36%}@keyframes media-skeleton-shimmer{from{background-position:100% 0}to{background-position:-120% 0}}@media(prefers-reduced-motion:reduce){.media-preview-placeholder,.media-skeleton-line{animation:none}}

.library-detail.library-chat-open{display:flex;flex-direction:column;padding:0;overflow:hidden;min-height:560px}
.library-chat-open>.library-detail-heading{flex:0 0 auto;padding:18px 20px 10px;margin:0;gap:10px}
.library-chat-open .library-detail-heading>div:first-child{min-width:0;flex:1}
.library-chat-open .library-detail-heading h3{font-size:16px;overflow-wrap:anywhere}
.library-chat-open>.chat-context-strip{flex:0 0 auto}
.chat-context-strip{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 20px;border-bottom:1px solid var(--border);background:var(--card)}
.chat-context-chips{display:contents}
.chat-context-chip{border:1px solid var(--border);border-radius:18px;background:var(--secondary);color:var(--foreground);font-size:12px;padding:6px 10px;max-width:100%;overflow-wrap:anywhere;text-align:left}
.chat-reminder-due{color:var(--primary);border-color:var(--primary)}
.chat-add-menu{position:relative;color:var(--foreground);font-size:12px}
.chat-add-menu>summary{list-style:none;border:1px dashed var(--border);border-radius:18px;padding:6px 12px;cursor:pointer;color:var(--primary)}
.chat-add-options{position:absolute;z-index:5;top:calc(100% + 6px);left:0;width:170px;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:6px;box-shadow:0 8px 24px #0004}
.chat-add-options>button{display:block;text-align:left;width:100%;font-size:13px;padding:10px}
.library-chat-history{overflow:auto;flex:1 1 auto;min-height:130px;padding:20px;background:var(--background);scrollbar-width:thin;overscroll-behavior:contain}
.library-chat-history .library-stored-message{max-width:88%;background:var(--card);border:1px solid var(--border);border-radius:12px;padding:12px 16px;margin:0 auto 14px 0;font-size:14px;overflow-wrap:anywhere}
.library-chat-history .library-stored-message.from-me{margin-left:auto;margin-right:0;background:var(--accent)}
.library-chat-history .library-stored-message>p{font-size:14px;line-height:1.6;white-space:pre-wrap}
.library-chat-history .library-stored-message>header{gap:12px;flex-wrap:wrap}
.chat-composer{flex:0 0 auto;padding:14px 20px 10px;background:var(--card);border-top:1px solid var(--border);min-width:0}
.chat-reply-form{padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--background)}
.chat-reply-form textarea,.chat-ai-panel textarea{display:block;box-sizing:border-box;width:100%;font:inherit;font-size:14px;line-height:1.6;color:var(--foreground);background:transparent;border:0;resize:vertical;min-height:64px;max-height:180px;padding:3px}
.chat-reply-actions,.chat-ai-top,.chat-ai-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.chat-reply-actions{margin-top:8px}.chat-reply-actions button{font-size:13px}
.chat-ai-button{background:var(--accent);color:var(--primary);border:1px solid var(--border);padding:9px 12px}
.chat-reply-feedback{font-size:12px;line-height:1.5;color:var(--muted-foreground);margin:8px 0 0;overflow-wrap:anywhere}
.chat-reply-feedback:empty{display:none}
.chat-ai-panel{border:1px solid var(--border);background:var(--secondary);border-radius:10px;padding:12px;margin-bottom:12px;max-height:280px;overflow:auto}
.chat-ai-panel[hidden]{display:none}.chat-ai-top{font-size:13px}.chat-ai-controls{justify-content:flex-start;margin:10px 0}
.chat-composer>.chat-ai-panel{max-height:min(420px,45dvh)}
.chat-ai-panel .chat-editor-field{margin:10px 0}
.chat-ai-panel input{box-sizing:border-box;width:100%;min-width:0;padding:8px;border:1px solid var(--border);border-radius:6px;background:var(--card);color:var(--foreground);font:inherit}
.chat-ai-identity{font-size:12px;color:var(--muted-foreground)}
.chat-ai-identity summary{cursor:pointer}
.chat-ai-intents{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.chat-ai-intent{padding:5px 10px;border:1px solid var(--border);border-radius:20px;background:transparent;color:var(--muted-foreground);font:inherit;font-size:12px}
.chat-ai-intent:hover,.chat-ai-intent[aria-pressed=true]{background:var(--accent);border-color:var(--primary);color:var(--foreground)}
.chat-ai-prompt-row{display:flex;align-items:center;gap:8px;margin:10px 0}
.chat-ai-prompt-row input{flex:1;min-width:0;font-size:12px}.chat-ai-prompt-row button{flex:none;white-space:nowrap;font-size:12px;padding:8px 10px}
.chat-ai-panel .chat-ai-identity{margin-top:10px;font-size:11px}
.chat-ai-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.chat-ai-option{text-align:start;white-space:normal;overflow-wrap:anywhere;padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--foreground);font:inherit;font-size:13px}
.chat-ai-option:hover{background:var(--accent);border-color:var(--primary)}
.chat-send-status{font-size:11px;color:var(--muted-foreground);margin:6px 0 0}
.library-chat-history .chat-message-pending{border:1px dashed var(--primary);opacity:.8}
.chat-message-pending .chat-send-status{color:var(--primary);font-weight:600}
.library-chat-history .library-stored-message.chat-message-failed{border:1px solid var(--danger-text,#fca5a5);opacity:1}
.chat-send-error{margin-top:10px;padding:10px 12px;border-top:1px solid var(--danger-text,#fca5a5);border-radius:6px;background:color-mix(in srgb,var(--danger-text,#fca5a5) 10%,var(--card));color:var(--danger-text,#fca5a5);font-size:12px;line-height:1.5}
.chat-send-error-title{display:block;font-size:12px}.chat-send-error p{margin:5px 0!important;font-size:12px!important}.chat-send-error small{display:block;font-size:11px}
.chat-composer .chat-reply-error{color:var(--danger-text,#fca5a5);padding:8px 10px;border-left:3px solid var(--danger-text,#fca5a5);background:color-mix(in srgb,var(--danger-text,#fca5a5) 8%,var(--card))}
.chat-ai-controls select{max-width:100%;background:var(--card);color:var(--foreground);padding:7px;border:1px solid var(--border);border-radius:6px}
.chat-context-dialog{box-sizing:border-box;width:min(480px,calc(100vw - 32px));max-height:calc(100vh - 48px);overflow:auto;background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:14px;padding:24px}
.chat-context-dialog::backdrop{background:#0007}.chat-context-dialog h2{font-size:20px;margin:0}.chat-editor-subtitle{font-size:12px;color:var(--muted-foreground);line-height:1.6;overflow-wrap:anywhere}
.chat-editor-field{display:grid;gap:7px;font-size:13px;margin:18px 0}.chat-context-dialog input,.chat-context-dialog textarea,.chat-context-dialog select{box-sizing:border-box;width:100%;font:inherit;background:var(--background);color:var(--foreground);border:1px solid var(--border);border-radius:8px;padding:10px;min-width:0}
.chat-context-dialog .reminder-time-fields{display:grid;gap:12px;padding:14px;background:var(--secondary);border:1px solid var(--border);border-radius:10px}.chat-context-dialog .reminder-time-fields .chat-editor-field{margin:0}.chat-context-dialog .reminder-presets{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.chat-context-dialog .reminder-presets-label{font-size:11px;color:var(--muted-foreground);margin-right:2px}.chat-context-dialog .reminder-preset{font-size:11px;padding:6px 9px}
.chat-note-row textarea{resize:vertical;min-height:110px}
.chat-context-dialog input[type=color]{height:48px;padding:5px;cursor:pointer}
.chat-color-palette,.chat-icon-gallery{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.chat-color-palette button{border-width:3px;font-size:12px}.chat-icon-gallery button{min-width:48px;min-height:44px;font-size:20px}
.chat-icon-gallery button[aria-pressed=true]{border-color:var(--primary);background:var(--accent)}
.chat-editor-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:20px}.chat-action-error{color:var(--destructive);font-size:13px;line-height:1.5}
.chat-action-error{color:var(--danger-text)}.chat-action-error:empty{display:none}.chat-due-reminders{padding:12px 20px;border-bottom:1px solid var(--border);font-size:13px;background:var(--accent)}.chat-due-reminders>button{display:block;text-align:left;overflow-wrap:anywhere;margin-top:8px}
.library-chat-options{width:100%;font-size:12px}.library-chat-options>summary{cursor:pointer;color:var(--muted-foreground);padding:6px 0}.library-chat-options-body{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding-top:10px}
.library-chat-options-body>.library-sync-controls,.library-chat-options-body>.library-conversation-context{width:100%}
.chat-composer{padding:10px 14px}
.library-chat-history .library-stored-message{width:fit-content;min-width:140px;max-width:85%;padding:9px 12px;margin-bottom:8px}
.library-chat-history .library-stored-message>header{font-size:10px;gap:24px}
.chat-reply-form{display:flex;align-items:flex-end;gap:10px;padding:6px 8px 6px 12px;border-radius:24px}
.chat-reply-form textarea{flex:1;min-width:0;min-height:36px;max-height:140px;resize:none;padding:6px 0;line-height:24px}
.chat-reply-actions{flex:none;flex-wrap:nowrap;margin:0;gap:6px}
.chat-reply-actions button{min-height:36px;padding:8px 12px;border-radius:20px}
.chat-ai-button{font-size:13px;background:var(--accent);border-color:var(--border)}
.library-chat-options{width:auto;margin-left:auto}
.library-chat-options[open]{width:100%}
.library-chat-options>summary{list-style:none;padding:6px 10px;border-radius:6px}
.library-chat-options>summary:hover{background:var(--accent)}
.library-chat-open>.library-detail-heading{align-items:center;padding:12px 16px}
.chat-context-strip{padding:6px 16px;gap:6px}
.chat-context-chip,.chat-add-menu>summary{padding:4px 8px;font-size:11px}
.library-chat-options-body>.chat-context-strip{width:100%;padding:0 0 10px}
@media(max-width:620px){.chat-composer{padding:12px}.chat-context-strip{padding:10px 12px}.library-chat-history{padding:12px}.library-chat-history .library-stored-message{max-width:95%}.chat-add-options{position:static;margin-top:6px}.chat-context-dialog{padding:18px}.chat-context-strip:has(.chat-add-menu[open]) .chat-add-menu{width:100%}.library-chat-open>.library-detail-heading{padding:14px 12px 8px}}

.chat-status-menu{position:fixed;z-index:1100;width:204px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box;padding:6px;background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 40px #0006}
.chat-status-menu button{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;text-align:left;border:0;background:transparent;color:var(--foreground);font-size:13px;border-radius:6px}
.chat-status-menu button>span:first-child{width:18px;text-align:center;flex:none}
.chat-status-menu button:hover,.chat-status-menu button:focus-visible,.chat-status-menu button[aria-checked=true]{background:var(--accent)}
.chat-status-menu button[aria-checked=true]::after{content:'✓';margin-left:auto;color:var(--primary)}
.chat-status-error{font-size:12px;padding:4px 8px;color:var(--danger);overflow-wrap:anywhere}

/* Notes keep their own visual identity alongside the conversation. */
.chat-notes-dialog{width:min(620px,calc(100vw - 24px));padding:0;overflow:hidden;box-shadow:0 24px 90px #0006}
.chat-notes-dialog>form{display:flex;flex-direction:column;max-height:calc(100dvh - 48px);padding:24px 24px 0}
.chat-notes-dialog .chat-editor-subtitle{margin:5px 0 0}
.chat-notes-help{font-size:12px;line-height:1.6;color:var(--muted-foreground);margin:14px 0 0}
.chat-notes-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 0 12px;flex:none}
.chat-notes-count{font-size:12px;font-weight:600;color:var(--muted-foreground)}
.chat-notes-toolbar button{font-size:12px;padding:7px 11px}
.chat-note-list{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px 3px 2px 0;display:grid;gap:12px}
.chat-note-row{min-width:0;padding:14px;background:var(--background);border:1px solid var(--border);border-radius:10px}
.chat-note-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.chat-note-scope{font-size:11px;font-weight:600;color:var(--warning-text);letter-spacing:.2px}
.chat-note-row .chat-note-remove{font-size:11px;padding:4px 6px;color:var(--muted-foreground)}
.chat-note-remove:hover{color:var(--danger-text)}
.chat-notes-dialog .chat-note-row textarea{display:block;background:var(--card);font-size:14px;line-height:1.65;padding:12px;text-align:start}
.chat-notes-dialog textarea:focus-visible{outline:2px solid var(--primary-glow);outline-offset:2px}
.chat-note-length{display:block;font-size:10px;color:var(--muted-foreground);text-align:right;margin-top:8px;font-variant-numeric:tabular-nums}
.chat-note-removed{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted-foreground)}
.chat-note-removed button{font-size:12px;padding:5px 10px;color:var(--primary-glow)}
.chat-note-row[data-removed] .chat-note-inline-source{display:none}
.chat-notes-empty{font-size:13px;color:var(--muted-foreground);padding:18px;border:1px dashed var(--border);border-radius:8px;line-height:1.6}
.chat-note-source{margin:16px 0 0;padding:10px 12px;border:0;border-left:3px solid var(--primary);border-radius:4px;background:var(--secondary);flex-shrink:0;overflow-wrap:anywhere}
.chat-note-source strong{display:block;font-size:11px;color:var(--muted-foreground);font-weight:500}
.chat-note-source p,.chat-note-inline-source{font-size:12px;line-height:1.6;white-space:pre-wrap;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;text-align:start}
.chat-note-source p{margin:5px 0 0}.chat-note-inline-source{margin:0 0 10px}
.chat-notes-dialog .chat-editor-actions{position:relative;flex:none;padding:16px 0;margin-top:16px;border-top:1px solid var(--border);align-items:center}
.chat-notes-dialog .chat-editor-actions::before{content:'Ctrl / ⌘ + Enter to save';margin-right:auto;color:var(--muted-foreground);font-size:10px}
.chat-notes-dialog .chat-action-error{flex:none;margin-bottom:0}
.library-detail-heading .library-notes-toggle{color:var(--warning-text);border:1px solid var(--border);border-radius:8px;background:var(--background);white-space:nowrap}
.library-message-note{padding:2px 5px;min-width:24px;background:transparent;border:0;color:var(--muted-foreground);font-size:14px;border-radius:5px}
.library-message-note:hover,.library-message-note:focus-visible{color:var(--warning-text);background:var(--secondary)}
.chat-message-notes{display:flex;flex-direction:column;gap:4px;width:100%;text-align:start;margin-top:10px;padding:9px 10px;border:0;border-left:2px solid var(--warning-text);border-radius:4px;background:color-mix(in srgb,var(--warning-text) 7%,var(--card));font-weight:400}
.chat-message-notes-label{font-size:10px;font-weight:600;color:var(--warning-text)}
.chat-message-note-text{font-size:12px;color:var(--foreground);line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.chat-message-notes:hover{background:var(--secondary)}
@media(max-width:620px){.chat-notes-dialog>form{padding:18px 16px 0}.chat-note-row{padding:11px}.chat-notes-dialog .chat-editor-actions::before{content:'Ctrl / ⌘ + Enter'}.chat-notes-help{margin-top:10px}}

/* One subtle focus boundary for the composer, with visible keyboard focus. */
.chat-reply-form:focus-within{border-color:color-mix(in srgb,var(--primary) 60%,var(--border));box-shadow:0 0 0 1px color-mix(in srgb,var(--primary) 20%,transparent)}
.chat-reply-form textarea:focus,.chat-reply-form textarea:focus-visible{outline:none;box-shadow:none}
.chat-composer{container-type:inline-size}
.chat-schedule-panel{display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin-bottom:10px;padding:12px;background:var(--background);border:1px solid var(--border);border-radius:10px}
.chat-schedule-panel[hidden]{display:none}
.chat-schedule-panel .chat-editor-field{flex:1;min-width:180px;margin:0}
.chat-schedule-panel input{width:100%;font:inherit;padding:8px 10px;background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:7px;color-scheme:dark}
.chat-schedule-help{flex-basis:100%;font-size:12px;color:var(--muted-foreground);margin:0;line-height:1.5}
.chat-schedule-button[aria-expanded=true]{background:var(--accent);color:var(--primary);border-color:var(--primary)}
@container (max-width:540px){.chat-reply-form{flex-wrap:wrap;border-radius:14px}.chat-reply-form textarea{flex-basis:100%}.chat-reply-actions{width:100%;justify-content:flex-end;flex-wrap:wrap}.chat-reply-actions button{padding:7px 10px}}

.library-chat-history,.library-message-text,.library-message-sender,.library-enrichment p,.library-conversation-context{user-select:text;-webkit-user-select:text;cursor:text}
.library-chat-history::selection,.library-chat-history ::selection{background:var(--primary);color:var(--background)}
.chat-selection-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;flex-shrink:0;padding:5px 12px;border-bottom:1px solid var(--border)}
.chat-selection-tools button{font-size:11px;padding:5px 8px}.chat-selection-feedback{font-size:11px;color:var(--muted-foreground)}
.library-chat-history:focus-visible{outline:1px solid var(--primary);outline-offset:-1px}

.library-chat-history button{user-select:none;-webkit-user-select:none;cursor:pointer}

#workspace-focus{min-width:0}
#workspace-focus .managed-card{cursor:default}
#workspace-focus .managed-card-text{cursor:text;user-select:text}
@media(hover:hover) and (pointer:fine){
  #workspace-focus .managed-card-open>svg{opacity:0}
  #workspace-focus .managed-card:hover .managed-card-open>svg,
  #workspace-focus .managed-card:focus-within .managed-card-open>svg{opacity:1}
}
.focus-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.focus-heading h2{margin:0}
.focus-heading-actions{display:flex;align-items:center;gap:8px}
.focus-heading #focus-widgets{font-size:12px;min-height:36px}
.focus-widgets{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:28px;align-items:start}
.focus-section{min-width:0}
.focus-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px}
.focus-section-heading h3{font-size:15px;margin:0;font-weight:600}
.focus-section-heading>span{font-size:12px;color:var(--muted-foreground);white-space:nowrap}
.focus-thread-card{display:block;width:100%;text-align:start;background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:11px;padding:18px;margin:0 0 12px}
.focus-thread-card:focus-visible,.focus-message-open:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.focus-thread-card h4{font-size:14px;line-height:1.5;font-weight:600;overflow-wrap:anywhere;margin:0 0 13px}
.focus-thread-goal{font-size:13px;line-height:1.6;font-weight:400;color:var(--muted-foreground);margin:0 0 18px;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.focus-thread-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;font-weight:400;color:var(--muted-foreground)}
.focus-thread-state{padding:3px 7px;border-radius:5px;background:var(--accent);color:var(--primary-glow)}
.focus-thread-state[data-status=paused]{background:var(--secondary);color:var(--muted-foreground)}
.focus-thread-state[data-status=failed]{background:var(--warning-bg);color:var(--warning-text)}
.focus-ai-card{display:block;width:100%;text-align:start;background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:11px;padding:18px;margin:0 0 12px}
.focus-ai-card h4{font-size:14px;line-height:1.5;font-weight:600;overflow-wrap:anywhere;margin:0 0 9px}
.focus-ai-card p{font-size:13px;line-height:1.6;color:var(--muted-foreground);margin:0;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.focus-ai-meta{display:block;font-size:11px;color:var(--muted-foreground);margin:13px 0 0}
.focus-message-card{position:relative;min-width:0;background:var(--card);border:1px solid var(--border);border-radius:11px;padding:18px;margin:0 0 12px}
.focus-message-open{display:block;width:100%;padding:18px 32px 18px 0;border:0;border-radius:0;background:transparent;color:var(--foreground);text-align:left;cursor:pointer}
.focus-message-card:first-child .focus-message-open{padding-top:2px}
.focus-message-open:hover .focus-message-body{color:var(--primary-glow)}
.focus-message-sender{font-size:12px;font-weight:600;display:block;overflow-wrap:anywhere}
.focus-message-body{font-size:13px;font-weight:400;line-height:1.6;margin:9px 0;color:var(--foreground);white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.focus-message-source{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:11px;font-weight:400;color:var(--muted-foreground)}
.focus-message-source>span:first-child{overflow-wrap:anywhere;min-width:0}
.focus-message-remove{position:absolute;right:0;top:13px;border:0;border-radius:6px;background:transparent;color:var(--primary-glow);padding:4px 7px;cursor:pointer;font-size:15px}
.focus-message-card:first-child .focus-message-remove{top:0}
.focus-message-remove:hover{background:var(--accent)}
.focus-empty{margin:0;padding:18px 0;color:var(--muted-foreground);font-size:13px;line-height:1.7}
.focus-cache-note{font-size:11px;line-height:1.6;color:var(--muted-foreground);margin:12px 0 0}
.focus-status{font-size:12px;line-height:1.6;margin:0 0 18px;padding:10px 12px;border:1px solid var(--warning-line);border-radius:7px;background:var(--warning-bg);color:var(--warning-text);overflow-wrap:anywhere}
.focus-status[hidden]{display:none}
#focus-browse{margin-top:15px;font-size:12px;padding:5px 0;color:var(--primary-glow)}
@media(max-width:900px){.focus-widgets{gap:20px}}
@media(max-width:700px){.focus-widgets{grid-template-columns:minmax(0,1fr);gap:28px}.focus-thread-card{padding:16px}.focus-message-remove{padding:9px;top:10px}.focus-message-open{padding-right:44px}}
#focus-pinned{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.focus-pinned-card{min-width:0;position:relative}
.focus-pinned-card .focus-thread-card{height:100%;margin:0;padding-bottom:42px}
.focus-pinned-card .focus-thread-goal{margin:0}
.focus-pinned-card>.text-button{position:absolute;bottom:10px;right:14px;font-size:12px}
.focus-widget-dialog{width:min(520px,calc(100vw - 32px));padding:0;border:1px solid var(--border);border-radius:14px;background:var(--card);color:var(--foreground);box-shadow:0 24px 70px #0005}
.focus-widget-dialog::backdrop{background:#0007}
.focus-widget-dialog>div{padding:20px}
.focus-widget-dialog h2{font-size:18px;margin:0 0 5px}
.focus-widget-dialog p{font-size:12px;line-height:1.6;color:var(--muted-foreground);margin:0 0 16px}
.focus-widget-options{display:grid;gap:8px}
.focus-widget-option{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:11px 0;border-top:1px solid var(--border)}
.focus-widget-option label{display:grid;gap:2px;cursor:pointer}
.focus-widget-option strong{font-size:13px}.focus-widget-option small{font-size:11px;color:var(--muted-foreground)}
.focus-widget-option button{min-width:32px;padding:5px 8px}.focus-widget-actions{display:flex;justify-content:flex-end;margin-top:18px}

/* Focus workspace: one viewport, with navigation and content scrolling separately. */
:root{--background:#10131d;--card:#171b28;--sidebar:#141824;--secondary:#202638;--accent:#2e2b50;--border:#2b3245;--line:var(--border);--foreground:#ebedf5;--muted-foreground:#a0abc1;--primary:#b4a7ff;--surface-soft:#171b28}
html,body{height:100%;overflow:hidden}
body{display:grid;grid-template-columns:174px minmax(0,1fr);grid-template-rows:62px minmax(0,1fr);height:100dvh;font-size:14px}
body>.topbar{grid-area:1/1/2/3;height:62px;padding:0 24px;background:var(--card);border-bottom:1px solid var(--border);gap:14px}
.topbar .brand-logo{width:76px;height:36px;object-fit:contain}.brand h1{font-size:15px;font-weight:500}.brand p{display:none}.topbar .protected{display:none}.topbar .connection{font-size:11px;color:var(--muted-foreground);max-width:340px;overflow:hidden;text-overflow:ellipsis}
body>.workspace-tabs{grid-area:2/1/3/2;display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:22px 10px 16px;border:0;border-right:1px solid var(--border);background:var(--card);min-height:0;overflow:auto}
.workspace-tabs button{display:flex;align-items:center;gap:10px;text-align:left;padding:11px 12px;border:0;border-radius:7px;font-size:13px;font-weight:400;flex-shrink:0;background:transparent;color:var(--muted-foreground)}
.workspace-tabs button[aria-selected=true]{border:0;background:var(--accent);color:var(--primary);font-weight:500}.workspace-nav-icon{font-size:18px;line-height:1;width:20px;text-align:center}
.workspace-nav-group { display: flex; flex: 0 0 auto; flex-direction: column; gap: 5px; }
.workspace-nav-group + .workspace-nav-group { border-block-start: 1px solid var(--border); padding-block-start: 5px; }
#workspace-tab-whatsapp {
  background: var(--accent);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
  font-weight: 700;
}
#workspace-tab-whatsapp .workspace-nav-icon { color: inherit; }
#workspace-tab-whatsapp:hover { box-shadow: inset 0 0 0 1px var(--primary); }
#workspace-tab-whatsapp[aria-selected="true"] { background: var(--primary); color: var(--card); }
#workspace-tab-whatsapp[aria-selected="true"]:focus-visible { outline-color: var(--card); }
body>main{grid-area:2/2/3/3;min-height:0;min-width:0;margin:0;padding:24px;width:100%;max-width:none;overflow:auto;scrollbar-width:thin}
#workspace-sidebar-toggle{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;padding:0;border:1px solid var(--border);border-radius:7px;background:transparent;color:var(--muted-foreground)}
#workspace-sidebar-toggle:hover{background:var(--secondary);color:var(--foreground)}
#workspace-sidebar-toggle:focus-visible,.workspace-tabs button:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
body[data-sidebar-collapsed=true] .sidebar-toggle-chevron{transform:rotate(180deg);transform-origin:15px 12px}
body[data-sidebar-collapsed=true] .workspace-nav-label,body[data-sidebar-collapsed=true] .workspace-nav-heading{display:none}
body[data-sidebar-collapsed=true] .workspace-tabs button{justify-content:center;padding:11px 0;gap:0}
.workspace-nav-icon{flex-shrink:0}
@media(min-width:760px){body[data-sidebar-collapsed=true]{grid-template-columns:64px minmax(0,1fr)}body[data-sidebar-collapsed=true]>.workspace-tabs{padding-left:8px;padding-right:8px}}
@media(max-width:759px){body[data-sidebar-collapsed=true] .workspace-tabs button{width:34px;padding:7px 0}}
body[data-workspace=conversations]>main{display:flex;flex-direction:column;overflow:hidden}
main>.alert{flex-shrink:0;max-height:100px;overflow:auto}.workspace-view-heading{margin-bottom:24px}.workspace-view-heading h2{font-size:23px;font-weight:500;letter-spacing:-.6px}.workspace-view-heading p{font-size:12px}
#workspace-conversations{flex:1;min-height:0;display:flex;flex-direction:column}
#conversation-layout-tabs{display:flex;flex:0 0 auto;align-items:center;gap:5px;margin:0 0 16px;padding:0 0 9px;border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none}
#conversation-layout-tabs button{flex:0 0 auto;min-height:36px;padding:7px 16px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--muted-foreground);font-size:13px;white-space:nowrap}
#conversation-layout-tabs button[aria-selected=true]{border-color:var(--primary);background:var(--accent);color:var(--primary);font-weight:500}
#conversation-layout-tabs button:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.conversation-import-toolbar{display:flex;align-items:flex-start;gap:12px;flex:0 0 auto}
.conversation-import-toolbar #conversation-layout-tabs{flex:1 1 auto;min-width:0}
.conversation-import-toolbar>button{min-height:36px;font-size:12px}
#chat-import-result{flex:0 0 auto;margin:0 0 12px}
#conversation-library{flex:1;min-height:0;display:flex;flex-direction:column}
#conversation-library .library-card{display:flex;flex-direction:column;flex:1;min-height:0;margin:0;border:0;border-radius:0;background:transparent;overflow:visible}
#workspace-conversations .library-heading{padding:0 0 20px;margin:0;flex:0 0 auto;align-items:center;gap:12px}
#workspace-conversations .library-heading h2{font-size:23px;letter-spacing:-.6px;font-weight:500}
.library-heading p{display:none}.library-heading-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:8px;width:auto;margin-left:auto}
.library-heading-actions #library-refresh{width:36px;height:36px;padding:0;display:grid;place-items:center;font-size:18px}
.library-heading-actions #collection-new{height:36px;padding:0 12px;border-radius:7px;font-size:12px;font-weight:500}
.library-bulk-actions{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:7px;background:var(--accent);margin-bottom:12px;flex:0 0 auto}.library-bulk-actions[hidden]{display:none!important}.library-bulk-actions button{font-size:12px}
.library-tools{position:relative;flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:0 0 16px;background:none}
.library-tools>label{flex:1;min-width:130px}.library-tools input{width:100%;max-width:none;background:var(--card);padding:10px 12px;border:1px solid var(--border);border-radius:7px;font-size:13px;color:var(--foreground)}
.library-tools>button,.library-heading-actions button{font-size:12px;font-weight:400;min-height:36px}
.workspace-tabs button{transition:none}
.workspace-nav-heading{padding:18px 12px 5px;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted-foreground);flex-shrink:0}
#library-filter-panel{position:absolute;top:44px;left:0;z-index:10;width:min(420px,100%);padding:16px;border:1px solid var(--border);border-radius:10px;background:var(--card);box-shadow:0 12px 30px #0005}
#library-filter-panel .library-tabs{padding:0;border:0;display:flex;gap:5px;flex-wrap:wrap;overflow:visible}
#library-filter-panel .library-tabs button{padding:8px 10px;font-size:12px;border:0;border-radius:6px;font-weight:400}
#library-filter-panel .library-tabs button[aria-selected=true]{background:var(--accent);color:var(--primary)}
#library-filter-panel select{margin-top:12px;background:var(--background);border:1px solid var(--border);padding:8px;border-radius:7px;color:var(--foreground);font-size:12px}
.library-selection{font-size:12px}.library-notice{flex:0 0 auto;margin:0 0 12px;border-radius:7px;max-height:100px;overflow:auto}
.library-footer{flex-shrink:0}.collection-editor{flex-shrink:1;min-height:0;max-height:55%;overflow:auto}.collection-members{max-height:180px;overflow:auto}.library-delete-confirm{flex-shrink:0}
#library-workspace[data-layout]{display:grid;flex:1;min-height:0;gap:0;overflow:hidden;border:1px solid var(--border);border-radius:10px;background:var(--card)}
#library-workspace[data-layout=grid],#library-workspace[data-layout=table]{grid-template-columns:minmax(0,1fr)}
#library-workspace[data-layout=sidebar]{grid-template-columns:minmax(240px,30%) minmax(0,1fr)}
#library-workspace[data-layout]>.library-list,#library-workspace[data-layout]>.library-detail{height:100%;min-height:0;max-height:none;overflow:auto;align-self:stretch;min-width:0;overscroll-behavior:contain;scrollbar-width:thin}
#library-workspace[data-layout]>.library-list{border:0}
#library-workspace[data-layout=sidebar]>.library-list{border-right:1px solid var(--border)}
#library-workspace[data-layout=grid]>.library-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));grid-auto-rows:max-content;align-content:start;gap:12px;padding:16px;background:var(--background)}
#library-workspace[data-layout=grid] .library-row{padding:16px;min-height:136px;border:1px solid var(--border);border-radius:9px;background:var(--card);gap:8px;cursor:pointer;position:relative}
#library-workspace[data-layout=grid] .library-row.active{border-color:var(--primary);background:var(--accent)}
#library-workspace .library-row:hover{background:var(--secondary)}
#library-workspace[data-layout=grid] .library-open{font-size:14px;font-weight:500;min-height:40px;line-height:1.4;padding-right:18px}
#library-workspace[data-layout=grid] .library-row>input{top:12px;right:12px}
#library-workspace[data-layout=grid] .library-chat-menu-button{position:absolute;right:10px;bottom:10px;font-size:19px;padding:2px 7px}
.library-chat-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#library-workspace[data-layout=grid] .library-avatar{width:36px;height:36px;font-size:17px;border-radius:50%;margin:0}
.library-chat-preview{font-size:12px;color:var(--muted-foreground);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:8px 0 0}
#library-workspace[data-layout=grid] .library-chat-preview{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.5;height:36px}
.library-row-time{font-size:11px;color:var(--muted-foreground);white-space:nowrap}
#library-workspace[data-layout=sidebar] .library-row{padding:10px 12px;min-height:66px;gap:8px;align-items:center;cursor:pointer;border-bottom:1px solid var(--border)}
#library-workspace[data-layout=sidebar] .library-row-main{position:relative;min-width:0;padding-right:24px}
#library-workspace[data-layout=sidebar] .library-open{display:flex;align-items:center;min-width:0;min-height:32px;font-size:13px;font-weight:500;line-height:1.4}
#library-workspace[data-layout=sidebar] .library-avatar{width:32px;height:32px;font-size:16px;border-radius:50%;margin-right:9px}
#library-workspace[data-layout=sidebar] .library-chat-preview{margin:3px 0 0 41px;font-size:12px}
#library-workspace[data-layout=sidebar] .library-chat-menu-button{position:absolute;right:-4px;top:2px;font-size:19px;padding:4px;min-width:24px}
#library-workspace[data-layout=sidebar] .library-row-time{position:absolute;top:5px;right:26px;font-size:10px}
#library-workspace[data-layout=sidebar] .library-open{padding-right:50px}
#library-workspace .library-chat-menu-button{border:0;background:none;color:var(--muted-foreground)}
#library-workspace[data-layout=sidebar] .library-crm-chips,#library-workspace[data-layout=sidebar] .library-note-preview,#library-workspace[data-layout=sidebar] .library-follow-up,#library-workspace[data-layout=sidebar] .library-row-main>.library-memberships{display:none}

/* Keep the table a table at all widths; explicit columns prevent oversized selects. */
#library-workspace .library-table{display:table;table-layout:fixed;width:100%;border-collapse:collapse;font-size:12px}
#library-workspace .library-table thead{display:table-header-group;position:sticky;top:0;z-index:1;background:var(--secondary)}
#library-workspace .library-table tbody{display:table-row-group}
#library-workspace .library-table tr{display:table-row;padding:0;cursor:pointer}
#library-workspace .library-table th,#library-workspace .library-table td{display:table-cell;padding:10px 9px;border:0;border-bottom:1px solid var(--border);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
#library-workspace .library-table td::before{display:none!important}
#library-workspace .library-table th{font-size:11px;font-weight:400;color:var(--muted-foreground)}
#library-workspace .library-table th:first-child.library-col-select{font-size:0}
#library-workspace .library-table td:last-child{padding-left:3px;padding-right:3px;text-overflow:clip}
#library-workspace .library-table td:first-child:has(input){text-overflow:clip;text-align:center}
.library-col-select{width:38px}.library-col-name{width:32%}.library-col-time{width:128px}.library-col-actions{width:38px}
#library-workspace .library-table .library-open{min-width:0;max-width:none;font-size:13px;font-weight:500;display:flex;align-items:center;gap:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#library-workspace .library-table .library-avatar{width:28px;height:28px;font-size:15px;margin:0;border-radius:50%}
#library-workspace .library-table .library-chat-preview{margin:0}.library-table input[type=checkbox]{width:14px;height:14px}

/* The same mounted reader lives either beside the list or inside a modal. */
#library-chat-dialog{box-sizing:border-box;padding:0;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--foreground);width:min(820px,calc(100vw - 40px));height:min(780px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);max-width:calc(100vw - 40px);overflow:hidden;box-shadow:0 24px 100px #0006}
#library-chat-dialog[open]{display:flex;flex-direction:column}
#library-chat-dialog::backdrop{background:#050915a8;backdrop-filter:blur(3px)}
#library-chat-dialog>.library-detail{width:100%;height:100%;max-height:100%;min-height:0;min-width:0;overflow:auto;padding:0}
#library-chat-dialog [hidden]{display:none!important}
#library-workspace[data-layout]>.library-detail.library-chat-open,#library-chat-dialog>.library-detail.library-chat-open{display:flex;flex-direction:column;overflow:hidden;min-height:0}
.library-detail>.library-detail-heading{display:flex;flex-wrap:nowrap;align-items:center;flex:0 0 auto;gap:10px;padding:13px 16px;background:var(--card);margin:0}
.library-detail-heading>div:first-child{flex:1;min-width:0}.library-detail-heading h3{font-size:15px!important;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.library-detail-heading p{font-size:11px;margin:3px 0 0}
.library-detail-heading button{font-size:13px;font-weight:400;flex-shrink:0;min-width:32px;padding:6px 9px}
#library-workspace[data-layout=sidebar] .library-close-preview{display:inline-flex}.library-close-preview{margin-left:0}
#library-info-toggle{color:var(--muted-foreground);background:transparent;border:0}
#library-more-options{width:100%;max-height:45%;flex:0 1 auto;overflow:auto;min-height:0;margin:0;padding:14px 16px;background:var(--card);border-bottom:1px solid var(--border)}
#library-more-options[hidden]{display:none!important}.library-chat-options-body{padding:0;gap:12px}.library-chat-options-body .chat-context-strip{padding:0 0 10px;width:100%}.library-sync-controls{padding:12px;margin:0}
#library-workspace .library-chat-history,#library-chat-dialog .library-chat-history{flex:1 1 0;min-height:0;max-height:none;overflow:auto;padding:20px;background:var(--background);overscroll-behavior:contain}
.library-chat-history .library-stored-message{width:fit-content;max-width:88%;min-width:120px;padding:10px 12px;margin-bottom:10px;border:0;border-radius:3px 11px 11px;background:var(--card)}
.library-chat-history .library-stored-message.from-me{border-radius:11px 3px 11px 11px;background:var(--accent)}
.library-chat-history .library-stored-message p{font-size:14px;line-height:1.5}.library-stored-message header{align-items:center;gap:14px;font-size:10px}.library-stored-message header strong{font-weight:500;font-size:11px}
.library-message-star{padding:2px 5px;min-width:24px;background:transparent;border:0;color:var(--muted-foreground);font-size:15px}.library-message-star[aria-pressed=true]{color:var(--primary)}
.library-stored-message:target,.library-message-highlight{outline:2px solid var(--primary);outline-offset:3px}
.chat-composer{padding:10px 14px;min-width:0;flex-shrink:0}.chat-reply-form{padding:5px 7px 5px 12px;border-radius:12px;gap:6px}.chat-reply-form textarea{font-size:14px}.chat-reply-actions{gap:5px}.chat-reply-actions button{font-size:12px;min-height:36px}.chat-reply-feedback{font-size:11px;margin-top:6px}
.chat-ai-panel{max-height:180px;overflow:auto;margin-bottom:8px}.chat-context-dialog{z-index:20}.chat-due-reminders{font-size:12px;margin-bottom:12px;border-radius:7px}
@media(max-width:1000px){body{grid-template-columns:154px minmax(0,1fr)}.workspace-tabs button{padding:12px 8px}.workspace-nav-icon{font-size:18px}body>main{padding:18px}.library-col-time{width:110px}#library-workspace[data-layout=sidebar]{grid-template-columns:minmax(220px,33%) minmax(0,1fr)}}
@media(max-width:759px){
 body{grid-template-columns:minmax(0,1fr);grid-template-rows:54px 48px minmax(0,1fr)}body>.topbar{grid-area:1/1/2/2;height:54px;padding:0 14px}.topbar .brand-logo{width:48px}.topbar .brand h1{font-size:13px}.topbar .connection{font-size:10px;max-width:140px;white-space:nowrap}.topbar .top-actions{width:auto;gap:0;margin:0}
 body>.workspace-tabs{grid-area:2/1/3/2;flex-direction:row;align-items:center;justify-content:flex-start;overflow-x:auto;padding:5px 10px;border:0;border-bottom:1px solid var(--border);gap:4px}.workspace-nav-heading{display:none}.workspace-tabs button{padding:7px 9px;gap:5px;font-size:12px}.workspace-nav-icon{font-size:17px}
 .workspace-nav-group { flex-direction: row; gap: 4px; }
 .workspace-nav-group + .workspace-nav-group { border-block-start: 0; padding-block-start: 0; border-inline-start: 1px solid var(--border); padding-inline-start: 4px; }
 body>main{grid-area:3/1/4/2;padding:14px;min-height:0}.library-heading-actions{width:auto}.library-tools{gap:7px;padding-bottom:12px}.library-tools>label{min-width:120px}
 #library-workspace[data-layout=sidebar]{grid-template-columns:minmax(0,1fr)}#library-workspace[data-layout=sidebar]>.library-list{border-right:0}#library-workspace[data-layout=sidebar]>.library-detail{display:none!important}
 #library-workspace[data-layout=grid]>.library-list{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));padding:10px;gap:10px}
 #library-workspace .library-table .library-col-name{width:auto}#library-workspace .library-table .library-col-preview,#library-workspace .library-table th:nth-child(3),#library-workspace .library-table td:nth-child(3){display:none}#library-workspace .library-table .library-col-time{width:100px}#library-workspace .library-table th,#library-workspace .library-table td{padding:9px 7px}
 #library-chat-dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}.library-detail>.library-detail-heading{padding:12px;gap:6px}.library-detail-heading button{font-size:12px;padding:6px;min-width:28px}#library-chat-dialog .library-chat-history{padding:14px}.chat-composer{padding:10px}.library-detail-heading p{font-size:10px}
}
@media(max-width:440px){#conversation-layout-tabs{gap:3px}#conversation-layout-tabs button{flex:1;padding:7px 9px}.library-heading-actions button{font-size:11px}#workspace-conversations .library-heading{padding-bottom:14px}.library-col-time{width:84px!important}.library-col-actions{width:28px}.library-col-select{width:32px}.library-table .library-avatar{display:none!important}.topbar .connection{max-width:110px}.workspace-tabs button{padding:7px}.workspace-nav-icon{font-size:16px}.chat-ai-button{padding:7px!important}}

/* Persistent, local conversation tabs above the application workspace. */
.conversation-tabs{display:flex;align-items:stretch;gap:5px;overflow-x:auto;flex-shrink:0;min-height:39px;margin:0 0 20px;scrollbar-width:thin;border-bottom:1px solid var(--border);padding-bottom:7px}
.conversation-tabs button{background:transparent;color:var(--muted-foreground);border:0;border-radius:6px;padding:9px 12px;font-size:12px;white-space:nowrap;font-weight:400}
.conversation-tabs>[role=tab]{flex-shrink:0}.conversation-tab-item{display:flex;align-items:center;flex-shrink:0;border-radius:6px;background:var(--card)}
.conversation-tab-item>[role=tab]{max-width:220px;overflow:hidden;text-overflow:ellipsis}.conversation-tab-item>button:last-child{padding:7px 9px;font-size:16px}
.conversation-tab-item[data-active=true],.conversation-tabs>[aria-selected=true]{background:var(--accent)}.conversation-tab-item[data-active=true]>[role=tab],.conversation-tabs>[aria-selected=true]{color:var(--primary)}
.conversation-tabs button:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}.conversation-tabs button:hover{background:var(--secondary)}
body[data-workspace=conversation-tab]>main{display:flex;flex-direction:column;overflow:hidden}
.workspace-conversation-tab{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;border:1px solid var(--border);border-radius:10px;background:var(--card)}
.workspace-conversation-tab[hidden]{display:none!important}
.workspace-conversation-tab>#library-detail{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;height:100%;max-height:none;overflow:hidden;padding:0}
.workspace-conversation-tab .library-chat-history{flex:1;min-height:0;overflow:auto;scrollbar-width:thin}
.workspace-conversation-tab .library-detail-heading,.workspace-conversation-tab .chat-composer{flex-shrink:0}
.workspace-tab-status{color:var(--muted-foreground);font-size:12px;flex-shrink:0}
.workspace-pin-dialog{width:min(440px,calc(100vw - 32px));padding:24px;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--foreground);box-shadow:0 24px 80px #0008;max-height:calc(100dvh - 32px);overflow:auto}
.workspace-pin-dialog::backdrop{background:#050915a8}.workspace-pin-dialog h2{font-size:20px;margin:0 0 10px}.workspace-pin-dialog p{overflow-wrap:anywhere}
.workspace-pin-help{font-size:12px;line-height:1.6;color:var(--muted-foreground)}
.workspace-pin-dialog [data-pin-destination]{display:flex;flex-direction:column;gap:5px;text-align:left;width:100%;margin:9px 0;padding:14px;background:var(--secondary);color:var(--foreground);border:1px solid var(--border);border-radius:8px}
.workspace-pin-dialog [data-pin-destination]:hover{border-color:var(--primary)}.workspace-pin-dialog [data-pin-destination] span{font-size:12px;color:var(--muted-foreground);font-weight:400;white-space:normal}.workspace-pin-error{color:#ffb7b7;font-size:12px}
@media(max-width:760px){.conversation-tabs{margin-bottom:12px}.conversation-tab-item>[role=tab]{max-width:160px}}

/* Two tight text lines, with the portrait spanning both instead of stretching the title. */
#library-compact[aria-pressed=true]{background:var(--accent);color:var(--primary);border-color:var(--primary)}
#library-workspace[data-layout=sidebar] .library-row[data-library-chat]{padding:10px 12px;min-height:66px;gap:10px}
#library-workspace[data-layout=sidebar] [data-library-chat] .library-row-main{padding:0 0 0 46px;min-height:38px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:18px 18px;column-gap:8px;row-gap:2px}
#library-workspace[data-layout=sidebar] [data-library-chat] .library-open{grid-area:1/1;min-height:0;height:18px;padding:0;line-height:18px;font-size:13px;overflow:hidden}
#library-workspace[data-layout=sidebar] [data-library-chat] .library-avatar{position:absolute;left:0;top:50%;transform:translateY(-50%);width:36px;height:36px;margin:0}
#library-workspace .library-avatar-initials{font-size:12px;font-weight:600;font-family:inherit;letter-spacing:.02em}
/* Card names start beside the portrait; metadata follows the complete two-line title. */
#library-workspace[data-layout=grid] .library-open:has(.library-card-name){align-items:flex-start;gap:9px}
#library-workspace[data-layout=grid] .library-card-name{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0;font-size:12px;line-height:1.4;text-align:start;white-space:normal;overflow:visible}
#library-workspace[data-layout=grid] .library-card-title{display:flex;align-items:baseline;gap:4px}
#library-workspace[data-layout=grid] .library-card-title>bdi{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;min-width:0}
#library-workspace[data-layout=grid] .library-card-title>.library-inferred-label{flex:none}
#library-workspace[data-layout=grid] .library-name-tags{display:flex;flex-wrap:wrap;align-items:center;gap:3px 5px;min-width:0;font-size:10px;line-height:1.4}
#library-workspace[data-layout=grid] .library-name-tags>*{min-width:0;max-width:100%;margin:0;white-space:normal;overflow-wrap:anywhere}
#library-workspace[data-layout=grid] .library-name-tags :is(.library-chat-badge,.chat-original-name){font-size:10px}
#library-workspace[data-layout=sidebar] [data-library-chat] .library-chat-preview{grid-area:2/1/3/3;margin:0;padding:0;line-height:18px;font-size:12px;text-align:start;min-width:0}
#library-workspace[data-layout=sidebar] [data-library-chat] .library-row-time{position:static;grid-area:1/2;align-self:center;font-size:10px;line-height:18px;font-variant-numeric:tabular-nums;direction:ltr}
#library-workspace[data-layout=sidebar] [data-library-chat] .library-chat-menu-button{top:auto;bottom:-2px;right:-4px;width:24px;height:22px;padding:0;font-size:20px;z-index:1;background:var(--card)}
#library-workspace[data-layout=sidebar] [data-library-chat]:is(:hover,:focus-within) .library-chat-menu-button{background:var(--secondary)}
#library-workspace[data-layout=sidebar] [data-library-chat]:is(:hover,:focus-within) .library-chat-preview{padding-right:24px}
#library-workspace .library-chat-menu-button{opacity:0;pointer-events:none}
#library-workspace :is(.library-row,tr):hover .library-chat-menu-button,#library-workspace .library-chat-menu-button:is(:focus-visible,[aria-expanded=true]){opacity:1;pointer-events:auto}
/* Custom selection controls retain native checkbox semantics without the gray OS fill. */
#library-workspace input[type=checkbox]{appearance:none;position:relative;display:inline-grid;place-content:center;box-sizing:border-box;width:14px;height:14px;flex:0 0 14px;margin:0;border:1px solid var(--muted-foreground);border-radius:4px;background:transparent;cursor:pointer;opacity:.55}
#library-workspace input[type=checkbox]:checked,#library-workspace input[type=checkbox]:indeterminate{background:var(--primary);border-color:var(--primary);opacity:1}
#library-workspace input[type=checkbox]:checked::after{content:'';width:6px;height:3px;border:solid var(--background);border-width:0 0 2px 2px;transform:translateY(-1px) rotate(-45deg)}
#library-workspace input[type=checkbox]:indeterminate::after{content:'';width:7px;height:2px;background:var(--background)}
#library-workspace input[type=checkbox]:focus-visible{outline:2px solid var(--primary);outline-offset:3px;opacity:1}
#library-workspace input[type=checkbox]:disabled{opacity:.25;cursor:default}
#library-workspace[data-layout=sidebar][data-density=compact] .library-row[data-library-chat]{min-height:52px;padding:6px 10px;gap:8px}
#library-workspace[data-layout=sidebar][data-density=compact] [data-library-chat] .library-row-main{padding-left:40px}
#library-workspace[data-layout=sidebar][data-density=compact] [data-library-chat] .library-avatar{width:32px;height:32px;font-size:11px}
#library-workspace[data-layout=table][data-density=compact] .library-table :is(td,th){padding-top:6px;padding-bottom:6px}
#library-workspace[data-layout=grid][data-density=compact] .library-row{min-height:132px;padding:12px}
@media(hover:none){
  #library-workspace .library-chat-menu-button{opacity:1;pointer-events:auto}
  #library-workspace[data-layout=sidebar] [data-library-chat] .library-chat-preview{padding-right:24px}
}

#library-bulk-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:10px 12px;margin-bottom:12px;border:1px solid color-mix(in srgb,var(--primary) 35%,var(--border));border-radius:10px;background:color-mix(in srgb,var(--primary) 8%,var(--card));box-shadow:0 3px 12px #0001}
#library-bulk-actions .library-selection{font-size:12px;font-weight:600;color:var(--primary);white-space:nowrap;padding:4px 10px 4px 0;border-right:1px solid var(--border)}
.library-bulk-buttons{display:flex;flex-wrap:wrap;gap:6px}
#library-bulk-actions button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:32px;padding:6px 11px;border-radius:6px;font-size:12px;white-space:nowrap}
#library-bulk-actions .secondary{background:var(--card);border:1px solid var(--border);color:var(--foreground)}
#library-bulk-actions .secondary:hover:enabled{border-color:var(--primary);background:var(--accent)}
#library-bulk-actions button:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
#library-bulk-actions button:disabled{opacity:.5;cursor:default}
#collection-add-selected::before{content:'+';font-size:17px;color:var(--primary)}
#library-download-selected::before{content:'↓';font-size:17px;color:var(--primary)}
#library-summarize-selected::before{content:'✦';font-size:14px;color:var(--primary)}
#library-clear-selection{margin-left:auto;color:var(--muted-foreground);background:transparent;border:1px solid transparent}
#library-clear-selection span{font-size:18px;line-height:1}
.bulk-summary-dialog{box-sizing:border-box;width:min(760px,calc(100vw - 24px));max-height:85dvh;padding:0;border:1px solid var(--border);border-radius:14px;background:var(--card);color:var(--foreground);box-shadow:0 20px 80px #0008;overflow:auto}
.bulk-summary-dialog::backdrop{background:#0009}
.bulk-summary-dialog header{display:flex;align-items:flex-start;gap:16px;padding:20px 22px 12px;border-bottom:1px solid var(--border)}
.bulk-summary-dialog h2{margin:0;font-size:19px}.bulk-summary-dialog header p{color:var(--muted-foreground);font-size:12px;line-height:1.5;margin:7px 0 0}
#bulk-summary-close{margin-left:auto;font-size:24px;padding:0 6px;color:var(--muted-foreground);background:none;border:0}
#bulk-summary-progress{padding:12px 22px;margin:0;font-size:12px;color:var(--primary)}
#bulk-summary-list{display:grid;gap:12px;padding:0 22px 20px}
.bulk-summary-card{padding:15px;border:1px solid var(--border);border-radius:9px;background:var(--background);min-width:0}
.bulk-summary-card h3{font-size:14px;margin:0 0 10px;text-align:start;overflow-wrap:anywhere}
.bulk-summary-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;font-size:13px;margin:0;text-align:start}
.bulk-summary-card small{display:block;margin-top:12px;color:var(--muted-foreground);font-size:11px;line-height:1.5}.bulk-summary-card.error .bulk-summary-text{color:#e7a67b}
.bulk-summary-dialog footer{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;background:var(--card);padding:12px 22px;border-top:1px solid var(--border)}
.bulk-summary-dialog footer button{font-size:12px;min-height:34px}
@media(max-width:620px){#library-bulk-actions{gap:8px}#library-bulk-actions .library-bulk-buttons{order:3;width:100%}#library-bulk-actions .library-bulk-buttons button{flex:1;padding:6px 8px}.bulk-summary-dialog header{padding:16px}#bulk-summary-list{padding:0 12px 12px}}

.global-search{display:flex;align-items:center;gap:10px;flex:1;max-width:620px;min-width:150px;border:1px solid var(--border);border-radius:9px;padding:7px 12px;background:var(--background)}
.global-search:focus-within{border-color:var(--primary);box-shadow:0 0 0 2px #b4a7ff25}.global-search>span{font-size:24px;color:var(--primary)}
.global-search input{width:100%;min-width:0;background:transparent;border:0;color:var(--foreground);outline:none;font-size:13px;padding:4px}.global-search kbd{white-space:nowrap;font-size:10px;color:var(--muted-foreground)}
.knowledge-settings label{display:grid;gap:5px;font-size:12px;color:var(--muted-foreground)}
.knowledge-settings input{color:var(--foreground);background:var(--card);padding:9px;border:1px solid var(--border);border-radius:6px;max-width:100%}
.knowledge-check{display:flex!important;align-items:center;gap:8px!important}.knowledge-check input{width:auto}.knowledge-results{display:grid;gap:12px;margin-top:18px}.knowledge-result,.brief-card{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:18px;min-width:0}
.brief-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.brief-heading h2{margin:0 0 3px}.brief-subtitle{margin:0!important;color:var(--muted-foreground)!important}.brief-info{position:relative;display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--card);color:var(--primary);font-size:15px}.brief-info::after{content:attr(data-tooltip);position:absolute;z-index:2;top:calc(100% + 8px);right:0;width:250px;padding:9px 10px;border:1px solid var(--border);border-radius:7px;background:var(--foreground);color:var(--card);font-size:11px;font-weight:400;line-height:1.5;text-align:left;opacity:0;pointer-events:none;transform:translateY(-3px);transition:opacity .15s,transform .15s}.brief-info:hover::after,.brief-info:focus-visible::after{opacity:1;transform:translateY(0)}
.brief-control-card{display:flex;align-items:end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0 0 10px;padding:14px 16px;border:1px solid var(--border);border-radius:11px;background:var(--card)}.brief-date-control{display:grid;gap:5px;font-size:11px;color:var(--muted-foreground)}.brief-date-control input{height:38px;padding:7px 9px;border:1px solid var(--border);border-radius:7px;background:var(--background);color:var(--foreground);font:inherit}.brief-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.brief-action{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:108px;height:38px;padding:0 12px;font-size:12px}.brief-status-card{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:3px 2px 0}.brief-status-card p{margin:0;font-size:12px;line-height:1.6}.brief-status-card #brief-status{color:var(--foreground)}.brief-status-card #brief-sync{color:var(--muted-foreground)}.brief-status-card #brief-sync:not(:empty){padding-inline-start:10px;border-inline-start:1px solid var(--border)}
.knowledge-result{display:block;width:100%;text-align:left;color:var(--foreground)}.knowledge-result:hover{border-color:var(--primary)}.knowledge-result h3,.brief-card h3{font-size:16px;margin:6px 0 9px}.knowledge-result p,.brief-card p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.6;margin:7px 0;color:var(--muted-foreground)}
.knowledge-kind,.knowledge-muted{font-size:11px;color:var(--muted-foreground)}.knowledge-tags{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}.knowledge-tag{display:inline-block;border:0;border-radius:5px;padding:4px 7px;background:var(--accent);color:var(--primary);font-size:11px}
.brief-topic-group{border-top:1px solid var(--border);margin-top:18px;padding-top:12px}.brief-topic-heading{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--primary);margin:0 0 5px}.brief-event{border-top:1px solid var(--border);margin-top:12px;padding-top:12px}.brief-event h5{font-size:13px;margin:0 0 6px}.brief-source{margin-right:12px;font-size:12px}.brief-evidence{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;margin:10px 0 0;padding:8px 10px;border-inline-start:2px solid var(--accent);background:var(--background);font-size:12px;line-height:1.6}.brief-evidence q{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--foreground)}.brief-speaker{font-weight:600;color:var(--muted-foreground)}.brief-evidence .brief-source{margin-inline-start:auto}.knowledge-settings{margin-top:28px;border-top:1px solid var(--border);padding:18px 0}.knowledge-settings summary{cursor:pointer;font-size:13px}.knowledge-settings p{font-size:12px;color:var(--muted-foreground);line-height:1.6}.knowledge-settings form{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin:16px 0}.knowledge-settings form>.knowledge-check{width:100%}.brief-settings{margin-top:26px}.brief-summary-info{color:var(--primary);font-size:13px}
.brief-highlight{outline:2px solid var(--primary)}#global-search-status,#brief-status,#embedding-status{font-size:13px;line-height:1.6;color:var(--muted-foreground)}
.brief-evidence{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;margin-top:12px;padding:12px 14px;border:1px solid var(--border);border-radius:8px;background:var(--background);font-size:13px}
.brief-evidence .brief-speaker{grid-column:1;grid-row:1;min-width:0;overflow-wrap:anywhere;font-size:12px}
.brief-evidence q{grid-column:1/-1;grid-row:2;display:block;min-width:0;line-height:1.6}
.brief-evidence .brief-source{grid-column:2;grid-row:1;margin:0;padding:4px 0;font-size:12px;text-align:end}
#brief-results{max-width:1040px;align-items:start;gap:12px}
.brief-card-meta{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;min-width:0;font-size:12px;line-height:1.5;color:var(--muted-foreground)}
.brief-card-meta>bdi{min-width:0;max-width:100%;overflow-wrap:anywhere}
.brief-relevance{flex:none;max-width:100%;padding:3px 7px;border-radius:5px;background:var(--secondary);color:var(--muted-foreground);font-size:10px;line-height:1.5;font-weight:500;overflow-wrap:anywhere}
.brief-relevance[data-relevance=critical]{background:var(--accent);color:var(--primary)}
.brief-topic-header{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 10px;min-width:0}
.brief-topic-title{flex:1 1 180px;min-width:0;margin:0;font-size:15px;line-height:1.5;font-weight:650;overflow-wrap:anywhere;color:var(--foreground)}
.brief-event>p{margin:5px 0;font-size:13px;line-height:1.6;color:var(--foreground);white-space:pre-wrap;overflow-wrap:anywhere;text-align:start}
.brief-card .knowledge-tags,.brief-details .knowledge-tags{margin:0;gap:5px}
.brief-card .knowledge-tag,.brief-details .knowledge-tag{max-width:100%;overflow-wrap:anywhere;background:var(--secondary);color:var(--muted-foreground);padding:4px 7px;font-size:11px}
.brief-details .brief-evidence{margin:8px 0;padding:9px 12px;font-size:12px}
.brief-source-list{display:flex;flex-wrap:wrap;gap:6px;padding-top:6px}
body[data-workspace=search]>main{display:flex;flex-direction:column;overflow:hidden}
#workspace-search{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0}
.global-search-dialog-shell{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;gap:8px}
#archive-search-settings{flex:0 1 auto;max-height:45%;margin:0;padding:10px 0;overflow:auto}
.global-search-dialog-toolbar{display:flex;align-items:center;gap:10px;flex-shrink:0;min-width:0;height:42px}
.global-search-dialog-input{display:flex;align-items:center;gap:9px;flex:1;min-width:0;height:100%;box-sizing:border-box;margin:0;padding:0 12px;border:1px solid var(--border);border-radius:10px;background:color-mix(in srgb,var(--card) 88%,transparent)}
.global-search-dialog-input:focus-within{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 12%,transparent)}
.global-search-dialog-input>span{font-size:25px;line-height:1;color:var(--primary)}
.global-search-dialog-input input{flex:1;min-width:0;width:100%;height:100%;padding:0;border:0;outline:0;background:transparent;color:var(--foreground);font-size:16px;text-align:start}
.search-layout-controls{display:flex;gap:2px;padding:3px;flex:none;box-sizing:border-box;height:36px;border:1px solid var(--border);border-radius:9px;background:color-mix(in srgb,var(--card) 74%,transparent)}
.search-layout-controls button,.search-icon-button{display:grid;place-items:center;flex:none;width:30px;height:30px;min-height:0;padding:0;box-sizing:border-box;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--muted-foreground);font-size:19px;line-height:1}
.search-layout-controls button{width:30px;height:28px}.search-layout-controls button[aria-pressed=true]{background:var(--accent);color:var(--primary);border-color:color-mix(in srgb,var(--primary) 30%,var(--border))}
.search-icon-button:hover,.search-layout-controls button:hover{background:var(--accent);color:var(--foreground)}
.search-icon-button:focus-visible,.search-layout-controls button:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
#global-search-dialog-close{width:34px;height:34px;font-size:23px}
.global-search-dialog-filters{display:flex;align-items:center;flex-wrap:wrap;gap:7px;flex-shrink:0;min-width:0;padding:0;border:0;background:transparent}
.global-search-dialog-filters select,.global-search-dialog-filters input[type=date]{height:30px;min-width:0;max-width:220px;box-sizing:border-box;padding:4px 8px;border:1px solid var(--border);border-radius:6px;background:color-mix(in srgb,var(--card) 80%,transparent);color:var(--foreground);font:inherit;font-size:11px}
.global-search-dialog-filters select{min-width:132px;max-width:230px}.global-search-dialog-filters input[type=date]{width:130px}
.search-date-actions{display:flex;align-items:center;gap:7px;min-width:0}
.search-vector-toggle{display:flex;align-items:center;justify-content:center;gap:4px;width:38px;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:6px;background:color-mix(in srgb,var(--card) 80%,transparent);color:var(--primary);cursor:pointer;flex:none}
.search-vector-toggle input{width:12px;height:12px;min-width:0;margin:0;padding:0;flex:none;accent-color:var(--primary)}.search-vector-toggle>span{font-size:12px}
.search-auxiliary-row{display:flex;align-items:center;gap:12px;flex-shrink:0;min-width:0;min-height:14px}.search-auxiliary-row:has(>p:empty):has(>div:empty){display:none}
.global-search-dialog-status{margin:0;color:var(--muted-foreground);font-size:11px;line-height:1.4;min-width:0;overflow-wrap:anywhere}
.global-search-dialog-suggestions{display:flex;align-items:center;gap:6px;min-width:0;overflow:auto;scrollbar-width:none}.global-search-dialog-suggestions:empty{display:none}.global-search-dialog-suggestions .knowledge-tag{flex:none;max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;padding:3px 6px}
.global-search-dialog-results{display:grid;align-content:start;gap:12px;flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px 3px 12px}
.search-result-group{display:grid;gap:7px;min-width:0;padding:0}.search-group-heading{display:flex;align-items:center;gap:7px;min-width:0;min-height:24px}
.search-group-heading h3{margin:0;color:var(--foreground);font-size:12px;line-height:1.4;font-weight:650}.search-group-count{font-size:10px;color:var(--muted-foreground)}
.search-group-more{margin-inline-start:auto;padding:3px 0;flex:none;font-size:11px;line-height:1.4}.search-all-types{justify-self:start;margin:0;padding:3px 0;font-size:11px}
.search-group-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));align-items:stretch;gap:10px;min-width:0}
.search-group-items .knowledge-result{display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto;align-items:start;column-gap:10px;row-gap:4px;box-sizing:border-box;width:100%;height:128px;min-width:0;padding:10px;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb,var(--card) 92%,transparent);box-shadow:0 2px 5px #132b3503;color:var(--foreground);text-align:start;overflow:hidden}
.search-group-items .knowledge-result:hover{border-color:var(--primary);background:color-mix(in srgb,var(--accent) 35%,var(--card))}.search-group-items .knowledge-result:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.search-result-icon{display:grid;place-items:center;grid-column:1;grid-row:1;width:30px;height:30px;border-radius:9px;background:color-mix(in srgb,var(--primary) 12%,var(--card));color:var(--primary);font-size:18px;line-height:1}
.search-result-body{grid-column:2;grid-row:1;min-width:0;overflow:hidden}.search-group-items .search-result-title{margin:0 0 6px;font-size:13px;line-height:1.4;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.search-group-items .search-result-excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0;min-width:0;font-size:12px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted-foreground)}
.search-result-meta{display:flex;align-items:center;gap:7px;grid-column:2;grid-row:3;min-width:0;overflow:hidden;color:var(--muted-foreground);font-size:10px;line-height:1.4;white-space:nowrap}.search-result-meta .knowledge-kind{font-size:10px;overflow:hidden;text-overflow:ellipsis}.search-result-date{flex:none}
.knowledge-result:not([data-search-kind=vector]) .search-result-meta .knowledge-kind{display:none}
.search-group-items .knowledge-tags{grid-column:2;grid-row:2;display:flex;align-items:center;flex-wrap:nowrap;gap:4px;min-width:0;max-height:21px;overflow:hidden;margin:0}.search-group-items .knowledge-tags:empty{display:none}.search-group-items .knowledge-tag{max-width:100%;padding:3px 5px;font-size:10px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:none}
.search-keyword{padding:0 1px;border-radius:2px;background:#ffe36b;color:#302600;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.search-table-tags{display:none}[data-layout=table] .search-table-tags{display:inline}.search-table-tags>span{display:inline;padding:0;margin-inline-end:6px;background:transparent;font:inherit;color:inherit}
.search-group-items .search-tags-only-excerpt{display:none}[data-layout=table] .search-group-items .search-tags-only-excerpt{display:block}
[data-layout=table]>.search-result-group .search-group-items{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
[data-layout=table]>.search-result-group .knowledge-result{display:grid;grid-template-columns:22px minmax(0,1fr) minmax(80px,140px);grid-template-rows:1fr;align-items:center;gap:9px;height:42px;min-height:0;padding:4px 9px;border-radius:6px;box-shadow:none}
[data-layout=table] .search-result-icon{grid-column:1;grid-row:1;width:22px;height:22px;border-radius:5px;font-size:14px}
[data-layout=table] .search-result-body{grid-column:2;grid-row:1;display:grid;grid-template-columns:minmax(110px,.7fr) minmax(0,1.5fr);align-items:center;gap:14px;min-width:0}
[data-layout=table] .search-result-title{margin:0;font-size:12px;line-height:1.4}[data-layout=table] .search-result-excerpt{display:block;margin:0;font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
[data-layout=table] .search-result-meta{grid-column:3;grid-row:1;justify-content:flex-end;min-width:0;font-size:10px}[data-layout=table] .knowledge-tags{display:none}
.global-search-dialog-results[data-layout=table] .search-group-items .knowledge-result,.knowledge-results[data-layout=table] .search-group-items .knowledge-result{border-radius:6px;box-shadow:none}
@media(max-width:1000px){.topbar .connection{display:none}.global-search kbd{display:none}.global-search-dialog-filters select{min-width:110px;max-width:180px}.global-search-dialog-filters input[type=date]{width:118px}.global-search-dialog-filters,.search-date-actions{gap:6px}}
@media(max-width:759px){body>.topbar{gap:9px}.topbar .brand-logo{display:none}.topbar .brand h1{font-size:11px;max-width:80px}.global-search{padding:3px 7px;min-width:0}.global-search input{font-size:12px}.global-search>span{font-size:19px}.knowledge-tools{gap:8px}.knowledge-tools button{padding:8px;font-size:12px}.brief-control-card{align-items:stretch}.brief-date-control{width:100%}.brief-date-control input{width:100%}.brief-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.brief-action{min-width:0;padding:0 7px}.brief-status-card{display:grid;gap:3px}.brief-status-card #brief-sync:not(:empty){padding-inline-start:0;border-inline-start:0}.brief-info::after{right:auto;left:0}
.global-search-dialog-shell{padding:12px;gap:7px}.global-search-dialog-toolbar{height:40px;gap:7px}.global-search-dialog-input{padding:0 8px;gap:6px;border-radius:8px}.global-search-dialog-input input{font-size:15px}.search-layout-controls{height:32px;padding:2px}.search-layout-controls button{width:27px;height:26px;font-size:17px}#global-search-dialog-close{width:28px;height:30px;font-size:21px}
.global-search-dialog-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.global-search-dialog-filters select{width:100%;max-width:none;min-width:0}.search-date-actions{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 34px 28px 28px;gap:6px}.global-search-dialog-filters input[type=date]{width:100%;max-width:none;padding-inline:5px;font-size:10px}.search-vector-toggle{width:34px;gap:3px}.search-date-actions .search-icon-button{width:28px;height:30px}.search-auxiliary-row{min-height:13px;gap:6px}.global-search-dialog-status{font-size:10px}.global-search-dialog-results{gap:11px;padding:3px 2px 10px}.search-group-items{grid-template-columns:minmax(0,1fr);gap:7px}.search-group-heading{min-height:22px}.search-group-heading h3{font-size:11px}.search-group-more{font-size:10px}
[data-layout=table]>.search-result-group .knowledge-result{grid-template-columns:18px minmax(0,1fr) 60px;height:40px;padding:4px 6px;gap:6px}[data-layout=table] .search-result-icon{width:18px;height:20px;font-size:13px}[data-layout=table] .search-result-body{grid-template-columns:minmax(0,1fr);gap:1px}[data-layout=table] .search-result-title{font-size:11px;line-height:1.3}[data-layout=table] .search-result-excerpt{font-size:10px;line-height:1.3}[data-layout=table] .search-result-meta{display:flex;flex-direction:column;align-items:flex-end;gap:1px;font-size:9px}[data-layout=table] .search-result-meta .knowledge-kind{max-width:100%;font-size:9px}
}

/* The reader uses WhatsApp's familiar dark chat palette, independent of the workspace. */
#library-workspace .library-chat-history,#library-chat-dialog .library-chat-history,.workspace-conversation-tab .library-chat-history {
  background-color:#0b141a;
  background-image:radial-gradient(circle at 1px 1px,#ffffff05 1px,transparent 0);
  background-size:24px 24px;
  padding:20px clamp(16px,4vw,64px);
}
.library-chat-history .library-stored-message {
  position:relative;width:fit-content;min-width:110px;max-width:min(78%,560px);
  margin:0 auto 10px 0;padding:7px 9px 5px;border:0;border-radius:0 8px 8px;
  background:#202c33;color:#e9edef;box-shadow:0 1px 1px #0003;
}
.library-chat-history .library-stored-message.from-me {background:#005c4b;border-radius:8px 0 8px 8px;margin-left:auto;margin-right:0}
.library-chat-history .library-stored-message::before {content:'';position:absolute;top:0;left:-7px;border-top:8px solid #202c33;border-left:8px solid transparent}
.library-chat-history .library-stored-message.from-me::before {left:auto;right:-7px;border-left:0;border-right:8px solid transparent;border-top-color:#005c4b}
.library-chat-history .library-stored-message.message-continuation {margin-top:-7px;border-radius:8px}
.library-chat-history .message-continuation::before {display:none}
.library-chat-history .library-stored-message>header {position:relative;min-height:20px;margin:0 0 3px;gap:4px;flex-wrap:nowrap;justify-content:flex-end}
.library-chat-history .library-stored-message .library-message-sender {margin-right:auto;font-size:12px;font-weight:600;color:#53bdeb;overflow-wrap:anywhere}
.library-chat-history [data-sender-color="1"] .library-message-sender {color:#a5d68c}
.library-chat-history [data-sender-color="2"] .library-message-sender {color:#e5a5d7}
.library-chat-history [data-sender-color="3"] .library-message-sender {color:#f5c477}
.library-chat-history [data-sender-color="4"] .library-message-sender {color:#7ad8c8}
.library-chat-history .from-me .library-message-sender {color:#a8e4cb}
.library-chat-history .library-stored-message .library-message-text {font:14px/1.45 "Segoe UI",sans-serif;color:#e9edef;margin:0;white-space:pre-wrap}
.library-message-meta {display:flex;justify-content:flex-end;gap:4px;font-size:10px;line-height:16px;color:#a5b5bd;margin:3px 0 0 28px}
.library-day {display:table;margin:10px auto 18px;padding:6px 12px;border-radius:8px;background:#18262e;color:#c0cbd0;font-size:11px;box-shadow:0 1px 2px #0003;text-align:center}
.library-message-toolbar {display:flex;align-items:center;gap:4px;flex:none;direction:ltr}
.library-chat-history .library-message-toolbar>button {min-width:20px;padding:0 3px;font-size:13px;line-height:20px;background:transparent;border:0;color:var(--muted-foreground)}
.library-message-toolbar>button,.library-message-toolbar .library-message-actions>summary {opacity:0}
.library-stored-message:hover .library-message-toolbar>button,.library-stored-message:hover .library-message-toolbar .library-message-actions>summary,
.library-stored-message:focus-within .library-message-toolbar>button,.library-stored-message:focus-within .library-message-toolbar .library-message-actions>summary,
.library-message-toolbar .library-message-actions[open]>summary,.library-chat-history .library-message-star[aria-pressed=true] {opacity:1}
.library-chat-history .library-message-star[aria-pressed=true] {color:#f5ce68}
.library-reaction-picker {width:min(360px,calc(100vw - 32px));padding:16px;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--foreground)}
.library-reaction-picker::backdrop {background:#0005}
.library-reaction-choices {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin-bottom:12px}
.library-reaction-choices button {padding:6px 0;font-size:22px;line-height:1.25}
.library-reaction-picker .library-notice {padding:6px 8px;margin-bottom:8px;border-radius:6px}
.library-reply-quote {display:flex;flex-direction:column;gap:4px;width:100%;max-width:100%;min-width:150px;text-align:start;border:0;border-left:4px solid #06cf9c;border-radius:5px;padding:8px 10px;margin:0 0 6px;background:#0003;color:#d7dfe3;font-size:12px;cursor:pointer}
.library-reply-quote:disabled {opacity:1;cursor:default}
.library-reply-quote strong {color:#65d9b4;font-size:12px}
.library-reply-quote span {display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap}
.library-reply-quote small {font-size:10px;color:#9aadb6}
.library-reply-quote.has-thumbnail {position:relative;padding-right:64px;min-height:60px}
.library-quote-thumbnail {position:absolute;right:0;top:0;width:58px;height:100%;object-fit:cover;border-radius:0 5px 5px 0}
.library-attachment {max-width:100%;margin:3px 0 5px}
.library-photo-button {display:block;max-width:100%;padding:0;border:0;border-radius:6px;background:#15232b;overflow:hidden;cursor:zoom-in}
.library-inline-media {display:block;width:320px;max-width:100%;border-radius:6px}
img.library-inline-media {height:240px;object-fit:contain;background:#111b21}
video.library-inline-media {height:220px;background:#111b21}
audio.library-inline-media {height:48px;width:300px}
.library-sticker img {width:160px;height:160px;background:transparent}
.library-sticker .library-photo-button {background:transparent}
.library-chat-history .library-save-file {display:block;padding:3px 0;border:0;background:transparent;color:#8edec9;font-size:11px;text-align:start;overflow-wrap:anywhere;max-width:100%}
.library-chat-history .library-file {color:#aebfc7;font-size:12px;padding:12px 4px}
.library-enrichment {font-size:12px;margin:8px 0 4px;color:#aebfc7}
.library-enrichment summary {cursor:pointer;font-size:11px}
.library-photo-dialog {max-width:94vw;max-height:94dvh;padding:12px;border:1px solid #38454d;border-radius:12px;background:#111b21;color:#e9edef}
.library-photo-dialog::backdrop {background:#000c}
.library-photo-dialog>button {display:block;margin:0 0 12px auto}
.library-photo-dialog>img {display:block;max-width:88vw;max-height:calc(90dvh - 70px);object-fit:contain}
.library-attachment [hidden] {display:none!important}
@media(max-width:620px) {
  .library-chat-history .library-stored-message {max-width:94%}
  .library-message-toolbar>button,.library-message-toolbar .library-message-actions>summary {opacity:1}
  .library-reply-quote {min-width:0}
}
@media(prefers-reduced-motion:reduce) {.library-chat-history {scroll-behavior:auto}}
.library-message-actions{position:relative;z-index:2}.library-message-actions>summary{list-style:none;cursor:pointer;color:var(--muted-foreground);padding:0 4px}.library-message-actions>summary::-webkit-details-marker{display:none}.library-message-action-items{position:absolute;inset-inline-end:0;top:100%;display:grid;min-width:190px;padding:6px;border:1px solid var(--border);border-radius:8px;background:var(--card);box-shadow:0 8px 24px #0003}.library-message-action-items button{text-align:start;white-space:normal;width:100%}

.workspace-items{padding:24px;overflow:auto}.workspace-items .workspace-view-heading{display:flex;justify-content:space-between;align-items:center}.item-search-label{display:block;max-width:520px;margin:20px 0}.workspace-item-list{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr))}.workspace-item-card{padding:18px;border:1px solid var(--border,#2b3245);border-radius:12px;background:var(--card,#171b28)}.workspace-item-card.due{border-color:#d6a94b}.workspace-item-meta{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;font-size:12px;color:var(--muted-foreground,#a0abc1)}.workspace-item-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:14px 0;color:var(--foreground,#ebedf5)}.workspace-item-actions{display:flex;gap:8px;flex-wrap:wrap}.workspace-items-due{margin:12px 0}.workspace-item-editor{max-height:90vh;overflow:auto}.workspace-item-editor select,.workspace-item-editor textarea,.workspace-item-editor input{width:100%;min-width:0}.workspace-item-editor select{max-width:100%}.workspace-item-editor textarea{resize:vertical}.workspace-item-editor form{display:grid;gap:12px}

.item-search-label{display:grid;gap:8px;color:var(--muted-foreground);font-size:12px}.item-search-label input{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--foreground);font:inherit}.workspace-items>p{color:var(--muted-foreground);font-size:13px}.workspace-item-editor .chat-editor-field{display:grid;gap:7px;color:var(--muted-foreground)}.workspace-item-editor select,.workspace-item-editor textarea,.workspace-item-editor input{padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--foreground);font:inherit}

/* Notes are a reading and writing surface, with source controls kept secondary. */
#workspace-notes {display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:16px clamp(16px,2vw,24px) 24px}
#workspace-notes[hidden] {display:none}
#workspace-notes .workspace-view-heading {flex:none;gap:16px;margin:0}
#workspace-notes .workspace-view-heading h2 {font-size:25px;letter-spacing:-.6px}
#workspace-notes>p {margin:8px 0 22px;line-height:1.6}
.notes-toolbar {display:flex;gap:16px;align-items:center;flex:none;margin-top:10px}
.notes-result-count {font-size:12px;color:var(--muted-foreground);white-space:nowrap}
.notes-scope-filters {display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 14px;flex:none}
.workspace-items {padding:16px clamp(16px,2vw,24px) 24px}
.workspace-items .item-page-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 14px;min-height:42px}
.item-page-title {min-width:0;flex:1}
.workspace-items .item-page-title h2,#workspace-notes .item-page-title h2 {margin:0;font-size:23px;line-height:1.15;letter-spacing:-.5px}
.workspace-items .item-page-title p {margin:2px 0 0;color:var(--muted-foreground);font-size:12px;line-height:1.35}
.item-page-tools {display:flex;align-items:center;gap:8px;flex:none;min-width:0}
.workspace-items .item-add-button,.workspace-items .item-icon-button {display:grid;place-items:center;flex:none;width:40px;height:40px;min-width:40px;padding:0;border-radius:9px;line-height:1}
.item-page-tools .item-icon-button {display:grid;place-items:center;flex:none;width:40px;height:40px;min-width:40px;padding:0;border-radius:9px;line-height:1;background:var(--card);color:var(--foreground);border:1px solid var(--border);cursor:pointer}
.item-page-tools .item-icon-button:hover {background:var(--secondary)}
.workspace-items .item-add-button {font-size:25px;font-weight:400}
.workspace-items .item-icon-button {background:var(--card);color:var(--foreground);border:1px solid var(--border);cursor:pointer}
.workspace-items .item-icon-button:hover {background:var(--secondary)}
.item-icon-button svg {width:18px;height:18px}
.item-search-control {display:flex;align-items:center;gap:0;position:relative;min-width:40px}
.item-search-control .item-search-label {display:block;max-width:0;width:0;min-width:0;margin:0;overflow:hidden;opacity:0;visibility:hidden;transition:max-width .22s ease,width .22s ease,opacity .15s ease}
.item-search-control.is-expanded .item-search-label {width:clamp(130px,24vw,340px);max-width:340px;margin-inline-start:8px;opacity:1;visibility:visible;overflow:visible}
.item-search-control .item-search-label input {box-sizing:border-box;width:100%;height:40px;padding:8px 12px;font-size:12px}
.item-search-control.is-loading .item-search-label input {padding-inline-end:34px}
.item-search-spinner {display:none;position:absolute;inset-inline-end:12px;top:50%;width:15px;height:15px;margin-top:-8px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:item-search-spin .7s linear infinite;pointer-events:none}
.item-search-control.is-expanded.is-loading .item-search-spinner {display:block}
#workspace-media {padding:16px clamp(16px,2vw,24px) 24px}
#workspace-media .item-page-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 14px;min-height:42px}
#workspace-media .item-page-title h2 {margin:0;font-size:23px;line-height:1.15}
#workspace-media .item-page-title p {margin:2px 0 0;color:var(--muted-foreground);font-size:12px;line-height:1.35}
#workspace-media .media-toolbar {margin:10px 0 14px}
#workspace-media .media-toolbar label:first-child {flex:none}
@keyframes item-search-spin {to {transform:rotate(360deg)}}
.notes-scope-filter {display:flex;align-items:center;gap:8px;border:1px solid transparent;background:transparent;color:var(--muted-foreground);border-radius:8px;padding:8px 12px;font:inherit;font-size:12px}
.notes-scope-filter:hover {background:var(--secondary);color:var(--foreground)}
.notes-scope-filter[aria-pressed=true] {background:var(--accent);color:var(--foreground);border-color:var(--border)}
.notes-filter-count {font-size:10px;font-variant-numeric:tabular-nums;min-width:16px;text-align:center;opacity:.75}
#notes-list {flex:1;min-height:0;overflow:auto;align-content:start;align-items:start;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:16px;padding:3px 4px 20px;scrollbar-width:thin}
.workspace-note-card {display:flex;flex-direction:column;min-width:0;padding:0;overflow:hidden;border-radius:12px;box-shadow:0 2px 6px #00000008;transition:border-color .15s}
.workspace-note-card:hover,.workspace-note-card:focus-within {border-color:var(--primary)}
.workspace-note-source {padding:16px 18px 0;font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.workspace-note-source::before {content:'▤';color:var(--warning-text,#c7a464);font-size:15px}
.workspace-note-source>span {flex:1;min-width:0}
.workspace-note-card[data-scope=message] .workspace-note-source::before {content:'↳';color:var(--primary)}
.workspace-note-card[data-scope=topic] .workspace-note-source::before {content:'◇';color:var(--primary)}
.workspace-note-open {display:block;width:100%;min-width:0;border:0;background:transparent;padding:14px 18px 18px;text-align:start;color:var(--foreground);font:inherit;cursor:pointer}
.workspace-note-open:hover {background:transparent}
.workspace-note-open .workspace-item-text {display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden;margin:0;font-size:14px;line-height:1.7;font-weight:400;min-height:72px}
.workspace-note-open .workspace-item-text::first-line {font-weight:600}
.workspace-note-card .workspace-item-actions {margin-top:auto;border-top:1px solid var(--border);padding:9px 12px;justify-content:space-between;background:color-mix(in srgb,var(--background) 30%,var(--card))}
.workspace-note-card .workspace-item-actions button {font-size:11px;padding:6px 8px;background:transparent;border-color:transparent;color:var(--muted-foreground)}
.workspace-note-card .workspace-item-actions button:hover {color:var(--foreground);background:var(--secondary)}
.workspace-items-empty {grid-column:1/-1;display:flex;flex-direction:column;align-items:center;text-align:center;padding:54px 20px;color:var(--muted-foreground)}
.workspace-items-empty-icon {display:grid;place-items:center;width:54px;height:54px;margin-bottom:18px;border:1px solid var(--border);border-radius:15px;color:var(--warning-text);background:var(--card);font-size:27px}
.workspace-items-empty h3 {color:var(--foreground);font-size:18px;line-height:1.5;margin:0 0 8px;font-weight:600}
.workspace-items-empty p {max-width:420px;font-size:13px;line-height:1.7;margin:0 0 20px}
.workspace-item-editor {width:min(680px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);box-sizing:border-box;padding:0;overflow:hidden;border-radius:16px;box-shadow:0 24px 90px #0005}
.workspace-item-editor form {display:flex;flex-direction:column;max-height:calc(100dvh - 26px);gap:0;min-height:0}
.item-editor-heading {display:flex;align-items:center;gap:13px;padding:24px 26px 20px;flex:none;border-bottom:1px solid var(--border)}
.item-editor-heading>div {min-width:0}
.item-editor-heading h2 {margin:0;font-size:21px;line-height:1.4}
.item-editor-heading .chat-editor-subtitle {margin:4px 0 0;font-size:12px;line-height:1.5}
.item-editor-icon {display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:var(--secondary);color:var(--warning-text);font-size:23px;flex:none}
.item-editor-body {padding:22px 26px;overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin}
.workspace-item-editor .chat-editor-field {margin:0;font-size:12px;line-height:1.5;min-width:0}
.reminder-time-fields {display:grid;gap:12px;padding:14px;background:var(--secondary);border:1px solid var(--border);border-radius:10px}
.reminder-presets {display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.reminder-presets-label {font-size:11px;color:var(--muted-foreground);margin-right:2px}
.reminder-preset {font-size:11px;padding:6px 9px}
.reminder-quick-times {display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.reminder-quick-times .reminder-preset {min-height:36px;padding:7px 12px;border-radius:9px;font-size:12px;color:var(--foreground);background:var(--secondary)}
.reminder-quick-times .reminder-preset:hover,.reminder-quick-times .reminder-preset:focus-visible {border-color:var(--primary);background:var(--accent)}
.reminder-expand {display:inline-flex;align-items:center;gap:6px;padding:7px 0;margin:0 0 12px;border:0;background:transparent;color:var(--muted-foreground);font-size:12px}
.reminder-expand::after {content:'⌄';font-size:15px;line-height:1}.reminder-expand[aria-expanded=true]::after {content:'⌃'}
.reminder-expand:hover,.reminder-expand:focus-visible {color:var(--foreground);background:transparent;filter:none}
.reminder-advanced-options {display:grid;gap:14px;padding:16px;margin-top:0;background:var(--secondary);border:1px solid var(--border);border-radius:11px}
.reminder-advanced-options .item-link-fields {margin:0;padding:0;background:transparent}
.workspace-item-editor:not(.workspace-note-editor) .item-writing-field input {height:44px;padding:10px 13px;font-size:14px;font-weight:400;background:var(--background);border-radius:10px;box-sizing:border-box}
.workspace-item-context {display:inline-grid;place-items:center;width:17px;height:17px;border:1px solid var(--border);border-radius:50%;color:var(--primary);font-size:11px;cursor:help}
.workspace-calendar-button {margin-inline-start:auto}
.workspace-item-editor .item-writing-field {color:var(--foreground);font-weight:600;gap:10px}
.workspace-item-editor .item-writing-field textarea {font-size:15px;font-weight:400;line-height:1.75;padding:16px;min-height:140px;max-height:42dvh;background:var(--background);resize:vertical;border-radius:10px;box-sizing:border-box}
.workspace-note-editor .item-writing-field textarea {min-height:220px}
.workspace-item-editor :is(textarea,input,select):focus-visible {outline:2px solid var(--primary);outline-offset:2px}
.workspace-select {position:relative;min-width:0}
.workspace-select-native {position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;inset:auto auto 0 0}
.workspace-select-trigger {display:flex;align-items:center;width:100%;min-width:0;min-height:42px;padding:10px 34px 10px 12px;text-align:left;font-size:12px;font-weight:400;line-height:1.4;color:var(--foreground);background:var(--card);border:1px solid var(--border);border-radius:8px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workspace-select-trigger::after {content:'⌄';position:absolute;right:12px;top:50%;transform:translateY(-55%);font-size:16px;line-height:1;color:var(--muted-foreground);pointer-events:none}
.workspace-select-trigger:hover:not(:disabled),.workspace-select[data-open=true] .workspace-select-trigger {background:var(--secondary);border-color:var(--primary);filter:none}
.workspace-select[data-open=true] .workspace-select-trigger::after {content:'⌃';color:var(--primary)}
.workspace-select-trigger:focus-visible {outline:2px solid var(--primary);outline-offset:2px}
.workspace-select-menu {display:none;position:absolute;z-index:30;left:0;right:0;top:calc(100% + 6px);max-height:min(280px,35dvh);overflow:auto;padding:6px;background:var(--card);border:1px solid var(--border);border-radius:10px;box-shadow:0 14px 34px #0006;scrollbar-width:thin}
.workspace-select[data-open=true] .workspace-select-menu {display:grid;gap:2px}
.workspace-select-option {display:block;width:100%;min-width:0;padding:9px 10px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:6px;background:transparent;color:var(--foreground);font-size:12px;font-weight:400}
.workspace-select-option:hover:not(:disabled),.workspace-select-option:focus-visible,.workspace-select-option[aria-selected=true] {background:var(--accent);color:var(--foreground);filter:none}
.workspace-select-option[aria-selected=true] {font-weight:600}
.workspace-select-option[aria-selected=true]::after {content:'✓';float:right;margin-left:10px;color:var(--primary)}
.workspace-select-option:disabled {opacity:.55;cursor:default}
.item-writing-meta {display:flex;justify-content:space-between;gap:12px;font-size:10px;line-height:1.5;color:var(--muted-foreground);margin:8px 0 22px}
.item-text-length {white-space:nowrap;font-variant-numeric:tabular-nums}
.item-link-fields {display:grid;grid-template-columns:minmax(120px,.7fr) minmax(0,1.3fr);gap:14px;padding:16px;background:var(--secondary);border-radius:10px;margin-bottom:16px}
.item-link-fields .chat-editor-field:has(#item-message),.item-link-fields>button {grid-column:1/-1}
.item-link-fields select {text-overflow:ellipsis;font-size:12px}
.workspace-item-editor .chat-editor-actions {flex:none;display:flex;align-items:center;gap:8px;margin:0;padding:16px 26px;border-top:1px solid var(--border);background:var(--card)}
.workspace-item-editor .chat-editor-actions>button {font-size:13px;padding:9px 15px}
.item-editor-status {flex:1;font-size:11px;color:var(--muted-foreground);line-height:1.4;min-width:0}
.item-delete-button {color:var(--muted-foreground)}
.item-delete-confirm {display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px;background:var(--danger-bg);border:1px solid var(--danger-line);border-radius:9px;font-size:12px}
.item-delete-confirm>span {flex:1;min-width:130px}
.workspace-item-editor [hidden] {display:none!important}
.workspace-item-editor .chat-action-error:empty {display:none}
.workspace-item-editor .chat-action-error {font-size:12px;line-height:1.5;margin:12px 0 0}

/* The existing multi-note chat editor shares the same writing treatment. */
.chat-notes-dialog {width:min(680px,calc(100vw - 24px));border-radius:16px}
.chat-notes-dialog .chat-notes-help {margin-top:10px;font-size:12px}
.chat-notes-dialog .chat-note-row {padding:16px;border-radius:12px;background:var(--card)}
.chat-notes-dialog .chat-note-heading {margin-bottom:10px}
.chat-notes-dialog .chat-note-scope {font-size:11px;letter-spacing:0}
.chat-notes-dialog .chat-note-row textarea {font-size:15px;line-height:1.75;background:var(--background);border-radius:9px;min-height:132px}
.chat-notes-dialog .chat-note-length {opacity:.65}
.chat-notes-dialog .chat-note-remove {border:0;background:transparent;font-size:11px}
.chat-notes-dialog .chat-note-source {background:var(--secondary);border-left-color:var(--warning-text);border-radius:6px}
@media(max-width:620px) {
  #workspace-notes {padding:12px}
  #workspace-notes .workspace-view-heading h2 {font-size:22px}
  .workspace-items {padding:12px}
  .workspace-items .item-page-heading {align-items:flex-start;gap:8px}
  .workspace-items .item-page-title h2,#workspace-notes .item-page-title h2 {font-size:21px}
  .workspace-items .item-page-title p {font-size:11px}
  .item-search-control.is-expanded .item-search-label {width:min(34vw,190px)}
  #workspace-media {padding:12px}
  .notes-scope-filters {gap:3px;margin:12px 0}
  .notes-scope-filter {padding:7px 8px;font-size:11px;gap:4px}
  .notes-toolbar {gap:10px}
  .item-editor-heading {padding:18px 16px;gap:10px}
  .item-editor-heading h2 {font-size:19px}
  .item-editor-heading .chat-editor-subtitle {font-size:11px}
  .item-editor-body {padding:16px}
  .workspace-note-editor .item-writing-field textarea {min-height:170px}
  .item-link-fields {grid-template-columns:minmax(0,1fr);gap:12px;padding:12px}
  .workspace-item-editor .chat-editor-actions {padding:12px;gap:6px}
  .workspace-item-editor .chat-editor-actions>button {padding:8px 10px;font-size:12px}
  .item-save-shortcut {display:none}
  .chat-notes-dialog .chat-note-row {padding:12px}
}
.workspace-task-checklist{list-style:none;margin:10px 0;padding:0;display:grid;gap:7px}.workspace-task-checklist label{display:flex;align-items:flex-start;gap:8px;line-height:1.5;cursor:pointer;overflow-wrap:anywhere}.workspace-task-checklist input{width:auto;min-width:auto;margin-top:4px;flex:none}.workspace-task-checklist input:checked+span{text-decoration:line-through;opacity:.65}
#tasks-list {grid-template-columns:repeat(auto-fill,minmax(min(100%, 460px),1fr))}
.workspace-task-checklist-wrap {min-width:0;margin:14px 0 0;padding:10px 12px;border:1px solid var(--border);border-radius:8px}
.workspace-task-checklist-wrap legend {padding-inline:4px;color:var(--muted-foreground);font-size:12px}

#reminder-notification-tray{position:fixed;z-index:90;inset:auto 18px 18px auto;display:grid;gap:10px;width:min(380px,calc(100vw - 36px));pointer-events:none}
.reminder-alert{display:grid;gap:7px;padding:15px 16px;border:1px solid color-mix(in srgb,var(--primary) 70%,var(--border));border-radius:13px;background:var(--card);box-shadow:0 14px 42px #0003;pointer-events:auto;animation:reminder-alert-in .18s ease-out}
.reminder-alert strong{font-size:14px;overflow-wrap:anywhere}.reminder-alert>span{font-size:12px;color:var(--muted-foreground)}
.reminder-alert-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:3px}.reminder-alert-actions button{font-size:12px;padding:7px 10px}.reminder-alert-error:empty{display:none}.reminder-alert-error{margin:0;color:var(--danger-text);font-size:12px}
@keyframes reminder-alert-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(max-width:620px){#reminder-notification-tray{inset:auto 12px 12px auto;width:calc(100vw - 24px)}}

/* Flow library */
.actions-workspace { min-width: 0; padding:16px clamp(16px,2vw,24px) 24px; }
.actions-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.actions-heading h2, .actions-heading h3 { margin: 0; }
.actions-heading-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions-heading p, .actions-help { color: var(--muted-foreground); font-size: 12px; line-height: 1.7; }
.actions-workspace > .actions-heading { margin-bottom:14px; }
.actions-workspace > .actions-heading h2 { font-size:23px;line-height:1.15; }
.actions-workspace > .actions-heading p { margin:2px 0 0;line-height:1.35; }
.actions-heading-tools .item-add-button { display:grid;place-items:center;width:40px;height:40px;padding:0;font-size:25px;font-weight:400;line-height:1; }
.actions-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.action-card { position: relative; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); min-width: 0; }
.action-card h3 { font-size: 15px; overflow-wrap: anywhere; }
.action-language-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-top: 20px; }
.action-language-tab { border: 1px solid transparent; border-radius: 7px; padding: 8px 12px; background: transparent; color: var(--muted-foreground); font-size: 13px; }
.action-language-tab[aria-selected=true] { background: var(--accent); color: var(--primary); border-color: var(--border); font-weight: 600; }
.action-language-tab:focus-visible, .action-quick-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.action-card-heading-controls { display: flex; align-items: center; gap: 4px; flex: none; }
.action-quick-toggle { display: grid; place-items: center; width: 32px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--muted-foreground); font-size: 22px; line-height: 1; }
.action-quick-toggle[aria-pressed=true] { color: var(--primary); background: var(--accent); border-color: var(--border); }
.action-quick-toggle[aria-disabled=true] { opacity: .55; cursor: wait; }
.action-quick-toggle > span { font-size: 20px; line-height: 1; }
.action-description { margin: 12px 0; min-height: 42px; font-size: 13px; line-height: 1.6; color: var(--muted-foreground); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.action-modes { font-size: 11px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.action-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.action-controls button { font-size: 12px; }
.action-card > .action-controls { border-top: 1px solid var(--border); padding-top: 14px; }
.action-more { position: relative; flex: none; }
.action-more > summary { display: grid; place-items: center; list-style: none; cursor: pointer; width: 30px; height: 28px; border-radius: 6px; color: var(--muted-foreground); font-size: 20px; line-height: 1; }
.action-more > summary::-webkit-details-marker { display: none; }
.action-more > summary:hover, .action-more[open] > summary { background: var(--accent); color: var(--foreground); }
.action-more > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.action-menu-items { position: absolute; inset-inline-end: 0; top: 34px; min-width: 160px; display: grid; gap: 3px; z-index: 12; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); box-shadow: 0 8px 24px #0002; }
.action-menu-items > button { border: 0; background: transparent; color: var(--foreground); text-align: start; font-size: 12px; padding: 8px 10px; }
.action-menu-items > button:hover:not(:disabled) { background: var(--accent); }

/* Editor and shared dialogs */
.action-dialog { width: min(700px, calc(100vw - 24px)); max-height: 90dvh; overflow: auto; background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.action-dialog::backdrop { background: #0008; }
.action-dialog h2 { margin: 0 0 18px; font-size: 20px; }
.action-dialog.flow-dialog { width: min(1280px, calc(100vw - 24px)); max-height: 94dvh; padding: 20px; }
.action-editor { display: grid; gap: 16px; min-width: 0; }
.action-identity { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); gap: 16px; align-items: end; }
.action-field { display: grid; gap: 6px; font-size: 12px; color: var(--muted-foreground); }
.action-field input, .action-field textarea, .action-field select { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--background); color: var(--foreground); font: inherit; }
.action-field textarea { resize: vertical; font-size: 13px; line-height: 1.6; }
.action-identity input { font-size: 15px; }
.action-check { display: flex; align-items: center; gap: 9px; font-size: 12px; padding: 5px 0; }
.action-check input { width: 16px; height: 16px; flex: none; accent-color: var(--primary); }
.action-context-settings { border-top: 1px solid var(--border); padding-top: 12px; font-size: 12px; }
.action-context-settings > summary, .action-advanced-settings > summary { cursor: pointer; color: var(--muted-foreground); }
.action-context-settings[open] > summary, .action-advanced-settings[open] > summary { color: var(--foreground); }
.action-context-body { display: grid; gap: 14px; padding-top: 14px; }
.action-context-body > .actions-help { margin: 0; }
.action-advanced-settings { border-top: 1px solid var(--border); padding-top: 12px; }
.action-advanced-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; padding-top: 14px; }
.action-advanced-body > .action-check { grid-column: 1 / -1; }
.action-source-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-source-columns fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 7px; }
.action-source-columns legend { font-size: 12px; color: var(--muted-foreground); }
.action-source-list { max-height: 200px; overflow: auto; }
.action-source-list span { overflow-wrap: anywhere; }
.action-source-unavailable { color: var(--danger-text, #b66054); }
.action-import-notice { border-inline-start: 2px solid var(--primary); padding: 2px 12px; color: var(--muted-foreground); font-size: 12px; line-height: 1.6; }
.action-import-notice p { margin: 0; }
.action-import-notice ul { margin: 8px 0 0; padding-inline-start: 18px; overflow-wrap: anywhere; }
.action-settings-footer { border-top: 1px solid var(--border); padding-top: 12px; }
.action-settings-footer button { font-size: 11px; }
.flow-dialog .action-editor > .action-controls { position: sticky; bottom: -20px; z-index: 2; justify-content: flex-end; padding: 12px 0 2px; margin-top: 0; border-top: 1px solid var(--border); background: var(--card); }
.action-picker { display: grid; gap: 10px; }
.action-picker button { text-align: start; white-space: normal; }
.action-error, #actions-status.error { font-size: 12px; line-height: 1.6; color: var(--danger-text, #b66054); overflow-wrap: anywhere; }
.action-error:empty, #actions-status:empty { display: none; }
.action-discard-warning { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); }
.action-discard-warning p { font-size: 12px; margin: 0; flex: 1 1 240px; }
.action-discard-warning button { font-size: 11px; }
.action-retry-dialog { width: min(460px, calc(100vw - 24px)); }
.action-retry-dialog .action-controls { justify-content: flex-end; }
.action-retry-dialog .actions-help { font-size: 14px; }

/* Runs and optional inspection */
.actions-history-heading { margin-top: 32px; }
.action-run { border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 15px; margin: 12px 0; }
.action-run > summary { cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
.action-run-steps { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 16px 0; }
.action-run-steps li { font-size: 11px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.action-run-steps [data-state=running] { border-color: var(--primary); color: var(--primary); }
.action-run-steps [data-state=completed] { color: var(--success-text); background: var(--success-bg); border-color: var(--success-line); }
.action-run-steps [data-state=prepared] { border-style: dashed; color: var(--primary); }
.action-run-steps [data-state=skipped] { color: var(--muted-foreground); border-style: dashed; }
.action-run-steps [data-state=failed] { color: var(--danger-text); }
.action-answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.8; }
.action-task-list li { padding: 7px; line-height: 1.6; }
.action-task-list small, .action-plan { color: var(--muted-foreground); font-size: 12px; }
.action-sources { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.action-sources-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.action-sources-heading h5 { margin: 0; font-size: 13px; font-weight: 600; }
.action-sources-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding-inline: 5px; border-radius: 6px; background: var(--muted); color: var(--foreground); font-size: 11px; font-variant-numeric: tabular-nums; }
.action-sources-kind { margin-inline-start: auto; color: var(--muted-foreground); font-size: 12px; }
.action-source-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.action-source-cards > li { min-width: 0; }
.action-source-cards > li[hidden] { display: none; }
.action-source-card { display: flex; flex-direction: column; gap: 12px; width: 100%; height: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); color: var(--foreground); text-align: start; white-space: normal; font-weight: 400; cursor: pointer; transition: border-color .15s, background-color .15s; }
.action-source-card:hover { border-color: var(--primary); background: var(--accent); }
.action-source-card:focus-visible, .action-sources-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.action-source-meta { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.action-source-number { display: grid; place-items: center; flex: none; min-width: 24px; height: 24px; padding-inline: 4px; border: 1px solid var(--border); border-radius: 6px; color: var(--primary); font-size: 11px; font-weight: 600; }
.action-source-sender { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.action-source-time { flex: none; margin-inline-start: auto; color: var(--muted-foreground); font-size: 11px; font-variant-numeric: tabular-nums; }
.action-source-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; width: 100%; font-size: 13px; line-height: 1.6; }
.action-source-footer { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; }
.action-source-chat { color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-source-open { display: flex; align-items: center; gap: 5px; flex: none; margin-inline-start: auto; color: var(--primary); font-weight: 500; }
.action-sources-toggle { display: block; min-height: 40px; margin: 10px auto 0; padding: 8px 16px; font-size: 12px; }
.action-node-trace { font-size: 12px; margin: 12px 0; color: var(--muted-foreground); }
.action-node-trace summary { cursor: pointer; }
.action-node-trace > details { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.action-node-trace pre { font: 12px/1.7 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; color: var(--foreground); tab-size: 2; }
.action-node-trace h5 { font-size: 11px; margin: 12px 0 5px; font-weight: 600; }
.action-node-trace > details > details { margin-top: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.action-node-trace > details > details > summary { font-size: 11px; }
.action-node-trace [data-node-state=skipped] { opacity: .65; }
.action-node-trace [data-node-state=failed] > summary { color: var(--danger-text); }
.action-node-trace [data-node-state=running] > summary, .action-node-trace [data-node-state=prepared] > summary { color: var(--primary); }
.action-test-notice { margin: 14px 0; padding: 10px 12px; border-inline-start: 2px solid var(--primary); color: var(--muted-foreground); font-size: 12px; line-height: 1.6; }
.action-run[data-test-only=true] > summary { color: var(--primary); }

@media (max-width: 650px) {
  .actions-workspace > .workspace-view-heading { flex-wrap: wrap; }
  .action-dialog, .action-dialog.flow-dialog { padding: 14px; }
  .action-source-columns, .action-advanced-body { grid-template-columns: minmax(0, 1fr); }
  .action-identity { grid-template-columns: minmax(0, 1fr); }
  .action-advanced-body > .action-check { grid-column: auto; }
  .flow-dialog .action-editor > .action-controls { bottom: -14px; }
  .actions-heading { align-items: flex-start; }
  .action-run-steps { display: grid; grid-template-columns: 1fr 1fr; }
}

.action-flow-editor {
  --flow-primary: var(--primary, #147b61);
  --flow-border: var(--border, #dce6e4);
  --flow-card: var(--card, #fff);
  --flow-bg: var(--background, #f5f8f7);
  --flow-text: var(--foreground, #213b46);
  --flow-muted: var(--muted-foreground, #71818a);
  min-width: 0;
  border: 1px solid var(--flow-border);
  border-radius: 10px;
  overflow: clip;
  color: var(--flow-text);
  background: var(--flow-card);
}

/* The canvas is the main view; secondary commands stay in disclosures. */
.flow-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--flow-border); position: relative; z-index: 10; }
.flow-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.flow-toolbar-actions > button { padding: 5px 8px; font-size: 11px; background: none; color: var(--flow-muted); border: 0; }
.flow-history-tools { display: flex; gap: 2px; }
.flow-history-tools button { width: 27px; height: 27px; padding: 0 !important; font-size: 18px !important; line-height: 1; background: none; border: 0; color: var(--flow-muted); }
.flow-history-tools button:disabled { opacity: .3; }
.flow-add-menu { position: relative; font-size: 12px; }
.flow-add-menu > summary { list-style: none; padding: 6px 11px; border: 1px solid var(--flow-border); border-radius: 6px; cursor: pointer; font-weight: 600; }
.flow-add-menu > summary::-webkit-details-marker { display: none; }
.flow-add-menu > summary::after { content: '⌄'; padding-left: 10px; color: var(--flow-muted); }
.flow-add-choices { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 180px; display: grid; gap: 2px; padding: 5px; background: var(--flow-card); border: 1px solid var(--flow-border); border-radius: 7px; box-shadow: 0 6px 18px #00000014; }
.flow-add-choices button { text-align: left; background: none; border: 0; color: var(--flow-text); padding: 9px 10px; font-size: 12px; }
.flow-add-menu:not([open]) > .flow-add-choices { display: none; }

.flow-body { display: grid; grid-template-columns: minmax(0, 1fr) 285px; grid-template-rows: minmax(0, 1fr); height: clamp(320px, calc(94dvh - 420px), 560px); min-height: 0; }
.flow-canvas { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.flow-viewport { overflow: auto; position: absolute; inset: 0; min-width: 0; min-height: 0; background-color: var(--flow-bg); background-image: radial-gradient(circle, color-mix(in srgb, var(--flow-muted) 17%, transparent) 1px, transparent 1px); background-size: 24px 24px; scrollbar-width: thin; overscroll-behavior: contain; touch-action: none; cursor: grab; }
.flow-viewport.panning { cursor: grabbing; }
.flow-scroll-space { position: relative; overflow: hidden; min-width: 100%; min-height: 100%; }
.flow-stage { position: absolute; transform-origin: 0 0; isolation: isolate; }
.flow-edges, .flow-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-edges { overflow: visible; pointer-events: none; color: var(--flow-muted); }
.flow-edge { fill: none; stroke: color-mix(in srgb, var(--flow-muted) 50%, transparent); stroke-width: 1.7; }
.flow-edge.selected { stroke: var(--flow-primary); color: var(--flow-primary); stroke-width: 2; }

/* Cards contain only the step type, description, and optional branch labels. */
.flow-node { position: absolute; width: 210px; min-height: 92px; border: 1px solid var(--flow-border); border-radius: 9px; background: var(--flow-card); cursor: grab; touch-action: none; user-select: none; outline: none; z-index: 1; transition: border-color .15s, box-shadow .15s; }
.flow-node.selected { border-color: var(--flow-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--flow-primary) 10%, transparent); z-index: 3; }
.flow-node:focus-visible { outline: 2px solid var(--flow-primary); outline-offset: 4px; }
.flow-node.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 5px 16px #00000012; }
.flow-node.connecting { border-style: dashed; }
.flow-node-heading { display: flex; align-items: center; gap: 7px; padding: 13px 14px 0; font-size: 11px; line-height: 1.3; font-weight: 500; color: var(--flow-muted); }
.flow-node-icon { width: 15px; font-size: 15px; line-height: 1; color: var(--flow-muted); }
.flow-node.selected .flow-node-icon { color: var(--flow-primary); }
.flow-node-description { margin: 9px 14px 14px; font-size: 14px; line-height: 1.45; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.flow-port { position: absolute !important; width: 10px !important; height: 10px !important; min-width: 10px !important; padding: 0 !important; border-radius: 50% !important; border: 2px solid var(--flow-card) !important; background: var(--flow-muted) !important; box-shadow: 0 0 0 1px var(--flow-muted); cursor: crosshair !important; z-index: 6; touch-action: manipulation; }
.flow-node.selected .flow-port, .flow-port.active { background: var(--flow-primary) !important; box-shadow: 0 0 0 1px var(--flow-primary); }
.flow-port:hover, .flow-port:focus-visible, .flow-port.active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--flow-primary) 22%, transparent) !important; outline: none; }
.flow-port-input { left: -5px; top: 45px; }
.flow-port-output { right: -5px; top: 45px; }
.flow-node-options { padding: 3px 0 6px; border-top: 1px solid var(--flow-border); }
.flow-option-row { position: relative; display: flex; align-items: center; justify-content: flex-end; min-height: 27px; padding: 4px 14px; font-size: 12px; text-align: right; }
.flow-option-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.flow-option-row .flow-port-output { top: 8px; }
.flow-option-empty { display: block; padding: 8px 14px; font-size: 11px; color: var(--flow-muted); }

.flow-inspector { border-left: 1px solid var(--flow-border); padding: 18px; overflow: auto; min-width: 0; min-height: 0; scrollbar-width: thin; display: flex; flex-direction: column; gap: 14px; }
.flow-inspector .flow-inspector-heading { margin: 0 0 2px !important; font-size: 14px !important; font-weight: 600; }
.flow-field { display: grid; gap: 6px; font-size: 11px; color: var(--flow-muted); font-weight: 500; }
.flow-field input, .flow-field textarea, .flow-field select { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--flow-border); border-radius: 6px; background: var(--flow-card); color: var(--flow-text); font: inherit; font-size: 12px; line-height: 1.5; font-weight: 400; }
.flow-field textarea { resize: vertical; }
.flow-field textarea#action-prompt { min-height: 120px; }
.flow-field small { font-size: 11px; line-height: 1.5; font-weight: 400; }
.flow-field input:focus-visible, .flow-field textarea:focus-visible, .flow-field select:focus-visible { outline: 2px solid color-mix(in srgb, var(--flow-primary) 70%, transparent); outline-offset: 2px; }
.flow-check { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.flow-check input { width: 15px; height: 15px; accent-color: var(--flow-primary); }
.flow-button-events { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--flow-border); border-radius: 7px; }
.flow-button-events legend { padding: 0 5px; font-size: 11px; font-weight: 600; color: var(--flow-muted); }
.flow-help { font-size: 11px; line-height: 1.6; color: var(--flow-muted); margin: 0; overflow-wrap: anywhere; }
.flow-connections, .flow-step-options { border-top: 1px solid var(--flow-border); padding-top: 12px; }
.flow-connections > summary, .flow-step-options > summary { cursor: pointer; color: var(--flow-muted); font-size: 12px; font-weight: 500; }
.flow-connections-body { display: grid; gap: 10px; padding-top: 12px; }
.flow-connections:not([open]) > .flow-connections-body, .flow-step-options:not([open]) > .flow-node-tools { display: none; }
.flow-connections-body > button { font-size: 11px; padding: 8px; }
.flow-connection-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; border-bottom: 1px solid var(--flow-border); padding: 5px 0 9px; font-size: 11px; }
.flow-connection-row > span { overflow-wrap: anywhere; min-width: 0; }
.flow-edge-tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.flow-remove-connection, .flow-insert-step { background: none !important; color: var(--flow-muted) !important; padding: 0 !important; width: 25px; height: 25px; flex-shrink: 0; font-size: 16px !important; }
.flow-node-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; }
.flow-node-tools > button { font-size: 11px; padding: 6px 8px; }
.flow-remove-node { color: var(--danger-text, #b66054) !important; background: none !important; white-space: normal !important; }

.flow-view-tools { position: absolute; z-index: 8; bottom: 12px; left: 12px; display: flex; align-items: center; gap: 1px; padding: 3px; border: 1px solid var(--flow-border); border-radius: 7px; background: var(--flow-card); }
.flow-view-tools button { background: none !important; color: var(--flow-muted) !important; font-size: 11px !important; padding: 5px 8px !important; min-width: 27px; line-height: 1.5; }
.flow-view-tools #flow-zoom-in, .flow-view-tools #flow-zoom-out { font-size: 17px !important; padding: 2px 8px !important; }
.flow-view-tools #flow-zoom-reset { min-width: 48px; font-variant-numeric: tabular-nums; }
.flow-view-tools #flow-fit { border-left: 1px solid var(--flow-border); margin-left: 3px; padding-left: 10px !important; border-radius: 0 5px 5px 0; }
.flow-view-tools #flow-fit[aria-pressed=true] { color: var(--flow-primary) !important; }
.flow-message { font-size: 11px; line-height: 1.5; margin: 0; color: var(--flow-muted); }
.flow-message:empty { display: none; }
.flow-message:not(:empty) { padding: 9px 14px; border-top: 1px solid var(--flow-border); }
.flow-message.error { color: var(--danger-text, #b66054); }

@media (max-width: 1000px) {
  .flow-body { grid-template-columns: minmax(0, 1fr) 265px; }
  .flow-inspector { padding: 15px; }
}
@media (max-width: 760px) {
  .flow-toolbar { padding: 10px 11px; gap: 7px; }
  .flow-toolbar-actions { gap: 4px; }
  .flow-toolbar-actions > button { padding: 5px; font-size: 10px; }
  .flow-add-menu > summary { padding: 6px 8px; }
  .flow-history-tools button { width: 25px; }
  .flow-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 360px auto; height: auto; }
  .flow-canvas { height: 360px; min-height: 0; }
  .flow-inspector { border-left: 0; border-top: 1px solid var(--flow-border); max-height: none; padding: 16px; }
  .flow-field textarea#action-prompt { min-height: 120px; }
  .flow-view-tools { left: 9px; bottom: 9px; }
}
@media (prefers-reduced-motion: reduce) { .flow-node { transition: none; } }

/* Theme tokens load last. Nightfall retains the original workspace palette. */
:root:not([data-theme="night"]) {
  color-scheme: light;
  --background: #f6f7fb;
  --foreground: #273248;
  --card: #ffffff;
  --sidebar: #ffffff;
  --primary: #6550c8;
  --primary-glow: #5842b7;
  --secondary: #f0eef9;
  --muted: #eef1f7;
  --muted-foreground: #626e82;
  --accent: #ebe6fc;
  --border: #dfe3ed;
  --line: var(--border);
  --surface-soft: #f8f9fc;
  --green: var(--primary);
  --dark: var(--foreground);
  --success-text: #246953;
  --success-bg: #e4f5eb;
  --success-line: #b9dfca;
  --warning-text: #865b17;
  --warning-bg: #fff4d9;
  --warning-line: #ecd59e;
  --danger-text: #ad3c30;
  --danger-bg: #fff0e9;
  --danger-line: #efc7bc;
  --chat-canvas: #f0f3f8;
  --chat-own: #ebe6fc;
}
:root[data-theme="mint"] {
  --background: #f2f8f6; --primary: #22756e; --primary-glow: #1b6862;
  --secondary: #eaf4ef; --accent: #dcefe7; --border: #d6e6df;
  --surface-soft: #f5faf7; --chat-canvas: #eef5f1; --chat-own: #ddf0e8;
}
:root[data-theme="sky"] {
  --background: #f3f7fc; --primary: #3268b5; --primary-glow: #285c9f;
  --secondary: #eaf1fb; --accent: #e0ecfc; --border: #d9e3f0;
  --surface-soft: #f6f9fd; --chat-canvas: #eef3fa; --chat-own: #e0ecfc;
}
:root[data-theme="whatsapp-mint"] {
  --background: #f2faf3; --foreground: #174634; --card: #ffffff; --sidebar: #ffffff;
  --primary: #1f654a; --primary-glow: #15533c; --secondary: #e8f5ea; --accent: #dff3c8;
  --muted: #edf6ed; --muted-foreground: #648171; --border: #d4e7d8; --surface-soft: #fbfdf9;
  --chat-canvas: #edf8ee; --chat-own: #ddf4c6; --success-text: #1f684c; --success-bg: #e4f5ea; --success-line: #bddfc8;
}
:root[data-theme="whatsapp-sand"] {
  --background: #fbf8ed; --foreground: #285047; --card: #fffefa; --sidebar: #fffefa;
  --primary: #247058; --primary-glow: #195944; --secondary: #f6f0d8; --accent: #e6f4cf;
  --muted: #f5f1e3; --muted-foreground: #75837b; --border: #e4dcc7; --surface-soft: #fffdf6;
  --chat-canvas: #f5f8ec; --chat-own: #e3f4cc; --success-text: #27684e; --success-bg: #e7f4e4; --success-line: #c8e3c5;
}

/* Legacy surfaces use explicit colors; keep their light equivalents together. */
:root:not([data-theme="night"]) {
  * { scrollbar-color: #bfc8d7 transparent; }
  body > .topbar { background: var(--card); box-shadow: 0 2px 14px #32456c05; }
  body > .workspace-tabs { background: linear-gradient(180deg, var(--card) 65%, var(--secondary)); }
  .brand-copy { border-color: var(--border); }
  .brand-logo[src="assets/kol-logo.png"], #appearance-logo-preview[src="assets/kol-logo.png"] {
    filter: brightness(0) saturate(100%) invert(34%) sepia(40%) saturate(1921%) hue-rotate(222deg) brightness(91%) contrast(88%);
  }
  .workspace-tabs button:hover:not(:disabled) { background: var(--secondary); color: var(--foreground); }
  .workspace-tabs button[aria-selected=true] { background: var(--accent); color: var(--primary); }
  .workspace-tabs button .workspace-nav-icon { color: var(--primary); }
  #workspace-tab-focus .workspace-nav-icon, #workspace-tab-reminders .workspace-nav-icon { color: #a2701d; }
  #workspace-tab-media .workspace-nav-icon { color: #298574; }
  #workspace-tab-search .workspace-nav-icon, #workspace-tab-notes .workspace-nav-icon { color: #3875b2; }
  .primary, button.primary, .chat-reply-actions .primary { color: white; background: var(--primary); }
  button.primary:hover:not(:disabled) { background: var(--primary-glow); }
  button.secondary, button.quiet { background: var(--secondary); color: var(--foreground); border-color: var(--border); }
  button.secondary:hover:not(:disabled), button.quiet:hover:not(:disabled) { border-color: var(--primary); }
  button.text-button, .library-row-actions button, .library-detail-links button,
  button.text-button:hover:not(:disabled), .library-open:hover:not(:disabled),
  .library-row-actions button:hover:not(:disabled), .connection-help code { color: var(--primary); }
  select option { background: var(--card); }
  input::placeholder, textarea::placeholder, .connection-field input::placeholder,
  .message-filters input::placeholder { color: #758196; }
  .eyebrow, .topbar .protected, .topbar .connection { color: var(--muted-foreground); }
  .capture-panel, .collection-editor, .library-activity-row { background: var(--surface-soft); border-color: var(--border); }
  .library-row.active { background: var(--accent); }
  .library-row:not(.active):hover { background: var(--secondary); }
  .metric strong, .library-open, .library-stored-message p,
  .library-stored-message header strong, .management-chat-name,
  .management-auto, .management-card summary, .connection-check,
  .connection-field, .collection-name-label, .library-capture-control,
  .library-destination, .library-activity, .spine-request-log > summary,
  .spine-log-action strong, .spine-log-fields dd, .spine-log-json h4,
  .spine-log-json pre, .health-list dd, .diagnostic-row strong,
  .access-note strong, .connection-sync-details dd, .spine-sync-totals dd,
  .connection-automation > summary, .workspace-advanced > summary,
  .spine-sync-settings > summary, #capture-status { color: var(--foreground); }
  .library-stored-message .library-file, .attachment-label,
  .library-enrichment h4, .library-enrichment > strong,
  .connection-field .field-state, .field-state { color: var(--primary); }
  .library-enrichment { border-left-color: var(--primary); color: var(--muted-foreground); }
  .badge, .direction, .library-kind, .library-tab-count, .chat-count,
  .library-transfer-pill, .spine-log-outcome.pending { color: var(--muted-foreground); background: var(--muted); border-color: var(--border); }
  .chat-avatar, .library-avatar, .library-kind.group, .badge.active,
  .direction.outgoing, .library-membership, .library-tabs button[aria-selected=true] {
    color: var(--primary); background: var(--accent); border-color: var(--border);
  }
  .library-notice, .connection-result, .connection-save-status,
  .spine-log-result, .badge.good, .spine-status, .spine-log-outcome,
  .library-transfer-pill.approved { color: var(--success-text); background: var(--success-bg); border-color: var(--success-line); }
  .badge.warning, .spine-status.warning, .library-notice.error,
  .connection-result.error, .connection-save-status.unsaved,
  .management-notice.error, .spine-log-result.error, .alert,
  .spine-log-entry.error .spine-log-outcome, .library-transfer-pill.excluded,
  .library-delete-confirm, .management-chat .management-mark.marked {
    color: var(--warning-text); background: var(--warning-bg); border-color: var(--warning-line);
  }
  .badge.danger, .spine-status.error { color: var(--danger-text); background: var(--danger-bg); border-color: var(--danger-line); }
  .management-chat .management-mark { color: var(--muted-foreground); }
  .progress-track { background: var(--accent); }
  .spine-log-entry > summary:hover, .spine-log-entry[open] > summary { background: var(--secondary); }
  .spine-log-action strong::before, .spine-request-log > summary::before { color: var(--primary); }
  #connections-dialog { box-shadow: 0 24px 90px #27324826; }
  dialog::backdrop, #connections-dialog::backdrop, #library-chat-dialog::backdrop { background: #27324866; }
  .focus-thread-card, .knowledge-result, .brief-card, .media-card, .workspace-item-card {
    box-shadow: 0 3px 14px #32456c06; border-radius: 14px;
  }
  .focus-thread-card { border-top: 3px solid #a99ae8; }
  .focus-thread-card:nth-child(3n+2) { border-top-color: #76bfa9; }
  .focus-thread-card:nth-child(3n+3) { border-top-color: #e5bc66; }
  .focus-thread-state { color: var(--primary); }
  #library-workspace .library-chat-history, #library-chat-dialog .library-chat-history,
  .workspace-conversation-tab .library-chat-history {
    background-color: var(--chat-canvas); background-image: none;
  }
  .library-chat-history .library-stored-message {
    background: var(--card); color: var(--foreground); border: 1px solid var(--border);
    border-radius: 14px; padding: 11px 13px; box-shadow: 0 2px 5px #27324804;
  }
  .library-chat-history .library-stored-message.from-me { background: var(--chat-own); border-radius: 14px; }
  .library-chat-history .library-stored-message::before { display: none; }
  .library-chat-history .library-stored-message .library-message-text { color: var(--foreground); }
  .library-chat-history .library-stored-message .library-message-sender { color: #326ca6; }
  .library-chat-history [data-sender-color="1"] .library-message-sender { color: #377449; }
  .library-chat-history [data-sender-color="2"] .library-message-sender { color: #6b50ad; }
  .library-chat-history [data-sender-color="3"] .library-message-sender { color: #89601b; }
  .library-chat-history [data-sender-color="4"] .library-message-sender { color: #26776d; }
  .library-chat-history .from-me .library-message-sender { color: var(--primary); }
  .library-message-meta, .library-chat-history .library-message-star,
  .library-chat-history .library-message-note { color: var(--muted-foreground); }
  .library-chat-history .library-message-star[aria-pressed=true] { color: #936513; }
  .library-day { color: var(--muted-foreground); background: var(--card); box-shadow: none; border: 1px solid var(--border); border-radius: 20px; }
  .library-reply-quote { background: #ffffff99; color: var(--foreground); border-left-color: var(--primary); }
  .library-reply-quote strong, .library-chat-history .library-save-file { color: var(--primary); }
  .library-reply-quote small, .library-chat-history .library-file { color: var(--muted-foreground); }
  .library-photo-dialog, .library-photo-button, img.library-inline-media, video.library-inline-media {
    background: var(--surface-soft); color: var(--foreground); border-color: var(--border);
  }
  .bulk-summary-card.error .bulk-summary-text { color: var(--warning-text); }
}

/* Appearance controls keep their swatches independent of the selected theme. */
.appearance-card { padding: 24px; margin-bottom: 24px; }
.appearance-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.appearance-heading h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.4px; }
.appearance-heading p, .appearance-logo-copy p { margin: 0; color: var(--muted-foreground); font-size: 12px; line-height: 1.65; }
.appearance-spark { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 16px; background: var(--accent); color: var(--primary); font-size: 27px; }
#appearance-styles { border: 0; margin: 0; padding: 0; min-width: 0; }
#appearance-styles legend { padding: 0; margin-bottom: 12px; font-size: 12px; font-weight: 600; }
.appearance-styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.style-choice { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 10px; border: 2px solid var(--border); border-radius: 13px; cursor: pointer; min-width: 0; }
.style-choice:has(:checked) { border-color: var(--primary); background: var(--surface-soft); }
.style-choice:has(:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.style-choice input { position: absolute; top: 20px; right: 18px; z-index: 1; width: 16px; height: 16px; accent-color: var(--primary); }
.style-choice strong { color: var(--foreground); font-size: 13px; }
.style-choice small { color: var(--muted-foreground); font-size: 11px; line-height: 1.5; }
.style-preview { display: block; position: relative; overflow: hidden; height: 90px; border-radius: 7px; background: #f3f1fb; border: 1px solid #dde0eb; }
.style-preview::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 22%; background: #fff; border-right: 1px solid #dde0eb; }
.style-preview i, .style-preview b, .style-preview em { position: absolute; height: 12px; border-radius: 5px; left: 32%; right: 14%; top: 18px; background: #a99ae8; }
.style-preview b { top: 39px; right: 30%; background: #91cdb9; }
.style-preview em { top: 60px; right: 22%; background: #edd18d; }
.preview-mint { background: #edf7f1; }.preview-mint i { background: #6daaa3; }.preview-mint b { background: #afd4c4; }.preview-mint em { background: #e7ca99; }
.preview-sky { background: #edf4fe; }.preview-sky i { background: #83afe7; }.preview-sky b { background: #abcde8; }.preview-sky em { background: #edc5a1; }
.preview-whatsapp-mint { background: #f3fbf2; border-color: #cfe4d4; }.preview-whatsapp-mint::before { background: #fffefa; border-color: #cfe4d4; }.preview-whatsapp-mint i { background: #1f654a; }.preview-whatsapp-mint b { background: #dff3c8; }.preview-whatsapp-mint em { background: #fff1cb; }
.preview-whatsapp-sand { background: #fbf8ed; border-color: #e4dcc7; }.preview-whatsapp-sand::before { background: #fffefa; border-color: #e4dcc7; }.preview-whatsapp-sand i { background: #247058; }.preview-whatsapp-sand b { background: #e3f4cc; }.preview-whatsapp-sand em { background: #ffdca7; }
.preview-night { background: #171b28; border-color: #32394b; }.preview-night::before { background: #202638; border-color: #32394b; }.preview-night i { background: #a69ae0; }.preview-night b { background: #464463; }.preview-night em { background: #69617f; }
.appearance-logo-row { display: flex; gap: 22px; align-items: center; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 24px; }
.appearance-logo-preview { width: 144px; height: 88px; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface-soft); border-radius: 12px; padding: 12px; display: grid; place-items: center; }
.appearance-logo-preview img { max-width: 100%; max-height: 62px; object-fit: contain; }
.appearance-logo-copy h4 { margin: 0 0 5px; font-size: 14px; }
.appearance-logo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.appearance-logo-actions button { font-size: 12px; }
#appearance-status { font-size: 12px; color: var(--muted-foreground); min-height: 18px; margin: 20px 0 0; }
#appearance-status.error { color: var(--danger-text); }
@media(max-width: 1050px) { .appearance-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width: 600px) { .appearance-card { padding: 16px; }.appearance-heading { align-items: flex-start; }.appearance-logo-row { align-items: flex-start; flex-direction: column; }.appearance-heading h3 { font-size: 19px; } }
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Retained for future use; opt in with data-button-wiggle="true" on the root. */
@keyframes bordered-button-wiggle { 0%,100% { transform: rotate(0) translateY(0); } 32% { transform: rotate(-0.75deg) translateY(-1px); } 68% { transform: rotate(0.75deg) translateY(-1px); } }
:root[data-button-wiggle="true"] :is(button.secondary, button.quiet, .settings-tabs button, .crm-tabs button):hover:not(:disabled) { animation: bordered-button-wiggle 320ms ease-in-out both; }
@media(min-width: 1051px) { .appearance-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Keep the WhatsApp name secondary to the workspace alias. */
.chat-original-name{font-size:.78em;font-weight:400;opacity:.72}
html[data-show-original-names="false"] .chat-original-name{display:none}
.appearance-original-names{display:flex;align-items:center;gap:9px;margin-top:24px;cursor:pointer}
.appearance-original-names input{width:auto;margin:0;accent-color:var(--primary)}
.appearance-name-help{font-size:12px;color:var(--muted);margin:6px 0 0}

/* One compact app bar and one toolbar for the WhatsApp workspace. */
:is(#workspace-focus,#workspace-brief,#workspace-activity,#workspace-settings) > .workspace-view-heading {margin-bottom:14px}
:is(#workspace-focus,#workspace-brief,#workspace-activity,#workspace-settings) > .workspace-view-heading h2 {margin:0;font-size:23px;line-height:1.15}
:is(#workspace-focus,#workspace-brief,#workspace-activity,#workspace-settings) > .workspace-view-heading p {margin:2px 0 0;font-size:12px;line-height:1.35}
body { --sidebar-width: 174px; grid-template-rows: 48px minmax(0, 1fr); }
body > .topbar { height: 48px; min-height: 0; padding-block: 0; padding-inline-start: 0; padding-inline-end: 14px; gap: 14px; justify-content: flex-start; }
.topbar .sidebar-header { display: flex; align-items: center; gap: 8px; flex: 0 0 var(--sidebar-width); width: var(--sidebar-width); height: 100%; padding-block: 0; padding-inline-start: 15px; padding-inline-end: 0; border-inline-end: 1px solid var(--border); }
.topbar .brand { flex: 0 0 auto; }
.topbar .brand-logo { width: 48px; height: 30px; }
.topbar .global-search { min-height: 0; height: 32px; max-width: 760px; padding: 2px 10px; }
.topbar .global-search input { padding: 2px; }
.topbar .global-search > span { display: grid; place-items: center; align-self: center; width: 18px; height: 20px; line-height: 1; transform: translateY(-5px); }
.topbar .top-actions { margin-inline-start: auto; gap: 8px; flex-shrink: 0; }
.topbar #refresh-all { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 9px; font-size: 12px; }
.topbar .connection-health { display: grid; grid-template-columns: repeat(2, max-content); align-content: center; gap: 1px 6px; height: 40px; margin: 0; }
.connection-health .health-dot { display: inline-flex; align-items: center; gap: 5px; min-height: 18px; padding: 0 3px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted-foreground); font-size: 10px; font-weight: 500; line-height: 16px; text-align: start; }
.connection-health .health-dot:hover { background: var(--secondary); }
.connection-health .health-dot:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }
.connection-health .health-dot::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #aab3c3; }
.connection-health .health-dot[data-state="ok"]::before { background: #66cda7; }
.connection-health .health-dot[data-state="warning"]::before { background: #e1ad58; }
.connection-health .health-dot[data-state="error"]::before { background: #d76d65; }
@media (min-width: 760px) and (max-width: 1000px) { body { --sidebar-width: 154px; } }
@media (min-width: 760px) { body[data-sidebar-collapsed="true"] { --sidebar-width: 64px; } body[data-sidebar-collapsed="true"] .topbar .brand { display: none; } }
body > .workspace-tabs { padding-top: 12px; }
body[data-workspace="conversations"] > main { padding: 10px 12px 12px; }
.conversation-tabs { min-height: 30px; margin-bottom: 6px; padding-bottom: 2px; }
.conversation-tabs:not(:has(.conversation-tab-item)) { display: none; }
.conversation-tabs button { padding: 5px 9px; }

#workspace-conversations .library-heading.library-tools {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 42px;
  padding: 4px 8px;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
#workspace-conversations .library-heading-actions { width: auto; margin: 0; gap: 6px; flex-wrap: nowrap; }
#workspace-conversations .library-heading-actions button,
#workspace-conversations .library-tools > button { min-height: 32px; }
#workspace-conversations .library-tools > button { padding: 5px 9px; }
#workspace-conversations .library-heading .library-heading-actions #library-new-chat { height: 32px; padding: 0 9px; }
#workspace-conversations .library-heading-actions #library-refresh,
#workspace-conversations .library-heading-actions #collection-new { width: 32px; height: 32px; padding: 0; }
#workspace-conversations #library-filter-panel { top: calc(100% - 1px); left: 8px; }
#workspace-conversations #library-workspace[data-layout] { border-radius: 0 0 10px 10px; }

@media (max-width: 759px) {
  body { grid-template-rows: 48px 42px minmax(0, 1fr); }
  body > .topbar { height: 48px; padding: 0 9px; gap: 8px; }
  .topbar .sidebar-header { width: auto; flex-basis: auto; padding: 0; border: 0; }
  .topbar .brand-logo { display: block; width: 30px; height: 25px; }
  .topbar #refresh-all span { display: none; }
  body > .workspace-tabs { padding: 3px 8px; }
  body[data-workspace="conversations"] > main { padding: 7px; }
  .conversation-tabs { margin-bottom: 5px; }
  #workspace-conversations .library-heading.library-tools { gap: 4px; padding: 4px 6px; }
  #workspace-conversations .library-heading-actions { gap: 4px; }
  #workspace-conversations .library-heading .library-heading-actions #library-new-chat { width: 32px; }
}

.diagnostics-updated { margin: 10px 0 18px; font-size: 11px; color: var(--muted-foreground); }
.diagnostics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.diagnostics-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.diagnostics-card:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.diagnostics-card header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.diagnostics-card h4, .diagnostics-log-heading { margin: 0; font-size: 13px; font-weight: 600; }
.diagnostics-state { font-size: 11px; color: var(--muted-foreground); }
.diagnostics-card[data-state="ok"] .diagnostics-state { color: var(--success-text, #246953); }
.diagnostics-card[data-state="warning"] .diagnostics-state { color: var(--warning-text, #865b17); }
.diagnostics-card[data-state="error"] .diagnostics-state { color: var(--danger-text, #ad3c30); }
.diagnostics-description { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted-foreground); overflow-wrap: anywhere; }
.diagnostics-log-heading { margin: 24px 0 10px; }
#settings-diagnostic-list, #capture-diagnostic-list, #capture-receipt-list { max-height: 420px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; }
#settings-diagnostics-panel .diagnostic-row { border-color: var(--border); }
#capture-log-filter { margin: 0 0 8px 8px; }
.diagnostic-fields { margin-top: 4px; line-height: 1.6; overflow-wrap: anywhere; }
.diagnostic-fields:empty { display: none; }
@media (max-width: 620px) { .diagnostics-grid { grid-template-columns: minmax(0, 1fr); } }

.language-setting{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #e1e9d9;border-radius:9px;background:#fbfdf9;font-size:12px;font-weight:650;color:#536f46}
.language-setting select{width:auto;min-width:120px;padding:7px 10px;border:1px solid #dce5d5;border-radius:8px;background:white;color:#334c29;font:inherit}
html[dir="rtl"] body{direction:rtl;text-align:right}
html[dir="rtl"] button,html[dir="rtl"] input:not([dir="auto"]),html[dir="rtl"] textarea:not([dir="auto"]),html[dir="rtl"] select{direction:rtl;text-align:right}
html[dir="rtl"] input[type="url"],html[dir="rtl"] input[type="password"],html[dir="rtl"] input[id$="key"],html[dir="rtl"] input[id$="token"],html[dir="rtl"] code,html[dir="rtl"] .diagnostics-path{direction:ltr;text-align:left;unicode-bidi:isolate}
html[dir="rtl"] input[type="checkbox"],html[dir="rtl"] input[type="radio"]{direction:rtl}
html[dir="rtl"] .actions .text-button{margin-left:0;margin-right:auto}
html[dir="rtl"] .archive-browser aside{border-right:0;border-left:1px solid #e4e9e1}
html[dir="rtl"] .conversation-item,html[dir="rtl"] .attachment button{text-align:right}
html[dir="rtl"] .message.own{margin-right:auto;margin-left:0}
html[dir="rtl"] .message:not(.own){margin-left:auto;margin-right:0}
html[dir="rtl"] .reply{border-left:0;border-right:2px solid #a3ba8c}
html[dir="rtl"] .archive-health-issues,html[dir="rtl"] .capture-history-list{padding-left:0;padding-right:18px}
html[dir="rtl"] .diagnostics-card>summary span,html[dir="rtl"] .settings-blocked-details>summary span,html[dir="rtl"] .automatic-analysis-panel>summary>span{margin-left:0;margin-right:7px}
html[dir="rtl"] .message-text,html[dir="rtl"] .sender,html[dir="rtl"] .quote-text,html[dir="rtl"] .settings-row-name,html[dir="rtl"] .settings-row-meta{unicode-bidi:plaintext}
html[dir="rtl"] .message-text,html[dir="rtl"] .quote-text{text-align:start}
html[dir="rtl"] .settings-conversation,html[dir="rtl"] .settings-contact{direction:rtl}
html[dir="rtl"] .management-table th,html[dir="rtl"] .management-table td{text-align:right}
html[dir="rtl"] .export-choice{text-align:right;align-items:flex-start}
html[dir="rtl"] .grouping-open,html[dir="rtl"] .conversation-folder-open,html[dir="rtl"] .table-conversation{text-align:right}
html[dir="rtl"] .grouping-edit{border-left:0;border-right:1px solid var(--border)}
html[dir="rtl"] #crm-integrations ul,html[dir="rtl"] #crm-integrations ol{padding-left:0;padding-right:20px}
html[dir="rtl"] #crm-uncertain-notes button{margin-right:0;margin-left:8px}
html[dir="rtl"] .crm-grid,html[dir="rtl"] .crm-actions,html[dir="rtl"] .management-actions{direction:rtl}
@media(max-width:700px){html[dir="rtl"] .archive-browser aside{border-left:0;border-bottom:1px solid #e4e9e1}.language-setting{justify-content:space-between}}
.message-text[dir="auto"],.message-context[dir="auto"],.quote-author[dir="auto"],.quote-text[dir="auto"],.analysis-batch-summary[dir="auto"]{text-align:start;unicode-bidi:plaintext}
.quote-deleted{display:block;font-size:11px;color:#8a987e}

html[dir="rtl"] .topbar .sidebar-header{border-right:0;border-left:1px solid var(--border)}
html[dir="rtl"] body>.workspace-tabs{border-right:0;border-left:1px solid var(--border)}
html[dir="rtl"] .workspace-tabs button{direction:rtl;text-align:right}
html[dir="rtl"] .workspace-view-heading,html[dir="rtl"] .workspace-settings-card,html[dir="rtl"] .panel{text-align:right}
html[dir="rtl"] #library-workspace[data-layout="sidebar"]>.library-list{border-right:0;border-left:1px solid var(--border)}
html[dir="rtl"] #library-workspace[data-layout="sidebar"] .library-row-main{padding-right:0;padding-left:24px}
html[dir="rtl"] #library-workspace[data-layout="sidebar"] .library-avatar{margin-right:0;margin-left:9px}
html[dir="rtl"] .library-heading-actions{margin-left:0;margin-right:auto}
html[dir="rtl"] .management-table th,html[dir="rtl"] .management-table td,html[dir="rtl"] .library-table th,html[dir="rtl"] .library-table td{text-align:right}
html[dir="rtl"] .knowledge-result,html[dir="rtl"] .focus-thread-card,html[dir="rtl"] .chat-add-options>button,html[dir="rtl"] .chat-due-reminders>button,html[dir="rtl"] .chat-status-menu button,html[dir="rtl"] .workspace-select-option,html[dir="rtl"] .library-context-menu button,html[dir="rtl"] .workspace-pin-dialog [data-pin-destination],html[dir="rtl"] .library-sync-pc>button,html[dir="rtl"] .library-sync-spine>button{text-align:right}
html[dir="rtl"] .library-sync-spine{border-left:0;border-right:1px solid #e6ede9;padding-left:0;padding-right:15px}
html[dir="rtl"] #workspace-sidebar-toggle svg{transform:scaleX(-1)}
html[dir="rtl"] .message-body,html[dir="rtl"] .chat-name,html[dir="rtl"] .library-chat-name,html[dir="rtl"] .library-message-text,html[dir="rtl"] .workspace-item-body{unicode-bidi:plaintext}
html[dir="rtl"] .global-search input{text-align:right}
html[dir="rtl"] .topbar .protected span{margin-right:0;margin-left:6px}
html[dir="rtl"] .language-setting{width:100%;justify-content:space-between}
html[dir="rtl"] #library-filter-panel{left:auto;right:0}
html[dir="rtl"] #workspace-conversations #library-filter-panel{left:auto;right:8px}
html[dir="rtl"] #library-workspace[data-layout=sidebar] [data-library-chat] .library-row-main{padding-left:0;padding-right:46px}
html[dir="rtl"] #library-workspace[data-layout=sidebar][data-density=compact] [data-library-chat] .library-row-main{padding-left:0;padding-right:40px}
html[dir="rtl"] #library-workspace[data-layout=sidebar] [data-library-chat] .library-avatar{left:auto;right:0;margin:0}
html[dir="rtl"] #library-workspace[data-layout=sidebar] [data-library-chat] .library-chat-menu-button{right:auto;left:-4px}
html[dir="rtl"] #library-workspace[data-layout=sidebar] [data-library-chat]:is(:hover,:focus-within) .library-chat-preview{padding-right:0;padding-left:24px}
html[dir="rtl"] #library-workspace[data-layout=sidebar] .library-row-time{right:auto;left:26px}
html[dir="rtl"] #library-workspace[data-layout=sidebar] .library-open{padding-right:0;padding-left:50px}
html[dir="rtl"] #library-workspace[data-layout=grid] .library-open{padding-right:0;padding-left:18px}
html[dir="rtl"] #library-workspace[data-layout=grid] .library-chat-menu-button{right:auto;left:10px}
html[dir="rtl"] .workspace-select-trigger{padding-left:34px;padding-right:12px}
html[dir="rtl"] .workspace-select-trigger::after{right:auto;left:12px}
html[dir="rtl"] .workspace-select-option[aria-selected=true]::after{float:left;margin-left:0;margin-right:10px}
html[dir="rtl"] .focus-message-remove,html[dir="rtl"] .focus-pinned-card>.text-button{right:auto;left:0}
html[dir="rtl"] .focus-pinned-card>.text-button{left:14px}
html[dir="rtl"] .focus-message-open{padding-right:0;padding-left:44px}
html[dir="rtl"] .chat-add-options{left:auto;right:0}
html[dir="rtl"] .chat-note-source,html[dir="rtl"] .chat-composer .chat-reply-error{border-left:0;border-right:3px solid var(--primary)}
html[dir="rtl"] .chat-composer .chat-reply-error{border-right-color:var(--danger-text,#fca5a5)}
html[dir="rtl"] .chat-message-notes{border-left:0;border-right:2px solid var(--warning-text)}
html[dir="rtl"] .chat-notes-dialog .chat-editor-actions::before{content:'Ctrl / ⌘ + Enter לשמירה';margin-right:0;margin-left:auto}
html[dir="rtl"] #library-bulk-actions .library-selection{border-right:0;border-left:1px solid var(--border);padding:4px 0 4px 10px}
html[dir="rtl"] .library-reply-quote{border-left:0;border-right:4px solid #06cf9c}
html[dir="rtl"] .library-chat-history .library-stored-message{margin-left:auto;margin-right:0;border-radius:8px 0 8px 8px}
html[dir="rtl"] .library-chat-history .library-stored-message.from-me{margin-left:0;margin-right:auto;border-radius:0 8px 8px 8px}
html[dir="rtl"] .library-chat-history .library-stored-message::before{left:auto;right:-7px;border-left:0;border-right:8px solid transparent}
html[dir="rtl"] .library-chat-history .library-stored-message.from-me::before{right:auto;left:-7px;border-right:0;border-left:8px solid transparent}
html[dir="rtl"] .library-reply-quote.has-thumbnail{padding-right:10px;padding-left:64px}
html[dir="rtl"] .library-quote-thumbnail{right:auto;left:0;border-radius:5px 0 0 5px}
html[dir="rtl"] .outbox-job button{margin-right:0;margin-left:8px}
html[dir="rtl"] .spine-log-summary{padding-left:0;padding-right:15px}
html[dir="rtl"] .spine-log-action strong::before{margin-right:0;margin-left:6px}
html[dir="rtl"] .library-enrichment{border-left:0;border-right:2px solid #b9d7cc;border-radius:5px 0 0 5px}
html[dir="rtl"] .brand-copy{border-left:0;border-right:1px solid #353146;padding-left:0;padding-right:17px}
html[dir="rtl"] .transfer-toolbar>.capture-panel{border-right:0;border-left:1px solid var(--line)}
@media(hover:none){html[dir="rtl"] #library-workspace[data-layout=sidebar] [data-library-chat] .library-chat-preview{padding-right:0;padding-left:24px}}
@media(max-width:850px){html[dir="rtl"] .transfer-toolbar>.capture-panel{border-left:0}}
@media(max-width:480px){html[dir="rtl"] .brand-copy{border-right:0;padding-right:0}}
@media(max-width:620px){html[dir="rtl"] .chat-notes-dialog .chat-editor-actions::before{content:'Ctrl / ⌘ + Enter'}}
@media(max-width:759px){html[dir="rtl"] body>.workspace-tabs{border-left:0;border-bottom:1px solid var(--border)}}
html[dir="rtl"] #library-clear-selection,html[dir="rtl"] #bulk-summary-close,html[dir="rtl"] .library-chat-options,html[dir="rtl"] .library-menu-arrow,html[dir="rtl"] .library-close-preview,html[dir="rtl"] .collection-editor-actions small,html[dir="rtl"] .library-tools>#collection-add-selected,html[dir="rtl"] .footer-note,html[dir="rtl"] .integration-strip>button{margin-left:0;margin-right:auto}
html[dir="rtl"] .spine-request-log>summary>span:first-child,html[dir="rtl"] .spine-log-toolbar label{margin-right:0;margin-left:auto}
html[dir="rtl"] .chat-context-chip,html[dir="rtl"] .library-membership{text-align:right}
html[dir="rtl"] .chat-note-length,html[dir="rtl"] .spine-log-duration,html[dir="rtl"] .health-list dd,html[dir="rtl"] .connection-sync-details dd{text-align:left}
html[dir="rtl"] .chat-context-dialog .reminder-presets-label,html[dir="rtl"] .reminder-presets-label{margin-right:0;margin-left:2px}
html[dir="rtl"] .brief-source{margin-right:0;margin-left:12px}
html[dir="rtl"] .chat-status-menu button[aria-checked=true]::after{margin-left:0;margin-right:auto}
html[dir="rtl"] .library-chat-history .library-stored-message .library-message-sender{margin-right:0;margin-left:auto}
html[dir="rtl"] .library-message-action-items{direction:rtl}
html[dir="rtl"] .library-chat-badge,html[dir="rtl"] .library-tab-count,html[dir="rtl"] .management-card summary span,html[dir="rtl"] .field-state{margin-left:0;margin-right:6px}
html[dir="rtl"] #library-workspace[data-layout=grid] .library-row>input{right:auto;left:12px}
html[dir="rtl"] .library-more-options[open]>.library-category{right:auto;left:0}
html[dir="rtl"] .spine-sync-actions>.text-button{margin-left:0;margin-right:4px}
html[dir="rtl"] .transfer-toolbar .spine-sync-actions>.text-button{margin-right:0}
html[dir="rtl"] .brand-icon span{right:auto;left:-3px}
@media(max-width:850px){html[dir="rtl"] .integration-strip>button{margin-right:0}}
.focus-thread-card [dir="auto"],.focus-ai-card [dir="auto"],.focus-message-open [dir="auto"],.library-chat-history .library-message-text[dir="auto"],.library-message-sender[dir="auto"],.library-reply-quote [dir="auto"],.library-chat-preview[dir="auto"],.bulk-summary-text[dir="auto"],.chat-message-note-text[dir="auto"]{text-align:start;unicode-bidi:plaintext}
.focus-pinned-title[dir="ltr"],.focus-pinned-title[dir="rtl"]{text-align:start}

/* Shared workspace cards: one rhythm and one action bar in every view. */
.managed-card { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); box-shadow: none; text-align: start; }
.managed-card[data-marked=true] { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.managed-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
#focus-pinned, #focus-threads, #focus-important, #focus-ai { display: grid; gap: 12px; }
.managed-card .managed-card-title { margin: 0; font-size: 15px; line-height: 1.45; font-weight: 600; }
.managed-card .managed-card-open { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; text-align: start; white-space: inherit; overflow-wrap: anywhere; cursor: pointer; }
.managed-card-open-label { min-width: 0; }
.managed-card-open > svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--muted-foreground); }
.managed-card-open:hover .managed-card-open-label { text-decoration: underline; text-underline-offset: 3px; }
.managed-card-open:hover > svg { color: var(--primary); }
[dir=rtl] .managed-card-open > svg { transform: scaleX(-1); }
.managed-card .managed-card-title,
.focus-ai-card h4,
.focus-thread-card h4,
.focus-message-sender,
.media-card-title { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.managed-card .managed-card-text { margin: 0; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--foreground); }
.managed-card .managed-card-meta { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted-foreground); overflow-wrap: anywhere; }
.split-card, .managed-card.split-card { gap: 0; padding: 0; }
.split-card-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-radius: inherit; overflow: hidden; }
.split-card-heading, .split-card-preview { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; padding: 14px 16px; }
.split-card-heading .managed-card-title, .managed-card.split-card .managed-card-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.split-card .managed-card-meta { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 4px 10px; }
.split-card-preview { background: color-mix(in srgb, var(--secondary) 50%, var(--card)); }
.split-card-preview .split-card-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0; font-size: 14px; line-height: 1.55; color: var(--foreground); white-space: pre-wrap; overflow-wrap: anywhere; text-align: start; }
.card-details-button { align-self: flex-end; margin-block-start: auto; min-height: 30px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--primary); font-size: 12px; font-weight: 600; }
.card-details-button:hover { background: var(--card); border-color: var(--border); }
.managed-card.split-card > .managed-card-actions, .split-card > .workspace-item-actions { box-sizing: border-box; padding: 6px 12px; }
.split-card-main:has(+ *) { border-end-start-radius: 0; border-end-end-radius: 0; }
.managed-card-dialog.card-details-dialog { box-sizing: border-box; width: min(670px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: hidden; }
.card-details-dialog[open] { display: flex; flex-direction: column; }
.card-details-header { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-details-header h2 { flex: 1; min-width: 0; margin: 0; font-size: 20px; line-height: 1.35; text-align: start; overflow-wrap: anywhere; }
.card-details-header button { flex: none; }
.card-details-body { min-height: 0; padding: 16px 20px; overflow: auto; overscroll-behavior: contain; }
.card-details-body .card-details-text { margin: 0 0 12px; color: var(--foreground); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; text-align: start; }
.card-details-body > :last-child { margin-block-end: 0; }
.card-details-error { margin: 8px 0 0; color: var(--danger-text); font-size: 12px; }
.card-details-error:empty { display: none; }
.message-route { display: flex; align-items: center; gap: 7px; min-width: 0; direction: ltr; color: var(--foreground); font-size: 12px; font-weight: 600; line-height: 1.4; }
.message-route-endpoint { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: calc(50% - 16px); }
.message-route-avatar.library-avatar { width: 22px; height: 22px; min-width: 22px; margin: 0; border-radius: 50%; font-size: 12px; line-height: 1; }
.message-route-avatar.library-avatar-initials { font-size: 9px; }
.message-route-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-route-arrow { flex: none; color: var(--muted-foreground); font-size: 16px; font-weight: 400; line-height: 1; }
.managed-card > p, .managed-card > h3, .managed-card > h4 { margin-block: 0; }
.managed-card .managed-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; width: 100%; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.managed-card-actions button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 34px; padding: 7px 10px; border-radius: 7px; font-size: 12px; line-height: 1.3; white-space: nowrap; }
.managed-card-actions .managed-card-mark { margin-inline-end: auto; }
.managed-card-actions > button { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; }
.managed-card-actions > button > svg { flex: none; }
.managed-card-mark[aria-pressed=true] { color: var(--primary); }
.managed-card-mark[aria-pressed=true] > svg { fill: currentColor; }
.managed-card-actions .managed-card-done { background: var(--secondary); color: var(--foreground); }
.managed-card-menu { position: relative; flex: none; margin: 0; padding: 0; border: 0; }
.managed-card-menu > summary { display: grid; place-items: center; width: 34px; min-height: 34px; padding: 0; border: 1px solid transparent; border-radius: 7px; font-size: 22px; line-height: 1; list-style: none; cursor: pointer; color: var(--muted-foreground); }
.managed-card-menu > summary::-webkit-details-marker { display: none; }
.managed-card-menu > summary:hover, .managed-card-menu[open] > summary { background: var(--secondary); color: var(--foreground); }
.managed-card-menu-items { position: absolute; inset-inline-end: 0; bottom: calc(100% + 6px); z-index: 25; display: grid; min-width: 150px; padding: 5px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); box-shadow: 0 8px 28px #0002; }
.managed-card-menu-items button { width: 100%; justify-content: flex-start; border: 0; background: #fff; color: var(--foreground); transition: background-color .15s ease, color .15s ease; }
.managed-card-menu-items button:hover:not(:disabled), .managed-card-menu-items button:focus-visible { background: var(--primary); color: #fff; }
.managed-card-menu-items .managed-card-delete { color: var(--danger-text, #b6414b); }
.managed-card-action-submenu>summary{cursor:pointer;list-style:none;padding:8px 10px}.managed-card-action-submenu>summary::-webkit-details-marker{display:none}.managed-card-action-choices{display:grid;max-height:240px;overflow:auto}.managed-card-action-choices .actions-help{margin:6px 10px}
.managed-card button:focus-visible, .managed-card summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.managed-card-error { margin: 8px 0 0; font-size: 12px; color: var(--danger-text, #b6414b); }
.managed-card-status { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 1400; max-width: min(90vw, 520px); margin: 0; padding: 10px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--foreground); box-shadow: 0 6px 24px #0002; font-size: 12px; pointer-events: none; }
.managed-card-status.error { color: var(--danger-text, #b6414b); }
.managed-card-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--foreground); }
.managed-card-dialog::backdrop { background: #0d132a80; }
.managed-card-dialog h2 { margin: 0 0 12px; font-size: 19px; }
.managed-card-dialog-help { margin: 0 0 16px; color: var(--muted-foreground); font-size: 13px; line-height: 1.6; }
.managed-card-dialog form, .managed-card-dialog label { display: grid; gap: 8px; }
.managed-card-dialog form { gap: 16px; }
.managed-card-dialog label { font-size: 12px; }
.managed-card-dialog input, .managed-card-dialog textarea, .archive-tools input, .archive-tools select, .archive-retention-form select { min-height: 40px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--foreground); font: inherit; }
.managed-card-dialog input:focus-visible, .managed-card-dialog textarea:focus-visible, .archive-tools input:focus-visible, .archive-tools select:focus-visible, .archive-retention-form select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.managed-card-dialog textarea { width: 100%; resize: vertical; min-height: 120px; }
.managed-card-dialog-controls { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.managed-card-delete-title { padding: 12px; border-radius: 8px; background: var(--background); font-size: 13px; overflow-wrap: anywhere; }
.managed-card-empty { grid-column: 1 / -1; padding: 38px 20px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted-foreground); }
.managed-card-empty h3 { color: var(--foreground); font-size: 15px; }
.managed-card-empty p { font-size: 13px; line-height: 1.6; }
#workspace-archive { padding: 28px clamp(16px, 2vw, 24px); }
#workspace-archive { padding-top: 16px; }
#workspace-archive .workspace-view-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#workspace-archive .workspace-view-heading h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 25px; letter-spacing: -.6px; }
#workspace-archive .workspace-view-heading h2 { font-size: 23px; line-height: 1.15; }
#workspace-archive .workspace-view-heading p { margin: 2px 0 0; color: var(--muted-foreground); font-size: 12px; line-height: 1.35; }
#workspace-archive .workspace-view-heading { margin-bottom: 14px; min-height: 42px; }
#archive-count { display: grid; place-items: center; min-width: 24px; height: 24px; padding-inline: 6px; border-radius: 7px; background: var(--secondary); color: var(--muted-foreground); font-size: 12px; letter-spacing: 0; font-weight: 500; }
.archive-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 24px 0 16px; }
.archive-tools { margin: 8px 0 14px; }
.archive-tools label { display: grid; gap: 6px; color: var(--muted-foreground); font-size: 12px; }
.archive-tools label:first-child { flex: none; }
.archive-tools input { width: 100%; }
.archive-tools select { min-width: 160px; }
.archive-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.archive-card-list .managed-card-text { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.archive-card-list .managed-card-text:has(> .managed-card-open) { display: block; overflow: visible; }
.archive-card-list .managed-card-text .managed-card-open-label { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.archive-retention-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 18px; }
.archive-retention-form label { display: grid; gap: 7px; font-size: 13px; }
.archive-retention-form select { min-width: 180px; }
#archive-retention-note, #archive-retention-status { color: var(--muted-foreground); font-size: 12px; line-height: 1.6; }
@media (max-width: 600px) {
  .managed-card { padding: 14px; }
  .managed-card-actions button, .managed-card-menu > summary { min-height: 40px; }
  .managed-card-actions > button { flex-basis: 40px; width: 40px; height: 40px; }
  .managed-card-menu > summary { width: 40px; }
  .managed-card-dialog { padding: 18px; }
}

/* Settings share compact controls and keep explanations on demand. */
#workspace-settings { max-width: 1180px; margin-inline: auto; }
#workspace-settings .workspace-view-heading { margin-bottom: 12px; }
#workspace-settings .workspace-settings-card,
#workspace-settings .settings-integration-hub,
#workspace-settings .management-card { padding: 16px; margin-bottom: 12px; }
.settings-tabs {
  margin-bottom: 10px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.settings-tab-row { display: flex; flex-wrap: wrap; gap: 4px; }
#settings-service-tabs { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.settings-tabs button {
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.25;
}
.settings-tabs button:hover { background: var(--surface-soft); }
.settings-tabs button[aria-selected="true"] {
  background: var(--secondary);
  border-color: var(--border);
  color: var(--foreground);
}
#workspace-settings h3, #workspace-settings h4 { line-height: 1.5; }
#workspace-settings .settings-service-cards { gap: 10px; }
#workspace-settings .settings-service-card {
  min-height: 0; padding: 14px; gap: 10px; border-radius: 10px;
  grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto auto;
}
#workspace-settings .settings-service-card > .settings-service-icon { width: 30px; height: 30px; font-size: 18px; border-radius: 8px; }
#workspace-settings .settings-service-kind, #workspace-settings .settings-request-note { display: none; }
#workspace-settings .settings-service-copy { grid-column: 2; align-self: center; }
#workspace-settings .settings-service-copy h4 { margin: 0; font-size: 12px; letter-spacing: .2px; }
#workspace-settings .settings-service-status { padding-top: 8px; font-size: 11px; font-weight: 500; }
#workspace-settings .settings-service-actions { gap: 6px; }
#workspace-settings .settings-service-card button { min-height: 32px; padding: 6px 9px; }
#workspace-settings .service-request { justify-content: center; gap: 8px; }
#workspace-settings .service-request .settings-service-copy { flex: 0; }
#workspace-settings .appearance-heading { margin-bottom: 12px; }
#workspace-settings .appearance-styles { gap: 8px; }
#workspace-settings .style-choice { padding: 10px; }
#workspace-settings .style-preview { height: 46px; }
#workspace-settings .style-choice small { display: none; }
#workspace-settings .appearance-logo-row { margin-top: 14px; padding-top: 14px; gap: 14px; }
#workspace-settings .appearance-logo-preview { width: 68px; height: 68px; }
#workspace-settings .workspace-advanced-actions { padding-top: 4px; gap: 8px; }
#workspace-settings .management-throttle { margin-top: 10px; }
#workspace-settings .management-throttle > label { min-width: 148px; }

:is(#workspace-settings, #connections-dialog) :is(select, input:not([type="checkbox"]):not([type="radio"]):not([type="file"])) {
  color: var(--foreground); background-color: var(--background); border: 1px solid var(--border);
  border-radius: 7px; min-height: 36px; font: inherit; font-size: 12px; box-sizing: border-box;
}
:is(#workspace-settings, #connections-dialog) select { padding: 7px 10px; max-width: 100%; cursor: pointer; color-scheme: light; }
:root[data-theme="night"] :is(#workspace-settings, #connections-dialog) select { color-scheme: dark; }
:is(#workspace-settings, #connections-dialog) select option,
:is(#workspace-settings, #connections-dialog) select optgroup { color: var(--foreground); background: var(--card); }
:is(#workspace-settings, #connections-dialog) :is(select, input, button):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
:is(#workspace-settings, #connections-dialog) .connection-field { margin: 10px 0; font-size: 12px; font-weight: 500; }
:is(#workspace-settings, #connections-dialog) .connection-field :is(input, select) { margin-top: 5px; height: 36px; padding-block: 7px; }
:is(#workspace-settings, #connections-dialog) .connection-check { font-size: 12px; margin-bottom: 10px; }
:is(#workspace-settings, #connections-dialog) .connection-check.secondary-check { font-size: 11px; margin: 8px 0; }
:is(#workspace-settings, #connections-dialog) .field-state { display: block; margin: 3px 0 0; font-size: 10px; }
.settings-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-field-grid[hidden] { display: none !important; }
.settings-model-section { border: 1px solid var(--border); border-radius: 9px; padding: 14px; background: var(--card); min-width: 0; }
.settings-model-section > h4 { margin: 0 0 10px; font-size: 13px; font-weight: 650; color: var(--foreground); }
.settings-model-section .connection-field:last-child { margin-bottom: 0; }
.settings-processing-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 230px); align-items: center; gap: 12px; }
.settings-processing-row .connection-check { margin: 0; }
#connections-dialog { width: 720px; background: var(--background); border-color: var(--border); color: var(--foreground); }
#connections-dialog .connections-heading { padding: 16px 18px; align-items: center; background: var(--card); border-color: var(--border); }
#connections-dialog .connections-heading h2 { margin: 0; font-size: 19px; }
#connections-dialog .connections-grid { display: block; padding: 14px 18px 18px; }
#connections-dialog .connection-settings-card { padding: 0; border: 0; background: transparent; }
#connections-dialog .connection-automation { border: 0; padding: 0; margin: 0; }
#analysis-connection-form { display: grid; gap: 12px; }
#analysis-connection-form > button { justify-self: start; }
#connections-dialog .connection-card-footer { margin-top: 12px; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; }
#connections-dialog .connection-help[role="status"] { margin: 8px 0 0; font-size: 11px; line-height: 1.5; }
#connections-dialog .connection-result { margin-top: 10px; }
#workspace-settings .crm-grid { gap: 12px; }
#workspace-settings .crm-grid > section { padding: 14px; }
#workspace-settings .crm-panel-heading { margin-bottom: 12px; }

.settings-help-note { display: none !important; }
:is(#workspace-settings, #connections-dialog) button.settings-help-trigger {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 0; margin: 0 0 0 5px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted-foreground);
  position: relative; font: 600 10px/1 system-ui, sans-serif; cursor: help; box-shadow: none;
}
:is(#workspace-settings, #connections-dialog) button.settings-help-trigger::before { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid currentColor; border-radius: 50%; opacity: .75; }
:is(#workspace-settings, #connections-dialog) button.settings-help-trigger:hover { background: var(--secondary); color: var(--foreground); }
[dir="rtl"] :is(#workspace-settings, #connections-dialog) button.settings-help-trigger { margin: 0 5px 0 0; }
#settings-help-tooltip {
  position: fixed; inset: auto; margin: 0; z-index: 1000; box-sizing: border-box;
  width: max-content; max-width: min(330px, calc(100vw - 24px)); max-height: min(60vh, 360px); overflow: auto;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--foreground); box-shadow: 0 6px 24px #0002;
  font-family: inherit; font-size: 12px; line-height: 1.6; text-align: start; overflow-wrap: anywhere;
}
#settings-help-tooltip[hidden] { display: none !important; }
#settings-help-tooltip p { margin: 0; }
#settings-help-tooltip p + p { margin-top: 8px; }
@media (max-width: 850px) { #workspace-settings .settings-service-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  #workspace-settings .settings-service-cards { grid-template-columns: 1fr; }
  .settings-field-grid, .settings-processing-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #connections-dialog .connections-heading { padding: 13px; }
  #connections-dialog .connections-heading h2 { font-size: 17px; }
  #connections-dialog .connections-grid { padding: 12px; }
  .settings-model-section { padding: 12px; }
}
.ai-language-setting { margin-top: 12px; flex-wrap: wrap; }
.ai-language-help { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted-foreground); }
.topbar .sidebar-header .brand {
  flex: 1 1 auto;
  gap: 6px;
  padding-inline-end: 6px;
}
#header-business-name {
  max-inline-size: 9ch;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
}
#workspace-settings #settings-branding-panel .appearance-logo-row { margin-block-start: 0; padding-block-start: 0; border-block-start: 0; }
#branding-logo-status, #branding-description-help, #branding-inject-help {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.5;
}
#branding-logo-status:empty { display: none; }
#branding-logo-status.error { color: var(--danger-text); }
#branding-form, .branding-context { max-inline-size: 600px; }
#branding-fields { margin: 16px 0 0; padding: 0; border: 0; min-inline-size: 0; }
#branding-fields legend, .branding-context h4 { margin: 0; font-size: 14px; font-weight: 600; }
#workspace-settings #branding-fields label { margin-block-end: 5px; color: var(--foreground); }
#branding-description-help { margin: 0 0 6px; }
#branding-fields :is(input, textarea) {
  box-sizing: border-box;
  inline-size: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
}
#branding-description { resize: vertical; }
#branding-description:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.branding-context { border-block-start: 1px solid var(--border); margin-block-start: 22px; padding-block-start: 16px; }
#branding-inject-help { margin-block: 4px 0; }
#branding-facts:not([hidden]) {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 14px;
  margin-block: 14px 0;
  font-size: 12px;
}
#branding-facts dt { font-weight: 600; }
#branding-facts dd { margin: 0; overflow-wrap: anywhere; }
#branding-facts ul { margin: 0; padding-inline-start: 1.2em; }

html{color-scheme:light}body{margin:0}button,input,textarea,select,[role=button]{pointer-events:none} .product-demo-brand{font:700 16px system-ui;color:var(--text)}#action-dialog[open]{position:fixed;inset:0;margin:auto;z-index:1000}
.library-message-toolbar > :not(.library-message-star[aria-pressed="true"]){display:none!important}
.library-message-toolbar:not(:has(.library-message-star[aria-pressed="true"])){display:none!important}