:root {
  --bg: #bcc0c9;
  --shell: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f3f2fb;
  --text: #1c1b23;
  --muted: #8d8ba0;
  --accent: #7550e8;
  --accent-2: #9b7cff;
  --border: #eceaf5;
  --ok: #2fb26a;
  --warning: #f4a722;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius: 14px;
  --shadow-soft: 0 20px 45px rgba(38, 26, 86, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% -10%, #d6d9e2 0%, var(--bg) 55%);
  padding: 0;
}

.app-shell {
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  border-radius: 0;
  background: var(--shell);
  border: 1px solid #d8dbe5;
  box-shadow: 0 40px 80px rgba(42, 34, 71, 0.12);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

.app-shell.sidebar-collapsed { grid-template-columns: 84px minmax(0, 1fr) !important; }

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.side-nav {
  display: none;
  background: linear-gradient(180deg, #1f1249 0%, #25165a 100%);
  color: #d8cdff;
  padding: 1rem 0.8rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-shell.sidebar-collapsed .side-label,
.app-shell.sidebar-collapsed .side-links a {
  font-size: 0;
  padding: 0.6rem;
}

.app-shell.sidebar-collapsed .side-links a::before {
  content: "•";
  font-size: 1rem;
  color: #e5ddff;
}

.side-label {
  margin: 1rem 0 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9f8fd7;
}

.side-links {
  display: grid;
  gap: 0.32rem;
}

.side-links a {
  text-decoration: none;
  color: #e5ddff;
  border-radius: 11px;
  padding: 0.5rem 0.62rem;
  font-size: 0.85rem;
}

.side-links a:hover,
.side-links a.active {
  background: rgba(255, 255, 255, 0.12);
}

.side-links.tools a {
  color: #c9bbf8;
  font-size: 0.82rem;
}

.app-content {
  position: relative;
  padding-bottom: 1rem;
}

.app-title-row {
  margin-top: 0.75rem;
  background: linear-gradient(145deg, #ffffff, #f3efff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.72rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.app-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.app-actions {
  display: inline-flex;
  gap: 0.42rem;
}

.mini-btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  color: #5f5b73;
  background: #fff;
}

.mini-btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.utility-rail { display: none; }

.utility-rail h3 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: #5f5984;
}

.utility-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.62rem;
  margin-bottom: 0.45rem;
}

.utility-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.utility-card strong {
  display: block;
  margin-top: 0.16rem;
  font-size: 0.85rem;
}

.container {
  width: min(1320px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 247, 251, 0.88);
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.side-nav .brand { color: #f5f1ff; }
.side-nav .brand-dot {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.brand-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: #0f0f14;
  font-size: 0.86rem;
}

.menu-toggle {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 11px;
  padding: 0.46rem 0.75rem;
}

#sidebar-toggle { display: none; }

.main-nav {
  display: none;
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  padding: 0.7rem 1rem;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  gap: 0.35rem;
}

.main-nav.open { display: grid; }

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
  transition: 0.2s ease;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.header-actions { display: none; }

body.theme-dark {
  --shell: #171825;
  --surface: #202238;
  --surface-2: #1b1d2e;
  --text: #ecebfd;
  --muted: #9fa3c7;
  --border: #2f3352;
  background: radial-gradient(circle at 20% -10%, #313555 0%, #181a2b 55%);
}

body.theme-dark .app-title-row,
body.theme-dark .dashboard-card,
body.theme-dark .card,
body.theme-dark .info-box,
body.theme-dark .footer-bottom,
body.theme-dark .utility-card,
body.theme-dark input,
body.theme-dark select {
  background: #1f2338;
  color: #ecebfd;
  border-color: #303758;
}

body.theme-dark .site-header { background: rgba(27, 29, 46, 0.82); }
body.theme-dark .section,
body.theme-dark .hero { background: #1b1d2e; border-color: #303758; }
body.theme-dark .trust-strip { color: #c9bbf8; }
body.theme-dark .hero-lead { color: #b8bdda; }
body.theme-dark .hero-premium {
  background:
    radial-gradient(circle at 90% 0%, rgba(157, 130, 255, 0.22), transparent 35%),
    radial-gradient(circle at 15% 85%, rgba(117, 80, 232, 0.2), transparent 36%),
    linear-gradient(160deg, #1b1d2e 0%, #1d2136 100%);
}
body.theme-dark .hero-badges span,
body.theme-dark .hero-kpi-row article {
  background: rgba(255, 255, 255, 0.04);
  border-color: #434a73;
  color: #c7c9df;
}
body.theme-dark .hero-kpi-row strong { color: #ecebfd; }
body.theme-dark .quick-help {
  background: linear-gradient(145deg, #1f2338 0%, #232843 100%);
  border-color: #3b4269;
}
body.theme-dark .quick-help p { color: #d2d6f0; }
body.theme-dark .result-grid article { background: #20243b; border-color: #303758; }
body.theme-dark .main-nav { background: #1f2338; border-color: #303758; }

.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #5d5a6f;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.74rem;
  color: #fff;
  background: linear-gradient(135deg, #2f2e3d, #7a4cff);
}

main { padding: 0.5rem 0 0.8rem; }

.hero,
.section {
  margin-top: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(1.1rem, 2.2vw, 1.5rem);
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.45s ease both;
}

#rechner,
#seo { scroll-margin-top: 90px; }

.hero h1,
.section h1,
.section h2 {
  margin: 0;
  letter-spacing: -0.02em;
  font-size: clamp(1.55rem, 2.9vw, 2.35rem);
}

.hero p,
.section-hint {
  margin-top: 0.52rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
}

.hero-premium {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, rgba(141, 104, 255, 0.22), transparent 35%),
    radial-gradient(circle at 15% 85%, rgba(117, 80, 232, 0.2), transparent 36%),
    linear-gradient(160deg, #f6f3ff 0%, #efecff 100%);
}

.hero-premium::before {
  content: "";
  position: absolute;
  right: -110px;
  top: -90px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.trust-strip {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #3d336a;
}

.trust-strip-sub {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.hero-lead {
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  color: #4f4b67;
  max-width: 42rem;
  line-height: 1.55;
}

.section-tight { margin-top: 0.55rem; }

.hero-badges {
  margin: 0.2rem 0 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hero-badges span {
  border: 1px solid rgba(117, 80, 232, 0.2);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  font-size: 0.76rem;
  color: #4c4470;
  font-weight: 600;
}

.hero-kpi-row {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.hero-kpi-row article {
  border: 1px solid rgba(117, 80, 232, 0.2);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 0.62rem 0.72rem;
}

.hero-kpi-row span {
  display: block;
  color: #6f6596;
  font-size: 0.75rem;
}

.hero-kpi-row strong {
  display: block;
  margin-top: 0.14rem;
  color: #2f2a47;
  font-size: 0.94rem;
}

.calc-tiles {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

.calc-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.calc-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(38, 26, 86, 0.12);
  border-color: #cec3ff;
}

.calc-tile::after {
  content: "->";
  position: absolute;
  right: 1rem;
  top: 0.9rem;
  color: #8a6cf3;
  font-weight: 700;
  opacity: 0.8;
}

.calc-tile-rank {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(117, 80, 232, 0.14);
  color: #5d44bf;
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.calc-tile-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.calc-tile-desc {
  font-size: 0.86rem;
  color: var(--muted);
}

.branch-cards {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

.branch-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.branch-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.branch-card a { color: var(--accent); font-weight: 600; }

.calculator-cta {
  margin-top: 1rem;
  text-align: center;
}

.calculator-cta p { margin: 0 0 0.65rem; color: #554f75; }

.calculator-cta p:last-child { margin-bottom: 0; }

.footer-legal-links {
  margin: 0.35rem 0;
  font-size: 0.88rem;
}

.footer-legal-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer-legal-links a:hover { text-decoration: underline; }

.quick-help {
  margin-top: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
  border: 1px solid #ddd4ff;
  background: linear-gradient(145deg, #ffffff 0%, #f4efff 100%);
}

.quick-help p {
  margin: 0;
  color: #4f4771;
}

.btn {
  text-decoration: none;
  border: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 12px;
  padding: 0.62rem 0.98rem;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(107, 73, 218, 0.28);
  transition: transform 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-secondary {
  background: #fff;
  color: #423f54;
  box-shadow: none;
  border: 1px solid var(--border);
}

.info-box,
.card {
  margin-top: 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
}

.info-box {
  background: linear-gradient(145deg, #faf8ff 0%, #f2efff 100%);
  color: #554f75;
}

.grid-2,
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

label {
  color: #55526a;
  font-size: 0.86rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  margin-top: 0.28rem;
  border: 1px solid var(--border);
  background: #f8f7fc;
  border-radius: 12px;
  padding: 0.63rem;
  font: inherit;
}

input:focus,
select:focus {
  outline: none;
  border-color: #c5b6ff;
  box-shadow: 0 0 0 3px rgba(117, 80, 232, 0.14);
}

input[type="range"] {
  appearance: none;
  border: 0;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8e0ff, #efecff);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: linear-gradient(145deg, #6d48e1, #8d6eff);
  box-shadow: 0 6px 18px rgba(109, 72, 225, 0.4);
}

.slider-wrap { margin-top: 0.33rem; }
.slider-meta { margin-top: 0.2rem; color: var(--muted); font-size: 0.78rem; }

.result-grid {
  margin-top: 0.74rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.62rem;
}

.result-grid article {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.74rem;
  box-shadow: 0 8px 18px rgba(45, 33, 89, 0.05);
}

.result-grid span { color: var(--muted); font-size: 0.8rem; }
.result-grid strong { display: block; margin-top: 0.16rem; font-size: 1.08rem; }
.result-grid p { margin-top: 0.32rem; color: #69657e; font-size: 0.83rem; }

a { color: #5b3fc8; }
.result-grid a { text-decoration: none; color: #422d94; }
.result-grid a:hover { text-decoration: underline; }

.msg { margin: 0.56rem 0 0; color: #8f6400; font-size: 0.85rem; }

.stats-panel {
  margin-top: 0.85rem;
  background: linear-gradient(155deg, #1f1146, #2d1764 55%, #3d2181);
  border-radius: 20px;
  color: #f3efff;
  padding: 0.95rem;
  box-shadow: 0 18px 34px rgba(58, 25, 129, 0.38);
}

.stats-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.stats-head h3 { margin: 0; font-size: 1rem; }

.stats-badge {
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  font-size: 0.73rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
}

.stats-grid {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.stats-grid article {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.55rem;
}

.stats-grid span {
  color: #cbb9ff;
  font-size: 0.72rem;
}

.stats-grid strong {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.95rem;
}

.stats-meter {
  margin-top: 0.7rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.stats-meter-bar {
  height: 100%;
  width: 22%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f5a623, #ffd56d);
  transition: width 0.35s ease;
}

.viz-panel {
  margin-top: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 0.9rem;
  background: linear-gradient(160deg, #24135a, #38207f 60%, #4e2d9e);
  color: #f2edff;
  box-shadow: 0 18px 34px rgba(54, 28, 129, 0.34);
}

.viz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.viz-head h3 { margin: 0; font-size: 1rem; }

.viz-chip {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 0.23rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.viz-grid {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 0.7rem;
  align-items: center;
}

.viz-ring {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: conic-gradient(#f6ad2c 35%, rgba(255, 255, 255, 0.16) 0);
  position: relative;
}

.viz-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #2f1d6d;
}

.viz-text strong {
  display: block;
  font-size: 1.07rem;
}

.viz-text span {
  color: #d8ccff;
  font-size: 0.82rem;
}

.viz-bars {
  margin-top: 0.72rem;
  display: grid;
  gap: 0.38rem;
}

.viz-bars span {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f49e4, #9d7aff);
  width: 40%;
  transition: width 0.35s ease;
}

.viz-trend {
  margin: 0.62rem 0 0;
  color: #d4c8ff;
  font-size: 0.81rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 0.56rem; font-size: 0.87rem; }
thead th { background: #f8f6ff; color: #554b83; }

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.dashboard-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.9rem;
}

.projection-card h2,
.params-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.trend-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.trend-grid div {
  background: #f8f7fd;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.56rem;
}

.trend-grid span { font-size: 0.72rem; color: var(--muted); display: block; }
.trend-grid strong { font-size: 0.95rem; }

.chart-lines {
  margin-top: 0.75rem;
  height: 130px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9f8ff 0%, #f3f1fd 100%);
  border: 1px solid var(--border);
  padding: 0.6rem;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 0.35rem;
}

.chart-lines span {
  height: var(--h);
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #926cf9, #6235d9);
  animation: growBar 0.8s ease both;
}

@keyframes growBar {
  from { height: 0; opacity: 0.4; }
  to { height: var(--h); opacity: 1; }
}

.params-card .section-hint { margin-bottom: 0; }

.site-footer {
  margin-top: 0.8rem;
  padding: 1rem 0 1.2rem;
}

.footer-bottom {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem;
  color: #6d6983;
}

.legal-warning { color: #7f668a; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 980px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .side-nav { display: block; }
  .menu-toggle { display: none; }
  #sidebar-toggle { display: inline-grid; place-items: center; }
  .main-nav {
    position: static;
    display: flex;
    background: transparent;
    border: 0;
    padding: 0;
    margin-left: 0.4rem;
    max-width: calc(100% - 370px);
    overflow-x: auto;
  }
  .main-nav a { padding: 0.48rem 0.78rem; }
  .header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
  }
  .app-content { padding-right: 300px; }
  .utility-rail {
    display: block;
    position: fixed;
    right: 1rem;
    top: 6.2rem;
    width: 270px;
    z-index: 25;
    background: linear-gradient(180deg, #f8f6ff, #f2f1fb);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.7rem;
  }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: 2fr 1fr; }
  .calc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .branch-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .calc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
