/* Energieassistent Dashboard — Design-System im z'ammstromen-Look.
   Palette: warme Stone-Grautöne + Lime-Akzent #cddb28, Schrift Red Hat Text
   (SIL OFL 1.1, lokal ausgeliefert — CSP erlaubt nur 'self'). */

@font-face {
  font-family: "Red Hat Text";
  src: url("/assistant/dashboard/assets/RedHatText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Text";
  src: url("/assistant/dashboard/assets/RedHatText-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --lime: #cddb28;
  --lime-soft: #f4f8d3;
  --lime-dark: #a9b51f;
  --ok: #3f9142;
  --ok-bg: #e4f3e4;
  --warn: #c07c10;
  --warn-bg: #fdf0d7;
  --bad: #c2403f;
  --bad-bg: #fbe4e4;
  --info: #3b7ea1;
  --info-bg: #e3eff6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 4px 16px rgba(28, 25, 23, 0.05);
  --sidebar-w: 236px;
  --font: "Red Hat Text", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--stone-900);
  background: var(--stone-100);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
h3 { font-size: 13.5px; }
p { margin: 0; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--stone-500); }
.small { font-size: 12px; }
.health-issue-details { margin: 6px 0 0; padding-left: 18px; line-height: 1.45; }
div.health-issue-details { padding-left: 0; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- Sitzungsprüfung ---------- */
#authLoading {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 520px at 76% 5%, rgba(205,219,40,.13), transparent 64%),
    #11130f;
  color: #fff;
  padding: 24px;
}
body.auth-pending #authLoading { display: flex; }
body.auth-pending #login { display: none; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth-brand svg { width: 84px; }
.auth-brand .wordmark { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand .sub { color: var(--stone-500); font-size: 13px; }

/* ---------- Login ---------- */
#login {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(900px 650px at 79% 12%, rgba(205,219,40,.12), transparent 66%),
    radial-gradient(700px 560px at 8% 88%, rgba(59,126,161,.12), transparent 67%),
    #11130f;
  color: #fff;
}
.login-grid {
  position: absolute; z-index: -3; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.032) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 82%);
}
#loginEnergyCanvas { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; opacity: .78; }
.login-glow { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.login-glow-a {
  width: min(62vw, 900px); aspect-ratio: 1; right: -24vw; top: -42vw;
  border: 1px solid rgba(205,219,40,.12); box-shadow: inset 0 0 120px rgba(205,219,40,.04);
}
.login-glow-b {
  width: 380px; height: 380px; left: -210px; bottom: -220px;
  border: 1px solid rgba(115,179,212,.09); box-shadow: inset 0 0 100px rgba(115,179,212,.03);
}
.login-shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, 445px);
  align-items: stretch; gap: clamp(52px, 8vw, 130px);
  width: min(1320px, 100%); min-height: min(760px, calc(100svh - 64px));
  padding: clamp(34px, 5vw, 72px);
}
.login-story { display: flex; flex-direction: column; min-width: 0; }
.login-brand {
  display: inline-flex; align-items: center; gap: 13px; width: max-content;
  color: #fff; text-decoration: none;
}
.login-brand svg { width: 38px; height: 42px; flex: none; fill: var(--lime); }
.login-brand > span { display: flex; flex-direction: column; line-height: 1.12; }
.login-brand strong { font-size: 15px; letter-spacing: .01em; }
.login-brand small { margin-top: 4px; color: var(--stone-500); font-size: 10.5px; letter-spacing: .06em; }
.login-brand:focus-visible, .login-home-link:focus-visible { outline: 2px solid var(--lime); outline-offset: 6px; border-radius: 4px; }
.login-story-copy { width: min(670px, 100%); margin: auto 0; padding: 48px 0; }
.login-eyebrow, .login-card-kicker {
  color: var(--lime); font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.login-eyebrow { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.login-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.login-story h1 {
  max-width: 680px; margin: 0;
  font-size: clamp(44px, 5vw, 76px); line-height: .99; letter-spacing: -.05em;
}
.login-story h1 em { color: var(--lime); font-style: normal; }
.login-story-copy > p:last-of-type {
  max-width: 590px; margin-top: 24px; color: var(--stone-400); font-size: 16px; line-height: 1.65;
}
.login-orbit { position: relative; width: min(620px, 100%); height: 210px; margin-top: 32px; }
.login-orbit-ring {
  position: absolute; left: 42%; top: 50%; border: 1px solid rgba(255,255,255,.11);
  border-radius: 50%; transform: translate(-50%, -50%);
}
.login-orbit-ring::after {
  content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 18px rgba(205,219,40,.7);
}
.login-orbit-ring.ring-a { width: 184px; height: 184px; animation: login-orbit 15s linear infinite; }
.login-orbit-ring.ring-a::after { left: 18px; top: 20px; }
.login-orbit-ring.ring-b { width: 314px; height: 116px; transform: translate(-50%, -50%) rotate(-13deg); animation: login-orbit-wide 22s linear infinite; }
.login-orbit-ring.ring-b::after { right: 32px; bottom: 5px; }
.login-orbit-core {
  position: absolute; left: 42%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; align-content: center;
  width: 98px; height: 98px; border-radius: 50%;
  border: 1px solid rgba(205,219,40,.38); background: rgba(205,219,40,.065);
  box-shadow: 0 0 50px rgba(205,219,40,.07), inset 0 0 28px rgba(205,219,40,.06);
}
.login-orbit-core strong { color: #fff; font-size: 22px; line-height: 1; }
.login-orbit-core small { margin-top: 5px; color: var(--stone-500); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.login-orbit-node, .login-orbit-output {
  position: absolute; padding: 6px 10px; border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px; background: rgba(28,25,23,.72); backdrop-filter: blur(8px);
  color: var(--stone-300); font-size: 10px; font-weight: 700;
}
.login-orbit-node::after {
  content: ""; position: absolute; top: 50%; width: 54px; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(205,219,40,.35));
}
.node-weather { left: 0; top: 12px; }
.node-readings { left: 4%; bottom: 26px; }
.node-price { left: 6%; top: 84px; }
.node-weather::after, .node-readings::after, .node-price::after { left: 100%; }
.login-orbit-output { right: 0; top: 86px; color: var(--lime); border-color: rgba(205,219,40,.24); }
.login-orbit-output i {
  display: inline-block; width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(205,219,40,.65);
}
.login-home-link {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: 510px; padding-top: 18px; color: #fff;
  border-top: 1px solid rgba(255,255,255,.1); text-decoration: none;
  transition: color .18s, border-color .18s;
}
.login-home-link:hover { color: var(--lime); border-color: rgba(205,219,40,.42); }
.login-home-link > span:first-child { display: flex; flex-direction: column; font-weight: 700; }
.login-home-link small { margin-bottom: 3px; color: var(--stone-500); font-size: 10.5px; font-weight: 400; }
.login-home-link > span:last-child { color: var(--lime); font-size: 22px; }
.login-panel { align-self: center; min-width: 0; }
.login-card {
  width: 100%;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid rgba(255,255,255,.13); border-radius: 24px;
  background: linear-gradient(145deg, rgba(41,37,36,.86), rgba(23,25,21,.92));
  box-shadow: 0 32px 90px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(22px);
}
.login-card h2 { margin: 8px 0 7px; color: #fff; font-size: 28px; }
.login-card-lead { margin-bottom: 25px; color: var(--stone-400); }
#login label { margin-top: 16px; color: var(--stone-300); }
#login input {
  padding: 12px 13px; border-color: rgba(255,255,255,.15);
  background: rgba(0,0,0,.2); color: #fff;
}
#login input:hover { border-color: rgba(255,255,255,.24); }
#login input:focus { border-color: var(--lime); background: rgba(0,0,0,.28); }
#login .login-submit {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: 19px; padding: 12px 15px;
}
#login .login-submit span { font-size: 18px; line-height: 1; }
.login-security { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--stone-500); font-size: 10.5px; }
.login-security > span {
  position: relative; width: 9px; height: 8px; border: 1px solid var(--stone-500); border-radius: 2px;
}
.login-security > span::before {
  content: ""; position: absolute; left: 1px; top: -6px; width: 5px; height: 6px;
  border: 1px solid var(--stone-500); border-bottom: 0; border-radius: 5px 5px 0 0;
}
.funding-credit { display: flex; align-items: center; }
.funding-credit img { display: block; flex: none; border-radius: 7px; }
.funding-credit-login {
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.funding-credit-login img { width: 44px; height: 44px; }
.funding-credit-login div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.funding-credit-login strong { color: var(--stone-300); font-size: 12px; }
.funding-credit-login span { color: var(--stone-400); font-size: 10.5px; line-height: 1.35; }
@keyframes login-orbit { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes login-orbit-wide { to { transform: translate(-50%, -50%) rotate(347deg); } }

@media (max-width: 1050px) {
  .login-shell { grid-template-columns: minmax(0, 1fr) minmax(350px, 400px); gap: 44px; }
  .login-story h1 { font-size: clamp(42px, 5.5vw, 60px); }
  .login-orbit { transform: scale(.9); transform-origin: left center; }
}

@media (max-width: 800px) {
  #login { overflow: auto; }
  .login-shell { grid-template-columns: minmax(0, 1fr); gap: 34px; min-height: 100svh; padding: 28px 22px 36px; }
  .login-story-copy { margin: 58px 0 0; padding: 0; }
  .login-story h1 { max-width: 620px; font-size: clamp(38px, 10vw, 54px); }
  .login-story-copy > p:last-of-type { margin-top: 18px; font-size: 14px; }
  .login-orbit { display: none; }
  .login-home-link { margin-top: 34px; }
  .login-panel { width: min(520px, 100%); }
  .login-card { border-radius: 20px; }
}

@media (max-width: 440px) {
  .login-shell { padding-left: 16px; padding-right: 16px; }
  .login-story-copy { margin-top: 46px; }
  .login-story h1 { font-size: 36px; }
  .login-home-link { gap: 14px; font-size: 12.5px; }
  .login-card { padding: 25px 20px; }
  .login-card h2 { font-size: 24px; }
}

/* ---------- App-Shell ---------- */
#app { display: flex; min-height: 100vh; }
aside {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--stone-900);
  color: var(--stone-300);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--stone-800);
}
.side-brand svg { width: 40px; flex: none; }
.side-brand .name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.side-brand .sub { color: var(--stone-500); font-size: 11.5px; }
.dashboard-mobile-menu { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.dashboard-menu-toggle { display: none; }
nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
nav .nav-group { margin: 14px 8px 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--stone-600); }
nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--stone-400);
  font: inherit;
  font-weight: 400;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}
