/* Existing Sorex Field + PPK styles are loaded unchanged. Module-specific rules only. */
.regulation-module .reg-export + .reg-export{margin-top:16px}
.reg-room-entry .reg-room-table th:first-child,.reg-room-entry .reg-room-table td:first-child{width:20%}.reg-room-entry .reg-room-table th:last-child,.reg-room-entry .reg-room-table td:last-child{width:32%}.reg-room-entry .reg-room-table th:nth-child(2),.reg-room-entry .reg-room-table th:nth-child(3),.reg-room-entry .reg-room-table td:nth-child(2),.reg-room-entry .reg-room-table td:nth-child(3){width:24%}.reg-marker{z-index:1}.reg-marker.room{z-index:2}.reg-marker-draft{z-index:3}
.reg-protocol-toolbar{padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:#fff;margin-bottom:16px}.reg-protocol-trash summary{cursor:pointer;padding:10px;color:var(--navy)}.reg-protocol-trash[open]{width:100%;border-top:1px solid var(--line);padding-top:8px}.reg-protocol-trash span{display:inline-block;margin:8px 12px}.reg-protocol-trash button{margin-right:16px}
.reg-room-entry>.reg-room-heading{display:flex!important;align-items:center;gap:8px;min-height:42px!important;padding:8px 10px!important;margin:0;cursor:pointer}.reg-room-entry[open] .reg-room-name{white-space:normal;overflow:visible;font-size:15px}.reg-room-entry.reg-room-selected[open]{border-width:2px}.reg-room-entry.reg-room-selected[open] .reg-room-table td{font-size:14px}.reg-room-entry.reg-room-selected[open] .reg-room-table th{font-size:12px}.reg-element-row.reg-element-selected{border:1px solid #1769c2;border-radius:8px;padding:12px;background:#f0f6ff}.reg-danger-link{color:#b52e2e!important;background:transparent!important;border:1px solid #e7c9c9!important}.reg-danger{background:#b52e2e!important;color:white!important;border:1px solid #b52e2e!important}.reg-trash{padding:20px}.reg-delete-editor .reg-editor-body{font-size:14px;padding:8px 0}.reg-editor-body>.reg-danger-link{margin:4px 0 10px}
.reg-room-entry:not([open]){padding:0}.reg-room-entry:not([open])>.reg-room-heading,.reg-room-entry[open]>.reg-room-heading{display:flex;align-items:center;gap:8px;min-height:42px;padding:8px 10px;margin:0;cursor:pointer;font-size:13px}.reg-room-entry[open]{padding:0 0 8px}.reg-room-entry>.reg-room-heading::before{content:'▸';flex:none;color:var(--muted)}.reg-room-entry[open]>.reg-room-heading::before{content:'▾'}.reg-room-entry .reg-room-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reg-room-entry>summary::-webkit-details-marker{display:none}.reg-room-entry[open]>small{padding:0 10px}.reg-room-entry[open]>.reg-room-table{width:calc(100% - 20px);margin:0 10px}.reg-room-list-cards .reg-room-entry{margin-bottom:5px}
.reg-catalog{padding:20px}.reg-catalog>.secondary{margin-left:8px}.reg-catalog .reg-element-row small{display:block}.reg-editor textarea{width:100%;min-height:120px;padding:10px;border:1px solid var(--line);background:white;resize:vertical}
.reg-drawing-extras summary{cursor:pointer;border:1px solid var(--line);border-radius:8px;padding:12px;font-size:13px;color:var(--navy);background:white;min-height:44px}.reg-drawing-extras .ppk-actions{margin-bottom:0}.reg-room-entry .reg-room-table td:first-child{min-width:0}
.ppk-side.reg-side{max-height:none;overflow:visible}.reg-room-list-cards{max-height:38vh;overflow-y:auto;overscroll-behavior:contain;padding:2px}.reg-side>.ppk-detail{max-height:48vh;overflow-y:auto;overscroll-behavior:contain;padding-right:4px}.reg-room-entry{border:1px solid var(--line);border-radius:10px;padding:10px;margin-bottom:8px;min-width:0}.reg-room-entry.reg-room-selected{border-color:#1769c2;background:#f0f6ff}.reg-room-entry .reg-room-heading{display:block;width:100%;border:0;background:transparent;color:var(--navy);font-size:14px;font-weight:600;text-align:left;white-space:normal;line-height:1.4;padding:0 0 6px;min-height:0}.reg-room-entry>small{display:block;font-size:11px;margin-bottom:8px}.reg-room-entry .reg-room-table{width:100%;table-layout:fixed}.reg-room-entry .reg-room-table th,.reg-room-entry .reg-room-table td{width:25%;min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:right;padding:8px 3px}.reg-room-entry .reg-room-table th:first-child,.reg-room-entry .reg-room-table td:first-child{text-align:left}.reg-room-entry .reg-room-table td{font-size:13px;font-variant-numeric:tabular-nums}.reg-room-entry .reg-room-table th{font-size:11px;line-height:1.3;background:transparent}.reg-room-entry .reg-room-table tr:last-child td{border-bottom:0}@media(max-width:900px){.reg-room-list-cards{max-height:48vh}.reg-side>.ppk-detail{max-height:none;overflow:visible}}
.reg-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.reg-editor-heading h2{margin:0;font-size:18px}.reg-editor-heading button{font-size:24px;line-height:1;min-width:36px}
.reg-point-editor{position:fixed;z-index:1000;width:min(310px,calc(100vw - 24px));max-height:min(450px,calc(100dvh - 24px));margin:0!important;display:flex;flex-direction:column;gap:0;box-shadow:0 8px 32px #102c4833;border:1px solid var(--line);padding:14px}
.reg-point-editor .reg-editor-heading{flex-shrink:0;padding-bottom:10px;border-bottom:1px solid var(--line)}.reg-point-editor .reg-editor-body{overflow-y:auto;overscroll-behavior:contain;min-height:0}.reg-point-editor .ppk-field-group{grid-template-columns:minmax(0,1fr);border:0;padding:0;margin:12px 0;gap:12px}.reg-point-editor .ppk-field-group legend{display:none}.reg-point-editor .actions{flex-shrink:0;margin-top:8px;padding-top:10px;border-top:1px solid var(--line);display:flex;flex-wrap:nowrap}.reg-point-editor .actions button{flex:1 1 0;min-width:0}.reg-point-editor .ppk-entry-hint{font-size:12px;margin:10px 0;color:var(--muted)}
.reg-marker-draft{border-style:dashed!important;opacity:.75;pointer-events:none;display:inline-flex;align-items:center;justify-content:center}
.reg-marker.unmeasured,.reg-marker.room.unmeasured{background:#c73535!important}.reg-marker.measured,.reg-marker.room.measured{background:#21834b!important}.reg-unmeasured-text{color:#c73535}.reg-measured-text{color:#21834b}.reg-measure-legend{display:flex;flex-wrap:wrap;gap:14px;font-size:13px;margin:10px 0}.reg-measure-result{font-size:14px;margin:10px 0}.reg-room-table{font-size:12px}.reg-room-table th,.reg-room-table td{padding:8px 6px}.reg-room-table td small{display:block;color:var(--muted);margin-top:4px}.reg-room-table td:first-child{white-space:normal;min-width:120px}.reg-room-table button{font-size:12px;padding:7px;min-height:36px;width:100%}.reg-room-selected td{background:#f0f6ff}.reg-room-table th{font-size:11px;white-space:normal}.reg-measure-editor .ppk-field-group{margin:10px 0}.reg-measure-editor .ppk-field input{font-size:22px}
.reg-icon{display:inline-flex!important;align-items:center;justify-content:center;width:28px;height:28px;flex:0 0 28px}.reg-icon svg{display:block;width:100%;height:100%}.reg-module-title{display:flex;align-items:center;gap:12px}.reg-module-title .reg-icon{width:34px;height:34px;flex-basis:34px;color:var(--navy)}
.reg-stage{position:relative;overflow:hidden;touch-action:none;cursor:grab;background:#e8edf3;height:100%;min-height:300px}.reg-stage.pick{cursor:crosshair}.reg-paper{position:absolute;transform-origin:0 0;background:white;box-shadow:0 2px 14px #102c4826}.reg-paper canvas{display:block;width:100%;height:100%}.reg-marker{position:absolute;transform:translate(-50%,-50%);min-height:30px!important;min-width:30px;border:2px solid white!important;border-radius:18px!important;padding:3px 7px!important;background:#1769c2!important;color:white!important;box-shadow:0 2px 8px #102c4850;font-size:11px;touch-action:none;white-space:nowrap}.reg-marker.extract{background:#9e542f!important}.reg-marker.room{background:#102c48!important}.reg-marker.selected{outline:3px solid #7fc6ff}.reg-element-row{border-top:1px solid var(--line);padding:12px 0}.reg-element-row h3{margin-bottom:6px}.reg-measure-input{width:120px}.reg-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0}.reg-summary>div{padding:10px;border:1px solid var(--line);border-radius:8px;background:#f7f9fc}.reg-summary strong{display:block;font-size:16px;margin:6px 0}.reg-summary small{display:block}.reg-warning{color:#94551f;background:#fff8ec;border:1px solid #efd6af;border-radius:8px;padding:10px}.reg-table-wrap{overflow:auto}.reg-table{width:100%;border-collapse:collapse}.reg-table th,.reg-table td{padding:12px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}.reg-table th{background:#f7f9fc}.reg-table button{white-space:normal}.reg-history{font-size:12px;color:var(--muted);margin:8px 0}.reg-history p{margin:3px 0}.reg-empty{padding:24px}.reg-editor{margin:18px 0}.reg-export{max-width:1050px}.reg-toolbar-note{font-size:12px;color:var(--muted)}.reg-data-heading{grid-column:1/-1}.reg-measure-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.reg-room-list{margin-top:12px}.reg-overview{padding:20px}.reg-tab-content{min-width:0}@media(max-width:600px){.reg-summary{grid-template-columns:1fr}.reg-table th,.reg-table td{padding:8px}.reg-marker{min-height:32px!important}.reg-measure-head{flex-wrap:wrap}}@media(pointer:coarse){.reg-marker{min-height:44px!important;min-width:44px}}

.reg-distribution{margin-top:16px;border-top:1px solid var(--line)}.reg-distribution>summary{padding:14px 0;font-weight:700;cursor:pointer;min-height:48px}.reg-compact-element{padding:0!important;margin:0;border:0!important;border-top:1px solid var(--line)!important;border-radius:0!important}.reg-element-heading{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) auto;gap:8px;align-items:center;min-height:48px;cursor:pointer;padding:10px 4px;font-size:12px;overflow-wrap:anywhere}.reg-element-heading>span{min-width:0}.reg-compact-element>.actions{padding:8px 4px;display:flex;flex-wrap:wrap;gap:8px}.reg-compact-element>.reg-history{padding:0 8px 12px}.reg-direction{font-weight:700}.reg-direction.supply{color:#18743c}.reg-direction.extract{color:#b92b2b}.pdf-pin.regulation-direction[data-measured=true]{border-style:double;box-shadow:0 0 0 2px white}.reg-shared-text{white-space:pre-wrap;overflow-wrap:anywhere}.form-popup .reg-editor{margin:0}.reg-compact-element[open]{background:#f7f9fc}.reg-element-heading::-webkit-details-marker{display:none}@media(max-width:600px){.reg-element-heading{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.reg-element-heading>span:last-child{grid-column:1/-1}.reg-compact-element>.actions>button{min-height:44px}.reg-room-list-cards{max-height:32vh}}

.pdf-pin.regulation-direction.supply,.pdf-pin.regulation-direction.extract{background:#b92b2b!important}.pdf-pin.regulation-direction[data-measured=true]{background:#18743c!important}.reg-direction.supply,.reg-direction.extract{color:var(--navy)!important}

/* Restricted measuring-technique editor; shared popup owns viewport/keyboard. */
.reg-measuring-preview{white-space:pre-wrap;max-height:12rem;overflow:auto;overflow-wrap:anywhere;margin:12px 0;padding:12px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px}
.reg-measuring-preview p,.reg-rich-input p{margin:0 0 .65em}
.reg-rich-editor{min-width:0;max-width:100%}
.reg-rich-toolbar{display:flex;gap:8px;position:sticky;top:0;background:white;padding:8px 0;z-index:1}
.reg-rich-toolbar button{min-width:44px;min-height:44px;border:1px solid #cbd5e1;border-radius:6px;background:white;color:#0f172a}
.reg-rich-toolbar button[aria-pressed=true]{background:#dbeafe;border-color:#2563eb}
.reg-rich-toolbar button:first-child{font-weight:bold}.reg-rich-toolbar button:nth-child(2){font-style:italic}
.reg-rich-input{min-height:220px;white-space:pre-wrap;overflow-wrap:anywhere;padding:14px;border:1px solid #94a3b8;border-radius:8px;background:white;font-size:16px;line-height:1.55;outline-offset:2px}
.reg-measuring-editor .ppk-field-group{display:block;min-width:0}
.reg-measuring-editor .form-popup-heading,.reg-measuring-editor .form-popup-footer{flex-shrink:0}
.reg-rich-input ul,.reg-measuring-preview ul{padding-left:1.5em}
