﻿:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #000000;
  --muted: rgba(0, 0, 0, 0.58);
  --line: rgba(0, 0, 0, 0.14);
  --line-invert: rgba(255, 255, 255, 0.12);
  --accent: #c12872;
  --accent-dark: #a91f63;
  --surface-dark: #000000;
  --surface-soft: #f7f7f7;
  --shadow: 0 2px 1px -1px rgb(0 0 0 / 20%), 0 1px 1px 0 rgb(0 0 0 / 14%), 0 1px 3px 0 rgb(0 0 0 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Consolas, "Cascadia Mono", monospace;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 36px;
  min-width: 0;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-weight: 600;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #fff;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 22px;
}

.app-shell {
  width: 100%;
  height: 100vh;
  padding: 10px;
  overflow: hidden;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(380px, 500px) minmax(0, 1fr);
  gap: 10px;
  height: calc(100vh - 20px);
  max-height: calc(100vh - 20px);
  min-height: 0;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.controls-panel,
.output-panel {
  display: flex;
  max-height: calc(100vh - 20px);
  min-height: 0;
  flex-direction: column;
}

.result-column {
  display: grid;
  grid-template-rows: minmax(280px, 48vh) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  max-height: calc(100vh - 20px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header.compact {
  padding-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

h3 {
  padding: 10px 12px 6px;
  color: var(--ink);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 3px 5px;
}

.table-wrap {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 5px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

td:first-child,
th:first-child {
  width: 30px;
  color: var(--muted);
  text-align: center;
}

th:nth-child(2),
td:nth-child(2) {
  width: 54px;
}

.simulation {
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.slider-list {
  display: grid;
  gap: 12px;
}

.slider-row {
  display: grid;
  grid-template-columns: 64px 1fr 72px 44px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.zero-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.viewer-zone {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-dark);
  box-shadow: var(--shadow);
}

.viewer {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.axis-legend {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.axis-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.axis-legend i {
  display: block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.axis-x {
  background: #ff3653;
}

.axis-y {
  background: #8adb00;
}

.axis-z {
  background: #2c8fff;
}
.view-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
}

.view-controls button {
  min-width: 48px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.65);
}

.pose-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 12px 2px;
}

.pose-grid div {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px;
  background: var(--surface-soft);
}

.pose-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pose-grid strong {
  display: block;
  margin-top: 4px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.matrix-output,
.joint-matrices pre {
  margin: 0 12px 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-dark);
  color: #ffffff;
  padding: 8px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.output-grid {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.1fr) minmax(320px, 1.1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0 2px;
  min-height: 0;
  overflow: hidden;
}

.output-grid > div {
  display: flex;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.report-output {
  flex: 1;
  min-height: 0;
}

.joint-matrices {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 8px;
}

.matrix-title {
  margin: 0 12px 6px;
  color: var(--muted);
  font-size: 13px;
}

.output-panel {
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .controls-panel,
  .output-panel {
    max-height: none;
  }

  .result-column {
    max-height: none;
    grid-template-rows: minmax(320px, 44vh) auto;
  }

  .viewer {
    height: 44vh;
    min-height: 320px;
  }

  .output-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 10px;
  }

  .panel-header,
  .toolbar,
  .simulation,
  .pose-grid {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 {
    font-size: 21px;
  }

  .slider-row {
    grid-template-columns: 52px 1fr 56px 40px;
  }
}

/* ==========================================================================
   Design-Update 2026 – einheitlicher Look wie www.lucahindelang.com
   Nur Optik: Layout, Raster und alle Funktionen oben bleiben unverändert.
   ========================================================================== */
:root {
  --ink: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.56);
  --line: rgba(10, 10, 10, 0.1);
  --accent: #c12872;
  --accent-dark: #a91f63;
  --accent-soft: rgba(193, 40, 114, 0.09);
  --surface-dark: #0a0a0a;
  --surface-soft: #fafafa;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -20px rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

body {
  background-color: #f3f3f4;
  background-image:
    linear-gradient(rgba(10, 10, 10, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, .035) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Panels */
.panel, .viewer-zone {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { background: #fff; }

/* Kopfbereich mit Logo */
.panel-header { gap: 12px; padding: 14px 16px; }
.home-link {
  display: inline-flex; flex: none; align-items: center; justify-content: center; white-space: nowrap;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 800; letter-spacing: -.04em;
  transition: background .25s, transform .25s var(--ease);
}
.home-link span { color: var(--accent); transition: color .25s; }
.home-link:hover { background: var(--accent); transform: rotate(-6deg); }
.home-link:hover span { color: #fff; }
.home-link + div { margin-right: auto; }
.eyebrow { color: var(--accent); letter-spacing: .08em; font-size: 11px; }
.eyebrow::before { content: "// "; opacity: .7; }
h1 { font-size: 22px; letter-spacing: -.02em; }
h2 { letter-spacing: -.01em; }

/* Buttons */
button, .icon-button {
  border-radius: var(--radius-sm);
  box-shadow: none;
  transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s;
}
button:hover { box-shadow: 0 8px 18px -10px rgba(193, 40, 114, .8); }
button:active { transform: translateY(1px); }
button.secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
button.secondary:hover { background: #fff; border-color: var(--accent); color: var(--accent); box-shadow: none; }
a.icon-button {
  display: inline-grid; place-items: center; height: 36px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); font-size: 12px; font-weight: 700;
  transition: border-color .2s, color .2s;
}
a.icon-button:hover { border-color: var(--accent); color: var(--accent); }
.icon-button { font-size: 19px; }

/* Eingaben */
input[type="number"], select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
input[type="number"]:hover, select:hover { border-color: rgba(10, 10, 10, .25); }
input[type="number"]:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="range"] { accent-color: var(--accent); }

/* Bereiche & Trenner */
.toolbar, .input-grid, .support-box, .section-box, .table-wrap, .panel-header { border-color: var(--line); }

/* Tabellen */
.table-wrap table, table { border-collapse: separate; border-spacing: 0; }
th { background: var(--surface-dark); font-weight: 700; letter-spacing: .02em; }
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
td { border-color: var(--line); }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--accent-soft); }
.table-scroll { border-radius: 10px; border-color: var(--line); }
.table-scroll th:first-child, .table-scroll th:last-child { border-radius: 0; }

/* Ergebnis-Kacheln */
.result-grid div, .pose-grid div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s var(--ease);
}
.result-grid div::before, .pose-grid div::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .85;
}
.result-grid div:hover, .pose-grid div:hover { border-color: rgba(193, 40, 114, .45); }
.result-grid span, .pose-grid span { text-transform: none; letter-spacing: .01em; }
.result-grid strong, .pose-grid strong { font-family: var(--mono); letter-spacing: -.01em; }

/* Code- / Textausgaben */
pre, .report-output, .matrix-output, .formula-box pre, .process-info {
  border: 1px solid #1f1f1f !important;
  border-radius: 10px !important;
  background: var(--surface-dark) !important;
  color: #ececec !important;
  font-family: var(--mono) !important;
}
.formula-title { color: var(--accent); letter-spacing: .08em; }

/* Diagramme */
.chart-canvas, .diagram-canvas { border-radius: 12px; border-color: var(--line); }
.viewer-zone { background: var(--surface-dark); }
.axis-legend { border-radius: 999px; padding: 7px 12px; backdrop-filter: blur(6px); }
.view-controls button {
  border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); border: 0;
}
.view-controls button:hover { background: var(--accent); color: #fff; }

/* Statusmeldungen */
.status { font-weight: 600; }

/* Schmale Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(10, 10, 10, .25) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(10, 10, 10, .22); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.header-actions { display: flex; align-items: center; gap: 8px; }
