:root {
    --blue: #21224a;
    --blue-2: #151638;
    --green: #25aa75;
    --green-2: #0a8f70;
    --gray: #f4f7f7;
    --line: #dfe8e8;
    --text: #20243f;
    --muted: #666d82;
    --danger: #d94646;
    --warn: #f2c94c;
    --surface: #ffffff;
    --surface-soft: #f8fbfb;
    --shadow: 0 6px 16px rgba(33, 34, 74, .045);
    --shadow-soft: 0 4px 10px rgba(33, 34, 74, .035);
}

/* System monitoring */
/* SYSTEM-MONITOR-LIGHT-COCKPIT-V1: Checkmk-inspirierte Dichte im hellen ENERKLAR-Stil. */
.system-monitor-light-cockpit{--monitor-cockpit-bg:#eef3f4;--monitor-cockpit-panel:#ffffff;--monitor-cockpit-line:#cedbe0;--monitor-cockpit-navy:#0b3857;--monitor-cockpit-green:#18a873;--monitor-load:#d39221;--monitor-disk:#4c7f99;gap:12px;color:#1f2c3a}
.system-monitor-light-cockpit .system-monitor-panel{min-width:0;padding:14px;border:1px solid #d9e3e6;border-radius:10px;background:var(--monitor-cockpit-bg)}
.system-monitor-light-cockpit .system-monitor-tabs{gap:0;overflow:hidden;border:1px solid #d6e0e4;border-radius:8px 8px 0 0;background:#fff}
.system-monitor-light-cockpit .system-monitor-tabs button{min-height:42px;padding:0 20px;border-right:1px solid #e2e9eb;border-bottom:3px solid transparent;color:#526577;font-size:11px}
.system-monitor-light-cockpit .system-monitor-tabs button.active{color:#08785a;border-bottom-color:var(--monitor-cockpit-green);background:#eff9f5}
.system-monitor-cockpit-toolbar{align-items:center;min-height:48px;padding:0 2px}.system-monitor-cockpit-toolbar>div:first-child{gap:1px}.system-monitor-cockpit-toolbar>div:first-child strong{color:var(--monitor-cockpit-navy);font-size:18px}.system-monitor-cockpit-toolbar>div:first-child small{color:#6d7c8c;font-size:11px}
.system-monitor-light-cockpit .system-monitor-ranges{gap:5px}.system-monitor-light-cockpit .system-monitor-ranges button{min-height:34px;border-color:#cbd9de;border-radius:6px;color:#29445b;background:#fff;font-size:10px}.system-monitor-light-cockpit .system-monitor-ranges button.active{color:#08785a;border-color:#77c7aa;background:#ebf8f3}
.system-monitor-light-cockpit .system-monitor-overview{margin:0;padding:12px 14px;grid-template-columns:minmax(220px,.85fr) minmax(0,2.15fr);border:1px solid #cfe2dc;border-left:4px solid var(--monitor-cockpit-green);border-radius:8px;background:#fff;box-shadow:0 3px 12px rgba(17,49,67,.045)}
.system-monitor-light-cockpit .system-monitor-overview-copy strong{color:var(--monitor-cockpit-navy);font-size:18px}.system-monitor-light-cockpit .system-monitor-overview-copy small{font-size:10px}.system-monitor-light-cockpit .system-monitor-overview-pills span{min-height:28px;padding:5px 8px;border-color:#dbe5e8;color:#5b6e7f;background:#f8faf9;font-size:10px}.system-monitor-light-cockpit .system-monitor-overview-pills b{color:var(--monitor-cockpit-navy)}
.system-monitor-cockpit-primary{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important;margin-top:10px}
.system-monitor-gauge-card,.system-monitor-live-card,.system-monitor-fleet-card,.system-monitor-resource-strip article{min-width:0;border:1px solid var(--monitor-cockpit-line);border-radius:7px;background:#fff;box-shadow:0 3px 12px rgba(18,49,67,.045)}
.system-monitor-gauge-card{min-height:170px;padding:12px;display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;gap:12px}
.system-monitor-gauge{--gauge-color:var(--monitor-cockpit-green);width:108px;height:108px;display:grid;place-items:center;border-radius:50%;background:radial-gradient(circle at center,#fff 0 58%,transparent 59%),conic-gradient(var(--gauge-color) calc(var(--monitor-gauge-value) * 1%),#dfe8ea 0);box-shadow:inset 0 0 0 1px #d4dfe3}.system-monitor-gauge-card.is-warning .system-monitor-gauge{--gauge-color:#d2a11b}.system-monitor-gauge-card.is-danger .system-monitor-gauge{--gauge-color:#d84a4a}
.system-monitor-gauge>div{display:grid;justify-items:center;gap:2px}.system-monitor-gauge strong{color:var(--monitor-cockpit-navy);font-size:24px;line-height:1}.system-monitor-gauge span{color:#718191;font-size:9px;font-weight:800;text-transform:uppercase}.system-monitor-gauge-copy{min-width:0}.system-monitor-gauge-copy>span{display:block;color:#607183;font-size:11px;font-weight:800}.system-monitor-gauge-copy strong{display:block;margin:5px 0 4px;color:var(--monitor-cockpit-navy);font-size:17px}.system-monitor-gauge-copy small{display:block;color:#748393;font-size:10px;line-height:1.35}
.system-monitor-live-card{min-height:170px;padding:15px;display:grid;align-content:center;gap:5px;border-top:4px solid var(--monitor-cockpit-navy)}.system-monitor-live-card header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px;color:#657789;font-size:11px;font-weight:800}.system-monitor-live-dot{width:9px;height:9px;border-radius:50%;background:var(--monitor-cockpit-green);box-shadow:0 0 0 4px rgba(24,168,115,.13)}.system-monitor-live-card>strong{color:var(--monitor-cockpit-navy);font-size:19px;line-height:1.15}.system-monitor-live-card>small{margin-top:4px;color:#748393;font-size:9px;line-height:1.35;overflow-wrap:anywhere}
.system-monitor-light-cockpit .system-monitor-chart{overflow:hidden;padding:0;border-color:var(--monitor-cockpit-line);border-radius:7px;background:#fff;box-shadow:0 3px 12px rgba(18,49,67,.045)}.system-monitor-light-cockpit .system-monitor-chart figcaption{min-height:42px;margin:0;padding:9px 12px;border-bottom:1px solid #dbe5e8;color:var(--monitor-cockpit-navy);background:#f7faf9;font-size:11px}.system-monitor-light-cockpit .system-monitor-chart svg{min-height:185px;padding:6px 9px 0}.system-monitor-light-cockpit .system-monitor-chart-help{margin:0;padding:4px 12px 9px;color:#83909d;font-size:9px}.system-monitor-light-cockpit .system-monitor-chart-gridline{stroke:#dce6e9;stroke-dasharray:2 4}.system-monitor-light-cockpit .system-monitor-chart polyline{stroke-width:2.3}.system-monitor-light-cockpit .system-monitor-chart polyline.is-load{stroke:var(--monitor-load)}.system-monitor-light-cockpit .system-monitor-chart polyline.is-disk{stroke:var(--monitor-disk)}.system-monitor-light-cockpit .system-monitor-chart-legend .is-load{color:var(--monitor-load)}.system-monitor-light-cockpit .system-monitor-chart-legend .is-disk{color:var(--monitor-disk)}
.system-monitor-cockpit-charts{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;margin-top:10px!important}.system-monitor-cockpit-secondary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px}
.system-monitor-fleet-card{padding:0;overflow:hidden}.system-monitor-fleet-card>header{min-height:42px;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #dbe5e8;background:#f7faf9}.system-monitor-fleet-card h2{margin:1px 0 0;color:var(--monitor-cockpit-navy);font-size:13px}.system-monitor-fleet-card>header>strong{color:var(--monitor-cockpit-green);font-size:20px}
.system-monitor-fleet-bars{display:grid;gap:10px;padding:15px 14px}.system-monitor-fleet-bars>div{display:grid;grid-template-columns:minmax(105px,.8fr) minmax(0,1.4fr) 28px;gap:8px;align-items:center;color:#657789;font-size:10px}.system-monitor-fleet-bars i{height:7px;overflow:hidden;border-radius:99px;background:#e1e9eb}.system-monitor-fleet-bars i b{display:block;width:var(--fleet-width);height:100%;border-radius:inherit;background:var(--monitor-cockpit-green)}.system-monitor-fleet-bars i b.is-neutral{background:#8395a5}.system-monitor-fleet-bars i b.is-danger{background:#d84a4a}.system-monitor-fleet-bars i b.is-ok{background:#b9c7cc}.system-monitor-fleet-bars>div>strong{color:var(--monitor-cockpit-navy);text-align:right}.system-monitor-fleet-card>footer{display:flex;justify-content:space-between;gap:10px;padding:9px 12px;border-top:1px solid #e0e8ea;color:#748393;background:#fbfcfc;font-size:9px}
.system-monitor-resource-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px}.system-monitor-resource-strip article{min-height:82px;padding:12px 14px;display:grid;align-content:center;gap:3px;border-left:4px solid var(--monitor-cockpit-green)}.system-monitor-resource-strip article.is-warning{border-left-color:#d2a11b}.system-monitor-resource-strip article.is-danger{border-left-color:#d84a4a}.system-monitor-resource-strip span,.system-monitor-resource-strip small{color:#718191;font-size:10px}.system-monitor-resource-strip strong{color:var(--monitor-cockpit-navy);font-size:18px}
.system-monitor-events-cockpit{overflow:hidden;margin-top:10px;padding:0;border-color:var(--monitor-cockpit-line);border-radius:7px;box-shadow:0 3px 12px rgba(18,49,67,.045)}.system-monitor-events-cockpit>header{min-height:48px;padding:10px 14px;align-items:center;border-bottom:1px solid #dbe5e8;background:#f7faf9}.system-monitor-events-cockpit>header h2{margin:1px 0 0;color:var(--monitor-cockpit-navy);font-size:14px}.system-monitor-events-cockpit>header>small{color:#748393;font-size:10px}.system-monitor-events-cockpit>ol,.system-monitor-events-cockpit>.system-monitor-events-more{margin-inline:14px}.system-monitor-events-cockpit li{min-height:58px}.system-monitor-events-cockpit li.is-info{background:#f5fafc}.system-monitor-events-cockpit li.is-deployment{margin:4px -8px;padding:10px 8px;border:1px solid #cce2ec;border-left:4px solid #2b82b4;background:#f2f9fc}
@media(min-width:768px) and (max-width:1199px){.system-monitor-light-cockpit .system-monitor-panel{padding:12px}.system-monitor-cockpit-primary{grid-template-columns:repeat(2,minmax(0,1fr))!important}.system-monitor-cockpit-charts{grid-template-columns:1fr!important}.system-monitor-cockpit-secondary{grid-template-columns:repeat(2,minmax(0,1fr))}.system-monitor-fleet-card{grid-column:1/-1}.system-monitor-gauge-card{min-height:150px}}
@media(max-width:767px){.system-monitor-light-cockpit{padding-bottom:calc(var(--app-mobile-bar-height,58px) + env(safe-area-inset-bottom,0px) + 18px)}.system-monitor-light-cockpit .system-monitor-panel{margin-inline:-2px;padding:9px;border-radius:7px}.system-monitor-light-cockpit .system-monitor-tabs{margin-inline:0;overflow-x:auto}.system-monitor-light-cockpit .system-monitor-tabs button{flex:1 0 auto;min-width:92px;padding:0 12px;font-size:10px}.system-monitor-cockpit-toolbar{align-items:stretch;flex-direction:column;gap:9px}.system-monitor-cockpit-toolbar>div:first-child small{display:none}.system-monitor-light-cockpit .system-monitor-ranges{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%}.system-monitor-light-cockpit .system-monitor-ranges button{min-width:0;padding:5px 3px;font-size:9px}.system-monitor-light-cockpit .system-monitor-overview{grid-template-columns:1fr;gap:9px;padding:11px}.system-monitor-light-cockpit .system-monitor-overview-pills{display:grid;grid-template-columns:1fr 1fr;gap:5px}.system-monitor-light-cockpit .system-monitor-overview-pills span{justify-content:center;min-width:0;white-space:normal;text-align:center;line-height:1.2}.system-monitor-cockpit-primary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}.system-monitor-gauge-card{min-height:132px;padding:10px;grid-template-columns:74px minmax(0,1fr);gap:8px}.system-monitor-gauge{width:72px;height:72px}.system-monitor-gauge strong{font-size:17px}.system-monitor-gauge span{font-size:7px}.system-monitor-gauge-copy>span{font-size:9px}.system-monitor-gauge-copy strong{font-size:13px}.system-monitor-gauge-copy small{font-size:8px}.system-monitor-live-card{grid-column:1/-1;min-height:118px;padding:12px}.system-monitor-live-card>strong{font-size:16px}.system-monitor-cockpit-charts,.system-monitor-cockpit-secondary,.system-monitor-resource-strip{grid-template-columns:1fr!important;gap:8px!important}.system-monitor-light-cockpit .system-monitor-chart svg{min-height:155px}.system-monitor-resource-strip{grid-template-columns:1fr 1fr!important}.system-monitor-resource-strip article:last-child{grid-column:1/-1}.system-monitor-events-cockpit>header{align-items:flex-start;flex-direction:column;gap:3px}.system-monitor-events-cockpit>ol,.system-monitor-events-cockpit>.system-monitor-events-more{margin-inline:10px}}
@media(max-width:430px){.system-monitor-gauge-card{grid-template-columns:1fr;justify-items:center;text-align:center}.system-monitor-gauge-copy small{min-height:22px}}

/* SYSTEM-MONITOR-UI-PHASE2: Server + Dienste */
.system-monitor-overview{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(0,2.2fr);gap:18px;align-items:center;margin:12px 0;padding:15px 17px;border:1px solid #cfe4dc;border-left:4px solid var(--green);border-radius:9px;background:linear-gradient(105deg,#f0faf6,#fff);box-shadow:var(--shadow-soft)}
.system-monitor-overview.is-warning{border-left-color:#d7a916;background:linear-gradient(105deg,#fff9e8,#fff)}
.system-monitor-overview.is-danger{border-left-color:var(--danger);background:linear-gradient(105deg,#fff4f4,#fff)}
.system-monitor-overview-copy{display:grid;gap:3px;min-width:0}.system-monitor-overview-copy strong{color:var(--blue);font-size:20px}.system-monitor-overview-copy small{color:var(--muted)}
.system-monitor-overview-pills{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}.system-monitor-overview-pills span{display:inline-flex;align-items:center;gap:5px;padding:6px 9px;border:1px solid #dbe7e4;border-radius:999px;background:#fff;color:#526276;font-size:12px}.system-monitor-overview-pills b{color:var(--blue)}.system-monitor-overview-pills .is-neutral{background:#f3f6f7}.system-monitor-overview-pills .is-danger{color:#9d2730;border-color:#e8b8bc;background:#fff2f3}
.system-monitor-service-quick{display:none}.system-monitor-service-details>summary{display:none}.system-monitor-service-details>summary::-webkit-details-marker{display:none}.system-monitor-service-details dl .is-neutral dd{color:#66758a;font-weight:700}
.system-monitor-events li.is-info .system-monitor-status-dot{background:#2b82b4}.system-monitor-events li.is-neutral .system-monitor-status-dot{background:#8b99a7}.system-monitor-events-more{margin-top:8px;border-top:1px solid var(--line)}.system-monitor-events-more>summary{padding:11px 0 2px;color:var(--green-2);font-weight:800;cursor:pointer}.system-monitor-events-more>ol{margin-top:5px}
@media(min-width:1501px){.system-monitor-kpis.is-server-kpis{grid-template-columns:repeat(4,minmax(160px,1fr))}}
@media(max-width:760px){
.system-monitor-overview{grid-template-columns:1fr;gap:10px;padding:13px}.system-monitor-overview-pills{justify-content:flex-start}.system-monitor-overview-pills span{font-size:11px}
.system-monitor-kpis.is-server-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.system-monitor-kpis.is-server-kpis .system-monitor-kpi{min-height:94px;padding:13px}.system-monitor-kpis.is-server-kpis .system-monitor-kpi strong{font-size:21px}.system-monitor-kpis.is-server-kpis .system-monitor-kpi:nth-child(3),.system-monitor-kpis.is-server-kpis .system-monitor-kpi:nth-child(7){grid-column:1/-1}
.system-monitor-service{padding:14px}.system-monitor-service h2{font-size:16px}.system-monitor-service-quick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:11px}.system-monitor-service-quick span{min-width:0;padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft)}.system-monitor-service-quick small,.system-monitor-service-quick b{display:block;overflow-wrap:anywhere}.system-monitor-service-quick small{color:var(--muted);font-size:10px}.system-monitor-service-quick b{margin-top:2px;color:var(--blue);font-size:12px}
.system-monitor-service-details{margin-top:10px;border-top:1px solid var(--line)}.system-monitor-service-details>summary{display:flex;justify-content:space-between;gap:10px;padding:10px 0 0;color:var(--blue);font-weight:800;cursor:pointer}.system-monitor-service-details>summary small{color:var(--muted);font-weight:700;text-align:right}.system-monitor-service-details:not([open]) .system-monitor-chart,.system-monitor-service-details:not([open]) dl{display:none}
.system-monitor-events{padding:14px}.system-monitor-events li{gap:9px;padding:9px 0}.system-monitor-events p{font-size:12px;line-height:1.4}.system-monitor-events time{font-size:11px}
}

.system-monitor {
    --monitor-cpu: #00a9c7;
    --monitor-ram: #21224a;
    --monitor-downstream: #7a1736;
    --monitor-upstream: #7651a8;
    display: grid;
    gap: 16px;
    min-width: 0;
}
.system-monitor-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.system-monitor-tabs button { min-height: 44px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--blue); }
.system-monitor-tabs button.active { border-bottom-color: var(--green); color: var(--green-dark, #087e5f); }
.system-monitor-tabs button:focus-visible { outline: 3px solid rgba(23, 177, 128, .3); outline-offset: -3px; }
.system-monitor-panel { min-width: 0; outline: none; }
.system-monitor-loading,
.system-monitor-empty { padding: 24px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.system-monitor-kpis { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; }
.system-monitor-kpi { min-height: 116px; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--green); background: #fff; }
.system-monitor-kpi.is-danger { border-left-color: var(--red, #dc4545); }
.system-monitor-kpi.is-warning { border-left-color: #d7a916; }
.system-monitor-kpi span,
.system-monitor-kpi small { display: block; color: var(--muted); }
.system-monitor-kpi strong { display: block; margin: 8px 0 5px; color: var(--blue); font-size: clamp(22px, 1.4vw, 30px); line-height: 1.05; }
.system-monitor-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.system-monitor-toolbar > div:first-child { display: grid; gap: 3px; }
.system-monitor-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.system-monitor-chart-grid.is-server { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.system-monitor-chart { margin: 0; padding: 16px; border: 1px solid var(--line); background: #fff; }
.system-monitor-chart figcaption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; color: var(--blue); font-weight: 700; }
.system-monitor-chart svg { display: block; width: 100%; min-height: 170px; }
.system-monitor-chart line { stroke: #d9e2e7; stroke-width: 1; }
.system-monitor-chart .system-monitor-chart-gridline { stroke: #e7edef; stroke-dasharray: 3 5; }
.system-monitor-chart-axis-label { fill: var(--muted); font-size: 11px; }
.system-monitor-chart polyline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.system-monitor-chart polyline.is-cpu { stroke: var(--monitor-cpu); }
.system-monitor-chart polyline.is-ram { stroke: var(--monitor-ram); }
.system-monitor-chart polyline.is-downstream { stroke: var(--monitor-downstream); }
.system-monitor-chart polyline.is-upstream { stroke: var(--monitor-upstream); }
.system-monitor-chart-point { fill: #fff; stroke-width: 2; opacity: .12; transition: opacity .15s, r .15s; }
.system-monitor-chart-point.is-cpu { stroke: var(--monitor-cpu); }
.system-monitor-chart-point.is-ram { stroke: var(--monitor-ram); }
.system-monitor-chart-point.is-downstream { stroke: var(--monitor-downstream); }
.system-monitor-chart-point.is-upstream { stroke: var(--monitor-upstream); }
.system-monitor-chart-point:hover,
.system-monitor-chart-point:focus { r: 7; opacity: 1; outline: none; }
.system-monitor-chart-legend { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; color: var(--muted); font-size: 12px; font-weight: 600; }
.system-monitor-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.system-monitor-chart-legend i { width: 18px; height: 3px; background: currentColor; }
.system-monitor-chart-legend .is-cpu { color: var(--monitor-cpu); }
.system-monitor-chart-legend .is-ram { color: var(--monitor-ram); }
.system-monitor-chart-legend .is-downstream { color: var(--monitor-downstream); }
.system-monitor-chart-legend .is-upstream { color: var(--monitor-upstream); }
.system-monitor-chart-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.system-monitor-events,
.system-monitor-database-table { margin-top: 12px; padding: 18px; border: 1px solid var(--line); background: #fff; }
.system-monitor-events > header,
.system-monitor-database-table > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.system-monitor-events h2,
.system-monitor-database-table h2 { margin: 3px 0 8px; font-size: 19px; }
.system-monitor-ranges { display: flex; gap: 4px; }
.system-monitor-ranges button { min-width: 44px; min-height: 38px; padding: 6px 10px; }
.system-monitor-ranges button.active { border-color: var(--green); color: var(--green-dark, #087e5f); }
.system-monitor-events ol { margin: 12px 0 0; padding: 0; list-style: none; }
.system-monitor-events li { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.system-monitor-events li.is-warning .system-monitor-status-dot { background: #d7a916; }
.system-monitor-events li.is-danger .system-monitor-status-dot { background: var(--red, #dc4545); }
.system-monitor-events p { margin: 3px 0; }
.system-monitor-events time { color: var(--muted); font-size: 13px; }
.system-monitor-status-dot { flex: 0 0 10px; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--green); }
.system-monitor-service-list { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 12px; }
.system-monitor-service { padding: 18px; border: 1px solid var(--line); border-top: 3px solid var(--green); background: #fff; }
.system-monitor-service.is-warning { border-top-color: #d7a916; }
.system-monitor-service.is-warning .system-monitor-status-dot { background: #d7a916; }
.system-monitor-service.is-danger { border-top-color: var(--red, #dc4545); }
.system-monitor-service.is-danger .system-monitor-status-dot { background: var(--red, #dc4545); }
.system-monitor-service > header,
.system-monitor-service > header > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.system-monitor-service h2 { margin: 0; font-size: 18px; }
.system-monitor-service dl { margin: 14px 0 0; }
.system-monitor-service dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.system-monitor-service dt { color: var(--muted); }
.system-monitor-service dd { margin: 0; text-align: right; font-weight: 700; }
.system-monitor-service .system-monitor-chart.is-compact { margin-top: 14px; padding: 10px; background: var(--surface-soft); }
.system-monitor-service .system-monitor-chart.is-compact figcaption { margin-bottom: 6px; font-size: 13px; }
.system-monitor-service .system-monitor-chart.is-compact svg { min-height: 104px; }
.system-monitor-service .system-monitor-chart.is-compact .system-monitor-chart-axis-label { font-size: 9px; }
.system-monitor-database-table .table-wrap { margin-top: 14px; overflow-x: auto; }
.system-monitor-database-table table { width: 100%; border-collapse: collapse; }
.system-monitor-database-table th,
.system-monitor-database-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.system-monitor-database-kpis { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.system-monitor-database-panel { margin-top: 12px; }
.system-monitor-application.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1500px) {
    .system-monitor-kpis { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .system-monitor-service-list { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
    .system-monitor-database-kpis { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .system-monitor-chart-grid.is-server { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .system-monitor-kpis,
    .system-monitor-database-kpis,
    .system-monitor-chart-grid,
    .system-monitor-service-list,
    .system-monitor-application.dashboard-grid { grid-template-columns: 1fr; }
    .system-monitor-tabs button { flex: 0 0 auto; }
    .system-monitor-events > header,
    .system-monitor-database-table > header { flex-direction: column; }
    .system-monitor-toolbar { align-items: stretch; flex-direction: column; }
    .system-monitor-ranges { width: 100%; }
    .system-monitor-ranges button { flex: 1; }
}

.mira-drawer .mira-cad-candidates { display: grid; gap: 8px; margin: 12px 0; }
.mira-drawer .mira-cad-candidates > strong { font-size: 13px; }
.mira-drawer .mira-cad-candidates article { display: grid; gap: 9px; padding: 11px; border: 1px solid #cbdcdb; border-left: 3px solid var(--green); background: #f7fbfa; }
.mira-drawer .mira-cad-candidates article div { min-width: 0; }
.mira-drawer .mira-cad-candidates b,
.mira-drawer .mira-cad-candidates span,
.mira-drawer .mira-cad-candidates small { display: block; overflow-wrap: anywhere; }
.mira-drawer .mira-cad-candidates span { margin-top: 2px; }
.mira-drawer .mira-cad-candidates small { margin-top: 3px; color: var(--muted); line-height: 1.4; }
.mira-drawer .mira-cad-candidates button { min-height: 42px; border: 0; background: var(--green-2); color: #fff; font-weight: 700; cursor: pointer; }
.mira-drawer .mira-cad-candidates button:hover { background: #07775e; }
.mira-drawer .mira-cad-candidates button:focus-visible { outline: 3px solid rgba(10, 143, 112, .28); outline-offset: 2px; }
.mira-drawer .mira-cad-candidates button:disabled { cursor: wait; opacity: .65; }

.ai-project-office .cad-sql-hub {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-left: 4px solid #778590;
    background: var(--surface);
}
.ai-project-office .cad-sql-hub.is-success { border-left-color: var(--green); }
.ai-project-office .cad-sql-hub.is-warning { border-left-color: #d4a31c; }
.ai-project-office .cad-sql-hub.is-danger { border-left-color: #d74646; }
.ai-project-office .cad-sql-hub > header,
.ai-project-office .cad-sql-snapshot,
.ai-project-office .cad-sql-candidates article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.ai-project-office .cad-sql-hub h2,
.ai-project-office .cad-sql-hub p { margin: 3px 0 0; }
.ai-project-office .cad-sql-hub > header p { max-width: 78ch; color: var(--muted); line-height: 1.5; }
.ai-project-office .cad-sql-status {
    flex: 0 0 auto;
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}
.ai-project-office .cad-sql-status span,
.ai-project-office .cad-sql-snapshot span,
.ai-project-office .cad-sql-link-data dt,
.ai-project-office .cad-sql-candidates small { display: block; color: var(--muted); font-size: 12px; }
.ai-project-office .cad-sql-link-data {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    background: var(--line);
    border: 1px solid var(--line);
}
.ai-project-office .cad-sql-link-data div { min-width: 0; padding: 12px; background: var(--surface-soft); }
.ai-project-office .cad-sql-link-data dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.ai-project-office .cad-sql-snapshot { padding: 13px; border: 1px solid var(--line); background: #f5faf8; }
.ai-project-office .cad-sql-snapshot strong,
.ai-project-office .cad-sql-snapshot small { display: block; }
.ai-project-office .cad-sql-snapshot small { margin-top: 3px; color: var(--muted); }
.ai-project-office .cad-sql-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-project-office .cad-sql-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ai-project-office .cad-sql-counts span { padding: 5px 8px; background: #eaf4f0; color: var(--text); font-weight: 700; }
.ai-project-office .cad-sql-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.ai-project-office .cad-sql-search label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.ai-project-office .cad-sql-candidates { display: grid; gap: 8px; }
.ai-project-office .cad-sql-candidates h4 { margin: 0; }
.ai-project-office .cad-sql-candidates article { padding: 11px 12px; border: 1px solid var(--line); background: var(--surface-soft); }
.ai-project-office .cad-sql-candidates article span { display: block; margin-top: 2px; }
.ai-project-office .cad-sql-warning { padding: 10px 12px; border-left: 3px solid #d4a31c; background: #fff9e9; }
.ai-project-office .cad-sql-empty { color: var(--muted); }
.ai-project-office .cad-sql-hub > footer { display: flex; justify-content: flex-end; }
.ai-project-office .cad-ist-model { display: grid; gap: 14px; padding: 16px; border: 1px solid #c7deda; background: #fbfefd; }
.ai-project-office .cad-ist-model > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ai-project-office .cad-ist-model h3, .ai-project-office .cad-ist-model h4, .ai-project-office .cad-ist-model p { margin: 0; }
.ai-project-office .cad-ist-model > header p { max-width: 82ch; margin-top: 4px; color: var(--muted); line-height: 1.45; }
.ai-project-office .cad-ist-status { padding: 5px 8px; background: #e7f4ee; color: #087a5c; font-size: 12px; font-weight: 800; }
.ai-project-office .cad-ist-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.ai-project-office .cad-ist-metrics span { min-width: 0; padding: 10px 12px; background: var(--surface); }
.ai-project-office .cad-ist-metrics small, .ai-project-office .cad-ist-metrics b { display: block; }
.ai-project-office .cad-ist-metrics small { color: var(--muted); font-size: 12px; }
.ai-project-office .cad-ist-metrics b { margin-top: 3px; font-size: 17px; }
.ai-project-office .cad-ist-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ai-project-office .cad-ist-groups article { position: relative; min-width: 0; padding: 11px; border: 1px solid var(--line); background: var(--surface); }
.ai-project-office .cad-ist-groups strong, .ai-project-office .cad-ist-groups span, .ai-project-office .cad-ist-groups small { display: block; }
.ai-project-office .cad-ist-groups b { position: absolute; right: 10px; top: 8px; padding: 3px 7px; background: #eaf4f0; }
.ai-project-office .cad-ist-groups span { margin-top: 7px; line-height: 1.35; }
.ai-project-office .cad-ist-groups small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.ai-project-office .cad-ist-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ai-project-office .cad-ist-columns > article, .ai-project-office .cad-ist-handover { padding: 12px; border-left: 3px solid #21a878; background: #f3faf7; }
.ai-project-office .cad-ist-columns p { margin-top: 6px; line-height: 1.45; }
.ai-project-office .cad-ist-columns ul, .ai-project-office .cad-ist-handover ol { margin: 9px 0 0; padding-left: 20px; }
.ai-project-office .cad-ist-columns li + li, .ai-project-office .cad-ist-handover li + li { margin-top: 4px; }
.ai-project-office .cad-ist-columns li b { color: #966a00; }
.ai-project-office .cad-ist-good { color: #087a5c; font-weight: 700; }
.ai-project-office .cad-ist-orientations { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ai-project-office .cad-ist-orientations span { padding: 3px 6px; background: #e8f2f6; font-size: 12px; font-weight: 700; }
.ai-project-office .cad-ist-handover { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); gap: 16px; border-left-color: #3f78a5; background: #f4f8fb; }
.ai-project-office .cad-ist-handover p { margin-top: 4px; line-height: 1.45; }
.ai-project-office .cad-ist-disclaimer { color: var(--muted); line-height: 1.4; }
.digital-office-dashboard .cad-sql-admin-status,
.system-monitor-database-panel .cad-sql-admin-status { border-left: 4px solid #778590; }
.digital-office-dashboard .cad-sql-admin-status.is-success,
.system-monitor-database-panel .cad-sql-admin-status.is-success { border-left-color: var(--green); }
.digital-office-dashboard .cad-sql-admin-status.is-warning,
.system-monitor-database-panel .cad-sql-admin-status.is-warning { border-left-color: #d4a31c; }
.digital-office-dashboard .cad-sql-admin-status.is-danger,
.system-monitor-database-panel .cad-sql-admin-status.is-danger { border-left-color: var(--danger); }
.digital-office-dashboard .cad-sql-admin-status dl,
.system-monitor-database-panel .cad-sql-admin-status dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 16px 0 0; border: 1px solid var(--line); background: var(--line); }
.digital-office-dashboard .cad-sql-admin-status dl div,
.system-monitor-database-panel .cad-sql-admin-status dl div { min-width: 0; padding: 11px 12px; background: var(--surface-soft); }
.digital-office-dashboard .cad-sql-admin-status dt,
.system-monitor-database-panel .cad-sql-admin-status dt { color: var(--muted); font-size: 12px; }
.digital-office-dashboard .cad-sql-admin-status dd,
.system-monitor-database-panel .cad-sql-admin-status dd { margin: 4px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.digital-office-dashboard .cad-sql-admin-badge,
.system-monitor-database-panel .cad-sql-admin-badge { flex: 0 0 auto; padding: 7px 10px; background: #eef3f4; font-weight: 700; }
.digital-office-dashboard .cad-sql-admin-error { margin: 12px 0 0; color: var(--danger); font-weight: 700; }
.digital-office-dashboard .cad-sql-admin-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
@media (max-width: 760px) {
    .ai-project-office .cad-sql-hub { padding: 15px; }
    .ai-project-office .cad-sql-hub > header,
    .ai-project-office .cad-sql-snapshot,
    .ai-project-office .cad-sql-candidates article { align-items: stretch; flex-direction: column; }
    .ai-project-office .cad-sql-status { min-width: 0; }
    .ai-project-office .cad-sql-link-data,
    .ai-project-office .cad-sql-search { grid-template-columns: 1fr; }
    .ai-project-office .cad-ist-metrics,
    .ai-project-office .cad-ist-groups,
    .ai-project-office .cad-ist-columns,
    .ai-project-office .cad-ist-handover { grid-template-columns: 1fr; }
    .ai-project-office .cad-ist-model > header { flex-direction: column; }
    .ai-project-office .cad-sql-search button,
    .ai-project-office .cad-sql-snapshot button,
    .ai-project-office .cad-sql-candidates button,
    .ai-project-office .cad-sql-hub > footer button { width: 100%; min-height: 44px; }
    .digital-office-dashboard .cad-sql-admin-status dl { grid-template-columns: 1fr; }
}

/* Digitales Büro: strukturierte Gebäudedatenanforderungen und Modellimport */
.ai-project-office .building-model-hub {
    margin-bottom: 20px;
    padding: clamp(18px, 1.6vw, 28px);
    border: 1px solid #cfdde0;
    border-left: 4px solid #18a873;
    background: #fff;
}

:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel { display: grid; gap: 14px; padding: 18px; border: 1px solid #d5e1e3; border-left: 4px solid var(--green); background: #fff; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel > header { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel h2 { margin: 3px 0 5px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel p { max-width: 74ch; margin: 0; color: var(--muted); line-height: 1.5; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-visibility { border: 1px solid #d5e1e3; background: #f7faf9; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-visibility summary { padding: 10px 12px; color: var(--text); font-weight: 700; cursor: pointer; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-visibility > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-visibility button { display: inline-flex; align-items: center; gap: 7px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-visibility button span { min-width: 20px; padding: 1px 5px; border-radius: 999px; background: #eaf4f0; font-size: 12px; font-weight: 700; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-visibility button.is-hidden { opacity: .54; text-decoration: line-through; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-metrics span { padding: 5px 8px; background: #eaf4f0; color: var(--text); font-size: 13px; font-weight: 700; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); min-height: 520px; border: 1px solid #cbdadd; background: #f4f7f8; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-canvas { position: relative; min-height: 520px; overflow: hidden; background: #f4f7f8; touch-action: none; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-canvas canvas { display: block; width: 100%; height: 100%; cursor: grab; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-canvas canvas:active { cursor: grabbing; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail { min-width: 0; overflow: auto; padding: 18px; border-left: 1px solid #cbdadd; background: #fff; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-empty { display: grid; gap: 8px; align-content: center; min-height: 100%; color: #657187; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-empty strong { color: var(--text); font-size: 17px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-content h3 { margin: 4px 0 14px; font-size: 21px; overflow-wrap: anywhere; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-values > div { min-width: 0; padding: 10px; background: #f4f7f8; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-values dt { color: #657187; font-size: 12px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-values dd { margin: 3px 0 0; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-layer-model { margin-top: 16px; padding-top: 15px; border-top: 1px solid #dce5e8; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-layer-model header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-layer-model h4 { margin: 0; font-size: 16px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-layer-model header span { display: block; margin-top: 2px; color: #657187; font-size: 12px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-layer-model header b { flex: 0 0 auto; color: #08785a; font-size: 12px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-stack { display: flex; min-height: 94px; margin: 13px 0 12px; padding: 9px; border: 1px solid #9eafb2; background: #3d5e78; box-shadow: inset 0 0 0 3px rgba(255,255,255,.22); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer { position: relative; display: flex; min-width: 5px; overflow: hidden; border-right: 1px solid rgba(27,43,52,.55); box-shadow: inset -3px 0 rgba(255,255,255,.17); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer:last-child { border-right: 0; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer.is-inhomogeneous { box-shadow: inset 0 0 0 1px rgba(27,43,52,.56); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-segment, :is(.ai-project-office, .project-cad-viewer-host) .cad-layer-key-segment { display: block; min-width: 0; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer.is-inhomogeneous .cad-layer-segment + .cad-layer-segment { border-left: 1px solid rgba(27,43,52,.46); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-air { background: radial-gradient(circle at 4px 4px, rgba(49,89,104,.55) 0 1px, transparent 1.5px) 0 0/11px 11px, #b9e0e8; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-ventilated-air { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(54,102,117,.56) 5px 7px, transparent 7px 12px), #b9e0e8; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-roof-covering { background: radial-gradient(ellipse at 7px 100%, transparent 0 5px, #4f5155 5.5px 6.5px, transparent 7px) 0 0/16px 9px, linear-gradient(#22252a, #34373b); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-underlay { background: repeating-linear-gradient(135deg, #6ea69a 0 2px, #d2e7df 2px 6px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-vapour-control { background: repeating-linear-gradient(0deg, #326f80 0 2px, #77bec5 2px 4px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-waterproofing { background: repeating-linear-gradient(0deg, #303439 0 3px, #595e63 3px 5px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-brick { background: repeating-linear-gradient(0deg, #c9878c 0 8px, #f2bdc0 8px 10px), repeating-linear-gradient(90deg, transparent 0 18px, #81565c 18px 20px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-render { background: repeating-linear-gradient(135deg, #ead6cc 0 4px, #f6e8de 4px 8px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-insulation { background: repeating-linear-gradient(45deg, #eccd66 0 4px, #fff0aa 4px 8px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-foam-insulation { background: radial-gradient(circle at 4px 4px, rgba(132,113,31,.45) 0 1px, transparent 1.5px) 0 0/9px 9px, #f7e599; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-aerated-concrete { background: repeating-linear-gradient(135deg, #c8d0c0 0 7px, #9fa99d 7px 9px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-concrete { background: radial-gradient(circle at 4px 4px, rgba(55,69,72,.42) 0 1px, transparent 1.5px) 0 0/10px 10px, #aeb5b2; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-timber-frame { background: repeating-linear-gradient(90deg, #8f4e48 0 3px, #c98277 3px 12px, #9f5b53 12px 14px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-timber-board { background: repeating-linear-gradient(0deg, #a86358 0 2px, #d49a8d 2px 8px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-wood { background: repeating-linear-gradient(135deg, #9e625a 0 2px, #d8a296 2px 8px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-gypsum { background: repeating-linear-gradient(135deg, #e5e7dd 0 5px, #f6f5ef 5px 9px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-screed { background: linear-gradient(135deg, #9b99be, #817fa9); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-glass { background: linear-gradient(135deg, #a2f0f2, #20cddb); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-metal { background: repeating-linear-gradient(135deg, #aeb9bd 0 3px, #e4e8e7 3px 7px); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-soil { background: radial-gradient(circle at 4px 4px, rgba(81,57,35,.48) 0 1px, transparent 1.5px) 0 0/10px 10px, #a98967; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-other { background: #7f9d95; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-list li { display: grid; grid-template-columns: 13px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px; border: 1px solid #e0e8e9; background: #fff; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-list strong, :is(.ai-project-office, .project-cad-viewer-host) .cad-layer-list small { display: block; overflow-wrap: anywhere; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-list small { margin-top: 2px; color: #657187; font-size: 11px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-list b { color: var(--text); font-size: 12px; white-space: nowrap; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-layer-key { display: flex; width: 13px; height: 18px; overflow: hidden; border: 1px solid rgba(27,43,52,.35); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail-note { margin-top: 12px; padding: 11px; border: 1px dashed #cbdadd; font-size: 13px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel > footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel > footer strong { color: var(--text); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-loading, :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-empty { min-height: 180px; align-content: center; color: var(--muted); }
:is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-empty h2 { color: var(--text); }

/* Der globale Viewer ist eine eigenständige Arbeitsfläche und kein kompaktes Projekt-Widget. */
.tools-viewer-host { min-width: 0; }
.tools-viewer-host .cad-viewer-panel { display: grid; gap: 16px; min-height: min(760px, calc(100vh - 250px)); padding: clamp(18px, 1.5vw, 28px); border: 1px solid #d5e1e3; border-left: 4px solid var(--green); border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(21, 47, 68, .08); }
.tools-viewer-host .cad-viewer-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.tools-viewer-host .cad-viewer-panel h2 { margin: 3px 0 5px; }
.tools-viewer-host .cad-viewer-panel p { max-width: 74ch; margin: 0; color: var(--muted); line-height: 1.5; }
.tools-viewer-host .cad-viewer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tools-viewer-host .cad-viewer-visibility { border: 1px solid #d5e1e3; border-radius: 10px; background: #f7faf9; }
.tools-viewer-host .cad-viewer-visibility summary { padding: 10px 12px; color: var(--text); font-weight: 700; cursor: pointer; }
.tools-viewer-host .cad-viewer-visibility > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }
.tools-viewer-host .cad-viewer-visibility button { display: inline-flex; align-items: center; gap: 7px; }
.tools-viewer-host .cad-viewer-visibility button span { min-width: 20px; padding: 1px 5px; border-radius: 999px; background: #eaf4f0; font-size: 12px; font-weight: 700; }
.tools-viewer-host .cad-viewer-visibility button.is-hidden { opacity: .54; text-decoration: line-through; }
.tools-viewer-host .cad-viewer-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.tools-viewer-host .cad-viewer-metrics span { padding: 5px 8px; border-radius: 6px; background: #eaf4f0; color: var(--text); font-size: 13px; font-weight: 700; }
.tools-viewer-host .cad-viewer-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 390px); min-height: clamp(560px, 64vh, 760px); overflow: hidden; border: 1px solid #cbdadd; border-radius: 12px; background: #f4f7f8; }
.tools-viewer-host .cad-viewer-canvas { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 40%, #ffffff 0, #f4f7f8 68%); touch-action: none; }
.tools-viewer-host .cad-viewer-canvas canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.tools-viewer-host .cad-viewer-canvas canvas:active { cursor: grabbing; }
.tools-viewer-host .cad-viewer-detail { min-width: 0; overflow: auto; padding: 20px; border-left: 1px solid #cbdadd; background: #fff; }
.tools-viewer-host .cad-viewer-detail-empty { display: grid; gap: 8px; align-content: center; min-height: 100%; color: #657187; }
.tools-viewer-host .cad-viewer-detail-empty strong { color: var(--text); font-size: 18px; }
.tools-viewer-host .cad-viewer-detail-content h3 { margin: 4px 0 14px; font-size: 21px; overflow-wrap: anywhere; }
.tools-viewer-host .cad-viewer-detail-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.tools-viewer-host .cad-viewer-detail-values > div { min-width: 0; padding: 10px; border-radius: 6px; background: #f4f7f8; }
.tools-viewer-host .cad-viewer-detail-values dt { color: #657187; font-size: 12px; }
.tools-viewer-host .cad-viewer-detail-values dd { margin: 3px 0 0; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.tools-viewer-host .cad-viewer-layer-model { margin-top: 16px; padding-top: 15px; border-top: 1px solid #dce5e8; }
.tools-viewer-host .cad-viewer-panel > footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.tools-viewer-host .cad-viewer-loading, .tools-viewer-host .cad-viewer-empty { min-height: 320px; align-content: center; color: var(--muted); }
@media (max-width: 920px) {
    .tools-viewer-host .cad-viewer-workspace { grid-template-columns: 1fr; min-height: 0; }
    .tools-viewer-host .cad-viewer-canvas { min-height: min(62vh, 560px); }
    .tools-viewer-host .cad-viewer-detail { min-height: 220px; border-top: 1px solid #cbdadd; border-left: 0; }
}
@media (max-width: 640px) {
    .tools-viewer-host .cad-viewer-panel { min-height: 0; padding: 16px; }
    .tools-viewer-host .cad-viewer-panel > header, .tools-viewer-host .cad-viewer-panel > footer { align-items: stretch; flex-direction: column; }
    .tools-viewer-host .cad-viewer-actions { justify-content: stretch; }
    .tools-viewer-host .cad-viewer-actions button { flex: 1 1 150px; }
    .tools-viewer-host .cad-viewer-canvas { min-height: 400px; }
}
@media (max-width: 760px) {
    :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel > header, :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-panel > footer { align-items: stretch; flex-direction: column; }
    :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-actions { justify-content: stretch; }
    :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-actions button { flex: 1 1 160px; }
    :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-workspace { grid-template-columns: 1fr; min-height: 0; }
    :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-canvas { min-height: 400px; }
    :is(.ai-project-office, .project-cad-viewer-host) .cad-viewer-detail { min-height: 220px; border-top: 1px solid #cbdadd; border-left: 0; }
}
.ai-project-office .building-model-hub-head,
.building-model-dialog-shell > header,
.building-model-gap header,
.building-model-import-card header,
.building-model-value header,
.building-model-gap footer,
.building-model-import-card footer,
.building-model-value footer,
.building-model-dialog-shell > footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.ai-project-office .building-model-hub-head h2,
.building-model-dialog-shell h2 { margin: 3px 0 6px; font-size: clamp(20px, 1.25vw, 26px); }
.ai-project-office .building-model-hub-head p { margin: 0; max-width: 78ch; }
.ai-project-office .building-model-metrics,
.building-model-review-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}
.ai-project-office .building-model-metrics > div,
.building-model-review-summary > div {
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid #dce5e8;
    background: #f7faf9;
}
.ai-project-office .building-model-metrics span,
.building-model-review-summary span { display: block; color: #657187; font-size: 13px; }
.ai-project-office .building-model-metrics strong,
.building-model-review-summary strong { display: block; margin-top: 3px; font-size: 24px; }
.ai-project-office .building-model-block + .building-model-block { margin-top: 22px; }
.ai-project-office .building-model-block > h3,
.building-model-review-group > h3 { margin: 0 0 10px; font-size: 17px; }
.ai-project-office .building-model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; }
.ai-project-office .building-model-gap,
.ai-project-office .building-model-import-card,
.building-model-value {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dce5e8;
    border-left: 3px solid #93a3aa;
    background: #fff;
}
.ai-project-office .building-model-gap.is-warning,
.ai-project-office .building-model-import-card.is-warning,
.building-model-value.is-warning { border-left-color: #dda900; }
.ai-project-office .building-model-gap.is-success,
.ai-project-office .building-model-import-card.is-success,
.building-model-value.is-success { border-left-color: #18a873; }
.ai-project-office .building-model-gap.is-danger,
.ai-project-office .building-model-import-card.is-danger { border-left-color: #d94848; }
.building-model-domain { color: #08785a; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.building-model-status { flex: 0 0 auto; padding: 5px 8px; background: #eef3f4; color: #34465a; font-size: 12px; font-weight: 700; }
.building-model-gap h4,
.building-model-import-card h4,
.building-model-value h4 { margin: 4px 0 0; font-size: 16px; }
.building-model-gap p,
.building-model-import-card p { line-height: 1.5; }
.building-model-gap ul { margin: 10px 0; padding-left: 20px; }
.building-model-gap footer,
.building-model-import-card footer,
.building-model-value footer { align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e5ecee; }
.building-model-import-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.building-model-import-card dl div { padding: 8px; background: #f7faf9; }
.building-model-import-card dt { color: #657187; font-size: 12px; }
.building-model-import-card dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.building-model-empty { margin: 12px 0 0; padding: 14px; border: 1px dashed #cfdde0; color: #657187; }
.building-model-error,
.building-model-warning { color: #b52f2f; }
.building-model-dialog {
    width: min(1180px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    background: transparent;
}
.building-model-dialog::backdrop { background: rgba(13, 24, 38, .58); }
.building-model-dialog-shell { max-height: calc(100vh - 32px); overflow: auto; padding: 22px; background: #f4f7f8; color: #171a43; }
.building-model-dialog-shell > header { position: sticky; top: -22px; z-index: 2; margin: -22px -22px 0; padding: 20px 22px; border-bottom: 1px solid #dce5e8; background: #fff; }
.building-model-dialog-shell > main { display: grid; gap: 16px; }
.building-model-review-group { min-width: 0; padding: 18px; border: 1px solid #dce5e8; background: #fff; }
.building-model-review-group .building-model-value + .building-model-value { margin-top: 10px; }
.building-model-review-note { display: flex; gap: 8px; margin-bottom: 16px; padding: 12px 14px; border-left: 3px solid #18a873; background: #eaf8f3; }
.building-model-value-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.building-model-value-compare > div { min-width: 0; padding: 12px; border: 1px solid #dce5e8; background: #f7faf9; }
.building-model-value-compare span,
.building-model-value-compare small { display: block; color: #657187; }
.building-model-value-compare strong { display: block; margin: 5px 0; font-size: 17px; overflow-wrap: anywhere; }
.building-model-source-stack {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #cfdde0;
    background: #f7faf9;
}
.building-model-source-stack > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.building-model-source-stack h5 { margin: 0; font-size: 15px; }
.building-model-source-stack .building-model-target-identity {
    display: block;
    margin-top: 3px;
    color: #657187;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.building-model-source-list { display: grid; gap: 9px; }
.building-model-source-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dce5e8;
    background: #fff;
}
.building-model-source-row.is-master { border-left: 4px solid #18a873; }
.building-model-source-row strong,
.building-model-source-row span,
.building-model-source-row small { display: block; overflow-wrap: anywhere; }
.building-model-source-row small { margin-top: 3px; color: #657187; }
.building-model-source-badge {
    display: inline-block;
    width: fit-content;
    margin-bottom: 4px;
    padding: 3px 6px;
    background: #eaf8f3;
    color: #08785a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.building-model-source-action { min-height: 40px; white-space: nowrap; }
.building-model-dialog-shell > footer { position: sticky; bottom: -22px; align-items: center; margin: 18px -22px -22px; padding: 16px 22px; border-top: 1px solid #dce5e8; background: #fff; }

@media (max-width: 760px) {
    .ai-project-office .building-model-hub-head,
    .building-model-dialog-shell > header,
    .building-model-dialog-shell > footer { align-items: stretch; flex-direction: column; }
    .ai-project-office .building-model-hub-head button,
    .building-model-dialog-shell > footer button { width: 100%; }
    .ai-project-office .building-model-metrics,
    .building-model-review-summary { grid-template-columns: 1fr; }
    .ai-project-office .building-model-grid { grid-template-columns: 1fr; }
    .building-model-value-compare { grid-template-columns: 1fr; }
    .building-model-source-stack > header,
    .building-model-source-row { grid-template-columns: 1fr; align-items: stretch; }
    .building-model-source-stack > header { flex-direction: column; }
    .building-model-source-action { width: 100%; }
    .building-model-dialog { width: 100vw; max-height: 100dvh; margin: 0; }
    .building-model-dialog-shell { min-height: 100dvh; max-height: 100dvh; }
    .building-model-gap footer,
    .building-model-import-card footer,
    .building-model-value footer { align-items: stretch; flex-direction: column; }
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* App-Arbeitsplatz mit fester Navigation */
:root {
    --app-sidebar-width: 244px;
    --app-mobile-bar-height: 58px;
}

#appView { min-height: 100vh; background: #f5f7f8; }

.app-sidebar.topbar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--app-sidebar-width);
    height: 100vh;
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    overflow-y: auto;
    background: #fff;
    border: 0;
    border-right: 1px solid var(--line);
}

.app-sidebar .brand { padding: 0 8px 16px; border-bottom: 1px solid var(--line); }
.app-sidebar .brand img { width: 142px; }

.app-sidebar nav {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    overflow: visible;
}

.app-sidebar nav .nav-section-label {
    margin: 16px 10px 5px;
    color: #9298a7;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.app-sidebar nav .nav-section-label:first-child { margin-top: 0; }

.app-sidebar nav button {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 6px;
    text-align: left;
    font-size: 12px;
}

.app-sidebar nav button:hover,
.app-sidebar nav button.active,
.app-sidebar nav button.active:hover { color: var(--blue); background: #edf8f4; }
.app-sidebar nav button.active { color: var(--green-2); box-shadow: inset 3px 0 0 var(--green); }
.app-sidebar nav button::after,
.app-sidebar nav button:hover::after,
.app-sidebar nav button.active::after { display: none; }

.app-sidebar .session-area {
    padding: 14px 8px 0;
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
}
.app-sidebar .current-user {
    min-width: 0;
    overflow: hidden;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-sidebar .session-area button { width: 100%; }

.app-menu-toggle,
.app-nav-backdrop { display: none; }

@media (max-width: 980px) {
    .app-menu-toggle {
        position: fixed;
        z-index: 45;
        top: 9px;
        left: 12px;
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 8px 13px;
        color: var(--blue);
        background: #fff;
        border: 1px solid var(--line);
        box-shadow: 0 4px 12px rgba(33, 34, 74, .08);
    }
    .app-sidebar.topbar {
        width: min(286px, 86vw);
        padding: 18px 14px;
        transform: translateX(-102%);
        transition: transform .2s ease;
        box-shadow: 18px 0 44px rgba(21, 22, 56, .18);
    }
    body.app-nav-open .app-sidebar.topbar { transform: translateX(0); }
    .app-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 38;
        display: block;
        background: rgba(21, 22, 56, .42);
    }
    .app-nav-backdrop[hidden] { display: none; }
}

* { box-sizing: border-box; }

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
    background:
        linear-gradient(180deg, #ffffff 0, #ffffff 120px, #f8fbfb 360px, var(--gray) 760px),
        var(--gray);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* Gebäude: Die Kartenkacheln werden extern gerendert; hier bleibt nur die Projektübersicht. */
.building-map-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: var(--shadow);
}
.building-map-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(165px, 1fr) minmax(145px, .8fr) auto;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}
.building-map-controls > * { margin: 0; }
.building-map-controls button { white-space: nowrap; }
.building-map-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    color: var(--muted);
    font-size: 13px;
}
.building-map-canvas {
    height: clamp(560px, calc(100vh - 220px), 1200px);
    min-height: 420px;
    background: #edf3f1;
}
.building-map-popup h3 { margin: 3px 0 5px; font-size: 16px; }
.building-map-popup p { margin: 0 0 9px; color: var(--muted); font-size: 13px; }
.building-map-popup button { width: 100%; margin-top: 12px; }
.building-map-company-popup a { color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.building-map-company-popup a:hover { color: var(--green-2); text-decoration: underline; }
.building-map-company-marker { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; color: #fff; background: var(--green-2); border: 3px solid #fff; border-radius: 50% 50% 50% 0; box-shadow: 0 3px 10px rgba(26, 66, 61, .32); transform: rotate(-45deg); }
.building-map-company-marker:hover, .building-map-company-marker:focus-visible { background: #1d8d65; outline: 3px solid rgba(37, 170, 117, .25); outline-offset: 2px; }
.building-map-company-marker span { font-size: 12px; font-weight: 900; transform: rotate(45deg); }
.building-map-status { display: inline-flex; padding: 2px 8px; color: var(--blue); background: #edf8f4; border-radius: 999px; font-size: 12px; font-weight: 700; }
.map-message { padding: 22px; }
.maplibregl-popup-content { padding: 15px; border-radius: 6px; box-shadow: 0 10px 28px rgba(33, 34, 74, .18); }
.maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); }
@media (max-width: 820px) {
    .building-map-controls { grid-template-columns: 1fr 1fr; }
    .building-map-controls input { grid-column: 1 / -1; }
    .building-map-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
    .building-map-canvas { height: 58vh; min-height: 360px; }
}
@media (max-width: 460px) {
    .building-map-controls { grid-template-columns: 1fr; }
    .building-map-controls input { grid-column: auto; }
    .building-map-canvas { height: 54vh; min-height: 320px; }
}

#appView {
    width: 100%;
    min-width: 0;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card, .card, .table-card, dialog {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(420px, 100%);
    padding: 28px;
    border-top: 4px solid var(--green);
}

.auth-card h1, .brand {
    color: var(--blue);
    letter-spacing: .01em;
}

.auth-card h1 span, .brand span { color: var(--green); }

.auth-card h1 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-card h1 img {
    width: min(210px, 70%);
    height: auto;
    display: block;
}

.auth-remember { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.auth-remember input { width: 18px; min-width: 18px; height: 18px; margin-top: 2px; padding: 0; }
.auth-remember span { display: grid; gap: 3px; }
.auth-remember small { color: var(--muted); font-size: .8rem; font-weight: 400; }

label {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    font-weight: 700;
}

input, select, textarea, button:not(:where(.codex-console *)) {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    inline-size: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid #cadbe3;
    border-radius: var(--ek-control-radius, 6px);
    padding: 12px 13px;
    background: #fff;
    color: var(--text);
    display: block;
}

label {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.card form,
.table-card form,
dialog form {
    min-width: 0;
    max-width: 100%;
}

input[type="date"],
input[type="month"],
input[type="datetime-local"],
input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    inline-size: 100%;
    min-width: 0;
    max-width: 100%;
    line-height: 1.25;
    box-sizing: border-box;
}

input::-webkit-date-and-time-value {
    max-width: 100%;
    min-width: 0;
    text-align: left;
}

input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(24, 179, 136, .16);
}

button:not(:where(.codex-console *)) {
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
    box-shadow: none;
}

button:not(:where(.codex-console *)):hover { background: var(--green-2); }
button:not(:where(.codex-console *)):disabled {
    cursor: not-allowed;
    opacity: .45;
}
button:not(:where(.codex-console *)).secondary, button:not(:where(.codex-console *)).ghost {
    background: #fff;
    color: var(--blue);
    border: 1px solid var(--line);
    box-shadow: none;
}
button:not(:where(.codex-console *)).ghost:hover,
button:not(:where(.codex-console *)).secondary:hover {
    background: #f7fbfa;
    border-color: rgba(37, 170, 117, .36);
}
button:not(:where(.codex-console *)).tertiary {
    min-height: auto;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--green-2);
    text-transform: none;
    letter-spacing: 0;
}
button:not(:where(.codex-console *)).tertiary:hover { color: var(--blue); background: var(--ek-hover-background, #f7fbfa); }
button:not(:where(.codex-console *)).danger { background: var(--danger); }

.topbar {
    display: flex;
    align-items: center;
    gap: 34px;
    padding: 20px 42px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 17px;
    flex: 0 0 auto;
}

.brand img {
    width: 150px;
    max-height: 58px;
    display: block;
}

nav {
    display: flex;
    gap: 30px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    overflow: visible;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

nav::-webkit-scrollbar { display: none; }

nav button {
    background: transparent;
    color: var(--blue);
    border: 1px solid transparent;
    border-radius: 0;
    padding: 10px 0 12px;
    min-height: 38px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .01em;
    text-transform: uppercase;
    flex: 0 0 auto;
    position: relative;
}

nav button:hover,
nav button.active:hover {
    background: transparent;
    color: var(--green);
}

nav button.active {
    border-color: transparent;
    color: var(--green);
    background: transparent;
    box-shadow: none;
}

nav button.active::after,
nav button:hover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--green);
}

.session-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.current-user {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.template-task-note,
.task-detail-description {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-line;
}

.task-detail-item.auto-task {
    background: #f4faf8;
    border-left: 4px solid var(--green);
    border-radius: 8px;
    padding: 14px 16px 22px 14px;
    position: relative;
    overflow: hidden;
}

.task-detail-item.auto-task::before {
    content: "";
    position: absolute;
    left: 14px;
    right: 16px;
    bottom: 10px;
    height: 7px;
    background: #dce7ec;
    border-radius: 999px;
}

.task-detail-item.auto-task::after {
    content: "";
    position: absolute;
    left: 14px;
    bottom: 10px;
    width: var(--progress, 0%);
    max-width: calc(100% - 30px);
    height: 7px;
    background: var(--green);
    border-radius: 999px;
}

.task-detail-item.sub-task {
    margin-left: 24px;
}

.auto-progress {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 110px;
    color: var(--blue);
    justify-content: flex-end;
}

.auto-progress strong {
    font-size: 18px;
}

.auto-progress span {
    color: var(--muted);
    font-size: 12px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

h1:not(:where(.codex-console *)) { margin: 0 0 16px; font-size: 30px; }
h1:not(:where(.codex-console *)), h2:not(:where(.codex-console *)) {
    color: var(--blue);
    font-weight: 800;
    letter-spacing: 0;
}
h1:not(:where(.codex-console *))::before {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    border-radius: 999px;
    background: var(--green);
    margin-bottom: 12px;
}
h2:not(:where(.codex-console *)) { margin-top: 0; font-size: 19px; }

.toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px;
    box-shadow: none;
}

.grid-5 { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }

.dashboard-grid, .cards, .two-col {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.dashboard-grid > *,
.cards > *,
.two-col > *,
.project-layout > *,
.vacation-layout > *,
.time-layout > * {
    min-width: 0;
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.two-col {
    grid-template-columns: minmax(0, 1fr) 380px;
}

.card, .table-card {
    padding: 26px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-project-list {
    display: none;
}

.project-overview-list { display: grid; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.project-overview-header, .project-overview-row { min-width: 0; display: grid; grid-template-columns: minmax(70px, .5fr) minmax(90px, .7fr) minmax(130px, 1.1fr) minmax(145px, 1.15fr) minmax(105px, .85fr) minmax(100px, .8fr) minmax(140px, 1.15fr) minmax(90px, .7fr) minmax(80px, .6fr) auto; align-items: center; gap: 13px; }
.project-overview-header { min-height: 42px; padding: 7px 14px; background: #5f5f60; color: #fff; }
.project-overview-header > span { padding: 0 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.project-overview-sort { min-height: 28px; padding: 0 8px; color: #fff; background: transparent; border: 0; border-radius: 0; box-shadow: none; font-size: 10px; text-align: left; text-transform: uppercase; }
.project-overview-sort:hover, .project-overview-sort.active { color: #fff; background: rgba(255,255,255,.13); }
.project-overview-sort span { margin-left: 3px; color: #c9f2e1; }
.project-overview-row { min-height: 76px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.project-overview-row:last-child { border-bottom: 0; }
.project-overview-row:hover { background: #f7fbf9; }
.project-overview-reference { min-width: 0; display: grid; gap: 5px; color: #436ab1; font-size: 12px; font-weight: 800; overflow: hidden; }
.project-overview-reference-line, .project-card-reference { min-width: 0; display: inline-flex; align-items: center; gap: 7px; overflow: hidden; }
.project-overview-reference-line > span, .project-card-reference > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-traffic-dot { width: 11px; height: 11px; flex: 0 0 11px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(20, 42, 79, .16); }
.project-traffic-dot.green { background: #2ab477; }
.project-traffic-dot.yellow { background: #f1c84c; }
.project-traffic-dot.red { background: #e25558; }
.project-traffic-dot.gray { background: #aab8c0; }
.project-overview-type { min-width: 0; width: fit-content; max-width: 100%; padding: 3px 6px; color: #986072; border: 1px solid #caa0ad; background: #fff8fa; border-radius: 3px; font-size: 10px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-overview-party, .project-overview-address, .project-overview-team { min-width: 0; display: grid; gap: 3px; }
.project-overview-party button { width: fit-content; max-width: 100%; padding: 0; color: var(--blue); background: transparent; font-size: 13px; font-weight: 800; text-align: left; text-transform: none; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-overview-party button:hover { color: var(--green-2); background: transparent; }
.project-overview-party small, .project-overview-address, .project-overview-team { color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.project-overview-status { justify-self: start; font-size: 10px; }
.project-overview-progress { min-width: 0; display: grid; grid-template-columns: minmax(50px, 1fr) auto; align-items: center; gap: 6px; }
.project-overview-progress .progress { height: 7px; margin: 0; background: #e5ecef; }
.project-overview-progress .bar { min-width: 0; color: transparent; }
.project-overview-progress small { color: var(--muted); font-size: 10px; font-weight: 800; }
.project-overview-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.project-overview-task, .project-overview-created { min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.project-overview-date { padding: 4px 6px; color: var(--muted); background: #eef2f3; border-radius: 3px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.project-overview-date.yellow { color: #765500; background: #fff6cf; }
.project-overview-date.red { color: #9c2330; background: #fff0f2; }
.project-overview-date.green { color: #157456; background: #e8f7f0; }
.project-overview-actions button { min-height: 34px; padding: 7px 9px; font-size: 10px; }
.project-overview-empty { padding: 24px; text-align: center; }

.card h2,
.table-card h2 {
    margin-bottom: 18px;
    font-size: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th, td {
    text-align: left;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    overflow-wrap: anywhere;
}

td[data-label]::before {
    content: none;
}

tbody tr:hover {
    background: #f9fcfb;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 12px 0 24px;
}

.stats > div {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.stats strong,
.stats span {
    display: block;
}

.stats strong {
    font-size: 28px;
    color: var(--blue);
    line-height: 1;
}

.stats span {
    margin-top: -8px;
    color: #607184;
}

.deadline-card {
    display: flex;
    flex-direction: column;
}

.deadline-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 12px 0 24px;
}

.deadline-stats > div {
    min-height: 72px;
    display: grid;
    align-content: center;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 13px 14px;
}

.deadline-stats strong,
.deadline-stats span {
    display: block;
}

.deadline-stats strong {
    color: var(--blue);
    font-size: 30px;
    line-height: 1;
}

.deadline-stats span {
    color: var(--muted);
    line-height: 1.2;
}

.deadline-list {
    display: grid;
    gap: 10px;
}

.deadline-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.deadline-row:last-child {
    border-bottom: 0;
}

.deadline-row > div {
    min-width: 0;
}

.deadline-row .link {
    overflow-wrap: anywhere;
}

.deadline-row strong {
    color: var(--blue);
    white-space: nowrap;
}

.deadline-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
}

.danger-text {
    color: var(--danger) !important;
}

.metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.metric strong {
    color: var(--blue);
}

.metric:last-child {
    border-bottom: 0;
}

.dashboard-task-list {
    display: grid;
}

.dashboard-task {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.dashboard-task:last-child {
    border-bottom: 0;
}

.dashboard-task strong,
.dashboard-task span {
    display: block;
    overflow-wrap: anywhere;
}

.dashboard-task .link {
    margin-top: 4px;
}

.dashboard-task small {
    color: var(--muted);
    white-space: nowrap;
    padding-top: 2px;
}

.notification {
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 4px;
    margin-bottom: 0;
    background: #fff;
    box-shadow: none;
}

.notification.warn {
    border-left-color: var(--warn);
}

.notification.danger {
    border-left-color: var(--danger);
}

.notification span {
    color: var(--muted);
}

.task-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.task-pager span {
    color: var(--muted);
    font-weight: 700;
    min-width: 48px;
    text-align: center;
}

.arrow-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
}

.button-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eaf2f5;
    font-size: 12px;
}

.status-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.status-options button {
    background: var(--surface-soft);
    color: var(--blue);
    border: 1px solid var(--line);
    padding: 7px 10px;
    box-shadow: none;
}

.status-options button.selected {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.task-detail-list {
    display: grid;
    gap: 0;
    margin-bottom: 14px;
}

.task-detail-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.task-detail-item:first-child {
    padding-top: 4px;
}

.task-detail-title {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.task-detail-status {
    min-width: 0;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 3px rgba(24, 179, 136, .08);
}

.green { background: var(--green); }
.yellow { background: var(--warn); }
.red { background: var(--danger); }
.gray { background: #a8b5c0; }

.progress {
    width: 150px;
    max-width: 100%;
    min-width: 0;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: #dfe8ef;
    box-shadow: inset 0 1px 2px rgba(6, 31, 61, .1);
}

.bar {
    height: 100%;
    min-width: 0;
    max-width: 100%;
    background: var(--green);
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.copy-row {
    display: flex;
    gap: 8px;
}

.copy-row input {
    font-family: Consolas, monospace;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.calendar-weekday {
    background: var(--blue);
    color: #fff;
    padding: 10px;
    font-weight: 700;
    text-align: center;
}

.calendar-day {
    min-height: 150px;
    background: var(--surface);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-day.weekend {
    background: #eef4f7;
}

.calendar-day.outside-month {
    background: var(--surface-soft);
    color: #8392a2;
}

.calendar-day.outside-month.weekend {
    background: #edf1f5;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--green);
}

.calendar-date {
    font-weight: 700;
    color: var(--blue);
}

.calendar-event {
    width: 100%;
    border-radius: 6px;
    padding: 6px 8px;
    text-align: left;
    color: var(--text);
    background: #e5eef3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event strong,
.calendar-event small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event strong {
    font-size: 13px;
}

.calendar-event small {
    margin-top: 3px;
    color: #607184;
    font-size: 11px;
    line-height: 1.25;
}

.calendar-event.green { background: #dcf5ed; border-left: 4px solid var(--green); }
.calendar-event.yellow { background: #fff3c4; border-left: 4px solid var(--warn); }
.calendar-event.red { background: #ffe0e0; border-left: 4px solid var(--danger); }
.calendar-event.gray { background: #eef2f5; border-left: 4px solid #a8b5c0; }
.holiday-event { background: #eef2f6; border-left: 4px solid #7b8794; }
.calendar-inline-note { margin:0 0 10px; color:var(--muted); font-size:13px; }
.vacation-event { background: #eef3fb; border-left: 4px solid var(--absence-color, #5a78bd); }
.sick-event { background: #ffe7e7; border-left: 4px solid var(--danger); }
.time-event { background: #e4f0ff; border-left: 4px solid var(--blue-2); }

.calendar-more {
    font-size: 12px;
    color: var(--muted);
}

.vacation-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

.time-layout {
    display: grid;
    grid-template-columns: minmax(260px, .7fr) minmax(320px, 1fr);
    gap: 16px;
    align-items: start;
}

.wide-card {
    grid-column: 1 / -1;
}

.time-status {
    display: grid;
    gap: 5px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    margin-bottom: 14px;
}

.time-status.active {
    border-color: rgba(24, 179, 136, .55);
    background: #dcf5ed;
}

.time-status strong {
    color: var(--blue);
    font-size: 20px;
}

.time-status span {
    color: var(--muted);
}

.time-actions {
    justify-content: flex-start;
}

.time-entry-row,
.absence-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.time-entry-row:last-child,
.absence-row:last-child {
    border-bottom: 0;
}

.time-entry-row span,
.absence-row span,
.absence-row small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.time-entry-row small {
    color: var(--blue);
    font-weight: 800;
    white-space: nowrap;
}

.editable-time-row .button-row {
    align-items: center;
}

.absence-row {
    grid-template-columns: minmax(0, 1fr);
    border-left: 4px solid var(--green);
    padding-left: 12px;
}

.absence-row.sick {
    border-left-color: var(--danger);
}

.calendar-subhead {
    margin: 22px 0 12px;
}

.calendar-subhead h2 {
    margin-bottom: 4px;
}

.vacation-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.vacation-item:last-child {
    border-bottom: 0;
}

.vacation-item span,
.vacation-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.vacation-item .vacation-days {
    color: var(--blue);
    font-weight: 700;
}

.vacation-balance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 22px;
}

.vacation-balance-grid > div {
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    padding: 12px 14px;
    background: #f8fbfc;
}

.vacation-balance-grid span,
table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.vacation-balance-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--blue);
    font-size: 24px;
    line-height: 1;
}

.vacation-team-list {
    display: grid;
    gap: 10px;
}

.vacation-team-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.vacation-team-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.vacation-team-details summary::-webkit-details-marker {
    display: none;
}

.vacation-team-details summary small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 700;
}

.vacation-team-body {
    border-top: 1px solid var(--line);
    padding: 4px 16px 10px;
}

.vacation-team-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.vacation-team-row:last-child {
    border-bottom: 0;
}

.vacation-team-row span,
.vacation-team-row small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.vacation-team-row strong {
    color: var(--blue);
    white-space: nowrap;
}

.vacation-team-row small {
    grid-column: 1 / -1;
    color: var(--muted);
}

.vacation-team-row.manual strong {
    color: var(--green);
}

.compact-buttons {
    flex-wrap: nowrap;
}

#templateList.cards {
    grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
    align-items: start;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.template-card-head {
    align-items: flex-start;
    margin-bottom: 0;
}

.template-card-head h2 {
    margin-bottom: 8px;
}

.template-actions {
    flex: 0 0 auto;
}

.template-task-list {
    display: grid;
    gap: 10px;
}

.template-task-group,
.template-task-single {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    background: #f7fbfa;
}

.template-task-child {
    margin-left: 18px;
    padding: 8px 0 8px 16px;
    border-left: 2px solid var(--line);
}

.template-task-child strong {
    font-size: 15px;
    font-weight: 700;
}

.template-task-note {
    margin-top: 4px;
}

.template-task-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.template-task-heading strong { min-width: 0; overflow-wrap: anywhere; }
.template-task-heading span { flex: none; color: var(--muted); font-size: 11px; font-weight: 700; }
.template-assignee-editor { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.template-assignee-editor > header { margin-bottom: 10px; }
.template-assignee-editor h3,
.template-assignee-editor p { margin: 0; }
.template-assignee-editor p { margin-top: 3px; }
.template-assignee-editor [data-template-assignee-editor] { display: grid; }
.template-assignee-row { min-width: 0; padding: 9px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.template-assignee-row > div { min-width: 0; }
.template-assignee-row strong,
.template-assignee-row small { display: block; overflow-wrap: anywhere; }
.template-assignee-row small { margin-top: 2px; color: var(--muted); }
.template-assignee-row label,
.template-assignee-row select { min-width: 0; width: 100%; }
.template-assignee-row.is-group { color: var(--blue); background: #f7fbfa; }
.template-assignee-row.is-group > div,
.template-assignee-row.is-group > span { padding-inline: 8px; }
.template-assignee-row.is-group > span { color: var(--green-2); font-size: 11px; font-weight: 800; text-align: right; }
.template-deadline-control { display: grid; gap: 4px; color: var(--blue); font-size: 11px; font-weight: 800; }
.template-deadline-control > div { display: flex; align-items: center; gap: 7px; }
.template-deadline-control input { min-width: 0; width: 96px; padding: 7px 8px; }
.template-deadline-control small { margin: 0; color: var(--muted); font-weight: 600; }
.project-task-assignment-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 620px) {
    .template-assignee-row { grid-template-columns: 1fr; gap: 7px; }
    .template-assignee-row.is-group { grid-template-columns: minmax(0, 1fr) auto; }
    .template-deadline-control input { width: 78px; }
    .template-task-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
}

.import-box {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px dashed #abc2cc;
    border-radius: 8px;
    background: var(--surface-soft);
}

.import-box label {
    margin-bottom: 0;
}

.import-actions {
    justify-content: flex-start;
}

.import-box .muted {
    margin: 0;
}

.import-result {
    grid-column: 1 / -1;
}

.import-result-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.import-result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    background: #fff;
}

.import-result-row.existing {
    border-left-color: #94a3b8;
}

.import-result-row.warning {
    border-left-color: var(--warn);
}

.import-result-row small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.import-result-row span {
    color: var(--blue);
    font-weight: 800;
    white-space: nowrap;
}

.import-preview {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.import-preview-row {
    display: grid;
    grid-template-columns: 130px minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    background: #fff;
}

.import-preview-row.warning {
    border-left-color: var(--warn);
}

.import-preview-row.existing {
    border-left-color: #94a3b8;
}

.planning-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.planning-card {
    display: grid;
    gap: 12px;
}

.planning-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.planning-projects {
    display: grid;
    gap: 8px;
}

.planning-project {
    display: grid;
    gap: 4px;
    text-align: left;
    color: var(--text);
    background: var(--surface-soft);
    border-left: 4px solid #a8b5c0;
    box-shadow: none;
    white-space: normal;
}

.planning-project.green { border-left-color: var(--green); }
.planning-project.yellow { border-left-color: var(--warn); }
.planning-project.red { border-left-color: var(--danger); }
.planning-project.done {
    opacity: .72;
    background: #f3f7f9;
}
.planning-project.done strong {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}
.planning-project span {
    color: var(--muted);
    font-size: 12px;
}

.planning-overload {
    border-color: rgba(217, 70, 70, .45);
}

.project-layout,
.project-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
}

.project-detail-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}

.project-detail-main {
    min-width: 0;
}

.project-detail-sidebar {
    min-width: 0;
    display: grid;
    gap: 14px;
    align-content: start;
}

.project-meta-card .card-head-inline h2 {
    margin-bottom: 4px;
}

.project-meta-grid {
    display: grid;
    gap: 10px;
    margin: 8px 0 12px;
}

.project-meta-grid p {
    margin: 0;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.project-meta-grid p span:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--blue);
    word-break: break-word;
}

.project-meta-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.project-meta-stat {
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.project-meta-stat strong {
    display: block;
    color: var(--blue);
    font-size: 22px;
    line-height: 1;
}

.project-meta-stat span {
    margin-top: 4px;
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.comment {
    border-top: 1px solid var(--line);
    padding: 10px 0;
}

::selection {
    background: rgba(24, 179, 136, .24);
}

.muted { color: var(--muted); }
.error { color: var(--danger); margin-top: 10px; }

dialog {
    width: min(760px, calc(100vw - 32px));
    border: 0;
    padding: 0;
}

dialog::backdrop { background: rgba(11, 35, 65, .35); }

#modalForm { padding: 18px; }
#modalBody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin-top: 14px;
}

#modalBody label:nth-child(2),
#modalBody label:nth-child(3),
#modalBody label:last-child {
    grid-column: 1 / -1;
}

#modalBody textarea {
    min-height: 96px;
}

.modal-head, .modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-actions {
    justify-content: flex-end;
    margin-top: 16px;
}

.modal-primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .035em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.modal-primary-link:hover {
    background: var(--green-2);
    color: #fff;
    text-decoration: none;
}

@media (max-width: 900px) {
    body { font-size: 14px; }
    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        padding: 16px 14px;
        overflow: visible;
    }
    .brand {
        font-size: 18px;
    }
    .brand img {
        width: 138px;
    }
    nav {
        gap: 18px;
        padding-bottom: 6px;
        width: 100%;
        max-width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    nav button {
        padding: 7px 0 9px;
        min-height: 32px;
        flex: 0 1 auto;
        font-size: 12px;
    }
    .session-area {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .current-user {
        white-space: normal;
    }
    .dashboard-grid, .two-col, .project-layout, .project-detail-layout, .grid-5, .vacation-layout, .time-layout { grid-template-columns: minmax(0, 1fr); }
    .page {
        padding: 20px 14px;
        max-width: none;
        overflow: hidden;
    }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }
    h1:not(:where(.codex-console *)) {
        font-size: 24px;
        margin-bottom: 6px;
    }
    h1:not(:where(.codex-console *))::before {
        width: 34px;
        margin-bottom: 10px;
    }
    h2:not(:where(.codex-console *)) {
        font-size: 17px;
    }
    .card, .table-card { padding: 16px; }
    .table-card table {
        min-width: 620px;
    }
    .copy-row { flex-direction: column; }
    .stats { grid-template-columns: 1fr; }
    .stats span {
        margin-top: 4px;
    }
    .deadline-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .deadline-stats > div {
        min-height: 64px;
        padding: 10px;
    }
    .deadline-stats strong {
        font-size: 24px;
    }
    .deadline-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        align-items: start;
    }
    .deadline-row strong {
        padding-left: 18px;
    }
    .dashboard-task {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }
    .dashboard-task small {
        white-space: normal;
    }
    .button-row {
        justify-content: flex-start;
        width: 100%;
    }
    .button-row button {
        flex: 1 1 auto;
    }
    .vacation-item {
        flex-direction: column;
    }
    .compact-buttons {
        flex-wrap: wrap;
    }
    #modalBody { grid-template-columns: 1fr; }
    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 1px;
        background: var(--line);
        border: 1px solid var(--line);
        border-radius: 8px;
        overflow: hidden;
    }
    .calendar-weekday {
        display: block;
        padding: 7px 2px;
        font-size: 12px;
    }
    .calendar-day {
        min-height: 92px;
        border: 0;
        margin-bottom: 0;
        border-radius: 0;
        padding: 5px;
        gap: 4px;
    }
    .calendar-date {
        font-size: 12px;
    }
    .calendar-controls {
        width: 100%;
        justify-content: space-between;
    }
    .calendar-event {
        padding: 4px 5px;
    }
    .calendar-event strong {
        font-size: 10px;
        line-height: 1.15;
        white-space: normal;
    }
    .calendar-event small {
        display: none;
    }
    .status-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .status-options button {
        white-space: normal;
        width: 100%;
    }
    dialog {
        width: calc(100vw - 18px);
    }
    #modalForm {
        padding: 14px;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 12px;
    }
    .auth-card {
        padding: 20px;
    }
    .page {
        padding: 14px 10px;
    }
    .card, .table-card {
        padding: 14px;
        border-radius: 4px;
    }
    input, select, textarea {
        min-width: 0;
    }
    .topbar {
        padding: 12px 10px;
    }
    .brand img {
        width: 132px;
    }
    nav {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        gap: 16px;
    }
    button:not(:where(.codex-console *)) {
        width: auto;
    }
    table {
        min-width: 0;
    }
    .table-card {
        overflow-x: visible;
    }
    .table-card thead {
        display: none;
    }
    .table-card table,
    .table-card tbody,
    .table-card tr,
    .table-card td {
        display: block;
        width: 100%;
    }
    .table-card tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--line);
    }
    .table-card tr.empty-row {
        padding: 0;
    }
    .table-card td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        padding: 7px 0;
        border-bottom: 0;
        min-width: 0;
        max-width: 100%;
    }
    .table-card td[data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: .02em;
    }
    .table-card td > * {
        min-width: 0;
        max-width: 100%;
    }
    .table-card .badge {
        display: inline-flex;
        justify-self: start;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .table-card td button {
        justify-self: start;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .table-card td[colspan] {
        display: block;
    }
    .toolbar {
        gap: 9px;
        padding: 10px;
    }
    .progress {
        width: auto;
        inline-size: auto;
        max-width: 100%;
        justify-self: stretch;
    }
    .table-card td .progress {
        width: auto;
        inline-size: auto;
        min-width: 0;
        max-width: 100%;
        justify-self: stretch;
        align-self: center;
    }
    .bar {
        overflow: hidden;
        white-space: nowrap;
    }
    .table-card td[data-label="Fortschritt"] {
        grid-template-columns: 104px minmax(0, calc(100% - 116px));
        overflow: hidden;
    }
    .table-card td[data-label="Fortschritt"] .progress {
        display: block;
        width: 100%;
        inline-size: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        justify-self: stretch;
    }
    #projectList.table-card {
        overflow-x: visible;
    }
    #projectList .desktop-table {
        display: none;
    }
    #projectList .mobile-project-list {
        display: grid;
        gap: 14px;
    }
    .mobile-project-card {
        display: grid;
        gap: 10px;
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
    }
    .mobile-project-card:last-child {
        border-bottom: 0;
    }
    .project-card-row,
    .project-card-progress {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        min-width: 0;
        overflow: hidden;
    }
    .project-card-row > span,
    .project-card-progress > span {
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: .02em;
    }
    .project-card-row strong {
        min-width: 0;
        font-size: 15px;
        font-weight: 700;
        overflow-wrap: anywhere;
    }
    .project-card-progress .progress {
        width: 100%;
        inline-size: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        justify-self: stretch;
    }
    .project-card-progress .bar {
        display: block;
        max-width: 100%;
    }
    .calendar-day {
        min-height: 78px;
        padding: 4px;
    }
    .calendar-controls {
        flex-wrap: wrap;
    }
    #calendarTitle {
        order: -1;
        width: 100%;
        font-size: 17px;
    }
}


/* Projektdateien und Konzeptvorbereitung */
.project-summary-card { margin-bottom:16px; }
.project-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px 18px; margin:8px 0 12px; }
.project-summary-grid p { margin:4px 0; min-width:0; overflow-wrap:anywhere; }
.project-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; border-bottom:1px solid var(--line); }
.project-tabs button { background:transparent; color:var(--blue); border:0; border-bottom:3px solid transparent; border-radius:0; box-shadow:none; padding:11px 14px; text-transform:uppercase; letter-spacing:.3px; }
.project-tabs button.active { color:var(--green); border-bottom-color:var(--green); background:rgba(24,179,136,.06); }
.project-funding-host { min-width:0; }
.project-funding-sync { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:16px; border-left:4px solid var(--green); }
.project-funding-sync h2 { margin:2px 0 5px; }
.project-funding-sync p { margin:0; color:var(--muted); }
.project-synced-field { position:relative; }
.project-synced-field select,
.project-synced-field input { background:#f1f5f4; color:var(--blue); opacity:1; }
.project-synced-field small { display:block; margin-top:5px; color:var(--green); font-weight:700; }
.project-tab-content { display:grid; gap:16px; }
.project-tab-panel { margin-top:0; }
.project-tab-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(280px,.6fr); gap:16px; align-items:start; }
.module-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:0 0 16px; }
.module-summary-grid > div { border:1px solid var(--line); border-left:4px solid var(--green); border-radius:10px; padding:14px 16px; background:#fff; }
.module-summary-grid strong { display:block; font-size:26px; color:var(--blue); line-height:1; }
.module-summary-grid span { color:var(--muted); font-weight:700; }
.module-preview-list { display:grid; gap:8px; margin:14px 0; }
.module-preview-list > div { border-bottom:1px solid var(--line); padding:9px 0; }
.module-preview-list strong { display:block; overflow-wrap:anywhere; }
.module-preview-list span { color:var(--muted); font-size:13px; }
.card-head-inline { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.card-head-inline h2 { margin-bottom:4px; }
.project-files-list { display:grid; gap:10px; margin-top:14px; }
.project-file-row { display:grid; grid-template-columns:92px minmax(0,1fr) auto; gap:14px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.02); }
.project-file-preview { width:92px; height:68px; display:grid; place-items:center; border-radius:8px; border:1px solid var(--line); overflow:hidden; background:#f3f7f8; color:var(--blue); text-decoration:none; font-size:12px; font-weight:900; }
.project-file-preview img { width:100%; height:100%; object-fit:cover; display:block; }
.project-file-preview.pdf-preview { background:linear-gradient(135deg,#fff 0 68%,#edf2f5 68%); }
.project-file-preview.pdf-preview span { display:grid; place-items:center; width:44px; height:32px; border-radius:5px; background:#d33f49; color:#fff; box-shadow:0 4px 12px rgba(211,63,73,.22); }
.project-file-main { min-width:0; display:grid; gap:3px; }
.project-file-main a { color:inherit; text-decoration:none; }
.project-file-main a:hover { text-decoration:underline; }
.concept-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:12px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.concept-row:last-child { border-bottom:0; }
.diary-list { display:grid; gap:12px; margin-top:14px; }
.diary-entry {
  border:1px solid var(--line);
  border-left:4px solid var(--green);
  border-radius:10px;
  padding:14px;
  background:#fff;
  display:grid;
  gap:10px;
}
.diary-entry.defect { border-left-color:var(--danger); }
.diary-entry.instruction { border-left-color:var(--warn); }
.diary-entry.acceptance { border-left-color:var(--blue); }
.diary-entry-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.diary-entry h3 { margin:2px 0 0; font-size:18px; }
.diary-date { color:var(--muted); font-weight:700; font-size:13px; }
.diary-tags { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.diary-badge { display:inline-block; padding:4px 8px; border-radius:999px; background:#e8f7f1; color:#087a4b; font-size:12px; font-weight:800; }
.diary-badge.defect { background:#fdeced; color:#b4232b; }
.diary-badge.instruction { background:#fff6db; color:#946200; }
.diary-badge.acceptance { background:#eaf2ff; color:#123f73; }
.diary-meta { display:flex; flex-wrap:wrap; gap:8px 14px; color:var(--muted); font-size:13px; }
.diary-files { display:flex; flex-wrap:wrap; gap:8px; }
.diary-files a { color:var(--blue); font-weight:700; text-decoration:underline; }
.diary-image-gallery { display:flex; flex-wrap:wrap; gap:8px; width:100%; }
.diary-image-thumb { width:104px; height:78px; padding:0; overflow:hidden; border:1px solid var(--line); border-radius:7px; background:#eef3f6; }
.diary-image-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.diary-image-thumb:hover { transform:translateY(-1px); border-color:var(--green); }
.diary-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.diary-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.diary-modal { display:grid; gap:12px; }
.diary-modal label { gap:6px; }
.diary-modal input,
.diary-modal select,
.diary-modal textarea { min-height:42px; }
.diary-modal textarea { resize:vertical; }
.diary-modal .top-grid { grid-template-columns:1fr 1.25fr 1.25fr 1.1fr; }
.diary-modal .detail-grid { grid-template-columns:1.4fr 1.4fr 1fr .9fr .9fr; }
.diary-text-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; align-items:start; }
.diary-footer-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; align-items:end; }
.diary-footer-grid .diary-check { grid-column:1 / -1; }
.diary-footer-grid select { min-height:96px; }
.diary-check { align-self:center; min-width:260px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:#f8fafb; }
.project-contacts-workspace { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(300px,.85fr); gap:16px; align-items:start; }
.project-contact-form { display:grid; gap:18px; }
.project-contact-address { margin:0; padding:14px; border:1px solid var(--line); border-radius:8px; }
.project-contact-address legend { padding:0 6px; color:var(--muted); font-weight:700; font-size:13px; }
.project-object-visual-card { position:sticky; top:16px; }
.project-object-visual { min-height:220px; display:grid; gap:12px; }
.project-object-visual figure { margin:0; display:grid; gap:8px; }
.project-object-visual img { width:100%; aspect-ratio:16 / 10; object-fit:cover; border-radius:7px; border:1px solid var(--line); background:#eef2f5; }
.project-object-aerial-map { width:100%; aspect-ratio:16 / 10; min-height:220px; overflow:hidden; border:1px solid var(--line); border-radius:7px; background:#eef2f5; }
.project-object-visual figcaption { color:var(--muted); font-size:12px; }
.project-object-visual-empty { min-height:180px; display:grid; align-content:center; gap:10px; padding:18px; border:1px dashed #b9c9d4; border-radius:7px; background:#f8fbfc; color:var(--muted); }
.project-object-visual-empty strong { color:var(--blue); }
.project-head-object-visual { overflow:hidden; }
.project-head-object-visual img { width:100%; height:100%; object-fit:cover; display:block; }
.project-location-picker-dialog { width:min(940px, calc(100vw - 2rem)); max-width:none; border:0; border-radius:10px; padding:0; box-shadow:0 28px 72px rgba(16, 35, 59, .3); }
.project-location-picker-dialog::backdrop { background:rgba(17, 28, 43, .56); }
.project-location-picker { display:grid; gap:14px; padding:20px; }
.project-location-picker header { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.project-location-picker h2 { margin:3px 0 5px; }
.project-location-picker p { margin:0; color:var(--muted); }
.project-location-picker-map { min-height:min(62vh, 620px); border:1px solid var(--line); border-radius:7px; overflow:hidden; background:#eef2f5; }
.project-location-picker output { color:var(--muted); font-size:13px; }
.project-location-picker footer { display:flex; justify-content:flex-end; gap:10px; }
@media (max-width: 640px) { .project-location-picker { padding:14px; } .project-location-picker header { gap:10px; } .project-location-picker-map { min-height:54vh; } }
dialog:has(.diary-modal) { width:min(980px,calc(100vw - 24px)); }
dialog:has(.diary-modal) #modalBody { display:block; }
@media (max-width: 760px) {
  .project-summary-grid, .project-detail-layout, .project-tab-grid, .module-summary-grid { grid-template-columns:1fr; }
  .project-tabs { overflow-x:auto; flex-wrap:nowrap; scrollbar-width:thin; }
  .project-tabs button { white-space:nowrap; }
  .project-funding-sync { align-items:flex-start; flex-direction:column; }
  .card-head-inline, .project-file-row { display:grid; grid-template-columns:1fr; }
  .project-file-preview { width:100%; height:150px; }
  .concept-row { grid-template-columns:1fr auto; }
  .concept-row button { grid-column:1 / -1; }
  .diary-entry-head { display:grid; grid-template-columns:1fr; }
  .diary-tags { justify-content:flex-start; }
  .diary-form-grid,
  .diary-modal .top-grid,
  .diary-modal .detail-grid,
  .diary-text-grid,
  .diary-footer-grid { grid-template-columns:1fr; }
  .diary-check { min-width:0; }
  .project-contacts-workspace { grid-template-columns:1fr; }
  .project-object-visual-card { position:static; }
}

/* UX4.1: document-centred human review workspace */
.project-file-review-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 7px;
    border: 1px solid #d8e2e5;
    border-radius: 4px;
    color: #43536a;
    background: #f4f7f8;
    font-size: 12px;
    font-weight: 750;
}
.project-file-review-status.is-in_review { border-color: #dfbd58; color: #6f5200; background: #fff8dc; }
.project-file-review-status.is-review_complete { border-color: #78cdb1; color: #086345; background: #eaf8f3; }
.project-file-review-status.is-review_complete_with_conflicts { border-color: #e49c9c; color: #982c2c; background: #fff0f0; }

dialog.document-review-dialog {
    width: min(1900px, calc(100vw - 24px));
    height: min(1120px, calc(100vh - 24px));
    max-width: none;
    max-height: none;
}
dialog.document-review-dialog #modalForm { height: 100%; max-height: none; }
dialog.document-review-dialog #modalBody { padding: clamp(14px, 1.2vw, 24px); overflow: hidden; }
dialog.document-review-dialog .modal-actions { padding: 12px clamp(14px, 1.2vw, 24px); }
.document-review-workspace {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
    gap: 14px;
    height: 100%;
    min-height: 0;
    color: #17234f;
    font-size: clamp(15px, .82vw, 17px);
    line-height: 1.5;
}
.document-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.document-review-head h2 { margin: 3px 0; font-size: clamp(24px, 1.55vw, 32px); line-height: 1.2; }
.document-review-head p { max-width: 78ch; margin: 0; color: #66748a; font-size: .9em; }
.document-review-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.document-review-file-status,
.document-review-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid #d7e1e4;
    border-radius: 4px;
    color: #43536a;
    background: #f4f7f8;
    font-size: 12px;
    font-weight: 800;
}
.document-review-file-status.is-in_review,
.document-review-status.is-unreviewed { border-color: #dfbd58; color: #765900; background: #fff8dc; }
.document-review-file-status.is-review_complete,
.document-review-status.is-confirmed { border-color: #78cdb1; color: #086345; background: #eaf8f3; }
.document-review-file-status.is-review_complete_with_conflicts,
.document-review-status.is-conflict { border-color: #df8888; color: #962d2d; background: #fff0f0; }
.document-review-status.is-corrected { border-color: #7eb5d5; color: #1d5f85; background: #ecf6fb; }
.document-review-status.is-rejected,
.document-review-status.is-not_readable,
.document-review-status.is-not_present { color: #576273; background: #edf1f3; }
.document-review-progress-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(210px, auto);
    gap: 8px 20px;
    padding: 12px 14px;
    border: 1px solid #dce5e8;
    border-radius: 6px;
    background: #f9fbfb;
}
.document-review-progress-panel > div:first-child,
.document-review-progress-copy { display: flex; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; }
.document-review-progress-panel span { color: #627087; font-size: .82em; }
.document-review-progress-copy { justify-content: flex-end; text-align: right; }
.document-review-progress-copy strong { font-size: 1em; }
.document-review-progress { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 4px; background: #dfe8eb; }
.document-review-progress > span { display: block; height: 100%; background: #19a873; transition: width .18s ease; }
.document-review-message {
    margin: 0;
    padding: 9px 12px;
    border-left: 3px solid #2688b4;
    color: #245b75;
    background: #eef7fb;
}
.document-review-mobile-switch { display: none; }
.document-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 58fr) minmax(410px, 42fr);
    gap: 14px;
    min-height: 0;
}
.document-review-preview,
.document-review-facts {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #d7e1e4;
    border-radius: 6px;
    background: #fff;
}
.document-review-preview { position: relative; display: flex; flex-direction: column; }
.document-review-viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 7px 9px;
    border-bottom: 1px solid #d7e1e4;
    background: #f5f8f9;
}
.document-review-viewer-toolbar button { min-width: 38px; min-height: 34px; padding: 6px 9px; }
.document-review-viewer-toolbar > span { color: #526076; font-size: 13px; white-space: nowrap; }
.document-review-toolbar-spacer { flex: 1; }
.document-review-canvas { flex: 1; min-height: 0; overflow: auto; padding: 16px; background: #dce2e4; }
.document-review-image-stage { position: relative; min-width: 240px; margin: 0 auto; transform-origin: center center; }
.document-review-image-stage img { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; background: #fff; box-shadow: 0 8px 25px rgba(20, 32, 47, .16); }
.document-review-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.document-source-marker {
    position: absolute;
    z-index: 2;
    min-width: 12px;
    min-height: 12px;
    padding: 0;
    border: 2px solid #e5a600;
    border-radius: 2px;
    background: rgba(255, 213, 51, .18);
    pointer-events: auto;
}
.document-source-marker:hover,
.document-source-marker:focus-visible,
.document-source-marker.is-active { border-color: #d43232; background: rgba(225, 53, 53, .18); outline: 3px solid rgba(212, 50, 50, .22); }
.document-review-pdf { flex: 1; width: 100%; min-height: 420px; border: 0; background: #e4e8ea; }
.document-review-source-hint { flex: 0 0 auto; margin: 0; padding: 8px 11px; border-top: 1px solid #d7e1e4; color: #68758a; background: #f7f9fa; font-size: 13px; }
.document-review-facts { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.document-review-filters {
    display: flex;
    gap: 5px;
    padding: 9px;
    overflow-x: auto;
    border-bottom: 1px solid #d7e1e4;
    background: #f7f9fa;
}
.document-review-filters button { flex: 0 0 auto; min-height: 35px; padding: 7px 10px; border-color: transparent; color: #42536a; background: transparent; }
.document-review-filters button.active { border-color: #8acdb7; color: #08724f; background: #e8f7f2; }
.document-review-fact-list { display: grid; align-content: start; gap: 10px; min-height: 0; margin: 0; padding: 10px; overflow: auto; }
.document-review-group { border: 1px solid #e0e7e9; border-radius: 5px; background: #fff; }
.document-review-group > summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; cursor: pointer; color: #384961; background: #f7f9fa; font-size: 13px; font-weight: 800; }
.document-review-group > div { display: grid; gap: 8px; padding: 8px; }
.document-review-detail {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dce4e7;
    border-left: 4px solid #d9aa22;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
}
.document-review-detail:hover { border-color: #aabdc4; }
.document-review-detail:focus-visible,
.document-review-detail.is-selected { border-color: #16875f; box-shadow: 0 0 0 3px rgba(25, 168, 115, .16); outline: none; }
.document-review-detail.is-confirmed { border-left-color: #19a873; }
.document-review-detail.is-corrected { border-left-color: #348fc0; }
.document-review-detail.is-conflict { border-left-color: #d73b3b; }
.document-review-detail.is-rejected,
.document-review-detail.is-not_readable,
.document-review-detail.is-not_present { border-left-color: #89939f; }
.document-review-detail > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.document-review-field-group { display: block; margin-bottom: 2px; color: #13845e; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.document-review-detail h4 { margin: 0; font-size: 1.08em; line-height: 1.3; }
.document-review-detected-value { font-size: 1.12em; font-weight: 750; overflow-wrap: anywhere; }
.document-review-correction { display: grid; gap: 2px; padding: 9px 11px; border-left: 3px solid #348fc0; background: #edf7fb; }
.document-review-correction span { color: #45667c; font-size: 12px; }
.document-review-detail-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; color: #66748a; font-size: 13px; }
.document-review-detail-meta button { min-height: 32px; padding: 5px 8px; color: #1f658b; background: #eef6fa; }
.document-review-detail blockquote { max-width: 78ch; margin: 0; padding: 8px 11px; border-left: 3px solid #cfdadd; color: #536176; background: #f7f9fa; font-size: 13px; }
.document-review-project-target { margin: 0; color: #56657b; font-size: 13px; }
.document-review-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.document-review-actions button { min-height: 40px; padding: 7px 8px; }
.document-review-actions kbd { padding: 1px 4px; border: 1px solid rgba(50, 65, 85, .25); border-radius: 3px; background: rgba(255, 255, 255, .7); font: inherit; font-size: 10px; }
.document-review-correction-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr); gap: 9px; padding-top: 10px; border-top: 1px solid #dce5e8; }
.document-review-correction-form label { display: grid; gap: 4px; }
.document-review-correction-form label:nth-child(3),
.document-review-correction-form .button-row { grid-column: 1 / -1; }
.document-review-completion,
.document-review-adoption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #dce5e8;
    border-radius: 6px;
    background: #fff;
}
.document-review-completion h3,
.document-review-adoption h3 { margin: 0 0 3px; font-size: 1.08em; }
.document-review-completion p,
.document-review-adoption p { max-width: 78ch; margin: 0; color: #637188; font-size: .86em; }
.document-review-adoption { display: grid; align-items: stretch; }
.document-review-adoption > article { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 9px; border-top: 1px solid #e2e9eb; }
.document-review-adoption > article > div:first-child { display: grid; gap: 2px; }
.document-review-adoption-action { display: flex; gap: 8px; flex-wrap: wrap; }
.document-review-policy { max-width: 85ch; margin: 0; padding: 9px 12px; border-left: 3px solid #d9aa22; color: #64571b; background: #fff9e5; font-size: 13px; }

@media (min-width: 2300px) {
    dialog.document-review-dialog { width: min(2200px, calc(100vw - 48px)); }
    .document-review-workspace { font-size: 17px; }
    .document-review-layout { grid-template-columns: minmax(0, 60fr) minmax(520px, 40fr); }
    .document-review-actions button { min-height: 44px; }
}

@media (max-width: 1120px) {
    dialog.document-review-dialog #modalBody { overflow: auto; }
    .document-review-workspace { height: auto; }
    .document-review-layout { grid-template-columns: minmax(0, 56fr) minmax(360px, 44fr); min-height: 650px; }
    .document-review-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    dialog.document-review-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; }
    dialog.document-review-dialog #modalForm { height: 100dvh; }
    dialog.document-review-dialog #modalBody { padding: 12px; }
    .document-review-workspace { grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto; height: 100%; font-size: 15px; }
    .document-review-head { display: grid; gap: 10px; }
    .document-review-head-actions { justify-content: flex-start; }
    .document-review-head-actions .button { flex: 1; text-align: center; }
    .document-review-progress-panel { grid-template-columns: 1fr; }
    .document-review-progress-copy { justify-content: space-between; text-align: left; }
    .document-review-mobile-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 5px; background: #e9eef0; }
    .document-review-mobile-switch button { min-height: 42px; color: #43536a; background: transparent; }
    .document-review-mobile-switch button.active { color: #fff; background: #11895f; }
    .document-review-layout { display: block; min-height: 0; height: 100%; }
    .document-review-layout.is-document .document-review-facts,
    .document-review-layout.is-details .document-review-preview { display: none; }
    .document-review-preview,
    .document-review-facts { height: 100%; }
    .document-review-viewer-toolbar { overflow-x: auto; }
    .document-review-pdf { min-height: 55vh; }
    .document-review-canvas { padding: 8px; }
    .document-review-actions { grid-template-columns: 1fr 1fr; }
    .document-review-actions button { min-height: 44px; }
    .document-review-completion { align-items: stretch; flex-direction: column; }
    .document-review-completion .button-row,
    .document-review-completion button { width: 100%; }
    .document-review-adoption > article,
    .document-review-adoption-action { align-items: stretch; flex-direction: column; }
}

@media (max-width: 480px) {
    .document-review-head-actions { display: grid; grid-template-columns: 1fr; }
    .document-review-actions,
    .document-review-correction-form { grid-template-columns: 1fr; }
    .document-review-correction-form label:nth-child(3),
    .document-review-correction-form .button-row { grid-column: auto; }
    .document-review-detail > header { display: grid; }
    .document-review-status { width: fit-content; }
}

@media (min-width: 641px) and (max-width: 700px) {
    .ai-project-office .ai-customer-action-controls { grid-template-columns: 1fr; }
}

/* ai-project-cockpit-ux1-v1 */
.ai-project-office {
    min-width: 0;
    color: var(--blue);
    font-size: 15px;
    line-height: 1.5;
}
.ai-project-office button,
.ai-project-office select,
.ai-project-office input,
.ai-project-office textarea {
    font: inherit;
}
.ai-project-office button:focus-visible,
.ai-project-office [role="tab"]:focus-visible,
.ai-project-office input:focus-visible,
.ai-project-office select:focus-visible,
.ai-project-office textarea:focus-visible {
    outline: 3px solid rgba(20, 171, 119, .28);
    outline-offset: 2px;
}
.ai-project-cockpit {
    display: grid;
    gap: 20px;
    padding: clamp(22px, 2.2vw, 36px);
    border: 1px solid #d8e3e7;
    border-top: 5px solid #7c8794;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(25, 36, 64, .07);
}
.ai-project-cockpit.is-danger { border-top-color: #d94848; }
.ai-project-cockpit.is-warning { border-top-color: #dda919; }
.ai-project-cockpit.is-approval { border-top-color: #7c5cc4; }
.ai-project-cockpit.is-running { border-top-color: #2589bd; }
.ai-project-cockpit.is-ready,
.ai-project-cockpit.is-success { border-top-color: #18a873; }
.ai-work-indicator {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 14px 0 10px;
    padding: 14px 18px;
    border: 1px solid #b8dbe9;
    border-left: 4px solid #2589bd;
    border-radius: 7px;
    background: linear-gradient(100deg, #f5fbfe 0%, #eef8f7 100%);
    box-shadow: 0 7px 18px rgba(37, 137, 189, .08);
}
.ai-work-indicator-avatar { display: grid; place-items: center; }
.ai-work-agent-avatar {
    width: 44px;
    height: 44px;
    border: 2px solid #2589bd;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 18%;
    background: #e8f5fb;
}
.ai-work-indicator-copy { min-width: 0; }
.ai-work-indicator-copy h2 { margin: 2px 0 3px; font-size: 17px; }
.ai-work-indicator-copy p { margin: 0; color: #4b6476; }
.ai-work-indicator-meta { display: grid; justify-items: end; gap: 3px; color: #376176; font-size: 12px; text-align: right; }
.ai-work-indicator-meta small { color: #687a88; }
.ai-work-pulse { display: inline-flex; gap: 4px; align-items: center; margin-bottom: 1px; }
.ai-work-pulse i { width: 7px; height: 7px; border-radius: 50%; background: #2589bd; animation: ai-work-pulse 1.1s ease-in-out infinite; }
.ai-work-pulse i:nth-child(2) { animation-delay: .16s; }
.ai-work-pulse i:nth-child(3) { animation-delay: .32s; }
@keyframes ai-work-pulse { 0%, 100% { opacity: .28; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.ai-project-cockpit-top,
.ai-project-next,
.ai-project-section-head,
.ai-project-inline-heading,
.ai-project-result-main,
.ai-project-result-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.ai-project-cockpit h1 {
    margin: 4px 0 2px;
    font-size: clamp(20px, 1.35vw, 27px);
    line-height: 1.2;
}
.ai-project-address {
    max-width: 75ch;
    margin: 3px 0 0;
    color: #657187;
}
.ai-project-responsible {
    min-width: 190px;
    padding: 11px 14px;
    border-left: 3px solid #19a873;
    background: #f4f8f7;
}
.ai-project-responsible span,
.ai-project-status > span,
.ai-project-next span,
.ai-project-metric span,
.ai-project-blockers article > span,
.ai-project-document-metrics span {
    display: block;
    margin-bottom: 3px;
    color: #66758a;
    font-size: 13px;
    font-weight: 750;
}
.ai-project-responsible strong { font-size: 16px; }
.ai-project-status h2 {
    max-width: 36ch;
    margin: 0;
    color: #151638;
    font-size: clamp(24px, 2vw, 32px);
    line-height: 1.18;
}
.ai-project-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ai-project-stages li {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-height: 46px;
    padding: 6px 12px 6px 0;
    color: #7b8797;
}
.ai-project-stages li::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 7px;
    width: 22px;
    height: 1px;
    background: #d9e2e6;
}
.ai-project-stages li:last-child::after { display: none; }
.ai-project-stages li > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #cbd6dc;
    border-radius: 50%;
    background: #fff;
    font-size: 15px;
    font-weight: 900;
}
.ai-project-stages li b { padding-right: 23px; font-size: 14px; }
.ai-project-stages .is-completed { color: #167c59; }
.ai-project-stages .is-completed > span { color: #fff; border-color: #18a873; background: #18a873; }
.ai-project-stages .is-current { color: #151638; }
.ai-project-stages .is-current > span { color: #fff; border-color: #2589bd; background: #2589bd; }
.ai-project-stages .is-blocked { color: #9a341f; }
.ai-project-stages .is-blocked > span { color: #fff; border-color: #d94848; background: #d94848; }
.ai-project-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border-top: 1px solid #e2e9ec;
    border-bottom: 1px solid #e2e9ec;
}
.ai-project-metric {
    min-width: 0;
    padding: 14px 16px;
    border-right: 1px solid #e2e9ec;
}
.ai-project-metric:last-child { border-right: 0; }
.ai-project-metric strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: clamp(20px, 1.45vw, 27px);
    line-height: 1.2;
}
.ai-project-next {
    align-items: center;
    padding: 15px 17px;
    border: 1px solid #cde7dd;
    background: #f2faf7;
}
.ai-project-next > div { max-width: 78ch; }
.ai-project-next strong { display: block; font-size: 17px; line-height: 1.4; }
.ai-project-primary-action {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 11px 18px;
    font-weight: 800;
}
.ai-project-secondary {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin: 12px 0 8px;
}
.ai-project-more { min-height: 40px; }
.ai-project-action-menu {
    position: absolute;
    z-index: 8;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    padding: 8px;
    border: 1px solid #d8e3e7;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(21, 22, 56, .16);
}
.ai-project-action-menu button {
    width: 100%;
    min-height: 40px;
    justify-content: flex-start;
    border: 0;
    border-bottom: 1px solid #edf1f3;
    border-radius: 0;
    text-align: left;
}
.ai-project-action-menu button:last-child { border-bottom: 0; }
.ai-project-inline-panel,
.ai-project-tool-actions {
    width: 100%;
    margin-top: 8px;
    padding: 18px;
    border: 1px solid #d8e3e7;
    border-radius: 6px;
    background: #fff;
}
.ai-project-secondary:has(.ai-project-inline-panel),
.ai-project-secondary:has(.ai-project-tool-actions) { flex-wrap: wrap; }
.ai-project-inline-heading h3,
.ai-project-tool-actions h3 { margin: 2px 0; font-size: 19px; }
.ai-project-inline-heading p { max-width: 75ch; margin: 4px 0 0; color: #657187; }
.ai-project-inline-panel textarea { width: 100%; margin: 14px 0 10px; }
.ai-project-tool-actions article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #e3eaed;
}
.ai-project-subtabs {
    display: flex;
    gap: 3px;
    margin: 20px 0 0;
    overflow-x: auto;
    border-bottom: 1px solid #cedae0;
    scrollbar-width: thin;
}
.ai-project-subtabs button {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 11px 18px;
    color: #46556b;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-weight: 800;
}
.ai-project-subtabs button:hover { background: #edf6f3; }
.ai-project-subtabs button.is-active {
    color: #08785a;
    border-bottom-color: #18a873;
    background: #edf8f4;
}
.ai-project-tabpanel { min-width: 0; padding: 20px 0 8px; }
.ai-project-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 18px;
    align-items: start;
}
.ai-project-section,
.ai-project-result-group,
.ai-project-documents > .ai-project-section {
    min-width: 0;
    padding: 20px;
    border: 1px solid #dce5e8;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(25, 36, 64, .045);
}
.ai-project-section-head { align-items: center; margin-bottom: 14px; }
.ai-project-section-head h2,
.ai-project-result-group > header h2,
.ai-project-next-card h2 {
    margin: 2px 0 0;
    font-size: clamp(18px, 1.15vw, 21px);
    line-height: 1.3;
}
.ai-project-next-card { border-left: 4px solid #18a873; background: #f8fcfa; }
.ai-project-next-card h2 { max-width: 65ch; margin-bottom: 16px; }
.ai-project-blockers { display: grid; gap: 9px; }
.ai-project-blockers article {
    padding: 12px 14px;
    border-left: 4px solid #8390a0;
    background: #f7f9fa;
}
.ai-project-blockers article.is-danger { border-left-color: #d94848; background: #fff6f6; }
.ai-project-blockers article.is-warning { border-left-color: #dda919; background: #fffaf0; }
.ai-project-blockers article.is-info { border-left-color: #2589bd; background: #f3f9fc; }
.ai-project-blockers article strong { display: block; max-width: 75ch; font-size: 15px; }
.ai-project-blockers article small { display: block; margin-top: 5px; color: #68758a; font-size: 13px; }
.ai-project-result-list,
.ai-project-results { display: grid; gap: 14px; }
.ai-project-result-group > header { margin-bottom: 14px; }
.ai-project-result-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dce5e8;
    border-left: 4px solid #18a873;
    border-radius: 5px;
    background: #fff;
}
.ai-project-result-main h3 { margin: 2px 0 5px; font-size: 18px; }
.ai-project-result-main p { max-width: 75ch; margin: 0; color: #526177; overflow-wrap: anywhere; }
.ai-project-result-status {
    flex: 0 0 auto;
    display: grid;
    justify-items: end;
    gap: 5px;
    min-width: 145px;
}
.ai-project-result-status small { color: #657187; font-size: 13px; }
.ai-project-result-actions { justify-content: flex-start; margin-top: 13px; }
.ai-project-result-detail {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e8eb;
}
.ai-project-result-detail > .card {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.ai-project-result-history { margin-top: 13px; }
.ai-project-history-list { display: grid; gap: 8px; margin-top: 9px; }
.ai-project-history-list > article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding: 11px 13px;
    border: 1px solid #e0e7ea;
    background: #f8fafb;
}
.ai-project-history-list > article small { display: block; color: #657187; font-size: 13px; }
.ai-project-history-list .ai-project-result-detail { grid-column: 1 / -1; }
.ai-project-activity-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ai-project-activity-list > li {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding: 13px 12px 13px 22px;
    border-bottom: 1px solid #e4eaed;
}
.ai-project-activity-list > li::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #18a873;
}
.ai-project-activity-list > li.is-warning::before { background: #dda919; }
.ai-project-activity-list > li.is-error::before { background: #d94848; }
.ai-project-activity-list > li.is-approval::before { background: #7c5cc4; }
.ai-project-activity-list p { max-width: 75ch; margin: 2px 0; }
.ai-project-activity-list small { color: #68758a; font-size: 13px; }
.ai-project-activity-list > li > ul {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    padding: 10px 14px 10px 28px;
    color: #59677a;
    background: #f7f9fa;
}
.ai-project-activity-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}
.ai-project-activity-filters button { min-height: 39px; }
.ai-project-activity-filters button.is-active { color: #08785a; border-color: #18a873; background: #edf8f4; }
.ai-project-document-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.ai-project-document-metrics > div {
    padding: 16px;
    border: 1px solid #dce5e8;
    border-left: 3px solid #18a873;
    background: #fff;
}
.ai-project-document-metrics strong { display: block; font-size: 26px; }
.ai-project-documents-empty,
.ai-project-empty {
    margin: 0;
    padding: 16px;
    color: #66758a;
    background: #f7f9fa;
}
.ai-project-documents-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ai-project-activity-note { color: #657187; font-size: 13px; }
.ai-project-office .ai-office-policy { margin: 8px 0 0; font-size: 13px; }
.ai-project-office .ai-result-workspace {
    display: grid;
    gap: 18px;
    min-width: 0;
    margin-top: 4px;
    padding: clamp(16px, 1.6vw, 26px);
    border: 1px solid #dbe5e8;
    border-radius: 6px;
    background: #fff;
}
.ai-project-office .ai-result-stale {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 14px;
    border-left: 4px solid #dda919;
    background: #fff8df;
}
.ai-project-office .ai-result-stale span { color: #5d6472; }
.ai-project-office .ai-result-workspace-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dce5e8;
}
.ai-project-office .ai-result-author { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ai-project-office .ai-result-author > div:last-child { min-width: 0; }
.ai-project-office .ai-result-author-avatar {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border: 2px solid #18a873;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 32%;
}
.ai-project-office .ai-result-author h2 { margin: 2px 0 3px; font-size: clamp(20px, 1.25vw, 26px); line-height: 1.2; }
.ai-project-office .ai-result-author p { margin: 0; color: #68758a; }
.ai-project-office .ai-result-workspace-state { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.ai-project-office .ai-result-workspace-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    align-items: start;
    gap: clamp(18px, 2vw, 30px);
    min-width: 0;
}
.ai-project-office .ai-result-workspace-main { min-width: 0; }
.ai-project-office .ai-result-review {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid #dce5e8;
    border-top: 4px solid #8190a0;
    border-radius: 5px;
    background: #f8fafb;
}
.ai-project-office .ai-result-review.is-pending { border-top-color: #7c5cc4; background: #f7f4fc; }
.ai-project-office .ai-result-review.is-approved,
.ai-project-office .ai-result-review.is-completed { border-top-color: #18a873; background: #f1faf6; }
.ai-project-office .ai-result-review.is-rejected,
.ai-project-office .ai-result-review.is-failed { border-top-color: #d94848; background: #fff4f4; }
.ai-project-office .ai-result-review h3,
.ai-project-office .ai-result-review p,
.ai-project-office .ai-result-review blockquote { margin: 0; }
.ai-project-office .ai-result-review blockquote { padding: 10px 12px; border-left: 3px solid #8190a0; background: #fff; }
.ai-project-office .ai-result-review label { display: grid; gap: 7px; font-weight: 700; }
.ai-project-office .ai-result-review textarea { width: 100%; min-height: 108px; resize: vertical; }
.ai-project-office .ai-result-review-actions { display: grid; gap: 8px; }
.ai-project-office .ai-result-review-actions button { width: 100%; min-height: 43px; }
.ai-project-office .ai-result-tabs {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    border-bottom: 1px solid #dce5e8;
}
.ai-project-office .ai-result-tabs button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 12px;
    color: #516177;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
}
.ai-project-office .ai-result-tabs button.is-active { color: #08785a; border-bottom-color: #18a873; background: #edf8f4; }
.ai-project-office .ai-result-tabpanel { min-width: 0; padding: 16px 2px 2px; }
.ai-project-office .ai-result-summary > p { max-width: 78ch; line-height: 1.55; }
.ai-project-office .ai-result-lineage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 14px 0;
}
.ai-project-office .ai-result-lineage > div { padding: 10px 12px; background: #f5f8f8; }
.ai-project-office .ai-result-lineage dt { color: #68758a; font-size: 13px; }
.ai-project-office .ai-result-lineage dd { margin: 3px 0 0; font-weight: 750; }
.ai-project-office .ai-result-checks,
.ai-project-office .ai-result-diff { display: grid; gap: 8px; }
.ai-project-office .ai-result-checks article,
.ai-project-office .ai-result-diff article { padding: 12px 14px; border-left: 4px solid #dda919; background: #fffaf0; }
.ai-project-office .ai-result-checks article.is-critical { border-left-color: #d94848; background: #fff3f3; }
.ai-project-office .ai-result-checks article.is-warning { border-left-color: #dda919; background: #fffaf0; }
.ai-project-office .ai-result-checks article.is-hint { border-left-color: #2589bd; background: #f3f9fc; }
.ai-project-office .ai-result-checks article.is-info { border-left-color: #8190a0; background: #f5f8f8; }
.ai-project-office .ai-result-checks article > div:first-child { display: grid; gap: 3px; }
.ai-project-office .ai-result-checks span { display: block; color: #68758a; font-size: 12px; text-transform: uppercase; }
.ai-project-office .ai-result-checks p { max-width: 78ch; margin: 8px 0; }
.ai-project-office .ai-result-checks dl { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 0; }
.ai-project-office .ai-result-checks dl > div { display: grid; gap: 1px; }
.ai-project-office .ai-result-checks dt { color: #68758a; font-size: 12px; }
.ai-project-office .ai-result-checks dd { margin: 0; font-weight: 700; }
.ai-project-office .ai-result-diff article { display: grid; gap: 4px; border-left-color: #2589bd; background: #f3f9fc; }
.ai-project-office .ai-result-diff del { color: #9f2d35; }
.ai-project-office .ai-result-diff ins { color: #08785a; text-decoration: none; }
.ai-project-office .ai-result-version-grid { display: grid; grid-template-columns: minmax(220px,.65fr) minmax(0,1.35fr); gap: 18px; }
.ai-project-office .ai-result-version-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 10px 11px; border-bottom: 1px solid #e2e9ec; }
.ai-project-office .ai-result-version-row > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-project-office .ai-result-version-row > div:first-child { display: grid; align-items: start; gap: 2px; }
.ai-project-office .ai-result-version-row small { grid-column: 1 / -1; color: #68758a; }
.ai-project-office .ai-result-version-row.is-current { border-left: 3px solid #18a873; background: #edf8f4; }
.ai-project-office .ai-result-version-row.is-selected { box-shadow: inset 0 0 0 2px rgba(37, 137, 189, .25); }
.ai-project-office .ai-result-sources { display: grid; gap: 8px; margin: 0; }
.ai-project-office .ai-result-sources article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border: 1px solid #dfe7ea; background: #f8fafb; }
.ai-project-office .ai-result-sources article > div { display: grid; gap: 3px; min-width: 0; }
.ai-project-office .ai-result-sources article small { color: #68758a; }
.ai-project-office .ai-result-sources article > span { flex: 0 0 auto; color: #08785a; font-weight: 700; }
.ai-project-office .ai-document-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 13px; }
.ai-project-office .ai-document-filters button.is-active { color: #08785a; border-color: #18a873; background: #edf8f4; }
.ai-project-office .ai-document-explorer { display: grid; border-top: 1px solid #e2e9ec; }
.ai-project-office .ai-document-row { display: grid; grid-template-columns: minmax(220px,1fr) minmax(130px,.35fr) auto; align-items: center; gap: 14px; min-width: 0; padding: 13px 3px; border-bottom: 1px solid #e2e9ec; }
.ai-project-office .ai-document-row-main { min-width: 0; }
.ai-project-office .ai-document-row-main strong,
.ai-project-office .ai-document-row-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-project-office .ai-document-row-main span,
.ai-project-office .ai-document-row-meta small { margin-top: 3px; color: #68758a; font-size: 13px; }
.ai-project-office .ai-document-row-meta { display: grid; gap: 2px; }
.ai-project-office .ai-document-status { font-weight: 750; }
.ai-project-office .ai-document-row.is-review .ai-document-status { color: #9b6d00; }
.ai-project-office .ai-document-row.is-error .ai-document-status { color: #b52832; }
.ai-project-office .ai-document-row.is-ready .ai-document-status { color: #08785a; }
.ai-project-office .ai-document-row-actions { display: flex; gap: 7px; }
.ai-project-office .ai-project-document-metrics > button,
.ai-project-office .ai-project-document-metrics > div {
    min-width: 0;
    padding: 15px 16px;
    color: #20243f;
    border: 1px solid #dce5e8;
    border-left: 3px solid #18a873;
    border-radius: 4px;
    background: #fff;
    text-align: left;
}
.ai-project-office .ai-project-document-metrics > button { cursor: pointer; }
.ai-project-office .ai-project-document-metrics > button:hover,
.ai-project-office .ai-project-document-metrics > button:focus-visible { border-color: #18a873; background: #f1faf7; }
.ai-project-office .ai-project-document-metrics > button.is-alert { border-left-color: #d94848; }
.ai-project-office .ai-document-head-actions,
.ai-project-office .ai-document-empty-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ai-project-office .ai-document-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
    gap: 10px;
    margin: 18px 0 10px;
}
.ai-project-office .ai-document-toolbar label,
.ai-project-office .ai-document-toolbar input,
.ai-project-office .ai-document-toolbar select { width: 100%; }
.ai-project-office .ai-document-workspace {
    display: grid;
    grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
    min-height: 360px;
    border: 1px solid #dce5e8;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}
.ai-project-office .ai-document-categories {
    display: grid;
    align-content: start;
    border-right: 1px solid #dce5e8;
    background: #f6f9f9;
}
.ai-project-office .ai-document-categories button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    color: #253149;
    border: 0;
    border-bottom: 1px solid #e2e9ec;
    border-radius: 0;
    background: transparent;
    text-align: left;
}
.ai-project-office .ai-document-categories button:hover,
.ai-project-office .ai-document-categories button:focus-visible { background: #eaf5f1; }
.ai-project-office .ai-document-categories button.is-active { color: #08785a; box-shadow: inset 3px 0 #18a873; background: #e7f5f0; }
.ai-project-office .ai-document-categories strong { min-width: 24px; text-align: right; }
.ai-project-office .ai-document-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 8px 13px;
    border-bottom: 1px solid #dce5e8;
}
.ai-project-office .ai-document-explorer {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 12px;
    padding: 13px;
    border: 0;
}
.ai-project-office .ai-document-card {
    display: grid;
    grid-template-rows: auto minmax(48px, auto) auto auto auto;
    min-width: 0;
    padding: 14px;
    border: 1px solid #dce5e8;
    border-left: 4px solid #8795a5;
    border-radius: 5px;
    background: #fff;
}
.ai-project-office .ai-document-card.is-success { border-left-color: #18a873; }
.ai-project-office .ai-document-card.is-warning { border-left-color: #dda919; }
.ai-project-office .ai-document-card.is-critical { border-left-color: #d94848; }
.ai-project-office .ai-document-card.is-info { border-left-color: #3888b8; }
.ai-project-office .ai-document-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ai-project-office .ai-document-card h3 { margin: 5px 0 2px; font-size: 17px; line-height: 1.25; }
.ai-project-office .ai-document-card header p { max-width: 48ch; margin: 0; overflow: hidden; color: #68758a; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ai-project-office .ai-document-category { color: #08785a; font-size: 12px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.ai-project-office .ai-document-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 3px; color: #536174; background: #edf1f3; font-size: 12px; font-weight: 800; }
.ai-project-office .ai-document-status.is-success { color: #08785a; background: #e7f6f0; }
.ai-project-office .ai-document-status.is-warning { color: #825e00; background: #fff3c9; }
.ai-project-office .ai-document-status.is-critical { color: #ae2933; background: #fdebed; }
.ai-project-office .ai-document-status.is-info { color: #246b95; background: #e8f4fa; }
.ai-project-office .ai-document-summary { max-width: 75ch; margin: 13px 0; line-height: 1.5; }
.ai-project-office .ai-document-summary.is-empty { color: #7b8593; }
.ai-project-office .ai-document-card dl { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 12px; }
.ai-project-office .ai-document-card dl > div { display: grid; gap: 1px; }
.ai-project-office .ai-document-card dt { color: #68758a; font-size: 12px; }
.ai-project-office .ai-document-card dd { margin: 0; font-weight: 700; }
.ai-project-office .ai-document-relations { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.ai-project-office .ai-document-relations span { padding: 4px 7px; color: #246b95; background: #e8f4fa; font-size: 12px; font-weight: 700; }
.ai-project-office .ai-document-card footer { display: flex; align-items: end; justify-content: flex-end; gap: 7px; margin-top: auto; padding-top: 11px; border-top: 1px solid #e5ebed; }

dialog.document-review-dialog {
    width: min(1900px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100vh - 28px);
    padding: 0;
}
dialog.document-review-dialog #modalForm { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 28px); }
dialog.document-review-dialog #modalBody {
    display: block;
    min-height: 0;
    overflow: auto;
}
.document-review-workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
.document-review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.document-review-head h2 { margin: 4px 0; font-size: clamp(21px, 1.45vw, 28px); }
.document-review-head p { margin: 0; color: #68758a; }
.document-review-layout {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(360px, 1.08fr) minmax(380px, .92fr);
    gap: 18px;
    min-height: 0;
}
.document-review-preview { position: static; min-height: 0; overflow: hidden; border: 1px solid #d9e3e6; background: #eef2f3; }
.document-review-preview iframe,
.document-review-preview img { display: block; width: 100%; height: min(70vh, 820px); border: 0; object-fit: contain; background: #fff; }
.file-preview-unavailable { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 520px; text-align: center; }
.document-review-facts { min-width: 0; }
.document-review-completion { flex: 0 0 auto; width: 100%; }
.document-review-summary { padding: 14px 16px; border-left: 4px solid #3888b8; background: #eef7fb; }
.document-review-summary h3 { margin: 0 0 6px; }
.document-review-summary p { max-width: 75ch; margin: 0; line-height: 1.5; }
.document-review-fact-list { display: grid; gap: 10px; margin-top: 12px; }
.document-fact-card { padding: 14px 15px; border: 1px solid #dce5e8; border-left: 4px solid #dda919; background: #fff; }
.document-fact-card.is-confirmed { border-left-color: #18a873; }
.document-fact-card.is-rejected,
.document-fact-card.is-conflict { border-left-color: #d94848; }
.document-fact-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.document-fact-card h3 { margin: 5px 0 0; font-size: 17px; }
.document-fact-priority { color: #68758a; font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.document-fact-priority.is-critical,
.document-fact-priority.is-high { color: #b62d37; }
.document-fact-priority.is-medium { color: #876400; }
.document-fact-value { margin: 13px 0; font-size: 20px; font-weight: 800; }
.document-fact-card dl { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.document-fact-card dl > div { display: grid; gap: 1px; }
.document-fact-card dt { color: #68758a; font-size: 12px; }
.document-fact-card dd { margin: 0; font-weight: 700; }
.project-file-fact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.project-file-transfer-note { margin: 12px 0 0; padding: 10px 12px; color: #315c50; background: #eaf7f2; }
.document-relations,
.document-excerpts { padding-top: 4px; }
.document-relations > article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #dfe7ea; }
.document-relations article > div { display: grid; gap: 2px; }
.document-relations small { color: #68758a; }
.document-excerpts details { padding: 10px 2px; border-bottom: 1px solid #dfe7ea; }
.document-excerpts summary { cursor: pointer; font-weight: 750; }
.document-excerpts p { max-width: 85ch; line-height: 1.55; }
.document-review-policy { max-width: 85ch; margin: 0; padding: 11px 13px; border-left: 3px solid #dda919; color: #5d521d; background: #fff8dc; }
@media (max-width: 980px) {
    .ai-project-office .ai-document-workspace { grid-template-columns: 1fr; }
    .ai-project-office .ai-document-categories { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid #dce5e8; }
    .ai-project-office .ai-document-categories button { flex: 0 0 auto; min-width: 150px; border-right: 1px solid #e2e9ec; border-bottom: 0; }
    .ai-project-office .ai-document-categories button.is-active { box-shadow: inset 0 -3px #18a873; }
    .document-review-layout { grid-template-columns: 1fr; }
    .document-review-preview { position: static; min-height: 440px; }
    .document-review-preview iframe,
    .document-review-preview img { height: min(56vh, 620px); }
}
@media (max-width: 680px) {
    .ai-project-office .ai-document-toolbar { grid-template-columns: 1fr; }
    .ai-project-office .ai-document-explorer { grid-template-columns: 1fr; padding: 9px; }
    .ai-project-office .ai-document-card > header,
    .document-review-head,
    .document-fact-card > header { display: grid; }
    .ai-project-office .ai-document-status { justify-self: start; }
    .ai-project-office .ai-document-card footer,
    .ai-project-office .ai-document-head-actions,
    .ai-project-office .ai-document-empty-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .ai-project-office .ai-document-card footer button,
    .ai-project-office .ai-document-head-actions button,
    .ai-project-office .ai-document-empty-actions button { width: 100%; min-height: 44px; }
    dialog.document-review-dialog { width: calc(100vw - 10px); max-height: calc(100vh - 10px); }
    dialog.document-review-dialog #modalForm { max-height: calc(100vh - 10px); }
    .document-review-preview { min-height: 300px; }
    .document-review-preview iframe,
    .document-review-preview img { height: 48vh; min-height: 300px; }
    .document-relations > article { align-items: stretch; flex-direction: column; }
    .project-file-fact-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (min-width: 981px) {
    dialog.document-review-dialog #modalBody {
        margin-top: 0;
        padding-top: 8px;
    }
    dialog.document-review-dialog .modal-actions { padding-top: 8px; }
    .document-review-head { align-items: center; }
    .document-review-head h2 { margin: 0; }
    .document-review-head p { margin-top: 3px; }
    .document-review-layout {
        flex: 0 0 auto;
        height: clamp(500px, calc(100vh - 420px), 720px);
    }
    .document-review-facts {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }
    .document-review-facts .document-review-completion {
        width: auto;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: 0 -8px 20px rgba(30, 47, 70, .05);
    }
}

/* Dokumentenprüfung – ruhiges Split-Layout mit durchgehender Originalansicht. */
@media (min-width: 981px) {
    dialog.document-review-dialog #modalForm {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        height: 100%;
        padding: 10px 16px 16px;
    }
    dialog.document-review-dialog .modal-head { min-height: 40px; }
    dialog.document-review-dialog .modal-actions { display: none; }
    dialog.document-review-dialog #modalBody {
        height: 100%;
        margin-top: 0;
        padding: 8px 0 0;
        overflow: hidden;
    }
    .document-review-workspace {
        height: 100%;
        min-height: 0;
        gap: 10px;
    }
    .document-review-head { align-items: center; min-height: 0; }
    .document-review-head .section-kicker { display: none; }
    .document-review-head h2 { font-size: clamp(19px, 1.2vw, 24px); }
    .document-review-progress-panel { gap: 5px 16px; padding: 7px 12px; }
    .document-review-progress { height: 5px; }
    .document-review-layout {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        grid-template-columns: minmax(360px, 34fr) minmax(0, 66fr);
        gap: 16px;
    }
    .document-review-preview,
    .document-review-facts { height: 100%; min-height: 0; }
}
.ai-office-workspace { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 18px; align-items: start; }
.ai-office-workspace > .card { min-width: 0; }
.ai-office-priority-list { grid-row: span 2; }
.ai-office-priority-list .ai-run-list article { border-left: 3px solid #8190a0; }
.ai-office-priority-list .ai-run-list article.is-critical { border-left-color: #d94848; }
.ai-office-priority-list .ai-run-list article.is-high { border-left-color: #dda919; }
.ai-office-pipeline { display: grid; gap: 8px; }
.ai-office-pipeline > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 11px; background: #f4f8f8; }
.ai-office-change-list { display: grid; gap: 2px; }
.ai-office-change-list button { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 10px 2px; color: #20213f; border: 0; border-bottom: 1px solid #e3eaed; border-radius: 0; background: transparent; text-align: left; }
.ai-office-change-list small { color: #68758a; }

/* Digitales Büro UX5: tägliche Portfolio- und Entscheidungszentrale. */
.digital-office-dashboard.ai-office-command-center {
    display: grid;
    gap: 18px;
    color: #17234f;
    font-size: 15px;
}
.digital-office-dashboard .ai-office-command-head {
    align-items: end;
    margin: 0;
}
.digital-office-dashboard .ai-office-command-head h1 { font-size: clamp(28px, 2vw, 38px); }
.digital-office-dashboard .ai-office-command-head p { max-width: 72ch; font-size: 15px; line-height: 1.55; }
.digital-office-dashboard .ai-office-command-actions { display: grid; justify-items: end; gap: 9px; }
.digital-office-dashboard .ai-office-command-actions small { color: #68758a; }
.digital-office-dashboard .ai-office-command-actions button { min-height: 42px; padding-inline: 18px; }
.digital-office-dashboard .ai-office-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.digital-office-dashboard .ai-office-kpis article { min-height: 108px; }
.digital-office-dashboard .ai-office-kpis .is-danger { border-color: #e28b8b; background: #fff6f6; }
.digital-office-dashboard .ai-office-kpis .is-warning { border-color: #e3c262; background: #fffbec; }
.digital-office-dashboard .ai-office-operation-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 14px;
    border-left: 4px solid #25a97a;
    background: #eef9f5;
}
.digital-office-dashboard .ai-office-operation-strip.is-danger { border-left-color: #d64b4b; background: #fff5f5; }
.digital-office-dashboard .ai-office-operation-strip span { color: #58677b; }
.digital-office-dashboard .ai-office-command-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
    gap: 18px;
    align-items: start;
}
.digital-office-dashboard .ai-office-command-grid > .card { min-width: 0; }
.digital-office-dashboard .ai-office-today { grid-row: span 2; }
.digital-office-dashboard .ai-office-pipeline-card { grid-column: 1 / -1; }
.digital-office-dashboard .card-head-inline h2 { font-size: 20px; }
.digital-office-dashboard .ai-office-project-list { display: grid; gap: 8px; }
.digital-office-dashboard .ai-office-project-item {
    display: grid;
    grid-template-columns: minmax(210px, 1.05fr) minmax(170px, .72fr) minmax(240px, 1.15fr) minmax(140px, .55fr) minmax(110px, .42fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border: 1px solid #dfe8eb;
    border-left: 4px solid #8293a5;
    background: #fff;
}
.digital-office-dashboard .ai-office-project-list.is-compact .ai-office-project-item {
    grid-template-columns: minmax(210px, 1fr) minmax(240px, 1.2fr) minmax(145px, .55fr) minmax(110px, .4fr) auto;
}
.digital-office-dashboard .ai-office-project-item.is-high,
.digital-office-dashboard .ai-office-project-item.is-urgent { border-left-color: #dc4a4a; }
.digital-office-dashboard .ai-office-project-identity strong,
.digital-office-dashboard .ai-office-project-reason strong,
.digital-office-dashboard .ai-office-project-owner span,
.digital-office-dashboard .ai-office-project-deadline span { display: block; }
.digital-office-dashboard .ai-office-project-item small { display: block; margin-top: 3px; color: #68758a; line-height: 1.35; }
.digital-office-dashboard .ai-office-project-phase { padding: 8px 10px; border-left: 3px solid #25a97a; background: #eef7f4; }
.digital-office-dashboard .ai-office-project-phase span { display: block; color: #166e59; font-weight: 700; }
.digital-office-dashboard .ai-office-project-item > button { min-height: 40px; white-space: nowrap; }
.digital-office-dashboard .ai-office-queues {
    display: grid;
    grid-template-columns: repeat(6, minmax(105px, 1fr));
    gap: 8px;
}
.digital-office-dashboard .ai-office-queues button {
    display: grid;
    gap: 4px;
    min-height: 70px;
    padding: 10px;
    border: 1px solid #dbe5e8;
    background: #f7faf9;
    color: #17234f;
    text-align: left;
}
.digital-office-dashboard .ai-office-queues button.is-active { border-color: #24aa7a; background: #eaf7f2; box-shadow: inset 0 -3px #24aa7a; }
.digital-office-dashboard .ai-office-queues strong { font-size: 22px; }
.digital-office-dashboard .ai-office-filterbar {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(4, minmax(150px, .72fr)) auto;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dce5e9;
    background: #fff;
}
.digital-office-dashboard .ai-office-filterbar label { display: grid; gap: 5px; min-width: 0; }
.digital-office-dashboard .ai-office-filterbar label > span { color: #68758a; font-size: 13px; font-weight: 700; }
.digital-office-dashboard .ai-office-filterbar input,
.digital-office-dashboard .ai-office-filterbar select { width: 100%; min-width: 0; min-height: 43px; }
.digital-office-dashboard .ai-office-view-switch { display: flex; align-items: end; gap: 4px; }
.digital-office-dashboard .ai-office-view-switch button { min-height: 43px; background: #eef3f3; color: #17234f; }
.digital-office-dashboard .ai-office-view-switch button.is-active { background: #17234f; color: #fff; }
.digital-office-dashboard .ai-office-quick-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.digital-office-dashboard .ai-office-quick-filters button { min-height: 38px; padding: 8px 12px; background: #eef3f3; color: #17234f; }
.digital-office-dashboard .ai-office-quick-filters button.is-active { background: #17234f; color: #fff; }
.digital-office-dashboard .ai-office-portfolio { display: grid; gap: 14px; }
.digital-office-dashboard .ai-office-portfolio-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.digital-office-dashboard .ai-office-portfolio-heading h2 { margin: 3px 0 0; font-size: 22px; }
.digital-office-dashboard .ai-office-stage-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(150px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.digital-office-dashboard .ai-office-stage-grid > section { min-width: 150px; border: 1px solid #dce5e9; background: #f7faf9; }
.digital-office-dashboard .ai-office-stage-grid > section > button { display: flex; justify-content: space-between; width: 100%; border: 0; border-bottom: 3px solid #26aa7b; border-radius: 0; background: #fff; color: #17234f; text-align: left; }
.digital-office-dashboard .ai-office-stage-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 7px; border-bottom: 1px solid #dce5e9; color: #68758a; font-size: 11px; text-align: center; }
.digital-office-dashboard .ai-office-stage-projects { display: grid; gap: 6px; padding: 8px; }
.digital-office-dashboard .ai-office-stage-projects button { display: grid; gap: 2px; padding: 8px; border: 1px solid #e0e7e9; background: #fff; color: #17234f; text-align: left; }
.digital-office-dashboard .ai-office-stage-grid p { margin: 4px; color: #758196; font-size: 13px; }
.digital-office-dashboard .ai-office-change-list button > span { min-width: 0; }
.digital-office-dashboard .ai-office-team-compact { display: grid; gap: 8px; }
.digital-office-dashboard .ai-office-team-compact article { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #e4ebed; }
.digital-office-dashboard .ai-office-team-compact small { display: block; margin-top: 3px; color: #68758a; }
.digital-office-dashboard .ai-office-usage-compact .ai-usage-summary { margin-top: 8px; }

@media (min-width: 2200px) {
    .digital-office-dashboard.ai-office-command-center { gap: 22px; font-size: 17px; }
    .digital-office-dashboard .ai-office-command-grid { grid-template-columns: minmax(0, 1.45fr) minmax(520px, .55fr); gap: 22px; }
    .digital-office-dashboard .ai-office-project-item { padding: 16px 18px; font-size: 16px; }
    .digital-office-dashboard .ai-office-filterbar { padding: 18px; }
}

@media (max-width: 1280px) {
    .digital-office-dashboard .ai-office-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .digital-office-dashboard .ai-office-command-grid { grid-template-columns: 1fr; }
    .digital-office-dashboard .ai-office-today { grid-row: auto; }
    .digital-office-dashboard .ai-office-pipeline-card { grid-column: auto; }
    .digital-office-dashboard .ai-office-filterbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .digital-office-dashboard .ai-office-project-item,
    .digital-office-dashboard .ai-office-project-list.is-compact .ai-office-project-item { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(105px, .4fr) auto; }
    .digital-office-dashboard .ai-office-project-item .ai-office-project-phase { display: none; }
}

@media (max-width: 760px) {
    .digital-office-dashboard.ai-office-command-center { gap: 13px; font-size: 15px; }
    .digital-office-dashboard .ai-office-command-head { align-items: stretch; flex-direction: column; }
    .digital-office-dashboard .ai-office-command-actions { justify-items: stretch; }
    .digital-office-dashboard .ai-office-command-actions button { width: 100%; }
    .digital-office-dashboard .ai-office-queues {
        display: flex;
        gap: 9px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }
    .digital-office-dashboard .ai-office-kpis article { min-height: 102px; }
    .digital-office-dashboard .ai-office-queues button { flex: 0 0 135px; scroll-snap-align: start; }
    .digital-office-dashboard .ai-office-operation-strip,
    .digital-office-dashboard .ai-office-portfolio-heading { align-items: stretch; flex-direction: column; }
    .digital-office-dashboard .ai-office-filterbar { grid-template-columns: 1fr; }
    .digital-office-dashboard .ai-office-view-switch { align-items: stretch; }
    .digital-office-dashboard .ai-office-view-switch button { flex: 1; }
    .digital-office-dashboard .ai-office-project-item,
    .digital-office-dashboard .ai-office-project-list.is-compact .ai-office-project-item { grid-template-columns: 1fr; gap: 9px; }
    .digital-office-dashboard .ai-office-project-item > button { width: 100%; min-height: 44px; }
    .digital-office-dashboard .ai-office-project-deadline { display: flex; justify-content: space-between; gap: 12px; }
}

@media (min-width: 2200px) {
    .ai-project-office { font-size: 16px; }
    .ai-project-cockpit { gap: 24px; }
    .ai-project-overview-grid { grid-template-columns: minmax(0, 1.3fr) minmax(480px, .7fr); gap: 22px; }
    .ai-project-section,
    .ai-project-result-group { padding: 24px; }
    .ai-project-blockers article strong,
    .ai-project-result-main p { font-size: 16px; }
}

@media (max-width: 1180px) {
    .ai-project-overview-grid { grid-template-columns: 1fr; }
    .ai-project-stages { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    .ai-office-workspace { grid-template-columns: 1fr; }
    .ai-office-priority-list { grid-row: auto; }
    .ai-project-office .ai-result-workspace-layout { grid-template-columns: 1fr; }
    .ai-project-office .ai-result-review { order: 2; }
}

@media (max-width: 700px) {
    .ai-project-office { font-size: 15px; }
    .ai-project-cockpit { gap: 16px; padding: 18px 14px; }
    .ai-work-indicator { grid-template-columns: 44px minmax(0, 1fr); padding: 13px 14px; }
    .ai-work-indicator-meta { grid-column: 1 / -1; justify-items: start; text-align: left; }
    .ai-project-cockpit-top,
    .ai-project-next,
    .ai-project-section-head,
    .ai-project-inline-heading,
    .ai-project-result-main,
    .ai-project-tool-actions article,
    .ai-project-documents-empty { align-items: stretch; flex-direction: column; }
    .ai-project-responsible { min-width: 0; }
    .ai-project-status h2 { font-size: 24px; }
    .ai-project-stages {
        display: flex;
        gap: 8px;
        padding-bottom: 6px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }
    .ai-project-stages li {
        flex: 0 0 155px;
        padding: 7px 10px;
        border: 1px solid #e0e7ea;
        scroll-snap-align: start;
    }
    .ai-project-stages li::after { display: none; }
    .ai-project-stages li b { padding-right: 0; }
    .ai-project-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-project-metric { border-bottom: 1px solid #e2e9ec; }
    .ai-project-next .ai-project-primary-action,
    .ai-project-next-card .ai-project-primary-action { width: 100%; }
    .ai-project-secondary { margin-top: 10px; }
    .ai-project-more { width: 100%; }
    .ai-project-action-menu { position: static; width: 100%; margin-top: 6px; box-shadow: none; }
    .ai-project-secondary:has(.ai-project-action-menu) { flex-wrap: wrap; }
    .ai-project-subtabs { margin-top: 15px; }
    .ai-project-subtabs button { min-height: 46px; padding: 10px 14px; }
    .ai-project-tabpanel { padding-top: 14px; }
    .ai-project-section,
    .ai-project-result-group { padding: 15px 13px; }
    .ai-project-result-status { justify-items: start; min-width: 0; }
    .ai-project-result-actions { flex-wrap: wrap; }
    .ai-project-result-actions button { min-height: 42px; }
    .ai-project-history-list > article,
    .ai-project-activity-list > li { grid-template-columns: 1fr; }
    .ai-project-activity-list > li > ul,
    .ai-project-history-list .ai-project-result-detail { grid-column: 1; }
    .ai-project-document-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-project-office .ai-result-version-grid { grid-template-columns: 1fr; }
    .ai-project-office .ai-result-workspace { padding: 14px 12px; }
    .ai-project-office .ai-result-workspace-head,
    .ai-project-office .ai-result-stale { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
    .ai-project-office .ai-result-workspace-state { justify-content: flex-start; }
    .ai-project-office .ai-result-author-avatar { flex-basis: 48px; width: 48px; height: 48px; }
    .ai-project-office .ai-result-sources article { align-items: flex-start; flex-direction: column; gap: 6px; }
    .ai-project-office .ai-document-row { grid-template-columns: 1fr; align-items: stretch; }
    .ai-project-office .ai-document-row-actions { flex-wrap: wrap; }
    .ai-project-office .ai-document-row-actions button { flex: 1 1 130px; min-height: 42px; }
    .ai-customer-action-controls { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .ai-project-metrics,
    .ai-project-document-metrics { grid-template-columns: 1fr; }
    .ai-project-metric { border-right: 0; }
}

/* Digitales Team: lokale, rein darstellende Persona-Schicht. */
.ai-office-tabs { display:flex; gap:2px; margin:18px 0; border-bottom:1px solid #dbe6e7; overflow-x:auto; }
.ai-office-tabs button { flex:0 0 auto; border:0; border-bottom:3px solid transparent; border-radius:0; background:transparent; color:#506274; padding:12px 15px; font-weight:700; }
.ai-office-tabs button:hover, .ai-office-tabs button.is-active { color:#087e61; border-bottom-color:#1aab78; background:#f2faf7; }
.ai-office-tab-panel { min-width:0; }
.ai-team-intro { display:flex; justify-content:space-between; gap:20px; align-items:flex-end; margin-bottom:16px; }
.ai-team-intro h2 { margin:3px 0 7px; }
.ai-org-chart { display:grid; gap:18px; }
.ai-org-people { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; max-width:880px; }
.ai-human-card { display:grid; grid-template-columns:128px minmax(0,1fr); align-items:start; gap:16px; padding:16px; border:1px solid #d7e3e4; border-radius:6px; background:#fff; }
.ai-human-card > div { min-width:0; }
.ai-human-card h3, .ai-team-card h3 { margin:2px 0; color:#17234f; }
.ai-human-card p, .ai-team-card p { margin:0; color:#5f7180; font-size:13px; }
.ai-human-card ul { margin:9px 0 0; padding-left:18px; font-size:12px; color:#506274; }
.ai-team-avatar { width:128px; height:128px; border-radius:50%; object-fit:cover; object-position:center 18%; border:2px solid var(--agent-accent,#19a873); background:#f4f8f8; }
.ai-team-avatar-small { width:40px; height:40px; border-radius:50%; object-fit:cover; object-position:center 18%; }
.ai-team-avatar-fallback { display:grid; place-items:center; background:#e7f2ef; color:#087e61; font-weight:800; }
.ai-team-type { display:inline-block; color:#087e61; font-size:10px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.ai-org-staff { display:grid; grid-template-columns:minmax(0,440px); justify-content:center; position:relative; padding:18px 0 6px; }
.ai-org-staff > div { display:grid; gap:8px; }
.ai-org-connector { position:absolute; top:0; left:50%; height:18px; border-left:1px solid #a8c4bc; }
.ai-org-departments { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.ai-org-department { border:1px solid #d7e3e4; border-radius:6px; overflow:hidden; background:#fff; }
.ai-org-department > header, .ai-org-quality > header { display:grid; gap:3px; padding:12px 14px; color:#fff; background:#173f3b; }
.ai-org-department > header span, .ai-org-quality > header span { font-weight:800; }
.ai-org-department > header small, .ai-org-quality > header small { color:#cce5dd; }
.ai-org-department > div { display:grid; gap:10px; padding:12px; }
.ai-team-card { display:grid; grid-template-columns:132px minmax(0,1fr); gap:14px; padding:14px; border:1px solid #e0e9e9; border-left:4px solid var(--agent-accent,#087e61); border-radius:6px; background:#fff; }
.ai-team-card .ai-team-avatar { width:128px; height:128px; }
.ai-team-card-main { min-width:0; }
.ai-team-card-main small { display:block; margin-top:7px; color:#5f7180; font-size:11px; }
.ai-team-card-foot { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:8px; border-top:1px solid #edf1f1; }
.ai-team-card-foot button { padding:6px 9px; font-size:11px; }
.ai-team-status { display:inline-flex; align-items:center; gap:5px; font-size:11px; color:#506274; }
.ai-team-status::before { content:''; width:7px; height:7px; border-radius:50%; background:#78909c; }
.ai-team-status.is-available::before { background:#21a574; }
.ai-team-status.is-working::before { background:#347cb4; }
.ai-team-status.is-paused::before { background:#d99a20; }
.ai-team-status.is-unconfigured::before { background:#a3afb7; }
.ai-org-quality { display:grid; gap:12px; max-width:620px; justify-self:center; border:1px solid #e2d3d7; border-radius:6px; overflow:hidden; background:#fffaf9; }
.ai-org-quality .ai-team-card { margin:0 12px 12px; }
.ai-org-handover { display:grid; grid-template-columns:auto minmax(220px,auto) minmax(0,1fr); gap:12px 20px; align-items:center; margin:0 0 18px; padding:14px 16px; border:1px solid #d5e7df; border-left:4px solid #1aa875; border-radius:6px; background:#f5fbf8; }
.ai-org-handover strong { color:#17234f; font-size:16px; }
.ai-org-handover p { margin:0; color:#506274; }
.ai-org-handover.is-paused { border-color:#eedaa4; border-left-color:#d99a20; background:#fffaf0; }
.ai-org-handover.is-gate { border-color:#d9d6f1; border-left-color:#7653a6; background:#faf9ff; }
.ai-org-handover.is-working { border-color:#cce0f0; border-left-color:#2878b5; background:#f5faff; }
.ai-org-department-body > p { min-height:38px; margin:0; color:#506274; font-size:12px; line-height:1.45; }
.ai-org-agent-stack { display:grid; gap:10px; }
.ai-org-department footer { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 10px; margin-top:2px; padding-top:11px; border-top:1px solid #e4ecec; color:#506274; font-size:11px; line-height:1.35; }
.ai-org-department footer strong { color:#173f3b; font-size:10px; letter-spacing:.04em; text-transform:uppercase; }
.ai-org-staff-note { margin:0; padding:10px 12px; border-left:3px solid #087e61; background:#f2faf7; color:#506274; font-size:12px; line-height:1.45; }
.ai-org-central { border:1px solid #d7e3e4; border-radius:6px; overflow:hidden; background:#fff; }
.ai-org-central > header { display:grid; gap:3px; padding:12px 14px; color:#fff; background:#33333a; }
.ai-org-central > header span { font-weight:800; }
.ai-org-central > header small { color:#dfe5e5; }
.ai-org-central-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; }
.ai-org-central-grid .ai-team-card { min-height:180px; border-width:0 1px 0 4px; border-radius:0; }
.ai-org-central-grid .ai-team-card:last-child { border-right:0; }
.ai-org-central-grid .ai-team-card h3 { margin:2px 0; color:#17234f; font-size:14px; }
.ai-org-central-grid .ai-team-card p { margin:0; color:#5f7180; font-size:12px; line-height:1.45; }
.ai-team-profile-dialog { width:min(620px,calc(100vw - 28px)); max-height:calc(100vh - 28px); padding:0; border:0; border-radius:8px; box-shadow:0 20px 60px rgba(14,35,53,.28); }
.ai-team-profile-dialog::backdrop { background:rgba(12,30,45,.45); }
.ai-team-profile { display:grid; gap:16px; padding:22px; background:#fff; }
.ai-team-profile header { display:grid; grid-template-columns:132px minmax(0,1fr); gap:18px; align-items:center; }
.ai-team-profile-avatar { width:128px; height:128px; border-radius:50%; object-fit:cover; object-position:center 18%; }
.ai-team-profile h2 { margin:3px 0; }
.ai-team-profile header p, .ai-team-profile section p, .ai-team-profile blockquote { margin:4px 0; color:#5f7180; }
.ai-team-profile blockquote { margin:0; padding:13px 16px; border-left:3px solid #1aa875; background:#f2faf7; font-weight:600; }
.ai-team-profile section { padding-top:12px; border-top:1px solid #e4ecec; }
.ai-team-profile section h3 { margin:0 0 5px; font-size:13px; }
.ai-team-profile section ul { margin:0; padding-left:18px; }
.ai-team-profile .ai-team-tool-list { display:flex; flex-wrap:wrap; gap:7px; padding-left:0; list-style:none; }
.ai-team-profile .ai-team-tool-list code { display:inline-block; padding:4px 6px; border:1px solid #dce8e7; border-radius:4px; background:#f5faf9; color:#174b42; font-size:11px; }
.ai-team-profile-close { justify-self:end; }
@media (max-width: 1180px) { .ai-org-departments { grid-template-columns:1fr; } .ai-org-central-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .ai-org-central-grid .ai-team-card:nth-child(2) { border-right:0; } .ai-org-central-grid .ai-team-card:nth-child(-n+2) { border-bottom:1px solid #e4ecec; } }
@media (max-width: 760px) { .ai-office-tabs { margin-left:-4px; margin-right:-4px; } .ai-office-tabs button { padding:11px 12px; font-size:12px; } .ai-team-intro { display:block; } .ai-org-handover { grid-template-columns:1fr; gap:6px; padding:13px; } .ai-org-people { grid-template-columns:1fr; } .ai-org-staff { grid-template-columns:1fr; } .ai-human-card { grid-template-columns:96px minmax(0,1fr); gap:14px; } .ai-human-card .ai-team-avatar { width:96px; height:96px; } .ai-org-central-grid { grid-template-columns:1fr; } .ai-org-central-grid .ai-team-card, .ai-org-central-grid .ai-team-card:nth-child(2) { min-height:auto; border-right:0; border-bottom:1px solid #e4ecec; } .ai-org-central-grid .ai-team-card:last-child { border-bottom:0; } .ai-team-profile { padding:16px; } }
@media (max-width: 480px) { .ai-human-card { grid-template-columns:1fr; } .ai-human-card .ai-team-avatar { width:112px; height:112px; } }
@media print { .app-sidebar, .site-sidebar, .ai-office-tabs, .ai-team-card button, .ai-team-profile-dialog { display:none !important; } .ai-org-chart, .ai-org-departments { display:block; } .ai-human-card, .ai-team-card, .ai-org-department, .ai-org-quality { break-inside:avoid; margin:0 0 12px; box-shadow:none; } }

/* Digital office workflow and tool approval surfaces. */
.ai-workflow-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:start; }
.ai-workflow-card .ai-tool-actions { grid-column:1 / -1; border-top:1px solid var(--line,#dbe5eb); padding-top:14px; }
.ai-workflow-card h2, .ai-tool-actions h3 { margin:3px 0 8px; }
.ai-workflow-error { color:#b42318; margin:6px 0 0; }
.ai-tool-action, .ai-workflow-list article { display:flex; justify-content:space-between; gap:14px; align-items:center; padding:11px 0; border-top:1px solid var(--line,#dbe5eb); }
.ai-tool-action small, .ai-tool-action p, .ai-workflow-list small { display:block; margin:3px 0 0; color:var(--text-muted,#697586); }
.ai-tool-action > div:last-child { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.ai-workflow-settings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-content:start; }
.ai-workflow-settings .card-head-inline, .ai-workflow-settings > button { grid-column:1 / -1; }
.ai-workflow-settings label { display:grid; gap:5px; font-size:13px; }
.ai-settings-heading { grid-column:1 / -1; display:flex; justify-content:space-between; align-items:flex-start; gap:18px; }
.ai-settings-heading h2 { margin:3px 0 5px; }
.ai-settings-heading p { margin:0; }
.ai-automation-toggle { display:flex !important; align-items:center; gap:8px; white-space:nowrap; padding:8px 10px; border:1px solid var(--line,#dbe5eb); border-radius:6px; background:#f8fbfa; }
.ai-usage-card { display:grid; gap:14px; }
.ai-usage-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.ai-usage-grid article { display:grid; gap:4px; padding:14px; border:1px solid var(--line,#dbe5eb); border-radius:6px; background:#fbfcfd; }
.ai-usage-grid strong { font-size:24px; }
.ai-usage-grid b { color:var(--text,#17213f); font-size:14px; }
.ai-usage-card > small { color:var(--text-muted,#697586); }
.ai-pricing-details { display:grid; gap:10px; padding:14px; border:1px solid var(--line,#dbe5eb); border-radius:6px; background:#fbfcfd; }
.ai-pricing-details h3 { margin:2px 0 0; font-size:15px; }
.ai-pricing-details p { margin:0; }
.ai-pricing-details > a { width:max-content; font-size:13px; }
.ai-pricing-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:8px; }
.ai-pricing-grid article { display:grid; gap:3px; padding:10px; border-left:3px solid var(--accent,#23aa75); background:#fff; }
.ai-pricing-grid small { color:var(--text-muted,#697586); }
.ai-routing-overview { display:grid; gap:10px; padding:14px; border:1px solid #b9e2d2; border-radius:6px; background:#f7fcf9; }
.ai-routing-overview h3 { margin:2px 0 0; font-size:15px; }
.ai-routing-overview p { margin:0; }
.ai-routing-overview a { font-size:13px; }
.ai-routing-settings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:14px; border:1px solid var(--line,#dbe5eb); border-radius:6px; background:#fbfcfd; }
.ai-routing-settings > div, .ai-routing-settings > button { grid-column:1 / -1; }
.ai-routing-settings h3 { margin:2px 0 4px; font-size:15px; }
.ai-routing-settings p { margin:0; }
.ai-routing-settings label { display:grid; gap:5px; font-size:13px; }
.ai-usage-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:10px 14px; border:1px solid var(--line,#dbe5eb); border-radius:6px; background:#fbfcfd; font-size:13px; }
.ai-usage-summary > small { width:100%; color:var(--text-muted,#697586); }
.ai-agent-limit-card { grid-column:1 / -1; }
.ai-agent-limit-list { display:grid; gap:8px; }
.ai-agent-limit-list article { display:grid; grid-template-columns:minmax(180px,1fr) minmax(150px,220px) auto; gap:10px; align-items:end; padding:10px 0; border-top:1px solid var(--line,#dbe5eb); }
.ai-agent-limit-list label { display:grid; gap:5px; font-size:13px; }
.ai-agent-limit-list label:first-child { display:flex; align-items:center; gap:8px; font-weight:600; }
.ai-office-kpis .is-positive { border-color:#92d9bd; }
.ai-office-kpis .is-danger { border-color:#e79b9b; background:#fff8f8; }
@media (max-width:760px) { .ai-workflow-card { grid-template-columns:1fr; } .ai-workflow-settings { grid-template-columns:1fr; } .ai-tool-action, .ai-workflow-list article { align-items:flex-start; flex-direction:column; } }
@media (max-width:760px) { .ai-settings-heading { align-items:stretch; flex-direction:column; } .ai-usage-grid, .ai-routing-settings { grid-template-columns:1fr; } .ai-agent-limit-list article { grid-template-columns:1fr; align-items:stretch; } }

/* Digitales Büro: nachvollziehbare KI-Arbeit bleibt eine eigene, ruhige Arbeitsfläche. */
.digital-office-project,
#digitalOfficePanel {
    display: grid;
    gap: 18px;
}
.ai-office-hero,
.ai-run-overview,
.ai-office-approval {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.ai-office-hero h2,
.ai-run-overview h2,
.ai-office-approval h2 {
    margin: 3px 0 7px;
}
.ai-office-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.ai-customer-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.ai-customer-action-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.5fr) auto;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 760px;
}

.ai-customer-draft-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.ai-customer-draft-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.ai-customer-draft-form label:last-child {
    grid-column: 1 / -1;
}

.ai-customer-draft textarea {
    min-height: 180px;
    resize: vertical;
}

.ai-question-count {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #916715;
}

.ai-customer-disclaimer {
    margin: 15px 0 0;
    font-size: 12px;
    color: #5f7180;
}
.ai-office-policy {
    padding: 12px 14px;
    border-left: 3px solid #23ae7a;
    background: #edf8f4;
    color: #285a49;
    font-size: 13px;
}
.ai-office-policy.is-warning {
    border-left-color: #d19419;
    background: #fff8df;
    color: #735106;
}
.ai-office-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ai-office-kpis article {
    display: grid;
    gap: 5px;
    min-height: 116px;
    padding: 17px;
}
.ai-office-kpis span,
.ai-office-kpis small,
.ai-run-overview small {
    color: #68758c;
    font-size: 12px;
}
.ai-office-kpis strong {
    color: #17234f;
    font-size: 31px;
    line-height: 1;
}
.ai-office-dashboard-grid,
.ai-office-project-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}
.ai-office-dashboard-grid .ai-office-activity-card {
    grid-column: span 2;
}
.ai-run-list,
.ai-agent-list,
.ai-artifact-list {
    display: grid;
    gap: 9px;
}
.ai-run-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #e7eef0;
}
.ai-run-list article:last-child { border-bottom: 0; }
.ai-run-list strong,
.ai-run-list small,
.ai-agent-list span,
.ai-agent-list small {
    display: block;
}
.ai-run-list strong { color: #17234f; }
.ai-run-list small,
.ai-agent-list small { margin-top: 3px; color: #68758c; }
.ai-run-list button { padding: 7px 10px; font-size: 12px; }
.ai-agent-list article {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 5px;
    background: #f5f8f8;
}
.ai-agent-list span { font-weight: 700; color: #17234f; }
.ai-agent-list small { text-align: right; }
.ai-run-overview > div:last-child {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: 180px;
}
.ai-status {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
    color: #506171;
    background: #edf1f3;
}
.ai-status-running,
.ai-status-queued { color: #126b54; background: #dcf4e9; }
.ai-status-awaiting-approval { color: #805501; background: #fff0bd; }
.ai-status-needs-human-input,
.ai-status-rejected { color: #9a5213; background: #fff0df; }
.ai-status-approved { color: #146a51; background: #dff5ea; }
.ai-status-failed { color: #9e2929; background: #fee8e8; }
.ai-artifact-card {
    padding: 15px;
    border: 1px solid #dbe5e7;
    border-left: 4px solid #24aa77;
    border-radius: 6px;
    background: #fff;
}
.ai-artifact-card header,
.ai-artifact-card footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}
.ai-artifact-card h3 { margin: 3px 0 0; font-size: 16px; }
.ai-artifact-card p { margin: 12px 0 0; white-space: pre-line; }
.ai-artifact-card ul { margin: 10px 0 0; padding-left: 20px; }
.ai-artifact-card li { margin: 4px 0; }
.ai-artifact-card footer { margin-top: 14px; color: #68758c; font-size: 11px; }
.ai-artifact-next { margin-top: 12px; padding: 10px; background: #f3faf7; }
.ai-office-input textarea { width: 100%; margin: 8px 0 10px; }
.ai-office-empty { text-align: center; padding: 36px; }
.ai-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.ai-timeline li { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 0 0 16px; }
.ai-timeline li::before { content: ''; position: absolute; top: 16px; bottom: 0; left: 7px; border-left: 1px solid #d9e5e2; }
.ai-timeline li:last-child::before { display: none; }
.ai-timeline-dot { width: 14px; height: 14px; margin-top: 2px; border: 3px solid #fff; border-radius: 50%; background: #20a976; box-shadow: 0 0 0 1px #bad9cd; }
.ai-timeline p { margin: 3px 0; }
.ai-timeline small { color: #68758c; }
.ai-office-message.error { border-left: 4px solid #cf4545; }
.ai-modeling-action { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.ai-modeling-brief h2 { font-size:34px; margin:3px 0; color:#17234f; }
.ai-modeling-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:16px; }
.ai-modeling-grid label, .ai-modeling-grid article { display:block; padding:10px 0; border-bottom:1px solid #e7eef0; }
.ai-modeling-grid label { cursor:pointer; }
.ai-modeling-grid label.is-complete strong { color:#5d7180; text-decoration:line-through; }
.ai-modeling-grid label input { margin-right:7px; accent-color:#13a875; }
.ai-modeling-questions { margin-top:16px; padding-top:12px; border-top:1px solid #dbe7e7; }
.ai-modeling-questions button { margin-top:8px; font-size:12px; }
.ai-modeling-actions { margin-top:18px; justify-content:flex-end; }
.ai-renovation-intro,.ai-renovation-packages,.ai-renovation-open,.ai-isfp-quality { margin-top:16px; padding:14px; border:1px solid #dce7e8; background:#f7faf9; }
.ai-renovation-intro h3,.ai-renovation-packages h3,.ai-renovation-open h3 { margin:0 0 7px; }
.ai-renovation-measures { display:grid; gap:16px; margin-top:16px; }
.ai-renovation-measure { border:1px solid #d9e6e7; padding:16px; background:#fff; }
.ai-renovation-measure > header { display:flex; justify-content:space-between; gap:16px; align-items:start; border-bottom:1px solid #e6eeee; padding-bottom:10px; }
.ai-renovation-measure h3,.ai-renovation-measure h4 { margin:3px 0; }
.ai-renovation-columns,.ai-isfp-draft-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:14px; }
.ai-renovation-columns strong { display:block; font-size:12px; color:#526577; }
.ai-renovation-columns p,.ai-renovation-columns ul { margin:4px 0 12px; }
.ai-technical-check { display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:12px; padding:10px; font-size:13px; }
.ai-technical-check strong { width:100%; }
.ai-technical-check.is-complete,.ai-isfp-quality.is-complete { background:#edf8f2; border-left:3px solid #23a875; }
.ai-technical-check.is-incomplete,.ai-isfp-quality.is-incomplete { background:#fff4f4; border-left:3px solid #db4b4b; }
.ai-technical-check small { width:100%; color:#a42828; }
.ai-variants { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-top:14px; }
.ai-variants > strong { grid-column:1/-1; }
.ai-variants article,.ai-renovation-packages article,.ai-isfp-draft article { padding:11px; border:1px solid #e1e9eb; background:#fbfdfd; }
.ai-variants p,.ai-isfp-draft p { margin:6px 0; font-size:13px; }
.ai-measure-actions { margin-top:14px; }
.ai-isfp-draft-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ai-isfp-draft-grid h3 { margin-top:0; }
.ai-funding-source-state { display:flex; justify-content:space-between; gap:14px; margin:16px 0; padding:11px 13px; background:#f4f7f8; border-left:3px solid #5e7890; font-size:13px; }
.ai-funding-source-state.current { border-left-color:#20a672; background:#edf8f2; }
.ai-funding-source-state.stale { border-left-color:#d99a20; background:#fff8e8; }
.ai-funding-source-state.source_unavailable { border-left-color:#d84949; background:#fff2f2; }
.ai-funding-results { display:grid; gap:12px; }
.ai-funding-result { padding:14px; border:1px solid #dde7e9; border-left:4px solid #718593; background:#fff; }
.ai-funding-result.confirmed_current { border-left-color:#24a874; }
.ai-funding-result.possibly_eligible,.ai-funding-result.needs_review { border-left-color:#d79c23; }
.ai-funding-result.not_eligible,.ai-funding-result.source_unavailable { border-left-color:#db4b4b; }
.ai-funding-result header { display:flex; justify-content:space-between; gap:16px; align-items:start; }
.ai-funding-result header h3,.ai-funding-result header p { margin:0; }
.ai-funding-result header span { display:inline-block; margin-right:8px; font-size:18px; }
.ai-funding-values { display:flex; flex-wrap:wrap; gap:8px 18px; margin:10px 0; padding:8px 0; border-top:1px solid #edf1f2; border-bottom:1px solid #edf1f2; font-size:13px; }
.ai-funding-result > p { margin:8px 0; font-size:13px; }
.ai-funding-sources { display:grid; gap:4px; margin-top:7px; font-size:12px; color:#5f7180; }
.ai-funding-sources a { color:#087e61; }
.ai-funding-disclaimer { margin:16px 0 0; font-size:12px; color:#5f7180; }
.ai-modeling-grid small, .ai-modeling-areas small { display:block; margin-top:3px; color:#68758c; }
.ai-modeling-grid p { margin:4px 0; }
.ai-modeling-areas { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:16px; }
.ai-modeling-areas section { padding:12px; background:#f5f8f8; }
.ai-modeling-areas h3 { margin:0 0 9px; font-size:14px; }
.ai-modeling-areas p { margin:7px 0; font-size:13px; }

@media (max-width: 980px) {
    .ai-office-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-office-dashboard-grid,
    .ai-office-project-grid { grid-template-columns: 1fr; }
    .ai-office-dashboard-grid .ai-office-activity-card { grid-column: auto; }
}
@media (max-width: 640px) {
    .ai-office-hero,
    .ai-run-overview,
    .ai-office-approval { align-items: stretch; flex-direction: column; }
    .ai-office-actions { justify-content: stretch; }
    .ai-office-actions button { flex: 1 1 auto; }
    .ai-office-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
    .ai-office-kpis article { min-height: 96px; padding: 13px; }
    .ai-run-overview > div:last-child { justify-items: start; min-width: 0; }
    .ai-artifact-card header { align-items: flex-start; flex-direction: column; }
    .ai-modeling-action { align-items:stretch; flex-direction:column; }
    .ai-customer-action { align-items: stretch; flex-direction: column; }
    .ai-customer-action-controls,
    .ai-customer-draft-form { grid-template-columns: 1fr; }
    .ai-customer-draft-form label:last-child { grid-column: auto; }
    .ai-modeling-grid, .ai-modeling-areas, .ai-renovation-columns, .ai-isfp-draft-grid { grid-template-columns:1fr; }
    .ai-funding-source-state { flex-direction:column; }
}

/* Large desktop workspace: fixed, readable dimensions for 4K monitors. */
@media (min-width: 2400px) {
    :root {
        --app-sidebar-width: 276px;
        --app-mobile-bar-height: 64px;
    }

    body { font-size: 17px; }

    .app-sidebar.topbar {
        padding: 28px 20px 22px;
        gap: 24px;
    }
    .app-sidebar .brand { padding: 0 10px 20px; }
    .app-sidebar .brand img { width: 162px; }
    .app-sidebar nav { gap: 5px; }
    .app-sidebar nav .nav-section-label {
        margin: 20px 11px 7px;
        font-size: 11px;
    }
    .app-sidebar nav button {
        min-height: 46px;
        padding: 10px 14px;
        font-size: 13px;
    }
    .app-sidebar .session-area { padding: 18px 10px 0; gap: 10px; }
    .app-sidebar .current-user { font-size: 13px; }

    .page-head { gap: 20px; margin-bottom: 28px; }
    h1:not(:where(.codex-console *)) { margin-bottom: 18px; font-size: 34px; }
    h1:not(:where(.codex-console *))::before { width: 48px; height: 4px; margin-bottom: 14px; }
    h2:not(:where(.codex-console *)) { font-size: 22px; }

    input, select, textarea { padding: 14px 16px; }
    button:not(:where(.codex-console *)) { padding: 12px 18px; font-size: 14px; }
    .toolbar { gap: 16px; margin-bottom: 22px; padding: 18px; }
    .dashboard-grid, .cards, .two-col { gap: 28px; }
    .card, .table-card { padding: 30px; }
    .card h2, .table-card h2 { margin-bottom: 20px; font-size: 22px; }
    th, td { padding: 15px 16px; }

    .project-overview-header, .project-overview-row { gap: 16px; }
    .project-overview-header { min-height: 48px; padding: 8px 16px; }
    .project-overview-header > span,
    .project-overview-sort { font-size: 11px; }
    .project-overview-row { min-height: 88px; padding: 12px 16px; }
    .project-overview-reference { font-size: 13px; }
    .project-overview-type,
    .project-overview-status,
    .project-overview-progress small,
    .project-overview-date { font-size: 11px; }
    .project-overview-party button { font-size: 14px; }
    .project-overview-party small,
    .project-overview-address,
    .project-overview-team,
    .project-overview-task,
    .project-overview-created { font-size: 12px; }
    .project-overview-progress .progress { height: 8px; }
    .project-overview-actions button { min-height: 38px; padding: 8px 11px; font-size: 11px; }
}

@media (min-width: 3200px) {
    body { font-size: 18px; }
    .app-sidebar.topbar { padding: 32px 22px 26px; }
    .app-sidebar nav button { min-height: 50px; font-size: 14px; }
    h1:not(:where(.codex-console *)) { font-size: 38px; }
    h2:not(:where(.codex-console *)), .card h2, .table-card h2 { font-size: 24px; }
    input, select, textarea { padding: 15px 17px; }
    button:not(:where(.codex-console *)) { padding: 13px 20px; font-size: 15px; }
    .project-overview-row { min-height: 94px; }
}

/* Central contact management */
.contacts-toolbar { grid-template-columns: minmax(260px, 720px); }
.contact-project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.contact-project-links small { color: var(--muted); }
.link-button { width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; color: var(--blue); background: transparent; box-shadow: none; font-size: inherit; font-weight: 700; letter-spacing: 0; text-align: left; text-transform: none; }
.link-button:hover, .link-button:focus-visible { color: var(--green-2); background: transparent; text-decoration: underline; }
.compact-actions { flex-wrap: nowrap; }
.compact-actions button { min-height: 34px; padding: 7px 10px; }
.contact-modal-form > .muted { margin-top: 0; }
.contact-number { color: var(--blue); font-variant-numeric: tabular-nums; }
.contact-address-count { display: inline-flex; padding: 3px 6px; color: #187357; background: #e9f7f0; border-radius: 3px; font-size: 11px; font-weight: 800; }
.contact-address-list { display: grid; gap: 10px; }
.contact-address-editor { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.contact-address-editor legend { padding: 0 6px; color: var(--blue); font-size: 12px; font-weight: 800; }
.contact-address-primary { display: flex; align-items: center; gap: 8px; padding-top: 25px; color: var(--blue); font-weight: 700; }
.contact-address-primary input { width: auto; }
.contact-duplicate-list { display: grid; gap: 14px; }
.contact-duplicate-pair { padding: 14px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 6px; background: var(--surface-soft); }
.contact-duplicate-pair > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.contact-duplicate-pair > header span { color: var(--muted); font-size: 12px; }
.contact-duplicate-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-duplicate-card { display: grid; gap: 5px; padding: 12px; border: 1px solid #cbdcda; border-radius: 5px; background: #fff; }
.contact-duplicate-card span, .contact-duplicate-card small, .contact-duplicate-card em { color: var(--muted); font-size: 12px; font-style: normal; }
.contact-duplicate-card button { margin-top: 5px; }
.contact-bulk-merge { display: grid; gap: 14px; }
.contact-bulk-merge-selected { display: grid; gap: 4px; min-height: 44px; padding: 10px 12px; border: 1px solid #cbdcda; border-radius: 5px; background: var(--surface-soft); }
.contact-bulk-merge-selected span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.contact-bulk-merge-list { display: grid; max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 5px; }
.contact-bulk-merge-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.contact-bulk-merge-option:last-child { border-bottom: 0; }
.contact-bulk-merge-option:hover { background: var(--surface-soft); }
.contact-bulk-merge-option input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 auto; }
.contact-bulk-merge-option span { display: grid; gap: 2px; min-width: 0; }
.contact-bulk-merge-option small { color: var(--muted); }
.contact-create-actions { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; }
.contact-create-actions small { color: var(--muted); }
.new-project-contact { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #f8fbfa; }
.new-project-contact legend { padding: 0 6px; color: var(--blue); font-size: 12px; font-weight: 800; }
.contact-match-hint { margin-top: 10px; padding: 11px 12px; border: 1px solid #bfe6d7; border-left: 3px solid var(--green-2); border-radius: 6px; background: #f4fbf8; }
.contact-match-hint > strong, .contact-match-hint > span { display: block; }
.contact-match-hint > span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.contact-match-hint > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.contact-match-hint button { width: auto; min-height: 0; padding: 7px 9px; text-align: left; text-transform: none; letter-spacing: 0; }
.contact-match-hint button b, .contact-match-hint button small { display: block; }
.contact-match-hint button small { margin-top: 2px; font-size: 10px; font-weight: 500; }
.contact-search { position: relative; }
.contact-search input { width: 100%; }
.contact-suggestions { display: grid; gap: 2px; max-height: 280px; margin-top: 6px; overflow: auto; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 8px 18px rgba(17, 38, 77, .10); }
.contact-suggestions.hidden, .contact-suggestions[hidden] { display: none; }
.contact-suggestion { display: flex; width: 100%; min-height: 0; flex-direction: column; gap: 2px; padding: 9px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--blue); text-align: left; text-transform: none; letter-spacing: 0; }
.contact-suggestion:hover, .contact-suggestion:focus-visible { background: #edf8f4; outline: none; }
.contact-suggestion strong { font-size: 13px; }
.contact-suggestion small { color: var(--muted); font-size: 11px; font-weight: 500; }
.contact-suggestions-empty { margin: 3px 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
@media (max-width: 760px) {
    .contacts-toolbar { grid-template-columns: minmax(0, 1fr); }
    .compact-actions { flex-wrap: wrap; }
    .contact-create-actions { align-items: flex-start; flex-direction: column; gap: 6px; }
    .contact-duplicate-options { grid-template-columns: 1fr; }
    .contact-address-primary { padding-top: 0; }
}

/* Dashboard workspace */
.dashboard-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dashboard-hero h1 { margin: 4px 0; }
.dashboard-hero h1::before { display: none; }
.dashboard-hero p { margin: 0; color: var(--muted); }
.dashboard-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.dashboard-kpi { min-height: 130px; padding: 18px; display: grid; align-content: space-between; justify-items: start; color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-soft); text-align: left; text-transform: none; letter-spacing: 0; }
.dashboard-kpi:hover { color: var(--blue); background: #f7fbf9; border-color: #b9ddcf; transform: translateY(-1px); }
.dashboard-kpi span { color: var(--muted); font-size: 12px; font-weight: 700; }
.dashboard-kpi strong { margin: 4px 0; font-size: 36px; line-height: 1; }
.dashboard-kpi small { color: var(--muted); font-size: 12px; }
.dashboard-kpi.warning strong { color: #9a7200; }
.dashboard-kpi.danger { background: var(--danger); border-color: var(--danger); }
.dashboard-kpi.danger:hover { color: #fff; background: #c93838; border-color: #c93838; }
.dashboard-kpi.danger span, .dashboard-kpi.danger small { color: #ffe8e8; }
.dashboard-kpi.danger strong { color: #fff; }
.dashboard-widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.dashboard-widget { min-width: 0; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--ek-area-radius, 12px); box-shadow: var(--ek-area-shadow, 0 1px 2px rgba(33, 34, 74, .04)); }
.dashboard-widget > header { min-height: 38px; display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dashboard-widget h2 { margin: 2px 0 0; font-size: 18px; }
.dashboard-widget .section-kicker { display: block; color: var(--green-2); font-size: 10px; }
.dashboard-link { min-height: auto; padding: 3px 0; color: var(--green-2); background: transparent; border: 0; font-size: 11px; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.dashboard-link:hover { color: var(--blue); background: transparent; }
.dashboard-widget-tasks { grid-column: span 5; }
.dashboard-widget-alerts { grid-column: span 4; }
.dashboard-widget-time { grid-column: span 3; }
.dashboard-widget-week { grid-column: span 7; }
.dashboard-widget-status { grid-column: span 2; }
.dashboard-widget-absence { grid-column: span 3; }
.dashboard-widget-team, .dashboard-widget-approvals, .dashboard-widget-activity { grid-column: span 4; }
.dashboard-empty { margin: 10px 0; }
.dashboard-task { width: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; text-transform: none; letter-spacing: 0; }
.dashboard-task:hover { color: var(--blue); background: #f8fbfb; }
.dashboard-task > span:first-child { display: grid; gap: 3px; min-width: 0; }
.dashboard-task > span:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-task > span:first-child small, .dashboard-task-meta small { color: var(--muted); font-size: 11px; }
.dashboard-task-meta { display: grid; justify-items: end; gap: 5px; }
.dashboard-status { padding: 2px 6px; color: var(--blue); background: #eef3f4; border-radius: 3px; font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.dashboard-status.red { color: #a52b36; background: #fff0f1; }
.dashboard-status.yellow { color: #8a6500; background: #fff7d9; }
.dashboard-status.green { color: #147557; background: #e7f7ef; }
.dashboard-alert-list { display: grid; gap: 8px; }
.dashboard-alert { display: grid; gap: 2px; padding: 10px 11px; border-left: 3px solid var(--green); background: #f9fbfb; }
.dashboard-alert strong { color: var(--blue); font-size: 12px; }
.dashboard-alert span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.dashboard-alert.warn { border-left-color: var(--warn); }
.dashboard-alert.danger { border-left-color: var(--danger); }
.dashboard-clock { display: grid; gap: 5px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dashboard-clock strong { color: var(--blue); font-size: 20px; }
.dashboard-clock.running strong { color: var(--green-2); }
.dashboard-clock span { color: var(--muted); font-size: 12px; }
.dashboard-clock-action { width: 100%; margin-top: 14px; }
.dashboard-week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.dashboard-week-day { min-height: 108px; padding: 10px 7px; display: grid; align-content: start; justify-items: start; gap: 4px; color: var(--blue); background: #f8fbfb; border: 1px solid var(--line); border-radius: 4px; text-align: left; text-transform: none; letter-spacing: 0; }
.dashboard-week-day:hover { color: var(--blue); background: #edf8f4; }
.dashboard-week-day.today { border-color: var(--green); box-shadow: inset 0 3px 0 var(--green); }
.dashboard-week-day > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.dashboard-week-day strong { font-size: 22px; line-height: 1; }
.dashboard-week-day small { color: var(--muted); font-size: 10px; line-height: 1.25; }
.dashboard-week-day em { padding: 2px 4px; color: #776000; background: #fff4cc; border-radius: 2px; font-size: 9px; font-style: normal; font-weight: 800; }
.dashboard-status-list { display: grid; gap: 9px; }
.dashboard-status-row { width: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 56px 22px; gap: 7px; align-items: center; padding: 3px 0; color: var(--blue); background: transparent; border: 0; text-align: left; text-transform: none; letter-spacing: 0; }
.dashboard-status-row:hover { color: var(--green-2); background: transparent; }
.dashboard-status-row span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-status-row i { height: 6px; overflow: hidden; background: #e4ecee; border-radius: 99px; }
.dashboard-status-row b { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.dashboard-status-row strong { font-size: 12px; text-align: right; }
.dashboard-absence-list, .dashboard-team-list, .dashboard-approval-list, .dashboard-activity-list { display: grid; }
.dashboard-absence, .dashboard-team-row, .dashboard-approval, .dashboard-activity-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dashboard-absence:last-child, .dashboard-team-row:last-child, .dashboard-approval:last-child, .dashboard-activity-list > div:last-child { border-bottom: 0; }
.dashboard-absence { align-items: start; flex-direction: column; gap: 2px; border-left: 3px solid #8fcdb1; padding-left: 8px; }
.dashboard-absence.sick { border-left-color: #e78383; }
.dashboard-absence strong, .dashboard-team-row span, .dashboard-approval strong, .dashboard-activity-list strong { color: var(--blue); font-size: 12px; font-weight: 800; }
.dashboard-absence small, .dashboard-approval small, .dashboard-activity-list small { color: var(--muted); font-size: 11px; }
.dashboard-team-row strong { color: var(--muted); font-size: 11px; }
.dashboard-presence { width: 8px; height: 8px; display: inline-block; margin-right: 7px; background: var(--green); border-radius: 50%; }
.dashboard-presence.away { background: var(--warn); }
.dashboard-approval > span { display: grid; gap: 2px; min-width: 0; }
.dashboard-approval button { min-height: 30px; padding: 5px 8px; font-size: 10px; }
.dashboard-activity-list > div { align-items: start; flex-direction: column; gap: 2px; }
@media (max-width: 1180px) {
    .dashboard-widget-tasks { grid-column: span 6; }
    .dashboard-widget-alerts { grid-column: span 6; }
    .dashboard-widget-time, .dashboard-widget-status, .dashboard-widget-absence { grid-column: span 4; }
    .dashboard-widget-week { grid-column: span 12; }
}
@media (max-width: 760px) {
    .dashboard-hero { align-items: start; flex-direction: column; }
    .dashboard-hero-actions { width: 100%; justify-content: stretch; }
    .dashboard-hero-actions button { flex: 1; }
    .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-kpi { min-height: 112px; padding: 14px; }
    .dashboard-kpi strong { font-size: 30px; }
    .dashboard-widgets { grid-template-columns: 1fr; gap: 12px; }
    .dashboard-widget, .dashboard-widget-tasks, .dashboard-widget-alerts, .dashboard-widget-time, .dashboard-widget-week, .dashboard-widget-status, .dashboard-widget-absence, .dashboard-widget-team, .dashboard-widget-approvals, .dashboard-widget-activity { grid-column: auto; }
    .dashboard-widget { padding: 16px; }
    .dashboard-week-strip { overflow-x: auto; grid-template-columns: repeat(7, minmax(88px, 1fr)); padding-bottom: 3px; }
}

/* Large desktop workspaces: keep dashboard information readable on 4K displays. */
@media (min-width: 2400px) and (min-height: 1300px) {
    .dashboard-hero { margin-bottom: 30px; }
    .dashboard-hero h1 { font-size: 42px; }
    .dashboard-hero p { font-size: 17px; }
    .dashboard-hero-actions { gap: 14px; }
    .dashboard-hero-actions button { min-height: 48px; padding-inline: 20px; font-size: 14px; }
    .dashboard-kpis { gap: 20px; margin-bottom: 24px; }
    .dashboard-kpi { min-height: 174px; padding: 25px; }
    .dashboard-kpi span { font-size: 15px; }
    .dashboard-kpi strong { font-size: 50px; }
    .dashboard-kpi small { font-size: 14px; }
    .dashboard-widgets { gap: 22px; }
    .dashboard-widget { padding: 26px; }
    .dashboard-widget > header { min-height: 50px; margin-bottom: 18px; }
    .dashboard-widget h2 { font-size: 24px; }
    .dashboard-widget .section-kicker { font-size: 12px; }
    .dashboard-link { font-size: 13px; }
    .dashboard-task { gap: 16px; padding: 16px 0; }
    .dashboard-task > span:first-child strong { font-size: 16px; }
    .dashboard-task > span:first-child small, .dashboard-task-meta small { font-size: 13px; }
    .dashboard-status { font-size: 12px; }
    .dashboard-alert { padding: 14px 15px; }
    .dashboard-alert strong { font-size: 15px; }
    .dashboard-alert span { font-size: 13px; }
    .dashboard-clock { padding: 24px 0; }
    .dashboard-clock strong { font-size: 26px; }
    .dashboard-clock span { font-size: 14px; }
    .dashboard-clock-action { min-height: 48px; font-size: 14px; }
    .dashboard-week-day { min-height: 138px; padding: 14px 12px; }
    .dashboard-week-day > span { font-size: 12px; }
    .dashboard-week-day strong { font-size: 30px; }
    .dashboard-week-day small { font-size: 12px; }
    .dashboard-status-row { grid-template-columns: minmax(0, 1fr) 74px 30px; gap: 10px; padding: 6px 0; }
    .dashboard-status-row span, .dashboard-status-row strong { font-size: 14px; }
    .dashboard-status-row i { height: 8px; }
    .dashboard-absence, .dashboard-team-row, .dashboard-approval, .dashboard-activity-list > div { padding: 14px 0; }
    .dashboard-absence strong, .dashboard-team-row span, .dashboard-approval strong, .dashboard-activity-list strong { font-size: 14px; }
    .dashboard-absence small, .dashboard-approval small, .dashboard-activity-list small { font-size: 13px; }
}

/* Förderungsoptimierung */
.funding-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
    gap: 24px;
    align-items: stretch;
}

.funding-controls-card,
.funding-results,
.funding-comparison-card {
    min-width: 0;
}

.funding-controls-card .card-head-inline {
    margin-bottom: 20px;
}

.funding-controls-card .card-head-inline p {
    margin: 0;
}

.funding-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 16px;
}

.money-input {
    position: relative;
    min-width: 0;
}

.money-input input {
    padding-right: 42px;
}

.money-input span {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-weight: 800;
    pointer-events: none;
}

.funding-slider-block {
    margin-top: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    background: var(--surface-soft);
}

.funding-slider-head,
.funding-optimal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.funding-slider-head > div {
    display: grid;
    gap: 2px;
}

.funding-slider-head > div > span {
    color: var(--blue);
    font-weight: 800;
}

.funding-slider-head > strong {
    color: var(--green-2);
    font-size: 24px;
    white-space: nowrap;
}

.funding-saving-manual {
    width: 190px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-align: left;
}

.funding-saving-manual input {
    color: var(--green-2);
    font-size: 20px;
    font-weight: 800;
    text-align: right;
}

.funding-slider-block input[type="range"] {
    appearance: none;
    width: 100%;
    height: 8px;
    margin: 22px 0 18px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #dce7e7;
    accent-color: var(--green);
    cursor: pointer;
}

.funding-slider-block input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 2px 8px rgba(33, 34, 74, .25);
}

.funding-slider-block input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 2px 8px rgba(33, 34, 74, .25);
}

.funding-limit-note {
    display: grid;
    gap: 5px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #f2f7f8;
    color: var(--muted);
    font-size: 13px;
}

.funding-limit-note strong,
.funding-limit-note b {
    color: var(--blue);
}

.funding-results {
    display: grid;
    gap: 14px;
}

.funding-saving-card {
    display: grid;
    align-content: center;
    min-height: 152px;
    border-top: 4px solid var(--green);
}

.funding-saving-card > span {
    color: var(--muted);
    font-weight: 700;
}

.funding-saving-card > strong {
    margin: 4px 0;
    color: var(--blue);
    font-size: 36px;
    line-height: 1.15;
}

.funding-saving-card.is-positive {
    background: #f0faf6;
}

.funding-saving-card.is-positive > strong {
    color: var(--green-2);
}

.funding-saving-card.is-negative {
    border-top-color: var(--danger);
    background: #fff6f6;
}

.funding-saving-card.is-negative > strong {
    color: var(--danger);
}

.funding-tolerance-card {
    display: grid;
    gap: 16px;
    border-left: 4px solid var(--blue);
}

.funding-tolerance-card > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.funding-tolerance-card > div:first-child span {
    color: var(--muted);
    font-weight: 700;
}

.funding-tolerance-card > div:first-child strong {
    color: var(--blue);
    font-size: 28px;
    white-space: nowrap;
}

.funding-tolerance-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.funding-tolerance-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.funding-tolerance-card dt {
    color: var(--muted);
}

.funding-tolerance-card dd {
    margin: 0;
    color: var(--blue);
    font-weight: 800;
    text-align: right;
}

.funding-tolerance-card > small {
    color: var(--muted);
    line-height: 1.45;
}

.funding-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.funding-metrics .card {
    display: grid;
    gap: 4px;
    padding: 18px;
}

.funding-metrics span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.funding-metrics strong {
    color: var(--blue);
    font-size: 20px;
}

.funding-comparison-bar {
    position: relative;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: #dce7e7;
}

.funding-comparison-bar span {
    display: block;
    width: var(--funding-width, 0%);
    max-width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
    transition: width .2s ease;
}

.funding-comparison-card {
    margin-top: 24px;
}

.funding-comparison-head,
.funding-comparison-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.25fr) repeat(3, minmax(140px, 1fr));
    gap: 18px;
    align-items: center;
}

.funding-comparison-head {
    padding: 0 14px 10px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.funding-comparison-row {
    padding: 16px 14px;
    border-top: 1px solid var(--line);
}

.funding-comparison-row > div,
.funding-comparison-row > span {
    display: grid;
    gap: 2px;
}

.funding-comparison-row > span b {
    color: var(--blue);
    font-size: 17px;
}

.funding-comparison-row small {
    color: var(--muted);
}

.funding-comparison-row > span small::before {
    content: "Zuschuss: ";
}

.funding-own-row {
    margin-top: 4px;
    background: #f4faf8;
    border-left: 4px solid var(--green);
}

.funding-own-row > span b {
    color: var(--green-2);
    font-size: 19px;
}

.funding-own-row > span small::before {
    content: none;
}

.funding-disclaimer {
    margin: 18px 14px 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .funding-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .funding-input-grid,
    .funding-metrics {
        grid-template-columns: minmax(0, 1fr);
    }

    .funding-slider-head,
    .funding-optimal-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .funding-saving-manual {
        width: 100%;
    }

    .funding-tolerance-card > div:first-child {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .funding-comparison-head {
        display: none;
    }

    .funding-comparison-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .funding-comparison-row > div {
        grid-column: 1 / -1;
    }

    .funding-comparison-row > span::before {
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .funding-comparison-row > span:nth-child(2)::before {
        content: "Vorher";
    }

    .funding-comparison-row > span:nth-child(3)::before {
        content: "Optimiert";
    }

    .funding-comparison-row > span:nth-child(4)::before {
        content: "Optimiert Plus";
    }
}

@media (max-width: 760px) {
    .vacation-balance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .vacation-balance-grid {
        grid-template-columns: 1fr;
    }

    .vacation-team-details summary,
    .vacation-team-row {
        display: block;
    }

    .vacation-team-row strong {
        display: block;
        margin-top: 4px;
    }
}
.tb-concept-head{max-width:1100px}.tb-detail-row{display:grid;grid-template-columns:42px 1fr auto;gap:14px;align-items:center;padding:14px 0;border-bottom:1px solid var(--border,#dfe5ea)}.tb-order{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#edf7f3;color:#14845f;font-weight:700}.tb-material-row{display:grid;grid-template-columns:60px 1.2fr .7fr .6fr 1.5fr 42px;gap:8px;margin-bottom:8px}.check-label{display:flex!important;align-items:center;gap:8px;padding-top:28px}.check-label input{width:auto}.report-page{page-break-after:always}.tb-report-images{display:grid;grid-template-columns:1fr 1fr;gap:12px}.tb-report-images img{max-width:100%;max-height:260px;object-fit:contain}.tb-report-table{width:100%;border-collapse:collapse}.tb-report-table th,.tb-report-table td{border:1px solid #555;padding:5px;vertical-align:top}@media(max-width:900px){.tb-material-row{grid-template-columns:50px 1fr}.tb-material-row input:nth-child(n+3){grid-column:span 1}.tb-detail-row{grid-template-columns:36px 1fr}.tb-detail-row .button-row{grid-column:2}}

/* Wärmebrückenkonzept – Phase 2 Hotfix */
.tb-building-card{margin-bottom:16px}.tb-building-card summary{display:flex;justify-content:space-between;gap:16px;cursor:pointer;list-style:none}.tb-building-card summary::-webkit-details-marker{display:none}.tb-details-body{padding-top:18px}.tb-details-body h3{margin:18px 0 8px}.tb-image-selects{align-items:start}.tb-file-preview{height:150px;border:1px dashed var(--line);border-radius:8px;margin-top:8px;display:grid;place-items:center;overflow:hidden;color:var(--muted);background:#fafcfd}.tb-file-preview img{max-width:100%;max-height:100%;object-fit:contain}.tb-material-head,.tb-material-row{display:grid;grid-template-columns:64px minmax(180px,1.2fr) 110px 130px minmax(240px,1.7fr) 44px;gap:8px;align-items:start}.tb-material-head{font-size:12px;font-weight:700;color:var(--muted);padding:0 0 6px}.tb-material-row textarea{min-height:58px;resize:vertical}.tb-detail-row .button-row{flex-wrap:nowrap}dialog:has(#tb-materials){width:min(1120px,calc(100vw - 32px));max-height:94vh}dialog:has(#tb-materials) #modalForm{max-height:94vh;overflow:auto}dialog:has(#tb-materials) #modalBody{display:block}dialog:has(#tb-materials) #modalBody>.grid-2,dialog:has(#tb-materials) #modalBody>.grid-3{margin-bottom:14px}
.project-cost-estimation{display:grid;gap:16px}.project-cost-estimation>header{display:flex;justify-content:space-between;gap:20px;align-items:start;padding:20px;background:linear-gradient(135deg,#f4fbf8,#fff);border:1px solid #cfe7dd;border-radius:10px}.project-cost-estimation h2{margin:4px 0}.project-cost-estimation p{max-width:720px;margin:0;color:var(--muted)}.cost-estimation-total{min-width:180px;padding:14px 16px;border-left:3px solid var(--green);background:#fff}.cost-estimation-total span,.cost-estimation-total small{display:block;color:var(--muted);font-size:12px}.cost-estimation-total strong{display:block;font-size:24px;margin:4px 0}.cost-estimation-note{padding:12px 14px;border-left:3px solid #27a875;background:#edf9f4;color:#245a46}.cost-estimation-meta{display:flex;flex-wrap:wrap;gap:12px;color:var(--muted);font-size:12px}.cost-estimation-table{border:1px solid var(--line);border-radius:10px;overflow:hidden}.cost-estimation-row{display:grid;grid-template-columns:minmax(220px,1.35fr) minmax(140px,.75fr) minmax(170px,.8fr) 100px;gap:16px;align-items:center;padding:13px 16px;border-bottom:1px solid var(--line);background:#fff}.cost-estimation-row:last-child{border-bottom:0}.cost-estimation-row small{display:block;color:var(--muted);font-size:12px;margin-top:2px}.cost-estimation-heading{background:#f3f7f8;color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase}.cost-estimation-row input{margin:0;max-width:180px}.cost-source{display:inline-block;padding:3px 7px;border-radius:999px;font-size:12px}.cost-source-cad{background:#e7f3ee;color:#197252}.cost-source-manual{background:#fff5da;color:#926810}.project-cost-estimation form>footer{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-top:14px}.project-cost-estimation form>footer small{max-width:760px;color:var(--muted)}.cost-estimation-status{min-height:1.2em;margin:0;color:var(--green)}.cost-estimation-status.error{color:var(--danger)}@media(max-width:860px){.project-cost-estimation>header,.project-cost-estimation form>footer{display:block}.cost-estimation-total{margin-top:14px}.cost-estimation-row{grid-template-columns:1fr 1fr}.cost-estimation-heading{display:none}.cost-estimation-row>span:first-child{grid-column:span 2}.project-cost-estimation form>footer button{margin-top:12px}}

/* VIEWER-LAYER-ASSETS-V1: Materialmuster auch im globalen Tools-Viewer aktivieren.
   Die ursprünglichen Assets waren nur auf .ai-project-office/.project-cad-viewer-host gescoped. */
.tools-viewer-host .cad-layer-segment,
.tools-viewer-host .cad-layer-key-segment{display:block;min-width:0}
.tools-viewer-host .cad-layer-key{display:flex;overflow:hidden;border:1px solid rgba(27,43,52,.35);background:#fff}
.tools-viewer-host .cad-layer-air{background:radial-gradient(circle at 4px 4px,rgba(49,89,104,.55) 0 1px,transparent 1.5px) 0 0/11px 11px,#b9e0e8}
.tools-viewer-host .cad-layer-ventilated-air{background:repeating-linear-gradient(135deg,transparent 0 5px,rgba(54,102,117,.56) 5px 7px,transparent 7px 12px),#b9e0e8}
.tools-viewer-host .cad-layer-roof-covering{background:radial-gradient(ellipse at 7px 100%,transparent 0 5px,#4f5155 5.5px 6.5px,transparent 7px) 0 0/16px 9px,linear-gradient(#22252a,#34373b)}
.tools-viewer-host .cad-layer-underlay{background:repeating-linear-gradient(135deg,#6ea69a 0 2px,#d2e7df 2px 6px)}
.tools-viewer-host .cad-layer-vapour-control{background:repeating-linear-gradient(0deg,#326f80 0 2px,#77bec5 2px 4px)}
.tools-viewer-host .cad-layer-waterproofing{background:repeating-linear-gradient(0deg,#303439 0 3px,#595e63 3px 5px)}
.tools-viewer-host .cad-layer-brick{background:repeating-linear-gradient(0deg,#c9878c 0 8px,#f2bdc0 8px 10px),repeating-linear-gradient(90deg,transparent 0 18px,#81565c 18px 20px)}
.tools-viewer-host .cad-layer-render{background:repeating-linear-gradient(135deg,#ead6cc 0 4px,#f6e8de 4px 8px)}
.tools-viewer-host .cad-layer-insulation{background:repeating-linear-gradient(45deg,#eccd66 0 4px,#fff0aa 4px 8px)}
.tools-viewer-host .cad-layer-foam-insulation{background:radial-gradient(circle at 4px 4px,rgba(132,113,31,.45) 0 1px,transparent 1.5px) 0 0/9px 9px,#f7e599}
.tools-viewer-host .cad-layer-aerated-concrete{background:repeating-linear-gradient(135deg,#c8d0c0 0 7px,#9fa99d 7px 9px)}
.tools-viewer-host .cad-layer-concrete{background:radial-gradient(circle at 4px 4px,rgba(55,69,72,.42) 0 1px,transparent 1.5px) 0 0/10px 10px,#aeb5b2}
.tools-viewer-host .cad-layer-timber-frame{background:repeating-linear-gradient(90deg,#8f4e48 0 3px,#c98277 3px 12px,#9f5b53 12px 14px)}
.tools-viewer-host .cad-layer-timber-board{background:repeating-linear-gradient(0deg,#a86358 0 2px,#d49a8d 2px 8px)}
.tools-viewer-host .cad-layer-wood{background:repeating-linear-gradient(135deg,#9e625a 0 2px,#d8a296 2px 8px)}
.tools-viewer-host .cad-layer-gypsum{background:repeating-linear-gradient(135deg,#e5e7dd 0 5px,#f6f5ef 5px 9px)}
.tools-viewer-host .cad-layer-screed{background:linear-gradient(135deg,#9b99be,#817fa9)}
.tools-viewer-host .cad-layer-glass{background:linear-gradient(135deg,#a2f0f2,#20cddb)}
.tools-viewer-host .cad-layer-metal{background:repeating-linear-gradient(135deg,#aeb9bd 0 3px,#e4e8e7 3px 7px)}
.tools-viewer-host .cad-layer-soil{background:radial-gradient(circle at 4px 4px,rgba(81,57,35,.48) 0 1px,transparent 1.5px) 0 0/10px 10px,#a98967}
.tools-viewer-host .cad-layer-other{background:repeating-linear-gradient(135deg,#7f9d95 0 5px,#a9bbb5 5px 10px)}

/* VIEWER-LAYER-TEXT-WRAP-V1: PWA-/Viewport-feste Schichttexte ohne horizontalen Überlauf. */
.tools-viewer-host .cad-viewer-detail{
    overflow-y:auto;
    overflow-x:hidden;
}
.tools-viewer-host .cad-layer-layout,
.tools-viewer-host .cad-layer-layout>div,
.tools-viewer-host .cad-layer-list,
.tools-viewer-host .cad-layer-list li{
    min-width:0;
    max-width:100%;
}
.tools-viewer-host .cad-layer-list{
    overflow:hidden;
}
.tools-viewer-host .cad-layer-list-button{
    width:100%;
    max-width:100%;
    min-width:0;
    grid-template-columns:14px minmax(0,1fr) minmax(44px,52px);
    white-space:normal;
    overflow:hidden;
}
.tools-viewer-host .cad-layer-list-button>span:nth-child(2){
    min-width:0;
    max-width:100%;
    overflow:hidden;
}
.tools-viewer-host .cad-layer-list-button strong,
.tools-viewer-host .cad-layer-list-button small{
    min-width:0;
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
    hyphens:auto;
}
.tools-viewer-host .cad-layer-list-button strong{
    line-height:1.22;
}
.tools-viewer-host .cad-layer-list-button small{
    line-height:1.28;
}
.tools-viewer-host .cad-layer-list-button b{
    min-width:44px;
    max-width:52px;
    justify-self:end;
    align-self:start;
    overflow:hidden;
    text-overflow:clip;
    text-align:right;
    white-space:nowrap;
    font-variant-numeric:tabular-nums;
}
.tools-viewer-host .cad-layer-inspector,
.tools-viewer-host .cad-layer-inspector-materials,
.tools-viewer-host .cad-layer-inspector-materials>div,
.tools-viewer-host .cad-layer-technical-list,
.tools-viewer-host .cad-layer-technical-list li,
.tools-viewer-host .cad-layer-technical-list li>span{
    min-width:0;
    max-width:100%;
}
.tools-viewer-host .cad-layer-inspector-materials strong,
.tools-viewer-host .cad-layer-inspector-materials span,
.tools-viewer-host .cad-layer-technical-list strong,
.tools-viewer-host .cad-layer-technical-list small{
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
}
@media(max-width:767px){
    .tools-viewer-host .cad-viewer-detail{
        overflow-y:auto;
        overflow-x:hidden;
    }
    .tools-viewer-host .cad-layer-list-button{
        grid-template-columns:14px minmax(0,1fr) 46px;
        gap:6px;
        padding:7px 6px;
    }
    .tools-viewer-host .cad-layer-list-button b{
        min-width:42px;
        max-width:46px;
        font-size:9px;
    }
    .tools-viewer-host .cad-layer-list-button strong{
        font-size:10px;
    }
    .tools-viewer-host .cad-layer-list-button small{
        font-size:8.5px;
    }
}

/* VIEWER-BIMLIGHT-V1: responsiver technischer BIM-Light-Viewer */
.tools-viewer-host .cad-viewer-bimlight{gap:14px;min-height:0;padding:18px;border-radius:12px;background:#fff}
.tools-viewer-host .cad-viewer-titlebar{min-height:60px}.tools-viewer-host .cad-viewer-titlebar h2{margin:2px 0 4px;font-size:22px}.tools-viewer-host .cad-viewer-titlebar p{max-width:76ch}
.tools-viewer-host .cad-viewer-visibility{margin:0;border:1px solid #d8e2e5;border-radius:8px;background:#f8faf9}.tools-viewer-host .cad-viewer-visibility summary{min-height:38px;padding:9px 12px;display:flex;align-items:center;color:#17234f;font-size:12px;font-weight:800}.tools-viewer-host .cad-viewer-visibility>div{display:flex;flex-wrap:wrap;gap:7px;padding:0 10px 10px}.tools-viewer-host .cad-viewer-visibility button{min-height:38px;padding:7px 10px;display:inline-flex;align-items:center;gap:7px;border:1px solid #d5e0e3;border-radius:7px;color:#17234f;background:#fff;font-size:11px}.tools-viewer-host .cad-viewer-visibility button span{min-width:22px;padding:2px 5px;border-radius:999px;color:#08785a;background:#e4f5ee;text-align:center;font-size:10px}.tools-viewer-host .cad-viewer-visibility button.is-active{color:#fff;border-color:#18a873;background:#18a873}.tools-viewer-host .cad-viewer-visibility button.is-active span{color:#08785a;background:#fff}.tools-viewer-host .cad-viewer-visibility button.is-hidden{opacity:.52;text-decoration:none}
.tools-viewer-host .cad-viewer-metrics{gap:7px;margin:0}.tools-viewer-host .cad-viewer-metrics span{padding:5px 8px;border:1px solid #e0e7e9;border-radius:6px;background:#f6f9f9;font-size:11px}
.tools-viewer-host .cad-viewer-workspace{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,420px);gap:0;min-height:clamp(620px,calc(100vh - 330px),920px);overflow:hidden;border:1px solid #cbdadd;border-radius:10px;background:#f4f7f8}
.tools-viewer-host .cad-viewer-stage{position:relative;min-width:0;min-height:620px;overflow:hidden;background:radial-gradient(circle at 50% 42%,#fff 0,#f4f7f8 70%);touch-action:none}.tools-viewer-host .cad-viewer-canvas{position:absolute;inset:0;min-height:0;background:transparent}.tools-viewer-host .cad-viewer-canvas canvas{display:block;width:100%;height:100%;cursor:grab}.tools-viewer-host .cad-viewer-canvas canvas:active{cursor:grabbing}
.cad-viewer-stage-controls{position:absolute;z-index:6;top:12px;right:12px;display:grid;gap:5px;padding:5px;border:1px solid #d5dfe3;border-radius:9px;background:rgba(255,255,255,.94);box-shadow:0 6px 18px rgba(20,40,60,.10);backdrop-filter:blur(8px)}.cad-viewer-stage-controls button,.cad-viewer-presets button{width:42px;height:42px;min-height:42px;padding:0;display:grid;place-items:center;border:1px solid transparent;border-radius:7px;color:#17324c;background:transparent;font-size:15px;font-weight:800;text-transform:none;letter-spacing:0}.cad-viewer-stage-controls button:hover,.cad-viewer-presets button:hover,.cad-viewer-stage-controls button:focus-visible,.cad-viewer-presets button:focus-visible{color:#08785a;border-color:#b7ded0;background:#eaf8f3;outline:none}
.cad-viewer-presets{position:absolute;z-index:6;left:50%;bottom:12px;transform:translateX(-50%);display:flex;gap:3px;padding:5px;border:1px solid #d5dfe3;border-radius:9px;background:rgba(255,255,255,.94);box-shadow:0 6px 18px rgba(20,40,60,.10);backdrop-filter:blur(8px)}.cad-viewer-presets button{width:auto;min-width:39px;padding:0 9px;font-size:11px}.cad-viewer-overlay-visibility{display:none}
.tools-viewer-host .cad-viewer-detail{min-width:0;min-height:0;max-height:clamp(620px,calc(100vh - 330px),920px);overflow:auto;padding:17px;border-left:1px solid #cbdadd;background:#fff}.cad-viewer-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.cad-viewer-detail-head h3{margin:3px 0 0;font-size:20px}.cad-viewer-detail-close{display:none;width:40px;height:40px;padding:0;border-radius:999px;color:#415468;background:#edf2f3;font-size:22px}
.cad-viewer-detail-values{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin:14px 0!important}.cad-viewer-detail-values>div{min-width:0;padding:10px 11px;border:1px solid #e1e8ea;border-radius:7px;background:#f6f9f9}.cad-viewer-detail-values dt{color:#68758a;font-size:10px;font-weight:800;text-transform:uppercase}.cad-viewer-detail-values dd{margin:4px 0 0;color:#17234f;font-size:13px;font-weight:800;overflow-wrap:anywhere}
.cad-viewer-detail-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:4px 0 13px;border-bottom:1px solid #dce5e8}.cad-viewer-detail-tabs button{min-height:40px;padding:8px 9px;color:#526276;border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;font-size:11px}.cad-viewer-detail-tabs button.is-active{color:#08785a;border-bottom-color:#18a873;background:#f0faf6}.cad-viewer-detail-panel[hidden]{display:none!important}
.cad-viewer-semantic-status{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline}.cad-viewer-variants article>div{display:grid;gap:3px}.cad-viewer-variants article span,.cad-viewer-variants article small{display:block}
.cad-layer-direction{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px;color:#657187;font-size:10px;letter-spacing:.04em}.cad-layer-direction span{flex:1;height:1px;display:flex;align-items:center;justify-content:center;color:#18a873;background:#dbe6e4;font-size:13px}
.cad-layer-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;align-items:stretch}.cad-layer-layout>div:first-child{min-width:0;overflow-x:auto;padding:2px 2px 8px;scrollbar-width:thin}.cad-layer-visual-stack{display:flex;flex-direction:row;width:max(100%,520px);height:112px;overflow:hidden;border:1px solid #8fa0a7;border-radius:5px;background:#fff;box-shadow:inset 0 0 0 3px rgba(255,255,255,.35)}.cad-layer-visual-band{position:relative;min-width:38px;height:100%;padding:0;display:flex;overflow:hidden;border:0;border-right:1px solid rgba(36,58,66,.25);border-radius:0;background:#fff;box-shadow:none}.cad-layer-visual-band:last-child{border-right:0}.cad-layer-visual-band:hover,.cad-layer-visual-band.is-selected{outline:2px solid #18a873;outline-offset:-2px;z-index:1}.cad-layer-visual-band .cad-layer-segment{min-width:3px;height:100%}.cad-layer-visual-empty{width:100%;min-height:96px;display:grid;place-items:center;padding:8px;border:1px dashed #b9c8ce;color:#768494;background:#f7f9fa;font-size:10px;text-align:center}
.cad-layer-list{display:grid!important;align-content:start;gap:5px!important;margin:0!important;padding:0!important;list-style:none!important}.cad-layer-list li{display:block!important;padding:0!important;border:0!important}.cad-layer-list-button{width:100%;min-height:38px;display:grid;grid-template-columns:14px minmax(0,1fr) auto;gap:7px;align-items:start;padding:6px 7px;border:1px solid #e0e7e9;border-radius:5px;color:#17234f;background:#fff;text-align:left;text-transform:none;letter-spacing:0}.cad-layer-list-button:hover,.cad-layer-list-button.is-selected{border-color:#84cdb4;background:#edf8f4}.cad-layer-list-button .cad-layer-key{width:14px;height:28px;margin:0}.cad-layer-list-button strong,.cad-layer-list-button small{display:block;overflow-wrap:anywhere}.cad-layer-list-button strong{font-size:11px}.cad-layer-list-button small{margin-top:2px;color:#68758a;font-size:9px;line-height:1.25}.cad-layer-list-button b{color:#17234f;font-size:10px;white-space:nowrap}
.cad-layer-inspector{margin-top:10px;padding:10px 11px;border-left:3px solid #18a873;background:#f1faf6}.cad-layer-inspector-title{display:flex;justify-content:space-between;gap:10px;color:#08785a;font-size:11px}.cad-layer-inspector-materials{display:grid;gap:6px;margin-top:7px}.cad-layer-inspector-materials>div{display:flex;flex-wrap:wrap;gap:3px 9px}.cad-layer-inspector-materials strong{width:100%;font-size:12px}.cad-layer-inspector-materials span{color:#68758a;font-size:10px}.cad-layer-inspector-empty{margin:0;color:#68758a}
.cad-viewer-tech-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 14px}.cad-viewer-tech-values>div{min-width:0;padding:9px 10px;background:#f6f9f9}.cad-viewer-tech-values dt{color:#68758a;font-size:10px}.cad-viewer-tech-values dd{margin:3px 0 0;font-weight:800;overflow-wrap:anywhere}.cad-viewer-tech-heading{margin:8px 0 8px;font-size:13px}.cad-layer-technical-list{display:grid;gap:6px;margin:0;padding:0;list-style:none}.cad-layer-technical-list li{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:8px;padding:8px;border:1px solid #e0e7e9;background:#fff}.cad-layer-technical-list li>b{width:22px;height:22px;display:grid;place-items:center;border-radius:50%;color:#fff;background:#18a873;font-size:9px}.cad-layer-technical-list strong,.cad-layer-technical-list small{display:block}.cad-layer-technical-list small{margin-top:3px;color:#68758a;font-size:10px;line-height:1.35}.cad-layer-technical-list em{color:#17234f;font-size:10px;font-style:normal;font-weight:800;white-space:nowrap}
.cad-viewer-selection-peek{display:none}.cad-viewer-model-info-mobile{display:none}
.cad-viewer-workspace:fullscreen{width:100vw;height:100vh;max-width:none;max-height:none;border:0;border-radius:0;background:#f4f7f8}.cad-viewer-workspace:fullscreen .cad-viewer-stage{min-height:100vh}.cad-viewer-workspace:fullscreen .cad-viewer-detail{max-height:100vh}.cad-viewer-workspace:fullscreen .cad-viewer-overlay-visibility{position:absolute;z-index:8;top:12px;left:12px;display:block}.cad-viewer-overlay-visibility summary{width:max-content;min-height:42px;padding:10px 12px;border:1px solid #d5dfe3;border-radius:8px;background:rgba(255,255,255,.94);color:#17234f;font-weight:800;cursor:pointer}.cad-viewer-overlay-visibility>div{display:flex;flex-wrap:wrap;gap:5px;max-width:min(620px,70vw);margin-top:5px;padding:7px;border:1px solid #d5dfe3;border-radius:8px;background:rgba(255,255,255,.96)}.cad-viewer-overlay-visibility button{min-height:38px;padding:7px 9px;color:#17234f;border:1px solid #dce5e8;background:#fff;font-size:10px;text-transform:none}.cad-viewer-overlay-visibility button.is-active{color:#fff;border-color:#18a873;background:#18a873}.cad-viewer-overlay-visibility button span{margin-left:4px}
@media(min-width:1200px){.tools-viewer-host .cad-viewer-workspace{grid-template-columns:minmax(0,1fr) minmax(360px,420px)}}
@media(min-width:1020px) and (max-width:1199px) and (orientation:landscape){.tools-viewer-host .cad-viewer-workspace{grid-template-columns:minmax(0,1fr) minmax(320px,360px);min-height:620px}.tools-viewer-host .cad-viewer-stage{min-height:620px}.tools-viewer-host .cad-viewer-detail{max-height:620px}}
@media(min-width:768px) and (max-width:1199px){.tools-viewer-host .cad-viewer-bimlight{padding:15px}.tools-viewer-host .cad-viewer-workspace{min-height:0}.tools-viewer-host .cad-viewer-stage{min-height:clamp(500px,58vh,680px)}.tools-viewer-host .cad-viewer-detail{max-height:none;border-top:1px solid #cbdadd;border-left:0}.tools-viewer-host .cad-viewer-visibility>div{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin}.tools-viewer-host .cad-viewer-visibility button{flex:0 0 auto;min-height:44px}.cad-layer-visual-stack{height:108px}}
@media(max-width:1019px){.tools-viewer-host .cad-viewer-workspace{grid-template-columns:1fr}}
@media(max-width:767px){.tools-viewer-host .cad-viewer-bimlight{gap:10px;padding:10px;border-left-width:3px;border-radius:8px}.tools-viewer-host .cad-viewer-titlebar h2{font-size:19px}.tools-viewer-host .cad-viewer-titlebar p{font-size:12px;line-height:1.4}.tools-viewer-host .cad-viewer-visibility{overflow:hidden}.tools-viewer-host .cad-viewer-visibility summary{min-height:36px}.tools-viewer-host .cad-viewer-visibility>div{overflow-x:auto;flex-wrap:nowrap;padding-bottom:9px;scroll-snap-type:x proximity}.tools-viewer-host .cad-viewer-visibility button{flex:0 0 auto;min-height:44px;min-width:96px;scroll-snap-align:start;justify-content:center}.cad-viewer-metrics-desktop{display:none!important}.cad-viewer-model-info-mobile{display:block;border:1px solid #dce5e8;border-radius:7px;background:#fff}.cad-viewer-model-info-mobile summary{padding:10px 12px;color:#17234f;font-size:11px;font-weight:800;cursor:pointer}.cad-viewer-model-info-mobile .cad-viewer-metrics{padding:0 10px 10px}.tools-viewer-host .cad-viewer-workspace{overflow:visible;border-radius:8px}.tools-viewer-host .cad-viewer-stage{min-height:52vh;max-height:640px;border-radius:8px}.cad-viewer-stage-controls{top:9px;right:9px}.cad-viewer-stage-controls button{width:44px;height:44px}.cad-viewer-presets{left:10px;right:64px;bottom:10px;transform:none;overflow-x:auto;justify-content:flex-start}.cad-viewer-presets button{flex:0 0 auto;min-height:42px}.has-cad-selection .cad-viewer-presets{bottom:104px}.cad-viewer-selection-peek{position:absolute;z-index:7;left:10px;right:10px;bottom:10px;display:none;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:11px 12px;border:1px solid #b7ddd0;border-left:4px solid #18a873;border-radius:9px;background:rgba(255,255,255,.96);box-shadow:0 10px 28px rgba(19,42,56,.16);backdrop-filter:blur(9px)}.has-cad-selection .cad-viewer-selection-peek{display:grid}.cad-viewer-selection-peek strong,.cad-viewer-selection-peek small{display:block;min-width:0;overflow-wrap:anywhere}.cad-viewer-selection-peek strong{margin-top:2px;font-size:14px}.cad-viewer-selection-peek small{margin-top:2px;color:#68758a;font-size:10px}.cad-viewer-selection-peek button{min-height:42px;padding:8px 11px}.tools-viewer-host .cad-viewer-detail{position:fixed;z-index:58;left:8px;right:8px;bottom:calc(62px + env(safe-area-inset-bottom,0px));width:auto;max-width:none;max-height:min(74dvh,760px);min-height:280px;padding:17px;overflow:auto;border:1px solid #cbdadd;border-radius:16px 16px 10px 10px;background:#fff;box-shadow:0 -18px 50px rgba(17,35,55,.24);transform:translateY(calc(100% + 90px));transition:transform .22s ease}.is-detail-open .cad-viewer-detail{transform:translateY(0)}.tools-viewer-host .cad-viewer-detail::before{content:"";display:block;width:42px;height:4px;margin:-7px auto 10px;border-radius:99px;background:#9eabb2}.cad-viewer-detail-close{display:grid;place-items:center}.cad-viewer-detail-values{grid-template-columns:repeat(2,minmax(0,1fr))!important}.cad-layer-layout{grid-template-columns:78px minmax(0,1fr)}.cad-layer-visual-stack{width:78px;height:230px}.cad-viewer-tech-values{grid-template-columns:1fr 1fr}.cad-viewer-detail-tabs button{min-height:44px}.cad-layer-list-button{min-height:42px}.cad-viewer-workspace:fullscreen .cad-viewer-stage{min-height:100vh;max-height:none;border-radius:0}.cad-viewer-workspace:fullscreen .cad-viewer-detail{bottom:calc(8px + env(safe-area-inset-bottom,0px))}.cad-viewer-workspace:fullscreen .cad-viewer-overlay-visibility{top:9px;left:9px}.cad-viewer-workspace:fullscreen .cad-viewer-overlay-visibility>div{max-width:calc(100vw - 90px);overflow-x:auto;flex-wrap:nowrap}.tools-viewer-host .cad-viewer-bimlight>footer{display:none}}
@media(max-width:430px){.tools-viewer-host .cad-viewer-bimlight{padding:8px}.tools-viewer-host .cad-viewer-stage{min-height:50vh}.cad-viewer-presets{right:60px}.cad-layer-visual-stack{height:100px}.cad-viewer-detail-values,.cad-viewer-tech-values{grid-template-columns:1fr 1fr!important;gap:6px!important}}

/* DAE/CAD V2: der fachliche Aufbau liest sich in jedem Viewport warm → kalt. */
@media(max-width:767px){.cad-layer-layout{grid-template-columns:minmax(0,1fr)}.cad-layer-visual-stack{width:max(100%,520px);height:100px}}


/* Project cost calculator V2 */
.project-cost-estimation{gap:14px;max-width:1560px;margin:0 auto;padding-bottom:72px}
.project-cost-estimation .cost-page-header{padding:18px 20px;border-color:#cfe3dc;background:linear-gradient(120deg,#f2fbf7 0,#fff 68%)}
.cost-page-header h2,.cost-panel h3{margin:3px 0 5px;color:var(--ink)}
.cost-header-meta{display:grid;justify-items:end;gap:5px;min-width:260px;color:var(--muted);font-size:12px;text-align:right}
.cost-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.cost-summary article{padding:14px 16px;border:1px solid var(--line);border-radius:8px;background:#fff}
.cost-summary span{display:block;margin-bottom:5px;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.035em;text-transform:uppercase}
.cost-summary strong{font-size:21px;color:var(--ink)}
.cost-summary .cost-summary-primary{border-color:#92d3ba;background:#f0faf6}
.cost-summary-primary strong{color:#087a53}
.cost-panel{border:1px solid var(--line);border-radius:9px;background:#fff;overflow:hidden}
.cost-panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:15px 17px;border-bottom:1px solid var(--line);background:#f7faf9}
.cost-panel-heading p{font-size:13px}
.cost-panel-heading>strong{font-size:20px}
.section-kicker{display:block;color:#0b9b6c;font-size:10px;font-weight:800;letter-spacing:.045em;text-transform:uppercase}
.cost-surface-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.cost-surface{display:grid;grid-template-columns:minmax(180px,1fr) minmax(150px,.7fr) 62px;align-items:center;gap:12px;padding:12px 16px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.cost-surface:nth-child(2n){border-right:0}
.cost-surface span:first-child{min-width:0}
.cost-surface b{font-size:13px}
.cost-surface small{display:block;margin-top:2px;color:var(--muted);font-size:11px}
.cost-source{text-align:center;font-style:normal;font-weight:700}
.cost-inline-note{padding:10px 16px!important;font-size:12px!important}
.cost-controls-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;padding:15px 17px}
.cost-control{display:grid;gap:6px;color:var(--muted);font-size:12px;font-weight:700}
.cost-control select,.cost-control input,.cost-surface input,.cost-measure input[type=number]{width:100%;margin:0;min-height:38px;border:1px solid #cad7d3;border-radius:6px;background:#fff;color:var(--ink)}
.cost-input-unit{display:flex;align-items:center;gap:7px;min-width:0}
.cost-input-unit>b{flex:none;color:var(--muted);font-size:11px;white-space:nowrap}
.cost-advanced{margin:0 17px 16px;border:1px solid var(--line);border-radius:7px;background:#fbfcfc}
.cost-advanced>summary{padding:11px 13px;color:var(--ink);font-size:12px;font-weight:800;cursor:pointer}
.cost-advanced .cost-controls-grid{grid-template-columns:repeat(4,minmax(150px,1fr));padding-top:6px}
.cost-engine-badge{padding:6px 9px;border-radius:999px;background:#e7f4ef;color:#167351;font-size:11px;font-weight:800;white-space:nowrap}
.cost-category-list{display:grid;gap:0}
.cost-category{border-bottom:1px solid var(--line)}
.cost-category:last-child{border-bottom:0}
.cost-category>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 17px;cursor:pointer;list-style:none}
.cost-category>summary::-webkit-details-marker{display:none}
.cost-category>summary span{display:flex;align-items:baseline;gap:10px}
.cost-category>summary small{color:var(--muted);font-size:11px;font-weight:500}
.cost-category>summary>b{color:#087a53;font-size:13px}
.cost-category[open]>summary{background:#f3f9f6}
.cost-measure-table{border-top:1px solid var(--line)}
.cost-measure-head,.cost-measure{display:grid;grid-template-columns:minmax(280px,1.6fr) minmax(130px,.62fr) minmax(105px,.5fr) minmax(105px,.5fr) minmax(105px,.5fr);gap:12px;align-items:center}
.cost-measure-head{padding:8px 17px;background:#f8faf9;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}
.cost-measure{padding:10px 17px;border-top:1px solid #edf1ef;background:#fff}
.cost-measure.is-selected{background:#f0faf6;box-shadow:inset 3px 0 #10a673}
.cost-measure-name{display:flex;align-items:flex-start;gap:10px;min-width:0}
.cost-measure-name input{flex:none;margin-top:3px}
.cost-measure-name strong{display:block;font-size:13px}
.cost-measure-name small{display:block;margin-top:3px;color:var(--muted);font-size:10px;line-height:1.35}
.cost-measure>span:not(.cost-measure-name):not(.cost-input-unit){font-size:12px;text-align:right}
.cost-measure .cost-extra{font-weight:800;color:#087a53}
.cost-calculation-note{display:flex;gap:12px;padding:11px 14px;border-left:3px solid #17a575;background:#edf9f4;color:#285d4b;font-size:12px}
.cost-calculation-note strong{flex:none}
.project-cost-estimation .cost-estimation-footer{position:sticky;bottom:0;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0;padding:12px 15px;border:1px solid #cbd9d4;border-radius:8px;background:rgba(255,255,255,.96);box-shadow:0 -8px 22px rgba(18,42,34,.08);backdrop-filter:blur(8px)}
.cost-estimation-status{font-size:12px;font-weight:700}

@media(max-width:1150px){
  .cost-controls-grid,.cost-advanced .cost-controls-grid{grid-template-columns:repeat(3,minmax(150px,1fr))}
  .cost-measure-head,.cost-measure{grid-template-columns:minmax(240px,1.5fr) minmax(120px,.6fr) repeat(3,minmax(92px,.48fr))}
}
@media(max-width:860px){
  .project-cost-estimation .cost-page-header,.cost-panel-heading{display:flex}
  .cost-header-meta{display:none}
  .cost-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cost-surface-grid{grid-template-columns:1fr}
  .cost-surface{border-right:0}
  .cost-controls-grid,.cost-advanced .cost-controls-grid{grid-template-columns:repeat(2,minmax(140px,1fr))}
  .cost-measure-head{display:none}
  .cost-measure{grid-template-columns:1fr 1fr;gap:8px}
  .cost-measure-name{grid-column:1/-1}
  .cost-measure>span:not(.cost-measure-name):not(.cost-input-unit){padding-top:4px;text-align:left}
  .cost-measure>span:not(.cost-measure-name):not(.cost-input-unit)::before{display:block;color:var(--muted);font-size:9px;text-transform:uppercase}
  .cost-measure>span:nth-child(3)::before{content:'Vollkosten'}
  .cost-measure>span:nth-child(4)::before{content:'Sowieso'}
  .cost-measure>span:nth-child(5)::before{content:'Energetisch'}
  .project-cost-estimation .cost-estimation-footer{display:flex}
}
@media(max-width:560px){
  .cost-summary{grid-template-columns:1fr}
  .cost-controls-grid,.cost-advanced .cost-controls-grid{grid-template-columns:1fr}
  .cost-surface{grid-template-columns:1fr 58px}
  .cost-surface .cost-input-unit{grid-column:1/-1}
  .cost-calculation-note{display:block}
}

/* Project cost calculator V4 - ENEBA web design */
.project-cost-estimation.cost-sheet{display:grid;gap:18px;max-width:1580px;margin:0 auto;padding:0 0 84px;color:var(--ink);background:transparent}
.cost-sheet-titlebar{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:24px!important;padding:22px 24px!important;border:1px solid #cfe4dc!important;border-radius:12px!important;background:linear-gradient(125deg,#f2fbf7 0,#fff 64%)!important;box-shadow:0 8px 28px rgba(16,73,54,.06)}
.cost-sheet-titlebar>div:first-child span{color:#079665;font-size:11px;font-weight:800;letter-spacing:.045em;text-transform:uppercase}
.cost-sheet-titlebar h2{margin:5px 0 0;font-size:25px;line-height:1.15}
.cost-sheet-totals{display:grid;grid-template-columns:repeat(4,minmax(112px,1fr));gap:9px;min-width:min(620px,55%)}
.cost-sheet-totals>span{display:grid;gap:4px;padding:11px 13px;border:1px solid #dce8e3;border-radius:9px;background:rgba(255,255,255,.9);color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.025em;text-transform:uppercase}
.cost-sheet-totals>span:last-child{border-color:#96d6bd;background:#ecf9f4;color:#147555}
.cost-sheet-totals b{color:var(--ink);font-size:16px;letter-spacing:0;text-transform:none}
.cost-sheet-totals>span:last-child b{color:#087a53}
.cost-sheet-master{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px}
.cost-sheet-master>section{overflow:hidden;border:1px solid var(--line);border-radius:11px;background:#fff;box-shadow:0 5px 18px rgba(27,51,42,.045)}
.cost-sheet-master h3{margin:0;padding:15px 17px;border-bottom:1px solid var(--line);background:#f7faf9;font-size:15px}
.cost-sheet-master>aside{grid-column:1/-1;display:flex;align-items:center;gap:10px;padding:11px 14px;border-left:3px solid #d7a415;border-radius:7px;background:#fff8df;color:#66511a;font-size:11px}
.cost-sheet-master>aside strong{flex:none;color:#80630e}
.cost-sheet-input{display:grid;grid-template-columns:minmax(145px,1fr) minmax(150px,.9fr);align-items:center;min-height:48px;padding:0 15px;border-bottom:1px solid #edf1ef;font-size:12px}
.cost-sheet-input:last-child{border-bottom:0}
.cost-sheet-input>span:first-child{padding:9px 8px 9px 0;color:#44554f;font-weight:650}
.cost-sheet-entry{display:grid;grid-template-columns:minmax(90px,1fr) auto;align-items:center;gap:7px}
.cost-sheet-entry input,.cost-sheet-entry select{width:100%;height:36px;min-height:36px;margin:0;padding:6px 9px;border:1px solid #d3c37b;border-radius:6px;background:#fffbee;color:var(--ink);font-size:12px;font-weight:700;box-shadow:inset 0 0 0 1px rgba(255,232,126,.2)}
.cost-sheet-entry input:focus,.cost-sheet-entry select:focus{border-color:#149c70;outline:2px solid rgba(20,156,112,.13)}
.cost-sheet-entry b{min-width:36px;color:var(--muted);font-size:10px;font-weight:700;white-space:nowrap}
.cost-sheet-input.is-automatic{background:#f8fbfc}
.cost-sheet-input.is-automatic .cost-sheet-entry input{border-color:#c5dbe3;background:#eef7fa;color:#24566a;cursor:default}
.cost-sheet-reference{grid-column:1/-1;display:flex;justify-content:space-between;gap:10px;margin:0 -15px;padding:6px 15px;border-top:1px solid #dce9ed;background:#f2f8fa;color:#52707b;font-size:9px;line-height:1.3}
.cost-sheet-reference a{color:#087a9c;font-weight:800;text-decoration:none}.cost-sheet-reference a:hover{text-decoration:underline}
.cost-sheet-reference span{text-align:right}
.cost-sheet-derived{display:grid;grid-template-columns:minmax(145px,1fr) minmax(85px,.55fr) minmax(90px,.6fr);align-items:center;min-height:48px;padding:0 15px;border-bottom:1px solid #edf1ef;font-size:12px}
.cost-sheet-derived span{color:#44554f;font-weight:650}.cost-sheet-derived strong{font-size:15px;text-align:right}.cost-sheet-derived b{padding-left:10px;color:var(--muted);font-size:10px;font-weight:600}
.cost-sheet-sections{display:grid;gap:16px}
.cost-sheet-section{overflow:hidden;border:1px solid var(--line);border-radius:11px;background:#fff;box-shadow:0 5px 18px rgba(27,51,42,.045)}
.cost-sheet-section-title{display:flex;align-items:center;gap:10px;padding:15px 17px;border-bottom:1px solid var(--line);background:#f7faf9}
.cost-sheet-section-title span{padding:4px 7px;border-radius:999px;background:#e7f6ef;color:#087a53;font-size:9px;font-weight:850;letter-spacing:.04em;text-transform:uppercase}
.cost-sheet-section-title strong{font-size:15px}
.cost-sheet-section-body{display:block}
.cost-sheet-section-inputs{display:grid;grid-template-columns:repeat(4,minmax(190px,1fr));gap:10px;padding:13px 16px;border-bottom:1px solid var(--line);background:#fbfcfc}
.cost-sheet-section-inputs .cost-sheet-input{display:grid;grid-template-columns:1fr;align-content:start;gap:5px;min-height:0;padding:10px 11px;border:1px solid #e1e8e5;border-radius:8px;background:#fff}
.cost-sheet-section-inputs .cost-sheet-input>span:first-child{padding:0;color:var(--muted);font-size:10px;text-transform:uppercase}
.cost-sheet-section-inputs .cost-sheet-entry input,.cost-sheet-section-inputs .cost-sheet-entry select{background:#fffbee}
.cost-sheet-section-inputs .cost-sheet-reference{margin:3px -11px -10px;padding:6px 11px;border-radius:0 0 8px 8px}
.cost-sheet-no-input{display:block;grid-column:1/-1;padding:6px 2px;color:var(--muted);font-size:11px}
.cost-sheet-hint{grid-column:1/-1;margin:0!important;padding:9px 11px;border-left:3px solid #19a675;border-radius:5px;background:#edf9f4;color:#285d4b!important;font-size:10px!important;line-height:1.4}
.cost-sheet-derived.section-derived{grid-column:1/-1;grid-template-columns:minmax(180px,1fr) 80px 34px;min-height:42px;padding:0 11px;border:1px solid #dce8e3;border-radius:7px;background:#f5faf8}
.cost-sheet-table-wrap{min-width:0;overflow-x:auto;background:#fff}
.cost-sheet-table-wrap table{width:100%;min-width:1040px;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:11px}
.cost-sheet-table-wrap th,.cost-sheet-table-wrap td{padding:10px 11px;border-bottom:1px solid #e7ece9;vertical-align:middle}
.cost-sheet-table-wrap tbody tr:last-child td{border-bottom:0}
.cost-sheet-table-wrap th{background:#f8faf9;color:#61716b;text-align:right;font-size:9px;font-weight:850;letter-spacing:.025em;line-height:1.35;text-transform:uppercase}
.cost-sheet-table-wrap th:first-child{width:31%;text-align:left}.cost-sheet-table-wrap th:nth-child(2){width:11%}.cost-sheet-table-wrap th:nth-child(3){width:11%}.cost-sheet-table-wrap th:nth-child(4){width:12%}.cost-sheet-table-wrap th:nth-child(5){width:13%}.cost-sheet-table-wrap th:nth-child(6){width:13%;text-align:left}.cost-sheet-table-wrap th:nth-child(7){width:9%;text-align:center}
.cost-sheet-table-wrap th small{display:block;margin-top:3px;color:#87958f;font-size:8px;font-weight:650;text-transform:none}
.cost-sheet-table-wrap th.is-anyway{background:#fffaf0}
.cost-sheet-output-mode{display:block;width:auto;min-width:74px;margin:5px 0 0 auto;padding:4px 6px;border:1px solid #d9c879;border-radius:5px;background:#fff9df;color:#604f18;font:inherit;font-weight:800;text-align:center;text-transform:none}
.cost-sheet-output-mode:disabled{opacity:.8;cursor:default}
.cost-sheet-measure{background:#fff;transition:background .15s ease,box-shadow .15s ease}
.cost-sheet-measure:hover{background:#fafcfb}
.cost-sheet-measure label{display:flex;align-items:flex-start;gap:9px;cursor:pointer;font-weight:650;line-height:1.35}
.cost-sheet-measure input{flex:none;width:15px;height:15px;min-width:15px;margin:0;accent-color:#0aa36d}
.cost-sheet-result{text-align:right;font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}
.cost-sheet-result.is-unit{color:#53635d;font-weight:600}
.cost-sheet-result.is-check{color:#b34242;text-align:right;font-size:9px;font-weight:750;white-space:normal}
.cost-sheet-result.is-extra{color:#087a53;font-weight:850}
.cost-sheet-range{color:#697872;text-align:left;font-size:9px}.cost-sheet-life{color:#697872;text-align:center;font-size:9px}
.cost-sheet-table-wrap tr.is-selected{background:#effaf5;box-shadow:inset 3px 0 #0aa36d}
.cost-sheet-table-wrap tr.is-selected:hover{background:#ebf8f2}
.cost-sheet .cost-estimation-footer{position:sticky;bottom:10px;z-index:5;display:flex!important;align-items:center;justify-content:space-between;gap:20px;margin:0;padding:12px 14px;border:1px solid #cbdcd5;border-radius:10px;background:rgba(255,255,255,.96);box-shadow:0 10px 30px rgba(20,62,48,.14);backdrop-filter:blur(9px)}
.cost-sheet .cost-estimation-footer button{min-width:190px}

@media(max-width:1280px){
  .cost-sheet-titlebar{display:grid!important}.cost-sheet-totals{min-width:0;width:100%}
  .cost-sheet-section-inputs{grid-template-columns:repeat(3,minmax(190px,1fr))}
}
@media(max-width:960px){
  .cost-sheet-master{grid-template-columns:1fr}.cost-sheet-master>aside{grid-column:auto}
  .cost-sheet-section-inputs{grid-template-columns:repeat(2,minmax(180px,1fr))}
}
@media(max-width:720px){
  .project-cost-estimation.cost-sheet{gap:12px}.cost-sheet-titlebar{padding:16px!important}.cost-sheet-titlebar h2{font-size:21px}
  .cost-sheet-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.cost-sheet-totals>span{padding:9px 10px}
  .cost-sheet-master{gap:12px}.cost-sheet-section-inputs{grid-template-columns:1fr;padding:10px}
  .cost-sheet-input{grid-template-columns:1fr;gap:4px;padding:9px 12px}.cost-sheet-input>span:first-child{padding:0}
  .cost-sheet-reference{display:block;margin:4px -12px -9px}.cost-sheet-reference span{display:block;margin-top:2px;text-align:left}
  .cost-sheet .cost-estimation-footer{bottom:6px}.cost-sheet .cost-estimation-footer button{min-width:0}
}
@media(max-width:900px){.tb-material-head{display:none}.tb-material-row{grid-template-columns:58px 1fr}.tb-material-row textarea,.tb-material-row button{grid-column:span 1}.tb-image-selects{grid-template-columns:1fr}.tb-building-card summary{display:block}}

/* Hott-Therm Dokumenteditor */
.td-page-list{display:flex;flex-direction:column;gap:8px;margin-top:14px}.td-page-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:11px 12px;border:1px solid #dce4e8;border-radius:8px;background:#fff}.td-page-row.disabled{opacity:.55;background:#f5f7f8}.td-page-index{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#e8f8f1;color:#087a4b;font-weight:700}.td-page-main{min-width:0}.td-page-main strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.page-head.compact{margin-bottom:4px}.page-head.compact h2{margin:0}.check-row{display:flex!important;align-items:center;gap:8px}.check-row input{width:auto!important}
@media(max-width:800px){.td-page-row{grid-template-columns:36px 1fr}.td-page-row>.button-row{grid-column:1/-1;justify-content:flex-end}}

/* Phase 4: PDF-Seiteneditor mit Überlagerungen */
.td-overlay-editor{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;align-items:start}.td-overlay-stage{position:relative;width:min(100%,720px);aspect-ratio:210/297;margin:auto;background:#eef1f3;border:1px solid #cbd5da;box-shadow:0 5px 20px rgba(0,0,0,.12);overflow:hidden}.td-page-background{position:absolute;inset:0;width:100%;height:100%;border:0;background:#fff}.td-overlay-layer{position:absolute;inset:0;pointer-events:none}.td-overlay{position:absolute;box-sizing:border-box;overflow:hidden}.td-overlay-text{white-space:pre-wrap;line-height:1.2;font-weight:600;background:rgba(255,255,255,.72);padding:3px}.td-overlay-image{object-fit:contain}.td-overlay-line{height:0!important;border-top-style:solid;overflow:visible}.td-overlay-line.arrow:after{content:"";position:absolute;right:-1px;top:50%;width:10px;height:10px;border-top:inherit;border-right:inherit;transform:translateY(-50%) rotate(45deg)}.td-overlay-shape{border-style:solid}.td-overlay-shape.circle{border-radius:50%}.td-overlay-tools{position:sticky;top:12px;max-height:72vh;overflow:auto;border-left:1px solid #e0e5e8;padding-left:16px}.td-overlay-tools h3{margin:18px 0 8px}.td-element-list{display:flex;flex-direction:column;gap:7px}.td-element-list>div{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px;border:1px solid #dce4e8;border-radius:7px;background:#fff}.td-element-list>div>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.td-element-list button{padding:5px 8px}.button-row.wrap{flex-wrap:wrap}
@media(max-width:1000px){.td-overlay-editor{grid-template-columns:1fr}.td-overlay-tools{position:static;max-height:none;border-left:0;border-top:1px solid #e0e5e8;padding:14px 0 0}}

/* Phase 6: Visuelle Wärmebrückenbibliothek */
dialog:has(.tb-library-picker){width:min(1500px,calc(100vw - 24px));max-width:none;height:min(92vh,980px)}dialog:has(.tb-library-picker) #modalForm{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto}dialog:has(.tb-library-picker) #modalBody{min-height:0;overflow:hidden}.tb-library-picker{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}.tb-library-filters{display:grid;gap:10px;border:1px solid var(--line);border-radius:10px;padding:10px;background:#fff}.tb-library-tabs,.tb-library-choice-row{display:flex;gap:6px;flex-wrap:wrap}.tb-library-tabs button,.tb-library-choice-row button,.tb-library-connection-grid button{border:1px solid #b9c5cc;background:#fff;color:#24323a;padding:8px 12px}.tb-library-tabs button.active,.tb-library-choice-row button.active,.tb-library-connection-grid button.active{background:#dbeafa;border-color:#75a6cf;color:#123f66;box-shadow:inset 0 0 0 1px #a8c9e6}.tb-library-connection-grid{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px}.tb-library-connection-grid button{min-width:132px;min-height:46px;white-space:normal}.tb-library-subfilters{display:grid;grid-template-columns:auto auto minmax(220px,1fr);gap:16px;align-items:end}.tb-library-subfilters>div{display:grid;gap:5px}.tb-library-workspace{min-height:0;display:grid;grid-template-columns:minmax(320px,36%) minmax(0,64%);border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}.tb-library-workspace>aside{min-height:0;border-right:1px solid var(--line);display:grid;grid-template-rows:auto minmax(0,1fr)}.tb-library-result-head{padding:10px 12px;background:#f4f7f8;border-bottom:1px solid var(--line)}.tb-library-results{overflow:auto;padding:8px;display:grid;gap:7px;align-content:start}.tb-library-result{display:grid;grid-template-columns:88px minmax(0,1fr);gap:10px;text-align:left;width:100%;padding:8px;background:#fff;border:1px solid #d2dce1;color:inherit}.tb-library-result:hover,.tb-library-result.selected{background:#d9ebf9;border-color:#74a8d2}.tb-library-result img,.tb-library-no-image{width:88px;height:70px;object-fit:contain;border:1px solid #9ba9b1;background:#fff}.tb-library-no-image{display:grid;place-items:center;font-size:11px;color:var(--muted)}.tb-library-result span:last-child{display:grid;gap:2px;min-width:0}.tb-library-result strong{font-size:14px}.tb-library-result small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tb-library-result em{font-size:11px;font-style:normal;color:#406173}.tb-library-preview{min-height:0;overflow:auto;padding:16px}.tb-library-preview-head{display:flex;justify-content:space-between;gap:16px;align-items:start;border-bottom:1px solid var(--line);padding-bottom:10px}.tb-library-preview-head h2{margin:7px 0 3px}.tb-library-category{padding:7px 10px;background:#e8f7f0;color:#08764e;border-radius:999px;font-weight:800;white-space:nowrap}.tb-library-meta{display:grid;grid-template-columns:130px minmax(0,1fr);margin:12px 0}.tb-library-meta dt,.tb-library-meta dd{margin:0;padding:6px 8px;border-bottom:1px solid #e5eaed}.tb-library-meta dt{font-weight:800;background:#f5f7f8}.tb-library-images{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tb-library-images figure{margin:0;border:1px solid #cfd9de}.tb-library-images figcaption{padding:7px 9px;background:#edf1f3;font-weight:800}.tb-library-images img,.tb-library-images figure>div{width:100%;height:250px;object-fit:contain;display:grid;place-items:center;background:#fff}.tb-library-materials{overflow:auto}.tb-library-materials table{width:100%;border-collapse:collapse;font-size:12px}.tb-library-materials th,.tb-library-materials td{border:1px solid #c9d2d7;padding:6px;vertical-align:top}.tb-library-materials th{background:#edf1f3;text-align:left}
@media(max-width:900px){dialog:has(.tb-library-picker){height:96vh}.tb-library-subfilters{grid-template-columns:1fr}.tb-library-workspace{grid-template-columns:1fr;overflow:auto}.tb-library-workspace>aside{max-height:390px;border-right:0;border-bottom:1px solid var(--line)}.tb-library-preview{overflow:visible}.tb-library-images{grid-template-columns:1fr}.tb-library-images img,.tb-library-images figure>div{height:200px}}


/* Phase 6 Hotfix: stabile Groesse und getrennte Scrollbereiche der visuellen Bibliothek */
dialog.tb-library-dialog {
    width: min(1500px, calc(100vw - 24px));
    max-width: none;
    height: min(92vh, 980px);
    max-height: 92vh;
    overflow: hidden;
}

dialog.tb-library-dialog #modalForm {
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

dialog.tb-library-dialog #modalBody {
    display: block;
    min-height: 0;
    overflow: hidden;
    margin-top: 14px;
}

dialog.tb-library-dialog .tb-library-picker {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
}

dialog.tb-library-dialog .tb-library-workspace {
    min-height: 0;
    height: 100%;
}

dialog.tb-library-dialog .tb-library-workspace > aside,
dialog.tb-library-dialog .tb-library-results,
dialog.tb-library-dialog .tb-library-preview {
    min-height: 0;
}

dialog.tb-library-dialog .tb-library-results,
dialog.tb-library-dialog .tb-library-preview {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

@media (max-width: 900px) {
    dialog.tb-library-dialog {
        width: calc(100vw - 12px);
        height: 96vh;
        max-height: 96vh;
    }

    dialog.tb-library-dialog #modalBody {
        overflow-y: auto;
    }

    dialog.tb-library-dialog .tb-library-picker {
        height: auto;
        min-height: 100%;
    }

    dialog.tb-library-dialog .tb-library-workspace {
        height: auto;
        min-height: 700px;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    dialog.tb-library-dialog .tb-library-workspace > aside {
        max-height: 390px;
    }
}


/* Phase 13.5: Wärmebrückenbibliothek – aufgeräumtes Layout und schnellere Bedienung */
.tb-library-loading,.tb-library-preview-loading{height:100%;min-height:180px;display:grid;place-content:center;justify-items:center;gap:10px;color:var(--muted)}
.tb-spinner{width:28px;height:28px;border:3px solid #dce5e9;border-top-color:#159c68;border-radius:50%;animation:tb-spin .75s linear infinite}
@keyframes tb-spin{to{transform:rotate(360deg)}}
dialog.tb-library-dialog{width:min(1420px,calc(100vw - 32px));height:min(90vh,940px)}
dialog.tb-library-dialog .tb-library-filters{padding:12px;gap:9px;background:#f8fafb}
dialog.tb-library-dialog .tb-library-tabs{padding-bottom:8px;border-bottom:1px solid var(--line)}
dialog.tb-library-dialog .tb-library-connection-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:7px;overflow-y:auto;overflow-x:hidden;max-height:112px;padding:0 2px 2px}
dialog.tb-library-dialog .tb-library-connection-grid button{min-width:0;min-height:42px;padding:7px 9px;line-height:1.15}
dialog.tb-library-dialog .tb-library-subfilters{grid-template-columns:minmax(210px,auto) minmax(330px,auto) minmax(260px,1fr);gap:12px}
dialog.tb-library-dialog .tb-library-workspace{grid-template-columns:minmax(360px,40%) minmax(0,60%)}
dialog.tb-library-dialog .tb-library-result-head{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;z-index:2}
dialog.tb-library-dialog .tb-library-results{padding:9px;gap:8px}
dialog.tb-library-dialog .tb-library-result{grid-template-columns:78px minmax(0,1fr);min-height:88px;padding:8px 9px;border-radius:7px;transition:background .12s,border-color .12s,box-shadow .12s}
dialog.tb-library-dialog .tb-library-result:hover{box-shadow:0 2px 8px rgba(22,52,68,.10)}
dialog.tb-library-dialog .tb-library-result img,dialog.tb-library-dialog .tb-library-no-image{width:78px;height:68px;border-radius:4px}
dialog.tb-library-dialog .tb-library-result strong{font-size:13px;line-height:1.15}
dialog.tb-library-dialog .tb-library-result small{font-size:11px;line-height:1.2}
dialog.tb-library-dialog .tb-library-connection{font-weight:700;color:#35576b}
dialog.tb-library-dialog .tb-library-execution{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
dialog.tb-library-dialog .tb-library-more{margin:0 9px 9px;width:calc(100% - 18px)}
dialog.tb-library-dialog .tb-library-preview{padding:18px 20px}
dialog.tb-library-dialog .tb-library-preview-head{position:sticky;top:-18px;background:#fff;z-index:2;padding-top:4px}
dialog.tb-library-dialog .tb-library-meta{grid-template-columns:120px minmax(0,1fr)}
dialog.tb-library-dialog .tb-library-images img,dialog.tb-library-dialog .tb-library-images figure>div{height:220px}
@media(max-width:1050px){dialog.tb-library-dialog .tb-library-subfilters{grid-template-columns:1fr 1fr}.tb-library-subfilters>label{grid-column:1/-1}dialog.tb-library-dialog .tb-library-workspace{grid-template-columns:minmax(320px,44%) minmax(0,56%)}}

/* Benutzeraktionen als kompaktes Drei-Punkte-Menü */
.user-action-menu {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.user-action-trigger {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 0.5rem;
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: #fff;
    border: 1px solid var(--border, #d9e2ec);
    color: var(--ink, #16213e);
}

.user-action-trigger:hover,
.user-action-trigger[aria-expanded="true"] {
    background: #f4f8fb;
    border-color: #aab9c8;
}

.user-action-dropdown {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 13.5rem;
    padding: 0.35rem;
    border: 1px solid var(--border, #d9e2ec);
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: 0 12px 30px rgba(22, 33, 62, 0.16);
}

.user-action-dropdown[hidden] {
    display: none;
}

.user-action-dropdown button {
    width: 100%;
    padding: 0.68rem 0.8rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--ink, #16213e);
    text-align: left;
    font-weight: 600;
}

.user-action-dropdown button:hover,
.user-action-dropdown button:focus-visible {
    background: #f1f5f8;
    outline: none;
}

.user-action-dropdown .danger-item {
    color: #c92a2a;
}

.user-action-dropdown .danger-item:hover,
.user-action-dropdown .danger-item:focus-visible {
    background: #fff0f0;
}


/* ENEBA Grundsteine V2 integration */
.gs-integration{margin-top:1rem;padding:1rem;border:1px solid #cfe4dc;border-radius:10px;background:#f7fbf9}
.gs-integration legend{font-weight:700;color:#153b30;padding:0 .35rem}
.gs-integration .check-row{display:flex;align-items:center;gap:.55rem;padding:.65rem .75rem;background:#e9f7f1;border-radius:8px;font-weight:700}
.gs-integration .check-row input{width:auto;margin:0}
.template-pick-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin-top:14px}
.template-pick-item{display:flex!important;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--border);border-radius:8px;background:#f8fbfc;cursor:pointer}
.template-pick-item:hover{border-color:var(--green);background:#eef8f3}
.template-pick-item input{width:auto!important;margin-top:3px}
.template-pick-item span{display:flex;flex-direction:column;gap:2px}
.template-pick-item small{color:var(--muted);font-size:.82rem}
.gs-fields{margin-top:.9rem}
.gs-fields h4{margin:1rem 0 .45rem;color:#153b30}
.form-grid.two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
@media(max-width:760px){.form-grid.two-col{grid-template-columns:1fr}}

/* ENEBA: breites Projektmodal mit Grundsteine V2 */
dialog:has(.gs-integration) {
    width: min(1180px, calc(100vw - 40px));
    max-width: none;
    max-height: 94vh;
}

dialog:has(.gs-integration) #modalForm {
    max-height: 94vh;
    overflow: auto;
    padding: 22px 24px;
}

dialog:has(.gs-integration) #modalBody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
}

dialog:has(.gs-integration) .gs-integration {
    grid-column: 1 / -1;
    padding: 18px 20px 20px;
}

dialog:has(.gs-integration) .gs-fields {
    margin-top: 14px;
}

dialog:has(.gs-integration) .gs-fields h4 {
    margin: 20px 0 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid #dce9e4;
}

dialog:has(.gs-integration) .gs-fields h4:first-of-type {
    margin-top: 10px;
}

dialog:has(.gs-integration) .form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

@media (min-width: 1180px) {
    dialog:has(.gs-integration) .form-grid.two-col {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    dialog:has(.gs-integration) {
        width: calc(100vw - 18px);
        max-height: 96vh;
    }
    dialog:has(.gs-integration) #modalForm {
        max-height: 96vh;
        padding: 14px;
    }
    dialog:has(.gs-integration) #modalBody,
    dialog:has(.gs-integration) .form-grid.two-col {
        grid-template-columns: 1fr;
    }
    dialog:has(.gs-integration) .gs-integration {
        padding: 14px;
    }
}

/* ENEBA: Klassen-Fallback Projektmodal */
dialog.project-create-wide {
    width: min(1180px, calc(100vw - 40px));
    max-width: none;
    max-height: 94vh;
}
dialog.project-create-wide #modalForm { max-height: 94vh; overflow: auto; padding: 22px 24px; }
dialog.project-create-wide #modalBody { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
dialog.project-create-wide .gs-integration { grid-column: 1 / -1; padding: 18px 20px 20px; }
@media (max-width: 760px) {
    dialog.project-create-wide { width: calc(100vw - 18px); max-height: 96vh; }
    dialog.project-create-wide #modalForm { max-height: 96vh; padding: 14px; }
    dialog.project-create-wide #modalBody,
    dialog.project-create-wide .form-grid.two-col { grid-template-columns: 1fr; }
}


/* Projektstammdaten in Luftdichtheits- und Wärmebrückenkonzept */
.concept-master-note{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:14px 16px;margin-bottom:14px;border:1px solid #bfe5d6;border-radius:10px;background:#eefaf5}.concept-master-note strong{color:#0d6f4a}.concept-master-note span{color:var(--muted);text-align:right}.concept-master-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:20px}.concept-master-item{min-width:0;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:#f8fafb}.concept-master-item span{display:block;margin-bottom:4px;font-size:12px;color:var(--muted)}.concept-master-item strong{display:block;overflow-wrap:anywhere}.concept-supplement-head{margin:24px 0 10px;padding-top:18px;border-top:1px solid var(--line)}.concept-supplement-head h3{margin:0 0 4px}.concept-supplement-head p{margin:0}.tb-building-card .button-row{justify-content:flex-end;margin-top:14px}
@media(max-width:1100px){.concept-master-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.concept-master-note{display:block}.concept-master-note span{display:block;margin-top:6px;text-align:left}.concept-master-grid{grid-template-columns:1fr}}


/* Konzeptspezifische Ergänzungen – kompakte Anordnung */
.concept-compact-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:12px}
.concept-subcard{min-width:0;padding:14px;border:1px solid var(--line);border-radius:10px;background:#fbfcfd}
.concept-subcard.concept-span-2{grid-column:1/-1}
.concept-subcard h3{margin:0 0 10px!important;font-size:15px;color:var(--blue)}
.concept-subcard .grid-2,.concept-subcard .grid-3{display:grid;gap:10px;margin:0 0 10px}
.concept-subcard .grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.concept-subcard .grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.concept-address-grid{display:grid;grid-template-columns:minmax(220px,1.6fr) 110px minmax(160px,1fr);gap:10px}
.concept-subcard label{margin:0;font-size:12px;font-weight:700}
.concept-subcard input,.concept-subcard select{min-height:36px;padding:7px 10px;margin-top:5px}
.concept-save-row{margin-top:14px!important;padding-top:14px;border-top:1px solid var(--line)}
@media(max-width:1050px){.concept-compact-grid{grid-template-columns:1fr}.concept-subcard.concept-span-2{grid-column:auto}}
@media(max-width:720px){.concept-subcard .grid-2,.concept-subcard .grid-3,.concept-address-grid{grid-template-columns:1fr}}

/* Wärmebrückenbibliothek: DIN-4108-Bbl.-2 Browser */
dialog.tb-library-dialog{
    width:min(1540px,calc(100vw - 32px));
    max-width:none;
    height:min(94vh,980px);
    max-height:none;
}
dialog.tb-library-dialog #modalForm{
    height:100%;
    max-height:none;
    display:grid;
    grid-template-rows:auto minmax(0,1fr) auto;
    padding:18px;
}
dialog.tb-library-dialog #modalBody{
    min-height:0;
    overflow:hidden;
}
dialog.tb-library-dialog .tb-library-picker{
    min-height:0;
    height:100%;
    display:grid;
    grid-template-rows:auto auto auto minmax(0,1fr);
    gap:12px;
}
.tb-library-titlebar{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
}
.tb-library-titlebar h2{
    margin:0 0 4px;
    color:var(--blue);
}
.tb-library-titlebar p{
    margin:0;
    color:var(--muted);
}
dialog.tb-library-dialog .tb-library-filters{
    display:grid;
    grid-template-columns:repeat(5,minmax(140px,1fr));
    gap:10px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#f8fafb;
}
dialog.tb-library-dialog .tb-library-filters label{
    display:grid;
    gap:5px;
    margin:0;
    min-width:0;
    font-size:12px;
    font-weight:800;
    color:var(--muted);
}
dialog.tb-library-dialog .tb-filter-search{
    grid-column:span 2;
}
.tb-library-active-filters{
    min-height:34px;
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
}
.tb-library-active-filters button{
    padding:6px 10px;
    border:1px solid #bfe5d6;
    border-radius:999px;
    background:#eefaf5;
    color:#0b6c4a;
    font-weight:800;
}
dialog.tb-library-dialog .tb-library-workspace{
    min-height:0;
    display:grid;
    grid-template-columns:minmax(400px,40%) minmax(0,60%);
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
}
dialog.tb-library-dialog .tb-library-workspace>aside{
    min-height:0;
    display:grid;
    grid-template-rows:auto minmax(0,1fr) auto;
    border-right:1px solid var(--line);
}
dialog.tb-library-dialog .tb-library-result-head{
    position:sticky;
    top:0;
    z-index:2;
    padding:10px 12px;
    border-bottom:1px solid var(--line);
    background:#f4f8fb;
}
dialog.tb-library-dialog .tb-library-results{
    min-height:0;
    overflow:auto;
    display:grid;
    align-content:start;
    gap:8px;
    padding:10px;
}
dialog.tb-library-dialog .tb-library-result{
    width:100%;
    min-height:112px;
    display:grid;
    grid-template-columns:104px minmax(0,1fr);
    gap:12px;
    padding:10px;
    border:1px solid #d7e1e7;
    border-radius:8px;
    background:#fff;
    color:var(--blue);
    text-align:left;
    transition:background .12s,border-color .12s,box-shadow .12s;
}
dialog.tb-library-dialog .tb-library-result:hover,
dialog.tb-library-dialog .tb-library-result:focus-visible{
    border-color:#92c3de;
    background:#f3f9fb;
    box-shadow:0 4px 14px rgba(22,52,68,.10);
    outline:none;
}
dialog.tb-library-dialog .tb-library-result.selected{
    border-color:var(--green);
    background:#eefaf5;
    box-shadow:inset 4px 0 0 var(--green);
}
.tb-library-thumb,
dialog.tb-library-dialog .tb-library-result img,
dialog.tb-library-dialog .tb-library-no-image{
    width:104px;
    height:92px;
}
dialog.tb-library-dialog .tb-library-result img,
dialog.tb-library-dialog .tb-library-no-image{
    display:grid;
    place-items:center;
    object-fit:contain;
    border:1px solid #c7d3da;
    border-radius:6px;
    background:#fff;
    color:var(--muted);
    font-size:12px;
}
.tb-library-card-main{
    min-width:0;
    display:grid;
    gap:4px;
}
.tb-library-card-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
}
.tb-library-card-top strong{
    font-size:15px;
}
.tb-category-badge,
.tb-detail-label{
    display:inline-flex;
    align-items:center;
    width:max-content;
    padding:4px 8px;
    border-radius:999px;
    background:#e8f7f0;
    color:#08764e;
    font-size:12px;
    font-weight:900;
}
.tb-detail-label{
    margin-right:6px;
    background:#eef3f7;
    color:var(--blue);
}
.tb-library-connection{
    font-weight:900;
    color:var(--blue);
}
.tb-library-meta-line,
.tb-library-source,
.tb-library-psi{
    color:var(--muted);
    font-size:12px;
}
.tb-library-execution{
    display:-webkit-box;
    overflow:hidden;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    color:#2d3f4c;
    line-height:1.35;
}
dialog.tb-library-dialog .tb-library-more{
    width:calc(100% - 20px);
    margin:0 10px 10px;
}
dialog.tb-library-dialog .tb-library-preview{
    min-height:0;
    overflow:auto;
    padding:22px;
}
dialog.tb-library-dialog .tb-library-preview-head{
    position:sticky;
    top:-22px;
    z-index:2;
    padding:4px 0 12px;
    border-bottom:1px solid var(--line);
    background:#fff;
}
dialog.tb-library-dialog .tb-library-preview-head h2{
    margin:10px 0 4px;
    color:var(--blue);
}
.tb-library-full-execution{
    padding:12px 0;
    color:#20313c;
    line-height:1.5;
}
.tb-library-source-line{
    color:var(--muted);
}
.tb-psi-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin:14px 0;
}
.tb-psi-card{
    min-width:0;
    padding:12px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#f8fafb;
}
.tb-psi-card span,
.tb-psi-card small{
    display:block;
    color:var(--muted);
    font-size:12px;
}
.tb-psi-card strong{
    display:block;
    margin:4px 0 2px;
    color:var(--blue);
    font-size:20px;
}
.tb-library-image-tabs{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin:16px 0;
}
.tb-library-image-tabs figure{
    margin:0;
    overflow:hidden;
    border:1px solid #cfd9de;
    border-radius:8px;
    background:#fff;
}
.tb-library-image-tabs figcaption{
    padding:8px 10px;
    background:#edf3f6;
    color:var(--blue);
    font-weight:900;
}
.tb-library-image-tabs img,
.tb-library-image-tabs figure>div{
    width:100%;
    height:320px;
    display:grid;
    place-items:center;
    object-fit:contain;
    background:#fff;
}
.tb-library-tech{
    display:grid;
    grid-template-columns:150px minmax(0,1fr);
    margin:16px 0;
    border-top:1px solid var(--line);
}
.tb-library-tech dt,
.tb-library-tech dd{
    margin:0;
    padding:8px 10px;
    border-bottom:1px solid var(--line);
}
.tb-library-tech dt{
    color:var(--muted);
    font-weight:900;
    background:#f8fafb;
}
.tb-library-materials{
    overflow:auto;
}
.tb-library-materials table{
    width:100%;
    border-collapse:collapse;
    font-size:12px;
}
.tb-library-materials th,
.tb-library-materials td{
    padding:7px;
    border:1px solid #cfd9de;
    vertical-align:top;
}
.tb-library-materials th{
    text-align:left;
    background:#edf3f6;
}
.tb-library-selection-summary{
    position:sticky;
    bottom:-22px;
    margin:18px -22px -22px;
    padding:12px 22px;
    border-top:1px solid var(--line);
    background:#f8fafb;
    color:var(--blue);
    font-weight:900;
}
@media(max-width:1150px){
    dialog.tb-library-dialog .tb-library-filters{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
    dialog.tb-library-dialog .tb-filter-search{
        grid-column:span 2;
    }
    dialog.tb-library-dialog .tb-library-workspace{
        grid-template-columns:minmax(340px,43%) minmax(0,57%);
    }
}
@media(max-width:820px){
    dialog.tb-library-dialog{
        width:calc(100vw - 16px);
        height:96vh;
    }
    dialog.tb-library-dialog #modalForm{
        padding:12px;
    }
    dialog.tb-library-dialog #modalBody{
        overflow:auto;
    }
    dialog.tb-library-dialog .tb-library-picker{
        height:auto;
        min-height:100%;
        grid-template-rows:auto;
    }
    .tb-library-titlebar{
        display:grid;
    }
    dialog.tb-library-dialog .tb-library-filters,
    dialog.tb-library-dialog .tb-library-workspace,
    .tb-library-image-tabs,
    .tb-psi-grid,
    .tb-library-tech{
        grid-template-columns:1fr;
    }
    dialog.tb-library-dialog .tb-filter-search{
        grid-column:auto;
    }
    dialog.tb-library-dialog .tb-library-workspace{
        overflow:visible;
    }
    dialog.tb-library-dialog .tb-library-workspace>aside{
        max-height:48vh;
        border-right:0;
        border-bottom:1px solid var(--line);
    }
    dialog.tb-library-dialog .tb-library-preview{
        overflow:visible;
        padding:16px;
    }
    dialog.tb-library-dialog .tb-library-preview-head{
        position:static;
    }
    .tb-library-image-tabs img,
    .tb-library-image-tabs figure>div{
        height:220px;
    }
    .tb-library-selection-summary{
        position:static;
        margin:16px -16px -16px;
        padding:12px 16px;
    }
}

/* Wärmebrückenbibliothek: hierarchische Filter ohne Beispielbilder */
dialog.tb-library-hierarchy-dialog{
    width:min(1480px,calc(100vw - 24px));
    height:min(95vh,980px);
}
dialog.tb-library-hierarchy-dialog .tb-library-hierarchy-picker{
    grid-template-rows:auto auto auto auto minmax(0,1fr);
}
.tb-hierarchy-filters{
    display:grid;
    gap:8px;
    padding:10px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#f8fafb;
}
.tb-hierarchy-level{
    display:grid;
    grid-template-columns:190px minmax(0,1fr);
    gap:10px;
    align-items:start;
    padding:8px;
    border:1px solid #d7e1e7;
    border-radius:7px;
    background:#fff;
}
.tb-hierarchy-level h3{
    margin:7px 0 0;
    color:var(--blue);
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.02em;
}
.tb-hierarchy-pills{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
}
.tb-hierarchy-pill{
    min-height:36px;
    padding:7px 12px;
    border:1px solid #bfcbd3;
    border-radius:4px;
    background:linear-gradient(#fff,#f3f5f6);
    color:var(--blue);
    font-weight:850;
    text-align:center;
}
.tb-hierarchy-pill:hover,
.tb-hierarchy-pill:focus-visible{
    border-color:#55a8d8;
    background:#eef8ff;
    outline:none;
}
.tb-hierarchy-pill.active{
    border-color:#278ed0;
    background:#bfe4ff;
    box-shadow:0 0 0 2px #8dccf5 inset;
}
dialog.tb-library-hierarchy-dialog .tb-library-advanced-filters{
    grid-template-columns:130px 110px 110px minmax(260px,1fr) 190px;
}
dialog.tb-library-hierarchy-dialog .tb-library-advanced-filters .tb-filter-search{
    grid-column:auto;
}
dialog.tb-library-hierarchy-dialog .tb-library-list-workspace{
    grid-template-columns:minmax(520px,54%) minmax(0,46%);
}
dialog.tb-library-hierarchy-dialog .tb-library-source-line,
dialog.tb-library-hierarchy-dialog .tb-library-tech dt:first-child,
dialog.tb-library-hierarchy-dialog .tb-library-tech dd:first-of-type{
    display:none;
}
@media(max-width:980px){
    .tb-hierarchy-level{
        grid-template-columns:1fr;
    }
    .tb-hierarchy-level h3{
        margin:0;
    }
    dialog.tb-library-hierarchy-dialog .tb-library-advanced-filters{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    dialog.tb-library-hierarchy-dialog .tb-library-advanced-filters .tb-filter-search{
        grid-column:1/-1;
    }
    dialog.tb-library-hierarchy-dialog .tb-library-list-workspace{
        grid-template-columns:1fr;
    }
}
@media(max-width:640px){
    dialog.tb-library-hierarchy-dialog .tb-library-advanced-filters{
        grid-template-columns:1fr;
    }
    .tb-hierarchy-pills{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .tb-hierarchy-pill{
        width:100%;
    }
}

/* Wärmebrückenbibliothek: grafische Filter wie Hottgenroth-Auswahlliste */
dialog.tb-library-visual-dialog{
    width:min(1500px,calc(100vw - 24px));
    height:min(95vh,1000px);
}
dialog.tb-library-visual-dialog .tb-library-visual-picker{
    grid-template-rows:auto auto auto minmax(0,1fr);
}
.tb-visual-filter-panel{
    display:grid;
    gap:10px;
}
.tb-visual-tabs,
.tb-construction-tiles{
    display:flex;
    gap:8px;
    overflow:auto;
    padding:8px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
}
.tb-filter-tile{
    flex:0 0 128px;
    min-height:122px;
    display:grid;
    grid-template-rows:82px auto;
    gap:6px;
    justify-items:center;
    align-items:center;
    padding:7px;
    border:1px solid #bfcbd3;
    border-radius:3px;
    background:linear-gradient(#fff,#f1f1f1);
    color:#24323a;
    text-align:center;
    font-weight:700;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.7);
}
.tb-filter-tile img{
    width:100%;
    height:82px;
    object-fit:contain;
    border:1px solid #b9c4cb;
    background:#fff;
}
.tb-filter-icon{
    width:100%;
    height:82px;
    display:grid;
    place-items:center;
    border:1px solid #b9c4cb;
    background:#fff;
    color:var(--muted);
    font-size:20px;
}
.tb-filter-tile:hover,
.tb-filter-tile:focus-visible{
    border-color:#61a9d9;
    background:#eef8ff;
    outline:none;
}
.tb-filter-tile.active{
    border-color:#278ed0;
    background:#bfe4ff;
    box-shadow:0 0 0 2px #8dccf5 inset;
}
.tb-visual-category-row{
    display:grid;
    grid-template-columns:150px minmax(0,1fr);
    gap:10px;
    padding:8px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
}
.tb-category-stack{
    display:grid;
    align-content:center;
    gap:8px;
}
.tb-category-choice{
    min-height:36px;
    padding:7px 10px;
    border:1px solid #bfcbd3;
    border-radius:2px;
    background:linear-gradient(#fff,#f1f1f1);
    color:#24323a;
    font-weight:800;
}
.tb-category-choice.active{
    border-color:#278ed0;
    background:#bfe4ff;
    box-shadow:0 0 0 1px #8dccf5 inset;
}
.tb-construction-tiles{
    border:0;
    padding:0;
}
.tb-filter-construction-tile{
    flex-basis:150px;
}
dialog.tb-library-visual-dialog .tb-library-advanced-filters{
    grid-template-columns:180px 130px 110px 110px minmax(240px,1fr) 170px;
}
dialog.tb-library-visual-dialog .tb-library-advanced-filters .tb-filter-search{
    grid-column:auto;
}
dialog.tb-library-visual-dialog .tb-library-list-workspace{
    grid-template-columns:minmax(540px,55%) minmax(0,45%);
}
dialog.tb-library-visual-dialog .tb-library-result{
    grid-template-columns:120px minmax(0,1fr);
    min-height:118px;
}
dialog.tb-library-visual-dialog .tb-library-thumb,
dialog.tb-library-visual-dialog .tb-library-result img,
dialog.tb-library-visual-dialog .tb-library-no-image{
    width:120px;
    height:96px;
}
dialog.tb-library-visual-dialog .tb-library-result.selected{
    background:#b9ddf4;
    border-color:#278ed0;
    box-shadow:inset 5px 0 0 #278ed0;
}
dialog.tb-library-visual-dialog .tb-library-tech{
    grid-template-columns:120px minmax(0,1fr);
}
@media(max-width:1100px){
    dialog.tb-library-visual-dialog .tb-library-advanced-filters{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
    dialog.tb-library-visual-dialog .tb-library-list-workspace{
        grid-template-columns:minmax(420px,52%) minmax(0,48%);
    }
}
@media(max-width:820px){
    .tb-visual-category-row{
        grid-template-columns:1fr;
    }
    .tb-category-stack{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
    dialog.tb-library-visual-dialog .tb-library-advanced-filters,
    dialog.tb-library-visual-dialog .tb-library-list-workspace{
        grid-template-columns:1fr;
    }
    .tb-filter-tile{
        flex-basis:118px;
    }
    dialog.tb-library-visual-dialog .tb-library-workspace>aside{
        max-height:50vh;
    }
}

/* ENEBA Konsolidierung: stabile Karten, Buttons und mobile Listen */
.card,
.table-card,
.auth-card,
dialog {
    box-sizing: border-box;
}

.button-row > button,
.button-row > a,
.modal-actions > button,
.modal-actions > a,
.table-card td button {
    min-width: max-content;
    line-height: 1.15;
}

.progress {
    display: block;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.progress .bar {
    display: block;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.project-card-row,
.project-card-progress,
.table-card td {
    min-width: 0;
}

.project-card-row > *,
.project-card-progress > *,
.table-card td > * {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 760px) {
    .page,
    main,
    .content,
    .card,
    .table-card {
        min-width: 0;
        max-width: 100%;
    }

    .table-card {
        overflow: hidden;
    }

    .table-card tr,
    .mobile-project-card {
        overflow: hidden;
    }

    .table-card td,
    .project-card-row,
    .project-card-progress {
        grid-template-columns: minmax(86px, 30%) minmax(0, 1fr);
        column-gap: 10px;
    }

    .project-card-progress .progress,
    .table-card td[data-label="Fortschritt"] .progress {
        width: 100%;
        inline-size: 100%;
        max-width: 100%;
        min-width: 0;
        justify-self: stretch;
    }

    .project-card-progress .bar,
    .table-card td[data-label="Fortschritt"] .bar {
        max-width: 100%;
    }

    .status-badge,
    .badge {
        width: fit-content;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .button-row {
        align-items: stretch;
    }

    .button-row > button,
    .button-row > a {
        flex: 0 1 auto;
        max-width: 100%;
        white-space: normal;
    }
}

/* Projektarbeitsplatz */
#projectDetail { min-width: 0; }
.project-workspace { min-width: 0; }

/* Project-head presentation is owned by assets/scss/modules/_project-detail-v1.scss. */
.project-assignee-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 11px; font-weight: 800; }
.project-assignee-avatar.is-empty { color: var(--muted); background: #edf1f2; }
.project-assignee-stack { min-width: 34px; display: inline-flex; align-items: center; }
.project-assignee-stack .project-assignee-avatar + .project-assignee-avatar { margin-left: -9px; border: 2px solid #fff; }
.project-assignee-stack small { margin-left: 5px; color: var(--muted); font-weight: 800; }
.project-team-list { display: grid; }
.project-team-list article { min-width: 0; padding: 10px 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.project-team-list strong,
.project-team-list small { display: block; overflow-wrap: anywhere; }
.project-team-list small { margin-top: 2px; color: var(--muted); }

.project-workspace-tabs {
    position: sticky;
    top: 92px;
    z-index: 16;
    margin: 0 0 20px;
    padding: 0;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    background: #fff;
}
.project-workspace-tabs button { min-height: 48px; padding: 10px 13px; font-size: 11px; white-space: nowrap; }

.project-workspace-body { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.project-workspace-content { min-width: 0; }
.project-context-rail {
    position: fixed;
    top: 156px;
    right: 0;
    z-index: 24;
    display: grid;
    gap: 6px;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    box-shadow: -8px 8px 22px rgba(21, 22, 56, .08);
}
.project-context-rail button { width: 42px; height: 42px; padding: 5px; display: grid; place-items: center; color: var(--blue); background: #f7fafb; border: 1px solid transparent; border-radius: 7px; font-size: 10px; }
.project-context-rail button img { width: 30px; height: 30px; display: block; object-fit: contain; mix-blend-mode: multiply; }
.project-context-rail button:hover,
.project-context-rail button.active { color: var(--green-2); background: #eaf7f2; border-color: #bee2d5; }

.project-context-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 32;
    width: min(390px, calc(100vw - var(--app-sidebar-width)));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 42px rgba(21, 22, 56, .13);
}
.project-context-drawer > header { min-height: 72px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.project-context-drawer > header h2 { margin: 0; font-size: 18px; }
.project-context-drawer-body { min-width: 0; padding: 20px; overflow-y: auto; }
.project-context-drawer-body > button,
.project-context-drawer-body > .project-drawer-link { width: 100%; margin-top: 14px; }
.project-drawer-data { margin: 0; display: grid; }
.project-drawer-data > div { padding: 11px 0; display: grid; grid-template-columns: minmax(100px, .75fr) minmax(0, 1.25fr); gap: 12px; border-bottom: 1px solid var(--line); }
.project-drawer-data dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.project-drawer-data dd { margin: 0; min-width: 0; text-align: right; overflow-wrap: anywhere; font-weight: 700; }
.project-drawer-error { display: grid; gap: 5px; margin: 14px 0 0; padding: 11px 12px; border: 1px solid #efc7c9; border-left: 3px solid #c94750; border-radius: 8px; color: #7d2930; background: #fff7f7; font-size: 13px; line-height: 1.4; }
.project-drawer-error span { overflow-wrap: anywhere; }
.project-drawer-lead { margin-top: 0; color: var(--blue); font-size: 17px; font-weight: 800; }
.project-note-text { padding: 13px; background: #f7f9fa; border-left: 3px solid var(--green); white-space: pre-wrap; }
.project-drawer-comments { display: grid; gap: 9px; margin: 10px 0 14px; }
.project-drawer-comments article { padding: 10px 0; border-bottom: 1px solid var(--line); }
.project-drawer-comments article strong,
.project-drawer-comments article small { display: block; }
.project-drawer-comments article p { margin: 5px 0 0; }
.project-drawer-link { min-height: 40px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--green); border-radius: 6px; text-decoration: none; font-weight: 800; }
.project-drawer-backdrop { display: none; }
.project-export-actions { display: grid; gap: 10px; }
.project-export-actions > * { width: 100%; }
.project-export-actions > a { min-height: 40px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--green); border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 800; }

.project-subtabs { margin-bottom: 16px; display: inline-flex; gap: 3px; padding: 4px; background: #e9eef0; border-radius: 7px; }
.project-subtabs button { color: var(--blue); background: transparent; }
.project-subtabs button.active { color: #fff; background: var(--blue); }
.project-activity-workspace,
.project-billing-workspace { min-width: 0; }
.project-activity-summary,
.project-billing-kpis { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); }
.project-activity-summary > div,
.project-billing-kpis > div { min-width: 0; padding: 14px 16px; display: grid; gap: 3px; border-right: 1px solid var(--line); }
.project-activity-summary > div:last-child,
.project-billing-kpis > div:last-child { border-right: 0; }
.project-activity-summary span,
.project-billing-kpis span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.project-activity-summary strong,
.project-billing-kpis strong { color: var(--blue); font-size: 17px; overflow-wrap: anywhere; }
.project-activity-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr); gap: 16px; align-items: start; }
.project-activity-toolbar { margin-top: 14px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px); gap: 8px; }
.project-activity-toolbar > * { min-width: 0; }
.project-activity-stream { display: grid; }
.project-activity-stream article { position: relative; min-height: 58px; padding: 9px 0 13px 30px; display: block; }
.project-activity-stream article::before { content: ""; position: absolute; left: 8px; top: 22px; bottom: -8px; width: 1px; background: var(--line); }
.project-activity-stream article:last-child::before { display: none; }
.project-activity-stream article > span { position: absolute; left: 3px; top: 15px; width: 11px; height: 11px; border: 3px solid #d9f1e8; border-radius: 50%; background: var(--green); }
.project-activity-stream strong,
.project-activity-stream small { display: block; }
.project-activity-stream small { margin-top: 3px; color: var(--muted); }
.project-activity-stream-large { margin-top: 12px; }
.project-activity-entry-head { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-activity-entry-head strong { min-width: 0; overflow-wrap: anywhere; }
.project-activity-entry-head em { flex: none; padding: 3px 6px; color: var(--muted); background: #f0f3f4; border-radius: 4px; font-size: 10px; font-style: normal; font-weight: 800; }
.project-activity-description { margin-top: 8px; color: #42546a; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.project-activity-description p { margin: 0 0 7px; }
.project-activity-description p:last-child { margin-bottom: 0; }
.project-activity-description ul,.project-activity-description ol { margin: 6px 0; padding-left: 20px; }
.project-activity-description a { color: var(--green); font-weight: 750; }
.project-activity-manual > span { background: #7055b9 !important; border-color: #e4ddf7 !important; }
.project-activity-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.project-activity-head-actions button,.project-drawer-create-activity { min-height: 34px; padding: 7px 10px; font-size: 11px; white-space: nowrap; }
.project-drawer-create-activity { width: 100%; margin-bottom: 12px; }
.manual-activity-form { display: grid; gap: 13px; }
.manual-activity-form > label,.manual-activity-datetime > label { display: grid; gap: 6px; color: var(--blue); font-size: 12px; font-weight: 800; }
.manual-activity-editor-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.manual-activity-editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px; border-bottom: 1px solid var(--line); background: #f8fafb; }
.manual-activity-editor-toolbar button { min-height: 31px; padding: 5px 8px; color: var(--blue); border: 0; border-radius: 4px; background: transparent; box-shadow: none; font-size: 12px; }
.manual-activity-editor-toolbar button:hover { color: var(--green); background: #eaf8f3; transform: none; }
.manual-activity-editor { min-height: 190px; padding: 13px; color: var(--text); outline: none; line-height: 1.55; }
.manual-activity-editor:empty::before { content: attr(data-placeholder); color: #9aa7b5; pointer-events: none; }
.manual-activity-editor p { margin: 0 0 8px; }
.manual-activity-editor ul,.manual-activity-editor ol { padding-left: 22px; }
.project-activity-task > span { background: var(--blue) !important; border-color: #dde3ed !important; }
.project-activity-file > span,
.project-activity-diary > span { background: #0a82a0 !important; border-color: #d4edf3 !important; }
.project-activity-billing > span { background: #9a6b16 !important; border-color: #f4e8cc !important; }
.project-activity-empty { padding: 18px 0; }
.project-comments-panel { min-width: 0; }
.project-comment-compose { margin: 14px 0 16px; display: grid; gap: 8px; }
.project-comment-compose button { justify-self: end; }
.project-comment-list { display: grid; gap: 0; max-height: 620px; overflow-y: auto; }
.project-comment-list .comment { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.project-comment-list .comment header { margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.project-comment-list .comment small { color: var(--muted); }

.project-billing-head { margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.project-billing-head h2,
.project-billing-head p { margin: 0; }
.project-billing-head p { margin-top: 4px; color: var(--muted); }
.project-billing-kpis strong.is-negative { color: var(--red); }
.project-billing-kpis strong.is-positive { color: var(--green-2); }
.project-billing-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(480px, 1.2fr); gap: 16px; align-items: start; }
.project-billing-documents,
.project-billing-form { min-width: 0; padding: 20px; background: #fff; border: 1px solid var(--line); }
.project-billing-section-head { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-billing-section-head h3,
.project-billing-section-head p { margin: 0; }
.project-billing-section-head p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.billing-document-section { margin-top: 20px; padding-top: 18px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.billing-document-section > label { color: var(--blue); font-weight: 800; }
.billing-document-empty { min-height: 78px; padding: 14px; display: grid; align-content: center; gap: 4px; color: var(--muted); background: #f5f7f8; border: 1px dashed #cbd4d8; }
.billing-document-empty small { color: var(--muted); }
.billing-document-linked { min-width: 0; min-height: 78px; padding: 10px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; background: #f7f9fa; border: 1px solid var(--line); }
.billing-document-icon { width: 42px; height: 48px; display: grid; place-items: center; color: #fff; background: var(--blue); font-size: 10px; font-weight: 900; }
.billing-document-linked strong,
.billing-document-linked small { display: block; min-width: 0; overflow-wrap: anywhere; }
.billing-document-linked small { margin-top: 3px; color: var(--muted); }
.project-billing-fields { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.project-billing-fields label { min-width: 0; display: grid; gap: 6px; color: var(--blue); font-size: 12px; font-weight: 800; }
.project-billing-fields input,
.project-billing-fields select { min-width: 0; width: 100%; max-width: 100%; }
.project-billing-status-field { grid-column: 1 / -1; }
.project-billing-form-footer { margin-top: 18px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.project-billing-form-footer small { color: var(--muted); }
.project-billing-save-status { min-height: 18px; margin: 8px 0 0; color: var(--green-2); text-align: right; font-size: 12px; }
.project-billing-save-status.error { color: var(--red); }

@media (max-width: 980px) {
    .project-workspace-tabs { top: calc(var(--app-mobile-bar-height) + 94px); margin-inline: -14px; padding-inline: 14px; }
    .project-context-drawer { width: min(420px, 100vw); }
    .project-drawer-backdrop { position: fixed; inset: 0; z-index: 31; display: block; padding: 0; background: rgba(21, 22, 56, .32); border-radius: 0; }
    .project-billing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .project-workspace-body { grid-template-columns: minmax(0, 1fr); }
    .project-context-rail { position: fixed; inset: auto 8px 8px 8px; z-index: 24; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; padding: 5px; box-shadow: 0 8px 30px rgba(21, 22, 56, .18); }
    .project-context-rail button { width: 100%; height: 38px; padding: 4px; }
    .project-context-rail button img { width: 28px; height: 28px; }
    .project-context-drawer { inset: var(--app-mobile-bar-height) 0 0; width: 100vw; }
    .project-subtabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .project-subtabs button { min-width: 0; white-space: normal; }
    .project-activity-layout { grid-template-columns: 1fr; }
    .project-activity-summary,
    .project-billing-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-activity-summary > div:nth-child(2),
    .project-billing-kpis > div:nth-child(2) { border-right: 0; }
    .project-activity-summary > div:nth-child(-n+2),
    .project-billing-kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .project-activity-toolbar,
    .project-billing-fields { grid-template-columns: 1fr; }
    .project-billing-status-field { grid-column: auto; }
    .project-billing-documents,
    .project-billing-form { padding: 15px; }
    .project-billing-section-head,
    .project-billing-form-footer { align-items: stretch; flex-direction: column; }
    .project-billing-form-footer button { width: 100%; }
    .billing-document-linked { grid-template-columns: 38px minmax(0, 1fr); }
    .billing-document-linked > button { grid-column: 1 / -1; width: 100%; }
}

/* Vertikaler Projektablauf */
.project-workflow-panel { min-width: 0; }
.workflow-overview {
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 190px)) minmax(220px, 1fr);
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--line);
}
.workflow-overview > div { min-width: 0; padding: 14px 17px; display: grid; gap: 3px; border-right: 1px solid var(--line); }
.workflow-overview > div:last-child { border-right: 0; }
.workflow-overview span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.workflow-overview strong { color: var(--blue); font-size: 17px; }
.workflow-overview .workflow-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.workflow-timeline { position: relative; display: grid; gap: 0; }
.workflow-timeline::before { content: ""; position: absolute; left: 22px; top: 28px; bottom: 28px; width: 2px; background: #d7e2e4; }
.workflow-milestone { position: relative; min-width: 0; padding: 0 0 24px 62px; }
.workflow-marker { position: absolute; z-index: 2; left: 0; top: 19px; width: 46px; height: 46px; display: grid; place-items: center; border: 5px solid #edf3f3; border-radius: 50%; background: #fff; }
.workflow-marker span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #9ca9b4; font-size: 12px; font-weight: 900; }
.workflow-milestone.is-active .workflow-marker span { background: var(--green); }
.workflow-milestone.is-waiting .workflow-marker span { color: #6f5100; background: var(--warn); }
.workflow-milestone.is-done .workflow-marker span { background: var(--green-2); }
.workflow-milestone-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-left: 4px solid #a9b5bd; border-radius: 6px; }
.workflow-milestone.is-active .workflow-milestone-card { border-left-color: var(--green); }
.workflow-milestone.is-waiting .workflow-milestone-card { border-left-color: var(--warn); }
.workflow-milestone.is-done .workflow-milestone-card { border-left-color: var(--green-2); }
.workflow-milestone-card > .workflow-milestone-summary { padding: 16px 18px 12px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; list-style: none; cursor: pointer; }
.workflow-milestone-card > .workflow-milestone-summary::-webkit-details-marker { display: none; }
.workflow-milestone-card > .workflow-milestone-summary::marker { display: none; content: ''; }
.workflow-milestone-card > .workflow-milestone-summary small { color: var(--muted); font-weight: 700; }
.workflow-milestone-card h3 { margin: 2px 0 0; color: var(--blue); font-size: 18px; }
.workflow-milestone-state { flex: 0 0 auto; display: grid; justify-items: end; }
.workflow-milestone-state strong { color: var(--blue); font-size: 20px; }
.workflow-milestone-state span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.workflow-milestone-content { min-width: 0; }
.workflow-milestone-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.workflow-progress { height: 4px; background: #edf2f2; }
.workflow-progress span { display: block; height: 100%; background: var(--green); transition: width .2s ease; }
.workflow-milestone-description { margin: 12px 18px 0; color: var(--muted); }
.workflow-task-list { padding: 7px 18px 13px; display: grid; }
.workflow-task-row { min-width: 0; padding: 11px 0; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #edf1f2; }
.workflow-task-row:last-child { border-bottom: 0; }
.workflow-task-check { width: 20px; height: 20px; display: grid; place-items: center; color: #fff; background: #fff; border: 2px solid #b9c5cb; border-radius: 4px; font-size: 12px; font-weight: 900; }
.workflow-task-row.is-done .workflow-task-check { background: var(--green); border-color: var(--green); }
.workflow-task-row.is-waiting .workflow-task-check { background: #fff7d6; border-color: #d8ad28; }
.workflow-task-copy { min-width: 0; }
.workflow-task-copy strong { display: block; overflow-wrap: anywhere; }
.workflow-task-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.workflow-task-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.workflow-task-meta small { color: var(--muted); white-space: nowrap; }
.workflow-task-meta .status-options { display: flex; flex-wrap: nowrap; }
.workflow-task-meta .status-options button { width: auto; padding: 7px 9px; font-size: 10px; }
.task-assignee-control { min-width: 150px; margin: 0; }
.task-assignee-control select { min-width: 0; width: 100%; max-width: 210px; padding-block: 7px; font-size: 11px; }
.task-assignee-readonly { min-width: 0; display: inline-flex; align-items: center; gap: 7px; color: var(--blue); font-size: 11px; font-weight: 800; }
.task-assignee-readonly .project-assignee-avatar { width: 26px; height: 26px; font-size: 9px; }
.task-assignee-empty,
.task-assignee-automatic { color: var(--muted); font-size: 11px; font-weight: 700; }
.task-assignee-automatic { color: var(--green-2); }

@media (max-width: 900px) {
    .workflow-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .workflow-overview .workflow-actions { grid-column: 1 / -1; justify-content: flex-start; border-top: 1px solid var(--line); }
    .workflow-task-row { grid-template-columns: 24px minmax(0, 1fr); align-items: start; }
    .workflow-task-meta { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
    .workflow-task-meta .status-options { flex-wrap: wrap; }
    .task-assignee-control { flex: 1 1 190px; }
    .task-assignee-control select { max-width: none; }
}

@media (max-width: 560px) {
    .workflow-overview { grid-template-columns: 1fr 1fr; }
    .workflow-overview > div:nth-child(2) { border-right: 0; }
    .workflow-overview > div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); border-right: 0; }
    .workflow-milestone { padding-left: 42px; }
    .workflow-timeline::before { left: 15px; }
    .workflow-marker { left: 0; width: 32px; height: 32px; border-width: 3px; }
    .workflow-marker span { width: 23px; height: 23px; }
    .workflow-milestone-card > .workflow-milestone-summary { min-height: 66px; padding: 13px 13px 10px; gap: 10px; }
    .workflow-milestone-card > .workflow-milestone-summary::after { content: '⌄'; align-self: center; color: var(--muted); font-size: 18px; font-weight: 700; }
    .workflow-milestone-card[open] > .workflow-milestone-summary::after { transform: rotate(180deg); }
    .workflow-milestone-card:not([open]) { background: #fbfcfc; }
    .workflow-milestone-card:not([open]) .workflow-milestone-summary { padding-bottom: 13px; }
    .workflow-milestone-state { margin-left: auto; padding-right: 4px; }
    .workflow-milestone-state strong { font-size: 16px; }
    .workflow-milestone-card h3 { font-size: 16px; }
    .workflow-task-list { padding-inline: 13px; }
    .workflow-milestone-actions { justify-content: stretch; padding: 0 13px 13px; }
    .workflow-milestone-actions > * { flex: 1 1 150px; }
    .workflow-task-row { grid-template-columns: 22px minmax(0, 1fr); }
    .workflow-task-meta { grid-column: 1 / -1; }
    .workflow-task-meta .status-options { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .workflow-task-meta .status-options button { width: 100%; }
    .task-assignee-control { width: 100%; }
}

/* Kompakter Projekt-Dateibrowser */
.project-file-browser { min-width: 0; display: grid; gap: 14px; }
.project-file-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 250px) auto auto; gap: 9px; align-items: center; }
.project-file-view-switch { display: inline-flex; padding: 3px; background: #edf1f2; border-radius: 6px; }
.project-file-view-switch button { padding: 8px 11px; color: var(--blue); background: transparent; }
.project-file-view-switch button.active { color: #fff; background: var(--blue); }
.project-file-browser-summary { min-height: 24px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.project-file-browser-summary strong { color: var(--green-2); }
.project-file-dropzone { min-height: 132px; padding: 22px; display: flex; align-items: center; justify-content: center; gap: 26px; border: 1px dashed #8fb0ea; border-radius: 7px; color: var(--blue); background: #fbfdff; cursor: pointer; text-align: center; transition: .15s ease; }
.project-file-dropzone:hover, .project-file-dropzone.is-dragging { border-color: #3268d5; background: #eef4ff; box-shadow: inset 0 0 0 2px rgba(50,104,213,.13); }
.project-file-dropzone > div { display: grid; gap: 4px; }
.project-file-dropzone strong { font-size: 15px; }
.project-file-dropzone span { color: var(--muted); font-size: 12px; }
.project-file-dropzone button { flex: 0 0 auto; color: #fff; background: #3f6ed4; font-size: 12px; }
.grundsteine-upload-category { display: grid; gap: 7px; margin-bottom: 20px; }
.grundsteine-upload-category input { width: 100%; }
.grundsteine-upload-category small { color: var(--muted); }
.grundsteine-upload-files { display: grid; gap: 9px; }
.grundsteine-upload-files > strong { font-size: 13px; }
.grundsteine-upload-files article { display: flex; align-items: center; gap: 11px; min-height: 60px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.grundsteine-upload-files article div { min-width: 0; display: grid; gap: 3px; }
.grundsteine-upload-files b { overflow-wrap: anywhere; }
.grundsteine-upload-files small { color: var(--muted); }
.grundsteine-file-icon { min-width: 40px; padding: 7px 4px; color: #e5504d; background: #fff2f2; border-radius: 4px; font-size: 10px; font-weight: 800; text-align: center; }
.project-file-group { min-width: 0; border: 1px solid var(--line); background: #fff; }
.project-file-group > header { padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f7f9fa; border-bottom: 1px solid var(--line); }
.project-file-group > header h3 { margin: 0; color: var(--blue); font-size: 15px; }
.project-file-group > header span { color: var(--muted); font-size: 12px; }
.project-file-table { min-width: 0; }
.project-file-table-head,
.project-file-table-row { min-width: 0; display: grid; grid-template-columns: 28px 62px minmax(180px, 1.35fr) minmax(120px, .65fr) minmax(190px, .85fr) auto; gap: 11px; align-items: center; }
.project-file-table-head { min-height: 34px; padding: 6px 12px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.project-file-table-row { min-height: 72px; padding: 8px 12px; border-bottom: 1px solid #edf1f2; }
.project-file-table-row:last-child { border-bottom: 0; }
.project-file-table-row:hover,
.project-file-table-row.is-selected { background: #f2faf7; }
.project-file-table-row .project-file-preview { width: 58px; height: 46px; border-radius: 4px; }
.project-file-select { width: 22px; height: 22px; margin: 0; display: block; overflow: visible; }
.project-file-select input { width: 18px; height: 18px; margin: 2px; accent-color: var(--green); }
.project-file-category,
.project-file-metadata { min-width: 0; display: grid; gap: 3px; }
.project-file-category span,
.project-file-metadata span { overflow-wrap: anywhere; font-weight: 700; }
.project-file-category small { width: fit-content; padding: 2px 6px; color: #9a2630; background: #fff0f1; border-radius: 3px; font-size: 10px; font-weight: 800; }
.project-file-metadata small { color: var(--muted); overflow-wrap: anywhere; }
.project-file-actions { display: flex; justify-content: flex-end; gap: 6px; }
.project-file-actions a { min-height: 34px; padding: 8px 10px; display: inline-flex; align-items: center; color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.project-file-actions button { min-height: 34px; padding: 8px 10px; font-size: 11px; }
.project-file-preview-grid { padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-file-preview-card { position: relative; min-width: 0; display: grid; grid-template-rows: 150px minmax(90px, auto) auto; border: 1px solid var(--line); background: #fff; }
.project-file-preview-card.is-selected { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.project-file-preview-card > .project-file-select { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 2px; background: #fff; border-radius: 4px; }
.project-file-preview-card > .project-file-preview { width: 100%; height: 150px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.project-file-preview-card > div:nth-of-type(1) { min-width: 0; padding: 12px; }
.project-file-preview-card h3 { margin: 3px 0; color: var(--blue); font-size: 15px; overflow-wrap: anywhere; }
.project-file-preview-card small { color: var(--muted); overflow-wrap: anywhere; }
.project-file-preview-category { color: var(--green-2); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.project-file-preview-card .project-file-actions { padding: 0 12px 12px; justify-content: flex-start; }
.project-file-empty { padding: 32px 20px; text-align: center; background: #fff; border: 1px dashed #cbd8db; }
.project-file-empty p { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 1200px) {
    .project-file-table-head { display: none; }
    .project-file-table-row { grid-template-columns: 28px 62px minmax(180px, 1fr) auto; }
    .project-file-category,
    .project-file-metadata { grid-column: 3; }
    .project-file-actions { grid-column: 4; grid-row: 1 / 4; }
    .project-file-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .project-file-toolbar { grid-template-columns: 1fr 1fr; }
    .project-file-toolbar input { grid-column: 1 / -1; }
    .project-file-toolbar > button { width: 100%; }
    .project-file-table-row { grid-template-columns: 26px 54px minmax(0, 1fr); align-items: start; }
    .project-file-table-row .project-file-preview { width: 50px; height: 48px; }
    .project-file-category,
    .project-file-metadata { grid-column: 3; }
    .project-file-actions { grid-column: 2 / -1; grid-row: auto; justify-content: flex-start; }
    .project-file-preview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
    .project-file-toolbar { grid-template-columns: 1fr; }
    .project-file-toolbar input { grid-column: auto; }
    .project-file-view-switch { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Interne Datei- und PDF-Vorschau für Browser und PWA */
.project-file-preview {
    padding: 0;
    color: var(--blue);
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
}
.project-file-preview:hover { background: #eef4f5; }
.project-file-title-button { width: fit-content; max-width: 100%; padding: 0; color: inherit; background: transparent; text-align: left; text-transform: none; letter-spacing: 0; white-space: normal; }
.project-file-title-button:hover { color: var(--green-2); background: transparent; }
.project-file-actions button { min-height: 34px; }

.file-preview-dialog {
    width: min(1180px, calc(100vw - 28px));
    height: min(880px, calc(100vh - 28px));
    max-width: none;
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.file-preview-dialog::backdrop { background: rgba(21, 22, 56, .58); }
.file-preview-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.file-preview-shell > header { min-width: 0; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.file-preview-shell > header h2 { margin: 1px 0 0; overflow-wrap: anywhere; }
.file-preview-body { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: auto; background: #e9eef0; }
.file-preview-body img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.file-preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.file-preview-unavailable { max-width: 440px; padding: 24px; text-align: center; background: #fff; border: 1px solid var(--line); }
.file-preview-shell > footer { padding: 10px 16px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.file-preview-shell > footer a { min-height: 38px; padding: 9px 13px; display: inline-flex; align-items: center; color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: 12px; font-weight: 800; text-transform: uppercase; }

@media (max-width: 700px) {
    .file-preview-dialog { width: 100vw; height: calc(100vh - var(--app-mobile-bar-height)); margin: var(--app-mobile-bar-height) 0 0; border: 0; border-radius: 0; }
    .file-preview-shell > header { padding: 10px 12px; }
    .file-preview-shell > header h2 { font-size: 16px; }
    .file-preview-shell > footer { padding: 8px 12px; }
}


/* project-task-deletion-v2 */
.workflow-milestone-head-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
}
.workflow-delete-button {
    width: auto;
    border: 1px solid #e8b8b8;
    background: #fff;
    color: #a32626;
    box-shadow: none;
}
.workflow-delete-button:hover,
.workflow-delete-button:focus-visible {
    border-color: #c94141;
    background: #fff1f1;
    color: #861b1b;
}
.workflow-task-delete {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    font-size: 19px;
    line-height: 1;
}
.workflow-group-delete {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}
.workflow-global-wait {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #dfe8e7;
    border-radius: 6px;
    background: #fbfcfc;
}
.workflow-global-wait > div {
    display: grid;
    gap: 3px;
}
.workflow-global-wait strong {
    color: #17234f;
}
.workflow-global-wait small {
    color: #68758c;
}
.workflow-global-wait.is-active {
    border-color: #e6c66b;
    background: #fffaf0;
}
.workflow-global-wait .badge {
    width: fit-content;
    color: #8a6500;
    background: #fff0bf;
}
.workflow-deadline-protection {
    font-size: 11px;
    white-space: nowrap;
}
.workflow-deadline-protection.is-protected {
    border-color: #d68d30;
    color: #875100;
    background: #fff5df;
}
@media (max-width: 760px) {
    .workflow-milestone-head-actions {
        flex-direction: column;
        align-items: flex-end;
    }
    .workflow-group-delete {
        white-space: normal;
    }
    .workflow-global-wait {
        align-items: stretch;
        flex-direction: column;
    }
}

.document-review-workspace .document-review-invoice-panel {
    margin: 16px 0;
    padding: 18px;
    border: 1px solid var(--line);
    background: #fff;
}
.document-review-workspace .document-review-invoice-panel > header,
.document-review-workspace .document-review-invoice-summary,
.document-review-workspace .document-review-invoice-check > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.document-review-workspace .document-review-invoice-panel h3,
.document-review-workspace .document-review-invoice-panel p { margin: 4px 0 0; }
.document-review-workspace .document-review-invoice-summary span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 13px;
}
.document-review-workspace .document-review-invoice-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.document-review-workspace .document-review-invoice-check {
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid #82909d;
    background: var(--surface-soft);
}
.document-review-workspace .document-review-invoice-check.is-pass { border-left-color: #1f9d72; }
.document-review-workspace .document-review-invoice-check.is-conflict {
    border-left-color: #d74646;
    background: #fff7f7;
}
.document-review-workspace .document-review-invoice-check header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.document-review-workspace .document-review-invoice-check header span,
.document-review-workspace .document-review-invoice-check p {
    color: var(--muted-text);
    font-size: 13px;
}
.document-review-workspace .document-review-position-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, auto);
    align-items: end;
    gap: 18px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-left: 4px solid #348fc0;
    background: #f5fafc;
}
.document-review-workspace .document-review-position-tools h3,
.document-review-workspace .document-review-position-tools p { margin: 3px 0 0; }
.document-review-workspace .document-review-position-tools p {
    max-width: 75ch;
    color: var(--muted-text);
    font-size: 13px;
    line-height: 1.5;
}
.document-review-workspace .document-review-position-controls {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: end;
    gap: 9px;
}
.document-review-workspace .document-review-position-controls label {
    display: grid;
    gap: 4px;
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 750;
}
.document-review-workspace .document-review-position-controls input { min-width: 0; }
.document-review-workspace .document-review-position-select {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid #cddde3;
    background: #f5f9fa;
    color: #40546a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.document-review-workspace .document-review-position-select input { width: 17px; height: 17px; margin: 0; }
.document-review-workspace .document-review-image-stage.is-pdf { background: #fff; }
.document-review-workspace .document-review-image-stage.is-pdf img { min-height: 240px; }
.document-review-workspace .document-review-image-stage img {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    object-fit: fill;
}
@media (max-width: 720px) {
    .document-review-workspace .document-review-invoice-panel > header,
    .document-review-workspace .document-review-invoice-check > div {
        align-items: flex-start;
        flex-direction: column;
    }
    .document-review-workspace .document-review-invoice-checks { grid-template-columns: 1fr; }
    .document-review-workspace .document-review-position-tools,
    .document-review-workspace .document-review-position-controls { grid-template-columns: 1fr; }
    .document-review-workspace .document-review-position-controls button { width: 100%; min-height: 44px; }
}
.cad-sql-hub .cad-sql-operation-notice {
    display: grid;
    gap: 4px;
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid #e1bd50;
    border-left: 4px solid #d49b00;
    background: #fff9e8;
    color: #2a3444;
}

.cad-sql-hub .cad-sql-operation-notice.is-success {
    border-color: #8acdb6;
    border-left-color: #1f9d72;
    background: #effaf5;
}

.cad-sql-hub .cad-sql-operation-notice span {
    line-height: 1.45;
}

.cad-sql-hub .cad-sql-operation-notice small {
    color: var(--muted-text);
}

/* Project templates V2 */
.template-v2-workspace,
.project-template-v2-config,
.project-template-v2-summary,
.template-v2-compare {
    color: var(--text);
}
.template-v2-workspace {
    display: grid;
    gap: 18px;
}
.template-v2-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}
.template-v2-tabs button {
    min-height: 44px;
    padding: 10px 15px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--muted);
    white-space: nowrap;
}
.template-v2-tabs button.active {
    border-bottom-color: var(--green);
    color: var(--green-2);
    background: var(--surface-soft);
}
.template-v2-panel { min-width: 0; }
.template-v2-grid,
.template-v2-deadlines {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 14px;
}
.template-v2-card,
.template-v2-deadline-card {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
}
.template-v2-card > header,
.template-v2-deadline-card > header,
.project-template-v2-summary > header,
.template-v2-config-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.template-v2-card header h2,
.template-v2-deadline-card header h2,
.project-template-v2-summary h2 {
    margin: 3px 0 0;
    font-size: 18px;
}
.template-v2-card header small,
.template-v2-deadline-card header small,
.project-template-v2-summary header small,
.template-v2-config-head small {
    color: var(--green-2);
    font-size: 11px;
    font-weight: 800;
}
.template-v2-card header code {
    max-width: 45%;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 11px;
}
.template-v2-card.is-inactive { opacity: .68; }
.template-v2-card p,
.project-template-v2-summary p { margin: 0; line-height: 1.5; }
.template-v2-module-list,
.template-v2-facts,
.template-v2-project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.template-v2-module-list span,
.template-v2-facts span,
.template-v2-project-meta > span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 12px;
}
.template-v2-facts span { color: var(--muted); }
.template-v2-warning,
.template-v2-dependency-note {
    padding: 9px 11px;
    border-left: 3px solid #d49b00;
    background: #fff9e8;
    color: #6d5200;
}
.template-v2-deadline-list,
.template-v2-preview-groups {
    display: grid;
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
}
.template-v2-deadline-list > div,
.template-v2-preview-groups > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    background: #fff;
}
.template-v2-deadline-list span,
.template-v2-preview-groups span {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}
.project-template-v2-config {
    display: grid;
    gap: 14px;
    margin-top: 14px;
    padding: 15px;
    border: 1px solid #b8dcd0;
    border-left: 4px solid var(--green);
    background: #f5fbf8;
}
.template-v2-config-head strong { display: block; margin-top: 3px; font-size: 17px; }
.template-v2-config-head > span { color: var(--muted); font-size: 12px; }
.template-v2-module-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 8px;
}
.template-v2-module-options label {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
}
.template-v2-module-options input { width: 18px; height: 18px; margin: 2px 0 0; }
.template-v2-module-options span { display: grid; gap: 3px; min-width: 0; }
.template-v2-module-options small { color: var(--muted); line-height: 1.35; }
.template-v2-preview { display: grid; gap: 10px; }
.template-v2-preview-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: #fff;
}
.template-v2-preview-summary > * { padding: 10px; text-align: center; }
.template-v2-preview-summary > * + * { border-left: 1px solid var(--line); }
.project-template-v2-summary {
    display: grid;
    gap: 14px;
    padding: 17px;
    border: 1px solid #b8dcd0;
    border-left: 4px solid var(--green);
    background: #fff;
}
.project-template-v2-summary > .project-template-v2-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    list-style: none;
    cursor: pointer;
}
.project-template-v2-summary > .project-template-v2-summary-head::-webkit-details-marker { display: none; }
.project-template-v2-summary > .project-template-v2-summary-head::marker { display: none; content: ''; }
.project-template-v2-summary-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}
.project-template-v2-summary-head small { color: var(--green-2); font-size: 11px; font-weight: 750; }
.project-template-v2-summary-state { flex: 0 0 auto; padding: 5px 8px; color: var(--green-2); border: 1px solid #b8dcd0; border-radius: 999px; background: #f1fbf6; font-size: 11px; font-weight: 800; }
.project-template-v2-summary-content { display: grid; gap: 14px; }
.template-v2-summary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}
.template-v2-update-badge {
    padding: 6px 9px;
    background: #fff0bf;
    color: #765700;
    font-size: 12px;
    font-weight: 750;
}
.template-v2-project-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 7px;
}
.template-v2-project-module {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}
.template-v2-project-module strong { overflow-wrap: anywhere; }
.template-v2-project-module span { color: var(--muted); font-size: 11px; }
.template-v2-project-module.is-blocked {
    border-color: #e1bd50;
    background: #fff9e8;
}

@media (max-width: 720px) {
    .template-v2-grid,
    .template-v2-deadlines,
    .template-v2-module-options,
    .template-v2-project-modules { grid-template-columns: 1fr; }
    .template-v2-card > header,
    .template-v2-deadline-card > header,
    .project-template-v2-summary > .project-template-v2-summary-head,
    .template-v2-config-head,
    .template-v2-deadline-list > div,
    .template-v2-preview-groups > div {
        align-items: stretch;
        flex-direction: column;
    }
    .template-v2-card header code { max-width: none; }
    .template-v2-deadline-list span,
    .template-v2-preview-groups span { text-align: left; }
    .template-v2-preview-summary { grid-template-columns: 1fr; }
    .template-v2-preview-summary > * + * { border-top: 1px solid var(--line); border-left: 0; }
    .template-v2-summary-actions { align-items: stretch; flex-direction: column; }
    .template-v2-summary-actions button { width: 100%; min-height: 44px; }
    .project-template-v2-summary { gap: 10px; padding: 14px; }
    .project-template-v2-summary-head p { display: none; }
    .project-template-v2-summary-head::after { content: '⌄'; align-self: center; color: var(--muted); font-size: 18px; font-weight: 700; }
    .project-template-v2-summary[open] > .project-template-v2-summary-head::after { transform: rotate(180deg); }
    .project-template-v2-summary-state { font-size: 10px; }
}

/* SYSTEM-MONITOR-LIGHT-COCKPIT-V1-1: Gauges mit integriertem Verlauf und CPU-Core-Details. */
.system-monitor-gauge-card{grid-template-areas:"gauge copy" "trend trend" "meta meta";align-items:start}.system-monitor-gauge{grid-area:gauge}.system-monitor-gauge-copy{grid-area:copy;align-self:center}.system-monitor-gauge-card .system-monitor-sparkline{grid-area:trend}.system-monitor-gauge-meta{grid-area:meta}.system-monitor-live-card-trend .system-monitor-live-trends{display:grid;gap:8px;margin-top:8px}.system-monitor-sparkline{display:grid;gap:4px}.system-monitor-sparkline header{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#607183;font-size:10px;font-weight:800}.system-monitor-sparkline header strong{color:var(--monitor-cockpit-navy);font-size:10px}.system-monitor-sparkline svg{display:block;width:100%;height:56px;border-radius:6px;background:linear-gradient(180deg,#f8fbfc,#eef4f7)}.system-monitor-sparkline .sparkline-area{fill:rgba(18,181,221,.12)}.system-monitor-sparkline .sparkline-line{fill:none;stroke:#12b5dd;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.system-monitor-sparkline.is-ram .sparkline-area{fill:rgba(63,76,123,.12)}.system-monitor-sparkline.is-ram .sparkline-line{stroke:#3f4c7b}.system-monitor-sparkline.is-disk .sparkline-area{fill:rgba(76,127,153,.12)}.system-monitor-sparkline.is-disk .sparkline-line{stroke:#4c7f99}.system-monitor-sparkline.is-downstream .sparkline-area{fill:rgba(167,25,73,.09)}.system-monitor-sparkline.is-downstream .sparkline-line{stroke:#a71949}.system-monitor-sparkline.is-upstream .sparkline-area{fill:rgba(128,85,208,.10)}.system-monitor-sparkline.is-upstream .sparkline-line{stroke:#8055d0}.system-monitor-core-meters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.system-monitor-core-meters span{display:grid;gap:3px;padding:6px;border:1px solid #dbe6ea;border-radius:6px;background:#fbfcfd}.system-monitor-core-meters b{color:#617285;font-size:9px}.system-monitor-core-meters i{display:block;height:5px;border-radius:99px;background:#e2eaee;overflow:hidden}.system-monitor-core-meters em{display:block;width:var(--core-value);height:100%;background:#18a873;border-radius:inherit}.system-monitor-core-meters small{color:#183247;font-size:9px;font-weight:700}.system-monitor-live-card-trend{align-content:start}.system-monitor-live-card-trend .system-monitor-sparkline svg{height:42px}.system-monitor-live-card-trend .system-monitor-sparkline header strong{font-size:9px}.system-monitor-live-card-trend .system-monitor-sparkline header span{font-size:9px}@media(max-width:767px){.system-monitor-core-meters{grid-template-columns:repeat(2,minmax(0,1fr))}.system-monitor-live-card-trend{grid-column:1/-1}}@media(max-width:430px){.system-monitor-gauge-card{grid-template-areas:"gauge" "copy" "trend" "meta"}}
\n\n
/* SYSTEM-MONITOR-LIGHT-COCKPIT-V1-2: konsolidierte KPI-Karten, Core-Ringe, Speedometer und Detailanalyse. */
.system-monitor-cockpit-v12-grid{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:10px!important;
    margin-top:10px;
}
.system-monitor-cockpit-v12-grid>.is-cpu-card{grid-column:span 2}
.system-monitor-network-card{grid-column:span 2}
.system-monitor-uptime-card{grid-column:span 1}
.system-monitor-fleet-card-v12{grid-column:span 3}
.system-monitor-cockpit-v12-grid .system-monitor-gauge-card{
    min-height:0;
}
.system-monitor-cockpit-v12-grid>.is-cpu-card{
    grid-template-columns:118px minmax(0,1fr);
    grid-template-areas:"gauge copy" "trend trend" "meta meta";
}
.system-monitor-cockpit-v12-grid>.is-load-card,
.system-monitor-cockpit-v12-grid>.is-swap-card{
    grid-template-areas:"gauge copy" "trend trend" "meta meta";
}
.system-monitor-core-meters{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
}
.system-monitor-core-ring{
    min-width:0;
    display:grid!important;
    justify-items:center;
    gap:5px!important;
    padding:6px!important;
    border:1px solid #dbe6ea!important;
    border-radius:8px!important;
    background:#fbfcfd!important;
}
.system-monitor-core-ring>i{
    --core-ring:#18a873;
    width:52px;
    height:52px!important;
    display:grid!important;
    place-items:center;
    border-radius:50%!important;
    background:
        radial-gradient(circle at center,#fff 0 59%,transparent 60%),
        conic-gradient(var(--core-ring) calc(var(--core-value) * 1%),#e1e9eb 0)!important;
    overflow:visible!important;
}
.system-monitor-core-ring.is-warning>i{--core-ring:#d2a11b}
.system-monitor-core-ring.is-danger>i{--core-ring:#d84a4a}
.system-monitor-core-ring>i>strong{
    color:var(--monitor-cockpit-navy);
    font-size:10px;
    line-height:1;
}
.system-monitor-core-ring>b{
    color:#607183!important;
    font-size:9px!important;
    line-height:1!important;
}
.system-monitor-core-ring>small{display:none}

.system-monitor-network-card,
.system-monitor-uptime-card{
    min-width:0;
    border:1px solid var(--monitor-cockpit-line);
    border-radius:7px;
    background:#fff;
    box-shadow:0 3px 12px rgba(18,49,67,.045);
}
.system-monitor-network-card{
    overflow:hidden;
}
.system-monitor-network-card>header{
    min-height:42px;
    padding:9px 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border-bottom:1px solid #dbe5e8;
    background:#f7faf9;
}
.system-monitor-network-card h2{
    margin:1px 0 0;
    color:var(--monitor-cockpit-navy);
    font-size:13px;
}
.system-monitor-speedometer-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    padding:12px 14px 8px;
}
.system-monitor-speedometer{
    min-width:0;
}
.system-monitor-speedometer header{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:8px;
    color:#617285;
    font-size:10px;
    font-weight:800;
}
.system-monitor-speedometer header strong{
    color:var(--monitor-cockpit-navy);
    font-size:12px;
    white-space:nowrap;
}
.system-monitor-speedometer svg{
    width:100%;
    height:auto;
    max-height:145px;
    overflow:visible;
}
.system-monitor-speedometer-track,
.system-monitor-speedometer-progress{
    fill:none;
    stroke-width:12;
    stroke-linecap:round;
}
.system-monitor-speedometer-track{stroke:#e2eaee}
.system-monitor-speedometer-progress{stroke:#a71949}
.system-monitor-speedometer.is-upstream .system-monitor-speedometer-progress{stroke:#8055d0}
.system-monitor-speedometer-needle{
    stroke:#173c57;
    stroke-width:3;
    stroke-linecap:round;
}
.system-monitor-speedometer-hub{fill:#173c57}
.system-monitor-speedometer text{
    fill:#738494;
    font-size:10px;
    font-weight:700;
}
.system-monitor-speedometer .system-monitor-speedometer-unit{
    fill:#607183;
    font-size:10px;
}
.system-monitor-network-card>footer{
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:9px 12px;
    border-top:1px solid #e0e8ea;
    color:#657789;
    background:#fbfcfc;
    font-size:9px;
}
.system-monitor-network-card>footer small{
    color:#7a8996;
    text-align:right;
}

.system-monitor-uptime-card{
    min-height:118px;
    padding:15px;
    display:grid;
    align-content:center;
    gap:4px;
    border-left:4px solid var(--monitor-cockpit-green);
}
.system-monitor-uptime-card>strong{
    color:var(--monitor-cockpit-navy);
    font-size:22px;
}
.system-monitor-uptime-card>small{
    color:#718191;
    font-size:10px;
}
.system-monitor-fleet-card-v12{
    align-self:stretch;
}
.system-monitor-fleet-card-v12 .system-monitor-fleet-bars{
    grid-template-columns:repeat(3,minmax(0,1fr));
}
.system-monitor-fleet-card-v12 .system-monitor-fleet-bars>div{
    grid-template-columns:minmax(95px,.85fr) minmax(0,1.2fr) 28px;
}

.system-monitor-detail-analysis{
    margin-top:10px;
    border:1px solid var(--monitor-cockpit-line);
    border-radius:7px;
    background:#fff;
    box-shadow:0 3px 12px rgba(18,49,67,.035);
    overflow:hidden;
}
.system-monitor-detail-analysis>summary{
    min-height:54px;
    padding:10px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    cursor:pointer;
    list-style:none;
    background:#f7faf9;
}
.system-monitor-detail-analysis>summary::-webkit-details-marker{display:none}
.system-monitor-detail-analysis>summary span{
    display:grid;
    gap:2px;
}
.system-monitor-detail-analysis>summary b{
    color:var(--monitor-cockpit-navy);
    font-size:12px;
}
.system-monitor-detail-analysis>summary small{
    color:#748393;
    font-size:9px;
}
.system-monitor-detail-analysis>summary em{
    padding:5px 8px;
    border:1px solid #d7e4e7;
    border-radius:99px;
    color:#607183;
    background:#fff;
    font-size:9px;
    font-style:normal;
    white-space:nowrap;
}
.system-monitor-detail-analysis>summary::after{
    content:"▾";
    color:#607183;
    font-size:14px;
}
.system-monitor-detail-analysis[open]>summary::after{transform:rotate(180deg)}
.system-monitor-detail-analysis-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    padding:10px;
    margin:0!important;
    border-top:1px solid #dbe5e8;
}
.system-monitor-detail-analysis-grid>.system-monitor-chart:nth-child(3){
    grid-column:1/-1;
}
.system-monitor-chart-area{
    opacity:.12;
    pointer-events:none;
}
.system-monitor-chart-area.is-cpu{fill:var(--monitor-cpu)}
.system-monitor-chart-area.is-ram{fill:var(--monitor-ram)}
.system-monitor-chart-area.is-downstream{fill:var(--monitor-downstream)}
.system-monitor-chart-area.is-upstream{fill:var(--monitor-upstream)}
.system-monitor-chart-area.is-load{fill:var(--monitor-load)}
.system-monitor-chart-area.is-disk{fill:var(--monitor-disk)}
.system-monitor-detail-analysis .system-monitor-chart-gridline{
    stroke:#d5e2e7;
    stroke-dasharray:3 4;
}

@media(min-width:768px) and (max-width:1199px){
    .system-monitor-cockpit-v12-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
    }
    .system-monitor-cockpit-v12-grid>.is-cpu-card,
    .system-monitor-network-card,
    .system-monitor-uptime-card,
    .system-monitor-fleet-card-v12{
        grid-column:1/-1;
    }
    .system-monitor-fleet-card-v12 .system-monitor-fleet-bars{
        grid-template-columns:1fr;
    }
    .system-monitor-detail-analysis-grid{
        grid-template-columns:1fr!important;
    }
    .system-monitor-detail-analysis-grid>.system-monitor-chart:nth-child(3){
        grid-column:auto;
    }
}
@media(max-width:767px){
    .system-monitor-cockpit-v12-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
    }
    .system-monitor-cockpit-v12-grid>.is-cpu-card,
    .system-monitor-network-card,
    .system-monitor-uptime-card,
    .system-monitor-fleet-card-v12{
        grid-column:1/-1;
    }
    .system-monitor-cockpit-v12-grid>.is-cpu-card{
        grid-template-columns:84px minmax(0,1fr);
        grid-template-areas:"gauge copy" "trend trend" "meta meta"!important;
        text-align:left;
    }
    .system-monitor-cockpit-v12-grid>.is-cpu-card .system-monitor-gauge{
        width:78px;
        height:78px;
    }
    .system-monitor-core-meters{
        grid-template-columns:repeat(4,minmax(0,1fr));
        gap:5px;
    }
    .system-monitor-core-ring{
        padding:5px 2px!important;
    }
    .system-monitor-core-ring>i{
        width:43px;
        height:43px!important;
    }
    .system-monitor-core-ring>i>strong{font-size:8px}
    .system-monitor-core-ring>b{font-size:8px!important}
    .system-monitor-speedometer-grid{
        gap:7px;
        padding:10px 8px 6px;
    }
    .system-monitor-speedometer header{
        display:grid;
        gap:1px;
    }
    .system-monitor-speedometer header strong{font-size:10px}
    .system-monitor-network-card>footer{
        flex-direction:column;
        gap:3px;
    }
    .system-monitor-network-card>footer small{text-align:left}
    .system-monitor-fleet-card-v12 .system-monitor-fleet-bars{
        grid-template-columns:1fr;
    }
    .system-monitor-detail-analysis>summary small{display:none}
    .system-monitor-detail-analysis-grid{
        grid-template-columns:1fr!important;
        gap:8px!important;
        padding:8px;
    }
    .system-monitor-detail-analysis-grid>.system-monitor-chart:nth-child(3){
        grid-column:auto;
    }
}
@media(max-width:430px){
    .system-monitor-cockpit-v12-grid>.is-cpu-card{
        grid-template-areas:"gauge copy" "trend trend" "meta meta"!important;
        justify-items:stretch;
        text-align:left;
    }
    .system-monitor-cockpit-v12-grid>.is-ram-card,
    .system-monitor-cockpit-v12-grid>.is-disk-card,
    .system-monitor-cockpit-v12-grid>.is-load-card,
    .system-monitor-cockpit-v12-grid>.is-swap-card{
        grid-template-areas:"gauge" "copy" "trend" "meta"!important;
        justify-items:center;
        text-align:center;
    }
}
\n

/* SYSTEM-MONITOR-LIGHT-COCKPIT-V1-3: gesunder Normalzustand kompakt, Diagnostik nur bei Bedarf. */
.system-monitor-service-issue-alert{
    margin-top:10px;
    padding:11px 13px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    border:1px solid #e7cf84;
    border-left:4px solid #d2a11b;
    border-radius:7px;
    background:#fffaf0;
}
.system-monitor-service-issue-alert.is-danger{
    border-color:#ebbbbb;
    border-left-color:#d84a4a;
    background:#fff5f5;
}
.system-monitor-service-issue-alert>div{
    min-width:0;
    display:grid;
    gap:2px;
}
.system-monitor-service-issue-alert strong{
    color:var(--monitor-cockpit-navy);
    font-size:13px;
}
.system-monitor-service-issue-alert small{
    color:#6d7c8c;
    font-size:10px;
    line-height:1.35;
    overflow-wrap:anywhere;
}
.system-monitor-service-issue-alert button{
    flex:0 0 auto;
    min-height:34px;
    padding:7px 10px;
    font-size:10px;
}

.system-monitor-uptime-strip{
    min-height:58px;
    margin-top:10px;
    padding:10px 14px;
    display:grid;
    grid-template-columns:auto auto minmax(0,1fr);
    align-items:center;
    gap:10px 14px;
    border:1px solid var(--monitor-cockpit-line);
    border-left:4px solid var(--monitor-cockpit-green);
    border-radius:7px;
    background:#fff;
    box-shadow:0 3px 12px rgba(18,49,67,.035);
}
.system-monitor-uptime-strip strong{
    color:var(--monitor-cockpit-navy);
    font-size:18px;
}
.system-monitor-uptime-strip small{
    justify-self:end;
    color:#718191;
    font-size:10px;
}

.system-monitor-cad-connection{
    margin-top:12px;
    overflow:hidden;
    border:1px solid #cfe2dc;
    border-left:4px solid var(--monitor-cockpit-green);
    border-radius:8px;
    background:#fff;
    box-shadow:0 3px 12px rgba(18,49,67,.04);
}
.system-monitor-cad-connection.is-warning{border-left-color:#d2a11b}
.system-monitor-cad-connection.is-danger{border-left-color:#d84a4a}
.system-monitor-cad-connection.is-neutral{border-left-color:#8395a5}
.system-monitor-cad-connection>summary{
    min-height:66px;
    padding:10px 13px;
    display:grid;
    grid-template-columns:minmax(190px,.7fr) minmax(0,1.8fr) auto;
    align-items:center;
    gap:10px 16px;
    cursor:pointer;
    list-style:none;
    background:#fff;
}
.system-monitor-cad-connection>summary::-webkit-details-marker{display:none}
.system-monitor-cad-connection>summary>div:first-child{
    min-width:0;
    display:grid;
    gap:2px;
}
.system-monitor-cad-connection>summary strong{
    color:var(--monitor-cockpit-navy);
    font-size:15px;
}
.system-monitor-cad-connection-facts{
    min-width:0;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}
.system-monitor-cad-connection-facts span{
    min-width:0;
    padding:5px 8px;
    border:1px solid #dce6e8;
    border-radius:99px;
    color:#526779;
    background:#f8faf9;
    font-size:9px;
    font-weight:700;
    overflow-wrap:anywhere;
}
.system-monitor-cad-connection>summary em{
    color:#08785a;
    font-size:9px;
    font-style:normal;
    font-weight:800;
    white-space:nowrap;
}
.system-monitor-cad-connection>summary::after{
    content:"▾";
    color:#607183;
    font-size:13px;
}
.system-monitor-cad-connection[open]>summary{
    border-bottom:1px solid #dbe5e8;
    background:#f7faf9;
}
.system-monitor-cad-connection[open]>summary::after{transform:rotate(180deg)}
.system-monitor-cad-connection-body{
    padding:10px;
    background:#eef3f4;
}
.system-monitor-cad-connection-body .cad-sql-admin-status{
    margin:0;
    border-radius:7px;
    box-shadow:none;
}
.system-monitor-cad-connection-body .cad-sql-admin-status .card-head-inline{
    margin-bottom:0;
}

@media(max-width:900px){
    .system-monitor-cad-connection>summary{
        grid-template-columns:1fr auto;
    }
    .system-monitor-cad-connection-facts{
        grid-column:1/-1;
        order:3;
    }
}
@media(max-width:767px){
    .system-monitor-service-issue-alert{
        align-items:stretch;
        flex-direction:column;
    }
    .system-monitor-service-issue-alert button{
        width:100%;
    }
    .system-monitor-uptime-strip{
        grid-template-columns:1fr auto;
    }
    .system-monitor-uptime-strip small{
        grid-column:1/-1;
        justify-self:start;
    }
    .system-monitor-cad-connection>summary{
        grid-template-columns:1fr;
        align-items:start;
    }
    .system-monitor-cad-connection>summary em{
        white-space:normal;
    }
    .system-monitor-cad-connection-facts{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .system-monitor-cad-connection-facts span{
        border-radius:6px;
        line-height:1.25;
    }
}


/* SYSTEM-MONITOR-LIGHT-COCKPIT-V1-3-1 */
.system-monitor-gauge-card-v131 {
    gap: 12px;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-head {
    display: grid;
    grid-template-columns: minmax(132px, 152px) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge.system-monitor-gauge-centered {
    justify-self: center;
    align-self: center;
    margin-inline: auto;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
    align-content: center;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy strong {
    display: none !important;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy > span {
    color: var(--monitor-cockpit-navy, #0f3554);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy > small {
    color: #5e7284;
    font-size: 12px;
    line-height: 1.35;
}
@media (max-width: 900px) {
    .system-monitor-gauge-card-v131 .system-monitor-gauge-head {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 10px;
    }
    .system-monitor-gauge-card-v131 .system-monitor-gauge-copy {
        justify-items: center;
        text-align: center;
    }
}

/* SYSTEM-MONITOR-LIGHT-COCKPIT-V1-3-2: Gauge-Grid-Areas zurücksetzen; Ring, Titel und Detail sauber stapeln. */
.system-monitor-gauge-card-v131 {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: none !important;
    justify-items: stretch;
    align-items: start;
}
.system-monitor-gauge-card-v131 > .system-monitor-gauge-head,
.system-monitor-gauge-card-v131 > .system-monitor-sparkline,
.system-monitor-gauge-card-v131 > .system-monitor-gauge-meta {
    grid-area: auto !important;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-head {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: none !important;
    justify-items: center;
    align-items: start;
    gap: 8px;
    text-align: center;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-head > .system-monitor-gauge,
.system-monitor-gauge-card-v131 .system-monitor-gauge-head > .system-monitor-gauge-copy {
    grid-area: auto !important;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge.system-monitor-gauge-centered {
    justify-self: center !important;
    align-self: center !important;
    margin: 0 auto !important;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy {
    width: 100%;
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 3px;
    text-align: center;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy > span {
    display: block;
    max-width: 100%;
    color: var(--monitor-cockpit-navy, #0f3554);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy > small {
    display: block;
    max-width: 100%;
    color: #68798a;
    font-size: 10px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.system-monitor-gauge-card-v131 .system-monitor-gauge-copy > strong {
    display: none !important;
}
.system-monitor-cockpit-v12-grid > .is-cpu-card.system-monitor-gauge-card-v131 {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: none !important;
}
@media (max-width: 767px) {
    .system-monitor-cockpit-v12-grid > .is-cpu-card.system-monitor-gauge-card-v131,
    .system-monitor-cockpit-v12-grid > .system-monitor-gauge-card-v131 {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: none !important;
        justify-items: stretch !important;
        text-align: center !important;
    }
    .system-monitor-gauge-card-v131 .system-monitor-gauge-head {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: none !important;
        justify-items: center !important;
        text-align: center !important;
    }
}
@media (max-width: 430px) {
    .system-monitor-gauge-card-v131 {
        grid-template-areas: none !important;
    }
}

/* ENERKLAR SYSTEMVORLAGEN PWA UI V4 START */

/* Übersicht: klarer Arbeitskopf statt Kartenwand ohne Orientierung. */
.template-v4-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(210px, .65fr) auto;
    gap: 10px;
    align-items: center;
    margin: 2px 0 16px;
}
.template-v4-toolbar input,
.template-v4-toolbar select { min-height: 42px; }
.template-v4-result {
    justify-self: end;
    color: var(--muted, #647585);
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}
.template-v4-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.template-v4-stats > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 12px 15px;
    border-right: 1px solid var(--line);
}
.template-v4-stats > div:last-child { border-right: 0; }
.template-v4-stats strong {
    color: #12314c;
    font-size: 1.02rem;
    line-height: 1.2;
}
.template-v4-stats span {
    color: var(--muted, #647585);
    font-size: .72rem;
    line-height: 1.25;
}

#templateList.template-v4-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    align-items: stretch;
}
#templateList.template-v4-grid > .template-v4-card[hidden] { display: none !important; }
.template-v4-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 16px;
    border-radius: 13px;
    box-shadow: var(--shadow-soft);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.template-v4-card:hover {
    border-color: #b8d8cd;
    box-shadow: 0 10px 26px rgba(15, 47, 72, .08);
    transform: translateY(-1px);
}
.template-v4-card > header {
    align-items: flex-start;
    gap: 10px;
}
.template-v4-card > header small {
    color: var(--green-2);
    font-weight: 800;
    letter-spacing: .025em;
}
.template-v4-card > header h2 {
    margin-top: 3px;
    font-size: 1rem;
    line-height: 1.2;
}
.template-v4-editable-badge { white-space: nowrap; }
.template-v4-card .template-v2-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}
.template-v4-card .template-v2-facts > span {
    padding: 4px 7px;
    border: 1px solid #e2ebef;
    border-radius: 7px;
    background: #f8fafb;
    color: #617484;
    font-size: .7rem;
    line-height: 1.2;
}
.template-v4-card .template-v2-deadline-list {
    display: grid;
    gap: 0;
    margin-top: 2px;
    border: 0;
    background: transparent;
}
.template-v4-card .template-v2-deadline-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 9px 2px;
    border: 0;
    border-bottom: 1px solid #e8eef1;
    background: transparent;
}
.template-v4-card .template-v2-deadline-list > div[hidden],
.template-v4-card .template-v4-phase-preview-hidden { display: none !important; }
.template-v4-card .template-v2-deadline-list strong {
    min-width: 0;
    overflow: hidden;
    font-size: .78rem;
    line-height: 1.3;
    text-overflow: ellipsis;
}
.template-v4-card .template-v2-deadline-list span {
    color: var(--muted, #647585);
    font-size: .68rem;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}
.template-v4-more {
    margin: 6px 2px 0;
    color: var(--green-2);
    font-size: .72rem;
    font-weight: 800;
}
.template-v4-mobile-phases { display: none; }
.template-v4-card > .form-actions {
    margin-top: auto;
    padding-top: 12px;
}
.template-v4-open-button { min-height: 38px; }

/* Editor: Phase auswählen, nur zugehörige Aufgaben bearbeiten. Alle Originalfelder bleiben im DOM. */
.template-v4-editor-modal {
    width: min(1180px, calc(100vw - 28px)) !important;
    max-width: 1180px !important;
    max-height: calc(100dvh - 24px) !important;
    overflow: auto;
}
.template-v4-editor-form {
    --template-v4-phase-column: 265px;
}
.template-v4-editor-modal #modalForm {
    max-height: calc(100dvh - 24px);
}
.template-v4-assignee-editor > header {
    margin-bottom: 10px;
}
.template-v4-assignee-editor > header p { margin-bottom: 0; }
.template-v4-workspace {
    display: grid;
    grid-template-columns: var(--template-v4-phase-column) minmax(0, 1fr);
    min-height: 430px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.template-v4-phase-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-right: 1px solid var(--line);
    background: #f7faf9;
}
.template-v4-phase-button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    width: 100%;
    min-height: 54px;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #17364f;
    text-align: left;
}
.template-v4-phase-button:hover { background: #eef7f3; }
.template-v4-phase-button[aria-selected="true"] {
    border-color: #b9decf;
    background: #eaf7f1;
    box-shadow: inset 3px 0 0 var(--green);
}
.template-v4-phase-index {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e8eff2;
    color: #24465f;
    font-size: .75rem;
    font-weight: 800;
}
.template-v4-phase-button[aria-selected="true"] .template-v4-phase-index {
    background: var(--green);
    color: #fff;
}
.template-v4-phase-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.template-v4-phase-copy strong {
    overflow: hidden;
    font-size: .76rem;
    line-height: 1.3;
    text-overflow: ellipsis;
}
.template-v4-phase-copy small {
    color: var(--muted, #647585);
    font-size: .66rem;
    line-height: 1.25;
}
.template-v4-task-pane { min-width: 0; }
.template-v4-task-section {
    display: grid;
    gap: 7px;
    padding: 14px;
}
.template-v4-task-section[hidden] { display: none !important; }
.template-v4-task-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 2px 9px;
}
.template-v4-task-heading h4 {
    margin: 0;
    color: #14344d;
    font-size: 1rem;
}
.template-v4-task-heading span {
    color: var(--muted, #647585);
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.template-v4-task-section .template-assignee-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 235px);
    gap: 12px;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 10px 11px;
    border: 1px solid #e1eaee;
    border-radius: 9px;
    background: #fff;
}
.template-v4-task-section .template-assignee-row > div,
.template-v4-task-section .template-assignee-row > span { min-width: 0; }
.template-v4-task-section .template-assignee-row strong {
    display: block;
    font-size: .78rem;
    line-height: 1.3;
}
.template-v4-task-section .template-assignee-row small {
    color: var(--muted, #647585);
    font-size: .65rem;
}
.template-v4-task-section .template-assignee-row select,
.template-v4-task-section .template-assignee-row input { min-height: 38px; }
.template-v4-group-row {
    border-color: #cde5db !important;
    background: #f1faf6 !important;
}
.template-v4-group-row > div:first-child small {
    display: inline-block;
    margin-top: 3px;
    color: var(--green-2);
    font-weight: 800;
}
.template-v4-group-row .template-deadline-control > span {
    color: #526c7c;
    font-size: .66rem;
    font-weight: 700;
}
.template-v4-group-row .template-deadline-control > div {
    display: flex;
    align-items: center;
    gap: 7px;
}
.template-v4-group-row .template-deadline-control input { width: 86px; }
.template-v4-raw {
    margin: 12px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfd;
}
.template-v4-raw > summary {
    padding: 11px 13px;
    color: #24465f;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}
.template-v4-raw > p { padding: 0 13px; }
.template-v4-raw > label,
.template-v4-raw > div { margin: 0; padding: 0 13px 13px; }
.template-v4-raw textarea { min-height: 230px; }
.template-v4-sticky-actions {
    position: sticky;
    z-index: 3;
    bottom: -1px;
    margin: 12px -2px -2px;
    padding: 11px 2px 2px;
    background: linear-gradient(to bottom, rgba(255,255,255,.86), #fff 34%);
}

/* Tablet-PWA: zwei Karten, Editor mit schmalerer Phasenspalte. */
@media (min-width: 768px) and (max-width: 1279px) {
    #templateList.template-v4-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .template-v4-toolbar { grid-template-columns: minmax(220px, 1fr) minmax(190px, .7fr) auto; }
    .template-v4-editor-form { --template-v4-phase-column: 220px; }
    .template-v4-editor-modal {
        width: min(980px, calc(100vw - 18px)) !important;
        max-width: 980px !important;
    }
    .template-v4-task-section .template-assignee-row {
        grid-template-columns: minmax(0, 1fr) minmax(165px, 210px);
    }
}

/* Mobile-PWA: kompakte Karten + Fullscreen-Editor + horizontale Phasen-Navigation. */
@media (max-width: 767px) {
    .template-v4-toolbar {
        grid-template-columns: minmax(0, 1fr) minmax(118px, .42fr);
        gap: 8px;
        margin-bottom: 11px;
    }
    .template-v4-result {
        grid-column: 1 / -1;
        justify-self: start;
        order: 3;
    }
    .template-v4-stats {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        order: 4;
    }
    .template-v4-stats > div { padding: 10px; }
    .template-v4-stats > div:nth-child(3) { border-right: 0; }
    .template-v4-stat-deadline { display: none !important; }

    #templateList.template-v4-grid { grid-template-columns: 1fr; gap: 9px; }
    .template-v4-card {
        padding: 13px;
        border-radius: 11px;
    }
    .template-v4-card:hover { transform: none; }
    .template-v4-card > header h2 { font-size: .95rem; }
    .template-v4-card .template-v2-facts { gap: 5px; }
    .template-v4-card .template-v2-facts > span { padding: 3px 6px; }
    .template-v4-card .template-v2-deadline-list { display: none; }
    .template-v4-card .template-v4-more { display: none; }
    .template-v4-mobile-phases {
        display: block;
        margin: 5px 0 1px;
        overflow: hidden;
        color: #5a7180;
        font-size: .69rem;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .template-v4-card > .form-actions { padding-top: 8px; }
    .template-v4-open-button { width: 100%; }

    .template-v4-editor-modal {
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .template-v4-editor-modal #modalForm {
        height: 100dvh;
        max-height: 100dvh;
    }
    .template-v4-workspace {
        display: block;
        min-height: 0;
        overflow: visible;
        border-radius: 10px;
    }
    .template-v4-phase-nav {
        position: sticky;
        z-index: 2;
        top: 0;
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        scrollbar-width: thin;
    }
    .template-v4-phase-button {
        flex: 0 0 auto;
        grid-template-columns: 25px minmax(108px, 155px);
        min-height: 48px;
        padding: 7px;
    }
    .template-v4-phase-button[aria-selected="true"] {
        box-shadow: inset 0 -3px 0 var(--green);
    }
    .template-v4-phase-index { width: 25px; height: 25px; }
    .template-v4-task-section { padding: 9px; }
    .template-v4-task-heading { padding: 2px 1px 7px; }
    .template-v4-task-section .template-assignee-row {
        grid-template-columns: minmax(0, 1fr) minmax(118px, 42%);
        gap: 8px;
        padding: 9px;
    }
    .template-v4-group-row {
        grid-template-columns: minmax(0, 1fr) minmax(104px, 38%) !important;
    }
    .template-v4-group-row .template-deadline-control > span { display: none; }
    .template-v4-group-row .template-deadline-control input { width: 70px; }
    .template-v4-raw textarea { min-height: 180px; }
    .template-v4-sticky-actions {
        bottom: 0;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .template-v4-card { transition: none; }
}

/* ENERKLAR SYSTEMVORLAGEN PWA UI V4 END */
