/* ---------- Design tokens (CD meta-sys) ---------- */
:root {
  --bg: #F4F4F2;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #6B6B6B;
  --line: #E3E3DF;
  --grid: #D9D9D4;
  /* Metasys-Blau, abgestimmt auf src/assets/custom.css (--main-color / blue-1..8) */
  --accent: #5F829C;
  --accent-soft: #B3D8EA;
  --accent-tint: #DBECF6;
  --font: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --maxw: 1240px;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.4;
  overflow-x: hidden;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(var(--gutter), 3vw, 40px);
}

/* ---------- Kopf (am Slide orientiert) ---------- */
.top { position: relative; overflow: hidden; }

.top .waves {
  position: absolute; top: 0; right: 0;
  height: 100%; width: 320px;
  pointer-events: none;
}

.waves path { fill: none; stroke: var(--line); stroke-width: 9; }

.top .wrap { position: relative; padding-top: 16px; padding-bottom: 12px; }

.logo {
  display: block;
  height: 40px; width: auto;
  /* Fallback, solange die Logo-Datei fehlt: der Alt-Text erscheint als Wortmarke */
  font-weight: 700; font-size: 1.3rem; line-height: 1;
}

h1 {
  font-weight: 300;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.15;
  margin: 14px 0 2px;
}

h1 .num { color: var(--accent); font-weight: 400; white-space: nowrap; }

.subtitle { color: var(--muted); font-weight: 300; font-size: clamp(.95rem, 1.4vw, 1.1rem); margin: 0; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: .85rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: filter .15s ease;
}

.btn:hover, .btn:focus-visible { filter: brightness(1.15); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }

/* ---------- Ablauf: Eingabe → Ergebnis ---------- */
.stage {
  display: grid;
  grid-template-columns: minmax(260px, 310px) 30px minmax(0, 1fr) 30px minmax(180px, 210px);
  align-items: start;
  gap: 0 10px;
  padding-bottom: 20px;
}

.col-label {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 6px;
  font-size: .85rem; font-weight: 600;
}

.col-label span {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 400;
}

.arrow {
  align-self: center;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
}

.arrow svg { width: 16px; height: 16px; }

.login .panel-body { padding: 12px; }
.login p { margin: 0 0 12px; font-size: .9rem; }
.login .btn { display: block; text-align: center; }

.login .alt { margin: 8px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }
.login .alt a { color: var(--accent); font-weight: 600; text-decoration: none; }
.login .alt a:hover, .login .alt a:focus-visible { text-decoration: underline; }

/* ---------- Panels (wie im Tool, Header in CD-Blau) ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel + .panel { margin-top: 10px; }

.panel-head { background: var(--accent); color: #fff; padding: 4px 10px; font-size: .8rem; }

.panel-body { padding: 6px 12px 8px; }

/* ---------- Slider (statischer Nachbau) ---------- */
.slider + .slider { margin-top: 2px; }

.slider-label { font-size: .78rem; margin: 4px 0 0; }
.slider-label .start { color: var(--muted); }
.is-changed .slider-label strong { color: var(--accent); }

.track { position: relative; height: 44px; margin: 0 10px; }

.track::before {                     /* Schiene */
  content: ""; position: absolute; left: 0; right: 0; top: 22px;
  height: 4px; border-radius: 2px; background: var(--accent-tint);
}

.fill { position: absolute; top: 22px; height: 4px; background: var(--accent); border-radius: 2px; }

.tick {
  position: absolute; left: var(--p); top: 20px;
  width: 8px; height: 8px; margin-left: -4px;
  border: 1px solid var(--grid); border-radius: 50%; background: var(--surface);
}

.tick span {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  font-size: .62rem; color: var(--muted); white-space: nowrap;
}

.dense .tick.minor span { display: none; }

.knob {
  position: absolute; left: var(--p); top: 16px;
  width: 16px; height: 16px; margin-left: -8px;
  border: 3px solid var(--accent); border-radius: 50%; background: var(--surface);
  z-index: 2;
}

.knob.ghost { border-color: var(--accent-soft); border-style: dashed; z-index: 1; }

.bubble {
  position: absolute; left: var(--p); top: 0; transform: translateX(-50%);
  background: var(--accent-tint); color: var(--accent);
  font-size: .66rem; font-weight: 600; line-height: 1.4;
  padding: 0 6px; border-radius: 3px; white-space: nowrap;
}

.is-changed .bubble { background: var(--accent); color: #fff; }
.bubble.ghost { background: transparent; color: var(--muted); font-weight: 400; }

/* ---------- Ergebnis ---------- */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.charts .panel + .panel { margin-top: 0; }

.chart { display: block; width: 100%; height: auto; }

.chart .bg { fill: #FAFAF8; }
.chart .axis { stroke: var(--text); stroke-width: 1.2; }
.chart text { font-family: var(--font); fill: var(--text); font-size: 17px; }
.chart .axis-title { fill: var(--muted); font-size: 14px; }

.chart .c-start { stroke: var(--accent-soft); stroke-width: 5; stroke-linecap: round; }
.chart .c-end { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.chart .eq-start { fill: none; stroke: #90A5C4; stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .eq-end { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot-start { fill: #90A5C4; }
.chart .dot-end { fill: var(--accent); }

.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px;
  margin: 8px 0 0; padding: 8px 0 0; list-style: none;
  border-top: 1px solid var(--line);
  font-size: .75rem; color: var(--muted);
}

.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.legend .l-start { background: var(--accent-soft); }
.legend .l-end { background: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { padding: 3px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-weight: 600; border-bottom: 1.5px solid var(--text); }
td.delta { color: var(--accent); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

footer { border-top: 1px solid var(--line); padding: 12px 0; color: var(--muted); font-size: .78rem; }
footer a { color: inherit; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(260px, 310px) 30px minmax(0, 1fr); }
  .arrow-2 { display: none; }
  .login { grid-column: 3; margin-top: 10px; }
}

@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .arrow, .arrow-2 { display: grid; justify-self: center; transform: rotate(90deg); }
  .login { grid-column: auto; margin-top: 0; }
}

@media (max-width: 560px) {
  .logo { height: 32px; }
  .charts { gap: 6px; }
  .charts .panel-head { font-size: .78rem; padding: 4px 8px; }
  .charts .panel-body { padding: 4px; }
  .chart .axis-title, .chart .tick-label { display: none; }
  .legend { font-size: .68rem; gap: 2px 10px; }
  .tick.minor span { display: none; }
}
