/* Mitarbeiterportal (static/employee.html) — UI-Modernisierung Phase 2.
 *
 * Rules (docs/ui-modernization/design-system.md §6): rem only (px only for hairlines ≤ 2px), colours only
 * from --color-* tokens (light/dark/high contrast follow automatically), every control ≥ 2.75rem (44px),
 * status never by colour alone (glyph + text), motion only through --motion-* tokens.
 *
 * Breakpoints are container queries on the root container "page" (html), so the layout reflows with the
 * text size: 53.75rem = the phone layout (tab bar + "Mehr" sheet) below 860px *or* when large text makes
 * the page that narrow (1280px at 200 % = 640 rem-px).  employee.js uses
 * FinanceDisplayPreferences.layoutQuery(860) for the same switch.
 *
 * Layers: element defaults in "reset"; everything else in "overrides" because these rules deliberately
 * replace the generic employee-shell mappings of design-system.css (layer "ds", px media queries).
 */
@layer reset, legacy, features, ds, overrides;

@layer reset {
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--color-canvas); color: var(--color-text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button svg { width: var(--icon); height: var(--icon); flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
p { overflow-wrap: anywhere; }
}

@layer overrides {
/* =================================================================== utilities */
.ep-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.employee-view { display: none; }
.employee-view.is-visible { display: block; }
.employee-workspace-page { display: none; }
.employee-workspace-page.is-visible { display: block; }

/* =================================================================== shell (desktop) */
.employee-shell {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); align-items: start;
  width: 100%; min-height: 100vh; background: var(--color-canvas);
}
.employee-sheet-head, .employee-tabbar, .employee-topbar-avatar, .employee-sheet-backdrop { display: none; }

.employee-sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; gap: var(--space-2);
  min-width: 0; height: 100vh; overflow-y: auto; padding: var(--space-4) var(--space-3) var(--space-5);
  border-right: 1px solid var(--color-border); background: var(--color-sidebar-bg); color: var(--color-text);
}
.employee-sidebar > * { flex-shrink: 0; }
.employee-brand {
  display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-border);
}
.employee-brand strong, .employee-brand span { display: block; }
.employee-brand strong { color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.employee-brand span { color: var(--color-text-muted); font-size: var(--text-xs); }

.employee-nav { display: grid; gap: var(--space-1); padding: 0; }
.employee-nav-section { display: grid; gap: 2px; min-width: 0; }
.employee-nav-group {
  margin: var(--space-3) var(--space-3) var(--space-1); color: var(--color-text-muted);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.02em;
}
.employee-nav-item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--target-min);
  padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius); background: transparent;
  color: var(--color-text-secondary); font-size: var(--text-base); text-align: left; white-space: normal;
}
.employee-nav-item:hover:not(.is-active) { background: var(--color-surface-hover); color: var(--color-text); }
/* Current area: tinted surface + bold text + indicator bar on the leading edge (never colour alone). */
.employee-nav-item.is-active {
  background: var(--color-selected-bg); color: var(--color-selected-text); font-weight: var(--weight-bold);
  box-shadow: inset var(--indicator-w) 0 0 var(--color-selected-indicator);
}
.employee-nav-item.is-active svg { color: var(--color-selected-indicator); }
.employee-nav-item > span:not(.ep-count) { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.ep-count {
  display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 1.5rem; height: 1.5rem; padding: 0 0.375rem;
  border-radius: var(--radius-full); background: var(--color-accent); color: var(--color-on-accent);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1; font-variant-numeric: tabular-nums;
}

/* Account block above the navigation (first block of the "Mehr" sheet on phones). */
.employee-account {
  display: grid; gap: var(--space-2); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border);
}
.employee-account > .employee-nav-group { margin-top: 0; }
.employee-card { display: grid; gap: var(--space-2); margin: 0; padding: 0 var(--space-2); border: 0; background: none; color: var(--color-text); }
.employee-card-person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.employee-card-person > div { min-width: 0; }
.employee-card-person strong, .employee-card-person small { display: block; overflow-wrap: anywhere; }
.employee-card-person strong { color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.employee-card-person small { color: var(--color-text-muted); font-size: var(--text-sm); }
.profile-avatar { place-items: center; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-text); font-weight: var(--weight-semibold); }
.profile-avatar.employee-card-avatar { display: grid; width: 2.5rem; height: 2.5rem; flex: 0 0 auto; font-size: var(--text-sm); }
.employee-user-switch { display: grid; gap: var(--space-1); margin: 0; }
.employee-user-switch > span { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.employee-user-switch select { width: 100%; min-height: var(--target-min); font-size: var(--text-sm); }
.employee-account-actions { display: grid; gap: 2px; }
.employee-account-actions .finance-language-slot { display: block; margin: 0; padding: 0 var(--space-2); }
.employee-account-actions .finance-language-switcher { width: 100%; margin: 0; }
.employee-account-actions .finance-language-switcher select { flex: 1 1 auto; min-height: var(--target-min); }
.employee-account-item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--target-min);
  padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius); background: transparent;
  color: var(--color-text-secondary); font-size: var(--text-base); text-align: left;
}
.employee-account-item:hover { background: var(--color-surface-hover); color: var(--color-text); }
.employee-account-item svg { color: var(--color-text-muted); }
.employee-sidebar-foot { display: grid; gap: var(--space-2); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.employee-sidebar .legal-links { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); padding: 0 var(--space-3); opacity: 1; font-size: var(--text-sm); }
.employee-sidebar .legal-links a { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--color-text-muted); }
.employee-about { margin: 0 var(--space-3); }

