/* rechner.help – helles, ruhiges Werkzeug-Design. Mobile first, keine externen Schriften. */
:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f5;
  --surface: #ffffff;
  --surface-raised: #f2f2ef;
  --text: #111111;
  --text-secondary: #4a4a4a;
  --muted: #6e6e6e;
  --line: #e4e4e0;
  --line-strong: #cfcfca;
  --accent: #3ccf6e;
  --accent-hover: #2fbd5f;
  --accent-ink: #0b0b0b;
  --accent-soft: #eafaf0;
  --accent-text: #137a3a;
  --error: #c62828;
  --focus: #1d4ed8;
  --radius: 8px;
  --max: 760px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--text); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; color: var(--text); }
h1 { font-size: 2rem; margin: 0.4rem 0 0.4rem; font-weight: 750; }
h2 { font-size: 1.3rem; margin: 0 0 0.6rem; font-weight: 700; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 0.3rem; font-weight: 650; }
p { margin: 0 0 0.8rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 200; }
.skip:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.1rem; }
.wrap.narrow { max-width: var(--max); }

/* Kopfzeile */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.site-header-inner { max-width: 1120px; margin: 0 auto; padding: 0 1.1rem; display: flex; align-items: center; gap: 1rem; height: 58px; }
.site-logo { font-size: 1.2rem; font-weight: 750; color: var(--text); text-decoration: none; flex-shrink: 0; letter-spacing: -0.02em; }
.site-logo:hover { color: var(--text); }
.logo-dot { color: var(--accent-text); }
.site-nav { margin-left: auto; min-width: 0; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.1rem; }
.site-nav a { display: block; font-size: 0.88rem; color: var(--text-secondary); text-decoration: none; padding: 0.4rem 0.6rem; border-radius: 6px; white-space: nowrap; }
.site-nav a:hover { color: var(--text); background: var(--surface-raised); }
.nav-toggle { display: none; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 44px; height: 44px; min-height: 0; margin-left: auto; padding: 10px; background: transparent; border: 1px solid var(--line); border-radius: 8px; }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
  .site-nav { position: absolute; top: 58px; left: 0; right: 0; margin-left: 0; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05); display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 0.5rem 1.1rem 1rem; }
  .site-nav a { padding: 0.65rem 0.6rem; font-size: 1rem; }
}

/* Breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; padding: 0; margin: 1.1rem 0 0; font-size: 0.86rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 0.5rem; }
.crumbs a { color: var(--muted); }

/* Seitenkopf mit Lesezeichen-Hilfe */
.page-head { margin: 0.6rem 0 1.2rem; }
.page-sub { color: var(--text-secondary); font-size: 1.12rem; font-weight: 500; letter-spacing: 0; margin: 0 0 0.9rem; }
.bookmark-wrap { position: relative; display: inline-block; max-width: 100%; }
.bookmark-btn { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--line); font-weight: 500; font-size: 0.88rem; min-height: 36px; padding: 0.3rem 0.8rem; border-radius: 999px; }
.bookmark-btn:hover { border-color: var(--line-strong); color: var(--text); background: var(--bg-subtle); }
.bookmark-btn span { color: var(--accent-text); }
.bookmark-hint { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(22rem, calc(100vw - 2.2rem)); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1); padding: 0.9rem 1rem; }
.bookmark-text { margin: 0 0 0.6rem; font-size: 0.95rem; color: var(--text); }
.bookmark-close { min-height: 34px; padding: 0.25rem 0.9rem; font-size: 0.88rem; }

/* Karten und Formular */
.card, .block { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; }
.block { margin-top: 1rem; }
.tool { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.tool-title { font-size: 1.05rem; color: var(--text-secondary); font-weight: 600; margin: 0 0 1rem; }
.fields { display: grid; gap: 0.9rem; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; }
.unit { font-weight: 400; color: var(--muted); }
input, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 0.65rem 0.8rem; min-height: 48px;
}
select { appearance: auto; }
input:hover, select:hover { border-color: #b5b5af; }
input:focus-visible, select:focus-visible { border-color: var(--focus); outline-offset: 0; }
.input-unit { position: relative; display: flex; align-items: stretch; }
.input-unit input { flex: 1; min-width: 0; }
.input-unit .suffix { display: flex; align-items: center; padding: 0 0.75rem; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; background: var(--bg-subtle); color: var(--muted); font-size: 0.92rem; white-space: nowrap; }
.input-unit input:has(+ .suffix) { border-radius: var(--radius) 0 0 var(--radius); }
.hint { font-size: 0.86rem; color: var(--muted); margin: 0.3rem 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }

/* Buttons: frisches Grün, schwarze Schrift, keine Verläufe */
button {
  font: inherit; font-weight: 650; min-height: 46px; padding: 0.6rem 1.4rem;
  border-radius: var(--radius); cursor: pointer; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); letter-spacing: 0.01em;
}
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button.primary { flex: 1 1 10rem; text-transform: uppercase; font-size: 0.95rem; letter-spacing: 0.04em; }
button.ghost { background: var(--bg); border-color: var(--line-strong); color: var(--text-secondary); font-weight: 550; }
button.ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.55rem 1.1rem; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font-weight: 650; text-decoration: none;
  text-transform: uppercase; font-size: 0.88rem; letter-spacing: 0.04em;
}
.btn-secondary:hover { background: var(--accent-hover); color: var(--accent-ink); }

