.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.user-menu { position: relative; }
#userMenuPanel [hidden] { display: none; }
#userMenuToggle { width: 44px; height: 44px; padding: .25rem; border-radius: 50%; background: var(--primary-light); color: var(--primary); }
#userMenuPanel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30; width: 272px; max-width: calc(100vw - 2rem); padding: .4rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); box-shadow: 0 8px 24px rgb(0 0 0 / 15%); }
#userMenuPanel a, #userMenuPanel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: .5rem .75rem; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-decoration: none; justify-content: flex-start; }
#userMenuPanel a:hover, #userMenuPanel button:hover { background: var(--subtle); }
#userMenuError { padding: .75rem; color: var(--error); }
#userMenuPanel .menu-version { margin: 0; padding: .35rem .75rem .25rem; color: var(--muted); font-size: .75rem; text-align: center; }
/* Ontwerpkeuze H: identity, Werkgebied, account links, Weergave and a separate Uitloggen. */
#userMenuPanel .menu-identity { display: grid; gap: .1rem; padding: .6rem .75rem .7rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
#userMenuPanel .menu-identity span { color: var(--muted); font-size: .85rem; }
#userMenuPanel .menu-section { padding: .3rem 0; }
#userMenuPanel .menu-section + .menu-section, #userMenuPanel .menu-identity + .menu-section { border-top: 1px solid var(--border); }
#userMenuPanel .menu-identity + .menu-section { border-top: 0; }
#userMenuPanel .menu-heading { margin: .35rem .75rem .2rem; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#userMenuPanel .menu-workspace { display: grid; gap: 0; align-content: center; }
#userMenuPanel .menu-detail { color: var(--muted); font-size: .8rem; }
#userMenuPanel .menu-theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; padding: .2rem .5rem .35rem; }
#userMenuPanel .menu-theme-options button { justify-content: center; min-height: 40px; padding: .4rem .25rem; border: 1px solid var(--border); font-size: .85rem; }
#userMenuPanel .menu-theme-options button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 700; }
.app-header { grid-template-columns: 112px minmax(0, 1fr) 140px; }
.app-header .header-actions { grid-column: 3; grid-row: 1; align-self: start; }
@media (max-width: 600px) { .app-header { grid-template-columns: 96px minmax(0, 1fr) 140px; } }
@media print { .header-actions { display: none !important; } }
/* Context switcher (user-menu.js): current path in the header, panel with Team and Werkgebied. */
.context-switcher[hidden], .context-toggle[hidden] { display: none; }
.header-actions .context-toggle { gap: .35rem; max-width: min(22rem, 40vw); min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font-weight: 600; }
.header-actions .context-toggle:hover { background: var(--subtle); border-color: var(--control-border); }
.context-path { display: inline-flex; min-width: 0; overflow: hidden; white-space: nowrap; }
.context-path .context-part { overflow: hidden; text-overflow: ellipsis; }
.context-path .context-part:not(.context-primary) { color: var(--muted); font-weight: 500; }
.context-separator { padding: 0 .3rem; color: var(--muted); font-weight: 400; }
.context-chevron { line-height: 1; transform: translateY(-.15em); }
.context-dialog { position: fixed; inset: 5.5rem 1.5rem auto auto; margin: 0; width: min(24rem, calc(100vw - 2rem)); max-height: calc(100dvh - 7rem); overflow: auto; padding: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.context-dialog::backdrop { background: rgba(15, 23, 20, .25); }
.context-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.context-head h2 { margin: 0; font-size: 1.125rem; }
.context-dialog .context-section { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.context-dialog .context-section + .context-section { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.context-dialog .context-section h3 { margin: 0 0 .35rem; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.context-dialog .context-section ul { display: grid; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.context-dialog li { margin: 0; padding: 0; border: 0; background: transparent; }
.context-dialog .context-option { display: grid; min-height: 44px; padding: .5rem .75rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.context-dialog .context-option:hover { background: var(--subtle); }
.context-dialog .context-option[aria-current="page"] { background: var(--primary-light); color: var(--primary); }
.context-option-label { font-weight: 600; }
.context-option-detail { color: var(--muted); font-size: .85rem; }
.context-option[aria-current="page"] .context-option-detail { color: inherit; }
@media (max-width: 600px) {
  /* The logo already carries the name; the switcher shows the team, so the text title makes room. */
  .trainer-app .app-header:has(.context-switcher:not([hidden])) .trainer-title h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .header-actions .context-toggle { max-width: 7rem; padding: .5rem .6rem; }
  .context-path .context-part:not(.context-key), .context-separator { display: none; }
  .context-path .context-key { color: var(--text); font-weight: 600; }
  .context-dialog { inset: auto 0 0 0; width: 100vw; max-width: 100vw; max-height: 80dvh; border-radius: 12px 12px 0 0; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
}
@media print { .context-switcher { display: none !important; } }
#userMenuPanel .menu-section:not(:has(> :not([hidden]))) { display: none; }
/* Feedback dialog (user-menu.js): type, privacy rule at the moment of writing, own mail program. */
.feedback-dialog { width: min(26rem, calc(100vw - 2rem)); padding: 1.25rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.feedback-dialog::backdrop { background: rgba(15, 23, 20, .35); }
.feedback-dialog form { display: grid; gap: 1rem; margin: 0; }
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.feedback-head h2 { margin: 0; font-size: 1.125rem; }
.feedback-dialog .feedback-close { width: 44px; min-height: 44px; padding: 0; font-size: 1.25rem; }
.feedback-dialog fieldset.feedback-kind { display: flex; flex-wrap: wrap; gap: .5rem; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
body .feedback-dialog .feedback-kind input[type="radio"][name] { width: 1rem; height: 1rem; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; accent-color: var(--primary); }
.feedback-kind legend { float: left; width: 100%; margin: 0 0 .4rem; padding: 0; font-weight: 600; }
.feedback-kind label { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.feedback-kind label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.feedback-kind label:has(input:focus-visible) { outline: 3px solid var(--secondary); outline-offset: 2px; }
.feedback-privacy { margin: 0; padding: .75rem .9rem; border-left: 4px solid var(--warning-border); border-radius: 6px; background: var(--warning-bg); color: var(--warning-text); }
.feedback-how { margin: 0; color: var(--muted); font-size: .875rem; }
.feedback-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
@media (max-width: 600px) {
  .feedback-dialog { inset: auto 0 0 0; width: 100vw; max-width: 100vw; margin: 0; border-radius: 12px 12px 0 0; padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
  .feedback-actions > * { flex: 1 1 auto; }
}
@media print { .feedback-dialog { display: none !important; } }
