/* Ergänzungen zu /shared/polarwolke.css, nur für die Werkzeug-Seite */
[hidden] { display: none !important; }
.hero { padding-bottom: 24px; }
.small { font-size: .9rem; }
.back { margin: 24px 0 8px; }
.back a { text-decoration: none; }

/* Übersicht */
.grid.tools { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.grid.tools .card { padding: 16px 18px; }
.card h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.grid.tools .card p { margin-top: 4px; font-size: .9rem; }
.card.wide { margin-top: 8px; border-color: var(--accent); background: var(--accent-soft); }

/* Formular eines Werkzeugs */
.tool { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; align-items: end; margin-top: 16px; }
.tool label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.tool input[type=text], .tool input[type=date], .tool select {
    width: 100%; min-height: 44px; padding: 9px 12px; font: inherit; font-weight: 400; color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.tool label.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; color: var(--text); }
.tool .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn { min-height: 44px; }
.btn:disabled { opacity: .6; cursor: progress; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Ergebnis */
.out { margin-top: 20px; }
.out > * + * { margin-top: 14px; }
.result { padding: 18px 20px; font-size: 1.25rem; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.result strong { color: var(--accent); }
.note.err { border-color: var(--err); }
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 16px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
tr + tr > * { border-top: 1px solid var(--line); }
thead th { border-bottom: 1px solid var(--line); }
th { font-size: .9rem; font-weight: 600; color: var(--muted); }
tbody th { width: 38%; min-width: 9em; }
.st-ok span { color: var(--ok); font-weight: 700; }
.st-warn span { color: #b26a00; font-weight: 700; }
.st-bad span { color: var(--err); font-weight: 700; }
@media (prefers-color-scheme: dark) { .st-warn span { color: #e3b341; } }
.cal th, .cal td { text-align: center; padding: 10px 6px; }
.cal tbody th { width: auto; min-width: 0; }
.cal .today { font-weight: 700; color: var(--accent); background: var(--accent-soft); }
pre { margin: 0; padding: 16px; overflow-x: auto; font: .88rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; }
.pw { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pw code { font-size: 1.05rem; }

/* Mehrzeilige Eingabe und Farbmuster (Ergänzungen 10.10.2026) */
.tool label.wide { grid-column: 1 / -1; }
.tool textarea {
    width: 100%; min-height: 132px; padding: 10px 12px; font: .95rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 400;
    color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; resize: vertical;
}
.swatch { display: block; border: 1px solid var(--line); border-radius: var(--radius); }

/* Formular "Werkzeug vorschlagen" unten auf der Übersicht */
.feedback { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }

/* Kurzerklärung mit Formel (Ergänzung 10.10.2026) */
.info { margin-top: 14px; padding: 12px 16px; font-size: .95rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.info p { margin: 0; }
.info .formula { margin-top: 6px; font: .88rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; }

/* Diagramme (SVG, Farben nur hier – die Seite erlaubt keine Inline-Styles) */
.plot { margin: 0; padding: 12px 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.plot svg { display: block; width: 100%; height: auto; }
.plot text { font-size: 11px; fill: var(--muted); }
.plot .grid { stroke: var(--line); stroke-width: 1; }
.plot .frame { fill: none; stroke: var(--muted); stroke-width: 1; }
.plot .ref { stroke: var(--muted); stroke-width: 1; }
.plot path { fill: none; stroke-width: 2; stroke-linejoin: round; }
.plot path.s1 { stroke: var(--accent); }
.plot path.s2 { stroke: #d9480f; }
.plot path.s3 { stroke: var(--ok); }
.plot figcaption { margin-top: 6px; font-size: .85rem; color: var(--muted); }
.key { display: inline-block; width: 16px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.key.s1 { background: var(--accent); }
.key.s2 { background: #d9480f; }
.key.s3 { background: var(--ok); }
@media (prefers-color-scheme: dark) { .plot path.s2 { stroke: #ff922b; } .key.s2 { background: #ff922b; } }

/* Schaltbilder, Dreiecke, Blockbilder und Schieberegler (Ergänzung 10.10.2026) */
.sch svg { max-width: 620px; margin: 0 auto; }
.sch .w { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sch .c, .sch .pin { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.sch .m { fill: var(--surface); stroke: none; }
.sch .d, .sch .ah { fill: var(--text); stroke: none; }
.sch text { font-size: 13px; fill: var(--text); }
.sch text.val { fill: var(--accent); font-weight: 600; }
.sch .tri, .sch .box { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.sch .b0 { fill: #4dabf7; } .sch .b1 { fill: var(--ok); } .sch .b2 { fill: #f59f00; } .sch .b3 { fill: var(--err); }
.rng { display: grid; grid-template-columns: 5.2em 1fr; gap: 10px; align-items: center; }
.rng input[type=range] { width: 100%; min-height: 44px; accent-color: var(--accent); }

/* Aufklappbare Rubriken, Suchvorschlag, hervorgehobene Ergebniszeile (Ergänzung 11.10.2026) */
details.cat { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.cat > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 18px; cursor: pointer; list-style: none; }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary::before { content: "▸"; color: var(--accent); font-size: 1.1rem; transition: transform .15s; }
details.cat[open] > summary::before { transform: rotate(90deg); }
details.cat > summary h2 { flex: 1; margin: 0; font-size: 1.15rem; }
details.cat .count { min-width: 2.2em; padding: 2px 10px; text-align: center; font-size: .85rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; }
details.cat > .grid { padding: 4px 14px 16px; }
.card.none { margin-top: 16px; border-color: var(--accent); background: var(--accent-soft); }
.card.none p { margin: 0; }
tr.hit > * { background: var(--accent-soft); font-weight: 600; }

/* Farbringe, Balkentexte, Farbwähler (Ergänzung 11.10.2026) */
.sch text.on { fill: #111; font-weight: 600; }
.sch .rb { fill: #e8d5a8; stroke: var(--text); stroke-width: 2; }
.sch .cb0 { fill: #000; } .sch .cb1 { fill: #7b4a12; } .sch .cb2 { fill: #d62828; } .sch .cb3 { fill: #f77f00; } .sch .cb4 { fill: #ffd60a; } .sch .cb5 { fill: #2a9d3f; }
.sch .cb6 { fill: #1d5fd0; } .sch .cb7 { fill: #8338ec; } .sch .cb8 { fill: #8d99ae; } .sch .cb9 { fill: #fff; stroke: #999; } .sch .cbg { fill: #c9a227; } .sch .cbs { fill: #c0c0c0; }
.rng input[type=color] { width: 100%; min-height: 44px; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }

/* Glücksrad (Ergänzung 11.10.2026) */
.wheel { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(240px, 340px); gap: 24px; align-items: start; }
@media (max-width: 720px) { .wheel { grid-template-columns: 1fr; } }
.wheelbox svg { display: block; width: 100%; max-width: 440px; margin: 0 auto; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .28)); }
.wheelbox path, .wheelbox circle { stroke: rgba(255, 255, 255, .85); stroke-width: 1; }
.wheelbox .wr { fill: none; stroke: var(--text); stroke-width: 5; }
.wheelbox .wh { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.wheelbox .wp { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
.wl { font-size: 9px; font-weight: 700; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .4); stroke-width: 1.4px; }
.wl.small { font-size: 5.5px; }
.wheelside.tool { display: block; margin: 0; }
.wheelside label { margin-bottom: 12px; }
#gw_res { font-size: 1.6rem; text-align: center; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* Spiele im Stil der Seite: flaches Rad mit Zeiger rechts, Würfel, Münze, Teams, Timer (Ergänzung 11.10.2026) */
.wheelbox svg { max-width: 460px; filter: drop-shadow(0 10px 24px rgba(11, 95, 208, .18)); }
.wheelbox path, .wheelbox circle { stroke: var(--surface); stroke-width: 1.6; }
.wheelbox .wr { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.wheelbox .wh { fill: var(--surface); stroke: var(--surface); stroke-width: 0; }
.wheelbox .wd { fill: var(--accent); stroke: none; }
.wheelbox .wp { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; stroke-linejoin: round; }
.wl { font-size: 8.5px; font-weight: 600; fill: #fff; stroke: none; letter-spacing: .02em; }
.wheelside select, .wheelside input[type=text] { width: 100%; min-height: 44px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.dice { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 8px 0 18px; }
.die { width: 92px; height: 92px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .14)); }
.die rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.die circle { fill: var(--accent); }
.coinbox svg, .tbox svg { display: block; width: 100%; max-width: 240px; margin: 0 auto 16px; }
.coinbox svg { filter: drop-shadow(0 10px 20px rgba(11, 95, 208, .25)); }
.coin { fill: var(--accent); } .coin2 { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 2; } .cointxt { fill: #fff; font-size: 22px; font-weight: 700; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.team { padding: 14px 16px; } .team h3 { margin: 0 0 6px; color: var(--accent); } .team ul { margin: 0; padding-left: 18px; } .team p { margin: 0; }
.big { min-height: 3.2rem; margin: 8px 0; font-size: 2.4rem; font-weight: 800; text-align: center; color: var(--accent); overflow-wrap: anywhere; }
.tbg { fill: none; stroke: var(--line); stroke-width: 8; } .tring { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; } .ttxt { font-size: 22px; font-weight: 700; fill: var(--text); font-variant-numeric: tabular-nums; }

/* Timer mit Bombe, Zahlenwürfel, Verteilungsbalken (Ergänzung 11.10.2026) */
.tring.hot { stroke: var(--err); }
.bomb { fill: var(--text); } .fuse { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; } .spark { fill: #ff8c00; }
.dietxt { font-size: 24px; font-weight: 800; fill: var(--accent); }
.wheelside progress { width: 100%; height: 14px; accent-color: var(--accent); }

/* Vollbild für Spiele, Punktetafel (Ergänzung 11.10.2026) */
#out:fullscreen { padding: 32px; overflow: auto; background: var(--bg); }
#out:fullscreen .wheelbox svg { max-width: min(82vh, 900px); }
#out:fullscreen .big { font-size: 4.5rem; }
#out:fullscreen .die { width: 150px; height: 150px; }
#out:fullscreen .coinbox svg, #out:fullscreen .tbox svg { max-width: min(60vh, 520px); }
.score { display: grid; gap: 10px; }
.srow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.srow strong { flex: 1; font-size: 1.1rem; overflow-wrap: anywhere; }
.srow .pts { min-width: 2.4em; text-align: right; font-size: 1.8rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.srow .buttons { margin: 0; flex-wrap: nowrap; }
.srow.vorn { border-color: var(--accent); background: var(--accent-soft); }

/* Spiele mittig und größenabhängig: Grafik richtet sich nach Fensterbreite und -höhe (Ergänzung 11.10.2026) */
.wheel > :first-child { min-width: 0; }
.wheel:has(> .wheelbox, > .tbox, > .stage) { align-items: center; }
.wheelbox svg { max-width: min(560px, 74vh); }
.coinbox svg, .tbox svg { max-width: min(340px, 52vh); }
.die { width: clamp(64px, 16vw, 120px); height: auto; aspect-ratio: 1; }
.stage .result { text-align: center; }
.big { font-size: clamp(2rem, 6vw, 3.2rem); }
#out:fullscreen { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 100vh; padding: 4vmin; }
#out:fullscreen .wheel { width: 100%; margin: 0; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(240px, 22vw); gap: 4vmin; }
#out:fullscreen .wheelbox svg { max-width: min(100%, calc((100vh - 8vmin) * 1.07)); }
#out:fullscreen .tbox svg { max-width: min(100%, 100vh - 12vmin); margin-bottom: 0; }
#out:fullscreen .coinbox svg { max-width: min(100%, 100vh - 32vmin); }
#out:fullscreen .die { width: clamp(90px, 21vmin, 300px); height: auto; }
#out:fullscreen .dice { gap: 3vmin; }
#out:fullscreen .big { font-size: clamp(2.4rem, 10vmin, 9rem); }
#out:fullscreen .result { font-size: clamp(1.25rem, 4.5vmin, 3.2rem); }
#out:fullscreen .srow strong { font-size: clamp(1.1rem, 3.5vmin, 2.4rem); } #out:fullscreen .srow .pts { font-size: clamp(1.8rem, 6vmin, 4rem); }
#out:fullscreen .team { font-size: clamp(1rem, 2.6vmin, 1.8rem); } #out:fullscreen .teams { grid-template-columns: repeat(auto-fit, minmax(22vmin, 1fr)); }
@media (max-width: 720px) { #out:fullscreen .wheel { grid-template-columns: 1fr; } #out:fullscreen { align-items: flex-start; } }
.dice { --d: clamp(64px, 16vw, 120px); } .die { width: var(--d); }
#out:fullscreen .dice { --d: clamp(90px, 21vmin, 300px); } #out:fullscreen .die { width: var(--d); }
.dice:has(> :nth-child(5)) { max-width: calc(3 * var(--d) + 40px); margin-inline: auto; }
#out:fullscreen .dice:has(> :nth-child(5)) { max-width: calc(3 * var(--d) + 7vmin); }

/* Merkliste: Favoriten, zuletzt benutzt, gespeicherte Rechnungen */
.merkliste { margin-bottom: 20px; } .merkliste h2 { margin-bottom: 10px; font-size: 1.05rem; }
.merkliste .chips a { color: inherit; text-decoration: none; } .merkliste .chips li:hover { border-color: var(--accent); }
details.merkliste { padding: 14px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.merkliste summary { display: flex; align-items: center; gap: 10px; cursor: pointer; } details.merkliste summary h2 { margin: 0; }
.verlauf { margin: 14px 0 8px; padding: 0; list-style: none; }
.verlauf li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.verlauf li > div { flex: 1 1 320px; min-width: 0; } .verlauf p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; max-height: 5.2em; overflow: hidden; }
.verlauf .buttons, p.merk { margin: 0; } p.merk { margin-top: 16px; align-items: center; }

/* Breite Bildschirme: geschlossene Rubriken stehen zu zweit nebeneinander, eine geöffnete nimmt die ganze Breite */
@media (min-width: 900px) {
    #app { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
    #app > * { grid-column: 1 / -1; }
    #app > details.cat:not([open]) { grid-column: auto; }
}

/* QR-Code-Werkzeug */
.qr { display: grid; justify-items: center; padding: 18px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.qr svg { width: min(100%, 300px); height: auto; }

/* Rubriken: feste Kachelleiste, darunter ein Bereich mit den Werkzeugen der gewählten Rubrik (nichts springt, weiche Animation) */
.kat-leiste { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 16px; transition: opacity .25s; }
.kat-leiste.gedimmt { opacity: .55; }
.kat { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 18px; border: 1px solid var(--glas-rand); border-radius: 16px; color: var(--text); font: inherit; font-weight: 700; font-size: 1.04rem; text-align: left; cursor: pointer;
    background-color: color-mix(in srgb, var(--surface) var(--glas-karte), transparent); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
    transition: transform .15s ease, border-color .2s, background-color .25s, color .25s, box-shadow .25s; }
.kat:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.kat[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.kat .count { flex: none; min-width: 2.2em; padding: 2px 10px; text-align: center; font-size: .85rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; transition: background .25s, color .25s; }
.kat[aria-expanded="true"] .count { background: rgba(255, 255, 255, .24); color: #fff; }
.kat-panel { display: grid; grid-template-rows: 0fr; margin-top: 0; visibility: hidden; transition: grid-template-rows .38s cubic-bezier(.2, .7, .2, 1), margin-top .38s cubic-bezier(.2, .7, .2, 1), visibility 0s .38s; }
.kat-panel.offen { grid-template-rows: 1fr; margin-top: 14px; visibility: visible; transition-delay: 0s; }
.kat-innen { min-height: 0; overflow: hidden; border-radius: 22px; }
.kat-block { padding: 22px 22px 24px; border: 1px solid var(--glas-rand); border-radius: 22px; box-shadow: var(--shadow); background-color: color-mix(in srgb, var(--surface) var(--glas-karte), transparent); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); }
.kat-block + .kat-block { margin-top: 14px; }
.kat-block.wechsel { animation: kat-rein .32s cubic-bezier(.2, .7, .2, 1); }
.kat-titel { display: none; margin: 0 0 14px; font-size: 1.1rem; }
.kat-block.mit-titel .kat-titel { display: block; }
.kat-block .grid.tools .card { box-shadow: none; }
@keyframes kat-rein { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .kat-panel, .kat, .kat-leiste { transition: none; } .kat-block.wechsel { animation: none; } }
@media (max-width: 880px) { .kat-leiste { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } .kat { padding: 8px 12px; min-height: 52px; font-size: .98rem; } .kat-block { padding: 16px; } }

/* Rubriken, Feinschliff: Kacheln wie die Dienste-Karten der Startseite, Werkzeugkarten mit Hover-Anhebung */
.kat-leiste { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kat { min-height: 64px; padding: 12px 18px; border-radius: 18px; font-size: 1.05rem; box-shadow: var(--shadow); }
.kat .count { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.kat-block { padding: 24px 24px 26px; }
.kat-block .grid.tools { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.kat-block .grid.tools .card { padding: 16px 18px; border-radius: 16px; transition: transform .15s, border-color .2s, background-color .2s; }
.kat-block .grid.tools .card:hover { transform: translateY(-2px); border-color: var(--accent); }
.kat-block .grid.tools .card h3 { color: var(--text); }
