/* Heating owns its mobile table layout; global rules hide other table views. */
#heatingSection, #heatingSection .card, #heatingSection form,
#heatingSection .form-row, #heatingSection .form-row > div { min-width: 0; max-width: 100%; }
#heatingSection { overflow-wrap: anywhere; }
#heatingSection .form-row { grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); }
#heatingSection input, #heatingSection select { min-width: 0; max-width: 100%; }
#heatingSection label { display: block; margin-bottom: 6px; line-height: 1.45; }
#heatingSection h2, #heatingSection h3, #heatingSection h4 { line-height: 1.4; }
.heating-table-wrap { max-width: 100%; overflow-x: auto; margin: 12px 0; }
#heatingSection .heating-table { display: table; width: 100%; }
#heatingSection summary { cursor: pointer; line-height: 1.5; padding: 12px 0; }
#heatingSection .heating-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#heatingSection .heating-actions button { margin: 0 !important; }
@media (max-width: 768px) {
 #heatingSection > .card { padding: 16px; }
 #heatingSection .form-row { grid-template-columns: minmax(0,1fr) !important; }
 #heatingSection .form-input { width: 100%; font-size: 16px; min-height: 48px; }
 #heatingSection .season-write { width: 100%; white-space: normal; min-height: 48px; }
 #heatingSection .heating-actions { flex-direction: column; }
 #heatingSection .heating-table { display: block; }
 #heatingSection .heating-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 #heatingSection .heating-table tbody { display: grid; gap: 12px; }
 #heatingSection .heating-table tbody tr { display: block; border: 1px solid #dfe4ed; border-radius: 12px; overflow: hidden; background: white; }
 #heatingSection .heating-table tbody td { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 12px; padding: 12px; white-space: normal; text-align: right; overflow-wrap: anywhere; }
 #heatingSection .heating-table tbody td::before { content: attr(data-label); text-align: left; font-size: 13px; font-weight: 600; color: #526077; }
 #heatingSection .heating-table tbody td:last-child { border-bottom: 0; }
 #heatingSection .heating-table-wrap { overflow-x: visible; }
 .user-menu { flex-wrap: wrap; min-width: 0; }
 #pwaInstall { white-space: normal; min-height: 44px; }
}
@media (display-mode: standalone) { #pwaInstall { display: none; } }

/* Prevent the calculation matrix from stretching the app viewport. */
.app-container, .app-content, .content-section, .card { min-width: 0; }
.app-container { width: 100%; }
@media (max-width: 768px) {
 .app-header, .app-nav, .app-content, .content-section, .card { max-width: 100%; }
 #calculationSection { overflow-wrap: anywhere; }
 #calculationSection table { display: block; width: 100%; font-size: 14px; }
 #calculationSection thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 #calculationSection tbody { display: grid; gap: 14px; }
 #calculationSection tbody tr { display: block; background: #f8faff; border: 1px solid #dfe4ed; border-radius: 12px; overflow: hidden; }
 #calculationSection tbody td { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; white-space: normal; text-align: right; overflow-wrap: anywhere; padding: 12px; }
 #calculationSection tbody td::before { content: attr(data-label); color: #526077; font-weight: 600; text-align: left; }
 #calculationSection tbody td:first-child { background: #e9edff; font-weight: 700; }
 #calculationSection tbody td:last-child { border-bottom: 0; }
}
