/* Compact page shell inspired by the reference UI; camera controls unchanged. */
body.inspection-shell{--teal:#356d7b;--border:#d9dfe3;background:#f0f2f4;color:#25343d;font-size:14px;overflow:hidden}
.inspection-shell button,.inspection-shell input,.inspection-shell select{font-size:13px;min-height:36px}
.inspection-shell button:focus-visible,.inspection-shell select:focus-visible,.inspection-shell input:focus-visible{outline:3px solid #e5a940;outline-offset:2px}
.shell-header{height:54px;display:flex;align-items:center;gap:16px;padding:0 16px;background:#1b303b;color:#f6f8fa;position:relative;z-index:10}
.shell-brand{font-size:19px;font-weight:800;white-space:nowrap}
.shell-nav{display:flex;align-items:stretch;height:100%;gap:0;min-width:0}
.shell-nav .nav,.shell-nav>button{width:auto;min-width:0;margin:0;border:0;border-radius:0;background:transparent;color:#cfdae0;padding:0 13px;font-size:13px;font-weight:650;white-space:nowrap;border-bottom:3px solid transparent}
.shell-nav>button:hover,.shell-nav>button.active{background:#294652;color:#fff}
.shell-nav>button.active{border-bottom-color:#e4aa43}
.shell-account{margin-left:auto;display:flex;align-items:center;gap:9px;white-space:nowrap}
.shell-account #account-name{background:transparent;color:#fff;padding:0;font-size:12px}
.shell-account button{background:transparent;border-color:#546874;color:#fff;padding:6px 11px}
.shell-menu{display:none}
.inspection-shell .rail,.inspection-shell .app>header,.inspection-shell .topline,.inspection-shell .app>footer,.inspection-shell .viewer-top{display:none}
.inspection-shell .app{margin:0;height:calc(100dvh - 54px);display:flex;flex-direction:column}
.shell-context{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:8px 12px;background:white;border-bottom:1px solid var(--border);flex:none;min-height:54px}
.shell-field{display:flex;align-items:center;gap:7px;margin:0;white-space:nowrap;color:#4f6069;font-size:12px}
.shell-field select{margin:0;width:190px;max-width:23vw;padding:7px 25px 7px 10px}
.shell-field:first-child select{width:230px}
.shell-field #quality{width:180px}
.shell-display{display:flex;gap:6px;align-items:center;margin-left:auto}
.shell-display button{padding:7px 12px;white-space:nowrap}
.shell-display button[aria-pressed=true]{background:#e4f0f2;border-color:#6c99a5;color:#285e6b}
.inspection-shell .workspace{flex:1;min-height:0;height:auto;margin:0;border:0;border-radius:0;grid-template-columns:280px minmax(0,1fr) 320px;overflow:hidden}
.inspection-shell .workspace.hide-left{grid-template-columns:minmax(0,1fr) 320px}
.inspection-shell .workspace.hide-right{grid-template-columns:280px minmax(0,1fr)}
.inspection-shell .workspace.hide-left.hide-right{grid-template-columns:minmax(0,1fr)}
.inspection-shell .viewer{min-height:0;background:#1b2127;isolation:isolate}
.inspection-shell .panel{padding:18px 16px;background:#fff;min-width:0;min-height:0}
.inspection-shell .panel-heading h3{font-size:14px}
.inspection-shell .left #add{margin-bottom:18px;width:100%}
.inspection-shell .left .records{flex:1 1 150px;min-height:100px}
.inspection-shell .tools,body.inspection-shell.focus-3d .tools{display:flex;flex-wrap:wrap;gap:8px;position:relative;margin:10px;max-width:calc(100% - 20px);width:max-content;padding:0;border:0;box-shadow:none;background:transparent;z-index:3;overflow:visible}
.shell-tool-group{display:flex;border:1px solid #434c55;border-radius:7px;overflow:hidden;background:#1b2127ed}
.inspection-shell .tools button{color:#e6ebef;background:transparent;border:0;border-right:1px solid #414a53;border-radius:0;padding:10px 11px;font-weight:650;min-height:40px;white-space:nowrap}
.inspection-shell .tools button:last-child{border-right:0}
.inspection-shell .tools button:hover{background:#303b44}
.inspection-shell .tools button.selected{background:#e4a63f;color:#19252e}
.inspection-shell .tools button[aria-pressed=true]{background:#365662;color:white}
.inspection-shell #toggle-source{font-size:12px}
.inspection-shell .viewer-bottom{background:#171e25de;color:#d8e0e5;border:0;left:10px;bottom:10px;right:10px;border-radius:5px;font-size:11px;padding:9px 12px;flex-wrap:wrap;z-index:2;pointer-events:none}
.inspection-shell .view-help{pointer-events:auto}.inspection-shell .view-help summary{color:#cfdee5}
.inspection-shell #load-state{top:auto;bottom:64px;right:10px;left:auto;background:#e6f2eade;color:#335e48;max-width:calc(100% - 20px)}
.inspection-shell #measure-box{bottom:76px;z-index:4;max-height:calc(100% - 180px);overflow:auto;box-shadow:0 5px 20px #0003}
.inspection-shell #source-panel{bottom:76px}
.inspection-shell .detail-list{font-size:13px;line-height:1.7}.inspection-shell .record h4{font-size:14px}.inspection-shell .record p,.inspection-shell .info-note,.inspection-shell .muted{font-size:12px}
.shell-focus-return{display:none}
body.inspection-shell.focus-3d .shell-header,body.inspection-shell.focus-3d .shell-context{display:none}
body.inspection-shell.focus-3d .app{height:100dvh}
body.inspection-shell.focus-3d .workspace{height:100dvh;grid-template-columns:minmax(0,1fr)}
body.inspection-shell.focus-3d .shell-focus-return{display:flex;border:1px solid #60747f;border-radius:7px;background:#29414deb}
body.inspection-shell.focus-3d.show-pin-detail .workspace>.right{top:115px;bottom:70px;max-width:calc(100% - 28px)}
.inspection-shell dialog{font-size:14px;padding:24px;border-radius:12px}
.inspection-shell dialog .dialog-heading{gap:15px}
.inspection-shell dialog .dialog-heading h2{font-size:21px}
.inspection-shell dialog.shell-page{position:fixed;inset:54px 0 0;margin:0;width:100%;max-width:none;height:calc(100dvh - 54px);max-height:none;border:0;border-radius:0;padding:22px 24px;background:#f0f2f4;box-shadow:none;z-index:8;overflow:auto}
.inspection-shell .shell-page>.dialog-heading{margin-bottom:20px}
.shell-page-tools{display:flex;align-items:center;gap:12px;margin-bottom:18px}.shell-page-tools input{flex:1;max-width:600px}.shell-page-tools #catalog-add{margin:0;white-space:nowrap}
.inspection-shell .shell-page>.dialog-heading .close{font-size:12px;background:white;border:1px solid #d6dfe3;padding:8px 12px;border-radius:7px}
.inspection-shell .catalog-layout{grid-template-columns:240px minmax(0,1fr);align-items:start;gap:20px}
.inspection-shell .folder-sidebar{background:white;padding:16px;border:1px solid var(--border);border-radius:9px;max-height:calc(100dvh - 160px)}
.inspection-shell .folder-node{font-size:13px;padding:10px}.inspection-shell .folder-active{background:#e5f0f2}
.inspection-shell .folder-catalog #vessel-cards{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px}
.inspection-shell .vessel-card{padding:18px;background:#fff;border:1px solid var(--border);border-radius:9px}
.inspection-shell .vessel-card>img{height:170px}.inspection-shell .vessel-placeholder{height:140px;background:#e1e6e9;color:#6d7d85}
.inspection-shell .vessel-card h3{font-size:16px;line-height:1.7}.inspection-shell .vessel-card p{font-size:12px}
.inspection-shell .card-buttons button{font-size:12px;min-height:36px}
.inspection-shell [data-open-vessel]{background:#356d7b;color:white;border-color:#356d7b}
.inspection-shell .customer-controls{align-items:end;max-width:100%;margin-bottom:14px}
.inspection-shell .customer-controls label:first-child{flex:1}
.inspection-shell .customer-card{background:#fff;padding:20px;border-color:#d9dfe3;margin:16px 0}
.inspection-shell .customer-table-wrap th{background:#edf2f4;font-size:12px}.inspection-shell .customer-table-wrap td{font-size:13px;padding:12px}
.inspection-shell .tenant-grid>section,.inspection-shell .history-row,.inspection-shell .audit-row{background:white;padding:20px;border:1px solid var(--border);border-radius:8px;margin-bottom:10px}
.inspection-shell .shell-page .empty{background:white;border:1px dashed #cfd8dd;border-radius:8px;padding:48px 20px}
.inspection-shell #toast{z-index:30}
@media(max-width:1150px){.shell-header{gap:8px;padding:0 10px}.shell-nav>button{padding:0 9px;font-size:12px}.shell-brand{font-size:17px}.shell-field select{width:170px}.shell-field:first-child select{width:190px}.shell-field #quality{width:150px}.shell-context{gap:8px}.shell-account #account-name{max-width:85px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:950px){
 .shell-header{height:52px;justify-content:space-between;flex-wrap:wrap}.shell-menu{display:block;margin-left:auto;color:white;background:none;border-color:#536771}
 .shell-nav,.shell-account{display:none}.shell-header.menu-open{height:auto;min-height:52px;padding-top:7px;padding-bottom:10px}.menu-open .shell-nav{display:flex;flex-direction:column;width:100%;height:auto;order:3}.menu-open .shell-account{display:flex;width:100%;order:4;justify-content:space-between;margin:6px 0 0}.shell-nav>button{min-height:44px;text-align:left;padding:10px 16px;border-bottom:0;border-left:3px solid transparent}.shell-nav>button.active{border-left-color:#e4aa43}
 .inspection-shell .app{height:calc(100dvh - 52px)}.shell-context{gap:8px;padding:8px}.shell-field select{max-width:28vw}.shell-display{margin-left:0}
 .inspection-shell .workspace,.inspection-shell .workspace.hide-left,.inspection-shell .workspace.hide-right{grid-template-columns:minmax(0,1fr);position:relative}
 .inspection-shell .workspace>.viewer{grid-column:1;grid-row:1;height:100%;min-height:0}
 .inspection-shell .workspace>.panel{position:absolute;z-index:5;top:0;bottom:0;width:310px;max-width:85%;box-shadow:0 4px 25px #0003}.inspection-shell .workspace>.left{left:0;max-height:none}.inspection-shell .workspace>.right{right:0;grid-column:auto}
 .inspection-shell dialog.shell-page{top:52px;height:calc(100dvh - 52px);padding:18px}
 .inspection-shell .shell-header:has(.shell-menu[aria-expanded=true]){position:absolute;left:0;right:0;top:0}.inspection-shell:has(.shell-menu[aria-expanded=true]) .app{margin-top:52px}
}
@media(max-width:600px){
 .shell-field{gap:4px;font-size:11px}.shell-field:first-child{width:100%}.shell-field:first-child select{max-width:none;width:100%;flex:1}.shell-field select{max-width:39vw;width:150px}.shell-field #quality{width:140px}.shell-display{width:100%;justify-content:flex-end}
 .inspection-shell .tools,body.inspection-shell.focus-3d .tools{gap:6px;margin:8px;max-width:calc(100% - 16px)}.inspection-shell .tools button{padding:9px;font-size:12px}.inspection-shell .viewer-bottom #scale-label{display:none}.inspection-shell #hint{max-width:100%;font-size:10px}
 .inspection-shell .catalog-layout{grid-template-columns:1fr}.inspection-shell .folder-sidebar{max-height:200px}.inspection-shell .folder-catalog #vessel-cards{grid-template-columns:1fr}.inspection-shell .customer-controls{display:grid;grid-template-columns:1fr}.inspection-shell .tenant-grid{grid-template-columns:1fr}.inspection-shell .model-manage-row{flex-wrap:wrap}.inspection-shell .model-manage-row>div{flex-basis:100%}
 .inspection-shell .shell-page>.dialog-heading{align-items:center}.inspection-shell .shell-page>.dialog-heading h2{font-size:19px}.inspection-shell .shell-page>.dialog-heading .close{white-space:nowrap}
 .shell-page-tools{flex-wrap:wrap}.shell-page-tools input{flex-basis:100%}
}

.inspection-shell .customer-card.customer-directory-row{padding:0;margin:8px 0}
.customer-directory-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px}
.customer-directory-heading h3{font-size:15px;overflow-wrap:anywhere}
.customer-directory-heading button{flex:none;color:var(--teal)}
.customer-directory-heading button[aria-expanded=true]{background:#e4f0f2}
.customer-directory-details{padding:16px;border-top:1px solid var(--border)}

/* Allow touch scrolling while reserving pinch zoom for the 3D canvas. */
.inspection-shell,.inspection-shell .shell-page,.inspection-shell .panel,.inspection-shell dialog{
  touch-action:pan-x pan-y;
}

.history-company{margin-top:10px;border:1px solid var(--border);border-radius:8px;background:#fff}
.history-company>summary{display:flex;align-items:center;gap:12px;padding:14px 16px;cursor:pointer;list-style:none}
.history-company>summary::-webkit-details-marker{display:none}
.history-company>summary strong{overflow-wrap:anywhere}
.history-company-count{white-space:nowrap;color:#516770}
.history-detail-label{margin-left:auto;white-space:nowrap;color:var(--teal)}
.history-detail-label span:last-child,.history-company[open] .history-detail-label span:first-child{display:none}
.history-company[open] .history-detail-label span:last-child{display:inline}
.history-company-records{padding:0 12px}

.history-print-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin:12px 0;padding:10px 14px;background:white;border:1px solid var(--border);border-radius:8px}
.history-print-toolbar label{display:flex;align-items:center;gap:8px;margin:0;color:inherit;font-weight:650}
.history-print-toolbar input,.history-group-checkbox{width:18px;height:18px;min-height:0!important;margin:0;accent-color:var(--teal)}
#history-print-count{color:#516770}
#history-clear-print{margin-left:auto}
.history-company-group{position:relative}
.history-group-checkbox{position:absolute;top:15px;left:16px;z-index:1;cursor:pointer}
.history-company-group .history-company>summary{padding-left:48px}
@media(max-width:520px){#history-clear-print{margin-left:0}}

body.inspection-shell.focus-3d .workspace.focus-record-list>.left{display:flex;position:absolute;left:12px;top:100px;bottom:70px;width:310px;max-width:85vw;z-index:6;box-shadow:0 8px 30px #0005;border-radius:8px}
#measure-box label{margin:6px 0;font-size:12px}
#measure-box input,#measure-box textarea{padding:7px;margin-top:3px}
#measure-box{max-height:calc(100% - 150px)}
/* Reserve a separate area for measurement inputs instead of covering the model.
   Query the viewer width, since the two side panels can make it much narrower
   than the browser window. The canvas resize observer updates its aspect ratio. */
.inspection-shell .viewer{container-type:inline-size}
.inspection-shell .viewer:has(#measure-box:not([hidden])) #canvas{right:264px;width:auto;height:auto}
.inspection-shell .viewer:has(#measure-box:not([hidden])) .tools{max-width:calc(100% - 284px)}
.inspection-shell .viewer:has(#measure-box:not([hidden])) .viewer-bottom{right:274px}
.inspection-shell #measure-box{left:auto;right:0;top:0;bottom:0;width:264px;max-height:none;padding:12px;border-radius:0;border-width:0 0 0 1px;background:#fff;overscroll-behavior:contain;scroll-padding:12px}
.inspection-shell #measure-box textarea{resize:vertical;min-height:54px}
.inspection-shell #measure-box>div{gap:6px}
.inspection-shell #measure-box button{flex:1 1 100px;white-space:normal}
@container (max-width:700px){
 .inspection-shell .viewer:has(#measure-box:not([hidden])) #canvas{right:0;bottom:min(240px,42%)}
 .inspection-shell .viewer:has(#measure-box:not([hidden])) .tools{max-width:calc(100% - 20px)}
 .inspection-shell .viewer:has(#measure-box:not([hidden])) .viewer-bottom{right:10px;bottom:calc(min(240px,42%) + 10px)}
 .inspection-shell #measure-box{left:0;right:0;top:auto;bottom:0;width:100%;height:min(240px,42%);border-width:1px 0 0}
}
.report-options{padding:0 4px 12px}
#assignment-duplicates{padding:12px;background:#fff4da;color:#6d4b10;border:1px solid #d9b766;border-radius:7px}

/* Role, saved measurements and one-model-at-a-time comparison helpers. */
.viewer-role-badge{flex:none;display:inline-flex;align-items:center;padding:4px 8px;border:1px solid #8fa8b4;border-radius:5px;font-size:11px;line-height:1.4;background:#294652;color:#fff;white-space:nowrap}
.viewer-role-badge[data-role="viewer"]{background:#fff2d5;border-color:#dab16b;color:#604615}
.viewer-role-badge[data-role="editor"]{background:#dff1ed;border-color:#7cafa1;color:#235249}
.viewer-role-badge[hidden]{display:none}
.viewer-tools{display:flex;align-items:center;min-width:0;max-width:100%}
.viewer-tools:has(.viewer-comparison[open]){flex-basis:100%;width:100%}
.viewer-comparison{min-width:0;max-width:100%;font-size:12px}
.viewer-comparison[hidden]{display:none}
.viewer-comparison>summary{cursor:pointer;min-height:36px;padding:8px 12px;border:1px solid #c6d6dc;border-radius:6px;background:#f4f9fa;color:#285e6b;font-weight:650;white-space:nowrap}
.viewer-comparison>summary:focus-visible,.measurement-fields>summary:focus-visible{outline:3px solid #e5a940;outline-offset:2px}
.viewer-comparison[open]{width:100%}
.viewer-comparison[open]>summary{width:max-content;max-width:100%}
.viewer-comparison-fields{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto;align-items:end;gap:8px 12px;padding:12px 0 4px}
.viewer-comparison-fields label{display:flex;flex-direction:column;gap:4px;margin:0;min-width:0;color:#36515a;font-size:12px}
.viewer-comparison-fields select{width:100%;max-width:none;margin:0;font-size:12px}
.viewer-comparison-fields button{padding:8px 12px;white-space:nowrap}
.viewer-comparison-fields button[aria-pressed="true"]{background:#e4f0f2;border-color:#6c99a5;color:#285e6b}
.viewer-comparison-fields .viewer-preserve-view{grid-column:1/-1;display:flex;flex-direction:row;align-items:center;gap:7px;width:max-content;max-width:100%}
.viewer-preserve-view input{min-height:0;width:18px;height:18px;margin:0;accent-color:var(--teal)}
.viewer-comparison-note{font-size:12px;color:#506970;margin:5px 0 2px;line-height:1.6}
.shell-display .viewer-measurements-entry{font-size:12px}
.measurement-fields{margin:10px 0;border:1px solid #d7e1e5;border-radius:6px;padding:8px;min-width:0}
.measurement-fields>summary{cursor:pointer;color:#285e6b;font-size:12px;font-weight:650;line-height:1.5;padding:3px 0}
.measurement-fields[open]>summary{margin-bottom:8px}
.measurement-fields input,.measurement-fields textarea{max-width:100%}
.viewer-readonly-notice{color:#604615;background:#fff2d5;border:1px solid #dab16b;border-radius:5px;padding:8px;font-size:12px;font-weight:700;line-height:1.6;margin:0 0 10px}
.viewer-readonly-explanation{font-size:12px;line-height:1.7;color:#506970;margin:10px 0 0}
.viewer-readonly-notice[hidden],.viewer-readonly-explanation[hidden]{display:none}
@media(max-width:950px){
 .viewer-role-badge{font-size:10px;padding:4px 6px}
 .shell-header{gap:7px}
 .viewer-comparison-fields{grid-template-columns:minmax(0,1fr) auto}
}
@media(max-width:600px){
 .shell-display{flex-wrap:wrap}
 .shell-display .viewer-measurements-entry{margin-right:auto}
 .viewer-tools{width:100%}
 .viewer-comparison{width:100%}
 .viewer-comparison>summary{white-space:normal}
}

/* One list for saved records and measurements; details open only for an item. */
#toggle-right[hidden],.sidebar-records[hidden],.sidebar-measurements[hidden]{display:none!important}
.sidebar-heading{flex:none;gap:8px}.sidebar-heading h3{margin:0}.sidebar-heading button{margin-left:auto}
.sidebar-tabs{display:flex;gap:6px;margin-bottom:14px;flex:none}.sidebar-tabs button{flex:1}
.sidebar-tabs [aria-selected="true"]{background:#356d7b;color:#fff;border-color:#356d7b}
.sidebar-records{display:flex;flex-direction:column;min-height:0;flex:1}.sidebar-measurements{overflow:auto;min-height:0;flex:1}
.sidebar-measurements .measurement{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px 0;border-bottom:1px solid #d9dfe3}
.sidebar-measurements .measurement strong,.sidebar-measurements .measurement p{width:100%;overflow-wrap:anywhere;margin:4px 0}
body.inspection-shell.focus-3d .workspace.hide-right>.right{display:none!important}
.organization-rename-form{margin:0}.organization-rename-form label{display:block}.organization-rename-form input{width:100%;box-sizing:border-box}.rename-error{color:#b43e36}

.data-management-choices{padding:14px;background:#f2f7f8;border-radius:8px;margin-bottom:18px}.data-management-choices>button{width:100%}#model-settings-fields{border:0;padding:0;min-width:0}#model-settings-fields legend{font-weight:700;margin-bottom:12px}