/* Ergebnis */
.result { margin-top: 1.3rem; }
.result:empty { display: none; }
.result.is-ok { border-top: 1px solid var(--line); padding-top: 1.3rem; }
.result-main { background: var(--bg-subtle); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.result-label { margin: 0; color: var(--text-secondary); font-size: 0.95rem; font-weight: 550; }
.result-value { margin: 0.15rem 0 0; font-size: 2.3rem; line-height: 1.15; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.result-badge { display: inline-block; margin: 0.5rem 0 0; padding: 0.15rem 0.65rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 650; font-size: 0.92rem; }

.result-rows { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-variant-numeric: tabular-nums; font-size: 0.97rem; }
.result-rows th, .result-rows td { padding: 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.result-rows th { text-align: left; font-weight: 450; color: var(--text-secondary); padding-right: 1rem; }
.result-rows td { text-align: right; white-space: nowrap; }
.result-rows tr.row-sum th, .result-rows tr.row-sum td { font-weight: 650; color: var(--text); }
.result-rows tr.row-total th, .result-rows tr.row-total td { font-weight: 750; color: var(--text); background: var(--accent-soft); border-bottom: 0; padding: 0.7rem 0.6rem; font-size: 1.02rem; }
.result-rows tr.row-total td { white-space: normal; }

.result-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 0 0 1rem; }
.result-detail-card { padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; }
.result-detail-card dt { color: var(--muted); font-size: 0.85rem; }
.result-detail-card dd { margin: 0.2rem 0 0; font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.result-table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.result-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.result-table caption { text-align: left; font-weight: 650; padding-bottom: 0.4rem; }
.result-table th { text-align: left; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line-strong); }
.result-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.result-table tr.is-current td { background: var(--accent-soft); font-weight: 700; }
.result-table tr.is-current td:first-child { box-shadow: inset 4px 0 0 var(--accent); }

.result-steps { background: var(--bg-subtle); border-radius: 10px; padding: 0.85rem 1rem; margin: 0 0 1rem; }
.steps-title { font-weight: 650; margin: 0 0 0.3rem; font-size: 0.92rem; }
.step { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95rem; margin: 0 0 0.2rem; overflow-x: auto; }
.step-formula { color: var(--muted); font-size: 0.88rem; margin: 0.4rem 0 0; }
.result-note { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; font-size: 0.95rem; color: var(--text-secondary); margin: 0 0 0.7rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.4rem; }
.result .copy { min-height: 40px; font-size: 0.88rem; padding: 0.4rem 1rem; }
.result.is-error { border-top: 0; padding-top: 0; }
.error { color: var(--error); font-weight: 600; margin: 0; padding: 0.75rem 0.9rem; border: 1px solid #f1c4c4; background: #fdf3f3; border-radius: 8px; }
.note { color: var(--muted); font-size: 0.95rem; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; background: var(--bg-subtle); border-radius: 8px; padding: 0.7rem 0.8rem; overflow-x: auto; }

/* Tipp */
.tip { display: flex; gap: 0.8rem; margin: 1.2rem 0; padding: 1rem 1.1rem; background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 12px; }
.tip-icon { font-size: 1.3rem; line-height: 1.3; }
.tip-title { font-weight: 700; margin: 0 0 0.2rem; }
.tip-text p:last-child { margin: 0; color: var(--text-secondary); }

/* Akkordeon */
.acc-group { margin-top: 1.2rem; border-top: 1px solid var(--line); }
.acc { border-bottom: 1px solid var(--line); }
.acc summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 1.4rem; color: var(--muted); font-weight: 400; }
.acc[open] summary::after { content: "–"; }
.acc summary h2 { margin: 0; font-size: 1.1rem; }
.acc-body { padding: 0 0 1rem; color: var(--text-secondary); }

/* Verwandte Rechner */
.related-block { background: var(--bg-subtle); border: 0; }
.related { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.related a { display: block; padding: 0.75rem 0.9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); }
.related a:hover { border-color: var(--line-strong); }
.related strong { display: block; }
.related span { display: block; font-size: 0.88rem; color: var(--muted); }

.ad-slot { min-height: 280px; margin: 1rem 0; }

/* Startseite */
.hero { padding: 3rem 0 1.6rem; text-align: center; }
.hero h1 { font-size: 2.2rem; }
.lead { color: var(--text-secondary); font-size: 1.1rem; max-width: 40rem; margin: 0 auto 1.4rem; }
.search { max-width: 34rem; margin: 0 auto; text-align: left; }
.search label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.95rem; }
.search input { font-size: 1.05rem; min-height: 54px; border-radius: 10px; }
.quick-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 1.4rem 0 0.6rem; color: var(--muted); }
.quick { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; }
.quick a { display: inline-block; padding: 0.4rem 0.85rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 0.92rem; }
.quick a:hover { border-color: var(--line-strong); background: var(--bg-subtle); }

