/* © 2026 Martin Scherer · Fachwerte (https://www.fachwerte.de) · Alle Rechte vorbehalten.
   Aufmaß- und Wohnflächenrechner — Original: https://www.fachwerte.de/tools/aufmass/
   Kopieren, Umbenennen oder Veröffentlichen nur mit schriftlicher Zustimmung
   (§§ 69a ff. UrhG). Kennung FWAU-2026-09-16 */

/* ─── Kopf ──────────────────────────────────────────────────────────────── */
.au-intro { max-width: 92rem; margin: 0 auto; padding: 2.2rem 1rem 0; }
@media (min-width: 40rem) { .au-intro { padding-left: 1.5rem; padding-right: 1.5rem; } }
.au-eyebrow { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .17em; color: var(--fw-accent); margin-bottom: .85rem; }
.au-intro h1 { font-size: clamp(1.8rem, 3.4vw, 3rem); letter-spacing: -.04em; line-height: 1.12; margin: 0 0 .9rem; font-weight: 400; }
.au-intro h1 strong { font-weight: 700; }
.au-intro > p { max-width: 68ch; line-height: 1.65; color: var(--fw-text-2); margin: 0; font-size: .95rem; }
.au-intro .au-meta { font-size: .78rem; color: var(--fw-muted); margin-top: .5rem; }
.au-intro .au-meta a { color: inherit; }

/* ─── Rahmen der Anwendung ──────────────────────────────────────────────── */
.au-app [hidden] { display: none !important; }
.au-app { max-width: 92rem; margin: 1.6rem auto 0; padding: 0 1rem; font-family: var(--fw-font); }
@media (min-width: 40rem) { .au-app { padding: 0 1.5rem; } }
.au-kasten { border: 1px solid var(--fw-border); border-radius: 18px; background: var(--fw-bg); overflow: hidden; box-shadow: 0 12px 45px rgba(40, 50, 45, .08); }

.au-bar { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--fw-border); background: var(--fw-bg); }
.au-bar-spacer { flex: 1 1 auto; }

.au-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.45rem;
          padding: .35rem .7rem; border: 1px solid var(--fw-border-str); border-radius: 8px;
          background: var(--fw-bg); color: var(--fw-text); font: inherit; font-size: .84rem;
          font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.au-btn:hover { border-color: var(--fw-accent); }
