/* Shared screen metrics for every portal page. Exported PDFs have independent layouts. */
:root{--ui-text:13px;--ui-label:12px;--ui-field:14px;--ui-control:34px;--ui-gap:8px;--ui-panel:12px;--ui-radius:6px}
html body{font-size:var(--ui-text);line-height:1.4}
html body h1,html body .heading h1,html body .access-card h1{font-size:20px;line-height:1.25;letter-spacing:0;margin:4px 0 10px;overflow-wrap:anywhere}
html body h2,html body .sectionhead h2,html body .dialoghead h2{font-size:15px;line-height:1.3;margin:0;overflow-wrap:anywhere}
html body h3{font-size:14px;line-height:1.3;margin:12px 0 6px;overflow-wrap:anywhere}
html body p,html body .heading p,html body .log-section p{font-size:12px;line-height:1.45;margin:5px 0;overflow-wrap:anywhere}
html body label,html body .group-fields label,html body #pzbPanel .grid label,html body .log-compact label{font-size:var(--ui-label);line-height:1.35;min-width:0;overflow-wrap:anywhere}
html body input:not([type=checkbox]):not([type=radio]):not([type=hidden]),html body select,html body textarea,html body #metaFields .content-width-field{font-family:inherit;font-size:var(--ui-field)!important;line-height:1.35!important;min-height:var(--ui-control)!important;height:auto;min-width:0;max-width:100%;padding:6px 8px!important;margin-top:3px;border-radius:var(--ui-radius);box-sizing:border-box}
html body select{width:100%;padding-right:28px!important;text-align:left!important;text-align-last:left;letter-spacing:normal}
html body textarea{text-align:left!important;min-height:64px!important;white-space:pre-wrap;overflow-wrap:anywhere;resize:vertical}
html body input[type=file]{white-space:normal;font-size:12px!important}
html body input[type=file]::file-selector-button{font:inherit;padding:4px 7px;margin-right:7px;max-width:100%}
html body input[type=checkbox],html body input[type=radio]{width:18px!important;height:18px!important;min-height:18px!important;margin:0;vertical-align:middle;flex-shrink:0}
html body .primary,html body .secondary,html body .import,html body .headeractions button,html body .profile-link{font-family:inherit;font-size:12px;line-height:1.35;min-height:var(--ui-control);padding:6px 10px;white-space:normal;overflow-wrap:anywhere;max-width:100%;height:auto}
html body .icon{min-width:34px;min-height:34px;font-size:21px;line-height:1.2}
html body .content{padding:12px 16px;min-width:0}
html body .heading{gap:10px;margin-bottom:12px}
html body .panel{border-radius:var(--ui-radius);margin-bottom:12px;min-width:0}
html body .sectionhead,html body .dialoghead{padding:10px 12px;gap:8px}
html body .dialogfoot{padding:10px 12px;gap:8px}
html body .grid,html body .grid.two,html body .formgrid,html body .group-fields,html body .log-grid{gap:8px 10px;min-width:0}
html body .grid>* ,html body .formgrid>*,html body .group-fields>*,html body .log-grid>*{min-width:0}
html body .log-grid{margin:10px 0;align-items:start}
html body .log-section,html body #logbookPanel .log-section,html body .log-entry-form{padding:12px}
html body .log-entry,html body .log-fault,html body .pzb-archive-row{padding:10px 12px;margin:8px 0}
html body .admin-group{padding:8px;margin:12px 0}
html body .admin-group>summary{font-size:16px;line-height:1.35;padding:8px;white-space:normal;overflow-wrap:anywhere}
html body .admin-topic>summary,html body .log-entry-form>summary,html body .log-section details>summary,html body #papersPanel summary,html body .log-section>summary{font-size:14px;line-height:1.35;padding:8px 0;min-height:34px;white-space:normal;overflow-wrap:anywhere}
html body .admin-topic>summary{padding:10px 12px}
html body .log-section h3{margin-top:14px}
html body .portal-cards{gap:12px}
html body .portal-card{padding:14px;min-width:0;height:auto;white-space:normal;overflow-wrap:anywhere}
html body .portal-card strong{font-size:16px;line-height:1.3}
html body .portal-card>span:not(.portal-icon){font-size:12px;line-height:1.4}
html body .portal-icon{font-size:24px;line-height:1.2}
html body .access-card{padding:24px;max-width:480px;border-radius:10px}
html body .access-card form{gap:10px;margin:16px 0}
html body .access-card label{gap:2px}
html body aside .nav{font-size:13px;line-height:1.35;padding:8px 10px;white-space:normal;overflow-wrap:anywhere}
html body .portal-brand-name{display:block;margin:9px 0;color:inherit;font-size:14px;line-height:1.35;letter-spacing:0;overflow-wrap:anywhere}
html body .ui-selection-text{display:block;font-size:11px;line-height:1.4;margin:4px 0;color:var(--muted,#526c70);white-space:normal;overflow-wrap:anywhere;text-align:left}
html body .ui-selection-text[hidden]{display:none!important}
html body #papersPanel .paper-context-grid{grid-template-columns:minmax(120px,1fr) minmax(140px,1fr) auto;align-items:end}
html body #papersPanel #paperRefresh{align-self:end;justify-self:start;min-height:var(--ui-control);height:auto;margin:0}
html body #papersPanel .paper-document-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
html body #papersPanel [data-paper-view]{margin-top:6px;min-height:30px}
html body #papersPanel details{padding:7px 0}
html body .pzb-stats input,html body .pzb-stats select{min-height:var(--ui-control)}
html body th,html body td{line-height:1.35}
html body .archive-table td,html body .archive-table th,html body .pzb-stats td,html body .pzb-stats th{font-size:12px;white-space:normal;overflow-wrap:anywhere}
html body .archive-table a{padding:5px 0;min-height:30px}
/* Photo close controls retain a clear, fixed hit area. */
html body .log-photo-bar button{width:44px;min-width:44px;min-height:44px;font-size:28px;line-height:1;padding:4px}
html body .file-download{padding:18px}
@media(max-width:760px){
 :root{--ui-control:40px;--ui-field:16px;--ui-label:12px}
 html body .content{padding:10px}
 html body .access-card{margin:12px;padding:18px}
 html body .heading h1,html body h1{font-size:19px}
 html body .primary,html body .secondary,html body .import{min-height:40px;font-size:12px;padding:7px 9px}
 html body .headeractions button{font-size:11px;min-height:36px}
 html body .mobile-nav button{font-size:11px;line-height:1.3;min-height:48px;white-space:normal}
 html body .mobile-nav button span{font-size:20px;line-height:22px}
 html body #wagonFields.formgrid,html body .mail-fields{padding:10px;gap:8px}
 html body .wagon-group{padding:8px}
 html body .wagon-group legend{font-size:12px}
 html body .computed-field output{font-size:16px}
 html body #wagonRows td,html body #reverseRows td{font-size:13px}
 html body #papersPanel .paper-context-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 html body #papersPanel #paperRefresh{grid-column:1/-1}
 html body input[type=checkbox],html body input[type=radio]{width:20px!important;height:20px!important;min-height:20px!important}
}
@media(max-width:540px){
 html body #papersPanel .paper-document-grid{grid-template-columns:minmax(0,1fr)}
 html body .portal-cards{grid-template-columns:minmax(0,1fr)}
 html body .member-form{align-items:stretch}
}
@media(pointer:coarse){:root{--ui-field:16px;--ui-control:40px}}
html body input.ui-native-date{display:none!important}html body .ui-date-input{text-align:center!important;width:100%}#portalNameForm,#portalLogoForm{display:grid;gap:10px;margin:10px 0 16px}#portalNameForm button,#portalLogoForm button{justify-self:start}

html body #pzbPanel .pzb-station-option{font-size:12px;line-height:1.35;min-height:var(--ui-control);padding:7px 9px}html body .log-extra>summary{font-size:14px;line-height:1.35}html body .stat strong{font-size:20px;line-height:1.2}
#twoFactorSettings{border-top:1px solid var(--line);padding-top:14px;margin-top:18px}#twoFactorQR{display:block;width:min(240px,100%);height:auto;background:white;margin:10px auto}#twoFactorRecovery pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.6}

/* Stable widths: names and date/time placeholders must not collapse when empty. */
html body #inspection{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
html body #inspection label:not(.inspection-options label){display:flex;flex-direction:column;align-items:stretch;text-align:left}
html body #inspection input:not([type=checkbox]):not([type=radio]),html body #inspection select{width:100%!important;inline-size:100%!important;min-width:0;min-height:38px!important;text-align:left!important}
html body #inspection .grid.two{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;padding:4px 0}
html body #inspection .ui-date-input{font-variant-numeric:tabular-nums}
@media(max-width:640px){html body #inspection,html body #inspection .grid.two{grid-template-columns:minmax(0,1fr)}}

#updateNews,#versionHistory{width:min(540px,calc(100vw - 32px));max-height:80dvh;overflow:auto;box-sizing:border-box;padding:20px;border:1px solid var(--line,#65705c);border-radius:10px;background:var(--surface,#202a1b);color:var(--text,#edf1e9)}#updateNews::backdrop,#versionHistory::backdrop{background:rgba(0,0,0,.65)}#updateNews li,#versionHistory li{margin:7px 0;line-height:1.45}#updateNews button{margin:8px 8px 0 0}

/* Compact update greeting; retain comfortable touch targets and scrolling. */
html body #updateNews{width:min(420px,calc(100vw - 24px));max-height:85dvh;padding:20px;border-top:3px solid #78be20;box-shadow:0 16px 56px rgba(0,0,0,.4)}
html body #updateNews .update-news-version{display:inline-block;font-size:11px;line-height:1.3;padding:3px 8px;border-radius:20px;background:rgba(120,190,32,.15);margin:0 0 10px;font-weight:700}
html body #updateNews h2{font-size:18px;margin:0 0 7px}html body #updateNews .update-news-intro{font-size:12px;line-height:1.5;margin:0 0 12px}
html body #updateNews h3{font-size:12px;margin:0 0 5px}html body #updateNews .update-news-list{padding-left:19px;margin:0 0 12px}html body #updateNews li{font-size:12px;line-height:1.4;margin:5px 0}html body #updateNews li::marker{color:#78be20}
html body #updateNews .update-news-signoff{font-size:12px;line-height:1.5;margin:10px 0;font-weight:600}html body #updateNews .update-news-hint{font-size:11px;opacity:.75;margin:10px 0}
html body #updateNews .update-news-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;border-top:1px solid var(--line,#65705c);padding-top:12px}html body #updateNews .update-news-actions button{margin:0;min-height:38px;padding:7px 14px}