nav button svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
nav button:hover { background: var(--stone-800); color: var(--stone-100); }
nav button.active { background: var(--stone-800); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--lime); }
.nav-inquiry-badge, .nav-critical-badge, .nav-model-ready-badge {
  min-width: 21px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--lime);
  color: var(--stone-900);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}
.nav-critical-badge {
  background: var(--bad);
  color: #fff;
}
.nav-model-ready-badge {
  background: var(--ok);
  color: #fff;
}
.side-user {
  border-top: 1px solid var(--stone-800);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-user .avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--lime);
  color: var(--stone-900);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.side-user .who { flex: 1; min-width: 0; }
.side-user .who div:first-child { color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who div:last-child { color: var(--stone-500); font-size: 11.5px; }
.side-user button { background: none; border: 1px solid var(--stone-700); color: var(--stone-400); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.side-user button:hover { color: #fff; border-color: var(--stone-500); }
.side-user button:disabled { opacity: .35; cursor: not-allowed; }
.profile-dialog { width: min(480px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--stone-900); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.profile-dialog::backdrop { background: rgba(28,25,23,.65); }
.profile-dialog form { margin: 0; }
.profile-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--stone-200); }
.profile-dialog-head h2 { margin: 2px 0 0; }
.profile-dialog-head .eyebrow { margin: 0; color: var(--stone-500); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.profile-close { border: 0; background: none; color: var(--stone-500); font-size: 28px; line-height: 1; cursor: pointer; }
.profile-dialog-body { padding: 18px 20px 4px; }
.profile-dialog-body label:first-child { margin-top: 0; }
.profile-dialog-body input[readonly] { background: var(--stone-100); color: var(--stone-500); }
.profile-access-summary { margin-top: 16px; padding: 10px 12px; border-radius: 9px; background: var(--stone-100); color: var(--stone-700); font-size: 13px; }
.profile-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 20px; }
.dashboard-dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--stone-900); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.dashboard-dialog::backdrop { background: rgba(28,25,23,.65); }
.dashboard-dialog form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.dashboard-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--stone-200); }
.dashboard-dialog-head h2 { margin: 0; font-size: 20px; }
.dashboard-dialog-close { border: 0; background: none; color: var(--stone-500); font-size: 28px; line-height: 1; cursor: pointer; }
.dashboard-dialog-body { overflow: auto; padding: 20px; }
.dashboard-dialog-copy { margin: 0; color: var(--stone-700); line-height: 1.55; }
.dashboard-dialog-field { margin-top: 0; }
.dashboard-dialog-copy:not([hidden]) + .dashboard-dialog-field:not([hidden]) { margin-top: 18px; }
.dashboard-dialog-field textarea { min-height: 180px; resize: vertical; }
.dashboard-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; flex-wrap: wrap; }
.side-version {
  padding: 8px 18px 12px;
  font-size: 10.5px;
  color: var(--stone-500);
  font-variant-numeric: tabular-nums;
}

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.impersonate-banner {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 26px;
  background: var(--warn-bg);
  color: var(--warn);
  border-bottom: 1px solid #f0d79a;
  font-weight: 600;
  font-size: 13px;
}
.impersonate-banner button { margin-left: auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--stone-200);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.topbar h1 { flex: 1; min-width: 160px; }
.days-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--stone-500);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.days-control select { color: var(--stone-800); }
.content { padding: 24px 26px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1560px; width: 100%; margin: 0 auto; }
/* Jede Ansicht erzeugt mehrere gleichrangige Bereiche (Karten, Überschriften,
   Tabellen). Als Blockelemente würden sie ohne Abstand direkt aneinanderliegen.
   Der gemeinsame Stack hält den vertikalen Rhythmus über das Dashboard hinweg
   konsistent; spezialisierte Ansichten können ihn bei Bedarf überschreiben. */
.content > section:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Geführte Hilfe */
.tour-invitation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid #d9e07d;
  border-left: 5px solid var(--lime);
  border-radius: var(--radius);
  background: linear-gradient(125deg, #fff 0%, #fbfce9 100%);
  box-shadow: var(--shadow);
}
.tour-invitation-copy h2 { margin: 3px 0 5px; font-size: 18px; }
.tour-invitation-copy p { margin: 0; color: var(--stone-600); font-size: 13px; }
.tour-kicker {
  color: var(--stone-500); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.tour-invitation-actions, .guided-tour-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.guided-tour-list .card-head h2 { margin: 3px 0 0; }
.guided-tour-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px; align-items: center; padding-top: 16px;
  border-top: 1px solid var(--stone-100);
}
.guided-tour-row h3 { margin: 0 0 4px; }
.guided-tour-row p { margin: 0 0 5px; color: var(--stone-600); font-size: 13px; }
.guided-tour-video {
  display: grid; grid-template-columns: minmax(320px, 1.6fr) minmax(240px, .8fr);
  gap: 22px; align-items: center; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--stone-100);
}
.guided-tour-video-player {
  overflow: hidden; border: 1px solid var(--stone-200); border-radius: 12px;
  background: var(--stone-900); box-shadow: 0 8px 24px rgba(28,25,23,.12);
}
.guided-tour-video-player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.guided-tour-video-copy h3 { margin: 5px 0 7px; }
.guided-tour-video-copy > p { margin: 0 0 12px; color: var(--stone-600); font-size: 13px; line-height: 1.55; }
.guided-tour-video-copy > p:last-child { margin: 10px 0 0; }
body.guided-tour-active #jobForm,
body.guided-tour-active [data-promote],
body.guided-tour-active [data-promote-competition] { pointer-events: none !important; }

