/* W-AI-PAGE-COMPANION-20261014: reuse the existing header action row. */
.contextual-ai-entry{font:inherit;color:inherit;position:relative;direction:ltr}
.contextual-ai-entry .header-control-content{font-size:13px;font-weight:700}
.contextual-ai-unread,.ai-topic-unread{display:inline-grid;place-items:center;background:var(--red,#e60012);color:white;border-radius:12px;min-width:18px;height:18px;padding-inline:3px;font-size:11px;line-height:1;font-weight:700}
.contextual-ai-unread{position:absolute;right:0;top:0;border:1px solid white}
.ai-topic-unread{margin-inline-start:8px}
.ai-topic-list-tools{flex-wrap:wrap;gap:8px}
.ai-topic-list-tools svg{width:18px;height:18px;vertical-align:middle}
.has-report-contextual-ai .kd-x-head{gap:8px;align-items:center}
.has-report-contextual-ai .kd-x-head h2{flex:1;min-width:0}
.contextual-ai-report-entry{margin-inline-start:0;color:var(--ink)}
.contextual-ai-report-entry .header-control-content{background:#f1f2f4;color:var(--ink)}
.contextual-ai-report-actions{display:flex;align-items:center;gap:4px;flex:none}
.has-report-contextual-ai .kd-x-head{flex-wrap:nowrap;padding-inline-end:0}
.has-report-contextual-ai .contextual-ai-report-actions .modal-close{position:static;inset:auto;flex:none;margin:0;width:44px;height:44px;min-width:44px}
.modal.has-report-contextual-ai .task-create-header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-inline:16px}
.modal.has-report-contextual-ai .task-create-header h2{flex:1;min-width:0}
.modal.has-report-contextual-ai .task-create-header>.workspace-editor-tools{flex:0 0 100%;order:3}
.workspace-editor-tools .contextual-ai-entry{margin-inline-start:auto}
.ai-topic-list{max-height:65dvh;overflow:auto}.ai-topic-list-tools{display:flex;gap:8px;justify-content:space-between}.ai-topic-list button{font:inherit;min-height:44px;background:white;border:0;text-align:start;color:inherit}.ai-topic-row{display:flex;align-items:center;border-bottom:1px solid #edf0f4;gap:8px;padding:8px 0}.ai-topic-row>[data-topic-open]{flex:1;min-width:0}.ai-topic-row small{display:block;color:#677180;font-size:12px;margin-top:4px}.ai-topic-menu{position:relative;flex:none}.ai-topic-menu summary{list-style:none;min-width:44px;min-height:44px;display:grid;place-items:center;cursor:pointer}.ai-topic-menu>div{position:absolute;inset-inline-end:0;z-index:5;background:white;box-shadow:0 4px 20px #172b4d22;min-width:150px;border:1px solid #dce1e8;border-radius:8px;display:flex;flex-direction:column;padding:4px}.ai-topic-menu [data-topic-delete]{color:#c90013}
.ai-topic-toolbar{display:flex;align-items:center;gap:4px;flex-wrap:wrap;padding:4px 8px;border-bottom:1px solid #edf0f4;flex:none}.ai-topic-toolbar>strong{flex:1;min-width:70px}.ai-topic-toolbar button{font-size:13px}.ai-topic-context{flex:none;margin:4px 8px;font-size:12px}.ai-topic-context summary{min-height:36px;display:flex;align-items:center}.ai-topic-context pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:180px;overflow:auto}
@media(max-width:719px){.topbar-title{min-width:0}}
@media(max-width:719px){
 /* The original title and My downloads must not compete for the narrow space
    left between the original close control and the physical-right Ai entry. */
 .has-report-contextual-ai .kd-x-head{gap:8px}
 .has-report-contextual-ai .kd-x-head h2{flex:1 1 0;overflow-wrap:anywhere}
 /* W-ATTENDANCE-CONFIRMED-20261015: title and original actions share one
    layer. A toolbar-heavy page may scroll horizontally; no action is removed
    or shrunk below its existing 44px touch area. */
 body:has(.topbar #page-contextual-ai){--topbar-height:var(--contextual-topbar-height,calc(64px + var(--safe-top)))}
 .topbar:has(#page-contextual-ai){flex-wrap:nowrap;gap:0;padding-inline:8px;align-content:center;min-height:calc(64px + var(--safe-top));overflow-x:auto;scrollbar-width:none}
 .topbar:has(#page-contextual-ai)::-webkit-scrollbar{display:none}
 .topbar:has(#page-contextual-ai)>.topbar-brand{flex:1 0 42px;min-width:42px;gap:5px}
 .topbar:has(#page-contextual-ai)>.topbar-brand>div{min-width:0}
 .topbar:has(#page-contextual-ai) .topbar-brand strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .topbar:has(#page-contextual-ai)>.topbar-action,.topbar:has(#page-contextual-ai)>.topbar-back{flex-shrink:0}
 .topbar:has(#page-contextual-ai) .mini-mark{width:24px;height:24px;flex-shrink:0}
}

.assistant-file-drafts{max-height:140px;overflow:auto;flex-shrink:0;padding:6px 10px;border-top:1px solid var(--line)}
.assistant-file-draft{display:flex;align-items:center;gap:8px;min-height:44px;flex-wrap:wrap}.assistant-file-draft span{flex:1;min-width:100px;overflow-wrap:anywhere}.assistant-file-draft small{color:var(--muted)}.assistant-file-draft button,#assistant-attach{min-width:44px;min-height:44px}.assistant-file-draft button{border:0;background:transparent;color:var(--red)}

.assistant-compose #assistant-attach{background:#f1f1f3;color:#333}
 .assistant-original-receipts a{min-height:44px;text-decoration:none}

@media(max-width:719px){.contextual-ai-grip{position:relative;padding-top:14px}.contextual-ai-grip::before{content:"";position:absolute;top:5px;left:50%;transform:translateX(-50%);width:32px;height:4px;border-radius:2px;background:#d6d9de}}
/* The approved interpreter keeps title/language above its existing tools. */
@media(max-width:520px){
 body.interp-page:not(.interp-focus) .topbar:has(#page-contextual-ai)>.topbar-brand{flex-basis:0;min-width:0}
 body.interp-page:not(.interp-focus) .topbar:has(#page-contextual-ai)>.topbar-brand>div{width:auto}
}
