/* Kostenlose Rechner (/rechner/) – baut auf home.css auf (Farben, Schriften, Kopf, Fuß, Buttons) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rechner-page main { padding-bottom: 40px; overflow-x: clip; }
.site-nav a[aria-current="page"] { background: var(--bg-2); color: var(--ink); }

/* ---------------------------------------------------------------- Brotkrumen + Kopf */
.crumbs { padding-top: 22px; font-size: 14px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: ""; width: 6px; height: 6px; margin: 0 10px; border-right: 1.5px solid #b8b8b0; border-top: 1.5px solid #b8b8b0; transform: rotate(45deg); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--muted); }
.calc-head { max-width: 820px; padding: 22px 0 26px; }
.calc-head h1, .hub-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 54px); line-height: 1.04; letter-spacing: -0.01em; margin: 0 0 14px; }
.calc-lead p { font-size: 18.5px; color: var(--ink-2); margin: 0; line-height: 1.55; }
.calc-lead p + p { margin-top: 10px; }
.calc-lead a, .prose a, .hub-deck a { color: var(--ink); text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.calc-lead a:hover, .prose a:hover { text-decoration-color: var(--ink); }

/* ---------------------------------------------------------------- Rechner */
.calc { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); background: var(--card); border: 1px solid var(--rule); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.calc-in { padding: 28px 30px 24px; min-width: 0; }
.calc-h { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 18px; align-items: start; }
.field { display: grid; gap: 6px; min-width: 0; }
.field[hidden] { display: none; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 14.5px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.control { position: relative; }
.control input, .control select, .control textarea { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: #fff; border: 1.5px solid #d6d6ce; border-radius: 11px; padding: 11px 13px; transition: border-color 0.15s, box-shadow 0.15s; }
.control input { font-variant-numeric: tabular-nums; min-height: 48px; }
.control textarea { resize: vertical; min-height: 64px; line-height: 1.45; font-size: 16px; }
.control select { appearance: none; -webkit-appearance: none; min-height: 48px; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315151a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 13px center / 16px no-repeat; cursor: pointer; }
.control.has-unit input { padding-right: 52px; }
.unit { position: absolute; right: 1.5px; top: 1.5px; bottom: 1.5px; min-width: 40px; padding: 0 12px; display: grid; place-items: center; font-size: 15px; font-weight: 650; color: var(--muted); background: var(--bg); border-left: 1px solid var(--rule); border-radius: 0 9.5px 9.5px 0; pointer-events: none; }
.control input:hover, .control select:hover, .control textarea:hover { border-color: #b9b9b0; }
.control input:focus, .control select:focus, .control textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.55); }
.control [aria-invalid="true"] { border-color: #c2261b; box-shadow: 0 0 0 3px rgba(194, 38, 27, 0.12); }
.hint { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.err { margin: 0; font-size: 13.5px; font-weight: 600; color: #b3261e; }
.err[hidden] { display: none; }
.fields-opt { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #d6d6ce; }
.fields-opt[hidden] { display: none; }
.fields-opt-h { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.calc-tools { display: flex; gap: 18px; margin-top: 20px; }
.linkbtn { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-decoration-color: #c9c9c0; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* Umschalter */
.modes { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.modes legend { font-size: 14.5px; font-weight: 650; margin-bottom: 8px; padding: 0; }
.modes-row { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--rule); border-radius: 13px; }
.mode { position: relative; }
.mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode span { display: block; padding: 9px 16px; border-radius: 9px; font-size: 15px; font-weight: 650; color: var(--ink-2); cursor: pointer; transition: background 0.15s, color 0.15s; }
.mode input:checked + span { background: var(--ink); color: #fff; }
.mode input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.mode span:hover { color: var(--ink); }
.mode input:checked + span:hover { color: #fff; }

/* Ergebnis */
.calc-out { background: var(--ink); color: #fff; padding: 28px 28px 22px; display: flex; flex-direction: column; min-width: 0; position: relative; overflow: hidden; }
.calc-out::before { content: ""; position: absolute; right: -80px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 212, 0, 0.22), transparent 70%); pointer-events: none; }
.calc-out .calc-h { color: #a9a9b4; }
.calc-out :focus-visible { outline-color: var(--yellow); }
.out { display: grid; gap: 14px; position: relative; }
.out [hidden] { display: none !important; }
.out-label { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: #c9c9d1; }
.out-main .out-value { display: block; font-family: var(--display); font-size: clamp(40px, 5.2vw, 58px); line-height: 1; color: var(--yellow); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.out-sub { margin: 8px 0 0; font-size: 14.5px; color: #e6e6ec; line-height: 1.45; }
.out-sub:empty { display: none; }
.out-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.out-tile { background: #1f1f26; border: 1px solid #2d2d36; border-radius: 13px; padding: 12px 14px; min-width: 0; }
.out-tile .out-label { font-size: 13px; }
.out-tile .out-value { display: block; font-family: var(--display); font-size: 26px; line-height: 1.1; color: var(--yellow); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.out-list { margin: 0; display: grid; }
.out-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid #2d2d36; }
.out-row dt { font-size: 14.5px; color: #c9c9d1; }
.out-row dd { margin: 0; font-size: 16px; font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.out-code { background: #1f1f26; border: 1px solid #2d2d36; border-radius: 13px; padding: 12px 14px; display: grid; gap: 8px; }
.out-code .out-value.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; color: #fff; overflow-wrap: anywhere; word-break: break-all; }
.out-code-main .out-value.code { color: var(--yellow); font-size: 15px; }
.out-code .btn { justify-self: start; }
.verdict { margin: 2px 0 0; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; font-size: 15px; line-height: 1.5; background: #24242c; border: 1px solid #34343e; color: #f0f0f4; }
.verdict .ico { margin-top: 1px; display: none; }
.verdict[data-tone="good"] { background: #11301f; border-color: #1f6b41; }
.verdict[data-tone="good"] .v-good { display: block; color: #5ee08f; }
.verdict[data-tone="warn"] { background: #33290b; border-color: #7a6214; }
.verdict[data-tone="warn"] .v-warn { display: block; color: var(--yellow); }
.verdict[data-tone="bad"] { background: #3a1512; border-color: #87302a; }
.verdict[data-tone="bad"] .v-bad { display: block; color: #ff8a80; }
.verdict[data-tone="info"] .v-info { display: block; color: #a9b8ff; }
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.notes li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.45; color: #d9d9e0; }
.notes li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.out-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; position: relative; }
.btn-sm { font-size: 14.5px; padding: 11px 14px; border-radius: 10px; }
.calc-out .btn-ghost { background: transparent; color: #fff; border-color: #44444f; }
.calc-out .btn-ghost:hover { border-color: #8a8a96; }
.btn.is-done { background: #1f9d55; color: #fff; box-shadow: none; }
.out-privacy { margin: 14px 0 0; font-size: 12.5px; color: #9a9aa6; }
.noscript { grid-column: 1 / -1; margin: 0; padding: 12px 30px; background: var(--yellow-soft); font-size: 14.5px; }

/* Tabelle Zeichenzähler */
.out-table { overflow-x: auto; }
.out-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.out-table th, .out-table td { text-align: left; padding: 9px 0; border-top: 1px solid #2d2d36; vertical-align: top; }
.out-table th:first-child { padding-right: 12px; }
.out-table td { text-align: right; }
.out-table thead th { border-top: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9a9aa6; padding-top: 0; }
.out-table thead th:last-child { text-align: right; }
.out-table tbody th { font-weight: 500; color: #e6e6ec; }
.out-table .t-p { font-weight: 700; color: #fff; }
.out-table .t-l { display: block; font-size: 13px; color: #b9b9c4; }
.out-table .t-n { display: block; }
.out-table td b { font-size: 16px; font-variant-numeric: tabular-nums; }
.out-table .t-lim { font-size: 12.5px; color: #9a9aa6; }
.st { display: inline-block; margin-top: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; line-height: 1.35; }
.st-good { background: #11301f; color: #7fe7a7; }
.st-warn { background: #33290b; color: var(--yellow); }
.st-bad { background: #3a1512; color: #ff9d94; }
.st-info { background: #1d2342; color: #b7c3ff; }

/* ---------------------------------------------------------------- Text unter dem Rechner */
.calc-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; margin-top: 56px; align-items: start; }
.prose { max-width: 740px; min-width: 0; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: clamp(25px, 3vw, 32px); line-height: 1.12; margin: 44px 0 14px; letter-spacing: -0.005em; scroll-margin-top: 80px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; line-height: 1.35; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--ink); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--bg-2); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.formula { margin: 4px 0 18px; padding: 16px 20px; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--yellow); border-radius: 12px; display: grid; gap: 6px; }
.formula p { margin: 0; font-size: 16.5px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.callout { margin: 4px 0 18px; padding: 14px 18px; background: var(--yellow-soft); border-radius: 12px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 4px 0 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--rule); vertical-align: top; }
.table-wrap thead th { border-top: 0; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: #fbfbf9; }
.table-wrap tbody th { font-weight: 650; color: var(--ink); }
.table-wrap td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.prose details { border-bottom: 1px solid var(--rule); }
.prose h2 + details, .prose details:first-of-type { border-top: 1px solid var(--rule); }
.prose summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; font-size: 17px; font-weight: 650; line-height: 1.4; color: var(--ink); }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: "+"; font-size: 24px; font-weight: 400; color: var(--muted); transition: transform 0.2s; flex: none; line-height: 1; }
.prose details[open] summary::after { transform: rotate(45deg); }
.prose details .a { padding-bottom: 16px; }
.prose details .a p:last-child { margin-bottom: 0; }

/* Seitenleiste: verwandte Rechner + Hinweis */
.calc-aside { position: sticky; top: 84px; display: grid; gap: 18px; }
.aside-h { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tool-list { display: grid; gap: 10px; }
.tool-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.tool-card:hover { border-color: #c9c9c0; transform: translateY(-1px); box-shadow: 0 10px 24px -16px rgba(21, 21, 26, 0.35); }
.tool-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); border: 1px solid var(--rule); display: grid; place-items: center; color: var(--ink); }
.tool-card:hover .tool-ico { background: var(--yellow); border-color: var(--yellow); }
.tool-txt { display: grid; gap: 3px; min-width: 0; flex: 1; }
.tool-name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.tool-text { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.tool-arrow { margin-top: 10px; width: 17px; height: 17px; color: var(--muted); transition: transform 0.15s, color 0.15s; }
.tool-card:hover .tool-arrow { transform: translateX(3px); color: var(--ink); }
.cc-hint { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 18px 18px 16px; }
.cc-hint p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.cc-kicker { display: flex; align-items: center; gap: 8px; font-size: 13px !important; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink) !important; }
.cc-kicker .ico { width: 18px; height: 18px; }
.cc-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14.5px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cc-link .ico { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- Übersicht */
.hub-head { padding: 44px 0 10px; max-width: 900px; position: relative; }
.hub-head::before { content: ""; position: absolute; inset: -60px -40vw auto; height: 420px; background: radial-gradient(40% 55% at 22% 30%, rgba(255, 212, 0, 0.2), transparent 70%); pointer-events: none; z-index: -1; }
.hub-deck p { font-size: clamp(18px, 2vw, 20px); color: var(--ink-2); margin: 0; max-width: 760px; line-height: 1.55; }
.hub-facts { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.hub-facts li { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.hub-facts .ico { width: 17px; height: 17px; color: var(--green); stroke-width: 2.4; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.cat-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 650; font-size: 15px; }
.cat-nav a:hover { border-color: #c9c9c0; }
.cat-nav span { font-size: 12.5px; font-weight: 700; background: var(--bg-2); border-radius: 999px; padding: 1px 8px; color: var(--ink-2); }
.tool-cat { margin-top: 56px; scroll-margin-top: 80px; }
.tool-cat-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 8px 40px; align-items: baseline; margin-bottom: 20px; }
.tool-cat-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.08; margin: 0; }
.tool-cat-head p { margin: 0; color: var(--ink-2); font-size: 16.5px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.hub-head + .tool-cat { margin-top: 44px; }
.rechner-page .wrap > .cc-hint { margin-top: 64px; max-width: 760px; padding: 24px; }
.rechner-page .wrap > .cc-hint p { font-size: 16px; }

/* ---------------------------------------------------------------- Rechner-Verzeichnis über dem Fuß */
.tools-index { margin-top: 72px; border-top: 1px solid var(--rule); background: var(--bg-2); }
.tools-index-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding-top: 36px; padding-bottom: 36px; }
.tools-col-h { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.tools-col-h a { color: var(--ink); text-decoration: none; }
.tools-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tools-col li a { color: var(--ink-2); text-decoration: none; font-size: 14.5px; }
.tools-col li a:hover { color: var(--ink); text-decoration: underline; }
.tools-index + .site-footer { padding-top: 0; }
.tools-index + .site-footer .footer-inner { border-top: 0; }

/* Ergebnis-Leiste auf dem Handy: zeigt das Hauptergebnis, solange das Ergebnis-Feld nicht zu sehen ist */
.out-peek { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1020px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .out-peek { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 11px 14px 11px 16px; border-radius: 14px; background: var(--ink); color: #fff; text-decoration: none; box-shadow: 0 12px 30px -10px rgba(21, 21, 26, 0.55); transform: translateY(0); transition: transform 0.2s, opacity 0.2s; }
  .out-peek[hidden] { display: flex; transform: translateY(140%); opacity: 0; pointer-events: none; visibility: hidden; }
  .out-peek-l { font-size: 13.5px; color: #c9c9d1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .out-peek b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--yellow); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .out-peek-go { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; white-space: nowrap; }
  .out-peek-go .ico { width: 15px; height: 15px; transform: rotate(90deg); }
  .calc-body { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .calc-aside { position: static; }
  .tool-cat-head { grid-template-columns: minmax(0, 1fr); }
  .tools-index-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .crumbs { padding-top: 14px; font-size: 13.5px; }
  .calc-head { padding: 14px 0 18px; }
  .calc-lead p { font-size: 17px; }
  .calc { border-radius: 16px; margin: 0 -4px; }
  .calc-in { padding: 20px 16px 18px; }
  .calc-out { padding: 22px 16px 18px; }
  .fields { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .field-short { max-width: none; }
  .modes-row { display: flex; }
  .mode { flex: 1; }
  .mode span { text-align: center; padding: 9px 10px; }
  .out-actions .btn { width: auto; flex: 1 1 auto; }
  .out-row dt { font-size: 14px; }
  .calc-body { margin-top: 40px; }
  .hub-head { padding-top: 28px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .tools-index-inner { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .rechner-page .wrap > .cc-hint { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card, .tool-arrow, .control input, .mode span, .prose summary::after, .out-peek { transition: none; }
}
