[70] Flächentabelle (Flächenarten nach SIA 416) und IVHB-Kennziffern

Kern flaechen.rs (Abfragen areaTable/ivhb): GF = NGF + KF, KF aus Wandgrundrissen
und KGF-Räumen, AGF separat, GV; GFZ, AZ, BMZ, ÜZ, GZ, Gesamt-/Fassadenhöhe.
Bericht als CSV (mit Rückleser), SVG und Vektor-PDF, Abschnitt im
Flächenbilanz-Panel, CLI kennzahlen --sia416 --ivhb --format json|csv|svg|pdf.

Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
Claude committed 2026-10-28 20:29:57 +00:00
1 parent 5d0dc7d875
commit c757eda756
20 files changed
+1692 -25

No files matched your search

+90
View File
@@ -0,0 +1,90 @@
// Flächentabelle und IVHB-Kennziffern ([70]). Rechnet der Kern auf dem Projekt-Dokument
// (`src-tauri/core/src/flaechen.rs`; Herleitung und Quellen stehen dort im Modulkopf).
// Diese Datei ist nur die typisierte Fassade.
import type { Project } from "../model/types";
import { documentFor } from "../core/document";
/** Eine Zeile der Flächentabelle: ein Geschoss oder die Summe (Flächenarten nach SIA 416). */
export interface AreaRow {
levelId: string;
name: string;
/** Oberkante ≤ ±0.00. */
underground: boolean;
hnf: number;
nnf: number;
/** NF = HNF + NNF. */
nf: number;
vf: number;
ff: number;
/** NGF = NF + VF + FF. */
ngf: number;
/** Konstruktionsfläche (aus Wandgrundrissen und KGF-Räumen). */
kf: number;
/** GF = NGF + KF. */
gf: number;
/** Aussengeschossfläche — nicht Teil der GF. */
agf: number;
height: number;
/** GF × Geschosshöhe. */
gv: number;
rooms: number;
}
export type GvSource = "solids" | "levels";
export interface AreaTable {
levels: AreaRow[];
total: AreaRow;
/** Gebäudevolumen (m³) gemäss `gvSource`. */
gv: number;
gvSource: GvSource;
/** Hinweis-Schlüssel (Annahmen der Rechnung). */
notes: string[];
}
/** Welche Fläche als „anrechenbare Geschossfläche" der AZ zählt (kantonal verschieden). */
export type AgfBasis = "gf" | "ngf" | "nf";
/** Eingaben, die das Modell nicht hergibt. */
export interface IvhbOptions {
/** Anrechenbare Grundstücksfläche (m²); sonst Parzellenfläche / Parzellengrenze. */
agsf?: number;
/** Anrechenbare Grünfläche (m²). */
greenArea?: number;
agfBasis?: AgfBasis;
/** Unterirdische Geschosse mitrechnen. */
includeUnderground?: boolean;
}
export type AgsfSource = "input" | "parcelArea" | "parcelRing" | "none";
export interface Ivhb {
agsf: number | null;
agsfSource: AgsfSource;
agfBasis: AgfBasis;
includeUnderground: boolean;
gfSum: number;
agf: number;
baumasse: number;
agbf: number;
greenArea: number | null;
az: number | null;
gfz: number | null;
bmz: number | null;
uz: number | null;
gz: number | null;
totalHeight: number | null;
facadeHeight: number | null;
notes: string[];
}
/** SIA-416-Flächentabelle je Geschoss und total. */
export function computeAreaTable(project: Project): AreaTable {
return documentFor(project).query<AreaTable>("areaTable");
}
/** IVHB-Kennziffern (GFZ, AZ, BMZ, ÜZ, GZ, Höhen). */
export function computeIvhb(project: Project, options: IvhbOptions = {}): Ivhb {
return documentFor(project).query<Ivhb>("ivhb", [], JSON.stringify(options));
}
+35 -1
View File
@@ -11,7 +11,7 @@
// dossier-cli <projekt.obp> elevation <Name> [--out ansicht.svg]
// dossier-cli <projekt.obp> ifc [--ebkph] [--ebenen] (IFC mit eBKP-H-Hauptgruppen bzw. Modell-Ebenen als Klassifikation)
// --schema 4|2x3: IFC4 (Standard) oder IFC2x3 (Coordination View 2.0)
// dossier-cli <projekt.obp> dxf [--binary] [--scale 100] [--dim-unit cm] [--layout]|dwg|ifc|step|obj|stl|glb|gltf|schedule|kennzahlen|sun [--level EG] [--out datei]
// dossier-cli <projekt.obp> dxf [--binary] [--scale 100] [--dim-unit cm] [--layout]|dwg|ifc|step|obj|stl|glb|gltf|schedule|kennzahlen [--sia416] [--ivhb] [--format json|csv|svg|pdf] [--agsf m2] [--gruenflaeche m2] [--agf-basis gf|ngf|nf] [--untergeschosse]|sun [--level EG] [--out datei]
// glb/gltf = glTF 2.0 (Y-up, Meter, Geschoss als Eltern; --flat ohne Geschoss-Knoten)
// dossier-cli convert <eingabe> <ausgabe> [--cmd "befehl"]… Format nach Endung: dxf/dwg/ifc/obp → obp-Import,
// obp → dxf/dwg/ifc/obj/stl/glb/gltf/step; --cmd: weitere Befehle
@@ -63,6 +63,12 @@ import {
exportProjectStep,
exportScheduleCsv,
computeKennzahlen,
computeAreaTable,
computeIvhb,
buildAreaReport,
areaReportToCsv,
areaReportToSvg,
buildAreaReportPdf,
sunPosition,
shadowPolygons,
projectLatLon,
@@ -620,6 +626,34 @@ async function execute(project: Project, file: string, command: string, rest: st
out(args, exportGltf(project, { byLevel: !args.flags.has("flat") }), `${project.name || "projekt"}.gltf`);
return 0;
case "kennzahlen": {
// --sia416 / --ivhb: Flächentabelle bzw. IVHB-Kennziffern [70]; --format json|csv|svg|pdf (Default json).
if (args.flags.has("sia416") || args.flags.has("ivhb")) {
const num = (k: string): number | undefined => {
const v = args.flags.get(k);
if (v === undefined) return undefined;
const n = Number(v.replace(",", "."));
if (!Number.isFinite(n)) throw new Error(`--${k}: keine Zahl`);
return n;
};
const basis = args.flags.get("agf-basis") ?? "ngf";
if (basis !== "gf" && basis !== "ngf" && basis !== "nf") throw new Error("--agf-basis: gf, ngf oder nf");
const ivhbOptions = { agsf: num("agsf"), greenArea: num("gruenflaeche"), agfBasis: basis, includeUnderground: args.flags.has("untergeschosse") } as const;
const wantAreas = args.flags.has("sia416");
const wantIvhb = args.flags.has("ivhb");
const format = args.flags.get("format") ?? "json";
const stem = `${project.name || "projekt"}-flaechen`;
if (format === "json") {
const json = { ...(wantAreas ? { flaechentabelle: computeAreaTable(project) } : {}), ...(wantIvhb ? { ivhb: computeIvhb(project, ivhbOptions) } : {}) };
out(args, JSON.stringify(json, null, 2), `${stem}.json`);
return 0;
}
const report = buildAreaReport(project, { areas: wantAreas, ivhb: wantIvhb, ivhbOptions });
if (format === "csv") out(args, areaReportToCsv(report), `${stem}.csv`);
else if (format === "svg") out(args, areaReportToSvg(report), `${stem}.svg`);
else if (format === "pdf") out(args, new Uint8Array(buildAreaReportPdf(report).output("arraybuffer")), `${stem}.pdf`);
else throw new Error("--format: json, csv, svg oder pdf");
return 0;
}
const k = computeKennzahlen(project);
const prog = checkRoomProgram(project);
const baurecht = checkSiteRules(project);
+2
View File
@@ -11,6 +11,8 @@ import { diffToOps } from "./ops";
/** Abfragen des Kerns (`queries.rs`). */
export type QueryName =
| "kennzahlen"
| "areaTable"
| "ivhb"
| "siteCheck"
| "buildingFootprint"
| "modelTop"
+4
View File
@@ -24,6 +24,10 @@ export type { CoreOp } from "./ops";
export type { Project, DrawingLevel } from "../model/types";
export { computeKennzahlen, checkRoomProgram, solidVolume } from "../analysis/kennzahlen";
export type { Kennzahlen, ProgramCheck } from "../analysis/kennzahlen";
export { computeAreaTable, computeIvhb } from "../analysis/areaTable";
export type { AreaTable, AreaRow, Ivhb, IvhbOptions, AgfBasis } from "../analysis/areaTable";
export { buildAreaReport, areaReportToCsv, parseAreaReportCsv, areaReportToSvg, buildAreaReportPdf } from "../export/areaReport";
export type { AreaReport, AreaReportOptions } from "../export/areaReport";
export { sunPosition, shadowPolygons, shadowOfPrism, projectLatLon } from "../analysis/sun";
export type { SunPosition } from "../analysis/sun";
export { checkSiteRules, allowedArea, multiPolygonArea, buildingFootprint, modelTop } from "../analysis/siteRules";
+115
View File
@@ -0,0 +1,115 @@
import { describe, expect, it } from "vitest";
import { sampleProject } from "../model/sampleProject";
import type { Project, Room, Wall } from "../model/types";
import { computeAreaTable, computeIvhb } from "../analysis/areaTable";
import { areaReportToCsv, areaReportToSvg, buildAreaReport, buildAreaReportPdf, cellText, layoutAreaReport, parseAreaReportCsv } from "./areaReport";
// Einfaches Haus: Achsen 10 × 8 m, Wände 0.3 m, EG-Räume innen 9.7 × 7.7 m (Handrechnung siehe flaechen.rs).
function house(): Project {
const base = structuredClone(sampleProject) as Project;
const wt = base.wallTypes[0]!;
const type = { ...wt, id: "w30", layers: [{ ...wt.layers[0]!, thickness: 0.3 }] };
const pts = [[0, 0], [10, 0], [10, 8], [0, 8]] as const;
const walls = pts.map((a, i): Wall => {
const b = pts[(i + 1) % 4]!;
return { ...(base.walls[0] as Wall), id: `hw${i}`, floorId: "eg", start: { x: a[0], y: a[1] }, end: { x: b[0], y: b[1] }, wallTypeId: "w30", height: 2.6, bottom: undefined, top: undefined };
});
const room = (id: string, cat: Room["siaCategory"], y0: number, y1: number): Room => ({
...(base.rooms![0] as Room), id, floorId: "eg", siaCategory: cat, name: id,
boundary: [{ x: 0.15, y: y0 }, { x: 9.85, y: y0 }, { x: 9.85, y: y1 }, { x: 0.15, y: y1 }],
});
return { ...base, name: "Haus", wallTypes: [type], walls, rooms: [room("a", "HNF", 0.15, 4.15), room("b", "NNF", 4.15, 5.85), room("c", "VF", 5.85, 7.85)], openings: [], extrudedSolids: undefined, roofs: undefined, parcelArea: 400 };
}
describe("computeAreaTable", () => {
it("einfaches Haus: Flächenarten, KF aus den Wänden, GF = NGF + KF", () => {
const t = computeAreaTable(house());
const eg = t.levels.find((l) => l.levelId === "eg")!;
expect(eg.hnf).toBeCloseTo(38.8, 4);
expect(eg.nnf).toBeCloseTo(16.49, 4);
expect(eg.vf).toBeCloseTo(19.4, 4);
expect(eg.ngf).toBeCloseTo(74.69, 4);
expect(eg.kf).toBeCloseTo(10.8, 4);
expect(eg.gf).toBeCloseTo(85.49, 4);
expect(t.total.gf).toBeCloseTo(85.49, 4);
expect(t.gvSource).toBe("levels");
expect(t.gv).toBeCloseTo(85.49 * 2.6, 3);
});
});
describe("computeIvhb", () => {
it("Ziffern aus Parzellenfläche, Eingaben überschreiben", () => {
const p = house();
const v = computeIvhb(p);
expect(v.agsfSource).toBe("parcelArea");
expect(v.gfz).toBeCloseTo(85.49 / 400, 5);
expect(v.az).toBeCloseTo(74.69 / 400, 5);
expect(v.uz).toBeCloseTo(85.49 / 400, 5);
expect(v.gz).toBeNull();
const w = computeIvhb(p, { agsf: 200, greenArea: 100, agfBasis: "gf" });
expect(w.agsfSource).toBe("input");
expect(w.az).toBeCloseTo(85.49 / 200, 5);
expect(w.gz).toBeCloseTo(0.5, 9);
});
it("ohne Parzelle keine Ziffern", () => {
const { parcelArea: _p, ...p } = house();
const v = computeIvhb(p as Project);
expect(v.agsf).toBeNull();
expect(v.az).toBeNull();
});
});
describe("Bericht", () => {
const report = buildAreaReport(house(), { areas: true, ivhb: true, ivhbOptions: { greenArea: 160 } });
it("hat Flächentabelle, Kennziffern, Höhen und Fussnoten", () => {
expect(report.sections).toHaveLength(3);
const areas = report.sections[0]!;
expect(areas.columns).toContain("NGF");
expect(areas.rows.at(-1)!.total).toBe(true);
expect(report.notes.some((n) => n.includes("SIA 416"))).toBe(true);
});
it("CSV-Rundreise gibt die ausgegebenen Zahlen zurück", () => {
const csv = areaReportToCsv(report);
const back = parseAreaReportCsv(csv);
expect(back.title).toBe(report.title);
expect(back.projectName).toBe("Haus");
expect(back.sections).toHaveLength(report.sections.length);
report.sections.forEach((s, i) => {
expect(back.sections[i]!.heading).toBe(s.heading);
expect(back.sections[i]!.columns).toEqual(s.columns);
s.rows.forEach((r, j) => {
r.cells.forEach((c, k) => {
const got = back.sections[i]!.rows[j]![k];
if (typeof c === "string") expect(got).toBe(c);
else expect(got).toBe(c.n === null ? null : Number(cellText(c)));
});
});
});
expect(back.notes).toEqual(report.notes);
});
it("CSV: Felder mit Semikolon und Anführungszeichen bleiben heil", () => {
const r = { ...report, projectName: 'Haus "A"; Süd' };
expect(parseAreaReportCsv(areaReportToCsv(r)).projectName).toBe('Haus "A"; Süd');
});
it("SVG und PDF entstehen aus derselben Seitenaufteilung", () => {
const svg = areaReportToSvg(report);
expect(svg.startsWith("<svg")).toBe(true);
expect(svg).toContain("NGF");
const lay = layoutAreaReport(report);
expect(lay.pages.length).toBeGreaterThanOrEqual(1);
const pdf = buildAreaReportPdf(report);
expect(pdf.getNumberOfPages()).toBe(lay.pages.length);
expect(pdf.output("arraybuffer").byteLength).toBeGreaterThan(1000);
});
it("viele Geschosse laufen auf eine zweite Seite", () => {
const sec = report.sections[0]!;
const rows = Array.from({ length: 60 }, (_, i) => ({ cells: [`G${i}`, ...sec.rows[0]!.cells.slice(1)] }));
const lay = layoutAreaReport({ ...report, sections: [{ ...sec, rows }] });
expect(lay.pages.length).toBeGreaterThan(1);
});
});
+364
View File
@@ -0,0 +1,364 @@
// Flächen- und Kennzahlen-Nachweis ([70]): ein Berichtsmodell (Tabellen mit Zahlen), daraus CSV,
// SVG und PDF (Vektor, jsPDF) — alle Ausgaben haben dieselbe Quelle.
//
// • `buildAreaReport`: rechnet über den Kern (`analysis/areaTable.ts`) und beschriftet mit `t()`.
// • `areaReportToCsv` / `parseAreaReportCsv`: CSV mit „;" und Punkt als Dezimaltrenner; die
// Rückwärtsrichtung gibt die Zahlen so zurück, wie sie ausgegeben wurden (gerundet).
// • `layoutAreaReport`: Seitenaufteilung in Papier-mm (A4 quer); `areaReportToSvg` und
// `buildAreaReportPdf` zeichnen dieselben Primitive.
//
// Die Flächenarten folgen SIA 416, die Kennziffern der IVHB; Herleitung im Kern (`flaechen.rs`).
import { jsPDF } from "jspdf";
import type { Project } from "../model/types";
import { t } from "../i18n";
import { computeAreaTable, computeIvhb } from "../analysis/areaTable";
import type { AreaRow, IvhbOptions } from "../analysis/areaTable";
/** Zelle: Text oder Zahl (`d` Nachkommastellen, `null` = nicht berechenbar). */
export type Cell = string | { n: number | null; d: number };
export interface ReportRow {
cells: Cell[];
/** Summenzeile (fett, Linie darüber). */
total?: boolean;
}
export interface ReportSection {
heading: string;
columns: string[];
/** Relative Spaltenbreiten (Länge = columns). */
widths: number[];
rows: ReportRow[];
}
export interface AreaReport {
title: string;
projectName: string;
sections: ReportSection[];
/** Fussnoten (Quellen, Annahmen). */
notes: string[];
}
export interface AreaReportOptions {
/** Flächentabelle aufnehmen (Default ja). */
areas?: boolean;
/** IVHB-Kennziffern aufnehmen (Default nein). */
ivhb?: boolean;
ivhbOptions?: IvhbOptions;
}
const num = (n: number | null | undefined, d: number): Cell => ({ n: n === undefined || n === null || !Number.isFinite(n) ? null : n, d });
const AREA_COLUMNS = ["HNF", "NNF", "NF", "VF", "FF", "NGF", "KF", "GF", "AGF", "GV"];
function areaCells(r: AreaRow): Cell[] {
return [r.hnf, r.nnf, r.nf, r.vf, r.ff, r.ngf, r.kf, r.gf, r.agf].map((v) => num(v, 2)).concat(num(r.gv, 1));
}
/** Baut den Bericht aus dem Projekt. */
export function buildAreaReport(project: Project, opts: AreaReportOptions = {}): AreaReport {
const sections: ReportSection[] = [];
const notes: string[] = [];
const addNotes = (keys: string[]) => {
for (const k of keys) {
const text = t(`areas.note.${k}`);
if (!notes.includes(text)) notes.push(text);
}
};
if (opts.areas ?? true) {
const table = computeAreaTable(project);
const rows: ReportRow[] = table.levels.map((l) => ({ cells: [l.name, ...areaCells(l)] }));
// Summenzeile: das GV ist das Gebäudevolumen gemäss Quelle (Körper oder Geschosse).
rows.push({ total: true, cells: [t("areas.total"), ...areaCells(table.total).slice(0, 9), num(table.gv, 1)] });
sections.push({
heading: `${t("areas.table")} [m², GV m³]`,
columns: [t("areas.level"), ...AREA_COLUMNS],
widths: [3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2.4],
rows,
});
notes.push(t("areas.foot.sia"));
addNotes(table.notes);
}
if (opts.ivhb) {
const v = computeIvhb(project, opts.ivhbOptions);
const basis = t(`areas.basis.${v.agfBasis}`);
const ratio = (key: string, formula: string, numerator: number | null, value: number | null): ReportRow => ({
cells: [t(`areas.ratio.${key}`), formula, num(numerator, 2), num(v.agsf, 2), num(value, 3)],
});
sections.push({
heading: `${t("areas.ivhb.title")} · ${t("areas.agsf.source")}: ${t(`areas.src.${v.agsfSource}`)}`,
columns: [t("areas.col.ratio"), t("areas.col.formula"), t("areas.col.numerator"), t("areas.col.agsf"), t("areas.col.value")],
widths: [4, 3.2, 1.6, 1.6, 1.2],
rows: [
ratio("gfz", t("areas.formula.gfz"), v.gfSum, v.gfz),
ratio("az", t("areas.formula.az", { basis }), v.agf, v.az),
ratio("bmz", t("areas.formula.bmz"), v.baumasse, v.bmz),
ratio("uz", t("areas.formula.uz"), v.agbf, v.uz),
ratio("gz", t("areas.formula.gz"), v.greenArea, v.gz),
],
});
sections.push({
heading: t("areas.heights"),
columns: [t("areas.col.ratio"), "[m]"],
widths: [6, 1.5],
rows: [
{ cells: [t("areas.height.total"), num(v.totalHeight, 2)] },
{ cells: [t("areas.height.facade"), num(v.facadeHeight, 2)] },
],
});
notes.push(t("areas.foot.ivhb"));
addNotes(v.notes);
}
return { title: t("areas.title"), projectName: project.name ?? "", sections, notes };
}
// ── CSV ─────────────────────────────────────────────────────────────────────
function csvField(v: string): string {
return /[",\n\r;]/.test(v) ? `"${v.replace(/"/g, '""')}"` : v;
}
/** Zelle als Text, so wie sie ausgegeben wird (Punkt als Dezimaltrenner, `null` = leer). */
export function cellText(c: Cell): string {
if (typeof c === "string") return c;
return c.n === null ? "" : c.n.toFixed(c.d);
}
/** CSV des Berichts: Titel, Projekt, dann je Abschnitt Überschrift, Kopf, Zeilen; Fussnoten mit „* ". */
export function areaReportToCsv(report: AreaReport, delimiter = ";"): string {
const line = (cells: string[]) => cells.map(csvField).join(delimiter);
const out: string[] = [line([report.title]), line([report.projectName]), ""];
for (const s of report.sections) {
out.push(line([s.heading]), line(s.columns));
for (const r of s.rows) out.push(line(r.cells.map(cellText)));
out.push("");
}
for (const n of report.notes) out.push(line([`* ${n}`]));
return out.join("\n") + "\n";
}
export interface ParsedSection {
heading: string;
columns: string[];
/** Zahlen als `number` (Zelle leer → `null` an Zahlenstellen), Texte als `string`. */
rows: (string | number | null)[][];
}
export interface ParsedReport {
title: string;
projectName: string;
sections: ParsedSection[];
notes: string[];
}
/** Zerlegt CSV-Text in Zeilen von Feldern (Anführungszeichen, Trenner, Zeilenumbruch im Feld). */
function parseCsvRows(text: string, delimiter: string): string[][] {
const rows: string[][] = [];
let row: string[] = [];
let field = "";
let quoted = false;
for (let i = 0; i < text.length; i++) {
const c = text[i]!;
if (quoted) {
if (c === '"') {
if (text[i + 1] === '"') {
field += '"';
i++;
} else quoted = false;
} else field += c;
} else if (c === '"') quoted = true;
else if (c === delimiter) {
row.push(field);
field = "";
} else if (c === "\n" || c === "\r") {
if (c === "\r" && text[i + 1] === "\n") i++;
row.push(field);
rows.push(row);
row = [];
field = "";
} else field += c;
}
if (field !== "" || row.length > 0) {
row.push(field);
rows.push(row);
}
return rows;
}
const NUMBER = /^-?\d+(\.\d+)?$/;
/** Liest eine mit {@link areaReportToCsv} geschriebene CSV zurück (Rundreise). */
export function parseAreaReportCsv(text: string, delimiter = ";"): ParsedReport {
const rows = parseCsvRows(text, delimiter);
// Blöcke zwischen Leerzeilen (eine Leerzeile = ein Feld "").
const blocks: string[][][] = [];
let cur: string[][] = [];
for (const r of rows) {
if (r.length === 1 && r[0] === "") {
if (cur.length) blocks.push(cur);
cur = [];
} else cur.push(r);
}
if (cur.length) blocks.push(cur);
const head = blocks.shift() ?? [];
const result: ParsedReport = { title: head[0]?.[0] ?? "", projectName: head[1]?.[0] ?? "", sections: [], notes: [] };
for (const b of blocks) {
if (b[0]?.[0]?.startsWith("* ")) {
for (const r of b) result.notes.push(r[0]!.slice(2));
continue;
}
result.sections.push({
heading: b[0]?.[0] ?? "",
columns: b[1] ?? [],
rows: b.slice(2).map((r) => r.map((c, i) => (NUMBER.test(c) ? Number(c) : i === 0 || c !== "" ? c : null))),
});
}
return result;
}
// ── Seitenaufteilung (Papier-mm) und Ausgabe ─────────────────────────────────
type Prim =
| { k: "text"; x: number; y: number; s: string; size: number; bold?: boolean; align?: "left" | "right" }
| { k: "line"; x1: number; y1: number; x2: number; y2: number; w: number };
export interface ReportLayoutOptions {
/** Blattgrösse in mm (Default A4 quer). */
width?: number;
height?: number;
margin?: number;
}
/** Zeilenumbruch nach Zeichenzahl (Helvetica ≈ 0.5 em je Zeichen). */
function wrap(text: string, maxMm: number, sizePt: number): string[] {
const per = Math.max(10, Math.floor(maxMm / (sizePt * 0.3528 * 0.5)));
const words = text.split(/\s+/);
const lines: string[] = [];
let cur = "";
for (const w of words) {
if (cur && (cur + " " + w).length > per) {
lines.push(cur);
cur = w;
} else cur = cur ? cur + " " + w : w;
}
if (cur) lines.push(cur);
return lines;
}
/** Teilt den Bericht in Seiten mit Zeichen-Primitiven. */
export function layoutAreaReport(report: AreaReport, o: ReportLayoutOptions = {}): { width: number; height: number; pages: Prim[][] } {
const width = o.width ?? 297;
const height = o.height ?? 210;
const m = o.margin ?? 12;
const inner = width - 2 * m;
const rowH = 6;
const pages: Prim[][] = [[]];
let y = m;
const page = () => pages[pages.length - 1]!;
const ensure = (h: number) => {
if (y + h > height - m) {
pages.push([]);
y = m;
}
};
page().push({ k: "text", x: m, y: y + 5, s: report.title, size: 15, bold: true });
y += 8;
if (report.projectName) {
page().push({ k: "text", x: m, y: y + 4, s: report.projectName, size: 10 });
y += 6;
}
y += 4;
for (const s of report.sections) {
ensure(rowH * 3 + 6);
page().push({ k: "text", x: m, y: y + 4, s: s.heading, size: 10, bold: true });
y += 7;
const sum = s.widths.reduce((a, b) => a + b, 0);
const xs: number[] = [];
let x = m;
for (const w of s.widths) {
xs.push(x);
x += (w / sum) * inner;
}
xs.push(x);
const drawRow = (cells: string[], bold: boolean, numeric: boolean[], line: "top" | "bottom" | "none") => {
ensure(rowH);
if (line === "top") page().push({ k: "line", x1: m, y1: y, x2: m + inner, y2: y, w: 0.35 });
cells.forEach((c, i) => {
const right = numeric[i] === true;
page().push({ k: "text", x: right ? xs[i + 1]! - 1.5 : xs[i]! + 1.5, y: y + 4.2, s: c, size: 8.5, bold, align: right ? "right" : "left" });
});
y += rowH;
if (line === "bottom") page().push({ k: "line", x1: m, y1: y, x2: m + inner, y2: y, w: 0.35 });
};
const isNum = (i: number) => s.rows.some((r) => typeof r.cells[i] === "object");
const numeric = s.columns.map((_, i) => isNum(i));
drawRow(s.columns, true, numeric, "none");
page().push({ k: "line", x1: m, y1: y, x2: m + inner, y2: y, w: 0.35 });
for (const r of s.rows) {
drawRow(r.cells.map((c) => (typeof c === "string" ? c : c.n === null ? "–" : c.n.toFixed(c.d))), r.total === true, numeric, r.total ? "top" : "none");
}
page().push({ k: "line", x1: m, y1: y, x2: m + inner, y2: y, w: 0.35 });
y += 6;
}
for (const n of report.notes) {
const lines = wrap(n, inner, 7.5);
ensure(lines.length * 3.4 + 1);
for (const l of lines) {
page().push({ k: "text", x: m, y: y + 2.8, s: l, size: 7.5 });
y += 3.4;
}
y += 1;
}
const total = pages.length;
pages.forEach((p, i) => {
p.push({ k: "text", x: width - m, y: height - m / 2, s: `${i + 1} / ${total}`, size: 7, align: "right" });
});
return { width, height, pages };
}
const esc = (s: string) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
/** SVG der ersten Seite (Papier-mm, viewBox in mm); `page` wählt eine andere. */
export function areaReportToSvg(report: AreaReport, page = 0, o: ReportLayoutOptions = {}): string {
const lay = layoutAreaReport(report, o);
const prims = lay.pages[Math.min(page, lay.pages.length - 1)] ?? [];
const body = prims
.map((p) =>
p.k === "line"
? `<line x1="${p.x1}" y1="${p.y1}" x2="${p.x2}" y2="${p.y2}" stroke="#111" stroke-width="${p.w}"/>`
: `<text x="${p.x}" y="${p.y}" font-size="${(p.size * 0.3528).toFixed(3)}" font-family="Helvetica, Arial, sans-serif" font-weight="${p.bold ? 700 : 400}" text-anchor="${p.align === "right" ? "end" : "start"}" fill="#111">${esc(p.s)}</text>`,
)
.join("\n");
return `<svg xmlns="http://www.w3.org/2000/svg" width="${lay.width}mm" height="${lay.height}mm" viewBox="0 0 ${lay.width} ${lay.height}">\n<rect width="${lay.width}" height="${lay.height}" fill="#fff"/>\n${body}\n</svg>\n`;
}
/** Die eingebaute Helvetica kennt nur WinAnsi: Zeichen ausserhalb ersetzen. */
function pdfSafe(s: string): string {
return s.replace(/Σ/g, "Sum").replace(/≈/g, "~").replace(/[–−]/g, "-");
}
/** Vektor-PDF des Berichts (A4 quer, eine oder mehrere Seiten). */
export function buildAreaReportPdf(report: AreaReport, o: ReportLayoutOptions = {}): jsPDF {
const lay = layoutAreaReport(report, o);
const doc = new jsPDF({ unit: "mm", format: [lay.width, lay.height], orientation: lay.width > lay.height ? "landscape" : "portrait", compress: true });
lay.pages.forEach((prims, i) => {
if (i > 0) doc.addPage([lay.width, lay.height], lay.width > lay.height ? "landscape" : "portrait");
doc.setTextColor(17, 17, 17);
doc.setDrawColor(17, 17, 17);
for (const p of prims) {
if (p.k === "line") {
doc.setLineWidth(p.w);
doc.line(p.x1, p.y1, p.x2, p.y2);
} else {
doc.setFont("helvetica", p.bold ? "bold" : "normal");
doc.setFontSize(p.size);
doc.text(pdfSafe(p.s), p.x, p.y, { align: p.align ?? "left" });
}
}
});
return doc;
}
+54 -1
View File
@@ -1582,11 +1582,64 @@ export const de = {
// ── Flächenbilanz (SIA 416) ──────────────────────────────────────────────
"nav.roomBalance": "Flächenbilanz",
"balance.title": "Flächenbilanz (SIA 416)",
"balance.title": "Flächenbilanz",
"balance.rooms": "Räume",
"balance.summary": "Bilanz",
"balance.export": "CSV exportieren",
"balance.empty": "Keine Räume vorhanden. Mit dem Raum-Werkzeug erstellen.",
"areas.title": "Flächen- und Kennzahlen-Nachweis",
"areas.table": "Flächentabelle",
"areas.level": "Geschoss",
"areas.total": "Total",
"areas.gv": "Gebäudevolumen GV",
"areas.ivhb.title": "Kennziffern (IVHB)",
"areas.col.ratio": "Kennziffer",
"areas.col.formula": "Berechnung",
"areas.col.numerator": "Zähler",
"areas.col.agsf": "aGSF [m²]",
"areas.col.value": "Wert",
"areas.ratio.gfz": "GFZ Geschossflächenziffer",
"areas.ratio.az": "AZ Ausnützungsziffer",
"areas.ratio.bmz": "BMZ Baumassenziffer",
"areas.ratio.uz": "ÜZ Überbauungsziffer",
"areas.ratio.gz": "GZ Grünflächenziffer",
"areas.formula.gfz": "Σ GF / aGSF",
"areas.formula.az": "aGF ({basis}) / aGSF",
"areas.formula.bmz": "Baumasse [m³] / aGSF",
"areas.formula.uz": "aGbF / aGSF",
"areas.formula.gz": "Grünfläche / aGSF",
"areas.heights": "Höhen über ±0.00",
"areas.height.total": "Gesamthöhe",
"areas.height.facade": "Fassadenhöhe (höchste Wandoberkante, genähert)",
"areas.agsf.source": "Anrechenbare Grundstücksfläche aGSF",
"areas.src.input": "Eingabe",
"areas.src.parcelArea": "Parzellenfläche des Projekts",
"areas.src.parcelRing": "Fläche der Parzellengrenze",
"areas.src.none": "nicht gesetzt",
"areas.note.agfSeparate": "Die Aussengeschossfläche AGF gehört nicht zur GF und wird separat ausgewiesen.",
"areas.note.kfFromWalls": "KF aus den Wandgrundrissen (abzüglich Räume) und KGF-Räumen hergeleitet; Stützen und Schächte nur als KGF-Raum.",
"areas.note.gvSolids": "GV = Volumen der freien Körper (Massenmodell).",
"areas.note.gvLevels": "GV ≈ GF × Geschosshöhe je Geschoss.",
"areas.note.terrainZero": "Massgebendes Terrain = ±0.00 (kein Geländemodell).",
"areas.note.agsfMissing": "Ohne anrechenbare Grundstücksfläche sind keine Ziffern berechenbar.",
"areas.note.greenInput": "Die Grünfläche ist nicht aus dem Modell ableitbar und muss eingegeben werden.",
"areas.note.aboveGroundOnly": "Unterirdische Geschosse sind in GFZ/AZ nicht angerechnet.",
"areas.foot.sia": "Flächenarten nach SIA 416 (2003): GF = NGF + KF, NGF = NF + VF + FF, NF = HNF + NNF.",
"areas.foot.ivhb": "Begriffe nach IVHB, Anhang 1; das kantonale Recht kann abweichen (Anrechnung der Flächen, Gebäudeteile).",
"areas.basis.gf": "GF",
"areas.basis.ngf": "NGF",
"areas.basis.nf": "NF",
"areas.agsfInput": "Anrechenbare Grundstücksfläche",
"areas.agsfInput.hint": "Leer: Parzellenfläche bzw. Parzellengrenze des Projekts.",
"areas.greenInput": "Grünfläche",
"areas.greenInput.hint": "Anrechenbare Grünfläche; nicht aus dem Modell ableitbar.",
"areas.basisInput": "aGF der AZ",
"areas.includeUnderground": "Untergeschosse anrechnen",
"areas.exportCsv": "CSV",
"areas.exportPdf": "PDF",
"areas.exportPdf.fail": "PDF konnte nicht erstellt werden.",
"areas.noLevels": "Keine Geschosse mit Räumen.",
"areas.page": "Seite {n}",
// ── Raum-Stempel-Editor ──────────────────────────────────────────────────
"room.stamp.editTitle": "Raum-Stempel bearbeiten",
"room.stamp.close": "Schliessen",
+54 -1
View File
@@ -1570,11 +1570,64 @@ export const en: Record<TranslationKey, string> = {
// Area balance (SIA 416).
"nav.roomBalance": "Area balance",
"balance.title": "Area balance (SIA 416)",
"balance.title": "Area balance",
"balance.rooms": "Rooms",
"balance.summary": "Balance",
"balance.export": "Export CSV",
"balance.empty": "No rooms yet. Create one with the room tool.",
"areas.title": "Area and ratio statement",
"areas.table": "Area table",
"areas.level": "Level",
"areas.total": "Total",
"areas.gv": "Building volume GV",
"areas.ivhb.title": "Ratios (IVHB)",
"areas.col.ratio": "Ratio",
"areas.col.formula": "Calculation",
"areas.col.numerator": "Numerator",
"areas.col.agsf": "aGSF [m²]",
"areas.col.value": "Value",
"areas.ratio.gfz": "GFZ gross floor area ratio",
"areas.ratio.az": "AZ utilisation ratio",
"areas.ratio.bmz": "BMZ building mass ratio",
"areas.ratio.uz": "ÜZ site coverage ratio",
"areas.ratio.gz": "GZ green area ratio",
"areas.formula.gfz": "Σ GF / aGSF",
"areas.formula.az": "aGF ({basis}) / aGSF",
"areas.formula.bmz": "building mass [m³] / aGSF",
"areas.formula.uz": "aGbF / aGSF",
"areas.formula.gz": "green area / aGSF",
"areas.heights": "Heights above ±0.00",
"areas.height.total": "Overall height",
"areas.height.facade": "Facade height (highest wall top, approximated)",
"areas.agsf.source": "Creditable plot area aGSF",
"areas.src.input": "input",
"areas.src.parcelArea": "parcel area of the project",
"areas.src.parcelRing": "area of the parcel boundary",
"areas.src.none": "not set",
"areas.note.agfSeparate": "The external floor area AGF is not part of GF and is shown separately.",
"areas.note.kfFromWalls": "KF derived from wall footprints (minus rooms) and KGF rooms; columns and shafts only as a KGF room.",
"areas.note.gvSolids": "GV = volume of the free solids (massing model).",
"areas.note.gvLevels": "GV ≈ GF × storey height per level.",
"areas.note.terrainZero": "Reference terrain = ±0.00 (no terrain model).",
"areas.note.agsfMissing": "Without a creditable plot area no ratios can be computed.",
"areas.note.greenInput": "The green area cannot be derived from the model and must be entered.",
"areas.note.aboveGroundOnly": "Underground levels are not credited in GFZ/AZ.",
"areas.foot.sia": "Area types per SIA 416 (2003): GF = NGF + KF, NGF = NF + VF + FF, NF = HNF + NNF.",
"areas.foot.ivhb": "Terms per IVHB, annex 1; cantonal law may differ (crediting of areas, building parts).",
"areas.basis.gf": "GF",
"areas.basis.ngf": "NGF",
"areas.basis.nf": "NF",
"areas.agsfInput": "Creditable plot area",
"areas.agsfInput.hint": "Empty: parcel area or parcel boundary of the project.",
"areas.greenInput": "Green area",
"areas.greenInput.hint": "Creditable green area; cannot be derived from the model.",
"areas.basisInput": "aGF for AZ",
"areas.includeUnderground": "Credit underground levels",
"areas.exportCsv": "CSV",
"areas.exportPdf": "PDF",
"areas.exportPdf.fail": "Could not create the PDF.",
"areas.noLevels": "No levels with rooms.",
"areas.page": "Page {n}",
// Room stamp editor.
"room.stamp.editTitle": "Edit room stamp",
"room.stamp.close": "Close",
+123
View File
@@ -0,0 +1,123 @@
// Flächentabelle (Flächenarten je Geschoss) und IVHB-Kennziffern im Flächenbilanz-Panel ([70]).
//
// • Die Tabellen stammen aus demselben Berichtsmodell wie CSV und PDF (`buildAreaReport`):
// was hier steht, steht auch im Export.
// • Eingaben, die das Modell nicht hergibt (anrechenbare Grundstücksfläche, Grünfläche, Basis der
// aGF, Untergeschosse), liegen nur in der Ansicht (nicht im Projekt).
// Herleitung der Zahlen: `src-tauri/core/src/flaechen.rs`.
import { useMemo, useState } from "react";
import { t } from "../i18n";
import { usePanelHost } from "./host";
import { areaReportToCsv, buildAreaReport, buildAreaReportPdf } from "../core";
import type { AgfBasis } from "../core";
import { DEFAULT_AREA_INPUTS, ivhbOptionsOf, type AreaInputs } from "./areaInputs";
import { downloadCsv } from "./downloadFile";
import { useStore } from "../state/appStore";
const BASES: AgfBasis[] = ["ngf", "gf", "nf"];
export function AreaTableSection() {
const host = usePanelHost();
const project = host.project;
const [inputs, setInputs] = useState<AreaInputs>(DEFAULT_AREA_INPUTS);
const notify = useStore((s) => s.notify);
const report = useMemo(
() => buildAreaReport(project, { areas: true, ivhb: true, ivhbOptions: ivhbOptionsOf(inputs) }),
// eslint-disable-next-line react-hooks/exhaustive-deps
[project, inputs],
);
const set = (patch: Partial<AreaInputs>) => setInputs((i) => ({ ...i, ...patch }));
const stem = `${project.name || "projekt"}-flaechen`;
const exportPdf = () => {
try {
buildAreaReportPdf(report).save(`${stem}.pdf`);
} catch {
notify(t("areas.exportPdf.fail"));
}
};
return (
<div className="area-section">
<div className="balance-head">
<span className="balance-section-label">{t("areas.title")}</span>
<span className="area-actions">
<button type="button" className="balance-export" onClick={() => downloadCsv(`${stem}.csv`, areaReportToCsv(report))}>
{t("areas.exportCsv")}
</button>
<button type="button" className="balance-export" onClick={exportPdf}>
{t("areas.exportPdf")}
</button>
</span>
</div>
{report.sections.map((s, si) => (
<div key={si} className="area-block">
<div className="area-heading">{s.heading}</div>
<div className="area-scroll">
<table className="area-table">
<thead>
<tr>
{s.columns.map((c, i) => (
<th key={i} className={i === 0 ? "" : "num"}>
{c}
</th>
))}
</tr>
</thead>
<tbody>
{s.rows.map((r, ri) => (
<tr key={ri} className={r.total ? "total" : ""}>
{r.cells.map((c, ci) =>
typeof c === "string" ? (
<td key={ci}>{c}</td>
) : (
<td key={ci} className="num">
{c.n === null ? "–" : c.n.toFixed(c.d)}
</td>
),
)}
</tr>
))}
</tbody>
</table>
</div>
</div>
))}
<div className="area-inputs">
<label className="kz-parcel">
<span>{t("areas.agsfInput")}</span>
<input type="text" inputMode="decimal" className="kz-input kz-num" value={inputs.agsf} title={t("areas.agsfInput.hint")} onChange={(e) => set({ agsf: e.target.value })} />
<span>m²</span>
</label>
<label className="kz-parcel">
<span>{t("areas.greenInput")}</span>
<input type="text" inputMode="decimal" className="kz-input kz-num" value={inputs.greenArea} title={t("areas.greenInput.hint")} onChange={(e) => set({ greenArea: e.target.value })} />
<span>m²</span>
</label>
<label className="kz-parcel">
<span>{t("areas.basisInput")}</span>
<select className="kz-input" value={inputs.agfBasis} onChange={(e) => set({ agfBasis: e.target.value as AgfBasis })}>
{BASES.map((b) => (
<option key={b} value={b}>
{t(`areas.basis.${b}`)}
</option>
))}
</select>
</label>
<label className="kz-parcel">
<span>{t("areas.includeUnderground")}</span>
<input type="checkbox" checked={inputs.includeUnderground} onChange={(e) => set({ includeUnderground: e.target.checked })} />
</label>
</div>
<ul className="area-notes">
{report.notes.map((n, i) => (
<li key={i}>{n}</li>
))}
</ul>
</div>
);
}
+8 -18
View File
@@ -1,5 +1,5 @@
// Inhalts-Panel „Flächenbilanz" (SIA 416) — listet alle Räume gruppiert nach
// ihrer SIA-416-Blatt-Kategorie mit Zwischen-/Gesamtsummen und bietet einen
// Inhalts-Panel „Flächenbilanz" — listet alle Räume gruppiert nach
// ihrer Flächenart (SIA 416) mit Zwischen-/Gesamtsummen und bietet einen
// CSV-Export, darüber die Kennzahlenleiste mit Parzelle und Raumprogramm
// (KennzahlenSection). Fläche/Bilanz werden LIVE aus den Raum-Umrissen abgeleitet
// (geometry/roomArea: evaluateRoom/balance/roomsToCsv) — nie gespeichert.
@@ -13,6 +13,8 @@ import { balance, evaluateRoom, roomsToCsv, siaLabelFull } from "../core";
import type { Room } from "../model/types";
import { roomDisplayName } from "../model/roomStamp";
import { KennzahlenSection } from "./KennzahlenSection";
import { AreaTableSection } from "./AreaTableSection";
import { downloadCsv } from "./downloadFile";
/** Löst je Raum die anrechenbare (Netto-)Fläche + Kategorie auf. */
function roomAreas(rooms: Room[]): { category: Room["siaCategory"]; area: number }[] {
@@ -30,22 +32,6 @@ function floorNameOf(
return levels.find((z) => z.id === floorId)?.name ?? floorId;
}
/** Stösst den Download einer CSV-Datei an (reiner Client, Blob-URL). */
function downloadCsv(fileName: string, content: string): void {
// BOM voranstellen, damit Excel UTF-8 (Umlaute/„m²") korrekt liest.
const blob = new Blob(["" + content], {
type: "text/csv;charset=utf-8;",
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
export function RoomBalancePanel() {
const host = usePanelHost();
const rooms = host.project.rooms ?? [];
@@ -55,6 +41,7 @@ export function RoomBalancePanel() {
return (
<div className="balance-panel">
<KennzahlenSection />
<AreaTableSection />
<div className="balance-empty">{t("balance.empty")}</div>
</div>
);
@@ -87,6 +74,9 @@ export function RoomBalancePanel() {
{/* Kennzahlenleiste, Parzelle und Raumprogramm. */}
<KennzahlenSection />
{/* Flächentabelle und IVHB-Kennziffern. */}
<AreaTableSection />
{/* Raumliste (je Raum: Name · Geschoss · SIA · Fläche). */}
<div className="balance-section-label">{t("balance.rooms")}</div>
<div className="balance-table">
+22
View File
@@ -0,0 +1,22 @@
import { describe, expect, it } from "vitest";
import { DEFAULT_AREA_INPUTS, ivhbOptionsOf, parseAreaNumber } from "./areaInputs";
describe("Flächen-Eingaben", () => {
it("Komma und Punkt, leer und Unsinn", () => {
expect(parseAreaNumber("412,5")).toBe(412.5);
expect(parseAreaNumber(" 300.25 ")).toBe(300.25);
expect(parseAreaNumber("")).toBeUndefined();
expect(parseAreaNumber("abc")).toBeUndefined();
expect(parseAreaNumber("-3")).toBeUndefined();
expect(parseAreaNumber("Infinity")).toBeUndefined();
});
it("Optionen für den Kern", () => {
expect(ivhbOptionsOf(DEFAULT_AREA_INPUTS)).toEqual({ agsf: undefined, greenArea: undefined, agfBasis: "ngf", includeUnderground: false });
expect(ivhbOptionsOf({ agsf: "500", greenArea: "120,5", agfBasis: "gf", includeUnderground: true })).toEqual({
agsf: 500,
greenArea: 120.5,
agfBasis: "gf",
includeUnderground: true,
});
});
});
+26
View File
@@ -0,0 +1,26 @@
// Eingaben und Hilfen des Flächen-Nachweises im Flächenbilanz-Panel ([70]).
import type { AgfBasis, IvhbOptions } from "../core";
/** Eingaben, die das Modell nicht hergibt; als Text, damit halbfertiges Tippen erhalten bleibt. */
export interface AreaInputs {
agsf: string;
greenArea: string;
agfBasis: AgfBasis;
includeUnderground: boolean;
}
export const DEFAULT_AREA_INPUTS: AreaInputs = { agsf: "", greenArea: "", agfBasis: "ngf", includeUnderground: false };
/** Zahl aus einer Eingabe (Komma oder Punkt); leer/ungültig/negativ → undefined. */
export function parseAreaNumber(text: string): number | undefined {
const s = text.trim().replace(",", ".");
if (s === "") return undefined;
const v = Number(s);
return Number.isFinite(v) && v >= 0 ? v : undefined;
}
/** Eingaben → Optionen für den Kern. */
export function ivhbOptionsOf(i: AreaInputs): IvhbOptions {
return { agsf: parseAreaNumber(i.agsf), greenArea: parseAreaNumber(i.greenArea), agfBasis: i.agfBasis, includeUnderground: i.includeUnderground };
}
+17
View File
@@ -0,0 +1,17 @@
// Stösst den Download einer Datei an (reiner Client, Blob-URL).
export function downloadFile(fileName: string, blob: Blob): void {
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
/** CSV mit BOM, damit Excel UTF-8 (Umlaute/„m²") korrekt liest. */
export function downloadCsv(fileName: string, content: string): void {
downloadFile(fileName, new Blob(["" + content], { type: "text/csv;charset=utf-8;" }));
}
+56
View File
@@ -8498,3 +8498,59 @@ body {
flex: 0 0 9em;
width: 9em;
}
/* Flächentabelle und IVHB-Kennziffern (Flächenbilanz-Panel, AreaTableSection). */
.area-section {
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 8px;
}
.area-actions {
display: flex;
gap: 4px;
}
.area-heading {
font-size: 11px;
font-weight: 600;
color: var(--ink-2);
margin-bottom: 2px;
}
.area-scroll {
overflow-x: auto;
}
.area-table {
border-collapse: collapse;
width: 100%;
font-size: 11px;
font-variant-numeric: tabular-nums;
}
.area-table th,
.area-table td {
padding: 2px 5px;
white-space: nowrap;
text-align: left;
border-bottom: 1px solid var(--line);
}
.area-table th {
color: var(--ink-2);
font-weight: 600;
}
.area-table .num {
text-align: right;
}
.area-table tr.total td {
font-weight: 700;
border-top: 1px solid var(--ink-2);
}
.area-inputs {
display: flex;
flex-direction: column;
gap: 4px;
}
.area-notes {
margin: 0;
padding-left: 16px;
font-size: 10px;
color: var(--ink-2);
}