.driver-popover.ea-guided-tour {
  max-width: 360px;
  border: 1px solid var(--stone-200);
  border-top: 4px solid var(--lime);
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(28, 25, 23, .28);
  color: var(--stone-800);
  font-family: "Red Hat Text", system-ui, sans-serif;
}
.driver-popover.ea-guided-tour .driver-popover-title { font-size: 17px; line-height: 1.3; }
.driver-popover.ea-guided-tour .driver-popover-description { color: var(--stone-600); line-height: 1.55; }
.driver-popover.ea-guided-tour .driver-popover-progress-text { color: var(--stone-500); }
.driver-popover.ea-guided-tour button {
  border: 1px solid var(--stone-300); border-radius: 8px; padding: 7px 11px;
  color: var(--stone-800); background: #fff; font: inherit; font-size: 12px; font-weight: 700;
  text-shadow: none;
}
.driver-popover.ea-guided-tour button:hover,
.driver-popover.ea-guided-tour button:focus-visible { background: var(--stone-100); color: var(--stone-900); }
.driver-popover.ea-guided-tour .driver-popover-close-btn {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; font-size: 18px; line-height: 1;
}
.driver-popover.ea-guided-tour .driver-popover-next-btn,
.driver-popover.ea-guided-tour .driver-popover-done-btn { background: var(--lime); border-color: var(--lime); }
.driver-popover.ea-guided-tour .driver-popover-next-btn:hover,
.driver-popover.ea-guided-tour .driver-popover-done-btn:hover { background: #d8e43d; }

/* Community-Pills */
.pills { display: flex; gap: 6px; background: var(--stone-200); border-radius: 11px; padding: 4px; flex-wrap: wrap; }
.pills button {
  border: 0; background: none; font: inherit; font-size: 13px;
  padding: 6px 13px; border-radius: 8px; cursor: pointer; color: var(--stone-600);
}
.pills button.active { background: #fff; color: var(--stone-900); font-weight: 700; box-shadow: 0 1px 3px rgba(28,25,23,.12); }

/* ---------- Bausteine ---------- */
.card {
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .muted { font-size: 12.5px; }
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head p { color: var(--stone-600); font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.neutral { background: var(--stone-200); color: var(--stone-600); }

/* Ampel */
.traffic { display: flex; align-items: center; gap: 14px; }
.traffic .lamp {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff; flex: none;
}
.lamp.green { background: var(--ok); box-shadow: 0 0 0 6px var(--ok-bg); }
.lamp.yellow { background: var(--warn); box-shadow: 0 0 0 6px var(--warn-bg); }
.lamp.red { background: var(--bad); box-shadow: 0 0 0 6px var(--bad-bg); }
.lamp.off { background: var(--stone-300); box-shadow: 0 0 0 6px var(--stone-100); color: var(--stone-500); }
.ampel-plan-title { margin: 15px 0 6px; color: var(--stone-600); font-size: 12px; }
.ampel-timeline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ampel-plan {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 8px;
  border-radius: 7px; font-size: 11.5px; font-weight: 600; line-height: 1.35;
}
.ampel-plan b { font-weight: 800; }
.ampel-plan.green { background: var(--ok-bg); color: var(--ok); }
.ampel-plan.yellow { background: var(--warn-bg); color: var(--warn); }
.ampel-plan.red { background: var(--bad-bg); color: var(--bad); }
.ampel-plan.off { background: var(--stone-100); color: var(--stone-600); }
.ampel-plan-more { color: var(--stone-500); font-size: 11.5px; }
.ampel-strip-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin: 14px 0 4px;
}
.ampel-strip-head span:last-child { text-align: right; }
.ampel-strip-grid { display: grid; gap: 5px; }
.ampel-strip-grid .ampel-strip { margin-top: 0; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: var(--stone-50); border: 1px solid var(--stone-200); border-radius: 11px; padding: 11px 13px; }
.stat .v { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.stat .l { font-size: 11.5px; color: var(--stone-500); margin-top: 1px; }

.model-registry-table { min-width: 1320px; }
.history-filter-row {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 14px 0; padding: 10px 12px;
  border: 1px solid var(--stone-200); border-radius: 10px;
  background: var(--stone-50);
}
.history-filter-row label { margin: 0; white-space: nowrap; }
.history-filter-row select { width: auto; min-width: 190px; padding: 7px 9px; font-size: 12.5px; }
.history-filter-row .muted { margin-left: auto; }
.model-role-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--stone-200);
  border-radius: 10px;
  background: var(--stone-50);
}
.model-role-legend > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.model-role-legend > div > span:last-child { color: var(--stone-500); font-size: 12px; }
@media (max-width: 760px) {
  .model-role-legend { grid-template-columns: 1fr; }
  .history-filter-row { align-items: stretch; }
  .history-filter-row label { width: 100%; }
  .history-filter-row select { width: 100%; }
  .history-filter-row .muted { width: 100%; margin-left: 0; }
}
.model-version-description { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 300px; max-width: 440px; }
.model-version-description > b { font-size: 12.5px; }
.model-version-details { font-size: 11.5px; color: var(--stone-700); }
.model-version-details summary { color: var(--stone-600); }
.model-version-details ul { margin: 7px 0 0; padding-left: 18px; line-height: 1.45; }
.model-version-details li + li { margin-top: 4px; }

/* Landingpage inquiries */
.inquiry-stats { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.inquiry-table { margin-top: 14px; }
.inquiry-table table { min-width: 1180px; }
.inquiry-organisation { margin-top: 7px; color: var(--stone-600); }
.inquiry-message { max-width: 360px; margin: 8px 0 0; white-space: pre-wrap; color: var(--stone-700); }
.inquiry-mail-status { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.inquiry-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 150px; }
.inquiry-actions select { width: 100%; padding: 6px 8px; font-size: 12px; }
.error-text { max-width: 230px; margin-top: 7px; color: var(--bad); }

@media (max-width: 880px) {
  .inquiry-stats { grid-template-columns: 1fr 1fr; }
}

/* Admin-Serverstatus: native progress-Elemente halten API-Werte aus
   style-Attributen heraus und bleiben auch ohne Farbe verständlich. */
.ops-refresh { display: flex; align-items: center; gap: 8px; }
.ops-refresh label { margin: 0; white-space: nowrap; }
.ops-refresh select { padding: 6px 9px; font-size: 12.5px; }
.server-status-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.server-status-grid { grid-template-columns: repeat(3, minmax(190px, 1fr)); }
.server-status-details { margin-top: 12px; }
.server-usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.server-usage-head .v { font-size: 19px; }
.server-meter { width: 100%; height: 9px; margin: 8px 0 5px; accent-color: var(--ok); }
.server-meter.warn { accent-color: var(--warn); }
.server-meter.bad { accent-color: var(--bad); }
.server-active-jobs { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--stone-200); }
.server-active-jobs-head, .server-active-job, .server-active-job-time {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.server-active-jobs-head { margin-bottom: 10px; }
.server-active-jobs-head h3 { margin: 0 0 2px; font-size: 14px; }
.server-active-job { padding: 10px 12px; border: 1px solid var(--stone-200); border-radius: 9px; background: var(--stone-50); }
.server-active-job + .server-active-job { margin-top: 7px; }
.server-active-job > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.server-active-job-time { flex: none; }
.server-active-job-time > span:first-child { color: var(--stone-600); font-size: 11.5px; white-space: nowrap; }
.server-active-jobs-empty { padding: 12px; }
.server-active-jobs-note { margin: 9px 0 0; }
.ops-layout { grid-template-columns: minmax(0, 1fr); }
.ops-scope-card {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 18px;
}
.ops-scope-card > div:first-child { max-width: 720px; }
.ops-scope-control { width: min(320px, 100%); flex: none; }
.ops-scope-control label { margin-top: 0; }
.ops-job-panel { margin-bottom: 18px; }
.ops-job-panel > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  list-style: none; color: var(--stone-900); font-size: 14px;
}
.ops-job-panel > summary::-webkit-details-marker { display: none; }
.ops-job-panel > summary > span:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ops-job-toggle::before { content: "Einblenden"; color: var(--stone-600); font-size: 12px; font-weight: 700; }
.ops-job-panel[open] .ops-job-toggle::before { content: "Ausblenden"; }
.ops-job-panel form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--stone-200); }
.ops-job-fields { display: grid; grid-template-columns: 1.35fr 1fr 0.8fr 1fr; gap: 12px; align-items: end; }
.ops-job-fields label { margin-top: 0; }
.ops-job-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.ops-job-actions .msg { margin: 0; }
.ops-community-stats { grid-template-columns: repeat(3, minmax(150px, 1fr)); margin-bottom: 12px; }
.ops-community-attention { background: rgba(251, 228, 228, 0.45); }
.ops-community-open { padding: 6px 10px; white-space: nowrap; }
.ops-snapshot-note { margin-bottom: 8px; }
.users-layout { grid-template-columns: minmax(0, 1fr); }
.users-layout.has-form { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); }
.users-layout > .card { min-width: 0; }

@media (max-width: 880px) {
  .users-layout.has-form { grid-template-columns: minmax(0, 1fr); }
  .ops-scope-card { align-items: stretch; flex-direction: column; }
  .ops-scope-control { width: 100%; }
  .ops-job-panel > summary { align-items: flex-start; }
  .ops-job-panel > summary > span:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .ops-job-fields { grid-template-columns: 1fr; }
  .ops-job-actions { align-items: stretch; flex-direction: column; }
  .ops-community-stats { grid-template-columns: 1fr; }
  .server-status-grid { grid-template-columns: 1fr; }
  .server-active-jobs-head, .server-active-job, .server-active-job-time { align-items: flex-start; flex-direction: column; }
  .server-active-job-time { gap: 6px; }
}

/* Modellwettbewerb: Unterkarten je Zielgröße + Entscheidungspanel */
.subcard {
  border: 1px solid var(--stone-200); border-radius: 10px;
  padding: 14px 16px; margin-top: 14px;
}
.subcard:first-child { margin-top: 0; }
.subcard .card-head { margin-bottom: 10px; }
.subcard .card-head h3 { font-size: 15px; margin: 0; }
.decision-panel { margin-top: 14px; border-top: 1px solid var(--stone-100); padding-top: 12px; }
.decision-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

/* Key-Value-Listen */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; }
.kv > div:nth-child(even) { font-weight: 700; text-align: right; }
.kv.lined > div { border-top: 1px solid var(--stone-100); padding-top: 6px; }
.kv > .recommendation-precision { max-width: 245px; font-weight: 400; }
.recommendation-precision-value {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  font-weight: 700;
}
.recommendation-precision-value .badge {
  flex: none; padding: 2px 6px; font-size: 10px; white-space: nowrap;
}
.recommendation-precision .small { margin-top: 3px; line-height: 1.3; font-weight: 400; }

/* Tabellen */
.tablewrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--stone-500);
  padding: 8px 10px; border-bottom: 1px solid var(--stone-200);
  white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--stone-100); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Formulare */
