/* One responsive shell on all routes. Page identity belongs to content, not toolbar. */
body .topbar{height:72px!important;min-height:72px!important;padding:12px 24px!important;display:flex!important;align-items:center!important;gap:12px!important;flex-wrap:nowrap!important;box-sizing:border-box;overflow:visible}
body .topbar-actions{display:flex!important;flex:1!important;width:100%;min-width:0;align-items:center;gap:8px!important;flex-wrap:nowrap!important;margin:0!important}
body .topbar-actions .search-box{display:flex;flex:1!important;min-width:60px!important;height:44px;margin:0!important}
body .topbar-actions .search-box input{width:100%;min-width:0}
body .topbar-actions>button,body .topbar-actions .icon-button{flex:0 0 44px!important;width:44px!important;height:44px;min-width:44px;padding:10px!important;border-radius:var(--control-radius)}
body .topbar-actions #quick-create-open{flex:0 0 auto!important;width:auto!important;padding:10px 14px!important}
.topbar-actions svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#topbar-secondary{display:flex;align-items:center;gap:8px}#topbar-secondary .quiet-clock{white-space:nowrap}
body #global-more{display:none}.content>.topbar-identity{margin:12px 0 24px;flex:none}body[data-current-view=today] .content>.topbar-identity{display:none}
body .topbar #topbar-brain-capture{background:transparent!important;border-color:transparent!important;color:var(--text-secondary)!important}
.assistant-more{margin-left:auto;position:relative}.assistant-more summary{cursor:pointer;min-width:40px;min-height:44px;padding:8px;text-align:center;font-size:22px;list-style:none}
.assistant-more[open]{background:var(--surface-muted);border-radius:var(--control-radius)}.assistant-more button{display:block;width:100%}
.assistant-message{padding:10px 0;border-bottom:1px solid var(--border-subtle)}.assistant-message p{white-space:pre-wrap;margin:5px 0}.assistant-message small{color:var(--text-secondary)}.assistant-message[data-role=user]{padding-left:12px;border-left:2px solid var(--accent-primary)}
#assistant-transcript{max-height:38vh;overflow:auto;margin-bottom:14px}#assistant-history-list button{display:block;width:100%;text-align:left;margin:8px 0}#assistant-history-list small{display:block}#assistant-thread-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
@media(max-width:1050px){body #global-more{display:inline-grid}#topbar-secondary{display:none;position:absolute;top:64px;right:24px;padding:10px;background:var(--surface);box-shadow:var(--shadow-soft);border:1px solid var(--border-subtle);border-radius:var(--control-radius);z-index:700}.topbar.secondary-open #topbar-secondary{display:flex}body .topbar #topbar-brain-capture{display:none}}
@media(max-width:760px){body .topbar{padding:12px!important;gap:8px!important}.topbar-actions #quick-create-open span:first-child{display:none}.topbar-actions .quiet-clock{display:none}#topbar-secondary{right:12px}.content>.topbar-identity .topbar-area-label{display:none}body .topbar-actions>.tool-menu{flex:0 0 44px}body .topbar-actions #quick-create-open{padding:8px!important;font-size:12px}.topbar-actions .search-box>span{display:none}body .topbar-actions .search-box input{padding:8px!important}}

/* Override legacy mobile search expansion: keep the input in the shared flex row. */
body .topbar-actions .search-box,body .topbar-actions .search-box:focus-within{order:0;position:relative;inset:auto;padding:0 8px;width:auto;box-shadow:none}
body .topbar-actions .search-box input{opacity:1;pointer-events:auto;border:0!important;min-height:40px!important;background:transparent!important}
body .topbar-actions .search-box:focus-within{box-shadow:var(--focus-ring)}

#assistant-thread-heading>strong{min-width:0;overflow-wrap:anywhere}#assistant-rename{flex:0 0 auto;white-space:nowrap}

/* Detail actions occupy their own bounded row, never overlay the record body. */
body:has(#detail-modal:not([hidden])) .sidebar{z-index:10;pointer-events:none}
#detail-modal>.modal{min-height:0}
#detail-modal #detail-body{min-height:0;flex:1 1 auto;overflow-y:auto}
#detail-action-panel{flex:0 0 auto;min-height:0;border-top:1px solid var(--border-subtle);background:var(--surface)}
.detail-action-toolbar{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:4px 16px;min-height:40px}
.detail-action-toolbar>button{min-height:32px;padding:4px 10px;border-color:transparent;background:transparent;color:var(--text-secondary)}
#detail-action-content{height:var(--detail-actions-height,140px);max-height:40dvh;overflow:auto;overscroll-behavior:contain;padding:0 0 8px}
#detail-action-content[hidden],#detail-action-content [hidden],.detail-action-resize[hidden]{display:none!important}
#detail-action-content .modal-actions{border-top:0;padding:8px 16px;position:static;margin:0}
#detail-action-content>[data-ac-detail]{display:block;margin:0 16px;width:calc(100% - 32px)}
.detail-action-resize{width:72px;height:32px;display:grid;place-items:center;cursor:ns-resize;touch-action:none;border-radius:var(--control-radius)}
.detail-action-resize::before{content:"";width:36px;height:4px;border-radius:4px;background:var(--border-subtle)}
.detail-action-resize:focus-visible{outline:2px solid var(--accent-primary);outline-offset:2px}
