:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --dark: #0f172a;
  --soft: #eef2ff;
  --success: #166534;
  --error: #b91c1c;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.container { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.eyebrow { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: #64748b; }
.brand-row { display: flex; align-items: center; gap: .75rem; }
.brand { font-size: 1.25rem; font-weight: 700; }
.version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: .82rem;
  font-weight: 700;
}
.version-pill.small { font-size: .76rem; }
.nav { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .95rem; color: #475569; }
.nav a:hover { color: #0f172a; }
.section { padding: 5rem 0; }
.section.alt { background: #ffffff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.grid-hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1.5rem;
  align-items: start;
}
.badge {
  display: inline-flex;
  padding: .5rem .9rem;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  font-size: .9rem;
}
h1 { font-size: clamp(2.3rem, 5vw, 4.4rem); line-height: 1.02; margin: 1rem 0 1rem; }
h2 { font-size: 2rem; margin: 0; }
h3 { margin-top: 0; }
.lead { font-size: 1.1rem; line-height: 1.8; color: var(--muted); max-width: 56rem; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .8rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  background: white;
}
.button.primary { background: var(--dark); color: white; border-color: var(--dark); }
.button.secondary { background: white; color: var(--text); }
.button.full { width: 100%; border-radius: 1rem; }
.panel, .card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.panel { padding: 1.5rem; }
.panel.dark { background: var(--dark); color: white; border-color: var(--dark); }
.panel.dark ul { padding-left: 1.2rem; color: #cbd5e1; line-height: 1.8; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card { padding: 1.4rem; }
.section-head { margin-bottom: 1.4rem; }
.section-head p { color: var(--muted); max-width: 52rem; }
.two-col { display: grid; grid-template-columns: .9fr 1.1fr; gap: 1.5rem; }
.form-stack { display: grid; gap: .8rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  padding: .9rem 1rem;
  font: inherit;
  background: white;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1rem 0; }
.stat {
  background: #f8fafc;
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
}
.stat span { display: block; color: var(--muted); font-size: .9rem; }
.stat strong { display: block; font-size: 1.4rem; margin-top: .3rem; }
.list-box {
  margin-top: .8rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 1rem;
  padding: 1rem;
}
.list-stack { display: grid; gap: .8rem; }
.message { min-height: 1.2rem; font-size: .92rem; }
.message.success { color: var(--success); }
.message.error { color: var(--error); }
.hidden { display: none !important; }
.plain-list { margin: .8rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.site-footer {
  background: var(--dark);
  color: #cbd5e1;
  border-top: 1px solid #1e293b;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0;
}
@media (max-width: 980px) {
  .grid-hero, .two-col, .cards-4, .cards-3 { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .stats { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}

.legal-text { margin-top: 1.5rem; line-height: 1.7; }
.admin-grid { margin-top: 1.5rem; }
.check-row { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .93rem; }
.check-row input { width: auto; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.button.small-action { min-height: auto; padding: .45rem .75rem; font-size: .85rem; }
textarea { min-height: 9rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: .9rem; }

.field-label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.field-label span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.field-label input,
.field-label select,
.field-label textarea {
  width: 100%;
  font-weight: 500;
  color: #0f172a;
}

.field-label textarea {
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.5;
}

.status-connected { color: var(--success); font-weight: 800; }
.status-error { color: var(--error); font-weight: 800; }
.status-neutral { color: var(--muted); font-weight: 700; }
.form-row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.log-link { text-decoration: underline; color: #1d4ed8; font-weight: 700; }


/* V0.9.2 Auth visibility hardening: static default is public-only. */
#dashboard,
#admin,
.auth-nav,
.admin-nav {
  display: none !important;
}

body.is-auth #dashboard {
  display: block !important;
}

body.is-workarea #admin {
  display: block !important;
}

body.is-auth #home,
body.is-auth #services,
body.is-auth #about,
body.is-auth #proof,
body.is-auth #process,
body.is-auth #prices,
body.is-auth #target,
body.is-auth #documents,
body.is-auth #platform,
body.is-auth #rechtliches,
body.is-auth #contact,
body.is-auth #login,
body.is-auth .public-nav,
body.is-auth .login-nav {
  display: none !important;
}

body.is-auth .auth-nav {
  display: inline-flex !important;
}

body.is-workarea .admin-nav {
  display: inline-flex !important;
}

body.public-mode #home,
body.public-mode #services,
body.public-mode #about,
body.public-mode #proof,
body.public-mode #process,
body.public-mode #prices,
body.public-mode #target,
body.public-mode #documents,
body.public-mode #platform,
body.public-mode #rechtliches,
body.public-mode #contact,
body.public-mode #login {
  display: block;
}

[data-role-visible].hidden { display: none !important; }
.role-anchor-group { display: inline-flex; gap: .45rem; flex-wrap: wrap; }

/* V0.9.2 landing page design */
.landing-hero { background: radial-gradient(circle at top left, #ecfdf5 0, #f8fafc 34%, #ffffff 100%); }
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin-top: 1.75rem; }
.trust-row div { border: 1px solid var(--border); background: rgba(255,255,255,.86); border-radius: 1.25rem; padding: 1rem; }
.trust-row strong { display: block; color: #0f172a; }
.trust-row span { display: block; color: var(--muted); margin-top: .25rem; font-size: .92rem; line-height: 1.45; }
.hero-card { border-top: 5px solid #059669; }
.feature-list li { margin-bottom: .55rem; }
.centered { text-align: center; margin-left: auto; margin-right: auto; }
.centered p { margin-left: auto; margin-right: auto; }
.section-kicker { display: inline-flex; color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 999px; padding: .4rem .75rem; font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .75rem; }
.service-card { position: relative; overflow: hidden; }
.service-card::after { content: ''; position: absolute; inset: auto -2rem -2rem auto; width: 7rem; height: 7rem; border-radius: 999px; background: #ecfdf5; z-index: 0; }
.service-card > * { position: relative; z-index: 1; }
.icon-badge { display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border-radius: 1rem; background: #0f172a; color: white; font-weight: 800; margin-bottom: 1rem; }
.lead.smaller { font-size: 1rem; }
.align-start { align-items: start; }
.evidence-panel { background: #0f172a; color: white; }
.evidence-panel h3 { color: white; }
.evidence-list { display: grid; gap: .85rem; margin-top: 1rem; }
.evidence-list div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 1rem; padding: 1rem; }
.evidence-list strong { display: block; color: #fff; }
.evidence-list span { display: block; color: #cbd5e1; margin-top: .35rem; line-height: 1.55; }
.process-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.process-step { background: white; border: 1px solid var(--border); border-radius: 1.25rem; padding: 1.2rem; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04); }
.process-step span { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 999px; background: #047857; color: white; font-weight: 800; margin-bottom: .8rem; }
.process-step p, .target-card p, .service-card p, .compact-cards p { color: var(--muted); line-height: 1.65; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.compact-cards .card { min-height: 150px; }
@media (max-width: 980px) {
  .trust-row, .process-grid, .cards-2 { grid-template-columns: 1fr; }
}


/* V0.9.2 landing text and pictogram refinements */
.pictogram { display: inline-flex; align-items: center; justify-content: center; width: 2.15rem; height: 2.15rem; margin-bottom: .55rem; border-radius: .9rem; background: #ecfdf5; font-size: 1.25rem; }
.mini-icon { display: inline-flex; width: 1.6rem; margin-right: .35rem; }
.pictogram-badge { background: #ecfdf5; color: #0f172a; font-size: 1.35rem; }
.followup-grid { margin-top: 1.5rem; }
.target-grid { grid-template-columns: repeat(3, 1fr); }
.target-card .target-icon, .compact-cards .target-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 1rem; background: #ecfdf5; font-size: 1.35rem; margin-bottom: .8rem; }
.process-step span { font-size: 1rem; }
@media (max-width: 980px) { .target-grid { grid-template-columns: 1fr; } }


/* V0.9.2 pricing and copy refinement */
.price-grid .price-card { display: flex; flex-direction: column; gap: 0.65rem; }
.price-value { font-size: 1.25rem; font-weight: 800; color: #0f172a; margin: 0.25rem 0; }
.note-panel { margin-top: 1.25rem; }
.note-panel p { margin: 0; display: flex; gap: 0.75rem; align-items: flex-start; }

/* V0.9.2 Corporate Design: seriöse Energie-/Ingenieurmarke */
:root {
  --brand-navy: #0b1f33;
  --brand-navy-2: #123b5d;
  --brand-blue: #1d6fa5;
  --brand-teal: #0f8f7f;
  --brand-green: #2f9e44;
  --brand-sand: #f5efe2;
  --brand-cream: #fbf7ef;
  --brand-ice: #eef7f6;
  --brand-line: #d5e3e1;
  --brand-gold: #c18a2a;
  --bg: #f5f8f7;
  --panel: #ffffff;
  --text: #0b1f33;
  --muted: #516372;
  --border: var(--brand-line);
  --dark: var(--brand-navy);
  --soft: #e8f3f1;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(15,143,127,.10) 0, transparent 32rem),
    linear-gradient(180deg, #f9fbfb 0%, #f3f7f6 45%, #f8faf9 100%);
}

.site-header {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(11,31,51,.12);
  box-shadow: 0 12px 30px rgba(11,31,51,.06);
}

.brand-row::before {
  content: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: .9rem;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-teal));
  color: #fff;
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 12px 24px rgba(15,143,127,.22);
}

.brand { color: var(--brand-navy); letter-spacing: -.02em; }
.eyebrow { color: #607482; font-weight: 700; }
.nav a { padding: .45rem .25rem; border-bottom: 2px solid transparent; transition: color .18s ease, border-color .18s ease; }
.nav a:hover { color: var(--brand-teal); border-color: var(--brand-teal); }
.version-pill {
  background: linear-gradient(135deg, #e8f3f1, #fff7e8);
  border-color: #c8ddd9;
  color: var(--brand-navy-2);
}

.landing-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(11,31,51,.96) 0%, rgba(18,59,93,.94) 46%, rgba(15,143,127,.88) 100%);
  color: white;
}
.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.18) 0, transparent 16rem),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: auto, 52px 52px, 52px 52px;
  pointer-events: none;
}
.landing-hero .container { position: relative; z-index: 1; }
.landing-hero h1 { color: #fff; max-width: 950px; }
.landing-hero .lead { color: #d9e8e5; }
.badge {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.28);
  color: #f7faf9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
.button.primary {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-green));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(15,143,127,.24);
}
.button.primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.button.secondary {
  background: rgba(255,255,255,.94);
  color: var(--brand-navy);
  border-color: rgba(11,31,51,.12);
}

.trust-row div {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.20);
  box-shadow: 0 16px 34px rgba(0,0,0,.12);
}
.trust-row strong { color: #fff; }
.trust-row span { color: #dce9e7; }
.hero-card {
  background: rgba(255,255,255,.96);
  color: var(--brand-navy);
  border: 1px solid rgba(255,255,255,.35);
  border-top: 6px solid var(--brand-gold);
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}
.hero-card p, .hero-card .plain-list { color: var(--muted); }

.section { position: relative; }
.section.alt {
  background: linear-gradient(180deg, var(--brand-cream), #ffffff);
  border-color: #eadfc9;
}
.section:not(.alt):not(.landing-hero) {
  background: linear-gradient(180deg, rgba(255,255,255,.70), rgba(245,248,247,.76));
}
.section-head h2, .section h2 { color: var(--brand-navy); letter-spacing: -.025em; }
.section-kicker {
  background: #e8f3f1;
  border-color: #b8d8d2;
  color: #0c6f66;
}

.card, .panel {
  border-color: rgba(11,31,51,.12);
  box-shadow: 0 18px 42px rgba(11,31,51,.07);
}
.card:hover, .process-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(11,31,51,.10);
}
.card, .process-step, .button { transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }

.service-card { border-top: 4px solid var(--brand-teal); }
.service-card:nth-child(2) { border-top-color: var(--brand-gold); }
.service-card:nth-child(3) { border-top-color: var(--brand-blue); }
.service-card:nth-child(4) { border-top-color: var(--brand-green); }
.service-card::after { background: linear-gradient(135deg, rgba(15,143,127,.10), rgba(193,138,42,.12)); }
.pictogram, .pictogram-badge, .target-card .target-icon, .compact-cards .target-icon {
  background: linear-gradient(135deg, #e8f3f1, #fff4dc);
  border: 1px solid #d7e4de;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.icon-badge { color: var(--brand-navy); }

.evidence-panel {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-2));
  box-shadow: 0 24px 56px rgba(11,31,51,.18);
}
.evidence-list div {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}

.process-grid { align-items: stretch; }
.process-step {
  border-color: #cfe0dd;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}
.process-step span {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-green));
  box-shadow: 0 10px 18px rgba(15,143,127,.20);
}

.price-card {
  border-top: 5px solid var(--brand-navy-2);
  background: linear-gradient(180deg, #ffffff 0%, #fbf7ef 100%);
}
.price-card:nth-child(1) { border-top-color: var(--brand-teal); }
.price-card:nth-child(2) { border-top-color: var(--brand-gold); }
.price-card:nth-child(3) { border-top-color: var(--brand-blue); }
.price-card:nth-child(4) { border-top-color: var(--brand-green); }
.price-value {
  color: var(--brand-navy);
  background: #e8f3f1;
  border: 1px solid #cfe0dd;
  border-radius: 1rem;
  padding: .7rem .85rem;
}
.note-panel {
  background: linear-gradient(135deg, #fff7e8, #ffffff);
  border-color: #ead8b8;
}

.target-card {
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
  border-top: 4px solid #b8d8d2;
}
.target-card:nth-child(1), .target-card:nth-child(4) { border-top-color: var(--brand-teal); }
.target-card:nth-child(2), .target-card:nth-child(5) { border-top-color: var(--brand-gold); }
.target-card:nth-child(3), .target-card:nth-child(6) { border-top-color: var(--brand-blue); }

#documents .card { border-left: 4px solid var(--brand-teal); }
#login .panel:first-child { border-top: 5px solid var(--brand-teal); }
#login .panel:last-child { background: linear-gradient(180deg, #ffffff, var(--brand-ice)); }

.site-footer {
  background: linear-gradient(135deg, var(--brand-navy), #061522);
  border-top: 4px solid var(--brand-teal);
}
.footer-inner strong { color: #fff; }

@media (max-width: 980px) {
  .landing-hero { padding-top: 2rem; }
  .nav { gap: .65rem; }
}

/* V0.9.2 About/Befaehigung section */
.about-section {
  background: linear-gradient(135deg, rgba(15, 76, 92, 0.06), rgba(237, 221, 194, 0.26));
}
.about-cards .card {
  border-left: 4px solid var(--brand-teal, #0f766e);
}


/* V0.9.9RC4 Logo Integration ohne Buchstaben */
.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.icea-logo {
  width: 9.8rem;
  height: auto;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 18px rgba(11,31,51,.10));
}

.brand-row {
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .brand-block {
    align-items: flex-start;
  }
  .icea-logo {
    width: 7.8rem;
  }
}

@media (max-width: 560px) {
  .brand-block {
    gap: .75rem;
  }
  .icea-logo {
    width: 6.5rem;
  }
  .brand {
    font-size: 1rem;
  }
}


/* V0.9.2 positions and service template UI */
.subpanel {
  border: 1px solid var(--border, #d5e3e1);
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff, rgba(238,247,246,.65));
  margin: .5rem 0;
}
.subpanel h4 {
  margin: 0 0 .35rem 0;
}
.inline-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .6rem;
}
.small-action {
  padding: .45rem .7rem;
  font-size: .82rem;
}

/* V0.9.2 Header-Navigation: Menüanker als dezente Pillen hervorheben */
.nav {
  gap: .55rem;
  align-items: center;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: .48rem .78rem;
  border: 1px solid rgba(11,31,51,.10);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(238,247,246,.94), rgba(255,247,232,.72));
  color: var(--brand-navy-2);
  font-weight: 700;
  box-shadow: 0 7px 18px rgba(11,31,51,.055);
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--brand-navy);
  border-color: rgba(15,143,127,.44);
  background: linear-gradient(135deg, rgba(232,243,241,1), rgba(245,239,226,.98));
  box-shadow: 0 10px 24px rgba(15,143,127,.14);
  transform: translateY(-1px);
  outline: none;
}

.nav a.auth-nav,
.nav a.admin-nav {
  background: linear-gradient(135deg, rgba(11,31,51,.94), rgba(18,59,93,.90));
  border-color: rgba(11,31,51,.28);
  color: #fff;
}

.nav a.auth-nav:hover,
.nav a.auth-nav:focus-visible,
.nav a.admin-nav:hover,
.nav a.admin-nav:focus-visible {
  background: linear-gradient(135deg, rgba(18,59,93,1), rgba(15,143,127,.92));
  border-color: rgba(15,143,127,.55);
  color: #fff;
}

.nav a.login-nav {
  background: linear-gradient(135deg, rgba(193,138,42,.16), rgba(251,247,239,.96));
  border-color: rgba(193,138,42,.28);
}

.admin-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-maintenance-grid { grid-template-columns: 1fr; }
}

/* V0.9.9RC11: Rollenbereiche als Tabs statt langer Aneinanderreihung */
.tabs.role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1.2rem 0 1rem;
  padding: .7rem;
  border: 1px solid rgba(11,31,51,.10);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(238,247,246,.92), rgba(255,247,232,.70));
  box-shadow: 0 12px 28px rgba(11,31,51,.06);
}
.tab-button {
  border: 1px solid rgba(11,31,51,.14);
  border-radius: 999px;
  background: #fff;
  padding: .62rem .95rem;
  font-weight: 800;
  color: var(--brand-navy-2);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.tab-button:hover,
.tab-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(15,143,127,.44);
  box-shadow: 0 8px 18px rgba(15,143,127,.14);
  outline: none;
}
.tab-button.active {
  background: linear-gradient(135deg, rgba(11,31,51,.96), rgba(15,143,127,.92));
  color: #fff;
  border-color: rgba(15,143,127,.55);
}
.tab-panel {
  margin-top: 1rem;
}
.tab-panel.hidden {
  display: none !important;
}


/* V0.9.9RC11: Kopfzeilen-Tabs und klarere Rollen-Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(11,31,51,.08);
}
.nav a.header-tab {
  background: rgba(238,247,246,.92);
  border-color: rgba(15,143,127,.22);
  color: var(--brand-navy-2);
  font-weight: 850;
}
.nav a.header-tab:hover,
.nav a.header-tab:focus-visible {
  background: rgba(255,247,232,.96);
  border-color: rgba(193,138,42,.38);
}
.nav a.header-tab.active {
  background: linear-gradient(135deg, rgba(11,31,51,.98), rgba(15,143,127,.92));
  color: #fff;
  border-color: rgba(15,143,127,.55);
  box-shadow: 0 10px 24px rgba(11,31,51,.18);
}
.dashboard-layout,
.workarea-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.dashboard-layout > .panel:first-child,
.workarea-layout > .section-head {
  margin-bottom: .25rem;
}
.tabs.role-tabs {
  position: sticky;
  top: 92px;
  z-index: 20;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,247,246,.94));
  border-color: rgba(15,143,127,.20);
  margin-top: .25rem;
}
.tab-button.active {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 10px 22px rgba(11,31,51,.16);
}
.tab-panel.active {
  display: block;
  animation: tabFadeIn .18s ease-out;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 980px) {
  .header-inner { align-items: flex-start; }
  .nav { width: 100%; justify-content: flex-start; }
  .tabs.role-tabs { top: 128px; }
}

/* V0.9.9RC11: Dashboard button in authenticated header and strict role tabs */
.dashboard-header-tab {
  font-weight: 800;
}
body.is-auth .dashboard-header-tab {
  background: rgba(37, 99, 235, 0.13);
  border-color: rgba(37, 99, 235, 0.28);
  color: #123a7a;
}
body.is-admin .dashboard-header-tab,
body.is-staff .dashboard-header-tab,
body.is-financial .dashboard-header-tab {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.15), rgba(14, 116, 144, 0.12));
}


/* V0.9.9RC11: Client-only dashboard panels/buttons must never bleed into Admin/Staff/Financial views. */
body.is-workarea [data-role-visible="client"][data-role-strict="true"],
body.is-admin [data-role-visible="client"][data-role-strict="true"],
body.is-staff [data-role-visible="client"][data-role-strict="true"],
body.is-financial [data-role-visible="client"][data-role-strict="true"],
body:not(.is-client) #customerMandatesPanel,
body:not(.is-client) #accountPanel {
  display: none !important;
}

.nav a.dashboard-header-tab {
  background: linear-gradient(135deg, rgba(11,31,51,.96), rgba(15,143,127,.92));
  border-color: rgba(15,143,127,.55);
  color: #fff;
  font-weight: 900;
}

/* V0.9.9RC11: Sticky-Header-Ausgleich für Kopfzeilen-Tabs/Sprungmarken.
   Verhindert, dass der angesprungene Bereich unter der fixierten Kopfzeile verschwindet. */
:root {
  --sticky-header-scroll-offset: 190px;
}
.section,
.panel[id],
.tab-panel[id] {
  scroll-margin-top: var(--sticky-header-scroll-offset);
}
@media (max-width: 980px) {
  :root { --sticky-header-scroll-offset: 235px; }
}
@media (max-width: 640px) {
  :root { --sticky-header-scroll-offset: 270px; }
}

/* V0.9.9RC11: Verlässliche Kopfzeilen-Sprungmarken.
   Alle Rollen-Tabs springen auf das aktive Panel selbst, nicht mehr auf den gesamten Rollenbereich. */
:root {
  --sticky-header-scroll-offset: 220px;
}
.nav a.auth-nav.active,
.nav a.admin-nav.active,
.nav a.dashboard-header-tab.active {
  background: linear-gradient(135deg, rgba(11,31,51,.98), rgba(15,143,127,.92));
  color: #fff;
  border-color: rgba(15,143,127,.60);
  box-shadow: 0 10px 24px rgba(11,31,51,.18);
}
.tab-panel[id],
.section[id],
.panel[id] {
  scroll-margin-top: var(--sticky-header-scroll-offset);
}
@media (max-width: 980px) {
  :root { --sticky-header-scroll-offset: 265px; }
}
@media (max-width: 640px) {
  :root { --sticky-header-scroll-offset: 305px; }
}


/* V0.9.9RC16 Wartungsmodus Bugfix */
.maintenance-section { min-height: 55vh; display: flex; align-items: center; }
.maintenance-panel { max-width: 820px; margin: 0 auto; text-align: center; padding: 42px; border: 1px solid rgba(15, 118, 110, 0.22); background: linear-gradient(180deg, #ffffff, #f8fafc); }
.maintenance-panel h1 { margin-top: 8px; }
.maintenance-admin-card { margin-top: 18px; padding: 16px; border: 1px solid rgba(15, 118, 110, 0.18); border-radius: 18px; background: #f8fafc; }
.check-row.strong { font-weight: 800; color: #0f172a; }
body.maintenance-mode .site-header .nav .public-nav { display: none !important; }
body.maintenance-mode .site-header .nav .login-nav { display: inline-flex !important; }

body.maintenance-mode main > section:not(#maintenance):not(#login) { display: none !important; }
body.maintenance-mode .site-header .nav a:not(.login-nav) { display: none !important; }
body.maintenance-mode .site-header .nav .login-nav { display: inline-flex !important; }

/* V0.9.9RC16 Maintenance Hard Lock */
body[data-maintenance-mode="active"] main > section:not(#maintenance):not(#login) {
  display: none !important;
  visibility: hidden !important;
}
body[data-maintenance-mode="active"] #maintenance {
  display: flex !important;
  visibility: visible !important;
}
body[data-maintenance-mode="active"] .site-header .nav a:not(.login-nav) {
  display: none !important;
}
body[data-maintenance-mode="active"] .site-header .nav .login-nav {
  display: inline-flex !important;
}

/* V0.9.9RC16 Corporate Design: ENERGIE#effizient */
.website-brand-only .brand {
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #0f172a;
}
.brand-accent {
  color: #15803d;
  font-style: italic;
  text-transform: none;
}
.brand-block .icea-logo {
  width: 132px;
  max-width: 132px;
}
@media (max-width: 760px) {
  .brand-block .icea-logo { width: 88px; }
  .website-brand-only .brand { font-size: 1.05rem; }
}

/* V0.9.9RC20 Header Brand Layout Fix
   Vollständiger dreizeiliger Brand links, Rollen-Tabs rechts mit Abstand und ohne Überlappung. */
.site-header .header-inner {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.35fr);
  gap: 2rem;
  align-items: center;
}
.full-brand-header {
  min-width: 0;
  max-width: 620px;
}
.full-brand-header .icea-logo {
  width: 118px;
  max-width: 118px;
}
.brand-copy {
  min-width: 0;
  display: grid;
  gap: .12rem;
}
.website-brand-full .brand-main {
  font-size: clamp(1.18rem, 1.6vw, 1.55rem);
  line-height: 1.05;
  letter-spacing: .065em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-line {
  color: var(--brand-navy, #0b1f33);
  font-weight: 800;
  line-height: 1.25;
}
.brand-person {
  font-size: clamp(1rem, 1.3vw, 1.24rem);
}
.brand-claim {
  font-size: clamp(.92rem, 1.16vw, 1.12rem);
}
.full-brand-header .version-pill {
  width: fit-content;
  margin-top: .4rem;
}
.site-header .nav {
  justify-content: flex-end;
  align-items: center;
  gap: .55rem;
  row-gap: .65rem;
  min-width: 0;
}
.site-header .nav a {
  white-space: nowrap;
}
body.is-auth .site-header .nav,
body.is-admin .site-header .nav,
body.is-staff .site-header .nav,
body.is-financial .site-header .nav,
body.is-client .site-header .nav {
  padding-left: 1.25rem;
  border-left: 1px solid rgba(213, 227, 225, .9);
}
@media (max-width: 1120px) {
  .site-header .header-inner {
    grid-template-columns: 1fr;
    gap: .85rem;
    align-items: start;
  }
  .site-header .nav {
    justify-content: flex-start;
    padding-left: 0 !important;
    border-left: 0 !important;
  }
  .full-brand-header { max-width: none; }
}
@media (max-width: 640px) {
  .full-brand-header {
    align-items: center;
  }
  .full-brand-header .icea-logo {
    width: 82px;
    max-width: 82px;
  }
  .website-brand-full .brand-main { white-space: normal; }
}

/* V0.9.9RC20: supplied Corporate Design logo asset */
.icea-logo {
  object-fit: contain;
}
.full-brand-header .icea-logo {
  width: 150px;
  height: auto;
  max-height: 86px;
}
@media (max-width: 780px) {
  .full-brand-header .icea-logo { width: 122px; max-height: 72px; }
}
