/* App shell: dark steel sidebar with the three modules, light working area.
   Tools use a split view: guided input panel on the left, the live engineering sheet on the right. */
body.app { font-size: 15px; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; height: 60px; display: flex; align-items: center; gap: 10px; padding-inline: 14px; background: var(--steel-900); color: var(--on-dark); border-bottom: 1px solid #000; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; min-width: 0; }
.brand .mk { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--orange), #F7A23B); display: grid; place-items: center; color: var(--on-orange); flex: none; }
.brand .mk svg { width: 20px; height: 20px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .grow { flex: 1; }
.tb-btn { background: transparent; border: 0; color: var(--on-dark); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.tb-btn:hover { background: rgba(255, 255, 255, .1); }
.who { display: inline-flex; align-items: center; gap: 9px; color: var(--on-dark); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 600; font-size: 14px; text-decoration: none; max-width: 260px; }
.who .av { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#menuBtn { display: none; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); height: calc(100vh - 60px); overflow-y: auto; background: var(--steel-800); color: var(--on-dark); padding: 14px 10px 18px; display: flex; flex-direction: column; gap: 14px; }
.side h3 { font-size: 11.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-muted); margin: 6px 10px 4px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--on-dark); text-decoration: none; font-weight: 550; font-size: 14.5px; }
.side a .ic { color: var(--on-dark-muted); }
.side a:hover { background: rgba(255, 255, 255, .07); }
.side a[aria-current="page"] { background: rgba(76, 139, 239, .22); color: #fff; }
.side a[aria-current="page"] .ic { color: #9CC3FF; }
.side a .lock { margin-left: auto; width: 14px; height: 14px; opacity: .6; }
.side .badge { margin-left: auto; background: var(--orange); color: var(--on-orange); font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.side .sub-box { margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: 13.5px; color: var(--on-dark-muted); display: flex; flex-direction: column; gap: 8px; }
.side .sub-box b { color: #fff; font-size: 14.5px; }
.scrim { display: none; }
main { min-width: 0; padding-block: 24px 80px; padding-inline: clamp(16px, 2.6vw, 34px); }
.page { display: flex; flex-direction: column; gap: 18px; max-width: 1500px; }
.crumbs { font-size: 12.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.crumbs a { color: inherit; text-decoration: none; } .crumbs a:hover { color: var(--link); }
h1 { font-size: clamp(24px, 2.8vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 2px 0 0; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 750; letter-spacing: -.01em; margin: 0; }
.lede { color: var(--muted); margin: 6px 0 0; max-width: 80ch; }
.head-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; justify-content: space-between; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--steel-900); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14.5px; max-width: min(92vw, 520px); }
.toast.bad { background: #7A1F18; }

/* dashboard */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.tile { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.tile .pic { height: 148px; background: #fff center / contain no-repeat; border-bottom: 1px solid var(--line); position: relative; }
.tile .pic .pill { position: absolute; top: 10px; left: 10px; }
.tile .txt { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 5px; }
.tile .txt b { font-size: 16.5px; line-height: 1.25; }
.tile .txt small { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.panel { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list { display: flex; flex-direction: column; }
.list a, .list .row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0; }
.list a:first-child, .list .row:first-child { border-top: 0; }
.list a:hover { background: var(--surface-2); }
.list .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list .t b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .t small { color: var(--muted); font-size: 13px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* tables (projects, admin) */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: var(--surface-2); font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.actions { white-space: nowrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button, .tabs a { border: 0; background: transparent; padding: 10px 14px; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; font-size: 14.5px; }
.tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type="search"] { min-height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); padding: 6px 12px; width: min(100%, 320px); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-weight: 650; font-size: 13.5px; color: var(--muted); min-height: 30px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 26, 36, .18); }
.seg.in button[aria-pressed="true"] { background: var(--input); color: var(--input-ink); box-shadow: inset 0 0 0 1px var(--input-edge); }
.seg.is-disabled { opacity: .55; }

/* auth */
.auth { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(1200px 500px at 10% -10%, rgba(37, 99, 201, .18), transparent), radial-gradient(900px 500px at 110% 110%, rgba(240, 124, 27, .14), transparent), var(--bg); }
.auth .card { width: min(100%, 440px); padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.auth h1 { font-size: 26px; }

/* lock / upsell */
.upsell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; max-width: 980px; }
.upsell .pic { background: #fff center / contain no-repeat; min-height: 240px; border-right: 1px solid var(--line); filter: saturate(.8); }
.upsell .body { padding: 26px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.upsell .price { font-size: 34px; font-weight: 850; letter-spacing: -.03em; }
.upsell .price small { font-size: 16px; color: var(--muted); font-weight: 600; }
.upsell ul { margin: 0; padding-left: 18px; color: var(--ink-2); }

/* ---------- workbook tools ---------- */
.tool-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.tool-tabs button[aria-selected="true"] { background: var(--steel-800); color: #fff; border-color: var(--steel-800); }
.tool-tabs button .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.toolbar { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 20; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; margin-inline: -4px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toolbar .name { font-weight: 700; min-width: 0; flex: 1 1 220px; }
.toolbar .name input { width: 100%; border: 1px solid transparent; background: transparent; font-weight: 750; font-size: 16px; padding: 6px 8px; border-radius: 8px; color: var(--ink); }
.toolbar .name input:hover, .toolbar .name input:focus { border-color: var(--line-2); background: var(--surface); outline: none; }
.dirty { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.wizard { position: sticky; top: calc(60px + 62px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 140px); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.wizard h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 750; }
.steps { display: flex; flex-direction: column; gap: 2px; }
.steps button { text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.steps button .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 11.5px; font-weight: 800; flex: none; }
.steps button[aria-current="step"] { background: var(--blue-soft); color: var(--link); }
.steps button[aria-current="step"] .n { background: var(--blue); color: #fff; }
.wz-fields { display: flex; flex-direction: column; gap: 12px; }
.wz-field { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.wz-field:last-child { border-bottom: 0; }
.wz-field label { font-weight: 650; font-size: 13.5px; color: var(--ink); }
.wz-field .ctl { display: flex; gap: 6px; align-items: center; }
.wz-field .ctl > * { min-width: 0; }
.wz-field input, .wz-field select { flex: 1; min-height: 38px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--input-edge); background: var(--input); color: var(--input-ink); font-weight: 600; }
.wz-field select.unit, .wz-field input.unit { flex: 0 0 96px; }
.wz-field .u { color: var(--muted); font-size: 13px; font-weight: 600; flex: none; }
.wz-field small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.wz-field.need input, .wz-field.need select { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 30%, transparent); }
.wz-nav { display: flex; justify-content: space-between; gap: 8px; }
.canvas { min-width: 0; padding: 14px; overflow: hidden; }
.canvas-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.canvas-scroll { overflow: auto; max-width: 100%; }
.xlwrap { position: relative; transform-origin: 0 0; background: #fff; color: #000; }
table.xl { table-layout: fixed; border-collapse: collapse; font-family: Calibri, Carlito, 'Figtree', Arial, sans-serif; font-size: 13.5px; line-height: 1.2; color: #000; }
table.xl td { padding: 1px 3px; overflow: hidden; white-space: nowrap; vertical-align: bottom; border: 0; }
table.xl td.w { white-space: normal; overflow-wrap: anywhere; }
table.xl td.ov { overflow: visible; }
table.xl td.in { background: #FFF2A8; box-shadow: inset 0 0 0 1px #D8B12E; padding: 0; }
table.xl td.in > input, table.xl td.in > select { width: 100%; height: 100%; min-height: 18px; border: 0; background: transparent; font: inherit; color: #000; padding: 1px 3px; text-align: inherit; }
table.xl td.in > select { padding: 0 1px; }
table.xl td.in:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
/* pick-from-list-or-type fields (Site lists on the forklift plan) */
.combo { position: relative; display: flex; flex: 1; min-width: 0; }
.wz-field .combo input { flex: 1; min-width: 0; padding-right: 38px; }
.combo-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 32px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--input-ink, #1F2933); cursor: pointer; padding: 0; }
.combo-btn:hover { background: rgba(0, 0, 0, .06); }
.combo-btn .ic { width: 16px; height: 16px; transform: rotate(90deg); }
table.xl td.in > .combo.in-cell { width: 100%; height: 100%; }
table.xl td.in > .combo.in-cell input { width: 100%; height: 100%; min-height: 18px; border: 0; background: transparent; font: inherit; color: #000; padding: 1px 16px 1px 3px; text-align: inherit; }
table.xl td.in > .combo.in-cell .combo-btn { right: 0; width: 15px; height: 100%; border-radius: 0; color: #444; }
table.xl td.in > .combo.in-cell .combo-btn .ic { width: 11px; height: 11px; }
.combo-pop { position: fixed; z-index: 1000; margin: 0; padding: 4px; list-style: none; overflow: auto; background: var(--surface, #fff); color: var(--ink, #111); border: 1px solid var(--line-2, #C9D2DA); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); font-size: 14.5px; max-width: min(420px, calc(100vw - 16px)); }
.combo-pop li { padding: 8px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-pop li:hover, .combo-pop li.on { background: var(--surface-2, #EEF2F6); }
.combo-pop li[aria-selected="true"] { font-weight: 700; }
.combo-pop .combo-empty { cursor: default; color: var(--muted, #667); white-space: normal; font-size: 13.5px; }
.combo-pop .combo-empty:hover { background: none; }
table.xl td.link { color: #1F58B8; text-decoration: underline; cursor: pointer; }
.xlwrap img.xi { position: absolute; pointer-events: none; }
.xlwrap .xc { position: absolute; background: #fff; border: 1px solid #ccd; }
.zoom-ctl { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.gate-note { padding: 14px 16px; border-radius: 12px; background: var(--orange-soft); color: var(--ink); font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start; }

/* plan details (planning tools) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cat { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 4px; }
.cat b { font-size: 15px; }
.cat small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.cat[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 35%, transparent); background: var(--orange-soft); }
.risk td input, .risk td select { width: 100%; min-height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; background: var(--surface); }
.rr { display: inline-grid; place-items: center; min-width: 42px; padding: 3px 8px; border-radius: 8px; font-weight: 800; font-family: var(--mono); }
.rr.lo { background: var(--good-bg); color: var(--good); } .rr.md { background: var(--warn-bg); color: var(--warn); } .rr.hi { background: var(--bad-bg); color: var(--bad); }

/* status chips for projects */
.st-draft { } .st-submitted { background: var(--blue-soft); color: var(--link); } .st-approved { background: var(--good-bg); color: var(--good); } .st-returned { background: var(--bad-bg); color: var(--bad); }

/* sling calculators (kept from the dedicated calculator) */
.summary { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px) + 8px); z-index: 10; display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.verdict { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 10px 18px; min-width: 190px; flex: 1 1 230px; background: var(--surface-2); color: var(--muted); }
.verdict b { font-size: 21px; font-weight: 850; letter-spacing: .03em; line-height: 1.1; }
.verdict span { font-size: 13px; font-weight: 600; }
.verdict[data-state="good"] { background: var(--good-bg); color: var(--good); }
.verdict[data-state="bad"] { background: var(--bad-bg); color: var(--bad); }
.metrics { display: flex; flex-wrap: wrap; flex: 3 1 420px; }
.metric { flex: 1 1 130px; padding: 9px 16px; border-left: 1px solid var(--line); min-width: 0; }
.metric dt { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric dd { margin: 1px 0 0; font-size: 19px; font-weight: 750; font-family: var(--mono); letter-spacing: -.02em; }
.metrics dl { display: contents; }
.jump { display: flex; gap: 6px; flex-wrap: wrap; }
.jump a { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted); padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.sec > h2 { padding: 14px 18px 0; font-size: 16px; }
.sec-body { display: flex; flex-wrap: wrap; gap: 18px 26px; padding: 14px 18px 18px; align-items: flex-start; }
.sec-main { flex: 1 1 380px; min-width: 0; }
.is-inputs > .sec-main { max-width: 540px; }
.sec-figs { flex: 1.5 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.is-inputs > .sec-figs { flex: 2 1 440px; }
.sec-figs.left { order: -1; }
.sec-below { flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fig { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.fig img { display: block; width: 100%; height: auto; }
.fig-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.fig.inset { align-self: flex-start; border: 2px solid #17365D; border-radius: 22px; padding: 0 0 4px; overflow: hidden; }
.fig figcaption { font-size: 12.5px; font-weight: 600; color: #586779; padding: 4px 2px 2px; text-align: center; }
.fig.zoom { position: fixed; inset: 0; z-index: 80; border-radius: 0; border: 0; overflow: auto; padding: 14px; max-width: none !important; }
.fig.zoom .fig-btn { cursor: zoom-out; min-width: min(1400px, 220vw); }
.in-rows { display: flex; flex-direction: column; }
.in-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.in-row:last-child { border-bottom: 0; }
.in-row > label, .in-row > .lbl { font-weight: 600; }
.in-row.is-off > label, .in-row.is-off > .lbl { color: var(--muted); }
.in-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.numf { position: relative; display: inline-flex; align-items: center; }
.numf input { width: 9.5em; padding-right: 2.6em; }
.numf .unit { position: absolute; right: 10px; font-size: 13px; font-weight: 600; color: var(--muted); pointer-events: none; }
.in-field select, .in-field input[type="text"], .toolbar select { background: var(--input); color: var(--input-ink); border: 1px solid var(--input-edge); border-radius: 9px; padding: 8px 11px; font-weight: 650; min-height: 40px; max-width: 100%; font-family: var(--mono); font-size: 14px; }
.in-field input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.val { font-weight: 700; font-family: var(--mono); }
.chip[data-state] { padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13.5px; }
[data-state="good"].chip, td[data-state="good"] { background: var(--good-bg); color: var(--good); }
[data-state="bad"].chip, td[data-state="bad"] { background: var(--bad-bg); color: var(--bad); }
.err { grid-column: 1 / -1; color: var(--bad); font-size: 13.5px; font-weight: 600; margin: 0; text-align: right; }
.ftbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.ftbl table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 14px; }
.ftbl th, .ftbl td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; overflow-wrap: break-word; }
.ftbl tbody tr:last-child > * { border-bottom: 0; }
.ftbl th.h { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 12.5px; }
.ftbl td.lb { font-weight: 600; text-align: left; }
.ftbl td.l { text-align: left; }
.ftbl tr.total > td { background: var(--surface-2); font-weight: 750; }
.ftbl tr.note > td { text-align: left; color: var(--muted); font-size: 13.5px; background: var(--surface-2); }
.ftbl tr.overall > td { font-weight: 750; font-size: 15.5px; }
.ftbl.derived { margin-top: 14px; } .ftbl.derived td { text-align: left; } .ftbl.derived td + td { text-align: right; font-weight: 700; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 6px; position: relative; }
.chart h3 { font-size: 14.5px; font-weight: 650; margin: 0 0 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; font-family: var(--mono); }
.xc .chart { border: 0; border-radius: 0; height: 100%; }

/* modal */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); padding: 22px; width: min(94vw, 520px); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(8, 14, 22, .58); }
dialog h2 { margin: 0 0 6px; font-size: 20px; }
dialog p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

/* report */
.report { background: #fff; color: #111; border-radius: 12px; border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 18px; max-width: 1100px; }
.report h1 { color: #111; }
.rep-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid #F07C1B; padding-bottom: 12px; }
.rep-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; font-size: 13.5px; }
.rep-meta div span { display: block; color: #5A6878; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.rep-sec h2 { font-size: 15px; color: #fff; background: #19232E; padding: 6px 10px; border-radius: 6px; margin-bottom: 10px; }
.rep-sec table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rep-sec th, .rep-sec td { border: 1px solid #C9D2DC; padding: 5px 8px; text-align: left; vertical-align: top; }
.rep-sec th { background: #EEF1F5; }
.sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sign div { border: 1px solid #C9D2DC; border-radius: 8px; padding: 10px; font-size: 13px; min-height: 92px; }
.sign b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #5A6878; margin-bottom: 4px; }

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .wizard { position: static; max-height: none; }
}
@media (max-width: 900px) {
  #menuBtn { display: grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; height: auto; width: min(86vw, 300px); z-index: 60; transform: translateX(-105%); transition: transform .2s ease; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .5); }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(8, 14, 22, .55); z-index: 50; }
  .two-col, .upsell { grid-template-columns: minmax(0, 1fr); }
  .upsell .pic { border-right: 0; border-bottom: 1px solid var(--line); }
  .who span { display: none; } .who { padding: 4px; }
  .in-row { grid-template-columns: minmax(0, 1fr); } .in-field { justify-content: flex-start; } .err { text-align: left; }
  .is-inputs > .sec-main { max-width: none; }
  .verdict { flex-basis: 100%; flex-direction: row; align-items: baseline; gap: 10px; padding: 8px 14px; }
  .metric { padding: 7px 14px; border-left: 0; border-top: 1px solid var(--line); flex-basis: 50%; }
  .rep-meta, .sign { grid-template-columns: minmax(0, 1fr); }
  .report { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .side, .tile { transition: none; } }

/* ---------- printing: A4, results only ---------- */
@page { size: A4; margin: 10mm; }
@media print {
  .rep-meta { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } .sign { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #F1F3F6; --ink: #000; --muted: #3C4856; --line: #BFC8D2; --line-2: #BFC8D2; --input: #FFF6BF; --input-ink: #000; --good: #14693A; --good-bg: #DCF2E3; --bad: #A8231B; --bad-bg: #FBE1DE; --shadow: none; --shadow-sm: none; color-scheme: light; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 10px; }
  .topbar, .side, .scrim, .toolbar, .wizard, .tool-tabs, .no-print, .jump, .zoom-ctl, .toast, dialog { display: none !important; }
  .shell, .split { display: block; }
  main { padding: 0; }
  .page { gap: 8px; max-width: none; }
  .card { border: 0; box-shadow: none; }
  .canvas { padding: 0; overflow: visible; }
  .canvas-scroll { overflow: visible; }
  .print-sheet { break-before: page; }
  .print-sheet:first-of-type { break-before: auto; }
  .print-sheet h3 { break-after: avoid; }
  .xlwrap { transform: none !important; zoom: var(--pz, 1); }
  table.xl tr { break-inside: avoid; }
  .report { border: 0; padding: 0; }
  .rep-sec { break-inside: avoid-page; }
  .rep-sec.rep-calc { break-inside: auto; }
  .rep-calc > h2 { break-after: avoid; }
  .summary { position: static; box-shadow: none; }
}
main.no-pad { padding: 0; }

/* ===== v4: insights, motion, phone navigation ===== */
:root { --st-draft: #8A97A6; --st-submitted: #2a78d6; --st-approved: #1baf7a; --st-returned: #eda100; --ease: cubic-bezier(.2, .7, .2, 1); }
:root[data-theme="dark"] { --st-draft: #6B7886; --st-submitted: #3987e5; --st-approved: #199e70; --st-returned: #c98500; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-draft: #6B7886; --st-submitted: #3987e5; --st-approved: #199e70; --st-returned: #c98500; } }
.insights { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.insights header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.insights .cap { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 600 10.5px var(--font); }
.chart .bar { fill: var(--series-1); transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--ease) both; animation-delay: var(--d); transition: opacity .15s; }
.chart .bar.on { opacity: .75; }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 130px; flex: none; } .donut .track { stroke: var(--surface-2); }
.donut .seg { transition: transform .2s var(--ease); transform-origin: 80px 80px; animation: fadein .6s var(--ease) both; } .donut .seg:hover { transform: scale(1.04); }
.donut .big { fill: var(--ink); font: 800 26px var(--font); } .donut .tick { fill: var(--muted); font: 600 11px var(--font); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 8px; } .legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { color: var(--ink-2); flex: 1; } .legend b { font-family: var(--mono); }
.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: 96px minmax(0, 1fr) 28px; align-items: center; gap: 8px; font-size: 13.5px; }
.hb span { color: var(--ink-2); } .hb b { font-family: var(--mono); text-align: right; }
.hb .tr { height: 10px; border-radius: 0 5px 5px 0; background: var(--surface-2); overflow: hidden; }
.hb .tr i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); transform-origin: left; animation: growx .8s var(--ease) both; animation-delay: var(--d); }
.ch-tip { position: fixed; z-index: 100; pointer-events: none; background: var(--steel-900); color: #fff; border-radius: 9px; padding: 7px 10px; font-size: 12.5px; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.ch-tip span { color: #C9D3DE; }
table.data.mini { font-size: 13px; } table.data.mini td, table.data.mini th { padding: 5px 8px; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }
main > .page { animation: pagein .35s var(--ease) both; }
.btn { transition: background-color .15s, border-color .15s, transform .12s, box-shadow .15s; }
.btn-primary:hover, .btn-accent:hover { box-shadow: 0 6px 16px -6px color-mix(in srgb, currentColor 30%, transparent); }
.card { transition: box-shadow .2s, border-color .2s; }
.verdict.flash, .summary.flash { animation: pop .45s var(--ease); }
.toast:not([hidden]) { animation: pagein .25s var(--ease) both; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 10px; min-height: 120px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* phone: bottom navigation like a native app */
.bnav { display: none; }
@media (max-width: 760px) {
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: color-mix(in srgb, var(--steel-900) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid rgba(255, 255, 255, .08); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .bnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--on-dark-muted); text-decoration: none; font-size: 11px; font-weight: 650; padding: 4px 0; border-radius: 10px; position: relative; }
  .bnav a .ic { width: 22px; height: 22px; transition: transform .2s var(--ease); }
  .bnav a[aria-current="page"] { color: #fff; }
  .bnav a[aria-current="page"] .ic { color: #FFB067; transform: translateY(-1px); }
  .bnav a[aria-current="page"]::before { content: ''; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange); }
  .bnav .badge { position: absolute; top: 0; right: 22%; background: var(--orange); color: var(--on-orange); font-size: 10px; font-weight: 800; border-radius: 999px; padding: 0 5px; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .insights { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) and (min-width: 761px) { .insights { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ins-wide { grid-column: 1 / -1; } }
.hub { display: grid; gap: 12px; }
.hub a.card { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; text-decoration: none; color: var(--ink); transition: transform .15s var(--ease), box-shadow .15s; }
.hub a.card:active { transform: scale(.985); }
.hub .th { width: 92px; height: 70px; border-radius: 10px; background: #fff center / cover no-repeat; border: 1px solid var(--line); }
.hub b { display: block; font-size: 16px; } .hub small { color: var(--muted); font-size: 13px; line-height: 1.4; display: block; }
@media print { .bnav, .ch-tip { display: none !important; } main > .page { animation: none; } }
@media (prefers-reduced-motion: reduce) { main > .page, .chart .bar, .hb .tr i, .donut .seg, .verdict.flash, .toast:not([hidden]) { animation: none !important; } }
/* connection table (padeye-to-shackle fit check) */
.grid-wrap { overflow-x: auto; margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 12px; }
.grid-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.grid-tbl thead th { background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 12px; text-align: left; padding: 9px 10px; vertical-align: bottom; border-bottom: 1px solid var(--line); }
.grid-tbl td, .grid-tbl tbody th { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: middle; text-align: left; }
.grid-tbl .g-lab { font-weight: 650; font-size: 13px; max-width: 230px; }
.grid-tbl .g-cap { display: none; }
.grid-tbl .numf input { width: 92px; }
.grid-tbl tr.g-res td { border-top: 0; padding-top: 0; }
.grid-tbl tr.g-res .chip { display: block; white-space: normal; font-family: var(--font); font-weight: 650; }
@media (max-width: 760px) {
  .grid-wrap { border: 0; overflow: visible; }
  .grid-tbl, .grid-tbl tbody { display: block; min-width: 0; }
  .grid-tbl thead { display: none; }
  .grid-tbl tr.g-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--surface); margin-top: 12px; }
  .grid-tbl tr.g-row th { grid-column: 1 / -1; max-width: none; border: 0; padding: 0; }
  .grid-tbl tr.g-row td { border: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
  .grid-tbl .g-cap { display: block; color: var(--muted); font-size: 11.5px; font-weight: 650; }
  .grid-tbl .numf input { width: 100%; }
  .grid-tbl tr.g-res { display: block; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; padding: 0 12px 12px; background: var(--surface); }
  .grid-tbl tr.g-res td { display: block; padding: 0; }
}
.sec-body.has-grid > .sec-main { max-width: none; flex-basis: 100%; }
.sec-body.has-grid .in-row { grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.6fr); }
.sec-body.has-grid .in-field { justify-content: flex-start; }
.in-field .chip.long { font-family: var(--font); font-weight: 500; color: var(--ink-2); font-size: 13.5px; white-space: normal; flex: 1 1 260px; }
.in-row > .lbl:only-child { grid-column: 1 / -1; font-weight: 500; color: var(--ink-2); font-size: 14px; }
@media (max-width: 760px) { .sec-body.has-grid .in-row { grid-template-columns: minmax(0, 1fr); } }
.in-row.note-row { grid-template-columns: minmax(0, 1fr) !important; } .in-row.note-row > .lbl { font-weight: 500; color: var(--ink-2); font-size: 14px; max-width: 110ch; }
.grid-tbl input[type="text"] { background: var(--input); color: var(--input-ink); border: 1px solid var(--input-edge); border-radius: 9px; padding: 7px 10px; font-weight: 650; min-height: 38px; font-family: var(--mono); }
@media (max-width: 760px) { table.data.proj th:nth-child(3), table.data.proj td:nth-child(3), table.data.proj th:nth-child(2), table.data.proj td:nth-child(2) { display: none; } table.data.proj td { white-space: nowrap; } table.data.proj td:first-child { white-space: normal; } }
[data-state="warn"].chip, td[data-state="warn"] { background: var(--warn-bg); color: var(--warn); }
[data-state="info"].chip, td[data-state="info"] { background: var(--blue-soft); color: var(--link); }
@media (max-width: 760px) { .toolbar { position: static; } }
.grid-tbl tr.g-res .chip[data-state] { border-radius: 10px; padding: 6px 10px; }
/* report: sling fit-check grids */
.rep-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.rep-grid th, .rep-grid td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.rep-grid thead th { background: var(--surface-2); }
.rep-grid .st-good { background: var(--good-bg); color: var(--good); }
.rep-grid .st-bad { background: var(--bad-bg); color: var(--bad); }
.rep-grid .st-warn { background: var(--warn-bg, #FFF4D6); color: var(--warn, #7A5200); }
.rep-grid .st-muted { color: var(--muted); }
@media print { .rep-grid { font-size: 9px; } .rep-grid tr { break-inside: avoid; } }
.wz-sub { margin: 14px 0 2px; padding-top: 10px; border-top: 2px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--ink); }
.wz-fields .wz-sub:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* administrator two-step sign-in */
.mfa-steps { margin: 4px 0 6px; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.mfa-qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line-2, #C9D2DA); width: max-content; margin: 4px auto; }
.mfa-qr img { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.mfa-key { font-size: 17px; letter-spacing: .06em; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, #EEF2F6); word-break: break-all; text-align: center; margin: 0; user-select: all; }
.mfa-code { font-size: 22px !important; letter-spacing: .25em; text-align: center; }
.mfa-backup { list-style: none; padding: 14px; margin: 4px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; background: var(--surface-2, #EEF2F6); border-radius: 12px; font-size: 17px; text-align: center; }
@media print { .mfa-backup { background: none; border: 1px solid #000; } }

/* ===== v10 "Hi-vis safety" theme: near-black shell, hi-vis yellow for the current place and actions ===== */
.topbar { background: #161616; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--hazard); pointer-events: none; }
.brand { color: var(--hivis); }
.brand .mk { background: var(--hivis); color: #161200; border-radius: 8px; }
.side { background: #1C1C1C; }
.side a[aria-current="page"] { background: rgba(255, 196, 0, .14); color: #fff; box-shadow: inset 3px 0 0 var(--hivis); }
.side a[aria-current="page"] .ic { color: var(--hivis); }
.side .badge, .bnav .badge { background: var(--hivis); color: #161200; }
.who .av { background: var(--hivis); color: #161200; }
.steps button[aria-current="step"] .n { color: var(--on-blue); }
.steps button[aria-current="step"] { color: var(--ink); }
.tabs [aria-selected="true"] { border-bottom-color: var(--hivis); }
.tool-tabs button[aria-selected="true"] { background: #161616; border-color: #161616; color: var(--hivis); }
.tool-tabs button .dot { background: var(--hivis); }
.auth { background: radial-gradient(1200px 500px at 10% -10%, rgba(255, 196, 0, .07), transparent), var(--bg); }
.rep-head { border-bottom-color: #FFC400; }
@media (max-width: 760px) { .bnav { background: rgba(22, 22, 22, .96); } .bnav a[aria-current="page"] .ic { color: var(--hivis); } .bnav a[aria-current="page"]::before { background: var(--hivis); } }
:root[data-theme="dark"] .tool-tabs button[aria-selected="true"] { background: var(--hivis); border-color: var(--hivis); color: #161200; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool-tabs button[aria-selected="true"] { background: var(--hivis); border-color: var(--hivis); color: #161200; } }
/* free trial offer, terms and decision (Update 37) */
.trial-box { border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 18px; margin: 14px 0; background: var(--surface-2); }
.trial-box h3 { margin: 0 0 6px; font-size: 18px; }
.trial-box .terms { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; font-size: 14.5px; }
.trial-box .terms dt { font-weight: 700; }
.trial-box .terms dd { margin: 0; }
@media (max-width: 560px) { .trial-box .terms { grid-template-columns: 1fr; } .trial-box .terms dd { margin-bottom: 6px; } }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; margin: 10px 0; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.adm-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 10px; }
.adm-filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.adm-filters input, .adm-filters select { font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.adm-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.adm-counts button { border: 0; cursor: pointer; }
.adm-counts button[aria-pressed="true"] { outline: 2px solid var(--ink); }
table.data th.sortable { cursor: pointer; user-select: none; }
.hist h3 { font-size: 15px; margin: 14px 0 6px; }
.hist table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hist td, .hist th { text-align: left; padding: 5px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.trial-box .btn { white-space: normal; max-width: 100%; text-align: center; }

/* Update 43: one logo everywhere: yellow mark, white wordmark on the dark app bar (dark wordmark on the light website) */
.brand { color: #fff; }

/* Update 50: readable text on yellow buttons (WCAG AA) */
.btn-accent, .btn-accent:hover { color: #161616 !important; }

/* ---------- Update 53: phones and tablets ---------- */
/* iPhone zooms the page when a field under 16px is tapped; keep fields at 16px on touch screens so the page stays at its proper size */
@media (pointer: coarse) { input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; } }