/* ------------------------------------------------------------------- workspace + top bar */
.employee-workspace { min-width: 0; padding: 0 var(--page-pad-x) var(--space-7); }
.employee-workspace:focus { outline: none; }
.employee-topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  min-height: var(--topbar-h); margin: 0 calc(-1 * var(--page-pad-x)) var(--space-5); padding: var(--space-3) var(--page-pad-x);
  border-bottom: 1px solid var(--color-border); background: var(--color-topbar-bg); backdrop-filter: none;
}
.employee-topbar > .navigation-history { order: 0; display: flex; gap: var(--space-1); }
.employee-topbar-title { flex: 1 1 16rem; min-width: 0; order: 1; }
.employee-topbar-title h1, #employee-page-title {
  margin: 0; color: var(--color-text); font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); overflow-wrap: anywhere;
}
#employee-page-subtitle { display: block; max-width: var(--measure); margin: var(--space-1) 0 0; color: var(--color-text-muted); font-size: var(--text-base); line-height: var(--leading-snug); }
.employee-actions { display: flex; flex: 0 0 auto; align-items: center; gap: var(--space-2); order: 2; }
.employee-bell { position: relative; }
.employee-bell .ep-count { position: absolute; top: -0.375rem; right: -0.375rem; }

/* =================================================================== building blocks */
.ep-eyebrow { display: block; color: var(--color-text-muted); font-size: var(--text-base); font-weight: var(--weight-medium); }
.ep-muted { margin: 0; color: var(--color-text-muted); font-size: var(--text-base); line-height: var(--leading-body); }
.ep-big {
  display: block; color: var(--color-text); font-size: var(--text-2xl); font-weight: var(--weight-semibold);
  line-height: var(--leading-tight); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.ep-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-5); }
.ep-section { display: grid; gap: var(--space-3); min-width: 0; margin: 0 0 var(--space-6); }
.ep-section[hidden] { display: none; }
.ep-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.ep-section-title {
  display: flex; align-items: center; gap: var(--space-2); margin: 0;
  color: var(--color-text); font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-snug);
}
.ep-section-title svg { width: var(--icon); height: var(--icon); color: var(--color-text-muted); }
.ep-note, .ep-hint {
  display: flex; align-items: flex-start; gap: var(--space-3); margin: 0; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-info-border); border-radius: var(--radius-md); background: var(--color-info-bg);
  color: var(--color-text); font-size: var(--text-base); line-height: var(--leading-snug);
}
.ep-note { margin-bottom: var(--space-5); }
.ep-hint { border-color: var(--color-warning-border); background: var(--color-warning-bg); font-size: var(--text-sm); }
.ep-note svg, .ep-hint svg { flex: 0 0 auto; width: var(--icon); height: var(--icon); margin-top: 0.125rem; }
.ep-note svg { color: var(--color-info-text); }
.ep-hint svg { color: var(--color-warning-text); }

/* Cards: surface, hairline border, one soft shadow (none in high contrast). */
.ep-card, .ep-hero-card, .ep-list, .ep-data-card {
  border: var(--border-w) solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.ep-card { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-5); }
