/* =====================================================================
   IPF-Manager – modernes Design
   Ein Stylesheet für Rahmen, Formulare, Tabellen und Simulationsansicht.
   Systemschriften (keine externen Fonts → DSGVO-freundlich).
   ===================================================================== */

:root {
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-500: #4f5bd5;
  --brand-600: #3d47c0;
  --brand-700: #313a9c;
  --brand-900: #1b1f4b;
  --accent:    #f59e0b;
  --accent-600:#d97706;
  --success:   #10b981;
  --danger:    #e11d48;
  --danger-50: #fff1f2;

  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e5e7ef;
  --text:      #0f172a;
  --text-2:    #334155;
  --muted:     #64748b;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(27, 31, 75, .14);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Altvariablen, die von bestehenden Views genutzt werden */
  --primarycolor: var(--brand-600);
  --secondarycolor: var(--brand-500);
  --thirdcolor: var(--brand-100);
  --invertedtextcolor: #fff;
  --mainbackgroundcolor: var(--surface);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ---------------------------------------------------------------------
   App-Rahmen
   --------------------------------------------------------------------- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; margin-top: -2px; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: .85rem;
  color: var(--text-2);
  white-space: nowrap;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-500), #7c3aed);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang-switch a, .lang-switch span {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lang-switch span.is-active { background: var(--brand-600); color: #fff; }
.lang-switch a:hover { text-decoration: none; color: var(--brand-600); }

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  cursor: pointer;
  color: var(--text);
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 28px;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }

