/* Presentation only: the existing history engine owns state and navigation. */
.header-history-heading{display:flex;align-items:center;gap:12px;min-width:0;flex:1 1 0}
.header-history-heading>.page-header-copy{min-width:0;flex:1 1 auto}
.header-history-heading .page-header-text{min-width:0}
.app-history-controls{position:static;display:flex;flex:0 0 auto;gap:4px;margin:0;padding:0;border:0;background:none;box-shadow:none}
/* Older route skins reserve space below the former standalone history row.
   Header-owned controls must never inherit that spacing, including ID skins. */
.header-history-heading>.app-history-controls{margin:0!important}
.app-history-controls button{display:grid;width:44px;height:44px;flex:0 0 44px;place-items:center;padding:0;border:1px solid var(--divider);border-radius:6px;background:#17232b;color:var(--text-primary);font:700 25px/1 var(--font-body);cursor:pointer;touch-action:manipulation}
.app-history-controls button:hover:not(:disabled){border-color:var(--border-strong);background:var(--interactive-hover)}
.app-history-controls button:focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
.app-history-controls button:disabled{opacity:.34;cursor:default}
html[data-theme="light"] .app-history-controls button{background:var(--surface-secondary);color:var(--text-primary);border-color:var(--border-primary)}
html[data-theme="light"] .app-history-controls button:hover:not(:disabled){background:var(--interactive-hover)}
html[data-theme="light"] .app-history-controls button:disabled{opacity:.5}
/* Immersive routes reuse their own header, never a floating history overlay. */
.teaching-toolbar>.header-history-heading{flex-wrap:wrap;gap:8px 12px}
.coaches-chat-topbar>.header-history-heading{justify-content:center}
.coaches-chat-topbar .header-history-heading h1{min-width:0;overflow-wrap:anywhere;white-space:normal}
.coach-messages-thread-heading>.header-history-heading{flex-wrap:wrap}
/* The pending Messages surface has a conversation switcher beside its title.
   Keep that action below the shared title/history group on narrow screens. */
@media(max-width:760px){
 .coach-messages-thread .coach-messages-thread-heading{display:contents}
 .coach-messages-thread-heading>.header-history-heading{grid-row:1;grid-column:1/-1;justify-content:flex-start;flex-wrap:nowrap}
 .coach-messages-thread .coaches-chat-topbar .header-history-heading h1{margin:0;text-align:left}
 .coach-messages-thread .coaches-chat-back{grid-row:2;grid-column:1}
 .coach-messages-thread .coach-messages-thread-heading>button{grid-row:2;grid-column:2}
 .coach-messages-thread .coaches-chat-topbar-actions{grid-row:2;grid-column:3}
}
@media(max-width:900px){
 .workspace>.topbar>.header-history-heading{flex-basis:100%}
 /* Utilities already live in the mobile brand header. Avoid an empty flex row
    while retaining any visible route-specific primary action. */
 .workspace>.topbar>.topbar-actions:has(>.top-action[hidden]){display:none}
}
@media(max-width:620px){
 .header-history-heading{gap:8px}
 .workspace>.topbar .page-identity-visual{display:none}
 .coaches-chat-room .coaches-chat-topbar>.header-history-heading{grid-row:1;grid-column:1/-1;justify-content:flex-start}
 .coaches-chat-room .coaches-chat-topbar .header-history-heading h1{margin:0;text-align:left}
}