.ep-card--wide { grid-column: 1 / -1; }
.ep-card[hidden] { display: none; }
.ep-card-head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.ep-card-head h3 { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--color-text); font-size: var(--text-md); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.ep-card-icon {
  display: grid; place-items: center; flex: 0 0 auto; width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-md); background: var(--color-accent-soft); color: var(--color-accent-text);
}
.ep-card-icon svg { width: var(--icon); height: var(--icon); }
/* "Alle …" link at the foot of a card: a full-width row with a large target. */
.ep-card-link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%;
  min-height: var(--target-min); margin: auto 0 0; padding: var(--space-2) var(--space-1) 0;
  border: 0; border-top: 1px solid var(--color-border-subtle); border-radius: 0; background: transparent; box-shadow: none;
  color: var(--color-accent-text); font-size: var(--text-base); font-weight: var(--weight-semibold); text-align: left; cursor: pointer;
}
.ep-card-link:hover { color: var(--color-accent-hover); text-decoration: underline; text-underline-offset: 0.18em; }
.ep-card-link svg { width: var(--icon); height: var(--icon); }
.ep-card-body { display: flex; flex-direction: column; gap: var(--space-3); flex: 1 1 auto; min-width: 0; }
.ep-card-text { margin: 0; color: var(--color-text-secondary); font-size: var(--text-base); line-height: var(--leading-body); }
.ep-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; }
.ep-stat small, .ep-time-status small { display: block; margin-top: var(--space-1); color: var(--color-text-muted); font-size: var(--text-base); line-height: var(--leading-snug); }
.ep-meter {
  display: block; width: 100%; height: 0.75rem; margin: 0; overflow: hidden; appearance: none;
  border: 1px solid var(--color-border-control); border-radius: var(--radius-full); background: var(--color-surface-sunken); color: var(--color-accent);
}
.ep-meter::-webkit-progress-bar { border-radius: var(--radius-full); background: var(--color-surface-sunken); }
.ep-meter::-webkit-progress-value { border-radius: var(--radius-full); background: var(--color-accent); }
.ep-meter::-moz-progress-bar { border-radius: var(--radius-full); background: var(--color-accent); }
/* The status dot sits on the first line of the headline (it hung at the baseline / between two lines). */
.ep-time-status { display: grid; gap: var(--space-1); min-width: 0; }
.ep-time-status > :is(.ep-state-label, small) { margin-inline-start: calc(0.75rem + var(--space-3)); }
.ep-time-headline { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; font-size: var(--text-2xl); line-height: var(--leading-tight); }
.ep-card--hero .ep-time-headline { font-size: calc(var(--text-2xl) * 1.25); }
.ep-time-headline > .ep-big { min-width: 0; font-size: inherit; line-height: inherit; }
.ep-time-headline > .ep-live-dot { margin-top: calc((1lh - 0.75rem) / 2); }
.ep-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ep-live-dot { flex: 0 0 auto; width: 0.75rem; height: 0.75rem; border: 2px solid var(--color-border-control); border-radius: 50%; background: var(--color-surface); }
.is-running .ep-live-dot { border-color: var(--color-success-fill); background: var(--color-success-fill); box-shadow: 0 0 0 0.25rem var(--color-success-bg); }
.ep-state-label { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.is-running .ep-state-label { color: var(--color-success-text); }

/* =================================================================== start page */
.ep-hello { display: grid; gap: var(--space-1); margin: 0 0 var(--space-5); }
.ep-today { margin: 0; color: var(--color-text-secondary); font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.ep-hello h2 { margin: 0; color: var(--color-text); font-size: var(--text-2xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ep-tenant { margin: 0; color: var(--color-text-muted); font-size: var(--text-base); }
/* Six tiles: up to three per row (3 + 3, never 5 + 1), all six in one row on very wide screens. The hero card
   and the heading span every track, so auto-fit could not collapse empty tracks here. */
.ep-cockpit { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(18rem, (100% - 2 * var(--space-4)) / 3)), 1fr)); gap: var(--space-4); align-items: stretch; }
@container page (min-width: 134rem) { .ep-cockpit { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ep-cockpit-title { grid-column: 1 / -1; margin-top: var(--space-3); }
.ep-card--hero { grid-column: 1 / -1; border-color: var(--color-accent-border); }
.ep-card--hero .ep-card-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-4) var(--space-6); }
.ep-card--hero .ep-big { font-size: calc(var(--text-2xl) * 1.25); }
.ep-card--hero .ep-card-actions { margin: 0; justify-content: flex-end; }
.ep-card--hero.is-running { border-color: var(--color-success-border); }
.ep-tile .ep-card-body { gap: var(--space-2); }
.ep-tile-note { margin: 0; color: var(--color-text-secondary); font-size: var(--text-base); line-height: var(--leading-snug); overflow-wrap: anywhere; }

/* Hero cards of the views (Resturlaub, Stempeluhr) */
.ep-hero-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin: 0 0 var(--space-5); padding: var(--space-5); }
.ep-hero-card > div:first-child { flex: 1 1 15rem; min-width: 0; }
.ep-hero-value {
  display: block; margin-top: var(--space-1); color: var(--color-text); font-size: var(--text-2xl); font-weight: var(--weight-semibold);
  line-height: var(--leading-tight); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.ep-hero-card small { display: block; margin-top: var(--space-1); color: var(--color-text-muted); font-size: var(--text-base); line-height: var(--leading-snug); }
.ep-hero-card small:empty { display: none; }
.ep-clock-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ep-clock.is-running { border-color: var(--color-success-border); }
.ep-clock .ep-eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); }
.ep-clock .ep-eyebrow::before { content: ""; width: 0.625rem; height: 0.625rem; border: 2px solid var(--color-border-control); border-radius: 50%; }
.ep-clock.is-running .ep-eyebrow::before { border-color: var(--color-success-fill); background: var(--color-success-fill); }

/* =================================================================== list rows */
.ep-list { display: grid; min-width: 0; overflow: hidden; }
.ep-list--compact { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.ep-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  width: 100%; min-width: 0; min-height: 3.5rem; margin: 0; padding: var(--space-3) var(--space-4);
  border: 0; border-bottom: 1px solid var(--color-border-subtle); border-radius: 0;
  background: transparent; box-shadow: none; color: var(--color-text); font: inherit; text-align: left;
}
.ep-row:last-child { border-bottom: 0; }
/* Wide lists: rows two per line once the list is 72rem wide, so status badges stay near their titles.
   Bottom lines are pulled under the list edge (overflow hidden), so the last line ends cleanly. */