label { display: block; font-size: 12px; font-weight: 700; color: var(--stone-600); margin: 12px 0 5px; }
input, select, textarea {
  font: inherit;
  width: 100%;
  border: 1px solid var(--stone-300);
  border-radius: 9px;
  padding: 9px 11px;
  background: #fff;
  color: var(--stone-900);
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 1px;
  border-color: var(--lime-dark);
}
input[type="checkbox"] { width: auto; }
.field-hint { font-size: 11.5px; color: var(--stone-400); margin-top: 3px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 130px; }

button.btn {
  font: inherit; font-weight: 700;
  border: 0; border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  background: var(--lime);
  color: var(--stone-900);
  transition: background 0.15s;
}
button.btn:hover { background: var(--lime-dark); }
button.btn.secondary { background: var(--stone-200); color: var(--stone-800); }
button.btn.secondary:hover { background: var(--stone-300); }
button.btn.ghost { background: none; border: 1px solid var(--stone-300); color: var(--stone-700); }
button.btn.ghost:hover { border-color: var(--stone-500); }
button.btn.danger { background: var(--bad); color: #fff; }
button.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
button.btn:disabled { opacity: 0.45; cursor: not-allowed; }
select.inline { width: auto; }

.msg { font-size: 13px; margin-top: 10px; }
.msg.ok { color: var(--ok); }
.msg.error { color: var(--bad); }
.banner {
  border-radius: var(--radius);
  padding: 13px 18px;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 13.5px;
}
.banner.bad { background: var(--bad-bg); color: #7c2a2a; border: 1px solid #f0c8c8; }
.banner.warn { background: var(--warn-bg); color: #6d4a10; border: 1px solid #efdcb2; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* Portfolio: Die erklärenden und administrativen Karten enthalten mehrere
   aufeinanderfolgende Elemente. Ein kompakter, aber klarer Innenrhythmus
   verhindert, dass Text, Auswahl und Aktion optisch zusammenkleben. */
.portfolio-info,
.portfolio-automation { display: flex; flex-direction: column; gap: 12px; }
.portfolio-info .card-head,
.portfolio-automation .card-head { margin-bottom: 0; }

/* Portfolio-Entscheidungen lagen bisher als vier untrennbare Controls in einer
   Tabellenzelle. Das sprengte bei normalen Desktop-Breiten die rechte Kante.
   Zwei kompakte Spalten halten die Aktion sichtbar; in engeren Fenstern wird
   die Zelle einspaltig. Die Tabelle bleibt als sichere Rückfallebene scrollbar. */
#view-portfolio .tablewrap {
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.portfolio-table { table-layout: fixed; }
.portfolio-col-name { width: 210px; }
.portfolio-col-ref { width: 85px; }
.portfolio-col-type { width: 70px; }
.portfolio-col-share { width: 95px; }
.portfolio-col-week { width: 75px; }
.portfolio-col-reading { width: 100px; }
.portfolio-col-status { width: 75px; }
.portfolio-col-review { width: 280px; }
.portfolio-review-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(360px, 100%);
}
.portfolio-review-controls > * { min-width: 0; }
.portfolio-review-controls .btn { width: 100%; }
.portfolio-name {
  overflow-wrap: anywhere;
}

/* ---------- Charts ---------- */
.chart-card svg.chart { display: block; width: 100%; height: auto; }
/* Kopfzeile des Charts: Ziel-Pillen + Rückblick-Umschalter nebeneinander */
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rangepick { display: inline-flex; align-items: center; gap: 7px; }
.rangepick .rp-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--stone-500); }