.au-btn:focus-visible { outline: 2px solid var(--fw-accent); outline-offset: 3px; }
.au-btn--primary { background: var(--fw-accent); border-color: var(--fw-accent); color: #fff; }
.au-btn--quiet { border-color: transparent; background: transparent; color: var(--fw-text-2); }
.au-btn--klein { min-height: 2.05rem; font-size: .78rem; padding: .25rem .55rem; }
@media (prefers-reduced-motion: reduce) { .au-btn { transition: none; } }

/* ─── Bühne links, Seitenleiste rechts ──────────────────────────────────── */
.au-grid { display: grid; grid-template-columns: minmax(0, 1fr) 23rem; height: clamp(38rem, 84vh, 70rem); }
.au-mitte { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.au-mitte > div { flex: 1 1 auto; min-height: 0; }
.au-seite { overflow: auto; min-height: 0; background: var(--fw-surface); border-left: 1px solid var(--fw-border); }
.au-seite-inhalt { padding: 1rem; }
@media (max-width: 64rem) {
    .au-grid { grid-template-columns: minmax(0, 1fr); height: auto; }
    .au-seite { border-left: 0; border-top: 1px solid var(--fw-border); }
    .au-app { padding: 0; }
    .au-kasten { border-left: 0; border-right: 0; border-radius: 0; }
}

/* Die Bühne des Grundriss-Kerns füllt die Spalte. Der Kern bringt für seine
   Planfläche eine feste Höhe von 38rem mit, gedacht für Wirte ohne eigenes
   Raster. Hier gibt das Raster die Höhe vor: #au-buehne ist so hoch wie die
   Spalte, .gk-app übernimmt sie ganz, und die Planfläche wächst als
   Flex-Kind in den Rest — ohne Kernhöhe, ohne Deckel bei 75vh. Vorher blieb
   der Kern bei seinem Mindestmaß von 22rem stehen, egal wie groß das
   Fenster war (Martins Befund vom 22.09.2026). */
#au-buehne { display: flex; flex-direction: column; }
.au-mitte .gk-app { flex: 1 1 auto; min-height: 0; height: 100%; }
.au-mitte .gk-plan { flex: 1 1 auto; height: auto; min-height: 0; max-height: none; }
@media (max-width: 64rem) { .au-mitte .gk-plan { height: 60vh; min-height: 24rem; flex: none; } }

/* ─── Vollbild ───────────────────────────────────────────────────────────
   Nur der Werkzeugkasten steht auf dem Schirm: kein Seitenkopf, kein
   Aufmaßblatt, keine Anleitung. Das Raster bekommt die ganze übrige Höhe.
   Beide Schreibweisen brauchen eigene Regeln — eine unbekannte Pseudoklasse
   in einer gemeinsamen Liste macht die ganze Regel ungültig. */
.au-app:fullscreen { max-width: none; height: 100%; margin: 0; padding: .6rem .8rem; display: flex; flex-direction: column; background: var(--fw-bg); overflow: hidden; }
.au-app:fullscreen .au-kasten { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.au-app:fullscreen .au-grid { flex: 1 1 auto; min-height: 0; height: auto; }
.au-app:fullscreen .au-bericht, .au-app:fullscreen .au-anleitung { display: none; }
.au-app:-webkit-full-screen { max-width: none; height: 100%; margin: 0; padding: .6rem .8rem; display: flex; flex-direction: column; background: var(--fw-bg); overflow: hidden; }
.au-app:-webkit-full-screen .au-kasten { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.au-app:-webkit-full-screen .au-grid { flex: 1 1 auto; min-height: 0; height: auto; }
.au-app:-webkit-full-screen .au-bericht, .au-app:-webkit-full-screen .au-anleitung { display: none; }

/* ─── Felder in der Seitenleiste ────────────────────────────────────────── */
.au-block { background: var(--fw-bg); border: 1px solid var(--fw-border); border-radius: 10px; padding: .7rem .8rem; margin: 0 0 .7rem; }
.au-block > summary { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fw-text-2); cursor: pointer; padding: .15rem 0; }
.au-block[open] > summary { margin-bottom: .85rem; }

.au-feld { margin: 0 0 .75rem; }
.au-feld > label, .au-lbl { display: block; font-size: .74rem; font-weight: 600; color: var(--fw-text-2); margin: 0 0 .35rem; }
.au-input, .au-select { font: inherit; font-size: .88rem; padding: .5rem .6rem; border: 1px solid var(--fw-border-str);
                        border-radius: 7px; background: var(--fw-bg); color: var(--fw-text); width: 100%; min-width: 0; }
.au-input:focus, .au-select:focus { outline: 2px solid var(--fw-accent); outline-offset: 1px; }
textarea.au-input { resize: vertical; line-height: 1.5; }
.au-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.au-haken { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 500; color: var(--fw-text-2); margin: .3rem 0 0; }
.au-haken input { accent-color: var(--fw-accent); width: 1rem; height: 1rem; }

.au-hinw { display: block; font-size: .73rem; color: var(--fw-muted); margin: .3rem 0 0; line-height: 1.5; }
.au-hinw.ist-warn { color: #7a3a0d; background: #fff4e8; border-radius: 6px; padding: .45rem .6rem; }
.au-leer { font-size: .82rem; color: var(--fw-muted); line-height: 1.55; margin: .3rem 0 .6rem; }

.au-raumkopf { border: 1px solid var(--fw-accent); background: var(--fw-accent-sf); border-radius: 8px; padding: .6rem .7rem; margin: 0 0 .7rem; }
.au-raumkopf strong { display: block; font-size: .95rem; }
.au-raumkopf span { display: block; font-size: .75rem; color: var(--fw-text-2); margin-top: .15rem; }
.au-raumkopf .au-raumkopf-wf { font-weight: 700; color: var(--fw-accent); font-size: .9rem; margin-top: .3rem; }
.au-zeile-kn { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .9rem; }

/* ─── Nachtragbare Listen (Schrägen, Abzüge, Nischen, Öffnungen) ────────── */
.au-unterblock { border-top: 1px solid var(--fw-border); margin: .9rem 0 0; padding-top: .6rem; }
.au-unterblock > summary { font-size: .78rem; font-weight: 700; color: var(--fw-text); cursor: pointer; padding: .2rem 0; }
.au-liste { margin: .5rem 0 0; }
.au-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.2rem, 1fr)); gap: .3rem; align-items: end;
            padding: .45rem; border: 1px solid var(--fw-border); border-radius: 8px; background: var(--fw-surface); margin: 0 0 .35rem; }
.au-zelle { min-width: 0; }
.au-zelle.ist-weit { grid-column: span 2; }
.au-zelle--weg { display: flex; flex-direction: column; align-items: flex-end; }
.au-zelle-l { display: block; font-size: .64rem; color: var(--fw-muted); margin: 0 0 .15rem; line-height: 1.2; }
.au-zelle .au-input, .au-zelle .au-select { padding: .3rem .35rem; font-size: .8rem; border-radius: 5px; }
.au-zelle .au-haken { margin: .25rem 0 0; font-size: .74rem; }
.au-zeile-fuss { font-size: .71rem; color: var(--fw-muted); margin: -.2rem 0 .55rem; padding: 0 .45rem; line-height: 1.45; }
.au-tf { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .78rem; color: var(--fw-text-2); margin: .3rem 0; }
.au-tf .au-input { width: 5rem; padding: .25rem .35rem; font-size: .78rem; }

/* ─── Ergebnisblatt ─────────────────────────────────────────────────────── */
.au-bericht { margin: 1.8rem auto 0; padding: 1.6rem clamp(1rem, 3vw, 2.25rem) 1.9rem; max-width: 62rem;
              background: var(--fw-bg); border: 1px solid var(--fw-border); border-radius: 16px; }
.au-bericht h2 { font-size: 1.05rem; margin: 1.6rem 0 .5rem; }
.au-bericht h3 { font-size: .92rem; margin: 1.1rem 0 .35rem; }
.au-b-kopf { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 2px solid var(--fw-text); padding-bottom: .6rem; }
.au-b-kopf h2 { font-size: 1.3rem; margin: 0 0 .3rem; }
.au-b-kopf p { margin: 0; font-size: .84rem; color: var(--fw-text-2); line-height: 1.5; }
.au-b-meta { text-align: right; font-size: .78rem; color: var(--fw-muted); white-space: nowrap; line-height: 1.5; }
@media (max-width: 48rem) { .au-b-kopf { flex-direction: column; } .au-b-meta { text-align: left; } }

.au-b-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; margin: 1rem 0 .5rem; }
.au-kachel { padding: .9rem 1rem; border: 1px solid var(--fw-border); border-radius: 10px; background: var(--fw-surface); }
.au-kachel.ist-warn { background: #fff4e8; border-color: #f0c9a0; }
.au-kachel-l { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fw-muted); }
.au-kachel strong { display: block; font-size: 1.35rem; margin: .1rem 0; }
.au-kachel-t { display: block; font-size: .74rem; color: var(--fw-text-2); line-height: 1.45; }

