/* BauGenie v0.68 – mobile Bedienung, App-Ergebnisse und wärmere Akzente */
:root { --accent-warm:#d59528; --accent-warm-soft:#fff4dd; }
body.pwa-standalone { height:100vh;min-height:100vh;height:100dvh;min-height:100dvh; }

/* Der aktive Zustand ist auf Website und App eindeutig erkennbar. */
.home-tool-tab.active,.misc-tool-tab.active,.tool-tab.active,.heatpump-subtab.active {
  box-shadow:inset 0 3px var(--accent-warm);
}
.button-primary:focus-visible,.outline-button:focus-visible,.tool-tab:focus-visible,
.home-tool-tab:focus-visible,.app-nav-item:focus-visible,.app-tool-option:focus-visible,
.knowledge-toggle:focus-visible,.app-knowledge-index a:focus-visible {
  outline:3px solid var(--accent-warm);outline-offset:2px;
}
.next-step-card,.result-guidance { border-color:#e3c689; }

.app-result-jump,.app-knowledge-index,.knowledge-toggle { display:none; }

/* Das feste App-Ergebnis nimmt nur eine Zeile ein. Weitere Werte bleiben im Rechner sichtbar. */
body.pwa-standalone .app-mode-top { width:min(720px,calc(100% - 24px));padding:8px 0 10px!important; }
body.pwa-standalone .app-result-head { margin-bottom:3px; }
body.pwa-standalone .app-result-head span { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px; }
body.pwa-standalone .app-result-head b { flex:none;font-size:9px; }
body.pwa-standalone .app-result-grid { display:block; }
body.pwa-standalone .app-result-item { display:flex;align-items:baseline;gap:8px;padding:0;border:0;background:none;text-align:left; }
body.pwa-standalone .app-result-item:not(:first-child) { display:none; }
body.pwa-standalone .app-result-item strong { flex:none;max-width:62%;font-size:clamp(17px,5vw,22px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
body.pwa-standalone .app-result-item small { min-height:0;margin:0;color:#e4ecea;font-size:11px;line-height:1.25; }
body.pwa-standalone .app-result-jump { display:inline-flex;min-height:34px;margin-top:3px;padding:5px 0;border:0;background:transparent;color:#ffdc91;font-size:11px;font-weight:800; }
body.pwa-standalone .app-result-jump:focus-visible { outline:2px solid #ffdc91;outline-offset:2px; }
body.pwa-standalone .home-calc-result,body.pwa-standalone .calculator-result,
body.pwa-standalone .precast-result,body.pwa-standalone .scope-result {
  display:block!important;width:100%;margin:14px 0 0;padding:17px;border:1px solid #d6e1d9;border-radius:12px;background:#edf5f2;
}
body.pwa-standalone .home-calc-result,body.pwa-standalone .calculator-result,
body.pwa-standalone .precast-result,body.pwa-standalone .scope-result,
body.pwa-standalone .pcf-result-grid,body.pwa-standalone .mass-comparison-card { scroll-margin-top:14px; }
body.pwa-standalone .scope-result { display:block!important; }
body.pwa-standalone .project-quickbar,body.pwa-standalone #beton .project-backup-bar { display:grid!important;margin:12px 0; }
body.pwa-standalone .project-quickbar-actions { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
body.pwa-standalone .project-quickbar-actions button { min-height:44px;font-size:12px; }
body.pwa-standalone [data-print-target],body.pwa-standalone [data-csv-target] { display:inline-flex!important;align-items:center;justify-content:center;min-height:44px; }
body.pwa-standalone .export-actions,body.pwa-standalone .tool-export-actions { display:flex!important;flex-wrap:wrap;gap:8px; }
body.pwa-standalone .app-nav-item { font-size:11px;font-size:clamp(10px,2.8vw,12px);min-height:49px; }
body.pwa-standalone .app-bottom-nav { padding:5px 7px 7px;padding:5px max(7px,env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-right)); }
body.pwa-standalone .app-nav-item b { min-height:42px;white-space:normal;line-height:1.15;overflow-wrap:anywhere; }
body.pwa-standalone .app-nav-item.active b { background:var(--accent-warm-soft);color:#63420e;box-shadow:inset 0 3px var(--accent-warm); }
body.pwa-standalone .app-tool-sheet { overflow-y:auto;align-items:center; }
body.pwa-standalone .app-tool-sheet-card { overflow-y:auto;max-height:100%; }
body.pwa-standalone .app-tool-sheet-close { width:44px;height:44px; }
body.pwa-standalone .app-tool-option.active { border-color:var(--accent-warm);background:var(--accent-warm-soft);color:#63420e; }

/* In der App kann ein Wissensartikel direkt aus der Themenliste geöffnet werden. */
body.pwa-standalone .app-knowledge-index { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 18px; }
body.pwa-standalone .app-knowledge-index a { display:flex;align-items:center;min-height:48px;padding:10px;border:1px solid #cbded6;border-radius:8px;background:#fff;color:var(--navy);font-size:12px;font-weight:700;text-decoration:none; }
body.pwa-standalone .knowledge-topic-overview { display:none!important; }
body.pwa-standalone .knowledge-card { scroll-margin-top:12px; }
body.pwa-standalone .knowledge-card.knowledge-collapsed:not(.knowledge-open)>:not(.knowledge-number):not(h3):not(.knowledge-toggle) { display:none!important; }
body.pwa-standalone .knowledge-toggle { display:inline-flex;align-items:center;min-height:44px;margin-top:7px;padding:9px 13px;border:1px solid #c5994c;border-radius:7px;background:var(--accent-warm-soft);color:#63420e;font-size:12px;font-weight:800; }

/* Kleine Telefone erhalten Karten statt horizontaler Eingabetabellen. */
@media (max-width:720px) {
  .materials-table,.scope-table,.mass-parts-table,.pcf-table,.pcf-a3-table { display:block!important;width:100%!important;min-width:0!important; }
  .materials-table thead,.scope-table thead,.mass-parts-table thead,.pcf-table thead,.pcf-a3-table thead { display:none!important; }
  .materials-table tbody,.scope-table tbody,.mass-parts-table tbody,.pcf-table tbody,.pcf-a3-table tbody { display:grid;gap:12px; }
  .materials-table tr,.scope-table tr,.mass-parts-table tr,.pcf-table tr,.pcf-a3-table tr { display:grid;gap:10px;padding:14px;border:1px solid #d2e0da;border-radius:10px;background:#fff; }
  .materials-table td,.scope-table td,.mass-parts-table td,.pcf-table td,.pcf-a3-table td {
    display:block!important;width:100%!important;min-width:0!important;padding:0!important;border:0!important;white-space:normal!important;overflow-wrap:anywhere;text-align:left!important;
  }
  .pcf-a3-table td[hidden],.pcf-table td[hidden] { display:none!important; }
  .materials-table td::before,.scope-table td::before,.mass-parts-table td::before,.pcf-table td::before,.pcf-a3-table td::before {
    display:block;margin-bottom:4px;color:#4e6570;font-size:12px;font-weight:750;
  }
  .materials-table td:nth-child(1)::before{content:'Ausgangsstoff'}
  .materials-table td:nth-child(2)::before{content:'Menge · kg/m³'}
  .materials-table td:nth-child(3)::before{content:'Faktor · kg CO₂e/kg'}
  .materials-table td:nth-child(4)::before{content:'Quelle / Hinweis'}
  .materials-table td:nth-child(5)::before{content:'Beitrag · kg CO₂e/m³'}
  .scope-table td:nth-child(1)::before{content:'Aktivität'}
  .scope-table td:nth-child(2)::before{content:'Jahresmenge'}
  .scope-table td:nth-child(3)::before{content:'Einheit'}
  .scope-table td:nth-child(4)::before{content:'Faktor · kg CO₂e je Einheit'}
  .scope-table td:nth-child(5)::before{content:'Faktorquelle / Hinweis'}
  .scope-table td:nth-child(6)::before{content:'Beitrag · kg CO₂e'}
  .mass-parts-table td:nth-child(1)::before{content:'Bauteil / Produkt'}
  .mass-parts-table td:nth-child(2)::before{content:'Betonmenge'}
  .mass-parts-table td:nth-child(3)::before{content:'Bewehrung'}
  .mass-parts-table td:nth-child(4)::before{content:'Ergebnis A1'}
  .pcf-table td:nth-child(1)::before{content:'Ausgangsstoff'}
  .pcf-table td:nth-child(2)::before{content:'Menge je m³'}
  .pcf-table td:nth-child(3)::before{content:'Entfernung · km'}
  .pcf-table td:nth-child(4)::before{content:'A2 · kg CO₂e'}
  .pcf-table td:nth-child(5)::before{content:'A2 · kg CO₂e je Bauteil'}
  .pcf-a3-table td:nth-child(1)::before{content:'Energie / Verbrauch'}
  .pcf-a3-table td:nth-child(2)::before{content:'Menge'}
  .pcf-a3-table td:nth-child(3)::before{content:'Einheit'}
  .pcf-a3-table td:nth-child(4)::before{content:'CO₂e je m³'}
  .pcf-a3-table td:nth-child(5)::before{content:'CO₂e je Bauteil / Faktor'}
  .pcf-a3-table td:nth-child(6)::before{content:'Faktor · kg CO₂e/Einheit'}
  .materials-table input,.materials-table select,.scope-table input,.scope-table select,
  .mass-parts-table input,.mass-parts-table select,.pcf-table input,.pcf-table select,
  .pcf-a3-table input,.pcf-a3-table select { width:100%;min-width:0;min-height:44px;font-size:16px; }
  .materials-table .row-remove,.scope-table .row-remove,.mass-parts-table .row-remove,.pcf-a3-table .row-remove,
  .recipe-tab-item .tab-remove { width:auto;min-width:44px;height:44px;min-height:44px;padding:0 12px; }
  .materials-table td:last-child,.scope-table td:last-child,.mass-parts-table td:last-child,.pcf-a3-table td:last-child { text-align:right!important; }
  .materials-table .table-wrap,.scope-table .table-wrap { overflow-x:visible; }
  .scope-table .scope-static-source,.scope-table .scope-static-unit { font-size:13px;line-height:1.4; }
  .small-note,.factor-hint,.scope-note,.pcf-story-intro p,.pcf-path small { font-size:12px;line-height:1.5; }
  .outline-button,.add-row,.text-button { min-height:44px;font-size:12px; }
  .hero-co2-card .co2-feeling-copy p,.hero-co2-card .co2-reference-card small { font-size:12px; }
  .hero-co2-card .co2-reference-card strong { overflow-wrap:anywhere; }
  body.pwa-standalone .app-knowledge-index { grid-template-columns:1fr; }
  body.pwa-standalone .app-tool-sheet-options { grid-template-columns:1fr; }
}
@media (max-width:380px) {
  body.pwa-standalone .app-result-head b { font-size:8px; }
  body.pwa-standalone .app-result-item strong { max-width:58%;font-size:16px; }
  body.pwa-standalone .app-result-item small { font-size:10px; }
  body.pwa-standalone .app-bottom-nav { padding-inline:max(3px,env(safe-area-inset-left)) max(3px,env(safe-area-inset-right)); }
}
@media print {
  .app-result-jump,.app-knowledge-index,.knowledge-toggle { display:none!important; }
  .knowledge-card.knowledge-collapsed>:not(.knowledge-number):not(h3):not(.knowledge-toggle) { display:block!important; }
}
