/* Pointcloud Office theme: use existing brand tokens for all screen controls.
   Deliberately excluded from printable document markup. */
:root{--pc-control:var(--ui-control,42px);--pc-control-small:var(--ui-control-compact,34px);--pc-radius:var(--ui-radius-sm,8px);--pc-card-radius:var(--ui-radius,12px);--pc-gap:var(--ui-space-2,8px);--pc-font:var(--sans,Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif)}
body{font-family:var(--pc-font);color:var(--ink,#22201e)}
:is(.office-shell,.project-office-sidebar~main,.office-dialog) :is(button,input,select,textarea){font-family:var(--pc-font)}
:is(.primary-action,.secondary-action,.project-heading button,.card-head button,.task-actions button,.row-action,.invoice-status,.invoice-status-select,.project-status-select,.project-assignee-cell select){min-height:var(--pc-control-small);border-radius:var(--pc-radius);line-height:1.35}
:is(.primary-action,.secondary-action,.project-heading button,.card-head button){min-height:var(--pc-control);display:inline-flex;align-items:center;justify-content:center;gap:var(--pc-gap);padding:8px 14px}
:is(.office-dialog,.task-dialog-grid,.form-grid,.quotation-form-grid) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){min-width:0;width:100%;min-height:var(--pc-control);border:1px solid var(--line,#e5e1dc);border-radius:var(--pc-radius);background:var(--surface,#fff);color:var(--ink,#22201e);padding:8px 12px}
:is(.office-dialog,.task-dialog-grid,.form-grid,.quotation-form-grid) label{min-width:0}
:is(.header-actions,.task-actions,.invoice-archive-actions,.history-actions,.dialog-actions){display:flex;align-items:center;flex-wrap:wrap;gap:var(--pc-gap)}
:is(.card,.task-lane,.task-card,.people-table,.project-register-grid>article){border-radius:var(--pc-card-radius);border-color:var(--line,#e5e1dc)}
:is(button,a,input,select,textarea):focus-visible{outline:2px solid var(--ui-focus,#6e675f);outline-offset:3px}
button:disabled{cursor:not-allowed;opacity:.55}
a.secondary-action,a.primary-action{color:var(--ink);text-decoration:none;border:1px solid var(--line);background:var(--surface)}
a.primary-action{background:var(--ui-primary,#302a26);color:var(--ui-primary-foreground,#fff)}
.office-dialog{max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto}
.office-dialog textarea{max-width:100%;width:100%;resize:vertical;padding:var(--ui-space-3);border:1px solid var(--line);border-radius:var(--ui-radius-sm);background:var(--surface);color:var(--ink);font:inherit}
.office-dialog :is(input[type=checkbox],input[type=radio]){width:var(--ui-space-4);height:var(--ui-space-4);min-width:0;min-height:0;padding:0;flex:0 0 var(--ui-space-4);accent-color:var(--green)}
.office-dialog label:has(>input[type=checkbox]),.office-dialog .check-field{display:flex;align-items:center;gap:var(--ui-space-3);min-height:var(--ui-control);padding:var(--ui-space-2) var(--ui-space-3);background:var(--surface);color:var(--ink);font-size:var(--ui-text);font-weight:400;line-height:1.5;letter-spacing:0;text-transform:none}
.office-dialog .task-dialog-grid label:has(>input[type=checkbox]){align-items:flex-start;padding-inline:0}
.office-shell .contract-fields label{font-size:var(--ui-text-sm)}
.office-shell .contract-fields :is(input,select,textarea){font-size:var(--ui-text)}
.office-shell :is(.contract-advisory,.contract-storage-note,.contract-custom-head small,.contract-form-head p){font-size:var(--ui-text-sm);line-height:1.6}
/* Public account screens share the Office control and type system. */
.login-page .login-panel{background:var(--surface);color:var(--ink)}
.login-page .brand,.login-page .eyebrow{color:var(--ink)}
.login-page .heading h1{font-family:var(--sans);font-size:var(--ui-title);font-weight:600;line-height:1.15;letter-spacing:-.035em;color:var(--ink);overflow-wrap:anywhere}
.login-page :is(.heading>p:last-child,.brand small,.login-panel footer){color:var(--muted)}
.login-page form>label{font-size:var(--ui-text);color:var(--ink)}
.login-page :is(input,.submit){font-family:var(--sans);font-size:var(--ui-text);border-radius:var(--ui-radius-sm);min-width:0}
.login-page input{border-color:var(--line-strong);background:var(--surface);color:var(--ink)}
.login-page .submit{background:var(--ink);color:var(--surface);border-color:var(--ink)}
.login-page .form-links{flex-wrap:wrap}
.login-page .form-links a{font-size:var(--ui-text-sm);color:var(--ink);line-height:1.6;min-height:var(--ui-control-compact,34px);display:inline-flex;align-items:center}
.login-page :is(.status,.login-panel footer){font-size:var(--ui-text-sm);line-height:1.6}
.login-page .password-field button{font-size:var(--ui-text-sm);min-height:var(--ui-control);color:var(--ink)}
.login-page form [hidden]{display:none}
@media(max-width:600px){.login-page input{font-size:var(--ui-text-lg)}.login-page .form-wrap{padding-block:var(--ui-space-10)}.login-page .brand{width:auto;min-width:0}.login-page .login-top{gap:var(--ui-space-3)}}
.portal-shell{display:block;min-height:100dvh}
.portal-shell .topbar{position:static;display:flex;justify-content:space-between;align-items:center;gap:var(--ui-space-4);border-bottom:1px solid var(--line)}
.portal-shell .wordmark{color:var(--ink);text-decoration:none;font-weight:650;letter-spacing:0;font-size:var(--ui-text-lg)}
.portal-shell .wordmark small{display:block;font-size:var(--ui-text-sm);color:var(--muted);font-weight:400}
.portal-shell .content{width:100%;max-width:var(--ui-content-max);margin-inline:auto;padding:var(--ui-space-8) var(--ui-gutter)}
.portal-shell .card{padding:var(--ui-space-6);margin:var(--ui-space-6) 0;background:var(--surface);border:1px solid var(--line)}
.portal-project-heading{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,300px);align-items:end;gap:var(--ui-space-6);margin-bottom:var(--ui-space-6)}
.portal-project-heading h1{font-size:clamp(24px,3vw,36px);line-height:1.25;letter-spacing:-.025em;margin:var(--ui-space-2) 0;overflow-wrap:anywhere}
.portal-project-heading .eyebrow{margin:0;color:var(--muted)}
.portal-project-picker{display:grid;gap:var(--ui-space-2);font-size:var(--ui-text-sm);color:var(--muted);min-width:0}
.portal-project-picker select{width:100%;min-width:0;height:var(--ui-control);border:1px solid var(--line);border-radius:var(--ui-radius-sm);background:var(--surface);color:var(--ink);padding:var(--ui-space-2) var(--ui-space-3);text-overflow:ellipsis}
.portal-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--line);border-radius:var(--ui-radius);background:var(--surface)}
.portal-overview>div{display:grid;gap:var(--ui-space-2);padding:var(--ui-space-5);min-width:0}
.portal-overview>div+div{border-left:1px solid var(--line)}
.portal-overview span,.portal-note{font-size:var(--ui-text);line-height:1.6;color:var(--muted)}
.portal-overview strong{font-size:var(--ui-text-lg);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.portal-section-nav{display:flex;gap:var(--ui-space-6);border-bottom:1px solid var(--line);margin-top:var(--ui-space-6)}
.portal-section-nav a{padding:var(--ui-space-3) 0;color:var(--ink);text-decoration:none;font-weight:550;min-height:var(--ui-control)}
.portal-section-heading{display:flex;justify-content:space-between;align-items:start;gap:var(--ui-space-4);margin-bottom:var(--ui-space-5)}
.portal-section-heading h2{font-size:var(--ui-text-lg);margin:0 0 var(--ui-space-2)}
.portal-section-heading p{color:var(--muted);line-height:1.6;margin:0;font-size:var(--ui-text)}
.portal-stage{border-top:1px solid var(--line)}
.portal-stage summary{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:var(--ui-space-4);align-items:center;cursor:pointer;list-style:none;padding:var(--ui-space-5) 0}
.portal-stage summary::after{content:'+';color:var(--muted);font-size:var(--ui-text-lg)}
.portal-stage[open]>summary::after{content:'−'}
.portal-stage summary::-webkit-details-marker{display:none}
.portal-stage-number{font-size:var(--ui-text-sm);color:var(--muted);font-variant-numeric:tabular-nums}
.portal-stage-title{display:grid;gap:var(--ui-space-2);min-width:0;overflow-wrap:anywhere}
.portal-stage-title strong{font-size:var(--ui-text);font-weight:600}
.portal-stage-title small,.portal-file small{display:block;color:var(--muted);font-size:var(--ui-text-sm);line-height:1.5}
.portal-stage summary:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px;border-radius:var(--ui-radius-sm)}
.portal-stage-body{padding:0 0 var(--ui-space-4) var(--ui-space-6)}
.portal-stage-body>.portal-note{margin:0}
.portal-file{display:flex;align-items:center;gap:var(--ui-space-4);flex-wrap:wrap;padding:var(--ui-space-4) 0;border-top:1px solid var(--line)}
.portal-file>div:first-child{flex:1 1 180px;min-width:0;overflow-wrap:anywhere}
.portal-shell .wordmark{display:block;line-height:1.4}
.portal-shell .topbar>.header-actions{display:flex;align-items:center;gap:var(--ui-space-3);flex-shrink:0}
.portal-shell .topbar #portal-logout{white-space:nowrap}
.portal-file-info{flex:1 1 220px;min-width:0;overflow-wrap:anywhere;display:grid;gap:var(--ui-space-1)}
.portal-file .header-actions{flex:0 1 auto;min-width:0}
.portal-invoice-amount{display:grid;gap:var(--ui-space-1);font-variant-numeric:tabular-nums}
.portal-shell :is(.record-badge,.secondary-action,.primary-action){font-size:var(--ui-text-sm)}
.portal-shell .record-badge{white-space:normal;line-height:1.5;text-align:center;max-width:100%;background:var(--ui-surface-subtle);color:var(--muted);font-size:var(--ui-text-sm);text-transform:none;letter-spacing:0;font-weight:500}
.portal-shell .form-grid{grid-template-columns:minmax(0,1fr)}
.portal-shell #portal-login,.portal-shell #portal-password{max-width:480px;margin:var(--ui-space-8) auto}
.portal-shell #portal-error:empty{display:none}
@media(max-width:768px){.portal-project-heading{grid-template-columns:minmax(0,1fr)}.portal-section-heading{flex-wrap:wrap}.portal-stage summary{gap:var(--ui-space-3)}.portal-stage-body{padding-left:0}.portal-shell .card{padding:var(--ui-space-4)}.portal-overview>div{padding:var(--ui-space-3)}}
@media(max-width:420px){.portal-overview{grid-template-columns:1fr}.portal-overview>div{display:flex;justify-content:space-between;align-items:center;gap:var(--ui-space-3)}.portal-overview>div+div{border-left:0;border-top:1px solid var(--line)}.portal-stage summary{grid-template-columns:auto minmax(0,1fr) auto}.portal-stage summary::after{grid-column:3;grid-row:1}.portal-stage summary>.record-badge{grid-column:2;justify-self:start}.portal-file .header-actions{width:100%}.portal-file .header-actions>*{flex:1 1 auto}}
.form-grid>label{display:flex;flex-direction:column;gap:6px;justify-content:flex-start}.form-grid>label[hidden]{display:none}.form-grid>label>small{min-height:16px;margin:0}.form-grid>label>span{margin:0}
.task,.simple-file-row,.finance-row{min-width:0}
.finance-card,.finance-stack,.finance-table{min-width:0;max-width:100%}
.saved-selection-row{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto auto;align-items:center;gap:var(--ui-space-4,16px);padding:16px 0;border-top:1px solid var(--line)}.saved-selection-row>div{display:grid;gap:6px;min-width:0;overflow-wrap:anywhere}.saved-selection-row small{letter-spacing:0;color:var(--muted)}.saved-selection-row p{margin:0;font-size:12px;color:var(--muted)}.saved-selection-row a{justify-self:start}
@media(max-width:900px){.saved-selection-row{grid-template-columns:minmax(0,1fr) auto}.saved-selection-row>div{grid-column:1/-1}.selection-sheet .card-head{flex-wrap:wrap;gap:12px}}
.work-stage summary{grid-template-columns:38px minmax(0,1fr) 150px 20px;gap:var(--ui-space-3,12px)}.work-stage summary select,.work-task select{min-width:0;width:100%;min-height:var(--pc-control-small);font-size:12px;padding:6px 10px}.work-stage summary small{display:block;color:var(--muted);font-weight:400;margin-top:4px}.work-stage-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--ui-space-3,12px);padding:12px 0;color:var(--muted);font-size:12px}.work-task{display:grid;grid-template-columns:minmax(0,1fr) 140px auto;align-items:center;gap:var(--ui-space-4,16px);padding:14px 12px;border-top:1px solid var(--line);background:var(--surface-soft,var(--surface))}.work-task>div{min-width:0;overflow-wrap:anywhere}.work-task small{display:block;color:var(--muted);font-size:11px;margin-top:6px}.work-task .header-actions{justify-content:flex-end}.work-empty{padding:12px 0;margin:0;color:var(--muted);font-size:12px}.work-file-link{display:inline-block;margin:8px 12px 0 0;color:var(--ink);font-size:11px;overflow-wrap:anywhere}.work-stage .secondary-action{min-height:var(--pc-control-small);font-size:12px;padding:6px 10px}.work-task-files:empty,.work-stage-files:empty{display:none}
@media(max-width:1050px){.work-task{grid-template-columns:minmax(0,1fr) 140px}.work-task>.header-actions{grid-column:1/-1}.work-stage summary{grid-template-columns:30px minmax(0,1fr) 20px}.work-stage summary::after{grid-column:3;grid-row:1}.work-stage summary select{grid-column:2}.work-stage-tools>.header-actions{justify-content:flex-start}}
@media(max-width:520px){.work-task{grid-template-columns:1fr}.work-task>.header-actions{grid-column:auto;justify-content:flex-start}.work-stage-tools{align-items:flex-start;flex-direction:column}}
.office-storage{margin-top:auto;margin-inline:8px;padding:12px 0;border-top:1px solid var(--line);display:grid;gap:6px;font-size:11px;overflow-wrap:anywhere}.office-storage small{color:var(--muted);font-size:9px}.office-storage+.sidebar-foot{margin-top:0}.pwa-update-notice{position:fixed;z-index:100;bottom:20px;right:20px;max-width:calc(100vw - 40px);padding:16px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--pc-card-radius);box-shadow:var(--ui-shadow,0 4px 16px #0002)}
.office-server-stats{margin-inline:var(--ui-space-2,8px);padding-bottom:var(--ui-space-3,12px);font-size:10px;color:var(--muted);line-height:1.6;overflow-wrap:anywhere}.office-server-stats+.sidebar-foot{margin-top:0}
.billing-schedule-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(0,2fr) 168px;gap:var(--ui-space-3,12px)}.billing-amounts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--ui-space-2,8px);min-width:0!important;font-variant-numeric:tabular-nums}.billing-amounts span{min-width:0;overflow-wrap:anywhere}.billing-schedule-row>a{width:168px;text-decoration:none}
@media(max-width:1100px){.billing-schedule-row{grid-template-columns:1fr}.billing-amounts{grid-template-columns:repeat(2,minmax(0,1fr))}.billing-schedule-row>a{justify-self:end}}
.topbar .project-mobile-home{display:none}
@media(max-width:1100px){.tabs{flex-wrap:wrap;overflow:visible}.tabs button{flex:1 1 30%}.card-head{flex-wrap:wrap;gap:12px}.card-head>div{min-width:0;max-width:100%}.invoice-head-controls{flex-wrap:wrap;max-width:100%}}
@media(max-width:720px){.tabs{flex-wrap:wrap;overflow:visible}.tabs button{flex:1 1 30%;padding:12px 8px}.topbar .project-mobile-home{display:inline-flex;margin-bottom:8px}.topbar{height:auto;min-height:72px;padding-block:12px}.topbar>.header-actions{max-width:55%}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.card-head{flex-wrap:wrap;gap:12px}}
:is(.task,.simple-file-row,.finance-row)>*{min-width:0;overflow-wrap:anywhere}
.project-heading{gap:24px;flex-wrap:wrap}.project-heading>div:first-child{min-width:0;flex:1 1 280px}.project-heading h1{overflow-wrap:anywhere}
.task-actions,.simple-file-actions{justify-content:flex-end;gap:var(--pc-gap)}
@media(max-width:760px){.task{display:flex;flex-wrap:wrap;padding:16px;gap:12px}.task>div:not(.task-actions){flex:1 1 100%}.task-actions{width:100%}.simple-file-row,.finance-row{display:flex;flex-wrap:wrap;gap:12px;padding:16px}.simple-file-row>div:first-child,.finance-row>div:first-child{flex:1 1 100%}.project-strip{gap:16px}.project-strip>div{min-width:0}.project-strip .progress-meta{min-width:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.image3d-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:var(--ui-space-4,16px)}
[data-view="image-to-3d"] .card{padding:var(--ui-space-4,16px);margin-bottom:var(--ui-space-4,16px);border:1px solid var(--line);border-radius:var(--ui-radius,12px);background:var(--surface)}
[data-view="image-to-3d"] .card-head{display:flex;justify-content:space-between;align-items:center;gap:var(--ui-space-3,12px);flex-wrap:wrap}
[data-view="image-to-3d"] input[type="file"]{display:block;width:100%;max-width:100%;margin-bottom:var(--ui-space-4,16px);font:inherit;font-size:var(--ui-text-sm,12px)}
[data-view="image-to-3d"] input[type="file"]::file-selector-button{padding:var(--ui-space-2,8px) var(--ui-space-3,12px);border:1px solid var(--line);border-radius:var(--ui-radius-sm,8px);background:var(--surface);color:inherit;margin-right:var(--ui-space-2,8px);cursor:pointer}
.image3d-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:var(--ui-space-4,16px)}
.image3d-gallery :is(article,figure){min-width:0;margin:0;padding:var(--ui-space-3,12px);border:1px solid var(--line);border-radius:var(--ui-radius,12px);display:grid;gap:var(--ui-space-2,8px);overflow-wrap:anywhere}
.image3d-gallery img{width:100%;height:140px;object-fit:contain;background:var(--surface)}
#image3d-viewer{min-height:360px;min-width:0}#image3d-viewer canvas{display:block;max-width:100%}
#pc-engine-panel .card-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--ui-space-3,12px)}
@media(max-width:900px){.image3d-layout{grid-template-columns:1fr}}
[data-view="image-to-3d"] .module-heading{margin-bottom:var(--ui-space-6,24px)}
[data-view="image-to-3d"] .card h3{margin:0;font-size:var(--ui-text-lg,18px);line-height:1.4;font-weight:650}
[data-view="image-to-3d"] .card .eyebrow{margin:0 0 var(--ui-space-1,4px);color:var(--muted)}
[data-view="image-to-3d"] .card-head{margin-bottom:var(--ui-space-4,16px)}
[data-view="image-to-3d"] .card>p{color:var(--muted);font-size:var(--ui-text-sm,12px);line-height:1.6}
.image3d-upload-zone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--ui-space-2,8px);min-height:180px;padding:var(--ui-space-6,24px);border:1px dashed var(--line);border-radius:var(--ui-radius,12px);background:var(--surface-soft,var(--surface));text-align:center;cursor:pointer;margin-bottom:var(--ui-space-4,16px)}
.image3d-name-field{display:grid;gap:var(--ui-space-2,8px);margin-bottom:var(--ui-space-4,16px);font-size:var(--ui-text-sm,12px);color:var(--muted)}.image3d-name-field input{width:100%;min-width:0}
.image3d-name-field input{height:var(--ui-control,42px);border:1px solid var(--line);border-radius:var(--ui-radius-sm,8px);background:var(--surface);color:var(--ink);padding:var(--ui-space-3,12px);font:inherit}
.image3d-upload-zone :is(span,small){color:var(--muted);font-size:var(--ui-text-sm,12px)}
.image3d-upload-zone .ui-icon{width:28px;height:28px;color:var(--muted)}
[data-view="image-to-3d"] .image3d-upload-zone input[type="file"]{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer;width:100%;height:100%}
.image3d-upload-zone:focus-within{outline:2px solid var(--ink);outline-offset:3px}
#image3d-generate{width:100%;margin-top:var(--ui-space-4,16px)}
#image3d-viewer{display:grid;place-items:center;border:1px solid var(--line);border-radius:var(--ui-radius,12px);background:var(--ui-model-canvas);overflow:hidden;margin-bottom:var(--ui-space-4,16px)}
#image3d-viewer .empty-state{max-width:32ch;padding:var(--ui-space-6,24px);margin:0;font-size:var(--ui-text-sm,12px);line-height:1.6;color:var(--ui-model-canvas-muted)}
.image3d-gallery article{background:var(--surface);display:flex;flex-direction:column;align-items:stretch}
.image3d-gallery article img{border-radius:var(--ui-radius-sm,8px)}
.image3d-model-title{font-size:var(--ui-text-sm,12px);line-height:1.5;min-height:3em;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.image3d-model-title[role="button"]{cursor:text}.image3d-model-title[role="button"]:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.image3d-inline-name{width:100%;min-width:0;height:var(--ui-control-compact,34px);padding:var(--ui-space-2,8px);font:inherit;font-size:var(--ui-text-sm,12px);border:1px solid var(--line);border-radius:var(--ui-radius-sm,8px);background:var(--surface);color:var(--ink)}
.image3d-gallery .record-badge{align-self:flex-start;justify-self:start}.image3d-gallery article>small{color:var(--muted);font-size:var(--ui-text-sm,12px)}
.image3d-gallery article>.secondary-action{margin-top:auto;width:100%;flex-shrink:0}
.image3d-gallery-actions{margin-top:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ui-space-2,8px)}.image3d-gallery .image3d-gallery-actions .secondary-action{min-width:0;padding-inline:var(--ui-space-2,8px);white-space:nowrap}.image3d-delete{color:var(--danger,var(--ink))}
.image3d-gallery-actions.is-deleted{grid-template-columns:1fr}
#pc-engine-panel{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--ui-space-3,12px)}
#pc-engine-panel .card-head{display:contents;margin:0}#pc-engine-panel [data-engine-status]{margin:0;order:1;flex:1 1 220px;font-size:var(--ui-text-sm,12px)}
#pc-engine-panel .header-actions{order:2}#pc-engine-panel .card-head>div:first-child{display:none}
#pc-engine-panel button{min-height:var(--ui-control-compact,34px);font-size:var(--ui-text-sm,12px)}