.ep-list:has(> .ep-row + .ep-row) { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(36rem, (100% - var(--space-5)) / 2)), 1fr)); column-gap: var(--space-5); }
.ep-list:has(> .ep-row + .ep-row) > .ep-row { margin-bottom: -1px; border-bottom: 1px solid var(--color-border-subtle); }
.ep-list > :not(.ep-row) { grid-column: 1 / -1; }
button.ep-row { flex-wrap: nowrap; cursor: pointer; }
button.ep-row .ep-row-side { flex: 0 1 auto; }
button.ep-row:hover { background: var(--color-surface-hover); }
.ep-list--compact .ep-row { padding: var(--space-3) var(--space-1); }
.ep-row-icon {
  display: grid; place-items: center; flex: 0 0 auto; width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-md); background: var(--color-surface-sunken); color: var(--color-text-muted);
}
.ep-row-icon svg { width: var(--icon); height: var(--icon); }
.ep-row-main { display: flex; flex: 1 1 12rem; flex-direction: column; gap: 0.125rem; min-width: 0; }
.ep-row-title { color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-semibold); line-height: var(--leading-snug); overflow-wrap: anywhere; }
.ep-row-meta { color: var(--color-text-muted); font-size: var(--text-sm); line-height: var(--leading-snug); overflow-wrap: anywhere; }
.ep-row-note { color: var(--color-text-secondary); font-size: var(--text-sm); line-height: var(--leading-snug); overflow-wrap: anywhere; }
.ep-row-side { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); min-width: 0; margin-left: auto; }
.ep-row-chevron { flex: 0 0 auto; width: var(--icon); height: var(--icon); color: var(--color-text-muted); }
.ep-row.is-unread .ep-row-title::before { content: "●" / ""; margin-right: var(--space-2); color: var(--color-accent); font-size: 0.75em; vertical-align: 0.1em; }
.ep-row.is-done .ep-row-title { color: var(--color-text-muted); font-weight: var(--weight-medium); }
.ep-row.is-done .ep-row-icon { background: var(--color-success-bg); color: var(--color-success-text); }
.ep-lock { color: var(--color-text-muted); font-size: var(--text-sm); }
.ep-empty { padding: var(--space-5) var(--space-4); }
.ep-list--compact .ep-empty, .ep-card-body > .ep-empty { padding: 0; }
.ep-empty strong { display: block; color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.ep-empty p { margin: var(--space-1) 0 0; color: var(--color-text-muted); font-size: var(--text-base); line-height: var(--leading-body); }
.ep-two, #absence-view .employee-planning-grid, #time-view .employee-planning-grid { align-items: start; }
.ep-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--space-4); margin: 0 0 var(--space-6); }
.ep-kpis { margin: 0; }
.ep-more-actions .ds-menu { inset-inline-end: auto; inset-inline-start: 0; }