.minis-section { background: var(--bg-subtle); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 1.5rem -1.1rem 0; padding: 2rem 1.1rem 2.2rem; }
.minis-section > h2, .section-lead { text-align: center; }
.section-lead { color: var(--text-secondary); max-width: 38rem; margin: 0 auto 1.4rem; }
.minis { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.mini { display: flex; flex-direction: column; padding: 1.2rem; }
.mini h3 { font-size: 1.3rem; margin: 0 0 0.9rem; }
.mini-form { display: grid; gap: 0.7rem; }
.mini-form .field label { font-size: 0.88rem; }
.mini-form button { width: 100%; }
.mini-result { margin: 1rem 0; padding: 0.8rem 0.9rem; background: var(--bg-subtle); border-left: 4px solid var(--accent); border-radius: 8px; }
.mini-label { margin: 0; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.mini-value { margin: 0.1rem 0 0; font-size: 1.8rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.mini-sub { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
.mini-result.is-error .mini-sub { color: var(--error); font-weight: 600; }
.mini .btn-secondary { margin-top: auto; }

.category { margin-top: 2.4rem; scroll-margin-top: 5rem; }
.category h2 { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.rechner-liste { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 0.1rem 1.2rem; }
.rechner-liste a { display: block; padding: 0.45rem 0; color: var(--text); text-decoration: none; border-bottom: 1px dashed transparent; }
.rechner-liste a:hover { color: var(--accent-text); }
.rechner-liste a::after { content: " →"; color: var(--muted); }
.keine-treffer { margin-top: 2rem; color: var(--muted); text-align: center; }

.site-footer { margin-top: 3.5rem; border-top: 1px solid var(--line); background: var(--bg-subtle); padding: 1.6rem 0 2.6rem; color: var(--muted); font-size: 0.9rem; }
.site-footer a { color: var(--text-secondary); }

@media (max-width: 420px) {
  .result-details { grid-template-columns: 1fr; }
  .result-value { font-size: 2rem; }
  h1 { font-size: 1.75rem; }
}
@media (min-width: 640px) {
  h1 { font-size: 2.3rem; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .field:only-child, .fields .field-wide { grid-column: 1 / -1; }
  .rechner-liste { grid-template-columns: 1fr 1fr 1fr; }
  .card, .block { padding: 1.5rem; }
  .minis { grid-template-columns: 1fr 1fr; }
  .related { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.7rem; }
}
@media (min-width: 980px) {
  .minis { grid-template-columns: 1fr 1fr 1fr; }
  .rechner-liste { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .related { grid-template-columns: 1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* === Legal Pages (Impressum, Datenschutz) === */
.legal { max-width:var(--max); margin:0 auto; padding:2rem 1.25rem 3rem; }
.legal h1 { font-size:clamp(1.5rem,3vw,2rem); margin:0 0 1.75rem; color:var(--text); }
.legal-intro { color:var(--text-secondary); font-size:.9rem; margin:-1.25rem 0 1.75rem; }
.legal-section { margin-bottom:2rem; border-top:1px solid var(--line); padding-top:1.5rem; }
.legal-section h2 { font-size:1.05rem; font-weight:700; color:var(--text); margin:0 0 .75rem; }
.legal-section p, .legal-section li { color:var(--text-secondary); font-size:.95rem; line-height:1.65; margin:0 0 .6rem; }
.legal-section ul { padding-left:1.25rem; margin:0 0 .6rem; }
.legal-section a { color:var(--accent); text-decoration:none; }
.legal-section a:hover { text-decoration:underline; }
.legal-section code { font-family:monospace; font-size:.85em; background:var(--surface-raised); padding:.1em .35em; border-radius:4px; }
.legal-origin { background:var(--bg-subtle); border:1px solid var(--line); border-radius:var(--radius); padding:1.25rem 1.5rem; margin-bottom:2rem; }
.legal-origin p { color:var(--text-secondary); font-size:.95rem; line-height:1.7; margin:0 0 .5rem; }
.legal-origin p:last-child { margin:0; }