/* Vollbild-Knopf: dezent schwebend in der oberen rechten Chart-Ecke */
.chart-wrap { position: relative; }
.chart-fs {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--stone-200); border-radius: 8px;
  background: rgba(255, 255, 255, 0.82); color: var(--stone-500);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.chart-fs:hover { color: var(--stone-900); border-color: var(--stone-400); background: #fff; }
.chart-fs svg { width: 16px; height: 16px; }

/* Vollbild: Chart-Karte füllt den Screen, Inhalt vertikal zentriert */
.chart-card:fullscreen {
  background: #fff;
  padding: 26px 34px;
  display: flex; flex-direction: column; justify-content: center;
  overflow: auto;
}
.chart-card:fullscreen .chart-wrap { display: block; width: 100%; }
.chart-card:fullscreen #fcChartInner { width: 100%; }
.chart-card:fullscreen svg.chart { width: 100%; height: auto; max-height: 82vh; }
.chart-card:fullscreen .chart-fs { top: 2px; right: 2px; }
.chart-card:fullscreen::backdrop { background: #fff; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--stone-600); margin-top: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.chart-legend .chart-note { color: var(--stone-500); font-style: italic; }
.model-explainer {
  margin: 0 16px 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--lime-dark);
  background: var(--stone-50);
  color: var(--stone-600);
  font-size: 12.5px;
  line-height: 1.55;
}
.chart-actual-summary { margin: 8px 0 0; color: var(--stone-600); }
.chart-tip {
  position: fixed; z-index: 40; pointer-events: none;
  background: var(--stone-900); color: var(--stone-100);
  border-radius: 9px; padding: 8px 11px; font-size: 12px;
  box-shadow: 0 6px 20px rgba(28,25,23,.35);
  max-width: 320px;
  overflow-wrap: anywhere;
}
.chart-tip .muted { color: var(--stone-300); }
.chart-tip b { color: #fff; }
.chart-tip .tip-lime { color: var(--lime); }
/* Zielgrößen-Farben im Hybrid-Tooltip (auf dunklem Grund lesbare Varianten
   der Linienfarben: Erzeugung Lime, Verbrauch helles Grau, Restlast Weiß) */
.chart-tip .tip-generation, .chart-tip .tip-generation b { color: var(--lime); }
.chart-tip .tip-consumption, .chart-tip .tip-consumption b { color: var(--stone-300); }
.chart-tip .tip-residual, .chart-tip .tip-residual b { color: #fff; }
/* Ist-Wert im Tooltip: helleres Blau, auf dunklem Grund gut lesbar */
.chart-tip .tip-actual, .chart-tip .tip-actual b { color: #93c5fd; }

/* Ampel-Streifen unterm Chart; .ampel-axis richtet ihn auf die
   SVG-Zeichenfläche aus (Ränder 52/920 der Breite links wie rechts) */
.ampel-axis { margin: 2px calc(52 / 920 * 100%) 0; }
.ampel-strip { display: flex; gap: 2px; margin-top: 8px; }
.ampel-strip i { flex: 1; height: 9px; border-radius: 3px; background: var(--stone-200); }
.ampel-strip i.green { background: var(--ok); }
.ampel-strip i.yellow { background: var(--warn); }
.ampel-strip i.red { background: var(--bad); }

/* Score-Balken */
.scorebar { height: 8px; border-radius: 99px; background: var(--stone-200); overflow: hidden; }
.scorebar i { display: block; height: 100%; border-radius: 99px; }

/* Skeleton / Leerzustand */
.empty {
  text-align: center; color: var(--stone-400);
  padding: 34px 10px; font-size: 13px;
}
.spinner {
  width: 17px; height: 17px; flex: none;
  border: 2.5px solid var(--stone-300);
  border-top-color: var(--stone-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Details/JSON */
details summary { cursor: pointer; color: var(--stone-500); font-size: 12px; }
pre {
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 11.5px;
  background: var(--stone-50); border: 1px solid var(--stone-200);
  border-radius: 9px; padding: 10px; margin: 8px 0 0;
}

/* ---------- Schnittstellen ---------- */
/* Die Section ist display:block — ohne eigenen Flow kleben Summary-Leiste und
   Kategoriegruppen aneinander. Eigene Flex-Spalte gibt den gestapelten Blöcken
   denselben vertikalen Rhythmus wie .content den Karten der übrigen Views. */
#view-interfaces { display: flex; flex-direction: column; gap: 24px; }
.iface-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 13px 18px; }
.iface-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.iface-summary #ifaceRefresh { margin-left: auto; }
.iface-group { display: flex; flex-direction: column; gap: 14px; }
.iface-cat {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--stone-500); font-weight: 700; margin: 0;
  padding-bottom: 8px; border-bottom: 1px solid var(--stone-200);
}
.iface-card { display: flex; flex-direction: column; gap: 10px; }
.iface-card .card-head { margin-bottom: 0; }
.iface-card .card-head h2 { font-size: 15px; }
.iface-purpose { color: var(--stone-600); }
.iface-kv { grid-template-columns: auto 1fr; gap: 4px 14px; }
.iface-kv > div:nth-child(even) { text-align: left; font-weight: 400; word-break: break-word; }
.iface-kv > div:nth-child(odd) { white-space: nowrap; }
.iface-card.is-shadow { border-color: var(--info); }
.iface-shadow {
  background: var(--info-bg); border: 1px solid var(--info);
  border-radius: 9px; padding: 9px 11px; font-size: 12.5px; color: var(--info);
}
.iface-card.is-planned { opacity: 0.62; background: var(--stone-50); }
.iface-card.is-legacy { background: var(--stone-50); border-style: dashed; }
.iface-planned {
  background: var(--stone-100); border: 1px dashed var(--stone-300);
  border-radius: 9px; padding: 9px 11px; font-size: 12.5px; color: var(--stone-600);
}
.iface-card.is-unlicensed { background: var(--warn-bg); }
.iface-unlicensed {
  background: var(--warn-bg); border: 1px dashed var(--warn);
  border-radius: 9px; padding: 9px 11px; font-size: 12.5px; color: var(--warn);
}
.iface-legacy {
  background: var(--stone-100); border-left: 3px solid var(--stone-400);
  border-radius: 7px; padding: 9px 11px; font-size: 12.5px;
  color: var(--stone-700); line-height: 1.5;
}
.iface-attr {
  display: inline-block; background: var(--warn-bg); color: var(--warn);
  border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 600;
}
/* Eigener Tooltip statt native title= (die sind browserseitig träge/unzuverlässig
   und zeigten hier nur den help-Cursor). Reines CSS, CSP-konform, kein JS. */
.badge.has-tip { cursor: help; position: relative; }
.badge.has-tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: max-content; max-width: 250px;
  background: var(--stone-800); color: #fff;
  font-size: 11.5px; font-weight: 500; line-height: 1.45;
  text-align: left; white-space: normal;
  padding: 7px 10px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  pointer-events: none;
}
.badge.has-tip:hover::after,
.badge.has-tip:focus-visible::after {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.iface-actions { margin-top: 2px; }
.iface-result { font-size: 12.5px; font-weight: 600; margin-top: 2px; word-break: break-word; }
.iface-result.ok { color: var(--ok); }
.iface-result.bad { color: var(--bad); }

/* Sichtbarer Schutz gegen einen versehentlich laufenden Präsentationsmodus. */
.presentation-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 24px; background: #fef3c7; color: #78350f;
  border-bottom: 1px solid #f59e0b; font-size: 13px;
}
.presentation-banner.hidden { display: none; }
.settings-card { max-width: 760px; }
.settings-card li { margin-bottom: 7px; }

/* ---------- Hilfe & Erklärungen ---------- */
/* Kleines i neben Überschriften/Spaltenköpfen/Badges — öffnet per Klick das
   Info-Popover (#infoPop). Inline im Textfluss, daher vertikal ausgerichtet. */
.info-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px;
  border: 1px solid var(--stone-300); border-radius: 50%;
  background: var(--stone-100); color: var(--stone-500);
  font: 700 10px/1 var(--font); font-style: italic;
  cursor: pointer; vertical-align: 2px; padding: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.info-dot:hover, .info-dot:focus-visible { background: var(--lime-soft); color: var(--stone-900); border-color: var(--lime-dark); }
th .info-dot { vertical-align: 1px; text-transform: none; font-style: italic; }

/* Popover: Singleton-Element, per JS positioniert (viewport-sicher). */
.info-pop {
  position: fixed; z-index: 50;
  max-width: min(440px, calc(100vw - 20px)); width: max-content;
  background: #fff; color: var(--stone-800);
  border: 1px solid var(--stone-200); border-radius: 12px;
  box-shadow: 0 10px 32px rgba(28, 25, 23, 0.22);
  padding: 14px 16px; font-size: 13px; line-height: 1.55;
  max-height: calc(100vh - 20px); overflow-y: auto;
}
.info-pop[data-for="trend.quality"] {
  width: min(520px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
}
.info-pop p { margin: 0 0 8px; }
.info-pop p:last-of-type { margin-bottom: 0; }
.info-pop-close {
  float: right; margin: -4px -6px 6px 10px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: none; color: var(--stone-400); font-size: 15px; line-height: 1;
  cursor: pointer;
}
.info-pop-close:hover { background: var(--stone-100); color: var(--stone-800); }
.info-pop-link {
  display: inline-block; margin-top: 4px;
  border: 0; background: none; padding: 0;
  color: var(--info); font-weight: 700; font-size: 12.5px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.info-pop-link:hover { color: var(--stone-900); }

/* Hilfe-Seite */
.help-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.help-levels {
  display: inline-flex; gap: 4px; background: var(--stone-200);
  border-radius: 11px; padding: 4px; flex: none;
}
.help-levels button {
  border: 0; background: none; font: inherit; font-weight: 700; font-size: 13px;
  padding: 7px 15px; border-radius: 8px; cursor: pointer; color: var(--stone-600);
}
.help-levels button.active { background: #fff; color: var(--stone-900); box-shadow: 0 1px 3px rgba(28,25,23,.12); }
.help-section { scroll-margin-top: 90px; }
.help-section h2 { margin-bottom: 10px; }
.help-text p { margin: 0 0 12px; line-height: 1.7; }
.help-text p:last-child { margin-bottom: 0; }
.help-glossar h2 { margin-bottom: 12px; }
.glossar-list { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.glossar-entry { scroll-margin-top: 90px; border-top: 1px solid var(--stone-100); padding-top: 12px; }
.glossar-entry:first-child { border-top: 0; padding-top: 0; }
.glossar-entry dt { font-weight: 700; margin-bottom: 4px; }
.glossar-entry dd { margin: 0; color: var(--stone-700); }
.glossar-entry dd p { margin: 0 0 6px; line-height: 1.65; }
.glossar-entry dd p:last-child { margin-bottom: 0; }

/* Admin-Wiki: eigener Inhaltsbereich, bewusst unabhängig von der allgemeinen
   Hilfe. So kann die Rollenfreigabe später ohne Inhaltsumbau erweitert werden. */
.wiki-intro {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; background: linear-gradient(135deg, #fff 0%, var(--stone-50) 100%);
}
.wiki-intro h2, .wiki-article h2 { margin: 4px 0 8px; }
.wiki-intro p { max-width: 820px; margin: 0; color: var(--stone-600); line-height: 1.65; }
.wiki-intro-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.wiki-kicker {
  color: var(--stone-600); font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
}

/* The process map keeps the operating and learning loops readable without a
   heavyweight rendering dependency. The routes are decorative; all content
   and interactions remain native HTML. */
.wiki-process {
  overflow: hidden;
  border: 1px solid var(--stone-800);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at 75% 10%, rgba(205, 219, 40, .12), transparent 28%),
    radial-gradient(circle at 15% 72%, rgba(59, 126, 161, .12), transparent 27%),
    #171916;
  color: var(--stone-100);
  box-shadow: 0 18px 45px rgba(28, 25, 23, .16);
}
.wiki-process-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 28px;
  padding: 26px 28px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.wiki-process-head h2 { margin: 4px 0 7px; font-size: 20px; }
.wiki-process-head p { max-width: 780px; color: var(--stone-400); line-height: 1.6; }
.wiki-process-head .wiki-kicker, .wiki-process-step { color: var(--lime); }
.wiki-process-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; flex: none; }
.wiki-process-legend span, .wiki-process-lane-label {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 999px;
  color: var(--stone-300); background: rgba(255,255,255,.04); font-size: 10.5px; font-weight: 700;
}
.wiki-process-legend span::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.wiki-process-legend .lane-data { color: #73b3d4; }
.wiki-process-legend .lane-live { color: var(--lime); }
.wiki-process-legend .lane-learn { color: #e2ad57; }
.wiki-process-map { position: relative; min-height: 600px; padding: 68px 26px 28px; }
.wiki-process-routes {
  position: absolute; inset: 36px 2% 12px; width: 96%; height: calc(100% - 48px);
  overflow: visible; pointer-events: none;
}
.wiki-process-routes path {
  fill: none; stroke: rgba(255,255,255,.16); stroke-width: 2;
  vector-effect: non-scaling-stroke; stroke-dasharray: 6 8;
  animation: wiki-route-flow 6s linear infinite;
}
.wiki-process-routes marker path { fill: var(--stone-500); stroke: none; animation: none; }
.wiki-process-routes .route-live { stroke: rgba(205,219,40,.52); }
.wiki-process-routes .route-maturity { stroke: rgba(115,179,212,.52); }
.wiki-process-routes .route-learn, .wiki-process-routes .route-competition { stroke: rgba(226,173,87,.5); }
.wiki-process-routes .route-return { stroke: rgba(205,219,40,.28); }
@keyframes wiki-route-flow { to { stroke-dashoffset: -70; } }
.wiki-process-lane-label { position: absolute; left: 28px; z-index: 2; }
.wiki-process-lane-label.lane-data { top: 18px; color: #73b3d4; }
.wiki-process-stages {
  position: relative; z-index: 1; display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(132px, auto) 28px repeat(2, minmax(132px, auto));
  gap: 18px 42px;
}
.wiki-process-stages > .wiki-process-lane-label.lane-learn {
  position: static; grid-column: 1 / -1; grid-row: 2;
  align-self: center; justify-self: start; color: #e2ad57;
}
.wiki-process-stage {
  align-self: center; display: flex; flex-direction: column; align-items: stretch; gap: 7px;
  min-width: 0; min-height: 132px; padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  background: rgba(41,37,36,.92); color: var(--stone-100); font: inherit; text-align: left;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); cursor: pointer;
  transition: transform .18s, border-color .18s, background .18s, box-shadow .18s;
}
.wiki-process-stage:hover { transform: translateY(-2px); background: rgba(68,64,60,.95); }
.wiki-process-stage:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.wiki-process-stage.is-active {
  transform: translateY(-3px); border-color: var(--lime);
  background: linear-gradient(145deg, rgba(68,64,60,.98), rgba(41,37,36,.98));
  box-shadow: 0 0 0 1px rgba(205,219,40,.18), 0 15px 38px rgba(0,0,0,.28), 0 0 28px rgba(205,219,40,.09);
}
.wiki-process-stage.lane-data { border-top: 3px solid #73b3d4; }
.wiki-process-stage.lane-live { border-top: 3px solid var(--lime); }
.wiki-process-stage.lane-learn { border-top: 3px solid #e2ad57; }
.wiki-process-stage-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.wiki-process-stage-top span:first-child {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 50%; background: rgba(255,255,255,.09); color: #fff; font-size: 10.5px; font-weight: 700;
}
.wiki-process-stage-top span:last-child { color: var(--stone-400); font-size: 9.5px; line-height: 1.25; text-align: right; }
.wiki-process-stage strong { font-size: 14px; line-height: 1.25; }
.wiki-process-stage > span:last-child { color: var(--stone-400); font-size: 11px; line-height: 1.42; }
.wiki-process-stage[data-process-position="inputs"] { grid-column: 1; grid-row: 1; }
.wiki-process-stage[data-process-position="features"] { grid-column: 2; grid-row: 1; }
.wiki-process-stage[data-process-position="forecast"] { grid-column: 3; grid-row: 1; }
.wiki-process-stage[data-process-position="recommendation"] { grid-column: 4; grid-row: 1; }
.wiki-process-stage[data-process-position="maturity"] { grid-column: 1; grid-row: 3; }
.wiki-process-stage[data-process-position="evaluation"] { grid-column: 2; grid-row: 3; }
.wiki-process-stage[data-process-position="retraining"] { grid-column: 3; grid-row: 3; }
.wiki-process-stage[data-process-position="competition"] { grid-column: 3; grid-row: 4; }
.wiki-process-detail {
  margin: 0 28px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; background: rgba(255,255,255,.055);
}
.wiki-process-detail-head, .wiki-process-detail-foot {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
}
.wiki-process-step { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.wiki-process-detail h3 { margin: 3px 0 0; color: #fff; font-size: 18px; }
.wiki-process-timing {
  padding: 5px 9px; border-radius: 999px; background: rgba(205,219,40,.1);
  color: var(--lime); font-size: 11px; font-weight: 700; text-align: right;
}
.wiki-process-detail > p { max-width: 980px; margin: 13px 0 16px; color: var(--stone-300); line-height: 1.65; }
.wiki-process-detail-foot { align-items: center; }
.wiki-process-detail .btn.ghost { color: var(--stone-100); border-color: var(--stone-600); flex: none; }
.wiki-process-outputs { display: flex; flex-wrap: wrap; gap: 7px; }
.wiki-process-outputs span {
  padding: 5px 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px;
  background: rgba(0,0,0,.12); color: var(--stone-300); font-size: 10.5px;
}
.wiki-process-rhythms {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 20px 28px 0; border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1);
}
.wiki-process-rhythms div { padding: 15px 16px; border-right: 1px solid rgba(255,255,255,.08); }
.wiki-process-rhythms div:last-child { border-right: 0; }
.wiki-process-rhythms span { display: block; margin-bottom: 4px; color: var(--stone-500); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.wiki-process-rhythms strong { display: block; color: var(--stone-300); font-size: 11.5px; line-height: 1.4; }
.wiki-process-guard { display: flex; align-items: flex-start; gap: 12px; padding: 18px 28px 22px; color: var(--stone-400); }
.wiki-process-guard > span { color: var(--lime); font-size: 24px; line-height: 1; }
.wiki-process-guard p { max-width: 980px; font-size: 11.5px; line-height: 1.55; }
.wiki-process-guard strong { color: var(--stone-200); }
.wiki-category { display: flex; flex-direction: column; gap: 12px; }
.wiki-category[data-wiki-category="future"] {
  margin-top: 12px; padding: 24px 22px 22px;
  border-top: 1px dashed var(--stone-300); border-bottom: 1px dashed var(--stone-200);
  background: linear-gradient(180deg, rgba(205,219,40,.045), rgba(205,219,40,0));
}
.wiki-category-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; padding: 2px 2px 0;
}
.wiki-category-head h2 { margin: 3px 0 5px; }
.wiki-category-head p { max-width: 780px; margin: 0; color: var(--stone-600); line-height: 1.55; }
.wiki-count { color: var(--stone-500); font-size: 12px; flex: none; }
.wiki-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wiki-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  min-width: 0; border: 1px solid var(--stone-200); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); padding: 18px 20px;
  color: var(--stone-900); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.wiki-card:hover, .wiki-card:focus-visible {
  border-color: var(--lime); transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(28,25,23,.1); outline: none;
}
.wiki-card-top, .wiki-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wiki-card-top > span:last-child { color: var(--lime-dark); font-size: 20px; }
.wiki-card strong { font-size: 16px; line-height: 1.35; }
.wiki-card-summary { color: var(--stone-600); font-size: 13px; line-height: 1.55; flex: 1; }
.wiki-card-meta { color: var(--stone-500); font-size: 11.5px; margin-top: 2px; }
.wiki-detail-nav { display: flex; align-items: center; gap: 12px; }
.wiki-article { padding: 0; overflow: hidden; }
.wiki-article-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; padding: 24px; border-bottom: 1px solid var(--stone-200);
}
.wiki-summary { max-width: 850px; margin: 0; color: var(--stone-600); line-height: 1.65; }
.wiki-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex: none; color: var(--stone-500); font-size: 12px;
}
.wiki-facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0; background: var(--stone-50); border-bottom: 1px solid var(--stone-200);
}
.wiki-facts div { padding: 16px 20px; border-right: 1px solid var(--stone-200); }
.wiki-facts div:last-child { border-right: 0; }
.wiki-facts dt { color: var(--stone-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wiki-facts dd { margin: 4px 0 0; font-size: 16px; font-weight: 700; }
.wiki-sections { padding: 4px 24px 24px; }
.wiki-sections > section { padding: 20px 0; border-bottom: 1px solid var(--stone-100); }
.wiki-sections > section:last-child { border-bottom: 0; padding-bottom: 0; }
.wiki-sections h3 { margin: 0 0 9px; font-size: 16px; }
.wiki-sections .help-text { max-width: 940px; color: var(--stone-700); }
.wiki-related-terms {
  display: flex; align-items: flex-start; gap: 16px; padding: 16px 24px;
  border-bottom: 1px solid var(--stone-200); background: var(--stone-50);
}
.wiki-related-terms > span {
  padding-top: 6px; color: var(--stone-500); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.wiki-related-terms > div { display: flex; flex-wrap: wrap; gap: 7px; }
.wiki-related-terms a {
  padding: 5px 9px; border: 1px solid var(--stone-300); border-radius: 999px;
  background: #fff; color: var(--stone-700); font: inherit; font-size: 11px;
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.wiki-related-terms a:hover, .wiki-related-terms a:focus-visible {
  border-color: var(--lime-dark); color: var(--stone-900); outline: none;
  box-shadow: 0 0 0 2px rgba(205,219,40,.18);
}
.wiki-term-inline {
  display: inline; padding: 0 1px; border: 0; border-bottom: 1px dotted currentColor;
  background: transparent; color: var(--lime-dark); font: inherit; font-weight: 700;
  line-height: inherit; text-decoration: none; cursor: pointer;
}
.wiki-term-inline:hover { color: var(--stone-900); background: rgba(205,219,40,.14); }
.wiki-term-inline:focus-visible { color: var(--stone-900); outline: 2px solid var(--lime); outline-offset: 2px; }
.wiki-glossary-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
  padding: 20px 24px 24px; background: var(--stone-50);
}
.wiki-glossary-grid > .wiki-glossary-entry {
  min-width: 0; padding: 18px 20px; border: 1px solid var(--stone-200);
  border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(28,25,23,.04);
  scroll-margin-top: 90px;
}
.wiki-glossary-grid > .wiki-glossary-entry:last-child { padding-bottom: 18px; border-bottom: 1px solid var(--stone-200); }
.wiki-glossary-entry:focus { border-color: var(--lime-dark); outline: 3px solid rgba(205,219,40,.2); }
.wiki-glossary-group {
  display: block; margin-bottom: 6px; color: var(--lime-dark); font-size: 10px;
  font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.wiki-source-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.wiki-source-links a {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px;
  border: 1px solid var(--stone-200); border-radius: 8px; color: var(--stone-700);
  background: var(--stone-50); font-size: 10.5px; font-weight: 700; text-decoration: none;
}
.wiki-source-links a:hover, .wiki-source-links a:focus-visible { border-color: var(--lime-dark); color: var(--stone-900); outline: none; }

/* Alternative traffic-light concept. Blue remains a selection treatment next
   to the three-state signal and never becomes a fourth lamp. */
.wiki-signal-mockup {
  --signal-blue: #2f6fed;
  --signal-blue-dark: #163a69;
  --signal-blue-pale: #eef4ff;
  display: grid; grid-template-columns: minmax(380px, 1.25fr) minmax(250px, .75fr);
  gap: clamp(22px, 4vw, 48px); align-items: center; margin-top: 22px;
  padding: clamp(20px, 4vw, 40px); border: 1px solid #dbe3f0; border-radius: 20px;
  background:
    radial-gradient(circle at 20% 18%, rgba(47,111,237,.1), transparent 32%),
    linear-gradient(145deg, #f5f8fd 0%, #fff 62%, #f6f7f2 100%);
  overflow: hidden;
}
.wiki-signal-stage { min-width: 0; }
.wiki-signal-app-card {
  padding: clamp(20px, 3vw, 30px); border: 1px solid #dde3ec; border-radius: 20px;
  background: #fff; color: #172033; box-shadow: 0 18px 42px rgba(31,42,65,.12);
}
.wiki-signal-kicker {
  color: #6d788d; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase;
}
.wiki-signal-app-card > h4 { margin: 6px 0 24px; font-size: clamp(20px, 2.5vw, 28px); letter-spacing: -.025em; }
.wiki-signal-comparison {
  display: grid; grid-template-columns: 102px 46px minmax(150px, 1fr); gap: 8px;
  align-items: center;
}
.wiki-signal-current { min-width: 0; text-align: center; }
.wiki-signal-section-label {
  display: block; margin-bottom: 9px; color: #6c778c; font-size: 8.5px;
  font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.wiki-traffic-light {
  display: flex; flex-direction: column; gap: 7px; width: 62px; margin: 0 auto 10px;
  padding: 9px; border: 1px solid #10141c; border-radius: 18px; background: #202630;
  box-shadow: inset 0 0 0 2px #343b47, 0 9px 18px rgba(20,26,38,.18);
}
.wiki-traffic-light i {
  display: block; width: 42px; height: 42px; border: 3px solid rgba(255,255,255,.08);
  border-radius: 50%; opacity: .22;
}
.wiki-traffic-light i.red { background: #d85c52; }
.wiki-traffic-light i.yellow { background: #e8bc2e; }
.wiki-traffic-light i.green { background: #67a96e; }
.wiki-traffic-light i.active { opacity: 1; }
.wiki-traffic-light i.red.active { box-shadow: 0 0 0 3px rgba(216,92,82,.16), 0 0 18px rgba(216,92,82,.58); }
.wiki-traffic-light i.yellow.active { box-shadow: 0 0 0 3px rgba(232,188,46,.16), 0 0 18px rgba(232,188,46,.65); }
.wiki-traffic-light i.green.active { box-shadow: 0 0 0 3px rgba(103,169,110,.16), 0 0 18px rgba(103,169,110,.58); }
.wiki-signal-current > strong { display: block; font-size: 13px; }
.wiki-signal-current > p { margin: 4px auto 0; color: #68748a; font-size: 10px; line-height: 1.45; }
.wiki-signal-arrow { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--signal-blue); text-align: center; }
.wiki-signal-arrow span { font-size: 25px; line-height: 1; }
.wiki-signal-arrow small { color: #758198; font-size: 8px; line-height: 1.25; }
.wiki-signal-selection {
  position: relative; min-width: 0; padding: 17px; border: 2px solid var(--signal-blue);
  border-radius: 15px; background: var(--signal-blue-pale);
  box-shadow: inset 4px 0 0 var(--signal-blue), 0 9px 24px rgba(47,111,237,.13);
}
.wiki-signal-selection::before {
  content: ""; position: absolute; top: -7px; left: 18px; width: 12px; height: 12px;
  border-radius: 3px; background: var(--signal-blue); transform: rotate(45deg);
}
.wiki-signal-selection-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wiki-signal-selection-head > span { color: var(--signal-blue-dark); font-size: 9px; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.wiki-signal-selection-head .wiki-planning-level { flex: none; }
.wiki-signal-selection > strong { display: block; margin-top: 10px; font-size: 15px; }
.wiki-signal-selection > p { margin: 5px 0 0; color: #536178; font-size: 10.5px; line-height: 1.5; }
.wiki-signal-horizon {
  display: block; margin-top: 12px; padding-top: 9px; border-top: 1px solid rgba(47,111,237,.2);
  color: #61708a; font-size: 9px; font-weight: 800;
}
.wiki-signal-rule {
  display: flex; gap: 8px; margin-top: 22px; padding: 12px 14px; border-radius: 10px;
  background: #f3f5f8; color: #5c687e; font-size: 10.5px; line-height: 1.45;
}
.wiki-signal-rule b { color: #253149; white-space: nowrap; }
.wiki-signal-explanation { min-width: 0; }
.wiki-signal-explanation > h4 { margin: 7px 0 10px; font-size: clamp(22px, 3vw, 33px); line-height: 1.12; letter-spacing: -.025em; }
.wiki-signal-explanation > p { margin: 0; color: var(--stone-600); line-height: 1.65; }
.wiki-signal-explanation dl { margin: 22px 0 0; }
.wiki-signal-explanation dl div { padding: 10px 0; border-top: 1px solid var(--stone-200); }
.wiki-signal-explanation dt { display: flex; align-items: center; gap: 9px; color: var(--stone-900); font-size: 12px; font-weight: 800; }
.wiki-signal-explanation dt i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.wiki-signal-explanation dt i.green { background: #67a96e; }
.wiki-signal-explanation dt i.yellow { background: #e8bc2e; }
.wiki-signal-explanation dt i.red { background: #d85c52; }
.wiki-signal-explanation dt i.blue { border-radius: 3px; background: var(--signal-blue); transform: rotate(45deg); }
.wiki-signal-explanation dt i.unknown { background: #aab1bd; }
.wiki-signal-explanation dd { margin: 3px 0 0 20px; color: var(--stone-600); font-size: 11px; line-height: 1.45; }
.wiki-signal-explanation .wiki-signal-caption { margin-top: 16px; color: var(--stone-500); font-size: 10.5px; }

/* Planning-first app concept embedded in the Future article. The mockup uses
   native HTML so its hierarchy and narrow layout can be reviewed in place. */
.wiki-planning-mockup {
  --planning-blue: #2f6fed;
  --planning-blue-dark: #163a69;
  --planning-blue-pale: #eef4ff;
  display: grid; grid-template-columns: minmax(300px, 420px) minmax(240px, 1fr);
  gap: clamp(22px, 5vw, 64px); align-items: center; margin-top: 22px;
  padding: clamp(20px, 4vw, 42px); border: 1px solid #dce3ef; border-radius: 20px;
  background:
    radial-gradient(circle at 15% 18%, rgba(47,111,237,.11), transparent 30%),
    linear-gradient(145deg, #f4f7fc 0%, #fff 60%, #f7f8f4 100%);
  overflow: hidden;
}
.wiki-planning-stage { display: flex; justify-content: center; min-width: 0; }
.wiki-planning-device {
  width: min(100%, 382px); padding: 9px; border: 1px solid #161b26;
  border-radius: 30px; background: #171b24;
  box-shadow: 0 24px 55px rgba(27,34,50,.22), 0 5px 14px rgba(27,34,50,.16);
}
.wiki-planning-device-bar { display: flex; justify-content: center; height: 17px; }
.wiki-planning-device-bar span { width: 72px; height: 5px; border-radius: 99px; background: #343b48; }
.wiki-planning-screen {
  padding: 23px 20px 20px; border-radius: 21px; background: #f8fafc; color: #172033;
}
.wiki-planning-screen-kicker {
  color: #67738a; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase;
}
.wiki-planning-screen h4 { margin: 5px 0 4px; font-size: 25px; letter-spacing: -.025em; }
.wiki-planning-lead { margin: 0 0 20px; color: #647087; font-size: 12px; line-height: 1.5; }
.wiki-planning-field { margin-top: 15px; }
.wiki-planning-field-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; }
.wiki-planning-field-label b {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: #e9edf4; color: #4b5870; font-size: 10px;
}
.wiki-planning-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.wiki-planning-option {
  padding: 9px 5px; border: 1px solid #d8deea; border-radius: 9px; background: #fff;
  color: #566176; font-size: 11px; font-weight: 800; text-align: center;
}
.wiki-planning-option.selected {
  border-color: var(--planning-blue); background: var(--planning-blue-pale);
  color: var(--planning-blue-dark); box-shadow: inset 0 0 0 1px var(--planning-blue);
}
.wiki-planning-deadline {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 8px; padding: 11px 12px; border: 1px solid #d8deea; border-radius: 9px;
  background: #fff; font-size: 12px;
}
.wiki-planning-deadline span { color: #738097; font-size: 17px; }
.wiki-planning-answer { margin-top: 20px; }
.wiki-planning-answer-kicker {
  display: block; margin-bottom: 8px; color: #68748a; font-size: 9px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.wiki-planning-result {
  padding: 13px 14px; border: 1px solid #d8deea; border-radius: 12px; background: #fff;
}
.wiki-planning-result + .wiki-planning-result { margin-top: 8px; }
.wiki-planning-result.selected {
  border-color: var(--planning-blue); background: var(--planning-blue-pale);
  box-shadow: inset 3px 0 0 var(--planning-blue);
}
.wiki-planning-result.alternative { border-color: #b8d7bc; background: #f3faf3; }
.wiki-planning-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wiki-planning-result-label { color: #4e5a70; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.wiki-planning-result strong { display: block; margin-top: 7px; color: #192338; font-size: 14px; }
.wiki-planning-result p { margin: 4px 0 0; color: #657087; font-size: 10.5px; line-height: 1.45; }
.wiki-planning-level { padding: 4px 7px; border-radius: 99px; font-size: 9px; font-weight: 900; }
.wiki-planning-level.green { background: #dcefdc; color: #285d31; }
.wiki-planning-level.yellow { background: #fff0b8; color: #705600; }
.wiki-planning-level.red { background: #f5d7d4; color: #842d26; }
.wiki-planning-level.unknown { background: #e8ebf0; color: #596376; }
.wiki-planning-detail { margin-top: 9px; border-top: 1px solid #e0e5ed; }
.wiki-planning-detail summary {
  min-height: 38px; padding: 11px 2px 5px; color: var(--planning-blue-dark);
  font-size: 10.5px; font-weight: 800; cursor: pointer;
}
.wiki-planning-detail p { margin: 4px 0 5px; color: #657087; font-size: 10px; line-height: 1.5; }
.wiki-planning-timeline { margin-top: 16px; padding-top: 13px; border-top: 1px solid #e0e5ed; }
.wiki-planning-timeline-head { display: flex; justify-content: space-between; gap: 10px; color: #78849a; font-size: 8.5px; font-weight: 800; text-transform: uppercase; }
.wiki-planning-day { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center; margin-top: 8px; }
.wiki-planning-day > span { color: #606c82; font-size: 9.5px; font-weight: 800; }
.wiki-planning-day > div { display: flex; gap: 3px; height: 10px; }
.wiki-planning-day i { position: relative; flex: 1; min-width: 0; border-radius: 3px; }
.wiki-planning-day i.green { background: #73af78; }
.wiki-planning-day i.yellow { background: #e6bd37; }
.wiki-planning-day i.red { background: #ca6b61; }
.wiki-planning-day i.unknown { background: #aab1bd; }
.wiki-planning-day i.selected::after {
  content: ""; position: absolute; inset: -3px -2px; border: 2px solid var(--planning-blue); border-radius: 5px;
}
.wiki-planning-principles { min-width: 0; }
.wiki-planning-principles h4 { max-width: 470px; margin: 7px 0 10px; font-size: clamp(22px, 3vw, 34px); line-height: 1.12; letter-spacing: -.025em; }
.wiki-planning-principles > p { max-width: 520px; margin: 0; color: var(--stone-600); line-height: 1.65; }
.wiki-planning-principles dl { margin: 24px 0 0; }
.wiki-planning-principles dl div { padding: 14px 0; border-top: 1px solid var(--stone-200); }
.wiki-planning-principles dt { color: var(--stone-900); font-size: 13px; font-weight: 800; }
.wiki-planning-principles dd { margin: 4px 0 0; color: var(--stone-600); font-size: 12px; line-height: 1.5; }
.wiki-planning-principles .wiki-planning-caption { margin-top: 18px; color: var(--stone-500); font-size: 10.5px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1250px) {
  .wiki-process-map { min-height: 0; padding: 24px 28px; }
  .wiki-process-routes, .wiki-process-lane-label { display: none; }
  .wiki-process-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; gap: 14px; }
  .wiki-process-stage[data-process-position] { grid-column: auto; grid-row: auto; }
  .wiki-process-rhythms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiki-process-rhythms div:nth-child(2) { border-right: 0; }
  .wiki-process-rhythms div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.08); }
}
@media (max-width: 900px) {
  #app { flex-direction: column; }
  .guided-tour-video { grid-template-columns: 1fr; }
  aside {
    width: 100%; height: 68px; flex: none; position: sticky; top: 0; z-index: 30;
  }
  .side-brand { min-height: 68px; padding: 10px 14px; }
  .side-brand svg { width: 34px; }
  .dashboard-menu-toggle {
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    gap: 5px; width: 44px; height: 44px; margin-left: auto; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer;
    transition: color .2s ease, background .2s ease;
  }
  .dashboard-menu-toggle:hover, .dashboard-menu-toggle:focus-visible {
    color: var(--lime); background: rgba(205,219,40,.08); outline: none;
  }
  .dashboard-menu-toggle span {
    display: block; width: 19px; height: 1px; background: currentColor;
    transition: opacity .2s ease, transform .2s ease;
  }
  .dashboard-menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
  .dashboard-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .dashboard-menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
  .dashboard-mobile-menu {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    max-height: calc(100dvh - 68px); overflow-y: auto; background: rgba(28,25,23,.98);
    border-top: 1px solid var(--stone-800); border-bottom: 1px solid var(--stone-700);
    box-shadow: 0 24px 55px rgba(0,0,0,.35); backdrop-filter: blur(18px);
  }
  aside.mobile-menu-open .dashboard-mobile-menu { display: flex; }
  body.dashboard-menu-open { overflow: hidden; }
  nav { flex-direction: column; flex-wrap: nowrap; padding: 8px 10px 12px; overflow: visible; }
  nav .nav-group { display: block; }
  nav button { width: 100%; }
  nav button.active { box-shadow: inset 3px 0 0 var(--lime); }
  .side-user { padding: 12px 18px; }
  .topbar { position: static; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .tablewrap { margin: 0 -16px; padding: 0 16px; }
  .portfolio-review-controls { grid-template-columns: minmax(0, 1fr); }
  .portfolio-table { min-width: 960px; }
  .info-pop { max-width: calc(100vw - 32px); }
  .help-toolbar { flex-direction: column; align-items: flex-start; }
  .tour-invitation, .guided-tour-row { grid-template-columns: 1fr; }
  .tour-invitation-actions, .guided-tour-actions { justify-content: flex-start; }
  .wiki-intro, .wiki-article-head { flex-direction: column; }
  .wiki-intro-actions { align-items: flex-start; }
  .wiki-process-head, .wiki-process-detail-head, .wiki-process-detail-foot { flex-direction: column; }
  .wiki-process-head { padding: 22px 20px 18px; }
  .wiki-process-legend { justify-content: flex-start; }
  .wiki-process-map { padding: 20px; }
  .wiki-process-stages { grid-template-columns: minmax(0, 1fr); }
  .wiki-process-stage { min-height: 0; }
  .wiki-process-detail { margin: 0 20px; }
  .wiki-process-detail-foot { align-items: flex-start; }
  .wiki-process-rhythms { margin-left: 20px; margin-right: 20px; grid-template-columns: minmax(0, 1fr); }
  .wiki-process-rhythms div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .wiki-process-rhythms div:last-child { border-bottom: 0; }
  .wiki-process-guard { padding-left: 20px; padding-right: 20px; }
  .wiki-category-head { align-items: flex-start; }
  .wiki-card-grid { grid-template-columns: minmax(0, 1fr); }
  .wiki-meta { align-items: flex-start; }
  .wiki-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiki-facts div:nth-child(2) { border-right: 0; }
  .wiki-facts div:nth-child(-n+2) { border-bottom: 1px solid var(--stone-200); }
  .wiki-related-terms { flex-direction: column; gap: 8px; }
  .wiki-glossary-grid { grid-template-columns: minmax(0, 1fr); }
  .wiki-signal-mockup { grid-template-columns: minmax(0, 1fr); }
  .wiki-signal-explanation { max-width: 620px; }
  .wiki-planning-mockup { grid-template-columns: minmax(0, 1fr); }
  .wiki-planning-principles { max-width: 620px; }
}

@media (max-width: 500px) {
  .topbar { gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .topbar h1 { min-width: 0; flex: 1 0 calc(100% - 112px); }
  .topbar .pills { order: 5; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .topbar .pills button { flex: none; }
  .days-control { order: 6; }
  .content { padding-top: 16px; padding-bottom: 32px; }
  .card { padding: 16px; }
  .tablewrap { margin: 0 -16px; padding: 0 16px; }
  .dashboard-dialog-body { padding: 16px; }
  .dashboard-dialog-actions { padding: 0 16px 16px; }
  .wiki-sections { padding-left: 16px; padding-right: 16px; }
  .wiki-signal-mockup { margin-left: -16px; margin-right: -16px; padding: 16px 10px 24px; border-right: 0; border-left: 0; border-radius: 0; }
  .wiki-signal-app-card { padding: 20px 16px; }
  .wiki-signal-comparison { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .wiki-signal-arrow { transform: rotate(90deg); }
  .wiki-signal-arrow small { display: none; }
  .wiki-signal-rule { flex-direction: column; }
  .wiki-signal-rule b { white-space: normal; }
  .wiki-signal-explanation { padding: 0 8px; }
  .wiki-planning-mockup { margin-left: -16px; margin-right: -16px; padding: 16px 10px 24px; border-right: 0; border-left: 0; border-radius: 0; }
  .wiki-planning-device { border-radius: 25px; }
  .wiki-planning-screen { padding: 20px 16px 17px; }
  .wiki-planning-principles { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-orbit-ring { animation: none; }
  .wiki-process-routes path { animation: none; }
  .wiki-process-stage { transition: none; }
}