/* Seitennavigation */
.sidebar { position: sticky; top: 92px; align-self: start; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 12px; }
.nav a, .nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav button:hover { background: var(--surface); color: var(--brand-600); text-decoration: none; box-shadow: var(--shadow-sm); }
.nav a.active, .nav button.active { background: var(--brand-600); color: #fff; box-shadow: 0 6px 16px rgba(61, 71, 192, .28); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }

.sidebar-card {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--brand-700), var(--brand-900));
  color: #dfe3ff;
  font-size: .85rem;
}
.sidebar-card strong { color: #fff; display: block; margin-bottom: 4px; }

/* Inhalt */
.main { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.75rem; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card + .card { margin-top: 20px; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card-title { font-size: 1.15rem; margin-bottom: 4px; }
.card-sub { color: var(--muted); margin-bottom: 20px; }

.prose { color: var(--text-2); max-width: 75ch; }
.prose b, .prose strong { color: var(--text); }
.prose div[style] { height: auto !important; overflow: visible !important; }  /* Altlast: feste Scrollboxen */
.prose p { margin: 0 0 1em !important; line-height: 1.7 !important; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .85rem;
}
.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.footer-links a, .footer-links button { color: var(--text-2); font-weight: 550; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.footer-links a:hover, .footer-links button:hover { color: var(--brand-600); text-decoration: none; }
.footer form { margin: 0; display: inline; }

/* ---------------------------------------------------------------------
   Buttons & Formulare
   --------------------------------------------------------------------- */
.btn, button.btn, input.btn, div.button input, div.submitbutton input, .loginbutton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary, div.button input, div.submitbutton input, .loginbutton {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 6px 16px rgba(61, 71, 192, .25);
}
.btn-primary:hover, div.button input:hover, div.submitbutton input:hover, .loginbutton:hover { background: var(--brand-700); color: #fff; }
.btn-accent { background: var(--accent); color: #1f1300; box-shadow: 0 6px 16px rgba(245, 158, 11, .3); }
.btn-accent:hover { background: var(--accent-600); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand-200); color: var(--brand-600); }
.btn-block { width: 100%; }
.btn:disabled, div.submitbutton input:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label, .field > label, label.col-form-label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.input,
.card input[type="text"], .card input[type="email"], .card input[type="password"], .card input[type="number"], .card select, .card textarea,
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .card input:focus, .card select:focus, .card textarea:focus, .form-control:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-100);
}
.check { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.field-error, .invalid-feedback { color: var(--danger); font-size: .82rem; margin: 2px 0 0; padding: 0; list-style: none; }
.is-invalid { border-color: var(--danger) !important; }
.help { font-size: .85rem; color: var(--muted); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; border: 1px solid; }
.alert-danger { background: var(--danger-50); border-color: #fecdd3; color: #9f1239; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------------
   Startseite / Hero
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 44px;
  background:
    radial-gradient(1200px 400px at 110% -10%, rgba(124, 58, 237, .35), transparent 60%),
    radial-gradient(800px 300px at -10% 120%, rgba(16, 185, 129, .25), transparent 60%),
    linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #e6e8ff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}
.hero h1 { color: #fff; font-size: 2.1rem; max-width: 22ch; }
.hero p { color: #c9cdf7; max-width: 60ch; font-size: 1.05rem; }
.hero .btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.feature .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); margin-bottom: 12px; }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

/* Spielbeginn */
.start-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; align-items: stretch; }
.start-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, #eef2ff 0%, #f5f3ff 55%, #ecfeff 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.start-hero svg.illustration { width: 100%; height: auto; display: block; }
.start-hero .start-hero-body { padding: 0 28px 28px; }
.start-hero h2 { font-size: 1.45rem; margin-bottom: 6px; }
.start-hero p { color: var(--text-2); }
.action-list { display: grid; gap: 14px; }
.action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-200); text-decoration: none; color: var(--text); }
.action-card .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.action-card .icon svg { width: 24px; height: 24px; }
.action-card .icon.i-brand { background: var(--brand-50); color: var(--brand-600); }
.action-card .icon.i-green { background: #ecfdf5; color: #059669; }
.action-card .icon.i-amber { background: #fffbeb; color: #d97706; }
.action-card .icon.i-violet { background: #f5f3ff; color: #7c3aed; }
.action-card strong { display: block; font-size: 1rem; }
.action-card span { color: var(--muted); font-size: .88rem; }
.action-card .chev { margin-left: auto; color: var(--muted); }

/* Spiel laden */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game-card {
  position: relative;
  display: block;
  cursor: pointer;
  padding: 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.game-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.game-card input { position: absolute; opacity: 0; pointer-events: none; }
.game-card:has(input:checked) { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-100); }
.game-card .game-name { font-weight: 700; font-size: 1rem; margin-bottom: 8px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card .game-meta { color: var(--muted); font-size: .82rem; display: block; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 650; background: var(--brand-50); color: var(--brand-700); }
.badge.done { background: #ecfdf5; color: #047857; }
.progress { height: 6px; border-radius: 999px; background: var(--brand-50); overflow: hidden; margin: 10px 0 8px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), #7c3aed); border-radius: inherit; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Tabellen
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); padding: 12px 14px; border-bottom: 1px solid var(--border); }
table.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); }
table.table tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover td { background: #fafbff; }
.yes { color: var(--success); font-weight: 700; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.search { max-width: 280px; }

/* Glossar */
.glossar-letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; position: sticky; top: 64px; background: var(--surface); padding: 10px 0; z-index: 2; }
.glossar-letters a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 650; color: var(--text-2); }
.glossar-letters a:hover { background: var(--brand-600); color: #fff; text-decoration: none; border-color: var(--brand-600); }
.glossar-letter { font-size: 1.4rem; color: var(--brand-600); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-top: 28px; scroll-margin-top: 130px; }
.glossar-entry { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.glossar-entry h3 { margin-bottom: 4px; }
.glossar-entry p { margin: 0; color: var(--text-2); }

/* ---------------------------------------------------------------------
   Simulation
   --------------------------------------------------------------------- */
.sim-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sim-title h1 { margin: 0; font-size: 1.6rem; }
.period-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--brand-600); color: #fff; font-weight: 700; font-size: .85rem;
  box-shadow: 0 6px 16px rgba(61, 71, 192, .25);
}
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi .k { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-size: 1.3rem; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .v.neg { color: var(--danger); }

/* Untermenü (Tabs) */
#navi { margin-bottom: 14px; }
#navi .submenu { float: none; margin: 0; position: static; }
#navi .submenu ul { list-style: none; margin: 0; padding: 4px; display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
#navi .submenu li { margin: 0; }
#navi a.decision {
  display: inline-block;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
}
#navi a.decision:hover { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
#navi a.decision.active, a.decision.active { background: var(--brand-600); color: #fff; }

.sim-stage-wrap { overflow-x: auto; }
.sim-stage {
  position: relative;
  min-width: 760px;
  min-height: 520px;
  font-size: 13px;
}
#contentsim { position: relative; }

/* Fabrik + Produktlinien */
.factory {
  position: absolute;
  width: 740px;
  height: 470px;
  margin-top: 8px;
  padding: 18px 14px 14px;
  border: 1.5px dashed var(--brand-200);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcff, #f5f7ff);
}
.factorysqm, .productsqm {
  position: absolute;
  top: -11px;
  right: 12px;
  float: none;
  margin: 0;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.factorysqm img.addProperties { filter: brightness(0) invert(1); cursor: pointer; }
.product {
  position: relative;
  float: left;
  width: 160px;
  height: 435px;
  margin-right: 14px;
  padding: 16px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.product .productsqm { background: #64748b; }
.productname { font-weight: 750; color: var(--text); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.productcategory { color: var(--muted); font-size: .8rem; }
.order, .sell { text-align: center; color: var(--text-2); font-size: .8rem; }
.order [class^="MaterialOrder"], .sell [class^="price_p"], .production [class^="changecapacity"] {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c !important;
  font-weight: 750;
  cursor: pointer;
  border: 1px solid #fed7aa;
  transition: background .15s;
}
.order [class^="MaterialOrder"]:hover, .sell [class^="price_p"]:hover, .production [class^="changecapacity"]:hover { background: #ffedd5; }
.order [class^="MaterialOrder"] span, .sell [class^="price_p"] span { color: inherit !important; }
.rawstock, .production, .productswarehouse {
  margin-top: 6px;
  padding: 6px 4px;
  text-align: center;
  font-size: .8rem;
  border: 1px solid var(--brand-100);
  border-radius: 9px;
  background: var(--brand-50);
  color: var(--brand-900);
}
.production { background: linear-gradient(180deg, #eef2ff, #e0e7ff); font-weight: 650; }
.productinfo { margin-top: 14px; color: var(--muted); font-size: .74rem; line-height: 1.55; }
#arrowdown {
  position: relative;
  width: 2px !important;
  height: 12px !important;
  margin: 4px auto !important;
  background: var(--brand-200);
  border: 0 !important;
  transform: none !important;
  top: 0 !important;
}
#arrowdown::after {
  content: "";
  position: absolute;
  left: -4px !important;
  bottom: -4px;
  top: auto !important;
  width: 0 !important; height: 0 !important;
  margin: 0 !important;
  border-left: 5px solid transparent !important;
  border-right: 5px solid transparent !important;
  border-top: 6px solid var(--brand-500) !important;
  transform: none !important;
}
.addProduct { position: absolute; top: 412px; right: -12px; cursor: pointer; }
.addProduct img, .addMachine img {
  width: 22px !important; height: 22px;
  padding: 5px;
  border-radius: 50%;
  background: var(--brand-600);
  filter: none;
  box-shadow: 0 4px 10px rgba(61, 71, 192, .35);
}

/* Overlays (Eingaben) */
#overlaybackground {
  position: absolute;
  inset: 0;
  width: auto; height: auto;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(2px);
  z-index: 10;
}
#overlayframe { position: absolute; left: 0; right: 0; bottom: 20px; width: auto; z-index: 11; }
.overlay, .overlaynewproduct {
  position: absolute;
  left: 50%; right: auto;
  bottom: 0;
  transform: translateX(-50%);
  width: min(560px, 92%);
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 12;
}
.overlay label, .overlaynewproduct label { color: var(--text-2); font-weight: 600; font-size: .85rem; }
.overlay input[type="text"], .overlay input[type="number"], .overlay input[type="input"], .overlay select,
.overlaynewproduct input[type="text"], .overlaynewproduct select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: #fff;
}
.overlay input[type="range"] { accent-color: var(--brand-600); width: 100%; }

/* Periode abschließen */
.button.continue { position: absolute; right: 0; bottom: 0; margin: 0; }
.button.continue input, input.button.continue {
  background: var(--accent) !important;
  color: #1f1300 !important;
  box-shadow: 0 8px 20px rgba(245, 158, 11, .35) !important;
  border: 0;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
}
.button.continue input:hover { background: var(--accent-600) !important; color: #fff !important; }

/* Hinweise / Fehler unter der Bühne */
.sim-notes { margin-top: 14px; color: var(--danger); font-size: .9rem; }

/* Auswertungstabellen in der Simulation */
.sim-stage table { border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 4px 12px 12px 0; }
.sim-stage thead { background: var(--brand-600); }
.sim-stage thead th { color: #fff; font-weight: 650; }
.sim-stage td, .sim-stage th { font-size: 12.5px; padding: 6px 12px; text-align: left; }
.sim-stage td.number { text-align: right; font-variant-numeric: tabular-nums; }
.sim-stage tr.mark td, .sim-stage td.mark { background: var(--brand-50); font-weight: 650; color: var(--brand-900); }
.sim-stage tr.sum td { font-weight: 750; }
.sim-stage tr.total td, .sim-stage td.total { border-bottom: 1.5px solid var(--text); }
.sim-stage tfoot { background: var(--surface-2); }

/* Simulation-Hauptmenü (linke Navigation) */
#menu_decision ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

/* Charts im Iframe */
.chart-frame { width: 100%; height: 430px; border: 0; border-radius: var(--radius); background: var(--surface); }

/* Altklassen neutralisieren */
.hidden { display: none; }
.activatenewproduct, .newprice { display: none; }
#content img { border: 0; }

/* ---------------------------------------------------------------------
   Responsiv
   --------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 16px; padding: 16px 16px 32px; }
  .sidebar { position: static; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .nav a, .nav button { white-space: nowrap; width: auto; background: var(--surface); border: 1px solid var(--border); }
  .nav-title, .sidebar-card { display: none; }
  .topbar { padding: 0 16px; }
  .brand small { display: none; }
  .user-chip .uname { display: none; }
  .user-chip { padding: 4px; }
  .card { padding: 20px; border-radius: var(--radius); }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 1.6rem; }
  .form-row { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.4rem; }
}

/* KPI-Trends */
.kpi .trend { font-size: .78rem; font-weight: 700; margin-top: 2px; }
.kpi .trend.up { color: #059669; }
.kpi .trend.down { color: var(--danger); }
.kpi .trend.flat { color: var(--muted); }

/* Entscheidungsblöcke (Finanzen, Marketing, Forschung …) */
.sim-stage .form-group.row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  max-width: 720px; margin: 0 0 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.sim-stage .form-group.row > label { flex: 1 1 220px; font-weight: 650; color: var(--text); font-size: .9rem; }
.sim-stage .form-group.row [id^="showvalue"] { font-weight: 750; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.sim-stage .slidecontainer { flex: 1 1 100%; }
.sim-stage input[type="range"] { width: 100%; accent-color: var(--brand-600); height: 6px; }
.sim-stage input.form-control:not([type="range"]):not([type="radio"]):not([type="checkbox"]) { max-width: 260px; }
.sim-stage input[type="radio"], .sim-stage input[type="checkbox"] { width: auto; accent-color: var(--brand-600); }
.sim-card { padding: 20px; }

/* ---------------------------------------------------------------------
   Spielfläche: flexibles Layout (statt fester Pixelpositionen)
   --------------------------------------------------------------------- */
.sim-stage { min-width: 0; min-height: 0; }
#linie { position: relative; }
.factory {
  position: relative;
  width: auto;
  height: auto;
  min-height: 420px;
  margin-top: 12px;
  padding: 26px 16px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px;
}
.product {
  float: none;
  flex: 1 1 180px;
  max-width: 230px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 18px 14px 40px;
  transition: transform .15s, box-shadow .15s;
}
.product:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product > br { display: none; }
.productname { float: none !important; width: auto !important; display: block; white-space: normal; }
.productcategory { float: none !important; width: auto !important; display: block; margin-bottom: 12px !important; }
.addProduct { top: auto; bottom: 10px; right: 10px; }
.addProduct img { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(79,91,213,.45); } 50% { box-shadow: 0 0 0 8px rgba(79,91,213,0); } }

/* Fehler-/Hinweisbereich unter der Fabrik (Altlast mit festen Abständen) */
.sim-stage div[style*="margin-top:545px"] { float: none !important; margin: 14px 0 0 !important; color: var(--danger); }

/* „Periode abschließen“ */
.sim-stage .button.continue { position: static; display: flex; justify-content: flex-end; margin-top: 18px; }
.sim-stage .button.continue input { font-size: 1rem; padding: 14px 26px; }
.sim-stage .button.continue input:hover { transform: translateY(-1px); }

/* Tabellen in der Spielfläche horizontal scrollbar */
.sim-stage .bilanz, .sim-stage .guv { float: none; overflow-x: auto; }
.sim-stage table { display: block; overflow-x: auto; max-width: 100%; }

@media (max-width: 860px) {
  #menu_decision ul { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .sim-head { align-items: stretch; }
  .sim-head > div:last-child { flex: 1 1 100% !important; }
  .kpi .v { font-size: 1.1rem; }
  #navi .submenu ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #navi a.decision { white-space: nowrap; }
  .sim-card { padding: 12px; }
  .factory { padding: 24px 10px 10px; }
  .product { flex: 1 1 100%; max-width: none; }
  /* Eingaben als Bottom-Sheet */
  #overlaybackground { position: fixed; border-radius: 0; z-index: 60; }
  #overlayframe { position: static; }
  .overlay, .overlaynewproduct {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    transform: none;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    z-index: 61;
    animation: sheet-up .22s ease-out;
  }
  .sim-stage .button.continue { position: sticky; bottom: 12px; z-index: 5; }
  .sim-stage .button.continue input { width: 100%; }
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Wortmarke */
.brand svg { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 4px 12px rgba(91, 63, 217, .3); }
.wordmark { font-size: 1.12rem; font-weight: 500; color: var(--brand-600); letter-spacing: -.02em; }
.wordmark b { font-weight: 850; color: var(--text); }
.wordmark small { letter-spacing: .14em; text-transform: uppercase; font-size: .62rem; font-weight: 700; }

/* ---------------------------------------------------------------------
   Spielidee / Landingpage
   --------------------------------------------------------------------- */
.hero-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; }
.hero-visual { background: rgba(255,255,255,.96); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25); transform: rotate(1.2deg); animation: hero-in .9s cubic-bezier(.2,.8,.2,1) both; }
.hero-visual svg { display: block; width: 100%; height: auto; }
@keyframes hero-in { from { opacity: 0; transform: translateY(20px) rotate(3deg); } to { opacity: 1; transform: rotate(1.2deg); } }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 36px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow-sm); }
.stat .num { display: block; font-size: 2rem; font-weight: 850; letter-spacing: -.03em; background: linear-gradient(135deg, var(--brand-500), #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat > span:last-child { color: var(--muted); font-size: .85rem; font-weight: 600; }

.section { margin-bottom: 40px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 1.5rem; margin-bottom: 4px; }
.section-head p { color: var(--muted); margin: 0; }

.cycle { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.cycle-svg { width: 100%; max-width: 300px; }
.cy-ring { animation: cy-spin 9.6s linear infinite; transform-origin: 150px 150px; }
.cy-orbit { animation: cy-orbit 9.6s linear infinite; transform-origin: 150px 150px; }
@keyframes cy-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes cy-orbit { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.step strong { display: block; color: var(--text); }
.step div > span { display: block; color: var(--muted); font-size: .9rem; }
.step .step-icon { color: #fff; }
.step-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--brand-500), #7c3aed); color: #fff; box-shadow: 0 6px 14px rgba(79, 91, 213, .3); }
.step-icon svg { width: 22px; height: 22px; }
.step:nth-child(1) { animation: step-hl 9.6s 0s infinite; }
.step:nth-child(2) { animation: step-hl 9.6s 2.4s infinite; }
.step:nth-child(3) { animation: step-hl 9.6s 4.8s infinite; }
.step:nth-child(4) { animation: step-hl 9.6s 7.2s infinite; }
@keyframes step-hl { 0%, 25% { border-color: var(--brand-200); background: var(--brand-50); transform: translateX(6px); } 26%, 100% { border-color: var(--border); background: var(--surface-2); transform: none; } }

.area-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.area { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.area:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--fg); }
.area:hover .area-icon { transform: rotate(-8deg) scale(1.08); }
.area-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--bgc); color: var(--fg); margin-bottom: 12px; transition: transform .2s; }
.area-icon svg { width: 24px; height: 24px; }
.area h3 { margin-bottom: 4px; }
.area p { color: var(--muted); font-size: .9rem; margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split .card + .card { margin-top: 0; }
.checklist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-weight: 550; }
.tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #ecfdf5; color: #059669; flex: none; }
.barometer { background: linear-gradient(160deg, #0b1020, #161d3f); border-color: #1d2547; }
.barometer .card-title { color: #fff; }
.barometer .card-sub { color: #9aa3c7; }
.spark { width: 100%; height: auto; display: block; }
.candle { opacity: 0; transform: translateY(10px); transition: opacity .4s calc(var(--d) * 90ms), transform .4s calc(var(--d) * 90ms); }
.candle.in { opacity: 1; transform: none; }
.spark-line { stroke-dasharray: 400; stroke-dashoffset: 400; animation: spark-draw 2.4s 1s ease-out forwards; }
@keyframes spark-draw { to { stroke-dashoffset: 0; } }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 28px 32px; border-radius: var(--radius-lg); margin-bottom: 24px; background: linear-gradient(120deg, #fff7ed, #fef3c7); border: 1px solid #fde68a; }
.cta h2 { margin-bottom: 4px; }
.cta p { margin: 0; color: #78350f; }

details.more summary { cursor: pointer; font-weight: 700; color: var(--brand-600); list-style: none; display: flex; align-items: center; gap: 8px; }
details.more summary::before { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); }
details.more[open] summary::before { content: "–"; }

/* Einblenden beim Scrollen */
.landing .stat, .landing .area { opacity: 0; transform: translateY(14px); transition: opacity .5s calc(var(--d, 0) * 80ms), transform .5s calc(var(--d, 0) * 80ms), box-shadow .18s, border-color .18s; }
.landing .stat.in, .landing .area.in { opacity: 1; transform: none; }
.landing .area.in:hover { transform: translateY(-4px); }

@media (max-width: 1080px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-visual { transform: none; animation: none; }
}
@media (max-width: 860px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .cycle { grid-template-columns: 1fr; justify-items: center; padding: 20px; }
  .cycle-svg { max-width: 240px; }
  .area-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .cta { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .landing .stat, .landing .area, .candle { opacity: 1 !important; transform: none !important; }
  .spark-line { stroke-dashoffset: 0; }
}

/* Grid-Kinder dürfen schrumpfen (verhindert horizontales Überlaufen auf Mobilgeräten) */
.layout > *, .sidebar, .main, #menu_decision { min-width: 0; }
html, body { overflow-x: clip; }

/* ---------------------------------------------------------------------
   Bilanz
   --------------------------------------------------------------------- */
.bs { font-size: 14px; }
.bs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bs-head h2 { margin: 0; font-size: 1.35rem; }
.bs-badge { padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.bs-badge.ok { background: #ecfdf5; color: #047857; }
.bs-badge.warn { background: #fff7ed; color: #c2410c; }
.bs-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.bs-kpi { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.bs-kpi span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.bs-kpi strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.bs-meter { display: block; height: 5px; border-radius: 999px; background: var(--border); margin-top: 6px; overflow: hidden; }
.bs-meter b { display: block; height: 100%; background: linear-gradient(90deg, #7c3aed, #4f5bd5); border-radius: inherit; animation: bs-fill 1s ease-out both; }
@keyframes bs-fill { from { width: 0 !important; } }
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bs-side { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.bs-side header { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fbfcff, #f5f7ff); }
.bs-side h3 { margin: 0; font-size: 1.05rem; }
.bs-side header p { margin: 2px 0 10px; color: var(--muted); font-size: .8rem; }
.bs-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--border); }
.bs-bar span { display: block; height: 100%; transition: width .6s; animation: bs-grow .9s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
@keyframes bs-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bs-group { padding: 10px 16px 6px; }
.bs-group + .bs-group { border-top: 1px dashed var(--border); }
.bs-group-head { display: flex; justify-content: space-between; align-items: center; font-weight: 750; color: var(--text); margin-bottom: 4px; }
.bs-group-head i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.bs-share { font-size: .75rem; color: var(--muted); font-weight: 700; background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.bs-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0 5px 18px; color: var(--text-2); border-radius: 6px; }
.bs-row:hover { background: #fafbff; }
.bs-row.zero { color: #a0a9bd; }
.bs-row .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.bs-row .num.neg { color: var(--danger); }
.bs-subtotal { font-weight: 750; color: var(--text); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 7px; border-radius: 0; }
.bs-total { margin-top: auto; display: flex; justify-content: space-between; padding: 12px 16px; background: var(--brand-900); color: #fff; font-weight: 800; font-size: 1rem; }
.bs-total .num { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .bs-grid { grid-template-columns: 1fr; }
  .bs-kpis { grid-template-columns: 1fr 1fr; }
  .bs-kpis .bs-kpi:first-child { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------------
   Benutzerverwaltung
   --------------------------------------------------------------------- */
.um-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.um-stat { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.um-stat .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.um-stat .icon svg { width: 22px; height: 22px; }
.um-stat .icon.i-brand { background: var(--brand-50); color: var(--brand-600); }
.um-stat .icon.i-green { background: #ecfdf5; color: #059669; }
.um-stat .icon.i-violet { background: #f5f3ff; color: #7c3aed; }
.um-stat .icon.i-amber { background: #fffbeb; color: #d97706; }
.um-stat strong { display: block; font-size: 1.4rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.um-stat span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.um-card { padding: 0; overflow: hidden; }
.um-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px; border-bottom: 1px solid var(--border); }
.um-search { position: relative; flex: 1 1 240px; max-width: 340px; }
.um-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.um-search .input { padding-left: 38px; }
.um-filter { width: auto; min-width: 170px; }
.um-chips { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-left: auto; }
.chip { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font: inherit; font-size: .85rem; font-weight: 650; color: var(--text-2); cursor: pointer; }
.chip:hover { color: var(--brand-600); }
.chip.is-active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.um-bulk { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); color: var(--brand-900); animation: sheet-up .18s ease-out; position: sticky; top: 64px; z-index: 5; }
.um-bulk[hidden] { display: none; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 6px 16px rgba(225, 29, 72, .25); }
.btn-danger:hover { background: #be123c; color: #fff; }
.btn-icon { padding: 8px; }
.um-card .table-wrap { border: 0; border-radius: 0; }
.um-table td { vertical-align: middle; }
.um-table tbody tr { cursor: pointer; transition: background .12s; }
.um-table tbody tr.is-selected td { background: var(--brand-50) !important; }
.um-table tbody tr.is-disabled .um-user strong { color: var(--muted); text-decoration: line-through; }
.um-check { width: 44px; text-align: center !important; }
.um-check input { width: 18px; height: 18px; accent-color: var(--brand-600); cursor: pointer; }
.um-user { display: flex; align-items: center; gap: 12px; }
.um-user .avatar { width: 36px; height: 36px; font-size: .8rem; flex: none; }
.um-user strong { color: var(--text); }
.um-mail { display: block; color: var(--muted); font-size: .82rem; }
.um-table td.num { font-variant-numeric: tabular-nums; font-weight: 650; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; margin-right: 4px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.s-on { background: #ecfdf5; color: #047857; }
.status.s-off { background: #fff1f2; color: #be123c; }
.status.s-admin { background: #f5f3ff; color: #6d28d9; }
.um-actions { text-align: right; }
.modal { border: 0; border-radius: var(--radius-lg); padding: 28px; width: min(440px, 92vw); box-shadow: var(--shadow-lg); text-align: center; }
.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.modal[open] { animation: sheet-up .2s ease-out; }
.modal-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: #fff1f2; color: var(--danger); }
.modal h3 { margin-bottom: 6px; }
.modal p { color: var(--muted); }
@media (max-width: 1080px) { .um-stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .um-chips { margin-left: 0; overflow-x: auto; max-width: 100%; }
  .um-search { max-width: none; }
  .um-filter { flex: 1 1 100%; }
  .um-table th:nth-child(3), .um-table td:nth-child(3), .um-table th:nth-child(6), .um-table td:nth-child(6) { display: none; }
}
.um-toolbar select.um-filter { width: auto; flex: 0 0 200px; }
@media (max-width: 860px) { .um-toolbar select.um-filter { flex: 1 1 100%; } }

/* Profilseite (Breeze-Formulare) */
.profile-stack { display: grid; gap: 20px; max-width: 760px; }
.profile-stack .card + .card { margin-top: 0; }
.profile-stack header h2 { font-size: 1.15rem; margin-bottom: 2px; }
.profile-stack header p { color: var(--muted); font-size: .9rem; margin: 0; }
.profile-stack form { display: grid; gap: 16px; margin-top: 18px; }
.profile-stack .label { display: block; margin-bottom: 6px; }
.card-danger { border-color: #fecdd3; }
.card-danger header h2 { color: #9f1239; }

/* ---------------------------------------------------------------------
   Schieberegler (public/js/sliders.js)
   --------------------------------------------------------------------- */
.sim-stage .form-group.row:has(.range-ui) { gap: 6px 16px; padding: 16px 18px 12px; }
.range-value { font-size: 1.15rem; font-weight: 800; color: var(--brand-700); font-variant-numeric: tabular-nums; padding: 2px 12px; border-radius: 999px; background: var(--brand-50); }
.range-value.neg { color: #be123c; background: #fff1f2; }
.range-value.pos { color: #047857; background: #ecfdf5; }
.range-ui { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; }
.range-track { position: relative; flex: 1; display: flex; align-items: center; }
.range-btn {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 1.15rem; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.range-btn:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.range-btn:active { transform: translateY(1px); }
.sim-stage .range-track input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 10px; margin: 12px 0; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  /* Füllung bis zur Mitte des Knopfs: Knopfmitte = Knopf/2 + (Breite − Knopf) × Anteil */
  --thumb: 24px;
  --f0: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--from, 0));
  --f1: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--to, 0));
  background: linear-gradient(to right,
    #e5e7ef 0, #e5e7ef var(--f0),
    var(--brand-500) var(--f0), #7c3aed var(--f1),
    #e5e7ef var(--f1), #e5e7ef 100%);
  outline: none;
}
.sim-stage .range-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; box-sizing: border-box; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand-600); box-shadow: 0 2px 8px rgba(61, 71, 192, .35);
  transition: transform .12s;
}
.sim-stage .range-track input[type="range"]::-moz-range-thumb {
  box-sizing: border-box; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand-600); box-shadow: 0 2px 8px rgba(61, 71, 192, .35);
}
.sim-stage .range-track input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
.sim-stage .range-track input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--brand-100); }
.range-zero { position: absolute; top: 50%; width: 2px; height: 20px; margin-top: -10px; background: #94a3b8; border-radius: 2px; pointer-events: none; }
.range-scale { display: flex; justify-content: space-between; width: 100%; padding: 0 44px; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-scale-zero { font-weight: 700; color: var(--text-2); }
.sim-stage .slidecontainer { display: block; }

/* ---------------------------------------------------------------------
   Eingabe-Overlays (Preis, Bestellmenge, Kapazität, Produkt, Fläche)
   --------------------------------------------------------------------- */
.overlay .form-group.row, .overlaynewproduct .form-group.row {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  border: 0; padding: 0; margin: 0 0 10px; max-width: none; background: transparent;
}
.overlay .form-group.row > label, .overlaynewproduct .form-group.row > label { flex: none; font-size: .95rem; color: var(--text); line-height: 1.4; }
.overlay .col-md-6, .overlaynewproduct .col-md-6 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 650; color: var(--text-2); }
.overlay input[type="text"], .overlay input[type="number"], .overlay input[type="input"],
.overlaynewproduct input[type="text"], .overlaynewproduct input[type="number"] {
  width: 180px; padding: 10px 14px; font-size: 1.15rem; font-weight: 700; text-align: right;
  border: 1.5px solid var(--brand-200); border-radius: 10px; background: #fff;
}
.overlay input:focus, .overlaynewproduct input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }
.overlay::before, .overlaynewproduct::before {
  content: ""; display: block; width: 40px; height: 4px; margin: -8px auto 12px; border-radius: 999px; background: var(--border);
}
.overlaynewproduct label { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.decision_machine_block { float: none; width: auto; display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; margin: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.decision_machine_picture { height: 90px; width: auto; }

/* Spielparameter */
.param-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.param-grid .card + .card { margin-top: 0; }
.param-card .card-title, .card > .card-title { display: flex; align-items: center; gap: 10px; }
.card-title svg { color: var(--brand-600); }
.param-list { margin: 12px 0 0; display: grid; gap: 0; }
.param-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.param-list > div:last-child { border-bottom: 0; }
.param-list dt { color: var(--text-2); }
.param-list dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.param-list dd small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.param-list.compact > div { padding: 6px 0; font-size: .88rem; }
.param-list.stacked > div { flex-direction: column; align-items: flex-start; gap: 2px; }
.param-list.stacked dt { font-weight: 750; color: var(--text); }
.param-list.stacked dd { font-weight: 450; text-align: left; color: var(--text-2); }
.machine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.machine-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); text-align: center; }
.machine-card img { height: 110px; width: auto; object-fit: contain; mix-blend-mode: multiply; }
.machine-card h3 { margin: 8px 0 2px; }
.machine-card .param-list { text-align: left; }
@media (max-width: 860px) {
  .param-grid, .machine-grid { grid-template-columns: 1fr; }
}
.sim-stage input[type="range"].range-locked { pointer-events: none; opacity: .35; filter: grayscale(1); }
.range-value.is-off { color: var(--muted); background: var(--surface-2); }
.range-note { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.range-note::before { content: "ⓘ "; }
.sim-stage .form-group.row .range-value.pos { color: #047857; background: #ecfdf5; }
.sim-stage .form-group.row .range-value.neg { color: #be123c; background: #fff1f2; }
.sim-stage .form-group.row .range-value.is-off { color: var(--muted); background: var(--surface-2); }

/* Dialog-Knöpfe */
.overlay-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.overlay-actions .btn { padding: 10px 18px; }
@media (max-width: 860px) { .overlay-actions .btn { flex: 1; } }

/* ---------------------------------------------------------------------
   Kennzahlen (Analyse → Performance)
   --------------------------------------------------------------------- */
.kpi-group { margin-bottom: 18px; }
.kpi-group h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 0 10px; color: var(--text); }
.kpi-group h3 svg { color: var(--brand-600); }
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.kpi-tile { position: relative; padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.kpi-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); }
.kpi-tile.is-good::before { background: #10b981; }
.kpi-tile.is-ok::before { background: #f59e0b; }
.kpi-tile.is-bad::before { background: var(--danger); }
.kpi-tile.is-neutral::before { background: var(--brand-200); }
.kpi-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-tile-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi-dot { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.is-good .kpi-dot { background: #ecfdf5; color: #047857; }
.is-ok .kpi-dot { background: #fffbeb; color: #b45309; }
.is-bad .kpi-dot { background: #fff1f2; color: #be123c; }
.kpi-tile-value { font-size: 1.45rem; font-weight: 800; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-tile-value.neg { color: var(--danger); }
.kpi-tile-delta { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-tile-delta.up { color: #059669; } .kpi-tile-delta.down { color: var(--danger); } .kpi-tile-delta.flat { color: var(--muted); font-weight: 500; }
.kpi-tile-text { margin: 8px 0 0; font-size: .8rem; line-height: 1.45; color: var(--muted); }

/* ---------------------------------------------------------------------
   Marktorientierung (Informationen)
   --------------------------------------------------------------------- */
.mo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mo-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.mo-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.mo-seg { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.mo-seg + .mo-seg { margin-top: 10px; }
.mo-seg.is-active { background: linear-gradient(180deg, #fbfcff, var(--brand-50)); border-color: var(--brand-100); }
.mo-seg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mo-seg-name { font-weight: 750; }
.mo-badge { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-active .mo-badge { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.mo-bar { height: 10px; border-radius: 999px; background: #e5e7ef; overflow: hidden; margin: 10px 0 8px; }
.mo-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-500), #7c3aed); animation: bs-fill 1s ease-out both; }
.mo-stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mo-stats dt { font-size: .72rem; color: var(--muted); font-weight: 600; }
.mo-stats dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; font-size: .92rem; }
.mo-hint { margin: 8px 0 6px; font-size: .82rem; color: var(--muted); }
.mo-price { margin-top: 8px; font-size: .8rem; color: var(--text-2); }
@media (max-width: 860px) { .mo-grid { grid-template-columns: 1fr; } .mo-stats { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------------
   Auswahlkarten statt Radio-Buttons
   --------------------------------------------------------------------- */
.choice {
  position: relative; display: inline-flex; align-items: flex-start; gap: 10px;
  min-width: 140px; flex: 1 1 140px; padding: 12px 14px 12px 12px; margin: 0;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface);
  cursor: pointer; user-select: none; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.choice:hover { border-color: var(--brand-200); background: #fbfcff; }
.choice:active { transform: translateY(1px); }
.choice input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice-body { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.choice-body::before {
  content: ""; position: absolute; top: 13px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.choice-title { font-weight: 750; color: var(--text); padding-right: 26px; }
.choice-body small { font-size: .76rem; font-weight: 500; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.choice:has(input:checked) .choice-body::before { border-color: var(--brand-600); box-shadow: inset 0 0 0 4px #fff; background: var(--brand-600); }
.choice:has(input:checked) .choice-title { color: var(--brand-700); }
.choice:has(input:focus-visible) { outline: 3px solid var(--brand-200); outline-offset: 2px; }
.overlay .col-md-6:has(.choice), .overlaynewproduct .col-md-6:has(.choice) { gap: 10px; align-items: stretch; }

/* Dialoge auf dem Desktop: zentriertes Fenster mit eigener Scrollleiste */
@media (min-width: 861px) {
  #overlaybackground { position: fixed; inset: 0; border-radius: 0; z-index: 90; }
  #overlayframe { position: static; }
  .overlay, .overlaynewproduct {
    position: fixed; left: 50%; top: 50%; bottom: auto; right: auto;
    transform: translate(-50%, -50%);
    width: min(640px, 92vw); max-height: 86vh; overflow-y: auto;
    padding: 24px 26px 18px; border-radius: var(--radius-lg); z-index: 91;
    animation: dialog-in .18s ease-out;
  }
  .overlay::before, .overlaynewproduct::before { display: none; }
  .overlay-actions { position: sticky; bottom: -18px; margin: 16px -26px -18px; padding: 14px 26px 18px; background: var(--surface); }
}
@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@media (max-width: 860px) {
  .overlay-actions { position: sticky; bottom: -20px; background: var(--surface); padding-bottom: 6px; }
}

/* Maschinen-Infokarte in den Dialogen */
.machine-info { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.machine-info img { width: 150px; height: 110px; object-fit: contain; mix-blend-mode: multiply; }
.machine-info h4 { margin: 0 0 6px; font-size: .95rem; }
.machine-info dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.machine-info dl > div { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; border-bottom: 1px dashed var(--border); padding: 3px 0; }
.machine-info dt { color: var(--muted); }
.machine-info dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .machine-info { grid-template-columns: 1fr; } .machine-info img { margin: 0 auto; } .machine-info dl { grid-template-columns: 1fr; } }

/* Schalter statt Häkchen in Dialogen (neues Produkt, neue Maschine, Fläche) */
.overlay input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 46px; height: 26px; margin: 4px 0; border-radius: 999px; cursor: pointer;
  background: #d5d9e6; transition: background .2s;
}
.overlay input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .2s;
}
.overlay input[type="checkbox"]:checked { background: var(--brand-600); }
.overlay input[type="checkbox"]:checked::after { transform: translateX(20px); }
.overlay input[type="checkbox"]:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 2px; }
.overlay .form-group.row + .form-group.row, .overlay .form-group.row + div { margin-top: 8px; }

/* Einheitliche Abstände in Dialogen: jede Frage ist ein eigener Abschnitt */
.overlay .form-group.row, .overlaynewproduct .form-group.row { gap: 10px; margin: 0; padding: 0 0 18px; }
.overlay .form-group.row + .form-group.row,
.overlay .form-group.row + div > .form-group.row:first-child,
.overlay > div > .form-group.row:first-child { padding-top: 18px; border-top: 1px solid var(--border); }
.overlay .form-group.row > label.col-form-label { font-size: .95rem; font-weight: 700; color: var(--text); margin: 0; line-height: 1.4; }
.overlay .col-md-6 > p, .overlay .form-group.row > p { margin: 0; }
.overlay .machine-info { margin-top: 4px; margin-bottom: 18px; }
.overlay-actions { margin-top: 4px; }
.overlay .form-group.row, .overlaynewproduct .form-group.row { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; background: transparent; }

/* Spielparameter: einheitlicher Abstand zwischen allen Boxen */
.param-page { display: grid; gap: 20px; }
.param-page > p { margin: 0; }
.param-page .param-grid { margin: 0; }
.param-page .card { margin: 0; }
.param-page .card + .card { margin-top: 0; }
/* Maschinen freigestellt auf einer Bühne */
.machine-card { display: flex; flex-direction: column; padding: 0 0 16px; overflow: hidden; background: var(--surface); }
.machine-stage { position: relative; height: 150px; display: grid; place-items: end center; padding: 14px 16px 18px; background: radial-gradient(120% 90% at 50% 100%, #e0e7ff 0%, #f5f7ff 55%, #fbfcff 100%); border-bottom: 1px solid var(--border); }
.machine-stage::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 14px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(27, 31, 75, .22), transparent); }
.machine-stage img { position: relative; z-index: 1; height: 120px; width: 100%; object-fit: contain; object-position: center bottom; mix-blend-mode: normal; filter: drop-shadow(0 6px 10px rgba(27, 31, 75, .12)); transition: transform .25s; }
.machine-card:hover .machine-stage img { transform: translateY(-3px) scale(1.02); }
.machine-card h3, .machine-card .param-list { padding: 0 16px; }
.machine-card h3 { margin-top: 12px; }
.machine-info img, .decision_machine_picture, .info_machine_picture { mix-blend-mode: normal; }

/* ---------- Kursverwaltung ---------- */
.input-sm { padding: 7px 10px; font-size: .92rem; min-width: 0; width: 100%; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.btn-sm { padding: 7px 12px; font-size: .88rem; }
.course-table td { vertical-align: middle; }
.course-table tr.is-disabled td { background: var(--surface-2, rgba(0,0,0,.03)); }
.course-table tr.is-disabled input.input { color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border, #d0d5dd); transition: background .2s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--danger, #d92d20); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.switch-label { font-size: .9rem; color: var(--muted); }

/* ---------- Spielende ---------- */
.finish-card { display: flex; gap: 20px; align-items: flex-start; padding: 22px 24px; margin: 0 0 20px; border-radius: var(--radius, 16px);
  background: linear-gradient(135deg, rgba(250,204,21,.16), rgba(61,71,192,.10)); border: 1px solid rgba(250,204,21,.45); }
.finish-trophy { font-size: 3rem; line-height: 1; animation: finish-pop .7s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes finish-pop { from { transform: scale(.3) rotate(-20deg); opacity: 0 } to { transform: none; opacity: 1 } }
.finish-body h2 { margin: 0 0 6px; }
.finish-body > p { margin: 0 0 14px; color: var(--text-2); }
.finish-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.finish-stats > div { background: var(--surface, #fff); border-radius: 12px; padding: 10px 14px; min-width: 150px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.finish-stats dt { font-size: .8rem; color: var(--muted); }
.finish-stats dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 750; }
.finish-stats dd.pos { color: var(--success, #12b76a); } .finish-stats dd.neg { color: var(--danger, #d92d20); }
.finish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (max-width: 560px) { .finish-card { flex-direction: column; padding: 18px; } .finish-trophy { font-size: 2.4rem; } }
@media (prefers-reduced-motion: reduce) { .finish-trophy { animation: none; } }

/* =====================================================================
   Neu gestaltete Ansichten: GuV, Konditionen, Maschinen-Info,
   Anleitung und Impressum
   (Baut auf den Bausteinen der Bilanz .bs-*, den KPI-Kacheln .kpi-* und
   der Maschinenbühne .machine-* auf. Kein Dark Mode im Stylesheet.)
   ===================================================================== */

/* ---------- Gemeinsam ---------- */
.bs-kpi strong.neg, .guv .num.neg, .cond-value.neg { color: var(--danger); }

/* ---------- GuV (Staffel + Ergebnisbrücke) ---------- */
.guv-kpi-sub { display: block; margin-top: 2px; font-size: .78rem; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.guv-kpi-sub.neg { color: var(--danger); }
.guv-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.guv-op { display: inline-block; width: 14px; margin-right: 6px; color: var(--muted); font-weight: 700; text-align: center; }
.guv .bs-row { padding-left: 4px; }
.guv .bs-row .num { white-space: nowrap; }
.guv-line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; font-weight: 750; color: var(--text); }
.guv-line .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.guv-turnover { background: var(--brand-50); color: var(--brand-900); border-bottom: 1px solid var(--brand-100); }
.guv-turnover .guv-op, .guv-result .guv-op { color: var(--brand-600); }
.guv-result { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.guv-result + .bs-group { border-top: 0; }
.guv .bs-total.is-loss { background: #9f1239; }
.guv-bridge header { background: linear-gradient(180deg, #fbfcff, #f5f7ff); }
.guv-steps { list-style: none; margin: 0; padding: 14px 16px 16px; display: grid; gap: 14px; }
.guv-steps li { display: grid; gap: 5px; }
.guv-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .85rem; color: var(--text-2); }
.guv-step-head strong { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.guv-step-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.guv-step-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-500), #7c3aed); animation: bs-fill 1s ease-out both; }
.guv-steps li.is-final .guv-step-bar i { background: linear-gradient(90deg, #10b981, #059669); }
.guv-steps li.is-neg .guv-step-bar i { background: var(--danger); }
.guv-steps li small { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.guv-steps li.is-final { padding-top: 12px; border-top: 1px dashed var(--border); }
.guv-steps li.is-final .guv-step-head { font-weight: 750; color: var(--text); }

/* ---------- Konditionen ---------- */
.cond-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cond-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cond-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 12px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.cond-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-200); }
.cond-label { font-size: .82rem; font-weight: 650; color: var(--text-2); line-height: 1.35; }
.cond-value { font-size: 1.45rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.2; }
.cond-value small { margin-left: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.cond-raw { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cond-desc { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.cond-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.cond-market { display: grid; gap: 12px; }
.cond-split { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.cond-split-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-weight: 750; font-size: .9rem; color: var(--text); }
.cond-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .8rem; color: var(--text-2); }
.cond-legend b { font-variant-numeric: tabular-nums; }

/* ---------- Maschinen-Info ---------- */
.mach-grid { margin-top: 0; }
.mach-card { box-shadow: var(--shadow-sm); }
.mach-tier { position: absolute; top: 10px; left: 12px; z-index: 2; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 750; color: var(--brand-700); background: rgba(255, 255, 255, .85); border: 1px solid var(--brand-100); }
.mach-price { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0 16px 12px; }
.mach-price span:first-child { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mach-price strong { font-size: 1.5rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mach-price span:last-child { font-size: .8rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mach-cap { margin: 0 16px 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); text-align: left; }
.mach-cap-head { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--text-2); }
.mach-cap-head b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Anleitung ---------- */
.guide { display: grid; gap: 20px; }
.guide .card { margin: 0; }
.guide .card + .card { margin-top: 0; }
.guide .section-head { margin-bottom: 14px; }
.guide-hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: center;
  padding: 32px; border-radius: var(--radius-lg); color: #e6e8ff; box-shadow: var(--shadow-lg);
  background:
    radial-gradient(900px 340px at 110% -10%, rgba(124, 58, 237, .35), transparent 60%),
    radial-gradient(700px 260px at -10% 120%, rgba(16, 185, 129, .22), transparent 60%),
    linear-gradient(135deg, var(--brand-700), var(--brand-900));
}
.guide-hero .eyebrow { color: #c7d2fe; }
.guide-hero h2 { color: #fff; font-size: 1.6rem; max-width: 26ch; margin-bottom: 10px; }
.guide-hero p { color: #c9cdf7; max-width: 60ch; margin: 0; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.guide-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.guide-hero .btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }
.guide-hero .btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.guide-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.guide-facts li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font-weight: 650; }
.guide-facts svg { color: #fcd34d; flex: none; }
.guide-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.guide-note p { margin: 10px 0 0; color: var(--text-2); }
.guide-goal { background: linear-gradient(120deg, #fff7ed, #fef3c7); border-color: #fde68a; }
.guide-goal .card-title svg { color: var(--accent-600); }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.guide-steps li { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.guide-steps strong { display: block; color: var(--text); padding-right: 28px; }
.guide-steps p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.guide-step-no { position: absolute; top: 10px; right: 14px; font-size: 1.7rem; font-weight: 850; line-height: 1; color: var(--brand-100); }
.guide-areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.guide .checklist li { align-items: flex-start; }
.guide .checklist .tick { margin-top: 1px; }

/* ---------- Impressum ---------- */
.imprint { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.imprint .card { margin: 0; }
.imprint-legal { grid-column: 1; grid-row: 1; }
.imprint-contact { grid-column: 2; grid-row: 1; display: grid; gap: 12px; position: sticky; top: 84px; }
.imprint .eyebrow { margin-bottom: 12px; }
.imprint-contact .eyebrow { margin-bottom: 0; }
.imprint h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin: 0 0 8px; }
.imprint-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand-600); }
.imprint-sec + .imprint-sec { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
.imprint-body { color: var(--text-2); font-size: .92rem; line-height: 1.7; overflow-wrap: anywhere; }
.imprint-body p { margin: 0 !important; }
.imprint-legal .imprint-body { padding-left: 42px; max-width: none; }
.imprint-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.imprint-card:first-of-type { border-top: 3px solid var(--brand-600); }

/* ---------- Responsiv ---------- */
@media (max-width: 1080px) {
  .guide-steps, .guide-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .guv-grid, .cond-tiles, .cond-tiles-2, .guide-hero, .guide-split, .imprint { grid-template-columns: minmax(0, 1fr); }
  .guide-hero { padding: 22px; gap: 20px; }
  .guide-hero h2 { font-size: 1.35rem; }
  .imprint-legal, .imprint-contact { grid-column: auto; grid-row: auto; }
  .imprint-contact { position: static; }
  .imprint-legal .imprint-body { padding-left: 0; }
}
@media (max-width: 560px) {
  .guide-steps, .guide-areas { grid-template-columns: minmax(0, 1fr); }
  .guide-actions .btn { flex: 1 1 100%; justify-content: center; }
  .guv-line, .guv-steps { padding-left: 12px; padding-right: 12px; }
  .cond-value { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .guv-step-bar i { animation: none; }
}

/* ---------- Rangliste pro Kurs & Kursübersicht ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.rank-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.rank-head .help { max-width: 640px; }
.rank-select .input { min-width: 220px; }
.rank-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; color: var(--text-2); font-size: .92rem; }
.rank-you-pill { margin-left: auto; padding: 5px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--brand-500), #7c3aed); color: #fff; font-weight: 700; font-size: .85rem; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; margin: 8px 0 22px; }
.podium-place { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; animation: podium-up .6s cubic-bezier(.2,1.2,.4,1) both; }
.podium-place.p1 { animation-delay: .15s; } .podium-place.p3 { animation-delay: .3s; }
@keyframes podium-up { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }
.podium-medal { font-size: 2.2rem; line-height: 1; margin-bottom: 6px; }
.podium-place.p1 .podium-medal { font-size: 2.8rem; }
.podium-company { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-player { font-size: .82rem; color: var(--muted); }
.podium-price { font-size: 1.25rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.podium-gain { font-size: .85rem; font-weight: 700; margin-bottom: 8px; }
.podium-block { width: 100%; border-radius: 14px 14px 6px 6px; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; color: #fff; font-weight: 850; font-size: 1.6rem;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-700)); box-shadow: var(--shadow-sm); }
.podium-place.p1 .podium-block { height: 120px; background: linear-gradient(180deg, #fbbf24, #d97706); }
.podium-place.p2 .podium-block { height: 90px; background: linear-gradient(180deg, #cbd5e1, #94a3b8); }
.podium-place.p3 .podium-block { height: 66px; background: linear-gradient(180deg, #fdba74, #c2410c); }
.podium-place.is-you .podium-company::after { content: " ★"; color: var(--brand-600); }
.pos { color: var(--success, #12b76a); } td.neg, .neg { color: var(--danger, #e11d48); }
.rank-table td, .ov-table td { vertical-align: middle; }
.rank-table .num, .ov-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-table tr.is-you td { background: var(--brand-50); }
.rank-table tr.is-you td:first-child { box-shadow: inset 3px 0 0 var(--brand-600); }
.sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.rank-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; background: var(--surface-2); color: var(--text-2); }
.rank-no.r1 { background: #fef3c7; color: #b45309; } .rank-no.r2 { background: #f1f5f9; color: #475569; } .rank-no.r3 { background: #ffedd5; color: #c2410c; }
.rank-progress { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.rank-progress .progress { flex: 1; height: 6px; margin: 0; }
.rank-progress span { font-size: .8rem; color: var(--text-2); white-space: nowrap; }
.ov-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
.ov-kpis small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.ov-filter { margin-left: 0; flex-wrap: wrap; }
.ov-filter .chip { text-decoration: none; }
.ov-filter .chip b { margin-left: 4px; color: var(--muted); font-weight: 700; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.st-active { background: #dcfce7; color: #15803d; } .st-inactive { background: #fef3c7; color: #b45309; }
.st-finished { background: var(--brand-50); color: var(--brand-700); } .st-none { background: var(--surface-2); color: var(--muted); }
@media (max-width: 900px) { .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .podium { gap: 8px; } .podium-price { font-size: 1rem; } .podium-medal { font-size: 1.8rem; } .podium-place.p1 .podium-medal { font-size: 2.2rem; }
  .podium-place.p1 .podium-block { height: 90px; } .podium-place.p2 .podium-block { height: 68px; } .podium-place.p3 .podium-block { height: 50px; }
  .rank-you-pill { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .podium-place { animation: none; } }
.rank-hint { margin-left: auto; padding: 5px 12px; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 650; font-size: .85rem; }
@media (max-width: 560px) { .rank-hint { margin-left: 0; } }
@media (max-width: 560px) { .hide-sm { display: none; } }
.ov-table th { white-space: nowrap; }

/* ---------- Live-Budget im Spiel ---------- */
.budget { position: sticky; top: 72px; z-index: 6; margin: 0 0 16px; border-radius: 14px; background: var(--surface, #fff);
  border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(15, 23, 42, .06); transition: border-color .2s, background .2s; }
.budget-main { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.budget-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); flex: none; transition: background .2s, color .2s; }
.budget-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.budget-label { font-weight: 700; font-size: .92rem; }
.budget-hint { font-size: .8rem; color: var(--muted); }
.budget-value { font-size: 1.35rem; font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em; }
.budget-toggle { border: 1px solid var(--border); background: var(--surface-2); border-radius: 9px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 650; color: var(--text-2); cursor: pointer; }
.budget-toggle:hover { color: var(--brand-700); border-color: var(--brand-200, #c7d2fe); }
.budget.is-low { border-color: #fcd34d; background: #fffbeb; }
.budget.is-low .budget-icon { background: #fef3c7; color: #b45309; }
.budget.is-low .budget-hint { color: #92400e; }
.budget.is-neg { border-color: #fda4af; background: #fff1f2; }
.budget.is-neg .budget-icon { background: #ffe4e6; color: #be123c; }
.budget.is-neg .budget-value, .budget.is-neg .budget-hint { color: #be123c; }
.budget.is-neg .budget-hint { font-weight: 650; }
.budget-details { padding: 4px 16px 14px; border-top: 1px dashed var(--border); }
.budget-details dl { margin: 10px 0; display: grid; gap: 2px; }
.budget-details dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: .88rem; }
.budget-details dt { color: var(--text-2); }
.budget-details dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.budget-details .is-decision dt { color: var(--brand-700); font-weight: 600; }
.budget-details .is-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-weight: 800; }
.budget-details .is-total dt { color: var(--text); font-weight: 800; }
.budget-next { font-size: .85rem; margin: 0 0 6px; color: var(--text-2); }
.budget-details dd.neg, .budget-next .neg { color: var(--danger, #e11d48); }
@media (max-width: 560px) {
  .budget { top: 60px; }
  .budget-main { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
  .budget-icon { width: 32px; height: 32px; }
  .budget-text { flex: 1 1 60%; }
  .budget-value { font-size: 1.15rem; }
  .budget-toggle { margin-left: auto; }
  .budget-details dl > div { flex-direction: column; gap: 0; }
}

/* ---------- Fokussierte Einzelseiten (z. B. Pflicht-Passwortänderung) ---------- */
.focus-body { min-height: 100vh; margin: 0; background: radial-gradient(1200px 600px at 50% -10%, var(--brand-50), transparent 70%), var(--bg, #f5f6fb); }
.focus-wrap { max-width: 440px; margin: 0 auto; padding: 48px 16px 32px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.focus-logo { display: flex; justify-content: center; }
.focus-card { width: 100%; padding: 28px 28px 24px; box-sizing: border-box; }
.focus-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--brand-500), #7c3aed); color: #fff; box-shadow: 0 8px 20px rgba(61, 71, 192, .3); }
.focus-card h1 { margin: 0 0 8px; font-size: 1.45rem; letter-spacing: -.02em; }
.focus-lead { margin: 0 0 20px; color: var(--text-2); line-height: 1.55; }
.focus-card .btn-block { margin-top: 6px; }
.focus-foot { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 650; color: var(--brand-600); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--brand-700); }
@media (max-width: 480px) { .focus-wrap { padding-top: 28px; } .focus-card { padding: 22px 18px; } }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.pw-rules li { display: inline-flex; align-items: center; gap: 6px; transition: color .15s; }
.pw-rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); box-sizing: border-box; transition: all .15s; }
.pw-rules li.is-ok { color: #047857; font-weight: 600; }
.pw-rules li.is-ok::before { border-color: var(--success, #10b981); background: var(--success, #10b981) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/10px no-repeat; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------- Glossar: Suche und Seitenleiste im Spiel ---------- */
.glossar-search { position: relative; margin: 0 0 14px; }
.glossar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.glossar-search .input { padding-left: 40px; }
.glossar-empty { color: var(--muted); padding: 12px 0; }
.glossar-group[hidden], .glossar-entry[hidden], .glossar-letters[hidden] { display: none; }
.nav-secondary { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 90; opacity: 0; transition: opacity .2s; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 91; background: var(--surface, #fff);
  box-shadow: -12px 0 40px rgba(15, 23, 42, .18); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease-out; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.drawer-close { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 10px; font-size: 1.4rem; line-height: 1; color: var(--text-2); cursor: pointer; }
.drawer-close:hover { background: var(--brand-50); color: var(--brand-700); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; overscroll-behavior: contain; }
.drawer-body .glossar-search { position: sticky; top: -16px; z-index: 1; background: var(--surface, #fff); padding: 16px 0 8px; margin-top: -16px; }
body.drawer-locked { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { transition: none; } }
.drawer-body .glossar-letters { position: static; padding: 0; margin-bottom: 8px; }
.drawer-body .glossar-letter { scroll-margin-top: 70px; }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }

/* ---------- Plus-Dialoge (neues Produkt, Fläche): Schalter entfällt, Titel bleibt ---------- */
.overlay .optin-row > div { display: none; }
.overlay .optin-row > label { font-size: 1.1rem; font-weight: 750; color: var(--text); padding: 0; margin: 0; max-width: none; flex: 1 1 100%; text-align: left !important; }
.optin-remove { text-align: center; margin: 10px 0 0; font-size: .88rem; }
.optin-remove .link-btn { color: var(--danger, #e11d48); }
.overlay .optin-row > label { pointer-events: none; }

/* ---------- Spiel: Kennzahlen in der Kopfzeile (Desktop) ---------- */
.topbar-kpis { display: none; }
@media (min-width: 1200px) {
  .topbar-kpis { display: flex; align-items: stretch; gap: 4px; margin-left: 28px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
  .tk { display: grid; grid-template-columns: auto auto; grid-template-areas: "k k" "v t"; align-items: baseline; column-gap: 8px; padding: 4px 12px; border-radius: 9px; min-width: 0; }
  .tk + .tk { border-left: 1px solid var(--border); border-radius: 0; }
  .tk-k { grid-area: k; font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
  .tk-v { grid-area: v; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
  .tk-v.neg { color: var(--danger); }
  .tk-t { grid-area: t; font-size: .72rem; font-weight: 700; white-space: nowrap; }
  .tk-t.up { color: #059669; } .tk-t.down { color: var(--danger); } .tk-t.flat { color: var(--muted); }
  .kpis-compact-hide { display: none; }
  /* Budget direkt unter der Kopfzeile, wenn die Kacheln entfallen */
  .budget { top: 76px; }
}
@media (min-width: 1200px) and (max-width: 1380px) {
  .topbar-kpis { margin-left: 16px; } .tk { padding: 4px 9px; } .tk-v { font-size: .92rem; }
  .topbar .wordmark small { display: none; }
}
@media (max-width: 1024px) { .nav-secondary { margin-top: 0; padding-top: 0; border-top: 0; } }

/* ---------- Kopfzeile: Benutzermenü und Kennzahlen (Desktop-Leiste / aufklappbar) ---------- */
.chev-down { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .55; transition: transform .15s; flex: none; }
[data-menu].is-open .chev-down { transform: rotate(-135deg) translate(-2px, 0); }
.user-menu, .topbar-kpis-wrap { position: relative; }
button.user-chip { cursor: pointer; font: inherit; font-size: .85rem; padding-right: 14px; }
button.user-chip:hover, .user-menu.is-open button.user-chip { border-color: var(--brand-200, #c7d2fe); color: var(--text); }
.menu-panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 270px; z-index: 80; padding: 6px;
  background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .16); }
.user-menu.is-open .menu-panel { display: block; animation: menu-in .14s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-head strong { display: block; font-size: .92rem; }
.menu-head small { display: block; font-size: .78rem; color: var(--muted); word-break: break-all; }
.avatar-lg { width: 38px; height: 38px; font-size: .85rem; flex: none; }
.menu-panel a, .menu-panel .menu-logout button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px;
  color: var(--text-2); font: inherit; font-size: .9rem; font-weight: 550; background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none; }
.menu-panel a:hover, .menu-panel a:focus-visible, .menu-panel .menu-logout button:hover, .menu-panel .menu-logout button:focus-visible { background: var(--brand-50); color: var(--brand-700); outline: none; }
.menu-panel svg { color: var(--muted); flex: none; }
.menu-logout { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.menu-logout button { color: var(--danger, #e11d48) !important; }
.menu-logout button svg { color: currentColor; }

/* Kennzahlen */
.tk-toggle { display: none; }
.tk-title { display: none; }
@media (max-width: 1199px) {
  .tk-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    font: inherit; font-size: .85rem; font-weight: 750; color: var(--text); cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .tk-toggle svg { color: var(--brand-600); }
  .tk-toggle .tk-t { font-size: .7rem; }
  .tk-toggle .tk-t.up { color: #059669; } .tk-toggle .tk-t.down { color: var(--danger); }
  .topbar-kpis-wrap { margin-left: 8px; }
  .topbar-kpis-wrap.is-open .topbar-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: absolute; left: 0; top: calc(100% + 10px); width: 340px; z-index: 80;
    padding: 12px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .16); animation: menu-in .14s ease-out; }
  .topbar-kpis-wrap.is-open .tk-title { display: block; grid-column: 1 / -1; margin: 0 0 2px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
  .topbar-kpis-wrap.is-open .tk { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
  .topbar-kpis-wrap.is-open .tk-k { font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .topbar-kpis-wrap.is-open .tk-v { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  .topbar-kpis-wrap.is-open .tk-v.neg { color: var(--danger); }
  .topbar-kpis-wrap.is-open .tk-t { font-size: .74rem; font-weight: 700; }
  .topbar-kpis-wrap.is-open .tk-t.up { color: #059669; } .topbar-kpis-wrap.is-open .tk-t.down { color: var(--danger); } .topbar-kpis-wrap.is-open .tk-t.flat { color: var(--muted); }
}
@media (max-width: 600px) {
  .topbar-kpis-wrap { position: static; }
  .topbar-kpis-wrap.is-open .topbar-kpis { left: 12px; right: 12px; width: auto; }
  .topbar:has(.topbar-kpis-wrap) .wordmark { display: none; }
  .user-chip .chev-down { display: none; }
  .menu-panel { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
}

/* Sprachwahl im Footer */
.footer-lang .lang-switch { font-size: .8rem; }
@media (max-width: 600px) { .footer-inner { justify-content: center; text-align: center; } }

/* ---------- Neues Produkt: geplante Karte, Platzanzeige ---------- */
.product.product-planned { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--brand-500); background: repeating-linear-gradient(135deg, var(--brand-50), var(--brand-50) 10px, #fff 10px, #fff 20px); padding: 18px 14px; min-height: 180px; }
.product.product-planned:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 2px; }
.planned-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--brand-600); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.planned-name { font-size: 1.05rem; word-break: break-word; }
.planned-meta { font-size: .82rem; color: var(--text-2); }
.planned-delivery { font-size: .78rem; font-weight: 650; color: var(--brand-700); }
.planned-hint { font-size: .74rem; color: var(--muted); }
.np-free { flex: 1 1 100%; margin: -4px 0 6px; font-size: .85rem; color: var(--text-2); }
.choice.is-disabled { opacity: .5; cursor: not-allowed; }
.choice.is-disabled input { pointer-events: none; }
.choice-warn { display: block; margin-top: 2px; color: var(--danger, #e11d48) !important; font-weight: 650; }
.alert-list { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Periode abschließen in der Kopfzeile ---------- */
.topbar-close { padding: 9px 16px; font-size: .9rem; white-space: nowrap; margin-right: 4px; flex: none; }
.topbar-close .tc-short { display: none; }
@media (max-width: 1380px) { .topbar-close .tc-long { display: none; } .topbar-close .tc-short { display: inline; } }
@media (max-width: 600px) { .topbar-close { padding: 8px 12px; } .topbar { gap: 8px; padding: 0 12px; } }
@media (max-width: 400px) { .topbar-close .tc-short { display: none; } .topbar-close { padding: 9px; } }
.confirm-dialog { border: 0; padding: 0; border-radius: 18px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(15, 23, 42, .3); color: var(--text); }
.confirm-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.confirm-dialog form { padding: 26px 26px 20px; margin: 0; }
.confirm-dialog[open] { animation: menu-in .16s ease-out; }
.cd-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #fef3c7; color: #b45309; margin-bottom: 12px; }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 1.25rem; }
.confirm-dialog p { margin: 0 0 10px; color: var(--text-2); line-height: 1.5; }
.cd-budget strong { color: var(--text); font-variant-numeric: tabular-nums; }
.cd-warn { padding: 10px 12px; border-radius: 10px; background: #fff1f2; color: #be123c !important; font-weight: 650; font-size: .9rem; }
.cd-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.focus-legal { margin: 0; font-size: .8rem; } .focus-legal a { color: var(--muted); }

/* ---------- Hilfe-Karten der Entscheidungen ---------- */
.help-card { margin: 18px 0 4px; padding: 18px 20px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.help-card-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 22px; align-items: center; }
.help-lead { margin: 0 0 10px; font-size: 1.02rem; font-weight: 700; color: var(--text); }
.help-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.help-points li { position: relative; padding-left: 26px; color: var(--text-2); line-height: 1.5; font-size: .93rem; }
.help-points li::before { content: ""; position: absolute; left: 0; top: .2em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/9px no-repeat; }
.help-sub { margin: 18px 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.help-quote { margin: 16px 0 0; padding: 12px 16px; border-left: 4px solid var(--accent, #f59e0b); background: #fffbeb; border-radius: 0 10px 10px 0; font-style: italic; color: #78350f; line-height: 1.5; }
.help-quote cite { display: block; margin-top: 6px; font-style: normal; font-size: .82rem; color: #92400e; }
.help-figure { margin: 0; padding: 12px; background: var(--surface, #fff); border-radius: 12px; border: 1px solid var(--border); }
.help-figure svg { width: 100%; height: auto; display: block; }
.help-figure figcaption { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 4px; }
.mkt-curve { stroke-dasharray: 260; stroke-dashoffset: 260; animation: mkt-draw 1.2s .2s ease-out forwards; }
@keyframes mkt-draw { to { stroke-dashoffset: 0; } }
.help-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.help-stats > div { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.help-stats span { display: block; font-size: .78rem; color: var(--muted); }
.help-stats strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.invest-status { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.is-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.is-badge { padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #fef3c7; color: #92400e; }
.invest-status.is-reached .is-badge { background: #dcfce7; color: #15803d; }
.is-effect { font-size: .85rem; font-weight: 650; color: var(--text-2); }
.is-bar { position: relative; height: 10px; border-radius: 999px; background: #e5e7ef; overflow: hidden; }
.is-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; }
.is-now { background: linear-gradient(90deg, var(--brand-500), #7c3aed); }
.invest-status.is-reached .is-now { background: linear-gradient(90deg, #10b981, #059669); }
.is-plan { background: repeating-linear-gradient(135deg, rgba(124, 58, 237, .45), rgba(124, 58, 237, .45) 4px, rgba(124, 58, 237, .2) 4px, rgba(124, 58, 237, .2) 8px); border-radius: 0 999px 999px 0; transition: width .15s, left .15s; }
.is-nums { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: .84rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.is-hint { margin: 6px 0 0; font-size: .82rem; color: var(--brand-700); font-weight: 600; min-height: 1.2em; }
@media (max-width: 760px) { .help-card-split { grid-template-columns: 1fr; } .help-stats { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mkt-curve { animation: none; stroke-dashoffset: 0; } }

/* ---------- Spielidee: ausführliche Beschreibung ---------- */
.idea-long { margin-top: 18px; display: grid; gap: 26px; color: var(--text-2); line-height: 1.6; }
.idea-long p { margin: 0 0 10px; }
.il-head h2 { margin: 0; font-size: 1.35rem; color: var(--text); }
.il-sub { margin: 4px 0 0 !important; color: var(--brand-700); font-weight: 600; }
.il-intro p:first-child { font-size: 1.05rem; color: var(--text); font-weight: 550; }
.il-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.il-box { padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.il-box h3, .il-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.05rem; color: var(--text); }
.il-box h3 svg { color: var(--brand-600); }
.il-questions { background: #fffbeb; border-color: #fde68a; }
.il-questions h3 svg { color: #b45309; }
.il-questions ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.il-questions li { padding: 8px 12px; background: #fff; border-radius: 10px; border: 1px solid #fde68a; font-weight: 600; color: #78350f; font-size: .93rem; }
.il-questions li::before { content: "? "; color: #d97706; font-weight: 800; }
.il-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: flow; }
.il-flow li { counter-increment: flow; position: relative; padding: 42px 14px 14px; border-radius: 14px; background: var(--surface, #fff); border: 1px solid var(--border); font-size: .9rem; }
.il-flow li::before { content: counter(flow); position: absolute; top: 12px; left: 14px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-500), #7c3aed); color: #fff; font-size: .8rem; font-weight: 800; }
.il-flow strong { display: block; color: var(--text); margin-bottom: 4px; }
.il-note { margin-top: 10px !important; font-size: .88rem; color: var(--muted); }
.il-learn { grid-template-columns: 1fr 1fr; column-gap: 24px; }
.il-areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.il-area { padding: 16px; border-radius: 14px; background: var(--surface, #fff); border: 1px solid var(--border); }
.il-area h4 { margin: 10px 0 6px; color: var(--text); font-size: .98rem; }
.il-area p { font-size: .88rem; margin: 0; }
.il-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--brand-50); color: var(--brand-700); flex: none; }
.il-share { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, var(--brand-50), #f5f3ff); border: 1px solid var(--brand-100, #e0e7ff); }
.il-share h3 { margin: 2px 0 6px; color: var(--text); font-size: 1.05rem; }
.il-share p { margin: 0; }
@media (max-width: 900px) { .il-flow { grid-template-columns: 1fr 1fr; } .il-areas { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .il-two, .il-flow, .il-areas, .il-learn { grid-template-columns: 1fr; } }

/* ---------- Liquidität: Zinsen und Erträge ---------- */
.fin-info { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.fi-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.fi-chip { font-size: .85rem; color: var(--text-2); }
.fi-chip strong { color: var(--text); }
.fi-note { font-size: .8rem; font-weight: 650; color: #b45309; background: #fef3c7; padding: 2px 8px; border-radius: 999px; }
.fi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.fi-grid > div { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.fi-grid dt { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.fi-grid dd { margin: 2px 0 0; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fi-grid dd.neg { color: var(--danger, #e11d48); } .fi-grid dd.pos { color: #059669; }
.fin-info .fi-live { border-style: dashed; }
.fin-info.is-changed .fi-live { border: 1px solid var(--brand-500); background: var(--brand-50); }
.fi-hint { margin: 8px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.45; }
@media (max-width: 760px) { .fi-grid { grid-template-columns: 1fr 1fr; } }

/* Footer bei kurzen Seiten immer am unteren Fensterrand */
.app > .footer { margin-top: auto; }

/* ---------- P-Linie: Fläche erweitern / neues Produkt als richtige Knöpfe ---------- */
.factory-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: -4px 0 14px; flex: 1 1 100%; width: 100%; }
.fh-info { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--text-2); }
.fh-info svg { color: var(--brand-600); }
.fh-info strong { color: var(--text); }
.factory-head button.addProperties { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--brand-600); background: var(--surface, #fff); color: var(--brand-700); font: inherit; font-size: .88rem; font-weight: 700; transition: background .15s, color .15s; }
.factory-head button.addProperties:hover, .factory-head button.addProperties:focus-visible { background: var(--brand-600); color: #fff; outline: none; }
button.addProduct { position: static; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; flex: 1 1 180px; max-width: 230px; min-height: 180px;
  padding: 18px 14px; border-radius: var(--radius); border: 2px dashed var(--brand-200, #c7d2fe); background: rgba(255, 255, 255, .7); color: var(--brand-700); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
button.addProduct:hover, button.addProduct:focus-visible { border-color: var(--brand-600); background: var(--brand-50); transform: translateY(-2px); outline: none; }
button.addProduct .ap-plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 600; line-height: 1;
  background: linear-gradient(135deg, var(--brand-500), #7c3aed); color: #fff; box-shadow: 0 6px 16px rgba(91, 63, 217, .3); }
button.addProduct strong { font-size: 1rem; }
button.addProduct small { color: var(--muted); font-size: .78rem; }
@media (max-width: 600px) {
  .budget { position: static; }                 /* auf dem Handy nicht über dem Inhalt kleben */
  button.addProduct, .product.product-planned { max-width: none; flex-basis: 100%; min-height: 140px; }
}

/* ---------- Charts: Übersicht mit aktuellen Werten ---------- */
.chart-submenu { padding: 8px !important; }
.chart-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#navi a.decision.chart-tile { display: grid; grid-template-rows: auto auto auto; gap: 2px; padding: 8px 10px !important; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface, #fff); text-decoration: none; color: var(--text); min-width: 0; white-space: normal !important; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
#navi a.decision.chart-tile:hover { border-color: var(--brand-200, #c7d2fe); text-decoration: none; }
#navi a.decision.chart-tile.active { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-100, #e0e7ff); background: var(--brand-50); color: var(--text) !important; }
.ct-k { font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-v { font-size: .98rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-v.neg { color: var(--danger, #e11d48); }
.ct-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ct-t { font-size: .72rem; font-weight: 700; }
.ct-t.good { color: #059669; } .ct-t.bad { color: var(--danger, #e11d48); } .ct-t.flat { color: var(--muted); }
.ct-spark { width: 64px; height: 20px; flex: none; }
.ct-spark polyline { fill: none; stroke: var(--brand-500); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ct-spark.good polyline { stroke: #10b981; } .ct-spark.bad polyline { stroke: #f43f5e; }
@media (max-width: 1100px) { .chart-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .chart-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

#navi a.decision.chart-tile { display: grid; align-items: start; justify-items: start; height: auto; font-weight: 400; }
#navi a.decision.chart-tile .ct-foot { width: 100%; }
#navi a.decision.chart-tile.active .ct-k { color: var(--brand-700); }
.chart-submenu .chart-tiles { background: none; }

/* ---------- Kopfzeile im Spiel: Firmenname, Periode + Fortschritt + Abschließen in einem Element ---------- */
.wordmark small.wm-company { text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 700; color: var(--text-2); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-period { display: inline-flex; align-items: stretch; gap: 0; padding: 0 !important; overflow: hidden; }
.topbar-period .tp-text { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 7px 14px; min-width: 132px; text-align: left; }
.topbar-period .period-pill { background: none !important; padding: 0 !important; box-shadow: none !important; color: inherit !important; font-size: .82rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.topbar-period .tp-bar { display: block; height: 5px; border-radius: 999px; background: rgba(31, 19, 0, .18); overflow: hidden; }
.topbar-period .tp-bar b { display: block; height: 100%; border-radius: 999px; background: #1f1300; opacity: .75; }
.topbar-period .tp-action { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-left: 1px solid rgba(31, 19, 0, .18); font-weight: 800; white-space: nowrap; }
.topbar-period .tp-action .tc-short { display: inline !important; }
span.topbar-period.is-finished { border-radius: 10px; background: #dcfce7; color: #14532d; }
span.topbar-period.is-finished .tp-bar b { background: #16a34a; }
.sim-head-mobile { display: none; }
@media (max-width: 1280px) { .topbar-period .tp-text { min-width: 116px; padding: 7px 10px; } .topbar-period .tp-action { padding: 0 10px; } }
@media (max-width: 760px) {
  .topbar-period .tp-text { display: none; }
  .topbar-period .tp-action { border-left: 0; padding: 9px 12px; }
  .sim-head-mobile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: .9rem; color: var(--text-2); }
  .sim-head-mobile strong { color: var(--text); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sim-head-mobile span { white-space: nowrap; }
}
@media (max-width: 400px) { .topbar-period .tp-action .tc-short { display: none !important; } }

/* Textfelder in Dialogen linksbündig und breit (nur Zahlen rechtsbündig) */
.overlay input[type="text"] { text-align: left; width: 100%; max-width: 360px; font-size: 1rem; font-weight: 600; }

/* Firmenname in der Kopfzeile ab 900 px immer zeigen; darunter die schmale Zeile im Inhalt */
@media (min-width: 861px) { .topbar .wordmark small.wm-company { display: block !important; } }
@media (max-width: 860px) {
  .sim-head-mobile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: .9rem; color: var(--text-2); }
  .sim-head-mobile strong { color: var(--text); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sim-head-mobile span { white-space: nowrap; }
}
.overlay .form-group.is-missing > label { color: var(--danger, #e11d48) !important; }
.overlay .form-group.is-missing input[type="text"], .overlay .form-group.is-missing input[type="number"] { border-color: var(--danger, #e11d48); box-shadow: 0 0 0 3px #ffe4e6; }
.overlay .form-group.is-missing .choice-body { border-color: #fda4af !important; }
.overlay-error { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: #fff1f2; color: #be123c; font-weight: 650; font-size: .9rem; }
.prop-cost { flex: 1 1 100%; margin: 8px 0 0; font-size: .9rem; color: var(--text-2); }
.prop-cost strong { color: var(--text); }
.prop-warn { flex: 1 1 100%; margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: #fff1f2; color: #be123c; font-weight: 650; font-size: .88rem; }
.prop-warn[hidden] { display: none; }
.planned-note { flex: 1 1 100%; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: .88rem; }
.fh-planned { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--brand-600); color: #fff; font-size: .78rem; font-weight: 700; }
.overlay input[id^="changecapacity_m"] { width: 92px; }

/* ---------- P-Linie: maximal 4 Produkte sichtbar machen ---------- */
.fh-slots { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text-2); margin-left: auto; margin-right: 6px; }
.fh-slots strong { color: var(--text); }
.slot-row { display: inline-flex; gap: 4px; }
.slot { width: 16px; height: 16px; border-radius: 4px; border: 1.5px dashed var(--brand-200, #c7d2fe); background: #fff; }
.slot.is-used { border: 0; background: linear-gradient(135deg, var(--brand-500), #7c3aed); }
.slot.is-planned { border: 1.5px solid var(--brand-500); background: repeating-linear-gradient(135deg, var(--brand-100, #e0e7ff), var(--brand-100, #e0e7ff) 3px, #fff 3px, #fff 6px); }
.product.product-full { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 180px;
  background: var(--surface-2); border: 2px dashed var(--border); color: var(--muted); box-shadow: none; }
.product.product-full:hover { transform: none; box-shadow: none; }
.pf-icon { padding: 4px 10px; border-radius: 999px; background: #e2e8f0; color: #475569; font-weight: 800; font-size: .85rem; }
.product.product-full strong { color: var(--text-2); }
.np-slot-note { margin: -4px 0 12px; font-size: .85rem; color: var(--brand-700); font-weight: 600; }
@media (max-width: 600px) { .fh-slots { margin-left: 0; } .product.product-full { max-width: none; flex-basis: 100%; min-height: 120px; } }

/* Passwort vergessen / zurücksetzen */
a.focus-logo { text-decoration: none; color: inherit; }
.focus-back { font-weight: 600; text-decoration: none; }
.focus-back:hover { text-decoration: underline; }
.focus-card .alert { margin-bottom: 12px; }

/* Illustrationen der Management-/Entscheidungsbereiche (Startseite und Anleitung) */
.area[data-area="controlling"] { --fg: #4f5bd5; --bgc: #eef2ff; }
.area[data-area="production"]  { --fg: #7c3aed; --bgc: #f5f3ff; }
.area[data-area="marketing"]   { --fg: #db2777; --bgc: #fdf2f8; }
.area[data-area="procurement"] { --fg: #d97706; --bgc: #fffbeb; }
.area[data-area="financing"]   { --fg: #059669; --bgc: #ecfdf5; }
.area[data-area="market"]      { --fg: #0891b2; --bgc: #ecfeff; }
.area[data-area="rd"]          { --fg: #65a30d; --bgc: #f7fee7; }
.area-art { display: block; width: 100%; height: auto; margin-bottom: 14px; transition: transform .25s; }
.area:hover .area-art { transform: scale(1.03); }
.area-art .aa-bg { fill: var(--bgc); }
.area-art .aa-fg { fill: var(--fg); }
.area-art .aa-m { fill: var(--fg); opacity: .55; }
.area-art .aa-l { fill: var(--fg); opacity: .22; }
.area-art .aa-w { fill: #fff; }
.area-art .aa-line { stroke: var(--fg); stroke-width: 3; stroke-linejoin: round; }
.area-art .aa-stroke { stroke: var(--fg); }
.area-art path.aa-stroke:not(.aa-w), .area-art g > path.aa-stroke { fill: none; }
.area-art .aa-txt { fill: var(--fg); font-family: inherit; }
@media (prefers-reduced-motion: reduce) { .area:hover .area-art { transform: none; } }

/* Spiel laden: Karte ist direkt der Link ins Spiel */
a.game-card-link { color: inherit; text-decoration: none; cursor: pointer; display: block; }
a.game-card-link:focus-visible { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-100); }
.game-card .game-open { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .85rem; color: var(--brand-600); transition: transform .15s; }
.game-card-link:hover .game-open { transform: translateX(3px); }

/* Mobil: Glossar in derselben (scrollbaren) Zeile wie die Haupttabs statt in einer zweiten Reihe */
@media (max-width: 860px) {
  .sidebar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar > #menu_decision, .sidebar > .nav-secondary { flex: 0 0 auto; }
  .sidebar .nav { overflow: visible; padding-bottom: 0; }
  .sidebar .nav-secondary { padding-left: 6px; border-left: 1px solid var(--border); }
  .sidebar .nav a, .sidebar .nav button { padding-top: 8px; padding-bottom: 8px; }
}

/* Impressum: Autoren und Mitwirkende mit Abstand untereinander */
.imprint-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.imprint-people li { line-height: 1.45; }
.imprint-people li + li { padding-top: 14px; border-top: 1px solid var(--border); }
.imprint-people span { color: var(--muted); font-size: .9rem; }
