/* Mathefix – gemeinsames Aussehen aller Apps */
:root {
  --bg: #f4f1ff;
  --card: #ffffff;
  --text: #1f1b3a;
  --muted: #6b6690;
  --brand: #6c4cf5;
  --brand-dark: #4f33cf;
  --teil: #1e88e5;
  --ganzes: #f57c00;
  --anteil: #2e9d5b;
  --ok: #2e9d5b;
  --ok-bg: #e5f6ec;
  --bad: #d64545;
  --bad-bg: #fdeaea;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(60, 40, 140, 0.12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--ganzes); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

h1 { font-size: 1.8rem; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }

button, .btn {
  font: inherit;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn {
  display: inline-block;
  min-height: 56px;
  padding: 14px 26px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 0 var(--brand-dark);
  transition: transform 0.05s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-dark); }
.btn.secondary { background: #e7e2ff; color: var(--brand-dark); box-shadow: 0 4px 0 #c9bfff; }
.btn.wide { width: 100%; }

footer.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 24px;
}

/* Bruchdarstellung: Zähler über Nenner */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  font-size: 0.9em;
  line-height: 1.1;
  margin: 0 0.12em;
  font-weight: 700;
}
.frac > span { padding: 0 0.2em; }
.frac > span:first-child { border-bottom: 2px solid currentColor; }