.au-b-plan { margin: 1.2rem 0 .5rem; }
.au-b-planbild { position: relative; width: 100%; height: 0; border: 1px solid var(--fw-border); border-radius: var(--fw-radius); background: #fff; overflow: hidden; }
.au-b-planbild > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.au-b-plansvg { position: absolute; inset: 0; }
.au-b-plansvg svg { width: 100%; height: 100%; display: block; }
.au-b-plan figcaption { font-size: .76rem; color: var(--fw-muted); margin-top: .4rem; line-height: 1.5; }

.au-tab-wrap { overflow-x: auto; }
.au-tab { width: 100%; border-collapse: collapse; font-size: .82rem; }
.au-tab th, .au-tab td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--fw-border); vertical-align: top; line-height: 1.45; }
.au-tab thead th { font-weight: 600; color: var(--fw-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; background: var(--fw-surface); white-space: nowrap; }
.au-tab td.ist-zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.au-tab tr.ist-summe td { font-weight: 700; border-top: 2px solid var(--fw-text); background: var(--fw-surface); }
.au-tab--weg td:first-child { width: 72%; color: var(--fw-text-2); }
.au-tab--weg td.ist-zahl { font-weight: 600; }
.au-tab--material td:nth-child(3) { color: var(--fw-muted); font-size: .76rem; }
.au-weg { margin: .8rem 0 1.2rem; }
.au-hinweis { font-size: .84rem; line-height: 1.55; padding: .6rem .8rem; border-radius: var(--fw-radius); background: var(--fw-accent-sf); margin: .6rem 0; color: var(--fw-text-2); }
.au-hinweis.ist-warn { background: #fff4e8; color: #7a3a0d; }
.au-material { margin: 1.4rem 0 0; border: 1px solid var(--fw-border); border-radius: 10px; padding: .7rem .9rem; }
.au-material > summary { font-size: .9rem; font-weight: 700; cursor: pointer; }
.au-b-fuss { font-size: .76rem; color: var(--fw-muted); border-top: 1px solid var(--fw-border); padding-top: .7rem; margin: 1.6rem 0 0; line-height: 1.6; }
.au-b-fuss p { margin: 0 0 .4rem; }

/* ─── Touch ─────────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
    .au-btn { min-height: 2.6rem; }
    .au-input, .au-select { padding: .6rem .65rem; }
    .au-zelle .au-input, .au-zelle .au-select { padding: .45rem .4rem; font-size: .85rem; }
}

/* ─── Aufmaßblatt drucken: A4, nur das Ergebnisblatt ────────────────────── */
@media print {
    body > *:not(main), main > *:not(.au-app), .au-app > *:not(.au-bericht) { display: none !important; }
    .au-app { max-width: none; margin: 0; padding: 0; }
    .au-bericht { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; color: #000; font-size: 10pt; }
    .au-bericht h2 { font-size: 11.5pt; margin: .7rem 0 .3rem; break-after: avoid; }
    .au-bericht h3 { font-size: 10.5pt; break-after: avoid; }
    .au-b-kopf h2 { font-size: 16pt; }
    .au-b-kopf p, .au-b-meta { font-size: 8.5pt; color: #333; }
    .au-b-kacheln { grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .5rem 0; }
    .au-kachel { padding: .4rem .55rem; border-color: #999; background: #fff; break-inside: avoid; }
    .au-kachel strong { font-size: 12pt; }
    .au-kachel-l, .au-kachel-t { font-size: 7pt; }
    .au-b-plan { margin: .5rem auto; break-inside: avoid; max-width: 150mm; }
    .au-b-planbild { border-color: #999; }
    .au-b-plan figcaption { font-size: 8pt; }
    .au-tab { font-size: 8.5pt; }
    .au-tab th, .au-tab td { padding: .12rem .3rem; border-bottom: 1px solid #bbb; }
    .au-tab thead th { background: #eee; color: #000; font-size: 7pt; }
    .au-tab tr { break-inside: avoid; }
    .au-tab tr.ist-summe td { background: #eee; }
    .au-tab-wrap { overflow: visible; }
    .au-weg { break-inside: auto; }
    .au-hinweis, .au-hinweis.ist-warn { background: #fff; border-left: 3px solid #999; border-radius: 0; padding: .2rem .5rem; font-size: 8.5pt; color: #000; }
    .au-hinw { font-size: 8pt; color: #444; }
    .au-hinw.ist-warn { background: #fff; color: #000; padding: 0; }
    .au-material { border: 0; padding: 0; }
    .au-material > summary { list-style: none; font-size: 11.5pt; }
    .au-material > summary::-webkit-details-marker { display: none; }
    .au-b-fuss { font-size: 7.5pt; }
    @page { size: A4 portrait; margin: 14mm; }
}

/* ─── SEO-Teil und Anleitung ────────────────────────────────────────────── */
.au-seo { max-width: 72ch; margin: 0 auto; padding: 2.5rem var(--fw-pad, 1.5rem) 4rem; }
.au-seo h2 { font-size: 1.25rem; margin: 2.2rem 0 .7rem; }
.au-seo h3 { font-size: 1rem; margin: 1.3rem 0 .4rem; }
.au-seo p, .au-seo li { line-height: 1.7; color: var(--fw-text-2); }
.au-seo table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: .6rem 0 1rem; }
.au-seo th, .au-seo td { padding: .5rem .65rem; border-bottom: 1px solid var(--fw-border); text-align: left; vertical-align: top; line-height: 1.5; }
.au-seo th { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fw-muted); font-weight: 500; background: var(--fw-surface); }
.au-seo .au-kurz { background: var(--fw-accent-sf); border-radius: var(--fw-radius-lg); padding: 1rem 1.25rem; margin: 1rem 0; }
.au-seo .au-kurz ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.au-seo .autor-box { margin: 2.5rem 0 0; background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: var(--fw-radius-lg); padding: 1.25rem 1.5rem; display: flex; gap: 1.2rem; align-items: flex-start; }
.au-seo .autor-box img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.au-seo .autor-box .ab-name { font-weight: 700; color: var(--fw-text); font-size: .95rem; }
.au-seo .autor-box .ab-role { font-size: .78rem; color: var(--fw-accent); font-weight: 600; margin-bottom: .35rem; }
.au-seo .autor-box p { font-size: .85rem; margin: 0; }
@media (max-width: 560px) { .au-seo .autor-box { flex-direction: column; } }
.au-seo .quellen { margin: 1.5rem 0 0; font-size: .78rem; color: var(--fw-muted); line-height: 1.7; }
.au-seo .quellen ul { list-style: none; padding: 0; margin: 0; }
.au-seo .quellen li { font-size: .8rem; margin: 0 0 .3rem; }
.au-seo .au-weiter { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .7rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.au-seo .au-weiter a { display: block; padding: .8rem 1rem; border: 1px solid var(--fw-border); border-radius: var(--fw-radius-lg); text-decoration: none; color: var(--fw-text); font-size: .88rem; font-weight: 600; }
.au-seo .au-weiter a:hover { border-color: var(--fw-accent); }
.au-seo .au-weiter span { display: block; font-size: .76rem; color: var(--fw-muted); margin-top: .2rem; font-weight: 400; }

.au-anleitung { max-width: 62rem; margin: 1.8rem auto 0; background: var(--fw-bg); border: 1px solid var(--fw-border); border-radius: var(--fw-radius-lg); scroll-margin-top: 5.5rem; }
.au-anleitung > summary { list-style: none; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "icon title chev" "icon sub chev"; column-gap: .75rem; align-items: center; padding: .85rem 1.1rem; cursor: pointer; border-radius: var(--fw-radius-lg); }
.au-anleitung > summary::-webkit-details-marker { display: none; }
.au-anleitung > summary:hover { background: var(--fw-surface); }
.au-anleitung > summary:focus-visible { outline: 2px solid var(--fw-accent); outline-offset: 2px; }
.au-anleitung .anl-icon { grid-area: icon; font-size: 1.35rem; }
.au-anleitung .anl-title { grid-area: title; font-weight: 700; font-size: 1rem; color: var(--fw-accent); }
.au-anleitung .anl-sub { grid-area: sub; font-size: .78rem; color: var(--fw-muted); line-height: 1.45; margin-top: .1rem; }
.au-anleitung .anl-chevron { grid-area: chev; color: var(--fw-muted); font-size: 1.1rem; transition: transform .2s; }
.au-anleitung[open] > summary { border-bottom: 1px solid var(--fw-border); border-radius: var(--fw-radius-lg) var(--fw-radius-lg) 0 0; }
.au-anleitung[open] .anl-chevron { transform: rotate(180deg); }
.au-anleitung .anl-body { padding: .4rem clamp(1rem, 3vw, 2.25rem) 1.75rem; }
.au-anleitung .anl-lead { font-size: .95rem; line-height: 1.65; color: var(--fw-text-2); margin: .8rem 0 1rem; }
.au-anleitung h3 { font-size: 1.08rem; margin: 1.9rem 0 .5rem; scroll-margin-top: 5.5rem; }
.au-anleitung h4 { font-size: .92rem; margin: 1.1rem 0 .3rem; }
.au-anleitung p, .au-anleitung li { font-size: .9rem; line-height: 1.65; color: var(--fw-text-2); }
.au-anleitung p { margin: 0 0 .7rem; }
.au-anleitung ul, .au-anleitung ol { margin: .3rem 0 .8rem; padding-left: 1.3rem; }
.au-anleitung li { margin: 0 0 .35rem; }
.au-anleitung li strong, .au-anleitung p strong { color: var(--fw-text); }
.au-anleitung a { color: var(--fw-accent); }
.au-anleitung figure { margin: .9rem 0 1.1rem; }
.au-anleitung figure img { width: 100%; height: auto; border: 1px solid var(--fw-border); border-radius: var(--fw-radius); background: #fff; }
.au-anleitung figcaption { font-size: .78rem; color: var(--fw-muted); margin-top: .35rem; line-height: 1.5; }
.au-anleitung table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: .4rem 0 1rem; }
.au-anleitung th, .au-anleitung td { text-align: left; padding: .4rem .55rem; border-bottom: 1px solid var(--fw-border); vertical-align: top; line-height: 1.5; }
.au-anleitung th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--fw-muted); background: var(--fw-surface); font-weight: 600; }
.anl-kurz { display: grid; gap: .55rem; grid-template-columns: 1fr; margin: .5rem 0 .8rem; }
@media (min-width: 40rem) { .anl-kurz { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .anl-kurz { grid-template-columns: repeat(3, 1fr); } }
.anl-kurz div { background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: var(--fw-radius-lg); padding: .7rem .85rem; font-size: .84rem; line-height: 1.5; color: var(--fw-text-2); }
.anl-kurz strong { display: block; color: var(--fw-accent); margin-bottom: .15rem; }
.anl-tabelle { overflow-x: auto; }
@media (max-width: 48rem) {
    .au-anleitung > summary { grid-template-columns: auto 1fr; grid-template-areas: "icon title" "icon sub"; }
    .au-anleitung .anl-chevron { display: none; }
}
