/* Internal application only. Public pages and the CMS canvas keep their own design. */
.app-shell {
  --bg: #f4f6f9;
  --surface-2: #edf2f7;
  --line: #dce3ec;
  --line-strong: #bbc9d8;
  --text: #1b2e40;
  --muted: #52677d;
  --shadow: none;
  --radius-panel: 12px;
  --radius-control: 8px;
  background: var(--bg);
}

.app-shell .main:not(.main--home)::before { display: none; }
.app-shell [data-server-freshness-host]:empty { display: none; }
.app-shell .app-header {
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.app-shell .brand { color: var(--navigation-blue); }
.app-shell .brand span { color: var(--muted); }
.app-shell .brand:hover { background: var(--surface-2); }
.app-shell :is(.nav-group-button, .nav-website-link, .nav-logout-button) { color: var(--muted); }
.app-shell :is(.nav-group.active, .nav-group.open) > .nav-group-button,
.app-shell :is(.nav-group-button, .nav-website-link, .nav-logout-button):hover {
  color: var(--navigation-blue);
  background: var(--navigation-blue-soft);
  box-shadow: none;
}
.app-shell :is(.brand, .nav-group-button, .nav-website-link, .nav-logout-button, .mobile-nav-toggle):focus-visible {
  outline-color: var(--navigation-blue);
}
.app-shell .mobile-nav-toggle { border-color: var(--line); }
.app-shell .mobile-nav-toggle span { background: var(--navigation-blue); }
.app-shell .nav-dropdown { border-color: var(--line); box-shadow: 0 12px 32px #1b2e4014; }
.app-shell .section { box-shadow: none; }
.app-shell :is(button, a, input, select, textarea) { scroll-margin-bottom: 100px; }

/* A keyboard shortcut past navigation, without changing the app's hash route. */
.app-skip-link {
  position: fixed; top: 12px; left: 12px; z-index: calc(var(--z-navigation) + 1);
  max-width: calc(100vw - 24px); min-height: 44px; padding: 12px 18px;
  border: 2px solid var(--navigation-blue); border-radius: 8px;
  background: var(--surface); color: var(--navigation-blue); font-weight: 650;
  transform: translateY(calc(-100% - 24px));
}
.app-skip-link:focus { transform: none; outline: 3px solid var(--focus-ring-color); outline-offset: 2px; }
.app-shell [data-app-content]:focus { outline: none; }
.app-shell [data-app-page-heading]:focus-visible { outline: 2px solid var(--navigation-blue); outline-offset: 5px; border-radius: 3px; }
.app-shell [data-server-view-state] { max-width: 900px; margin-inline: auto; }
.app-shell [data-server-view-state] .section-body { padding: 24px; }
.app-shell [data-server-view-state] p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.app-shell [data-server-view-state] button { justify-self: start; min-height: 44px; white-space: normal; }

.member-bottom-nav { display: none; }
.member-start { width: min(100%, 980px); margin: 24px auto; }
.member-start h1 { margin: 0 0 28px; font-size: clamp(24px, 3vw, 32px); color: var(--text); }
.member-eyebrow { margin: 0 0 8px; font-weight: 650; color: var(--muted); }
.member-start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.member-start-grid > button {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 112px;
  padding: 22px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}
.member-start-grid > button:hover { border-color: var(--navigation-blue-light); background: var(--surface-2); }
.member-start-grid strong { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; }
.member-start-grid > button > span { color: var(--muted); }
.member-start-customize { margin-top: 24px; background: var(--surface); }
.member-equipment-tabs { display: none; }

/* Shared workspace. Only the internal application loads this stylesheet.
   Desktop navigation reuses the same permission-filtered controls as mobile. */
.workspace-navigation-toggle, .workspace-home-link { display: none; }
.app-shell .member-start { width: 100%; max-width: none; margin: 8px 0; }
.app-shell .workspace-home-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 28px;
}
.app-shell .workspace-home-header h1 { margin: 0 0 10px; color: var(--navigation-blue); }
.app-shell .workspace-home-intro { margin: 0; color: var(--muted); max-width: 65ch; }
.app-shell .workspace-home-header .member-start-customize {
  margin: 0; min-height: 44px; border: 1px solid var(--line); color: var(--navigation-blue);
}
.app-shell .workspace-personal-shortcuts { margin-top: 32px; }
.app-shell .workspace-personal-shortcuts h2 { margin: 0 0 12px; font-size: 17px; color: var(--text); }
.app-shell .workspace-personal-shortcuts > div { display: flex; flex-wrap: wrap; gap: 10px; }
.app-shell .workspace-personal-shortcuts button {
  min-height: 44px; padding: 11px 14px; background: var(--surface);
  border: 1px solid var(--line); color: var(--navigation-blue);
  display: flex; gap: 18px; justify-content: space-between; text-align: left;
}
.app-shell .member-start--personal .home-dashboard {
  --home-form-bar-width: 100%; max-width: none; width: 100%; margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.app-shell .member-start--personal .home-dashboard:has(.home-form-entry.expanded) { grid-template-columns: minmax(0, 1fr); }
.app-shell .member-start--personal .home-form-shortcut-button {
  width: 100%; min-height: 128px; padding: 22px; grid-template-columns: minmax(0, 1fr);
  align-content: start; align-items: start; gap: 14px; background: var(--surface);
}
.app-shell .member-start--personal .home-form-shortcut-title { font-size: 17px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
.app-shell .member-start--personal .home-form-shortcut-area { color: var(--muted); text-align: left; font-size: 14px; }

@media (min-width: 981px) {
  .app-shell { --workspace-sidebar-width: 240px; }
  .app-shell .app-header { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 24px; gap: 20px; }
  .app-shell .workspace-navigation-toggle {
    display: inline-flex; min-height: 44px; padding: 10px 14px;
    border: 1px solid var(--line); color: var(--navigation-blue); background: var(--surface);
  }
  .app-shell .main-nav {
    position: fixed; inset: var(--navigation-shell-height) auto 0 0;
    width: var(--workspace-sidebar-width); max-height: none; min-height: 0;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; padding: 18px 12px 24px; overflow-y: auto; overscroll-behavior-y: contain;
    background: var(--surface); border-right: 1px solid var(--line); scrollbar-gutter: stable;
  }
  .app-shell .main { margin-left: var(--workspace-sidebar-width); }
  .app-shell .main::before { left: var(--workspace-sidebar-width); }
  .app-shell .main-nav > * { flex-shrink: 0; }
  .app-shell .workspace-home-link {
    display: block; width: 100%; min-height: 44px; padding: 12px;
    text-align: left; background: transparent; color: var(--text); border: 0; margin-bottom: 12px;
  }
  .app-shell .workspace-home-link[aria-current] { background: var(--navigation-blue-soft); color: var(--navigation-blue); font-weight: 650; }
  .app-shell .main-nav .nav-group-button { width: 100%; white-space: normal; min-height: 44px; text-align: left; padding: 12px 28px 12px 12px; }
  .app-shell .main-nav .nav-dropdown {
    position: static; width: 100%; min-width: 0; max-width: none; max-height: none;
    grid-template-columns: minmax(0, 1fr); margin: 4px 0 10px; padding: 0 0 0 10px;
    border: 0; border-left: 2px solid var(--line); border-radius: 0; box-shadow: none;
    overflow: visible; background: transparent;
  }
  .app-shell .main-nav .nav-dropdown :is(button, a) { min-height: 44px; white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
  .app-shell .nav-dropdown-section-label { grid-column: 1; }
  .app-shell .nav-website-link { margin-top: 18px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 16px; }
  .app-shell .nav-logout-button { text-align: left; }
  .app-shell.workspace-navigation-hidden .main-nav { display: none; }
  .app-shell.workspace-navigation-hidden .main { margin-left: 0; }
  .app-shell.workspace-navigation-hidden .main::before { left: 0; }
  /* A contextual workspace already has its own navigation. Its global menu
     opens over the edge instead of adding a third column to the editor. */
  .app-shell.workspace-local-navigation .main { margin-left: 0; }
  .app-shell.workspace-local-navigation:not(.workspace-navigation-hidden) .main-nav { box-shadow: 8px 0 24px #1b2e4022; }
  .app-shell .content { max-width: none; padding: 28px; }
  .app-shell:is([data-app-view="boats"], [data-app-view="oarsMobileBeta"]) .main .content { max-width: none; }
  .app-shell.workspace-local-navigation :is(.admin-workspace, .website-cms) { max-width: none; }
  .app-shell .member-start-grid, .app-shell .member-start--personal .home-dashboard:not(:has(.home-form-entry.expanded)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-shell .member-start-grid > button { min-height: 144px; padding: 22px; align-content: start; gap: 18px; }
  .app-shell .admin-overview-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 981px) and (max-width: 1199px) {
  .app-shell .member-start-grid, .app-shell .admin-overview-cards,
  .app-shell .member-start--personal .home-dashboard:not(:has(.home-form-entry.expanded)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell .content { padding: 22px; }
}
@media (max-width: 600px) {
  .app-shell .workspace-home-header { gap: 16px; margin-bottom: 22px; }
  .app-shell .workspace-personal-shortcuts > div { display: grid; grid-template-columns: minmax(0, 1fr); }
  .app-shell .member-start--personal .home-dashboard { grid-template-columns: minmax(0, 1fr); }
  .app-shell .member-start--personal .home-form-shortcut-button { min-height: 104px; padding: 20px; }
}

.app-shell:is([data-app-view="boats"], [data-app-view="oarsMobileBeta"]) .content { max-width: 1440px; padding: 24px; }
.app-shell :is(.boats-list-section, .oars-mobile-beta-section) {
  border: 0;
  background: transparent;
  overflow: visible;
}
.app-shell:is([data-app-view="boats"], [data-app-view="oarsMobileBeta"]) .section > .section-header {
  border: 0;
  background: transparent;
  padding: 12px 0 20px;
}
.app-shell :is(.boats-list-section, .oars-mobile-beta-section) > .section-header h2 { font-size: 26px; color: var(--text); }
.app-shell :is(.boats-list-section, .oars-mobile-beta-section) > .section-body { padding: 0; }
.app-shell :is(.boats-table, .oars-table) { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.app-shell :is(.boats-table, .oars-table) th { background: var(--surface-2); }
.app-shell :is(.boats-table, .oars-table) td { padding-block: 14px; border-color: var(--line); }
.app-shell :is(.boats-table, .oars-table) .row-button { font-weight: 650; color: var(--navigation-blue); }

.member-navigation-links { display: grid; gap: 8px; }
.member-navigation-links h3 { font-size: 15px; margin: 0; }
.member-navigation-links [role="menu"] { display: grid; gap: 4px; padding: 4px 0 8px 12px; }
.member-navigation-links [role="menu"][hidden] { display: none; }
.member-navigation-links :is(button, a) {
  display: block;
  min-height: 48px;
  width: 100%;
  padding: 13px 12px;
  text-align: left;
  color: var(--text);
  background: white;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.member-navigation-links :is(button, a):hover,
.member-navigation-links .active { background: var(--navigation-blue-soft); color: var(--navigation-blue); }
.member-navigation-links .nav-user-review-unavailable { font-style: italic; }
.member-navigation-current { margin: 0 0 8px; padding: 0 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.member-navigation-current strong { display: block; margin-top: 4px; color: var(--text); font-size: 16px; }
.member-navigation-links :is(.member-navigation-group-toggle, .nav-direct-link) { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-weight: 650; background: var(--surface-2); }
.app-shell .nav-direct-link::after { content: none; }
.app-shell .nav-direct-link.nav-user-review-unavailable { font-style: italic; }
.member-navigation-links .nav-direct-link::after { content: "›"; position: static; border: 0; transform: none; width: auto; height: auto; font-size: 20px; }
.member-navigation-group.is-current > h3 > button { color: var(--navigation-blue); box-shadow: inset 3px 0 var(--navigation-blue); }
.member-navigation-chevron { flex: 0 0 auto; font-size: 18px; }
.member-navigation-group-toggle[aria-expanded="true"] .member-navigation-chevron { transform: rotate(180deg); }
.member-navigation-links [aria-current="page"] { font-weight: 650; box-shadow: inset 3px 0 var(--navigation-blue); }
.member-navigation-links .nav-dropdown-section-label { color: var(--muted); font-size: 12px; padding: 16px 12px 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.member-navigation-footer { display: grid; gap: 4px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.member-navigation-dialog .dialog-body { padding: 20px; }

.work-time-quarter-filters { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(90px, 1fr) minmax(130px, 1fr); gap: 16px; max-width: 820px; }
.work-time-quarter-filters .label { display: grid; gap: 8px; min-width: 0; }
.work-time-quarter-filters :is(select, input) { min-height: 44px; width: 100%; min-width: 0; }
.work-time-quarter-overview { display: grid; gap: 24px; }
.work-time-quarter-heading { display: flex; gap: 16px; align-items: start; justify-content: space-between; flex-wrap: wrap; }
.work-time-quarter-heading h3 { margin: 0 0 8px; }
.work-time-quarter-heading p { margin: 0; color: var(--muted); }
.work-time-quarter-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.work-time-quarter-summary > div { background: var(--surface-2); border-radius: 10px; padding: 18px; }
.work-time-quarter-summary dt { color: var(--muted); font-size: 14px; }
.work-time-quarter-summary dd { margin: 8px 0 0; color: var(--navigation-blue); font-size: 24px; font-weight: 700; }
.work-time-quarter-overview > p { margin: -12px 0 0; }
.work-time-quarter-months h4, .work-time-quarter-next h4 { margin: 0 0 12px; font-size: 17px; }
.work-time-quarter-month-table { width: 100%; table-layout: fixed; max-height: none; container-type: normal; }
.work-time-quarter-month-table :is(td, th) { padding: 12px 8px; white-space: normal; overflow-wrap: anywhere; }
.work-time-quarter-month-table th { position: static; }
.work-time-quarter-month-table th:first-child { width: 22%; }
.work-time-quarter-month-table th:last-child { width: 24%; }
.work-time-quarter-month-table th small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.work-time-quarter-month-table [data-employed="false"] { color: var(--muted); background: var(--surface-2); }
.work-time-quarter-next { border-top: 1px solid var(--line); padding-top: 20px; }
.work-time-quarter-actions { flex-wrap: wrap; gap: 10px; }
.work-time-quarter-actions button { min-height: 44px; }
@media (max-width: 760px) {
  .work-time-quarter-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-time-quarter-filters > :first-child { grid-column: 1 / -1; }
  .work-time-quarter-summary { grid-template-columns: 1fr; }
  .work-time-quarter-summary > div { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px; }
  .work-time-quarter-summary dd { margin: 0; white-space: nowrap; }
  .work-time-quarter-month-table, .work-time-quarter-month-table tbody { display: block; }
  .work-time-quarter-month-table thead { display: none; }
  .work-time-quarter-month-table tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin-block: 12px; padding: 12px; }
  .work-time-quarter-month-table th:first-child { display: block; width: auto; padding: 4px 0 12px; }
  .work-time-quarter-month-table td { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 10px 0; width: auto; text-align: right; }
  .work-time-quarter-month-table td::before { content: attr(data-label); text-align: left; color: var(--muted); flex: 0 0 40%; }
  .work-time-quarter-month-table [data-employed="false"] td:not(:last-child) { display: none; }
  .work-time-quarter-month-table [data-employed="false"] td:last-child { display: block; text-align: left; }
  .work-time-quarter-month-table [data-employed="false"] td:last-child::before { display: none; }
  .work-time-quarter-actions { display: grid; grid-template-columns: 1fr; }
}

.directory-filter-dialog .dialog-body { display: grid; align-content: start; gap: 22px; }
.directory-filter-dialog .label { display: grid; gap: 8px; }
.directory-filter-column { border-top: 1px solid var(--line); }
.directory-filter-column > summary { padding: 16px 4px; min-height: 48px; font-weight: 650; }
.directory-filter-field { display: grid; gap: 12px; padding: 0 4px 16px; }
.directory-filter-field .excel-filter-values { border: 0; padding: 0; }
.directory-filter-field .excel-filter-value-list { max-height: 220px; overflow-y: auto; }
.directory-filter-field .excel-filter-value-option { min-height: 44px; align-items: center; }
.directory-filter-field .excel-filter-row-count { display: none; }
.directory-filter-dialog .dialog-footer { justify-content: space-between; }
.directory-filter-toggle.active { color: var(--navigation-blue); background: var(--navigation-blue-soft); }

.member-ergometer-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.member-scope-switch { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.member-scope-switch button { min-height: 44px; border: 0; background: transparent; padding: 10px 14px; color: var(--muted); }
.member-scope-switch button[aria-pressed="true"] { background: var(--navigation-blue-soft); color: var(--navigation-blue); font-weight: 650; }
.app-shell .profile-ergometer-booking .ergometer-simple-week { padding: 0; gap: 12px; }
.app-shell .profile-ergometer-booking .ergometer-simple-group { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.app-shell .profile-ergometer-booking .ergometer-simple-group-bar {
  position: relative;
  min-height: 100px;
  padding: 18px 20px;
  gap: 6px;
  text-align: left;
  border-left: 4px solid var(--ergometer-group-color);
  background: var(--surface);
}
.app-shell .profile-ergometer-booking .ergometer-simple-group-bar:is(:hover, [aria-expanded="true"]) { background: var(--surface-2); }
.app-shell .profile-ergometer-booking .ergometer-simple-group-heading { font-size: 17px; color: var(--text); }
.app-shell .profile-ergometer-booking :is(.ergometer-simple-group-schedule, .ergometer-simple-group-status) { font-size: 14px; color: var(--muted); }
.app-shell .profile-ergometer-booking .ergometer-simple-group-detail { background: var(--surface); border-color: var(--line); padding: 16px; }
.app-shell[data-app-section="profile-ergometer"] .content { max-width: 1180px; }
.app-shell[data-app-section="profile-ergometer"] [data-nav-section="profile-ergometer"] { border: 0; background: transparent; }
.app-shell[data-app-section="profile-ergometer"] [data-nav-section="profile-ergometer"] > .section-header { padding: 12px 0 20px; border: 0; background: transparent; }
.app-shell[data-app-section="profile-ergometer"] [data-nav-section="profile-ergometer"] > .section-header h2 { font-size: 26px; color: var(--text); }
.app-shell[data-app-section="profile-ergometer"] .profile-ergometer-booking { padding: 0; }

@media (max-width: 980px) {
  .app-shell .main-nav { background: var(--surface); border-color: var(--line); }
  .app-shell .nav-dropdown { box-shadow: none; }
  .app-shell .nav-dropdown :is(button, a) { color: var(--text); }
  .app-shell .nav-dropdown :is(button, a):is(:hover, .active) { background: var(--navigation-blue-soft); color: var(--navigation-blue); }
  .app-shell .nav-dropdown-section-label { color: var(--muted); border-color: var(--line); }
  .app-shell .nav-website-link { background: var(--surface-2); border-color: var(--line); }
}

@media (max-width: 600px) {
  .app-shell .app-header :is(.mobile-nav-toggle, .main-nav) { display: none; }
  .app-shell[data-app-view] .content { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .app-shell:is([data-app-view="boats"], [data-app-view="oarsMobileBeta"], [data-app-view="home"], [data-app-section="profile-ergometer"]) .content {
    padding: 20px 16px calc(104px + env(safe-area-inset-bottom));
  }
  .app-shell .main-nav { max-height: calc(100dvh - var(--navigation-shell-height) - 80px - env(safe-area-inset-bottom)); }
  .app-shell .app-notification { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .app-shell .brand strong { font-size: 13px; }
  .app-shell .brand img { width: 36px; height: 36px; flex-basis: 36px; }
  .member-bottom-nav {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    position: fixed;
    z-index: var(--z-navigation);
    inset: auto 0 0;
    gap: 4px;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .member-bottom-nav button {
    display: grid;
    place-content: center;
    gap: 3px;
    min-height: 56px;
    padding: 6px 2px;
    min-width: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 12px;
  }
  .member-bottom-nav button[aria-current="page"] { background: var(--navigation-blue-soft); color: var(--navigation-blue); font-weight: 650; }
  .member-nav-symbol { justify-self: center; }
  .ergometer-fullscreen-open .member-bottom-nav { display: none; }
  .member-start { margin-block: 4px 16px; }
  .member-start-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .member-start-grid > button { padding: 20px; min-height: 96px; }
  .member-start h1 { margin-bottom: 24px; }
  .member-equipment-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
  .member-equipment-tabs a { flex: 1; min-width: 0; padding: 12px; min-height: 44px; border-radius: 8px; color: var(--muted); text-decoration: none; text-align: center; }
  .member-equipment-tabs a[aria-current="page"] { color: var(--navigation-blue); background: var(--navigation-blue-soft); font-weight: 650; }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-mobile-toolbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
  }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-mobile-filters {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; overflow: visible;
  }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-filter-toggle {
    min-width: 0; white-space: normal; text-align: left;
  }
  .directory-filter-toggle { min-height: 46px; padding: 10px 14px; border-radius: 8px; background: var(--surface); }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) [data-responsive-data-search-count] { grid-column: 1 / -1; }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-card-list { gap: 12px; }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-card { position: relative; background: var(--surface); padding: 16px 18px; gap: 8px; overflow: visible; }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-card:focus-within { outline: 3px solid var(--focus-ring-color); outline-offset: 2px; }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-card-title { border: 0; background: transparent; padding: 0; min-height: 44px; font-size: 18px; color: var(--text); }
  .app-shell :is(.responsive-data-view--boats, .responsive-data-view--oarsMobileBeta) .responsive-data-card-title::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
  .app-shell .responsive-data-view--boats .responsive-data-card-meta { display: flex; gap: 12px 20px; flex-wrap: wrap; }
  .app-shell .responsive-data-view--boats .responsive-data-card-meta > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .app-shell .boat-mobile-card-allocation { border: 0; padding-top: 4px; }
  .app-shell .oar-mobile-beta-description { color: var(--muted); margin: 0 0 6px; }
  .app-shell[data-app-section="profile-ergometer"] [data-nav-section="profile-ergometer"] > .section-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .app-shell[data-app-section="profile-ergometer"] [data-nav-section="profile-ergometer"] > .section-header .header-actions { justify-content: flex-start; text-align: left; }
  .member-ergometer-toolbar { gap: 12px; }
  .member-scope-switch { width: 100%; }
  .member-scope-switch button { flex: 1; min-width: 0; padding-inline: 8px; }
}

/* Member workspaces. Scope deliberately excludes Admin, CMS and public pages. */
.app-shell:is([data-app-view="trainingPrograms"], [data-app-view="teams"], [data-app-view="assignments"], [data-app-view="profile"], [data-app-view="profileAdmin"]) .content {
  width: 100%;
  max-width: 1440px;
  padding: 24px;
}
.app-shell[data-app-view="profile"] .content,
.app-shell[data-app-view="profileAdmin"] .content { max-width: 1180px; }
.app-shell :is(.member-list-section, .profile-home-admin) { border: 0; background: transparent; overflow: visible; }
.app-shell :is(.member-list-section, .profile-home-admin) > .section-header {
  padding: 12px 0 20px; border: 0; background: transparent; gap: 16px;
}
.app-shell :is(.member-list-section, .profile-home-admin) > .section-header h2,
.app-shell[data-app-view="teams"] .section-title-dropdown-toggle { font-size: 26px; color: var(--text); }
.app-shell :is(.member-list-section, .profile-home-admin) > .section-body { padding: 0; }
.app-shell .member-list-section .responsive-data-view-table > .table-wrap,
.app-shell .profile-home-admin > .section-body > .table-wrap {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.app-shell .member-list-section .responsive-data-view-table th { background: var(--surface-2); }
.app-shell .member-list-section .responsive-data-view-table td { padding-block: 14px; }
.app-shell .member-list-section .row-button { font-weight: 650; color: var(--navigation-blue); }
.app-shell .member-list-section .table-filter-toolbar { gap: 12px; margin-bottom: 18px; }
.member-view-intro { color: var(--muted); max-width: 68ch; margin: 0 0 20px; line-height: 1.6; }

/* Group and period are the primary task; import actions remain in the same form. */
.app-shell[data-app-view="trainingPrograms"] .training-program-import {
  padding: 20px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.app-shell[data-app-view="trainingPrograms"] .training-program-workflow {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "group dates" "file upload" "period-actions period-actions";
  gap: 20px; align-items: end;
}
.app-shell[data-app-view="trainingPrograms"] .training-program-workflow.is-read-only {
  width: 100%; grid-template-areas: "group dates" "period-actions period-actions";
}
.app-shell[data-app-view="trainingPrograms"] .training-program-scope-actions {
  display: flex; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line);
}
.app-shell[data-app-view="trainingPrograms"] .training-program-scope-actions > button { width: auto; min-height: 44px; }
.app-shell[data-app-view="trainingPrograms"] .training-program-scope-actions > button:not(.danger) { background: var(--surface); color: var(--navigation-blue); border: 1px solid var(--line-strong); }
.app-shell[data-app-view="trainingPrograms"] .training-program-upload-actions { align-self: end; }
.training-program-card-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.app-shell[data-app-view="profile"] [data-nav-section] > .section-header {
  background: transparent; color: var(--text); border: 0; padding: 18px 0; box-shadow: none;
}
.app-shell[data-app-view="profile"] [data-nav-section] > .section-header h2 { color: var(--text); font-size: 24px; }
.app-shell[data-app-view="profile"] [data-nav-section] > .clickable-section-header::after { content: "−"; font-size: 22px; color: var(--muted); }
.app-shell[data-app-view="profile"] [data-nav-section] > .clickable-section-header[aria-expanded="false"] { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.app-shell[data-app-view="profile"] [data-nav-section] > .clickable-section-header[aria-expanded="false"]::after { content: "+"; }
.app-shell[data-app-view="profile"] [data-nav-section] { border: 0; background: transparent; }
.app-shell[data-app-view="profile"] [data-nav-section] > .section-body { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.app-shell[data-app-view="profile"] .profile-contact-body { margin-top: 0; padding: 24px; }
.app-shell[data-app-view="profile"] .person-detail-primary-row { gap: 32px; }
.app-shell[data-app-view="profile"] .profile-contact-body .detail-group h3 { margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.app-shell[data-app-view="profile"] .profile-contact-body .line-item { padding-block: 12px; gap: 12px; overflow-wrap: anywhere; }
.app-shell[data-app-view="profile"] .profile-contact-body .detail-edit-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.app-shell[data-app-view="profile"] .profile-contact-body .form-actions { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.app-shell[data-app-view="profile"] .profile-contact-body .form-actions button { min-width: 120px; min-height: 44px; }
.app-shell .profile-home-admin-table td { padding-block: 16px; }
.app-shell .profile-home-admin .home-order-controls { grid-template-columns: minmax(58px, 1fr) 44px 44px; }
.app-shell .profile-home-admin .home-order-controls button { width: 44px; height: 44px; }
.app-shell .profile-home-admin th:last-child,
.app-shell .profile-home-admin td:last-child { width: 208px; }

@media (max-width: 800px) {
  .app-shell[data-app-view="trainingPrograms"] .training-program-workflow,
  .app-shell[data-app-view="trainingPrograms"] .training-program-workflow.is-read-only {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "group" "dates" "file" "upload" "period-actions";
  }
  .app-shell[data-app-view="trainingPrograms"] .training-program-workflow.is-read-only { grid-template-areas: "group" "dates" "period-actions"; }
  .app-shell[data-app-view="profile"] .person-detail-primary-row { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 600px) {
  .app-shell:is([data-app-view="trainingPrograms"], [data-app-view="teams"], [data-app-view="assignments"], [data-app-view="profile"], [data-app-view="profileAdmin"]) .content {
    padding: 20px 16px calc(104px + env(safe-area-inset-bottom));
  }
  .app-shell :is(.member-list-section, .profile-home-admin) > .section-header,
  .app-shell[data-app-view="profile"] [data-nav-section] > .section-header {
    flex-wrap: wrap; align-items: center; gap: 10px; text-align: left;
  }
  .app-shell :is(.member-list-section, .profile-home-admin) > .section-header .header-actions { justify-content: flex-start; text-align: left; }
  .app-shell .member-list-section .responsive-data-mobile-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
  .app-shell .member-list-section .responsive-data-mobile-filters { grid-column: 2; grid-row: 1; padding: 0; overflow: visible; }
  .app-shell .member-list-section [data-responsive-data-search-count] { grid-column: 1 / -1; }
  .app-shell .member-list-section .responsive-data-card-list { gap: 12px; }
  .app-shell .member-list-section .responsive-data-card { padding: 16px; gap: 12px; background: var(--surface); }
  .app-shell .member-list-section .responsive-data-card-title { border: 0; padding: 0; min-height: 44px; font-size: 18px; color: var(--text); background: transparent; }
  .app-shell .member-list-section .responsive-data-card-title--static { min-height: 0; }
  .app-shell .member-list-section .responsive-data-card-meta { gap: 10px; }
  .app-shell .member-list-section .responsive-data-card-meta > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .app-shell .member-list-section .responsive-data-card-meta dt { font-size: 12px; }
  .app-shell .member-list-section .responsive-data-card-meta dd { white-space: normal; }
  .app-shell .member-list-section .responsive-data-card-actions { border-top: 1px solid var(--line); padding-top: 12px; }
  .app-shell .member-list-section .responsive-data-card-actions button { min-height: 44px; }
  .app-shell[data-app-view="trainingPrograms"] .training-program-import { padding: 16px; }
  .app-shell[data-app-view="trainingPrograms"] .training-program-workflow { gap: 16px; }
  .app-shell[data-app-view="trainingPrograms"] .training-program-scope-actions > button { width: 100%; }
  .app-shell[data-app-view="trainingPrograms"] .training-program-upload-actions button { width: 100%; min-height: 44px; white-space: normal; }
  .app-shell[data-app-view="profile"] .profile-contact-body { padding: 18px; }
  .app-shell[data-app-view="profile"] .profile-contact-body .line-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .app-shell[data-app-view="profile"] .profile-contact-body .line-item > span { font-size: 13px; color: var(--muted); }
  .app-shell[data-app-view="profile"] .profile-contact-body .line-item > strong { text-align: left; }
  /* Keep one semantic table and one set of controls. Explicit roles in the
     markup preserve its relationships when rows are presented as cards. */
  .app-shell .profile-home-admin > .section-body > .table-wrap {
    border: 0; background: transparent; overflow: visible;
    /* Mobile cards must contribute their full height to page scrolling. */
    height: auto; max-height: none;
  }
  .app-shell .profile-home-admin-table { display: block; }
  .app-shell .profile-home-admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .app-shell .profile-home-admin-table tbody { display: grid; gap: 12px; }
  .app-shell .profile-home-admin-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .app-shell .profile-home-admin-table td { display: block; padding: 0; width: auto; border: 0; background: transparent; }
  .app-shell .profile-home-admin-table .home-admin-checkbox-cell { grid-column: 1; grid-row: 1 / 3; width: 44px; padding: 0; }
  .app-shell .profile-home-admin-table .home-admin-name-cell { grid-column: 2; grid-row: 1; }
  .app-shell .profile-home-admin-table .home-admin-group-cell { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 12px; }
  .app-shell .profile-home-admin-table td.home-admin-order-column { display: block; grid-column: 1 / -1; width: auto; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
  .app-shell .profile-home-admin-table tr:not(.home-admin-selected) .home-admin-order-column { display: none; }
  .app-shell .profile-home-admin-table tr.home-admin-selected { border-color: var(--navigation-blue-light); }
  .app-shell .profile-home-admin-table tr.home-admin-selected td { background: transparent; }
}

/* Administration: the same hierarchy at every level, with a quiet work area. */
.app-shell .admin-workspace { width: 100%; max-width: none; margin-inline: auto; grid-template-columns: minmax(0, 1fr); gap: 0; }
.app-shell .navigation-overview { width: 100%; min-width: 0; }
.app-shell .nav-direct-link.nav-user-review-unavailable,
.app-shell .navigation-overview-cards .nav-user-review-unavailable { font-style: italic; }
.app-shell .navigation-overview-cards .admin-overview-card :is(p, span) { font-style: normal; }
.app-shell .navigation-overview-cards .admin-overview-card:focus-visible { outline: 3px solid var(--focus-ring-color); outline-offset: 3px; }
.app-shell .admin-sidebar { padding: 12px; border-color: var(--line); scrollbar-gutter: stable; }
.app-shell .admin-sidebar-title { margin-bottom: 8px; }
.app-shell .admin-sidebar a { font-size: 14px; }
.app-shell .admin-sidebar .admin-sidebar-title { font-size: 18px; }
.app-shell .admin-sidebar a[aria-current="page"] { background: var(--navigation-blue-soft); color: var(--navigation-blue); }
.app-shell .admin-sidebar-children { border-color: var(--line); }
.app-shell .admin-sidebar-children a { font-size: 13px; }
.app-shell .admin-page-header { padding: 4px 0 24px; margin: 0; }
.app-shell .admin-page-header h1 { font-size: clamp(24px, 2.4vw, 30px); margin: 16px 0 8px; color: var(--text); line-height: 1.2; }
.app-shell .admin-page-header p { max-width: 72ch; font-size: 14px; }
.app-shell .admin-breadcrumb { color: var(--muted); font-size: 13px; }
.app-shell .admin-overview-cards { gap: 16px; }
.app-shell .admin-overview-card { padding: 22px; gap: 12px; min-height: 160px; border-color: var(--line); box-shadow: 0 2px 4px #1b2e4003; }
.app-shell .admin-overview-card h3 { color: var(--text); font-size: 17px; line-height: 1.4; }
.app-shell .admin-overview-card p { font-size: 14px; }
.app-shell .admin-overview-card > span { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding-top: 8px; }
.app-shell .admin-overview-card > span > span { font-size: 20px; }
.app-shell .admin-overview-card:hover { border-color: var(--navigation-blue-light); background: #f9fbfd; }
.app-shell .admin-page-content .section { border-color: var(--line); border-radius: 12px; background: var(--surface); }
.app-shell .admin-page-content .section-header { background: var(--surface); border-color: var(--line); }
.app-shell .admin-page-content .section-body { padding: 22px; }
.app-shell .admin-page-content :is(input, select, textarea) { border-color: var(--line-strong); }
.app-shell .admin-page-content .form-actions { gap: 10px; flex-wrap: wrap; }
.app-shell .admin-page-content .form-actions button { min-height: 44px; white-space: normal; }
.app-shell .admin-page-content th { background: var(--surface-2); }
.app-shell .admin-page-content :is(th, td) { border-color: var(--line); }

/* The editor chrome is separate from the public text/image canvases.
   Do not put typography/color overrides on editable or preview descendants. */
.app-shell .website-cms { max-width: 1540px; width: 100%; }
.app-shell .website-editor-layout { grid-template-columns: 252px minmax(0, 1fr); gap: 24px; }
.app-shell .website-editor-outline {
  display: grid;
  grid-template-rows: auto minmax(80px, 1fr) auto;
  gap: 0;
  padding: 0;
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: auto;
  max-height: calc(100dvh - var(--navigation-shell-height, 100px) - 32px);
}
.website-editor-sidebar-head { min-width: 0; padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
.website-editor-sidebar-body { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding: 16px 12px; }
.website-editor-sidebar-footer { min-width: 0; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.app-shell .website-editor-page-controls { margin: 0; gap: 8px; }
.app-shell .website-editor-page-picker { gap: 8px; font-size: 13px; font-weight: 650; }
.app-shell .website-editor-page-picker select { min-height: 44px; font-size: 14px; font-weight: 400; }
.app-shell .website-editor-outline .website-editor-view-tools { gap: 8px; margin: 10px 0 0; }
.app-shell .website-editor-view-tools button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); }
.app-shell .website-editor-outline h3 { margin: 0 8px 10px; font-size: 12px; color: var(--muted); font-weight: 650; }
.app-shell .website-editor-outline-list { gap: 4px; }
.app-shell .website-editor-outline-item { border-radius: 8px; font-size: 14px; color: var(--text); padding: 11px 12px; }
.app-shell .website-editor-outline-item[aria-current] { background: var(--navigation-blue-soft); color: var(--navigation-blue); border-color: transparent; }
.app-shell .website-editor-workspace .website-cms-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 0; margin: 0; border: 0; }
.app-shell .website-editor-workspace .website-cms-actions > button { min-width: 0; min-height: 44px; padding: 10px 6px; font-size: 13px; white-space: normal; }
.app-shell .website-editor-workspace .website-cms-actions > :is([data-website-publish], span) { grid-column: 1 / -1; }
.app-shell .website-editor-workspace .website-cms-actions [data-website-preview] { border: 1px solid var(--line-strong); }
.app-shell .website-editor-sidebar-footer .website-cms-status { display: grid; gap: 6px; margin: 12px 0 0; font-size: 12px; line-height: 1.4; }
.app-shell .website-editor-sidebar-footer .website-cms-status-state { justify-self: start; min-height: 24px; border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.app-shell .website-editor-publication { margin-top: 8px; font-size: 12px; color: var(--muted); }
.app-shell .website-editor-publication summary { padding: 10px 0; min-height: 44px; }
.app-shell .website-editor-publication[open] { max-height: 180px; overflow-y: auto; }
.app-shell .website-editor-publication a { display: inline-block; color: var(--navigation-blue); padding-block: 6px; text-underline-offset: 3px; }
.app-shell .website-editor-add-row { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.app-shell .website-editor-add-row > summary { cursor: pointer; min-height: 44px; padding: 12px 8px; color: var(--navigation-blue); font-size: 14px; font-weight: 650; }
.app-shell .website-editor-outline .website-page-row-add { margin: 0; padding: 8px; border: 0; }
.app-shell .website-editor-content > .website-row-card { border-color: var(--line); border-radius: 12px; }
.app-shell .website-editor-content > .website-row-card > summary { padding: 20px 22px; color: var(--text); font-size: 17px; }
.app-shell .website-editor-workspace .website-cms-fieldset { padding: 20px; }
.app-shell .website-page-row-controls { border-radius: 8px; padding: 12px; background: var(--surface-2); gap: 8px 12px; font-size: 13px; }
.app-shell .website-page-row-controls .website-page-row-state { color: var(--muted); }
.app-shell .website-page-row-controls :is(select, button) { font-size: 13px; min-height: 44px; }
.app-shell .website-editor-workspace .website-row-steps { margin-bottom: 20px; }
.app-shell .website-editor-workspace .website-row-steps button { min-height: 44px; font-size: 14px; }
.app-shell .website-editor-outline :is(button, select, summary, a):focus-visible { outline: 3px solid var(--focus-ring-color); outline-offset: 2px; }
.app-shell .website-editor-empty { border-radius: 12px; background: var(--surface); }

@media (max-width: 900px) {
  .app-shell .admin-workspace { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .app-shell .admin-mobile-navigation { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 20px; }
  .app-shell .admin-mobile-navigation label { font-size: 13px; color: var(--muted); }
  .app-shell .website-editor-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .app-shell .website-editor-outline { position: static; display: block; max-height: none; overflow: visible; }
  .app-shell .website-editor-workspace .website-editor-outline > .website-editor-sidebar-head,
  .app-shell .website-editor-workspace .website-editor-outline > .website-editor-sidebar-footer { display: block; }
  .app-shell .website-editor-sidebar-head { padding: 14px; border: 0; }
  .app-shell .website-editor-workspace.is-outline-open .website-editor-sidebar-body { display: block; max-height: 50dvh; }
  .app-shell .website-editor-workspace:not(.is-outline-open) .website-editor-sidebar-body { display: none; }
  .app-shell .website-editor-outline .website-editor-view-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell .website-editor-sidebar-footer { padding: 12px 14px; }
  .app-shell .website-editor-workspace .website-cms-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-shell .website-editor-workspace .website-cms-actions > [data-website-publish] { grid-column: auto; }
  .app-shell .website-editor-sidebar-footer .website-cms-status { display: flex; flex-wrap: wrap; gap: 8px 12px; }
  .app-shell .website-editor-content > .website-row-card > summary { padding: 16px; }
}
@media (max-width: 600px) {
  .app-shell .admin-page-content .section-body { padding: 16px; }
  .app-shell .admin-overview-card { min-height: 130px; padding: 20px; }
  .app-shell .admin-page-header { padding-top: 0; }
  .app-shell .website-editor-workspace .website-cms-fieldset { padding: 12px; }
  .app-shell .website-editor-workspace .website-row-steps button { flex: 1 1 70px; padding: 10px 6px; font-size: 13px; }
}
@media (max-height: 640px) and (min-width: 901px) {
  /* At high browser zoom / short landscape windows, use document scrolling:
     navigation and actions must never be clipped by a constrained sidebar. */
  .app-shell .website-editor-outline { position: static; max-height: none; overflow: visible; }
  .website-editor-sidebar-body { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell .nav-target-highlight { animation: none; }
}
@media print {
  .member-bottom-nav { display: none; }
  .app-shell { background: white; }
}
