:root{
  --navy-950:#0a1d32;--navy-900:#102d4d;--navy-800:#173f68;--teal:#00a696;--teal-dark:#007f76;
  --ink:#14273d;--muted:#64748b;--canvas:#f3f6f8;--panel:#ffffff;--line:#d8e0e7;--line-dark:#c4d0db;
  --green:#137a4f;--green-bg:#e5f4ec;--amber:#9b6200;--amber-bg:#fff2d6;--red:#a12d2d;--red-bg:#fde8e5;
  --sidebar:254px;--topbar:72px;
}
*{box-sizing:border-box}
/* The hidden attribute always hides, whatever a component rule sets (PM walk M-1: a bar rule showed "View as" to everyone). */
[hidden]{display:none!important}
/* A control the signed-in role may not use: disabled, with the reason in its title (PM walk M-1). */
[data-role-locked]{opacity:.45;cursor:not-allowed}
html{font-family:"Segoe UI",Tahoma,Arial,sans-serif;background:var(--canvas);color:var(--ink)}
body{margin:0;font-size:15px;overflow:hidden}
button,input,select{font:inherit}
button,a{touch-action:manipulation}
a{text-decoration:none;color:inherit}
.app-shell{display:flex;min-height:100vh;width:100%}
.sidebar{width:var(--sidebar);height:100vh;flex:0 0 var(--sidebar);display:flex;flex-direction:column;background:var(--navy-950);color:#dce8f2;border-inline-end:1px solid rgba(255,255,255,.08)}
.brand{display:flex;align-items:center;gap:12px;height:var(--topbar);padding:0 20px;border-bottom:1px solid rgba(255,255,255,.1)}
.brand-mark{width:36px;height:36px;display:grid;place-items:center;background:var(--teal);color:white;font-weight:800;border-radius:8px;letter-spacing:-.04em}
img.brand-mark{background:none;border-radius:0}.auth-logo{display:block;width:168px;height:40px;margin:0 0 10px}
.brand strong{display:block;color:white;font-size:1.05rem}.brand small{display:block;color:#8fa7ba;margin-top:2px;font-size:.75rem}
.project-chip{margin:18px 14px 10px;padding:14px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05);border-radius:8px}
.project-chip small{display:block;color:#8fa7ba;font-size:.72rem}.project-chip strong{display:block;margin:6px 0 8px;color:white;font-size:.86rem;letter-spacing:.02em}
.project-chip select{width:100%;margin:0 0 9px;padding:7px 8px;border:1px solid rgba(255,255,255,.14);border-radius:5px;background:#0d2742;color:#dce8f2;font-size:.72rem}
.project-chip span{font-size:.72rem;color:#b5c7d6}.project-chip i,.system-state i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#24c583;margin-inline-end:6px;box-shadow:0 0 0 3px rgba(36,197,131,.12)}
.module-nav{padding:8px;display:flex;flex-direction:column;gap:3px;overflow-y:auto}
.nav-item{position:relative;width:100%;display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:10px;min-height:46px;padding:7px 10px;border:0;border-radius:6px;background:transparent;color:#b8c9d8;text-align:start;cursor:pointer;font-weight:600}
.nav-item:hover{background:rgba(255,255,255,.07);color:white}.nav-item.active{background:#173f68;color:white}.nav-item.active:before{content:"";position:absolute;inset-block:8px;inset-inline-start:-8px;width:3px;background:var(--teal);border-radius:3px}
.nav-icon{width:30px;height:30px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.13);border-radius:6px;font-size:.7rem;letter-spacing:.04em;color:#91d9d3}
.nav-item em{font-style:normal;font-size:.58rem;letter-spacing:.08em;color:#6f899f;border:1px solid rgba(255,255,255,.1);padding:3px 5px;border-radius:3px}
.nav-item.active em{color:#bdeae5}
.sidebar-foot{margin-top:auto;padding:14px;border-top:1px solid rgba(255,255,255,.1)}
.system-state{display:flex;align-items:center;padding:8px}.system-state strong,.system-state small{display:block}.system-state strong{font-size:.78rem;color:white}.system-state small{font-size:.68rem;color:#8fa7ba;margin-top:2px}
.workspace{min-width:0;flex:1;height:100vh;display:flex;flex-direction:column}
.topbar{height:var(--topbar);flex:0 0 var(--topbar);display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 24px;background:white;border-bottom:1px solid var(--line);box-shadow:0 2px 8px rgba(10,29,50,.04);z-index:5}
.topbar>div:first-child small,.topbar>div:first-child strong{display:block}.topbar>div:first-child small{color:var(--teal-dark);font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em}.topbar>div:first-child strong{margin-top:4px;font-size:.95rem}
.top-actions,.heading-actions{display:flex;align-items:center;gap:9px}
.language-switch{direction:ltr;display:flex;padding:3px;border:1px solid var(--line-dark);border-radius:7px;background:#f4f7f9}
.language-switch button{min-height:34px;padding:6px 10px;border:0;border-radius:5px;background:transparent;color:var(--muted);font-size:.78rem;font-weight:700;cursor:pointer}
.language-switch button.active{background:white;color:var(--navy-900);box-shadow:0 1px 4px rgba(10,29,50,.15)}
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 14px;border:1px solid transparent;border-radius:6px;font-size:.82rem;font-weight:700;cursor:pointer;white-space:nowrap}
.button.primary{background:var(--teal-dark);color:white;border-color:var(--teal-dark)}.button.primary:hover{background:#006c65}
.button.secondary{background:white;color:var(--navy-900);border-color:var(--line-dark)}.button.secondary:hover{background:#f4f7f9}
.button.full{width:100%}.button:disabled{opacity:.45;cursor:not-allowed}.compact-button{min-height:32px;padding:5px 10px}
.content{min-width:0;flex:1;overflow:auto;padding:24px;background:var(--canvas)}
.view{display:none;max-width:none;width:100%}.view.active{display:block}
.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin:0 0 20px}.page-heading.compact{align-items:center}
.kicker{margin:0 0 5px;color:var(--teal-dark);font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.12em}
.page-heading h1{margin:0;font-size:1.7rem;letter-spacing:-.025em;color:var(--navy-950)}
.page-heading p:last-child{max-width:820px;margin:7px 0 0;color:var(--muted);line-height:1.45}
.revision-badge{direction:ltr;padding:8px 12px;border:1px solid var(--line-dark);border-radius:5px;background:white;color:var(--navy-800);font-size:.72rem;font-weight:800;letter-spacing:.06em}
.revision-controls{display:flex;align-items:center;gap:8px}.revision-controls select{min-height:34px;padding:6px 9px;border:1px solid var(--line-dark);border-radius:5px;background:white;color:var(--navy-900);font-size:.75rem;font-weight:700}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.metric{background:white;border:1px solid var(--line);border-inline-start:4px solid var(--teal);padding:15px 16px;min-height:92px;box-shadow:0 3px 12px rgba(10,29,50,.035)}
.metric small{display:block;color:var(--muted);font-size:.78rem}.metric strong{direction:ltr;display:block;margin-top:11px;font-size:1.55rem;color:var(--navy-950);text-align:start}
.workflow-strip{display:grid;grid-template-columns:repeat(4,1fr);margin-bottom:14px;border:1px solid var(--line);background:white}
.workflow-strip button{display:grid;grid-template-columns:32px 1fr auto;align-items:center;gap:10px;padding:14px;border:0;border-inline-end:1px solid var(--line);background:white;text-align:start;cursor:pointer}
.workflow-strip button:last-child{border-inline-end:0}.workflow-strip button:hover{background:#f5fbfa}
.workflow-strip button>span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#e3f5f2;color:var(--teal-dark);font-size:.72rem;font-weight:800}
.workflow-strip strong,.workflow-strip small{display:block}.workflow-strip strong{font-size:.84rem}.workflow-strip small{margin-top:3px;color:var(--muted);font-size:.7rem}.workflow-strip b{color:var(--line-dark)}
.dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.roadmap-card{grid-column:1/-1}
.card{background:white;border:1px solid var(--line);padding:18px;box-shadow:0 3px 12px rgba(10,29,50,.035)}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.card-head>div{display:flex;align-items:center;gap:10px}.card-head h2{margin:0;font-size:1rem;color:var(--navy-950)}
.section-number{color:var(--teal-dark);font-size:.72rem;font-weight:800}.text-button{border:0;background:transparent;color:var(--teal-dark);font-size:.76rem;font-weight:800;cursor:pointer;padding:5px}
.activity-grid{direction:ltr;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.activity{position:relative;min-height:105px;padding:12px;border:1px solid var(--line);background:#f7fafb;text-align:start;cursor:pointer}
.activity:hover{border-color:var(--teal);background:#f2fbf9}.activity b,.activity strong,.activity small{display:block}.activity b{color:var(--teal-dark);font-size:.68rem}.activity strong{margin:9px 0 7px;font-size:.78rem;line-height:1.35}.activity small{color:var(--muted);font-size:.68rem}
html[dir="rtl"] .activity{direction:rtl;text-align:right}.stat-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.stat{padding:14px;border:1px solid var(--line);border-inline-start:3px solid #2e82a4;background:#f7fafb}.stat b,.stat span{display:block}.stat b{direction:ltr;font-size:1.3rem}.stat span{margin-top:4px;color:var(--muted);font-size:.76rem}
.input-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(340px,.6fr);gap:14px;margin-bottom:14px}
.import-card{padding:0;overflow:hidden}.drop-zone{min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px;border:2px dashed var(--line-dark);margin:14px;background:#f8fafb;text-align:center}
.drop-zone.dragging{border-color:var(--teal);background:#effaf8}.upload-symbol{width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:#e3f5f2;color:var(--teal-dark);font-size:1.5rem}.drop-zone h2{font-size:1rem;margin:12px 0 5px}.drop-zone p{margin:0 0 15px;color:var(--muted);font-size:.78rem}
.file-status{display:flex;align-items:center;gap:12px;padding:13px 15px;border-top:1px solid var(--line);background:white}.file-status>span{direction:ltr;width:34px;height:34px;display:grid;place-items:center;border-radius:6px;background:#edf2f5;color:var(--muted);font-weight:800}.file-status div{min-width:0;flex:1}.file-status strong,.file-status small{display:block}.file-status strong{font-size:.82rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-status small{margin-top:3px;color:var(--muted);font-size:.72rem}.file-status.success>span{background:var(--green-bg);color:var(--green)}.file-status.error>span{background:var(--red-bg);color:var(--red)}.file-status.wide{margin-bottom:14px;border:1px solid var(--line);border-inline-start:4px solid var(--teal)}
.batch-toolbar{display:flex;align-items:center;justify-content:space-between;padding:10px 14px 0;border-top:1px solid var(--line);font-size:.75rem}.batch-toolbar[hidden]{display:none}.text-button.danger{color:var(--red)}
.boq-file-list{display:grid;gap:7px;padding:10px 14px 14px;max-height:280px;overflow:auto}.boq-file-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:6px}.boq-file-item{appearance:none;width:100%;display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px;border:1px solid var(--line);border-radius:5px;background:#fff;color:var(--ink);text-align:start;cursor:pointer}.boq-file-item:hover,.boq-file-row.active .boq-file-item{border-color:var(--teal);background:#f2fbf9}.boq-file-item:disabled{cursor:not-allowed;opacity:.78}.file-remove{appearance:none;border:1px solid var(--line);border-radius:5px;background:#fff;color:var(--muted);font-size:1.15rem;cursor:pointer}.file-remove:hover,.file-remove:focus-visible{border-color:var(--red);background:var(--red-bg);color:var(--red);outline:none}.file-sequence{direction:ltr;width:30px;height:30px;display:grid;place-items:center;border-radius:4px;background:var(--navy-900);color:#fff;font-size:.68rem;font-weight:800}.file-details{min-width:0}.file-details strong,.file-details small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-details strong{font-size:.75rem}.file-details small{margin-top:3px;color:var(--muted);font-size:.65rem}.file-state{padding:4px 6px;border-radius:4px;font-size:.58rem;font-weight:900}.file-state.ready{background:#edf2f5;color:var(--muted)}.file-state.validated{background:var(--green-bg);color:var(--green)}.file-state.failed{background:var(--red-bg);color:var(--red)}
.mapping-context{margin:-3px 0 14px;color:var(--muted);font-size:.72rem;line-height:1.5}.preview-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.mapping-fields{display:grid;gap:10px;margin-bottom:14px}.mapping-fields label span{display:block;margin-bottom:5px;color:var(--muted);font-size:.72rem;font-weight:700}.mapping-fields select,.draft-resource input,.draft-resource select{width:100%;height:38px;padding:7px 9px;border:1px solid var(--line-dark);border-radius:5px;background:white;color:var(--ink)}
.empty-message{color:var(--muted);font-size:.8rem;line-height:1.55}.table-card{padding:0;overflow:hidden}.table-card .card-head{padding:16px 18px;margin:0;border-bottom:1px solid var(--line)}
.table-count{direction:ltr;color:var(--muted);font-size:.72rem}.data-table-wrap{width:100%;overflow:auto}.data-table{width:100%;border-collapse:collapse;font-size:.76rem}.data-table th{position:sticky;top:0;z-index:1;padding:10px 12px;background:#eef3f6;color:#46596c;text-align:start;white-space:nowrap;border-bottom:1px solid var(--line-dark)}.data-table td{padding:10px 12px;border-bottom:1px solid #e7edf1;vertical-align:top;line-height:1.4}.data-table tbody tr:hover{background:#f6fbfb}.data-table td small{display:block;color:var(--muted);font-size:.66rem;margin-top:3px}.data-table code{direction:ltr;display:inline-block;color:var(--navy-800);font-size:.7rem}.data-table .number{direction:ltr;text-align:end;white-space:nowrap}.empty-cell{height:120px;color:var(--muted);text-align:center!important;vertical-align:middle!important}
.status{display:inline-block;padding:3px 7px;border-radius:4px;font-size:.64rem;font-weight:800;white-space:nowrap}.status.implemented,.status.matched{background:var(--green-bg);color:var(--green)}.status.partial,.status.duration-variance{background:var(--amber-bg);color:var(--amber)}.status.not-implemented,.status.schedule-gap{background:var(--red-bg);color:var(--red)}.status.neutral{background:#edf2f5;color:var(--muted)}
.resource-type{display:inline-block;padding:3px 7px;border-radius:4px;background:#e8eef5;color:#34516e;font-size:.65rem;font-weight:800}.resource-type.labour{background:#e9f3fd;color:#25649a}.resource-type.material{background:#e8f5ed;color:#26704b}.resource-type.plant{background:#fff1da;color:#8b5c13}.resource-type.subcontract{background:#f1eafd;color:#68409a}.resource-type.composite{background:#e5f6f4;color:#04766d}
.output-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.output-card{display:grid;grid-template-columns:54px 1fr auto;align-items:center;gap:14px;padding:17px;background:white;border:1px solid var(--line)}.file-kind{direction:ltr;width:50px;height:50px;display:grid;place-items:center;background:var(--navy-900);color:white;border-radius:6px;font-size:.65rem;font-weight:900;letter-spacing:.06em}.output-card h2{margin:0;font-size:.9rem}.output-card p{margin:4px 0;color:var(--muted);font-size:.74rem}.output-card small{direction:ltr;color:#8393a3;font-size:.66rem}.feature-card{margin-top:14px}
.portfolio-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 0 12px}.segmented-control{display:flex;padding:3px;border:1px solid var(--line-dark);border-radius:6px;background:#e9eff3}.segmented-control button{padding:7px 11px;border:0;border-radius:4px;background:transparent;color:var(--muted);font-size:.72rem;font-weight:800;cursor:pointer}.segmented-control button.active{background:white;color:var(--navy-900);box-shadow:0 1px 4px rgba(10,29,50,.12)}
.project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}.project-card{display:flex;flex-direction:column;min-height:235px;padding:17px;background:#fff;border:1px solid var(--line);border-top:4px solid var(--teal);box-shadow:0 3px 12px rgba(10,29,50,.035)}.project-card.archived{border-top-color:#8494a3;opacity:.86}.project-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.project-card code{direction:ltr;color:var(--teal-dark);font-size:.7rem;font-weight:800}.project-card h2{margin:8px 0 5px;font-size:1rem;line-height:1.35}.project-card p{margin:0;color:var(--muted);font-size:.75rem}.project-meta{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:15px 0}.project-meta div{padding:9px;background:#f5f8fa;border:1px solid #e7edf1}.project-meta small,.project-meta strong{display:block}.project-meta small{color:var(--muted);font-size:.63rem}.project-meta strong{direction:ltr;margin-top:4px;font-size:.78rem}.project-card-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:auto}.project-card-actions .button{min-height:32px;padding:5px 9px;font-size:.7rem}.comparison-card{margin-top:14px}
.access-grid{display:grid;grid-template-columns:minmax(420px,.7fr) minmax(0,1.3fr);gap:14px}.audit-wrap{max-height:520px}.role-badge{display:inline-block;padding:4px 7px;border-radius:4px;background:#e8eef5;color:#34516e;font-size:.64rem;font-weight:800}.role-badge.admin{background:#e5f4ec;color:#137a4f}.role-badge.planner{background:#e9f3fd;color:#25649a}.role-badge.viewer{background:#edf2f5;color:#64748b}
.dialog-backdrop{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:20px;background:rgba(5,20,35,.58);backdrop-filter:blur(2px)}.dialog-backdrop[hidden]{display:none}.dialog{width:min(620px,100%);max-height:calc(100vh - 40px);overflow:auto;padding:22px;background:white;border:1px solid var(--line);box-shadow:0 24px 70px rgba(5,20,35,.3)}.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.dialog-head h2{margin:0;font-size:1.25rem}.dialog-close{width:34px;height:34px;border:1px solid var(--line);border-radius:5px;background:white;color:var(--muted);font-size:1.2rem;cursor:pointer}.project-form{display:grid;grid-template-columns:1fr 1fr;gap:13px}.project-form label:first-child,.project-form .dialog-actions{grid-column:1/-1}.project-form label span{display:block;margin-bottom:5px;color:var(--muted);font-size:.72rem;font-weight:700}.project-form input,.project-form select{width:100%;height:40px;padding:8px 10px;border:1px solid var(--line-dark);border-radius:5px;background:white}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:7px}
.toast{position:fixed;z-index:50;inset-inline-end:24px;bottom:24px;max-width:420px;padding:13px 16px;border-radius:6px;background:var(--navy-950);color:white;box-shadow:0 12px 30px rgba(10,29,50,.24);font-size:.8rem;transform:translateY(20px);opacity:0;pointer-events:none;transition:.2s}.toast.visible{transform:none;opacity:1}.toast.error{background:var(--red)}
@media(max-width:1200px){:root{--sidebar:218px}.activity-grid{grid-template-columns:repeat(3,1fr)}.workflow-strip{grid-template-columns:repeat(2,1fr)}.workflow-strip button:nth-child(2){border-inline-end:0}.workflow-strip button:nth-child(-n+2){border-bottom:1px solid var(--line)}.input-layout{grid-template-columns:1fr}.project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.access-grid{grid-template-columns:1fr}}
@media(max-width:900px){body{overflow:auto}.app-shell{display:block}.sidebar{width:100%;height:auto;display:block}.brand{height:58px}.project-chip,.sidebar-foot{display:none}.module-nav{flex-direction:row;overflow:auto;padding:7px}.nav-item{min-width:max-content;width:auto;grid-template-columns:28px auto auto}.nav-item.active:before{inset-block:auto -7px;inset-inline:8px;width:auto;height:3px}.workspace{height:auto;min-height:calc(100vh - 58px)}.topbar{height:auto;min-height:64px;flex-wrap:wrap;padding:10px 16px}.content{overflow:visible;padding:16px}.page-heading{align-items:flex-start;flex-direction:column}.metrics{grid-template-columns:repeat(2,1fr)}.dashboard-grid{grid-template-columns:1fr}.activity-grid{grid-template-columns:repeat(2,1fr)}.output-grid{grid-template-columns:1fr}.project-grid{grid-template-columns:1fr}}
@media(max-width:600px){.top-actions{width:100%;overflow:auto}.topbar>div:first-child{display:none}.metrics,.workflow-strip,.activity-grid,.stat-list{grid-template-columns:1fr}.workflow-strip button{border-inline-end:0;border-bottom:1px solid var(--line)}.output-card{grid-template-columns:46px 1fr}.output-card .button{grid-column:1/-1}.heading-actions{width:100%;flex-wrap:wrap}.portfolio-toolbar{align-items:flex-start;flex-direction:column}.segmented-control{width:100%;overflow:auto}.project-form{grid-template-columns:1fr}.project-form label{grid-column:1/-1}.revision-controls{width:100%;flex-wrap:wrap}}

/* ---------- Workbook discovery ---------- */
.discovery-card { display: flex; flex-direction: column; gap: 12px; }
.discovery-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.discovery-summary .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.discovery-count { margin-inline-start: auto; opacity: .7; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: rgba(127, 127, 127, .16); }
.type-BOQ_DETAIL { background: rgba(34, 139, 94, .18); color: #1c7a52; }
.type-SUMMARY { background: rgba(60, 110, 200, .18); color: #2f5cae; }
.type-RATE_SCHEDULE { background: rgba(150, 100, 200, .18); color: #7247ad; }
.hidden-chip { background: rgba(200, 140, 40, .2); color: #9a6608; }
.override-chip { background: rgba(200, 80, 80, .18); color: #a33a3a; }
.sum-chip { background: rgba(150, 100, 200, .2); color: #7247ad; }

.sheet-list { display: grid; gap: 10px; max-height: 520px; overflow-y: auto; padding-inline-end: 4px; }
.sheet-card { border: 1px solid rgba(127, 127, 127, .25); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; background: rgba(127, 127, 127, .04); }
.sheet-card.included { border-color: rgba(34, 139, 94, .5); background: rgba(34, 139, 94, .06); }
.sheet-card.active { outline: 2px solid rgba(60, 110, 200, .45); outline-offset: 1px; }
.sheet-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-include { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.sheet-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-verdict { display: flex; align-items: center; gap: 8px; }
.sheet-type { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 6px; }
.confidence { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 6px; }
.confidence.high { background: rgba(34, 139, 94, .18); color: #1c7a52; }
.confidence.medium { background: rgba(200, 150, 40, .2); color: #8a6508; }
.confidence.low { background: rgba(200, 80, 80, .18); color: #a33a3a; }
.sheet-facts { display: flex; gap: 14px; margin: 0; font-size: 12px; }
.sheet-facts div { display: flex; gap: 4px; }
.sheet-facts dt { opacity: .65; margin: 0; }
.sheet-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-roles { margin: 0; font-size: 12px; opacity: .8; }
.sheet-note { margin: 0; font-size: 11px; opacity: .65; }
.sheet-reasons summary { cursor: pointer; font-size: 12px; opacity: .8; }
.sheet-reasons ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: 12px; opacity: .8; }
.sheet-reasons li { margin-bottom: 2px; }

/* ---------- Rebuilt structure and review queue ---------- */
.structure-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.structure-stat { border: 1px solid rgba(127, 127, 127, .22); border-radius: 8px; padding: 8px 12px; display: grid; gap: 2px; }
.structure-stat span { font-size: 12px; opacity: .8; }
.structure-stat small { font-size: 11px; opacity: .6; }
.preview-table .row-number, .data-table .row-number { width: 56px; text-align: center; opacity: .55; font-variant-numeric: tabular-nums; }
.description-cell { max-width: 520px; }
.source-cell { font-size: 11px; opacity: .7; white-space: nowrap; }
.numeric { text-align: end; font-variant-numeric: tabular-nums; }
.missing-value { color: #a33a3a; font-style: italic; }
.flagged-row { background: rgba(200, 150, 40, .07); }

/* ---------- Honest empty states and sample marking ---------- */
.sample-banner { margin: 0; padding: 8px 20px; font-size: 12px; font-weight: 600; background: rgba(200, 80, 80, .12); color: #a33a3a; border-bottom: 1px solid rgba(200, 80, 80, .25); }
.empty-state { display: grid; gap: 6px; justify-items: start; padding: 18px; border: 1px dashed rgba(127, 127, 127, .4); border-radius: 10px; background: rgba(127, 127, 127, .04); }
.empty-state strong { font-size: 14px; }
.empty-state p { margin: 0; font-size: 13px; opacity: .75; max-width: 62ch; }
.data-table td > .empty-state { margin: 4px 0; }
.pricing-blockers { margin: 10px 0 0; }
.blocker-row { display: flex; flex-wrap: wrap; gap: 6px; }
.blocker-chip { background: rgba(200, 150, 40, .18); color: #8a6508; }
.blocker-notes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.unpriced-row { opacity: .92; }
.unpriced-row td:first-child small { opacity: .6; font-style: italic; }
.structure-alert { margin: 0 0 10px; padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; background: rgba(200, 80, 80, .12); color: #a33a3a; border: 1px solid rgba(200, 80, 80, .3); }
.plan-note { color: #8a6508; background: rgba(200, 150, 40, .14); padding: 2px 6px; border-radius: 5px; display: inline-block; margin-top: 3px; }
.status.engine-only { background: rgba(60, 110, 200, .16); color: #2f5cae; }
.recovered-note { margin: 6px 0 0; font-size: 12px; color: #8a6508; background: rgba(200, 150, 40, .14); padding: 4px 8px; border-radius: 6px; }
.revision-note { margin: 0 0 12px; font-size: 13px; color: #8a6508; background: rgba(200, 150, 40, .14); padding: 8px 12px; border-radius: 8px; }

.library-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.library-stats[hidden] { display: none; }
.library-stats .stat.placeholder { border-inline-start-color: var(--red); }
.library-stats .stat.priced { border-inline-start-color: var(--green); }
.library-toolbar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7fafb; }
.library-toolbar[hidden] { display: none; }
.library-toolbar input, .library-toolbar select { height: 36px; padding: 6px 10px; border: 1px solid var(--line-dark); border-radius: 5px; background: white; font-size: .78rem; }
.library-toolbar input { flex: 1 1 260px; min-width: 160px; }
.status.placeholder { background: var(--red-bg); color: var(--red); }
.status.priced { background: var(--green-bg); color: var(--green); }
.data-table td.group-path { color: var(--muted); font-size: .66rem; }
.resource-type.other { background: #eceff2; color: #4c5b69; }
@media (max-width: 900px) { .library-stats { grid-template-columns: repeat(2, 1fr); } .library-toolbar { flex-wrap: wrap; } }

.muted { color: var(--muted); }

.totals-strip { grid-template-columns: repeat(6, 1fr); }
.totals-strip .totals-note { grid-column: 1 / -1; margin: 0; font-size: .78rem; color: var(--muted); }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); font-weight: 700; }
.inline-field input { width: 84px; height: 38px; padding: 6px 10px; border: 1px solid var(--line-dark); border-radius: 6px; direction: ltr; text-align: end; }
.cell-input, .cell-select { width: 100%; min-width: 88px; height: 30px; padding: 3px 7px; border: 1px solid var(--line-dark); border-radius: 4px; background: white; font-size: .74rem; }
.cell-input[type=number] { direction: ltr; text-align: end; }
.cell-input.needs-value { border-color: var(--red); background: var(--red-bg); }
.cell-stack { display: grid; gap: 4px; min-width: 150px; }
.pricing-table td, .ws-table td { vertical-align: middle; }
.excluded-row td { opacity: .55; }
.excluded-row td.scope-cell { opacity: 1; }
.scope-cell .exclusion-reason { margin-top: 4px; min-width: 160px; }
.exclusion-proposal { margin-top: 4px; padding: 4px 6px; border-left: 3px solid #c98a00; background: rgba(201, 138, 0, .08); max-width: 320px; white-space: normal; }
.exclusion-bar { margin: 10px 16px 0; padding: 8px 12px; border: 1px solid rgba(201, 138, 0, .45); border-radius: 6px; background: rgba(201, 138, 0, .06); }
.exclusion-bar .exclusion-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.exclusion-bar ul { margin: 6px 0 0; padding-inline-start: 18px; }
.exclusion-bar li { margin: 3px 0; }
.text-button.tiny { display: block; margin-top: 4px; font-size: .66rem; }
.table-more { display: block; width: 100%; padding: 10px; text-align: center; border-top: 1px solid var(--line); }
.check-list { list-style: none; margin: 0; padding: 0 18px 14px; }
.check-list li { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: .8rem; }
.check-list li small { grid-column: 2; color: var(--muted); direction: ltr; text-align: start; }
.dialog.dialog-wide { width: min(1080px, 100%); }
.ws-head { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.ws-head label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.ws-head input { width: 100%; height: 38px; padding: 6px 10px; border: 1px solid var(--line-dark); border-radius: 5px; }
.ws-search { position: relative; margin-bottom: 12px; }
.ws-search input { width: 100%; height: 40px; padding: 6px 12px; border: 1px solid var(--teal-dark); border-radius: 6px; }
.ws-results { position: absolute; inset-inline: 0; top: 42px; z-index: 5; max-height: 300px; overflow: auto; background: white; border: 1px solid var(--line-dark); border-radius: 6px; box-shadow: 0 12px 30px rgba(5,20,35,.18); }
.ws-results:empty { display: none; }
.ws-result { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: start; font: inherit; font-size: .76rem; cursor: pointer; }
.ws-result:hover { background: #f4fbfa; }
.ws-result code { direction: ltr; font-size: .7rem; }
.ws-result em { color: var(--muted); font-style: normal; white-space: nowrap; direction: ltr; }
.ws-result.placeholder em { color: var(--red); }
.ws-none { padding: 10px 12px; color: var(--muted); font-size: .76rem; }
.ws-actions { align-items: center; justify-content: space-between; }
.ws-actions .stat { min-width: 240px; padding: 8px 12px; }
@media (max-width: 900px) { .totals-strip { grid-template-columns: repeat(3, 1fr); } .ws-head { grid-template-columns: 1fr; } }

/* The bill items table is numeric, but its description reads left to right like any text. */
.data-table.numeric.pricing-table td:nth-child(3), .data-table.numeric.pricing-table th:nth-child(3) { text-align: start; }

.rate-button { padding: 3px 8px; border: 1px dashed var(--line-dark); border-radius: 4px; background: white; font: inherit; font-size: .76rem; direction: ltr; cursor: pointer; }
.rate-button:hover { border-color: var(--teal-dark); color: var(--teal-dark); }
.rate-button.placeholder { color: var(--red); border-color: var(--red); }
.rate-current { margin: 0 0 12px; color: var(--muted); font-size: .8rem; }
.rate-current b { color: var(--navy-950); direction: ltr; unicode-bidi: embed; }
.field-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.rate-history { list-style: none; margin: 0; padding: 0; max-height: 140px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.rate-history li { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .74rem; }
.rate-history li b { direction: ltr; text-align: end; }
.rate-history li small { color: var(--muted); }
.project-form > div { grid-column: 1 / -1; }
input[inputmode="decimal"] { direction: ltr; text-align: end; font-variant-numeric: lining-nums tabular-nums; }

.candy-import-stats { margin: 0; padding: 0 18px 12px; }
#candyImportCard h3 { margin: 0; font-size: .9rem; }

.manual-match { position: relative; min-width: 320px; }
.manual-match .cell-input { text-align: start; direction: inherit; }
.manual-results { top: 34px; }
.ws-result span small { display: block; color: var(--muted); font-size: .66rem; }

.links-resources li { grid-template-columns: 90px 1fr auto auto; }
.links-resources li span { color: var(--muted); direction: ltr; }

.relink-activity { flex: 1 1 320px; min-width: 260px; height: 36px; }

.user-form{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}.role-badge.reviewer{background:#fdf3e3;color:#9a5b0b}.role-badge.estimator{background:#eef3fb;color:#3b5f8f}

.button[hidden]{display:none}
.master-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.master-tabs button{padding:7px 12px;border:1px solid var(--line-dark);border-radius:5px;background:white;font-size:.78rem;font-weight:700;cursor:pointer}.master-tabs button.active{background:var(--navy-800,#0f2a44);color:white}.master-form{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}.master-form .project-form{grid-template-columns:repeat(3,1fr)}

.revision-modes{display:grid;gap:8px;margin:12px 0}.revision-modes label{display:flex;gap:10px;align-items:flex-start;padding:10px;border:1px solid var(--line);border-radius:6px;cursor:pointer}.revision-modes small{display:block;color:var(--muted)}.revision-table{max-height:320px;overflow:auto;margin:8px 0}.sheet-reading{margin:8px 0}.sheet-reading.needs-mapping>summary{color:var(--red);font-weight:800}.reading-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:8px}.reading-grid label span{display:block;font-size:.68rem;color:var(--muted);font-weight:700}.reading-grid input,.reading-grid select{width:100%;height:32px;border:1px solid var(--line-dark);border-radius:4px;padding:4px 6px}.reading-grid .wide{grid-column:1/-1}.sheet-reasons-list{margin:6px 0;padding-inline-start:18px;font-size:.72rem;color:var(--muted)}

.commercial-form{grid-template-columns:repeat(4,1fr)}.commercial-form label.check{display:flex;align-items:center;gap:8px;margin-top:22px}.commercial-form label.check input{width:auto;height:auto}.commercial-form .wide{grid-column:1/-1}tr.recommended td{background:var(--green-bg)}

.project-form textarea{width:100%;min-height:84px;padding:8px 10px;border:1px solid var(--line-dark);border-radius:5px;font:inherit;font-size:.8rem}

.suggestion-list{display:grid;gap:8px;margin:8px 0}.suggestion{padding:10px 12px;border:1px solid var(--line);border-radius:6px}.suggestion.active{border-color:var(--teal);background:#f2fbf9}.suggestion-head{display:flex;gap:10px;align-items:center}.suggestion-head span{flex:1}.suggestion small{display:block;color:var(--muted);margin-top:3px}.suggestion .confidence{padding:2px 8px;border-radius:10px;font-size:.72rem}.codes-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:6px 0 12px}.codes-strip small{display:block;color:var(--muted);font-size:.66rem;font-weight:700}.master-tag{display:block;color:var(--teal-dark);font-size:.64rem}

.id-scheme .library-toolbar{align-items:flex-end;flex-wrap:wrap}.id-scheme label span{display:block;font-size:.66rem;color:var(--muted);font-weight:700}.id-scheme input{width:110px;height:34px;border:1px solid var(--line-dark);border-radius:4px;padding:4px 8px}

#templateReview{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}#templateReviewRows td{vertical-align:top}#templateReviewRows .confidence{display:inline-block;padding:2px 8px;border-radius:10px;font-size:.72rem;font-weight:800}

.history-chip{display:block;margin-top:4px;font-size:.64rem;cursor:help}.history-reason{display:block;color:var(--muted);font-size:.64rem}.median-line{display:block;margin-top:3px;color:var(--muted);font-size:.64rem;font-weight:400;white-space:normal;cursor:help}.median-line.differs{color:var(--ink,#1c2b2a);font-weight:600}.median-details{flex-basis:100%;font-size:.72rem}.median-details ul{margin:4px 0 4px 18px;padding:0}.median-details summary{cursor:pointer}.median-voices{color:var(--muted);font-size:.66rem}.median-far{color:#a43d1f}

.manual-offers{margin-top:18px;padding-top:12px;border-top:1px solid var(--line)}#manualOfferRows input{width:110px;height:30px;border:1px solid var(--line-dark);border-radius:4px;padding:3px 6px}

/* CSI divisions on Price Build-up: one chip per division, the active one filled. */
.division-bar{display:flex;flex-wrap:wrap;gap:6px;padding:10px 16px 0}
.division-chip{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:120px;padding:6px 10px;border:1px solid var(--line-dark);border-radius:6px;background:white;color:var(--navy-900);cursor:pointer;text-align:start}
.division-chip b{font-size:.74rem}.division-chip small{font-size:.64rem;color:var(--muted)}
.division-chip.has-unpriced{border-inline-start:3px solid var(--amber)}
.division-chip.active{background:var(--navy-800);border-color:var(--navy-800);color:white}.division-chip.active small{color:#d6e2ee}
.division-code{min-width:30px;padding:3px 6px;border:1px solid var(--line-dark);border-radius:4px;background:#f4f7f9;color:var(--navy-900);font-size:.7rem;font-weight:800;cursor:pointer;direction:ltr}
.division-code.manual{border-color:var(--teal);color:var(--teal-dark)}.division-code.unclassified{background:var(--amber-bg);color:var(--amber)}
.division-select{min-width:180px}
.library-explain{max-width:980px;margin-top:6px}
.inline-check{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;color:var(--navy-900);white-space:nowrap}
.preview-note{padding:8px 16px 12px}
#itemOfferExplain{margin-top:14px}

/* A line judged in its place: its path, its facts, the owner's rows around it. */
.line-path{display:block;color:var(--muted);font-size:.66rem;line-height:1.4;margin-bottom:2px}.line-path b{color:var(--line-dark);font-weight:400}
.line-facts,.owner-price,.review-explain{display:block;margin-top:3px;font-size:.68rem;color:var(--muted);line-height:1.4}.owner-price{color:var(--navy-800)}
.owner-rows td{font-size:.7rem;white-space:pre-wrap;vertical-align:top;max-width:420px}.owner-rows .target-row td{background:var(--amber-bg);font-weight:700}.owner-rows .header-row td{background:#eef3f7;font-weight:700}
/* The roadmap on Overview: a summary across the grid, then the largest activities. */
.roadmap-summary{grid-column:1/-1;margin:0 0 4px}
.activity-more{display:flex;align-items:center;justify-content:center;color:var(--teal-dark)}
/* Resource picker and draft resources (build-up worksheet, Resource Library) */
.ws-picker-bar{display:flex;gap:8px;align-items:center}.ws-search .ws-picker-bar input{flex:1;width:auto}.ws-picker-bar select{height:40px}
.ws-picker{max-height:320px;overflow:auto;margin-top:8px;background:white;border:1px solid var(--line-dark);border-radius:6px}
.ws-group summary{display:flex;justify-content:space-between;gap:10px;padding:7px 12px;background:#f5f8fa;border-bottom:1px solid var(--line);font-size:.76rem;font-weight:700;cursor:pointer}.ws-group summary em{font-style:normal;color:var(--muted);direction:ltr}
.ws-kind h4{margin:0;padding:5px 12px;font-size:.66rem;font-weight:800;color:var(--muted);text-transform:uppercase}.ws-kind h4 em{font-style:normal}
.draft-tag{display:inline-block;margin-inline-start:6px;padding:1px 6px;border-radius:4px;background:var(--amber-bg);color:var(--amber);font-size:.64rem;font-weight:800;white-space:nowrap}
.new-resource-host{margin:8px 0;padding:10px 12px;border:1px solid var(--teal-dark);border-radius:6px;background:#fbfefd}.new-resource .form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:8px 0}.new-resource .form-grid .wide{grid-column:span 2}.new-resource label span{display:block;margin-bottom:4px;color:var(--muted);font-size:.72rem;font-weight:700}.new-resource input,.new-resource select{width:100%;height:36px;padding:5px 9px;border:1px solid var(--line-dark);border-radius:5px;background:white}@media (max-width:700px){.new-resource .form-grid{grid-template-columns:1fr}.new-resource .form-grid .wide{grid-column:auto}.similar-row{grid-template-columns:1fr}}
.new-resource-similar{font-size:.76rem}.similar-row{display:grid;grid-template-columns:96px 1fr auto auto;gap:8px;align-items:center;padding:5px 0;border-bottom:1px solid var(--line)}.similar-row code{direction:ltr}.similar-row small{display:block;color:var(--muted)}.similar-row em{font-style:normal;color:var(--amber)}
.library-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:8px 12px;border-bottom:1px solid var(--line);background:#fbfefd}.library-bulk[hidden]{display:none}.library-bulk p{margin:0;flex:1 1 320px}.library-bulk .bulk-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.bulk-tick{display:inline-flex;align-items:center;margin-inline-end:6px}.bulk-tick input{width:16px;height:16px}
/* 0.21.2 speed: the snapshot is being rebuilt off the page. The indicator says so, and what the screens show is marked as updating (not current) until the new one is applied. */
.snapshot-busy{display:inline-flex;align-items:center;gap:7px;padding:5px 10px;border:1px solid var(--line-dark);border-radius:999px;background:#fffaf0;color:var(--amber);font-size:.72rem;font-weight:800;white-space:nowrap}.snapshot-busy[hidden]{display:none}.snapshot-busy i{width:10px;height:10px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:snapshot-spin .8s linear infinite}
@keyframes snapshot-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.snapshot-busy i{animation:none}}
body[data-snapshot="updating"] .content .view{opacity:.62;transition:opacity .15s ease-in}
/* The development-phase bar (owner's decision 2026-09-29): visible while the server runs in it; "View as" for the ADMIN. */
.development-phase-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:6px 24px;background:var(--amber-bg);color:var(--amber);border-bottom:1px solid var(--line);font-size:.78rem}.development-phase-bar[hidden],.development-phase-bar [hidden]{display:none}
.development-phase-bar .view-as{display:inline-flex;align-items:center;gap:6px;font-weight:700}.development-phase-bar select{font:inherit;padding:2px 6px}
/* The planner baseline against the issued mapping: the confirmation screen (mapping-confirmation.js). */
#mappingConfirmBody section{margin-bottom:14px}#mappingConfirmBody td small{display:block;color:var(--muted);font-size:.68rem}#mappingConfirmBody code{direction:ltr;unicode-bidi:embed;font-size:.72rem}
.mapping-rejected td{opacity:.55;text-decoration:line-through}.mapping-rejected td:first-child{opacity:1;text-decoration:none}.mapping-accept{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:.74rem}
.mapping-distribution>td{background:#f7fafb}.mapping-distribution .data-table{margin-top:4px}.mapping-distribution .cell-input{max-width:96px}.ws-table th small{display:block;font-weight:400;font-size:.66rem;color:var(--muted)}.ws-table .percent-description{max-width:none;width:100%;text-align:start}.percent-line-fields{display:flex;gap:6px;align-items:center}.percent-line-fields .cell-input{width:80px}
.mapping-summary{padding:12px 14px;border:1px solid var(--line);border-inline-start:3px solid #2e82a4;background:#f7fafb;margin:10px 0}.mapping-summary ul{margin:6px 0;padding-inline-start:18px;font-size:.76rem}
.mapping-problem{color:var(--red);background:var(--red-bg);padding:8px 12px;border-radius:4px;font-size:.76rem}.mapping-confirm-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;font-size:.78rem}
.mapping-item{display:inline-block;direction:ltr;unicode-bidi:isolate}
/* 0.21.2: Price Build-up in pages, and the scope of many lines in one action */
.pricing-table .select-cell { width: 28px; padding-inline: 6px; text-align: center; }
.pricing-table .select-cell input { width: 16px; height: 16px; cursor: pointer; }
.bulk-scope-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f7fafb; }
.bulk-scope-bar[hidden] { display: none; }
.bulk-scope-bar .cell-select { width: auto; min-width: 190px; }
.bulk-scope-bar .cell-input { flex: 1 1 260px; min-width: 200px; }
.table-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; }
.table-pager[hidden] { display: none; }
.table-pager .pager-page { min-width: 32px; height: 28px; padding: 2px 8px; border: 1px solid var(--line-dark); border-radius: 4px; background: white; color: var(--navy-900); font-size: .72rem; font-weight: 700; cursor: pointer; direction: ltr; }
.table-pager .pager-page.active { border-color: var(--teal); background: #f2fbf9; color: var(--teal); }
.table-pager .pager-gap { color: var(--muted); }
.table-pager .text-button:disabled { opacity: .45; cursor: default; }
/* 0.21.2: the export gate dialog fits the screen; every text in it wraps (owner's finding 3) */
#exportGateDialog .dialog { max-width: 100%; overflow-x: hidden; }
#exportGateDialog table { table-layout: fixed; width: 100%; }
#exportGateDialog th:nth-child(1) { width: 34%; }
#exportGateDialog th:nth-child(2) { width: max(10%, 4.8em); }
#exportGateDialog th:nth-child(3) { width: 36%; }
#exportGateDialog th:nth-child(4) { width: 20%; }
#exportGateDialog td { overflow-wrap: anywhere; white-space: normal; }
#exportGateDialog th { white-space: normal; }
#exportGateDialog td:not(.number), #exportGateDialog th { text-align: start; }
#exportGateDialog .status, #exportGateDialog .button, #exportGateDialog small { white-space: normal; max-width: 100%; }
#exportGateDialog .button { height: auto; text-align: start; }
#exportGateDialog p, #exportGateRejected { overflow-wrap: anywhere; }
.gate-refused { color: var(--red); font-weight: 700; }
.gate-refused:empty { display: none; }

/* The lock dialog (owner's decisions 2026-09-30): the gaps it accepts, and a reason as wide as the dialog. */
.lock-gaps { margin: 0.25rem 0 0.75rem; padding-inline-start: 1.25rem; line-height: 1.5; }
#lockReason { width: 100%; box-sizing: border-box; }

/* Product Manager walk 2026-09-30 (B-3, M-4): accept all of one kind; the gate names its lines and links them; Price Build-up shows only some lines. */
.review-bulk { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
button.blocker-chip { border: 0; cursor: pointer; font: inherit; }
button.blocker-chip.active { outline: 2px solid currentColor; }
.gate-show { display: block; margin: 6px 0 2px; }
.gate-lines { margin: 4px 0 0; padding-inline-start: 1rem; line-height: 1.45; }
.gate-lines li button { text-align: start; }
.gate-lines small { opacity: .75; }
.pricing-show-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pricing-show-note { margin: 6px 0 0; }
.gate-carried { display: block; margin-top: 4px; }
.review-banner { display: grid; gap: 8px; margin: 0 0 14px; padding: 12px 16px; border-radius: 8px; background: var(--amber-bg); border: 1px solid rgba(155, 98, 0, .35); color: var(--amber); }
.batch-description { white-space: normal; min-width: 320px; max-width: 520px; overflow-wrap: anywhere; text-align: start; }
.batch-description small { display: block; white-space: normal; }
.library-gap { padding: 8px 12px; border-radius: 6px; background: #eef4fb; border: 1px solid var(--line-dark); }
.not-awarded-band { margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: #edf2f5; border: 1px solid var(--line-dark); font-weight: 700; color: var(--navy-900); }
.stage-choice { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.stage-choice small, .stage-history span, .stage-history small { display: block; }
.stage-history { margin: 8px 0 0; padding-inline-start: 18px; }
.change-list, .change-lines { margin: 0; padding: 0; list-style: none; }
.change-entry { padding: 8px 12px; border-top: 1px solid var(--line); }
.change-head strong, .change-head small { display: block; }
.change-lines { margin-top: 6px; padding-inline-start: 12px; font-size: 12px; }
.change-issue { background: var(--green-bg); }
.auto-summary { padding: 8px 12px; border-radius: 6px; background: #eef4fb; border: 1px solid var(--line-dark); font-weight: 600; }
.auto-price { margin-top: 4px; }
.auto-price summary { cursor: pointer; list-style: revert; background: #e3ecf7; color: var(--navy-900); }
.auto-price.auto-low summary { background: var(--amber-bg); color: var(--amber); }
.auto-price small { display: block; white-space: normal; }
.auto-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* The productivity indicator: a dot (green, amber, red) or a clock for a duration; for information. */
.prod-indicator { display: inline-block; margin-inline-start: 6px; vertical-align: middle; }
.prod-indicator[open] { display: block; margin: 6px 0 0; }
.prod-indicator > summary { list-style: none; cursor: pointer; display: inline-block; font-size: .95rem; line-height: 1; }
.prod-indicator > summary::-webkit-details-marker { display: none; }
.prod-indicator small { display: block; margin-top: 4px; white-space: normal; }
.prod-green { color: #1f9d55; } .prod-amber { color: #d9920a; } .prod-red { color: #c62828; } .prod-clock { color: var(--muted); }
.prod-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 10px 0; }
.prod-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: .8rem; }
.prod-list li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.enrich-list { max-height: 260px; overflow: auto; display: grid; gap: 4px; margin: 6px 0 12px; }
.enrich-list .inline-check { white-space: normal; }
#productivityCard .prod-settings { margin-bottom: 12px; }
.auto-sets { display: grid; gap: 2px; justify-items: start; }
.batch-progress { font-weight: 700; color: var(--navy-900); }
.batch-select-note { padding: 8px 12px; border-radius: 6px; background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.reconcile-note { margin: 0 0 14px; padding: 12px 16px; border-radius: 8px; background: #eef4fb; border: 1px solid var(--line-dark); font-size: 13px; }
.reconcile-note[data-state="failed"] { background: var(--red-bg); border-color: rgba(200, 80, 80, .35); }
.reconcile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reconcile-actions { display: flex; gap: 6px; flex-shrink: 0; }
.reconcile-note ul { margin: 8px 0 0; padding-inline-start: 18px; max-height: 220px; overflow: auto; }
.reconcile-note p { margin: 6px 0 0; }
.reconcile-reopened { margin-top: 8px; }
.reconcile-head strong:empty { display: none; }
.review-banner-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-banner-head strong { display: block; font-size: 14px; }
.review-banner-head small { display: block; margin-top: 4px; font-weight: 600; }
.review-banner .review-bulk { margin: 0; }
.review-kinds { width: auto; flex-wrap: wrap; gap: 2px; margin: 0 0 10px; }
.review-banner .review-kinds { margin: 0; }
.inline-review summary { cursor: pointer; list-style: revert; white-space: normal; }
.inline-review summary:focus-visible { outline: 2px solid var(--navy-800); outline-offset: 2px; }
.inline-review-issue { display: grid; gap: 4px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); min-width: 180px; }
.inline-review.answered .inline-review-issue:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.inline-review-issue .status { justify-self: start; }
/* A large project: Price Build-up reads the server's pages (scale design, stage 5 b). */
.pricing-table tr.row-updating td { opacity: .62; }
.pricing-table tr.row-updating td:last-child, .pricing-table tr.row-updating td.select-cell { opacity: 1; }
.row-updating-tag { margin-inline-end: 6px; }
#pricingTotals[data-updating] .stat b { opacity: .5; }
.large-project-note { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line-dark); border-inline-start: 4px solid var(--amber); border-radius: 6px; background: #fffaf0; color: var(--navy-900); font-size: .82rem; }
.large-project-note[hidden] { display: none; }
.commercial-updating { opacity: .5; }
/* Two people on one project (scale design, stage 9; web/live-project.js) */
.live-here{display:inline-flex;align-items:center;gap:6px;flex:none;max-width:min(72ch,38vw);overflow:hidden;white-space:nowrap;padding:5px 10px;border:1px solid var(--line-dark);border-radius:999px;background:#f2f8ff;color:#1d4f91;font-size:.72rem;font-weight:800}
.live-here::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:#2e9d5b}
.live-here[hidden],.live-note[hidden]{display:none}
.live-note{max-width:min(60ch,38vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:5px 10px;border-radius:999px;background:#eefaf1;color:#1c6b3c;font-size:.72rem;font-weight:800}
.live-note.held{background:#fffaf0;color:var(--amber);border:1px solid var(--line-dark)}
.live-tag{margin-inline-start:6px;white-space:nowrap}
tr.live-changed td{animation:live-changed 8s ease-out 1}
@keyframes live-changed{0%,60%{background-color:#fff6c9}100%{background-color:transparent}}
@media(prefers-reduced-motion:reduce){tr.live-changed td{animation:none;background-color:#fffbe3}}
.unsaved-kept{outline:2px solid var(--amber);outline-offset:1px;background:#fffaf0}
.kept-note{grid-column:1/-1;white-space:normal}
.live-line-note{display:block;margin-top:4px;padding:4px 8px;border-inline-start:3px solid var(--amber);background:#fffaf0;color:#6b4a00;font-size:.74rem;font-weight:700;white-space:normal;max-width:44ch}

/* QA visual check 2026-10-15 (M06, M16): nothing outside the window at 1280-1920 in either language.
   The heading keeps its title readable and its buttons wrap below it; the top bar shortens a long project name;
   dialogs never exceed the window; tables scroll inside their card. */
.page-heading{flex-wrap:wrap}
.page-heading>div:first-child{flex:1 1 360px;min-width:0}
.page-heading>.heading-actions,.page-heading>.revision-controls{flex:0 1 auto;min-width:0;max-width:100%;flex-wrap:wrap;justify-content:flex-end;row-gap:8px}
.heading-actions{flex-wrap:wrap;row-gap:8px}
.heading-actions .mapping-context{white-space:nowrap}
.inline-field>span{white-space:nowrap}
.library-toolbar{flex-wrap:wrap}
.topbar>div:first-child{flex:1 1 auto;min-width:0;overflow:hidden;white-space:nowrap}
.topbar>div:first-child small{overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.topbar>div:first-child strong{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;margin-top:2px}
.topbar>div:first-child #topProjectStage,.topbar>div:first-child #changeStageButton{vertical-align:bottom}
.top-actions{flex:0 0 auto;min-width:0}
.project-chip select{text-overflow:ellipsis;white-space:nowrap}
.project-chip select option{white-space:normal}
.dialog-backdrop{overflow:auto}
.dialog{max-width:calc(100vw - 40px);min-width:0;overflow-x:auto;overflow-wrap:anywhere}
.dialog .dialog-actions{flex-wrap:wrap}
.lock-gaps,#lockTotals{overflow-wrap:anywhere}
@media(max-width:1700px){.access-grid{grid-template-columns:minmax(0,1fr)}}
.access-grid .data-table{min-width:640px}
.access-grid #serverStats{overflow-wrap:anywhere}
.library-toolbar input[type=checkbox],.library-toolbar input[type=radio],.project-form input[type=checkbox]{flex:none;width:auto;min-width:0;height:auto;padding:0}
.library-toolbar label.check{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;white-space:nowrap}
