html:has(body.page-site) {
  height: 100%;
  overflow: hidden;
}
body.page-site {
  min-height: 100svh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
body.page-site .app-header {
  align-items: center;
  flex-wrap: wrap;
  row-gap: 10px;
}
body.page-site .app-header h1 { margin: 2px 0 0; white-space: nowrap; }
body.page-site .app-header h1 a { color: inherit; text-decoration: none; }
body.page-site .app-header h1 a:focus-visible { outline: 3px solid #8cb4e8; outline-offset: 3px; border-radius: 2px; }
.site-header-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: flex-end; }
.site-header-nav a { color: #dce8e6; text-underline-offset: 3px; }
.site-header-nav a:focus-visible { outline: 3px solid #8cb4e8; outline-offset: 3px; border-radius: 2px; }
.header-logout { border: 0; background: none; color: #dce8e6; text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }
.header-logout:focus-visible { outline: 3px solid #8cb4e8; outline-offset: 3px; }
.auth-card { max-width: 560px; margin-inline: auto; }
.auth-card h2 { margin-bottom: var(--space-2); }
.auth-card .home-lead { margin-bottom: var(--space-5); }
.auth-card .button { width: 100%; min-height: 48px; }
.auth-card .button.text { min-height: 48px; }
.auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"] {
  width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px;
  border: 1px solid #79747e; border-radius: 4px;
  color: var(--color-text); background: var(--color-surface);
}
.auth-card .session-form { display: grid; gap: var(--space-4); margin: 0; }
.auth-divider { margin-block: var(--space-4); color: var(--color-muted); text-align: center; }
.auth-code-actions { display: grid; gap: var(--space-2); }
.auth-email-summary { margin: 0; color: var(--color-muted); overflow-wrap: anywhere; }
.auth-status { margin-top: var(--space-3); overflow-wrap: anywhere; }
.auth-status:empty { margin: 0; }
.auth-status[data-tone="error"] { color: var(--color-error); }
.member-list { display: grid; gap: var(--space-4); }
.member-row { display: grid; gap: var(--space-3); background: var(--color-surface-soft); padding: var(--space-4); border-radius: var(--radius); min-width: 0; }
.member-row p, .member-row strong { overflow-wrap: anywhere; }
.member-row label { min-height: 40px; }
body.page-site.is-cloud .site-header-nav a,
body.page-site.is-cloud .header-logout { min-height: 40px; display: inline-flex; align-items: center; }
@media (min-width: 761px) and (max-width: 1040px) {
  body.page-site.is-cloud .app-header { height: 108px; display: grid; grid-template-rows: 48px 40px; gap: 0; padding-block: 8px; }
  body.page-site.is-cloud .site-header-nav { justify-content: flex-start; flex-wrap: nowrap; gap: 8px 12px; }
}

.site-main {
  width: min(920px, calc(100% - 32px));
  justify-self: center;
  min-block-size: 0;
  min-inline-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5) 0;
}
.home-card, .legal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 36px);
}
.home-kicker { margin: 0 0 8px; color: var(--color-primary); font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.home-lead, .legal-card p { color: var(--color-muted); }
.home-process { margin: 0 0 var(--space-4); padding-left: 1.2rem; }
.home-process li { margin: 4px 0; font-weight: 650; }
.home-process-note {
  margin: 0 0 var(--space-5);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #f3f7f6;
  color: var(--color-text);
}
.home-process-note strong { display: block; margin-bottom: 6px; }
.home-process-note ul { margin: 0; padding-left: 1.1rem; color: var(--color-muted); }
.home-process-note li { margin: 4px 0; }
.home-limit {
  margin: 0 0 var(--space-5);
  padding: 12px 14px;
  border-radius: 8px;
  background: #faecec;
  color: var(--color-error);
}
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.desk-stages {
  --desk-label-lines: 1;
  --desk-label-leading: 1.05rem;
  --desk-value-lines: 1;
  --desk-value-leading: 1.4rem;
  --desk-note-lines: 1;
  --desk-note-leading: 1.2rem;
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: stretch;
}
.desk-stages li {
  min-inline-size: 0;
  display: grid;
}
.desk-stages a {
  min-inline-size: 0;
  display: grid;
  grid-template-rows:
    calc(var(--desk-label-lines) * var(--desk-label-leading))
    calc(var(--desk-value-lines) * var(--desk-value-leading))
    calc(var(--desk-note-lines) * var(--desk-note-leading));
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: inherit;
  text-decoration: none;
}
.desk-stages a:hover { border-color: var(--color-primary); }
.desk-stages a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.desk-stages a.is-current { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); color: var(--color-primary); }
.desk-stage-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: var(--desk-label-leading);
  min-block-size: calc(var(--desk-label-lines) * var(--desk-label-leading));
}
.desk-stages b {
  font-size: 1.15rem;
  line-height: var(--desk-value-leading);
  min-block-size: calc(var(--desk-value-lines) * var(--desk-value-leading));
}
.desk-stage-note {
  color: var(--color-muted);
  font-size: .82rem;
  line-height: var(--desk-note-leading);
  min-block-size: calc(var(--desk-note-lines) * var(--desk-note-leading));
}
.desk-work {
  margin-top: var(--space-5);
  min-block-size: 1.35rem;
}
.desk-empty {
  margin: 0;
  color: var(--color-muted);
  font-size: .85rem;
  line-height: 1.35rem;
  min-block-size: 1.35rem;
}
.site-footer {
  --footer-lines: 1;
  --footer-leading: 1.25rem;
  width: min(920px, calc(100% - 32px));
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-block: var(--space-4);
  min-block-size: calc(var(--footer-lines) * var(--footer-leading) + 2 * var(--space-4));
  color: var(--color-muted);
  font-size: .85rem;
  line-height: var(--footer-leading);
}
.site-footer a { color: inherit; text-underline-offset: 3px; }
.site-footer a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.home-meta { margin: 18px 0 0; color: var(--color-muted); font-size: .85rem; }
.legal-card h2 { margin-bottom: 12px; }
.legal-card h3 { margin: 22px 0 8px; }
.legal-card a { color: var(--color-primary); }
.session-form .field { margin-bottom: 12px; }
.session-form .approval-box { margin: 10px 0; }
.session-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-subtle, #f6f9f9);
}
.session-summary div { min-width: 0; }
.session-summary dt {
  margin-bottom: 3px;
  color: var(--color-muted);
  font-size: .8rem;
}
.session-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}
.section-gap { margin-top: 1.25rem; }
.stammdaten-tabs { margin-top: var(--space-5); }
.stammdaten-tablist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--color-border);
}
.stammdaten-tab {
  min-width: 0;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 10px 8px;
  border-bottom: 3px solid transparent;
  color: var(--color-muted);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.stammdaten-tab:hover { color: var(--color-primary); background: var(--color-surface-soft); }
.stammdaten-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.stammdaten-tab[aria-selected="true"] {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
}
.stammdaten-block {
  margin-top: 0;
  padding-top: var(--space-5);
}
.stammdaten-block h3 { margin: 0 0 8px; }
.stammdaten-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  color: var(--color-muted);
}
.stammdaten-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 761px) and (min-height: 640px) {
  body.page-site .app-header { min-height: 0; height: 68px; padding: 8px clamp(24px, 4vw, 48px); }
}

@media (max-width: 760px) {
  body.page-site .app-header { align-items: flex-start; }
  .site-header-nav { justify-content: flex-start; }
  .home-actions .button { width: 100%; }
  .session-summary { grid-template-columns: 1fr; }
  .desk-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.page-legal .site-main { width: min(100% - 32px, 680px); }
  .site-footer { --footer-lines: 2; }
}

@media (max-width: 520px) {
  .stammdaten-tablist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