/* =================================================================== Meine Daten */
.ep-profile-head { display: flex; align-items: center; gap: var(--space-4); margin: 0 0 var(--space-4); }
.profile-avatar.ep-profile-avatar { display: grid; width: 3.5rem; height: 3.5rem; flex: 0 0 auto; font-size: var(--text-lg); }
.ep-profile-head > div { min-width: 0; }
.ep-profile-head strong { display: block; color: var(--color-text); font-size: var(--text-xl); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.ep-profile-head > div > span { display: block; color: var(--color-text-muted); font-size: var(--text-base); overflow-wrap: anywhere; }
.ep-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(26rem, (100% - 2 * var(--space-6)) / 3)), 1fr)); gap: var(--space-5) var(--space-6); align-items: start; }
.ep-data-group { display: grid; gap: var(--space-3); min-width: 0; }
.ep-field { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
.ep-field:last-child { border-bottom: 0; }
.ep-field.is-editing { background: var(--color-surface-subtle); }
.ep-field-main { display: flex; flex: 1 1 12rem; flex-direction: column; gap: 0.125rem; min-width: 0; }
.ep-field-label { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.ep-field-value { color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-medium); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ep-field-value.is-empty { color: var(--color-text-muted); font-weight: var(--weight-regular); }
.ep-field-pending { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.ep-field-pending small { color: var(--color-text-muted); font-size: var(--text-sm); }
.ep-edit { display: grid; flex: 1 1 100%; gap: var(--space-4); padding-top: var(--space-1); }
.ep-edit[hidden] { display: none; }
.ep-edit-title { margin: 0; color: var(--color-text); font-size: var(--text-md); font-weight: var(--weight-semibold); }
.ep-input { display: grid; gap: var(--space-1); min-width: 0; }
.ep-input > span { color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.ep-input:has([required]) > span::after { content: " *" / ""; color: var(--color-danger-text); }
.ep-input :is(input, select) { width: 100%; min-height: var(--control-h); }
.ep-input-row { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); align-items: start; gap: var(--space-3); }
/* Error next to the field: glyph + text, linked with aria-describedby. */
.ep-input-error, .employee-inline-error, .action-field-error {
  display: flex; align-items: flex-start; gap: var(--space-2); margin: 0;
  color: var(--color-danger-text); font-size: var(--text-base); font-weight: var(--weight-medium); line-height: var(--leading-snug);
}
.ep-input-error:not(:empty)::before, .employee-inline-error:not(:empty)::before, .action-field-error:not(:empty)::before {
  content: "!" / ""; display: inline-grid; place-items: center; flex: 0 0 auto; width: 1.25rem; height: 1.25rem; margin-top: 0.125rem;
  border-radius: 50%; background: var(--color-danger-fill); color: var(--color-on-danger-fill); font-size: var(--text-xs); font-weight: var(--weight-bold);
}
.ep-input-error:empty, .employee-inline-error:empty, .action-field-error:empty { display: none; }
.ep-input-hint { color: var(--color-text-muted); font-size: var(--text-sm); }
.ep-edit-info { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); line-height: var(--leading-snug); }
.ep-edit-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.ep-edit-actions button { min-height: var(--control-h); }
.ep-register { margin: 0; }
.ep-register > * { padding-block: var(--space-3); }
/* Wide screens: the register flows into two or three columns of label/value rows instead of one row
   spanning the whole screen. The rows' bottom lines are pulled under the card edge, so the last row of
   every column ends without a double line. */
.ep-register { grid-template-columns: repeat(auto-fill, minmax(min(100%, 36rem), 1fr)); overflow: hidden; }
.ep-register > * { margin-bottom: -1px; }

/* =================================================================== panels, KPIs, calendar */
.panel { min-width: 0; }
.panel-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.employee-planning-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.employee-balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--space-3); }
/* Six balance cards: two rows of three rather than five plus one. */
.employee-balance-grid:has(> :nth-child(6):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(11rem, (100% - 2 * var(--space-3)) / 3)), 1fr)); }
.employee-info-card { display: grid; gap: var(--space-1); min-width: 0; }
.employee-info-card > span { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.employee-info-card strong { color: var(--color-text); font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.employee-info-card small { color: var(--color-text-muted); font-size: var(--text-sm); line-height: var(--leading-snug); }

.employee-calendar { margin-top: var(--space-3); }
.employee-calendar-weekdays, .employee-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-1); }
.employee-calendar-weekdays { margin-bottom: var(--space-1); color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-semibold); text-align: center; }
.employee-calendar-day {
  display: grid; align-content: start; gap: 0.125rem; min-width: 0; min-height: 4.25rem; padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); text-align: left;
}
.employee-calendar-day:not(.is-empty) { cursor: pointer; }
.employee-calendar-day.is-empty { border-style: dashed; background: transparent; }
.employee-calendar-day > span { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.employee-calendar-day small {
  overflow: hidden; padding: 0.0625rem 0.25rem; border-radius: var(--radius-sm); background: var(--color-surface);
  color: var(--color-text-secondary); font-size: var(--text-xs); line-height: var(--leading-snug); text-overflow: ellipsis; white-space: nowrap;
}
/* Status glyph in front of the label: never colour alone. */
.employee-calendar-day small.paid::before { content: "✓ " / ""; }
.employee-calendar-day small:is(.review, .planned)::before { content: "! " / ""; }
.employee-calendar-day small.danger::before { content: "✕ " / ""; }
.employee-calendar-day.is-nonworking:not(.has-requested):not(.has-approved):not(.is-selected) { background: var(--color-surface-sunken); color: var(--color-text-muted); }
.employee-calendar-day.has-items { border-color: var(--color-accent-border); background: var(--color-accent-soft); }
.employee-calendar-day.has-requested { border-color: var(--color-warning-border); background: var(--color-warning-bg); }
.employee-calendar-day.has-approved { border-color: var(--color-success-border); background: var(--color-success-bg); }
.employee-calendar-day.is-selected { border-color: var(--color-accent); background: var(--color-selected-bg); color: var(--color-selected-text); }
.employee-calendar-day.is-edge { box-shadow: inset 0 0 0 2px var(--color-selected-indicator); }
.employee-calendar-day.is-today > span { text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 0.1875rem; text-underline-offset: 0.1875rem; }
.employee-calendar-controls, .employee-calendar-legend, .employee-absence-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.employee-calendar-controls strong { min-width: 8rem; color: var(--color-text); font-size: var(--text-base); text-align: center; }
.employee-calendar-hint, .employee-balance-note { color: var(--color-text-muted); font-size: var(--text-sm); line-height: var(--leading-body); }
.employee-balance-note, .employee-calendar-legend { margin-top: var(--space-3); }
.employee-calendar-legend span { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.legend-dot {
  display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border: 1px solid var(--color-border-control);
  border-radius: var(--radius-sm); font-size: var(--text-xs); font-style: normal; font-weight: var(--weight-bold); line-height: 1;
}
.legend-dot.requested { border-color: var(--color-warning-border); background: var(--color-warning-bg); color: var(--color-warning-text); }
.legend-dot.requested::before { content: "!"; }
.legend-dot.approved { border-color: var(--color-success-border); background: var(--color-success-bg); color: var(--color-success-text); }
.legend-dot.approved::before { content: "✓"; }
.legend-dot.nonworking { background: var(--color-surface-sunken); color: var(--color-text-muted); }
.legend-dot.nonworking::before { content: "–"; }
.employee-absence-filter > span { color: var(--color-text-secondary); font-weight: var(--weight-medium); }
.employee-absence-filter select { min-height: var(--control-h); max-width: 100%; }
.employee-absence-link { min-height: var(--target-min); padding: 0; border: 0; background: transparent; color: var(--color-accent-text); font-weight: var(--weight-semibold); text-decoration: underline; text-underline-offset: 0.18em; }

.employee-card-list, .time-week-strip { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.time-week-strip { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr)); }
.employee-card-list article, .time-week-strip article {
  display: grid; gap: var(--space-1); min-width: 0; padding: var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface);
}
.time-week-strip span, .time-week-strip small { color: var(--color-text-muted); font-size: var(--text-sm); }
.time-week-strip strong { color: var(--color-text); font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.time-week-strip article.review { border-color: var(--color-warning-border); }
.time-week-strip article.paid { border-color: var(--color-success-border); }
.employee-card-list .employee-absence-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); width: 100%;
  min-height: var(--target-min); padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface); color: var(--color-text); text-align: left;
}
.employee-card-list .employee-absence-card span { display: block; margin-top: var(--space-1); color: var(--color-text-muted); font-size: var(--text-sm); }
.approval-rail { display: grid; gap: var(--space-2); }
.approval-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface);
}
.approval-item > div { display: grid; gap: 0.125rem; min-width: 0; }
.approval-item span { color: var(--color-text-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.empty-state { padding: var(--space-4); border: 1px dashed var(--color-border-control); border-radius: var(--radius); color: var(--color-text-muted); }

/* Urlaubskonto */
.employee-vacation-year { display: grid; gap: var(--space-1); min-width: 7rem; color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.employee-vacation-year select { min-width: 0; min-height: var(--control-h); }
#employee-absence-balance, #employee-time-summary { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); }
.employee-vacation-calculation { display: grid; gap: var(--space-2); margin: var(--space-5) 0; }
.employee-vacation-calculation > div, .vacation-year-preview dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-1) var(--space-3); }
.employee-vacation-calculation dt, .vacation-year-preview dt { min-width: 0; color: var(--color-text-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.employee-vacation-calculation dd, .vacation-year-preview dd { margin: 0 0 0 auto; color: var(--color-text); font-weight: var(--weight-semibold); text-align: right; font-variant-numeric: tabular-nums; }
#employee-vacation-migration { padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface-subtle); }
#employee-vacation-account-status:empty { display: none; }
.employee-vacation-history { margin: var(--space-4) 0; }
.employee-vacation-history summary { display: flex; align-items: center; min-height: var(--target-min); cursor: pointer; font-weight: var(--weight-semibold); }
.employee-vacation-history ol { display: grid; gap: var(--space-4); padding-left: var(--space-5); overflow-wrap: anywhere; }
.employee-vacation-history li > strong, .employee-vacation-history li > small { display: block; }
.employee-vacation-history small { margin-top: var(--space-1); color: var(--color-text-muted); }
.employee-vacation-history p { margin: var(--space-2) 0 0; font-size: var(--text-sm); line-height: var(--leading-body); }

/* =================================================================== pages: details, forms, planner */
.employee-workspace-page .action-modal, .employee-workspace-page .employee-detail-modal { width: 100%; max-height: none; overflow: visible; }
.employee-workspace-page .action-modal { max-width: 56rem; }
.action-modal, .employee-detail-modal {
  display: grid; gap: var(--space-5); width: min(60rem, 100%); padding: var(--space-5);
  border: var(--border-w) solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface);
}
.action-modal-header, .action-modal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.action-modal-header > div { flex: 1 1 14rem; min-width: 0; }
.action-modal-header span { display: block; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.action-modal-header strong, .action-modal-header h2 { display: block; margin: var(--space-1) 0 0; color: var(--color-text); font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); overflow-wrap: anywhere; }
.action-modal-header .ds-btn { flex: 0 0 auto; }
.action-modal-actions { justify-content: flex-end; padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
.action-modal-actions > :is(.secondary-button, .ds-btn--secondary):first-child { margin-right: auto; }
.action-description { margin: 0; color: var(--color-text-secondary); font-size: var(--text-base); line-height: var(--leading-body); }
.action-fields { display: grid; gap: var(--space-4); }
.action-field { display: grid; gap: var(--space-1); min-width: 0; }
.action-field > span { color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.action-field:has([required]) > span:first-child::after { content: " *" / ""; color: var(--color-danger-text); }
.action-field :is(input, select, textarea) { width: 100%; min-height: var(--control-h); }
.action-field input[readonly] { background: var(--color-surface-sunken); }
.action-field textarea { resize: vertical; }
.action-required-note { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.checkbox-row { display: flex; align-items: center; gap: var(--space-3); min-height: var(--target-min); font-size: var(--text-base); }
.checkbox-row input { flex: 0 0 auto; }
[data-action-error]:not([hidden]), .whistleblowing-error:not([hidden]) {
  margin: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-danger-border); border-radius: var(--radius-md);
  background: var(--color-danger-bg); color: var(--color-danger-text); font-weight: var(--weight-medium);
}
.employee-detail-grid, .employee-detail-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: var(--space-3); }
.employee-detail-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.employee-detail-sections section { display: grid; align-content: start; gap: var(--space-2); min-width: 0; }
.employee-detail-sections h2 { font-size: var(--text-md); }
.profile-field { min-width: 0; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface-subtle); }
.profile-field span, .profile-field strong { display: block; }
.profile-field span { color: var(--color-text-muted); font-size: var(--text-sm); }
.profile-field strong { margin-top: var(--space-1); color: var(--color-text); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.profile-field p { margin: var(--space-1) 0 0; color: var(--color-text); }
.employee-mini-table { display: grid; gap: var(--space-2); }
.employee-mini-row { display: grid; gap: var(--space-1); padding: var(--space-3); border: 1px solid var(--color-border-subtle); border-radius: var(--radius); }
.employee-mini-row small { display: block; color: var(--color-text-muted); font-size: var(--text-xs); }
.employee-mini-row strong { display: block; font-weight: var(--weight-medium); overflow-wrap: anywhere; }

/* Confirmation (Urlaub stornieren): plain question, consequence, two clear answers. */
.employee-cancel-confirmation {
  display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-5);
  border: var(--border-w) solid var(--color-danger-border); border-inline-start-width: var(--indicator-w); border-radius: var(--radius-md);
  background: var(--color-danger-bg); color: var(--color-text);
}
.employee-cancel-confirmation[hidden] { display: none; }
.employee-cancel-confirmation > strong { font-size: var(--text-md); }
.employee-cancel-confirmation p { margin: 0; color: var(--color-text); }
.employee-cancel-confirmation .employee-detail-actions { margin-top: var(--space-2); }

.vacation-planner-toolbar, .vacation-planner-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.vacation-planner-toolbar [data-month-label] { flex: 1 1 8rem; min-width: 0; font-size: var(--text-md); text-align: center; }
.vacation-planner-calendar { display: grid; gap: var(--space-1); }
.vacation-planner-status {
  justify-content: flex-start; min-height: var(--target-min); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-subtle);
  color: var(--color-text-secondary); font-weight: var(--weight-medium);
}
.vacation-planner-status:empty { display: none; }
.vacation-planner-status.is-error { border-color: var(--color-danger-border); background: var(--color-danger-bg); color: var(--color-danger-text); }
.vacation-planner-status.is-error::before { content: "!" / ""; display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--color-danger-fill); color: var(--color-on-danger-fill); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.vacation-planner-status.is-ok { border-color: var(--color-success-border); background: var(--color-success-bg); color: var(--color-success-text); }
.vacation-planner-status.is-ok::before { content: "✓" / ""; font-weight: var(--weight-bold); }
.vacation-planner [data-submit]:disabled { cursor: not-allowed; }
.vacation-date-fields, .vacation-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: var(--space-3); }
.vacation-date-fields > *, .vacation-preview > * { min-width: 0; }
.vacation-preview { align-items: center; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-subtle); }
.vacation-preview > div span, .vacation-preview > div strong { display: block; }
.vacation-preview > div span { color: var(--color-text-muted); font-size: var(--text-sm); }
.vacation-preview > div strong { margin-top: var(--space-1); font-size: var(--text-xl); overflow-wrap: anywhere; }
.vacation-year-preview { display: grid; gap: var(--space-3); }
.vacation-year-preview > section { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-subtle); }
.vacation-year-preview > section.is-insufficient { border-color: var(--color-danger-border); }
.vacation-year-preview h3 { margin: 0 0 var(--space-3); font-size: var(--text-base); }
.vacation-year-preview dl { display: grid; gap: var(--space-2); margin: 0; }
#employee-vacation-account-retry[hidden], #employee-vacation-migration[hidden], [data-vacation-years-retry][hidden] { display: none; }

.toast { padding: var(--space-3) var(--space-4); font-size: var(--text-base); }
.toast-stack { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--z-toast); display: grid; gap: var(--space-2); width: min(26rem, calc(100vw - 2rem)); }

/* =================================================================== narrower desktop */
@container page (max-width: 68.75rem) {
  .ep-card--hero .ep-card-body { grid-template-columns: minmax(0, 1fr); }
  .ep-card--hero .ep-card-actions { justify-content: flex-start; }
}

/* =================================================================== phone: tab bar + "Mehr" sheet */
@container page (max-width: 53.75rem) {
  .employee-shell { display: block; min-height: 100vh; padding-bottom: calc(4.75rem + env(safe-area-inset-bottom)); }
  .employee-shell:has(.employee-workspace-page.is-visible) { padding-bottom: 0; }
  .employee-shell:has(.employee-workspace-page.is-visible) .employee-tabbar { display: none; }

  .employee-tabbar {
    position: fixed; right: 0; bottom: 0; left: 0; z-index: var(--z-topbar);
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-1);
    padding: var(--space-1) max(var(--space-2), env(safe-area-inset-right)) calc(var(--space-1) + env(safe-area-inset-bottom)) max(var(--space-2), env(safe-area-inset-left));
    border-top: var(--border-w) solid var(--color-border-control); background: var(--color-surface);
  }
  .employee-tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
    min-width: 0; min-height: 3.75rem; margin: 0; padding: var(--space-1) 0.125rem;
    border: 0; border-radius: var(--radius-md); background: transparent; box-shadow: none;
    color: var(--color-text-secondary); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: var(--leading-tight); cursor: pointer;
  }
  .employee-tab svg { width: var(--icon-lg); height: var(--icon-lg); color: currentColor; }
  .employee-tab span:not(.ep-count) { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
  .employee-tab.is-active { background: var(--color-selected-bg); color: var(--color-selected-text); font-weight: var(--weight-bold); box-shadow: inset 0 calc(-1 * var(--indicator-w)) 0 var(--color-selected-indicator); }
  .employee-tab.is-active svg { color: var(--color-selected-indicator); }
  .employee-tab .ep-count { position: absolute; top: 0.125rem; left: calc(50% + 0.375rem); }

  .employee-sheet-backdrop { position: fixed; inset: 0; z-index: calc(var(--z-dialog) - 1); display: block; background: var(--color-overlay); }
  .employee-sheet-backdrop[hidden] { display: none; }
  .employee-sidebar {
    position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: var(--z-dialog);
    width: auto; height: auto; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
    border: var(--border-w) solid var(--color-border); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--color-surface); box-shadow: var(--shadow-overlay);
    transform: translateY(105%); visibility: hidden;
    transition: transform var(--motion) var(--ease), visibility 0s linear var(--motion);
  }
  .employee-sidebar.is-open { transform: none; visibility: visible; transition: transform var(--motion) var(--ease); }
  .employee-sheet-head {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    margin: 0 calc(-1 * var(--space-4)) var(--space-1); padding: var(--space-5) var(--space-3) var(--space-2) var(--space-5);
    border-bottom: 1px solid var(--color-border-subtle); background: var(--color-surface);
  }
  .employee-sheet-head::before {
    content: ""; position: absolute; top: var(--space-2); left: 50%; width: 2.5rem; height: 0.25rem; margin-left: -1.25rem;
    border-radius: var(--radius-full); background: var(--color-border-control);
  }
  .employee-sheet-head strong { color: var(--color-text); font-size: var(--text-lg); font-weight: var(--weight-semibold); }
  .employee-brand { display: none; }
  /* The tab bar already offers Start, Zeit, Urlaub and Lohn: the sheet shows only the other areas. */
  .employee-nav-section[data-tabbar] { display: none; }
  /* One large row per area on a phone; two columns once the sheet is wide enough (tablet, large text on desktop). */
  .employee-nav-section { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: var(--space-2); }
  .employee-nav-section > .employee-nav-group { grid-column: 1 / -1; margin: var(--space-3) var(--space-1) 0; }
  .employee-nav-item {
    min-height: 3.5rem; padding: var(--space-2) var(--space-3);
    border: var(--border-w) solid var(--color-border); background: var(--color-surface-subtle); color: var(--color-text);
  }
  .employee-nav-item.is-active { border-color: var(--color-selected-indicator); background: var(--color-selected-bg); color: var(--color-selected-text); }
  .employee-account { padding-top: var(--space-2); }
  .employee-account-item { min-height: 3.5rem; border: var(--border-w) solid var(--color-border); background: var(--color-surface-subtle); color: var(--color-text); }
  .employee-sidebar-foot { margin-top: var(--space-4); }

  .employee-workspace { padding: 0 var(--space-4) var(--space-5); }
  .employee-topbar {
    flex-wrap: nowrap; gap: var(--space-2); min-height: 3.5rem;
    margin: 0 calc(-1 * var(--space-4)) var(--space-4); padding: calc(var(--space-2) + env(safe-area-inset-top)) var(--space-4) var(--space-2);
  }
  /* Phone: only the back arrow stays; forward lives in the browser gesture. */
  .employee-topbar .navigation-history { flex: 0 0 auto; gap: 0; }
  .employee-topbar .navigation-history [data-history-forward] { display: none; }
  .employee-topbar .navigation-history button span { display: none; }
  .employee-topbar-avatar {
    display: grid; flex: 0 0 auto; order: 0; width: var(--target-min); height: var(--target-min); min-height: var(--target-min); padding: 0;
    border: 0; font-size: var(--text-sm); cursor: pointer;
  }
  .employee-topbar-title { flex: 1 1 auto; }
  .employee-topbar-title h1, #employee-page-title { font-size: var(--text-lg); }
  #employee-page-subtitle { display: none; }

  .toast-stack { right: var(--space-3); bottom: calc(5.25rem + env(safe-area-inset-bottom)); width: calc(100vw - 1.5rem); }

  .ep-hello { margin-bottom: var(--space-4); }
  .ep-today { font-size: var(--text-md); }
  .ep-hello h2 { font-size: var(--text-xl); }
  .ep-cockpit { gap: var(--space-3); }
  .ep-card { padding: var(--space-4); gap: var(--space-3); }
  .ep-card--hero .ep-big, .ep-card--hero .ep-time-headline { font-size: var(--text-2xl); }
  .ep-card-actions > *, .ep-card--hero .ep-card-actions > * { flex: 1 1 100%; justify-content: center; }
  .ep-hero-card { padding: var(--space-4); margin-bottom: var(--space-4); }
  .ep-hero-card > button, .ep-clock-actions, .ep-clock-actions > * { flex: 1 1 100%; justify-content: center; }
  .ep-actions > *, .ep-actions > .ep-more-actions > summary { flex: 1 1 calc(50% - var(--space-3)); justify-content: center; }
  .ep-more-actions .ds-menu { inset-inline: 0; min-width: 0; }
  .ep-row { padding: var(--space-3); }
  .ep-edit-actions > * { flex: 1 1 auto; }
  .employee-absence-filter { width: 100%; }
  .employee-absence-filter select { flex: 1 1 auto; }
  .employee-calendar-controls { width: 100%; }
  .employee-calendar-controls strong { flex: 1 1 6rem; min-width: 0; }
  .employee-calendar-day { min-height: 3.25rem; padding: var(--space-1); }
  .employee-calendar-day small { padding: 0; background: transparent; }
  .action-modal, .employee-detail-modal { padding: var(--space-4); border: 0; border-radius: 0; }
  .action-modal-actions > button { flex: 1 1 8rem; }
  .vacation-planner .employee-calendar-grid { gap: 0.125rem; }
  .vacation-planner .employee-calendar-day { min-height: 3rem; padding: 0.25rem 0.125rem; }
}

@container page (max-width: 25rem) {
  .ep-input-row { grid-template-columns: minmax(0, 1fr); }
  .ep-row-icon { display: none; }
  .ep-actions > *, .ep-actions > .ep-more-actions > summary { flex-basis: 100%; }
}
}
