:root {
  --navy: #1f3864; --ink: #14171a; --muted: #5d6570; --line: #dde3ea; --bg: #f5f7f9;
  --chws: #1e88e5; --chwr: #e53935; --icw: #43a047; --cd: #fb8c00; --chw: #8e24aa; --unknown: #757575; --fh: #6d4c41; --sa: #00897b; --ra: #7b1fa2; --ea: #827717;
  --done: #2e7d32; --sel: #ffd600;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 15px; overscroll-behavior: none; }
body { display: flex; flex-direction: column; height: 100dvh; }
header#topbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--sat)) 10px 8px;
  background: var(--navy); color: #fff; }
#title { flex: 1; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v111: the company name centred in the header's free space once the title is a block, a print or a report */
#brand { flex: 1; min-width: 0; text-align: center; font-weight: 500; letter-spacing: .02em; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
#topbar.branded #title { flex: 0 1 auto; }
@media (max-width: 640px) { #brand { display: none; } #topbar.branded #title { flex: 1; } }
#btn-home { font-size: 24px; }
button.icon { width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: inherit;
  font-size: 22px; line-height: 1; cursor: pointer; }
.badge { background: #fb8c00; color: #fff; border-radius: 12px; padding: 2px 9px; font-size: 13px; font-weight: 600; }
.view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#view-sheets { overflow-y: auto; padding: 12px; gap: 10px; }
/* v115: logo at the foot of the home screens (margin-top auto parks it in the white space when the content is short) and a
   navy footer matching the top bar; the footer is hidden by app.js show() outside the home / kinds / prints screens */
#foot-brand { margin-top: auto; padding: 28px 0 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#foot-brand .co { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--navy); }   /* v135: company name directly under the logo (Alex); the footer bar keeps project and version */
#foot-brand img { width: 200px; height: auto; max-width: 60vw; mix-blend-mode: multiply; }   /* v124: the company logo back in the footer; FieldPins mark only on the business case */
footer#bottombar { flex: 0 0 auto; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px calc(8px + var(--sab)); background: var(--navy); color: #c7d0dc; font-size: 12.5px; letter-spacing: .02em; }
footer#bottombar .sep { opacity: .5; } footer#bottombar[hidden] { display: none; }
.blocks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.block-btn { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 150px; padding: 18px 20px; border: 0; border-radius: 16px;
  background: var(--navy); color: #fff; text-align: left; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.block-btn:active { transform: scale(.99); }
.block-btn .big { font-size: 32px; font-weight: 700; letter-spacing: .02em; }
.block-btn .sub { font-size: 15px; opacity: .85; }
.block-btn .bar { background: rgba(255,255,255,.25); height: 10px; }
.block-btn .bar > i { background: #7ee787; }
#uploads { margin-top: 18px; }
#uploads summary { cursor: pointer; font-weight: 600; color: var(--muted); }
#uploads .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.card.upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.sheet-card { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.sheet-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #e7ecf2; }
.sheet-card .name { font-weight: 600; margin-top: 6px; }
.bar { height: 8px; background: #e7ecf2; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--done); }
.muted { color: var(--muted); font-size: 13px; }
.err { color: #b00020; margin-top: 8px; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 14px;
  font-size: 15px; min-height: 44px; cursor: pointer; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.danger { color: #b00020; border-color: #e5a0a8; }
.btn:disabled { opacity: .5; }

/* viewer */
#view-viewer { position: relative; }
#stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
#side { display: contents; }
#side-empty { display: none; }
#side-tab { display: none; }
#progress { flex: 0 0 auto; background: #fff; border-bottom: 1px solid var(--line); padding: 6px 10px; }
#progress-total { font-weight: 600; font-size: 14px; flex: 1; }
.row-tight { display: flex; align-items: center; gap: 8px; }
#find { width: 46%; max-width: 220px; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
#modal-body tr.go { cursor: pointer; }
#chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 4px; scrollbar-width: none; }
.chip { flex: 0 0 auto; border-radius: 14px; padding: 4px 10px; font-size: 13px; border: 2px solid transparent;
  background: #eef1f4; cursor: pointer; white-space: nowrap; }
.chip.on { border-color: var(--ink); }
.chip i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
#osd { flex: 1 1 auto; min-height: 0; min-width: 0; background: #2b2f33; touch-action: none; }
#zoom-ctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
#zoom-ctl .icon { background: rgba(31,56,100,.9); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
#zoom-ctl .icon.on { background: var(--sel); color: var(--ink); }
#zoom-ctl .icon.clean { background: #fff; color: var(--ink); }
#zoom-ctl .icon.pdf { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
#zoom-ctl .icon.tq { font-size: 12px; font-weight: 700; letter-spacing: .02em; background: #f57c00; }   /* v174: flange / coupling reports on (orange, like the pins) */
#zoom-ctl .icon.tq.off { background: rgba(31,56,100,.9); text-decoration: line-through; opacity: .85; }   /* off: the pins are hidden */
#zoom-ctl .icon.area { font-size: 18px; }
/* area mark (2026-10-23): the drag box and the hotspots it caught */
svg.hot rect.marquee { fill: var(--sel); fill-opacity: .15; stroke: var(--navy); stroke-width: 2px; stroke-dasharray: 8 5; vector-effect: non-scaling-stroke; pointer-events: none; }
svg.hot rect.sp.area { stroke: var(--sel); stroke-width: 4px; fill-opacity: .5; }
#area-panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--sab)); box-shadow: 0 -4px 12px rgba(0,0,0,.15); display: flex; flex-direction: column; gap: 8px; }
#area-panel .head { display: flex; justify-content: space-between; align-items: center; }
#area-panel .big { font-size: 15px; }
#area-panel .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#actionbar { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + var(--sab)); box-shadow: 0 -4px 12px rgba(0,0,0,.15); }
#actionbar .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
#sel-meta { margin-left: 8px; }
#drawer { position: absolute; left: 0; right: 0; bottom: 0; height: 70%; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 12px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.drawer-head b { flex: 1; }
.drawer-head .icon { background: #eef1f4; color: var(--ink); }
.drawer-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; background: #e7ecf2; touch-action: pan-x pan-y pinch-zoom; }
.shop-wrap { position: relative; display: inline-block; width: 200%; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.shop-wrap img { display: block; width: 100%; max-width: none; }

/* hotspot overlay */
svg.hot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
svg.hot rect.sp { fill-opacity: .18; stroke-width: 2px; vector-effect: non-scaling-stroke; }
svg.hot rect.sys-CHWS { fill: var(--chws); stroke: var(--chws); }
svg.hot rect.sys-CHWR { fill: var(--chwr); stroke: var(--chwr); }
svg.hot rect.sys-ICW { fill: var(--icw); stroke: var(--icw); }
svg.hot rect.sys-CD { fill: var(--cd); stroke: var(--cd); }
svg.hot rect.sys-CHW { fill: var(--chw); stroke: var(--chw); }
svg.hot rect.sys-UNKNOWN { fill: var(--unknown); stroke: var(--unknown); }
svg.hot rect.sys-FH { fill: var(--fh); stroke: var(--fh); }
svg.hot rect.sys-SA { fill: var(--sa); stroke: var(--sa); } svg.hot rect.sys-RA { fill: var(--ra); stroke: var(--ra); } svg.hot rect.sys-EA { fill: var(--ea); stroke: var(--ea); }
.block-btn.kind-btn[disabled] { opacity: .45; cursor: default; }
.block-btn.kind-btn.empty .sub { opacity: .7; font-style: italic; }   /* 2026-10-24: a folder with no prints yet still opens, same colour as the others */
.block-btn.kind-btn.hangers { background: var(--fh); }
/* equipment block tiles match the home-screen block tiles (navy), per Alex 2026-10-22 */
.btn.equipment { background: #37474f; border-color: #37474f; }
svg.hot rect.installed { fill: var(--done); stroke: var(--done); fill-opacity: .55; }
svg.hot rect.received { fill: #e53935; stroke: #e53935; fill-opacity: .55; }                     /* equipment: site received */
svg.hot rect.received.installed { fill: var(--sel); stroke: #e53935; fill-opacity: .6; stroke-width: 3px; }   /* received + installed: yellow, red outline */
svg.hot.ov-outline rect.received { fill-opacity: .35; stroke-width: 2px; stroke-opacity: 1; }
#btn-received.on { background: #e53935; border-color: #e53935; color: #fff; }
#btn-received.on.both { background: var(--sel); border-color: #e53935; color: var(--ink); }
svg.hot rect.low { stroke-dasharray: 6 4; }
/* focus mode tags: drawn by the app in place of the stripped printed labels; scale with the drawing like print */
svg.hot text.lbl { font-family: -apple-system, Helvetica, Arial, sans-serif; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 2px; }
svg.hot text.lbl.sys-CHWS { fill: var(--chws); } svg.hot text.lbl.sys-CHWR { fill: var(--chwr); } svg.hot text.lbl.sys-ICW { fill: var(--icw); }
svg.hot text.lbl.sys-CD { fill: var(--cd); } svg.hot text.lbl.sys-CHW { fill: var(--chw); } svg.hot text.lbl.sys-FH { fill: var(--fh); } svg.hot text.lbl.sys-SA { fill: var(--sa); } svg.hot text.lbl.sys-RA { fill: var(--ra); } svg.hot text.lbl.sys-EA { fill: var(--ea); } svg.hot text.lbl.sys-UNKNOWN { fill: var(--unknown); }
.chip.all { background: var(--ink); color: #fff; }
.chip.all.on { border-color: var(--sel); }
svg.hot rect.hidden { display: none; }
svg.hot rect.selected { stroke: var(--sel); stroke-width: 4px; }
svg.hot rect.pending { stroke-dasharray: 2 2; }
/* Names-off modes: 'outline' keeps a thin box per spool (installed ones solid), 'hidden' shows only the selected spool. */
svg.hot.ov-outline rect.sp { fill-opacity: 0; stroke-width: 1.5px; stroke-opacity: .8; }
svg.hot.ov-outline rect.installed { fill-opacity: .35; stroke-width: 2px; stroke-opacity: 1; }
svg.hot.ov-outline rect.selected { stroke-width: 4px; stroke-opacity: 1; }
svg.hot.ov-hidden rect.sp:not(.selected) { display: none; }
svg.hot.ov-hidden g.wb { display: none; }
svg.hot.ov-hidden rect.selected { fill-opacity: .18; }

/* bottom sheets */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + var(--sab));
  box-shadow: 0 -4px 16px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 8px; max-height: 80%; overflow: auto; z-index: 20; }
/* 2026-10-23 (Alex): a tap anywhere outside the open menu closes it. The backdrop sits under the menu and swallows the tap. */
#menu-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(20,23,26,.12); }
#menu-backdrop[hidden] { display: none; }
#modal-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
#modal-body td, #modal-body th { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--sab)); transform: translateX(-50%); background: rgba(20,23,26,.92); color: #fff;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; z-index: 30; max-width: 90vw; }

body.login { align-items: center; justify-content: center; }
body.login .card { width: min(92vw, 360px); display: flex; flex-direction: column; gap: 10px; }
body.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
body.login input { font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
body.login h1 { margin: 0 0 6px; color: var(--navy); font-size: 22px; }
body.login select { font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
body.login .auth { width: min(92vw, 380px); display: flex; flex-direction: column; gap: 14px; }
body.login .auth .card { width: auto; }
body.login .brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
body.login .brand img { width: 44px; height: 44px; border-radius: 10px; }
body.login .brand b { display: block; font-size: 20px; }
body.login .brand span { display: block; font-size: 13px; color: var(--muted); }
body.login .alt { font-size: 14px; color: var(--muted); margin-top: 4px; }
body.login .alt a { color: var(--navy); }
body.login p { margin: 0; }
/* admin: users / invites / requests */
.admin { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }   /* v149: a wide table scrolls sideways inside the pop-up (Users, daily reports, constraints on a phone) */
#modal-body { min-width: 0; max-width: 100%; }   /* v155: no min-height: 0 — it shrank the body so the Close button sat at the first screen's foot and scrolled away (bugs 18, 19) */
#modal-close { position: sticky; bottom: 0; z-index: 3; flex: 0 0 auto; align-self: stretch; box-shadow: 0 -8px 10px -6px rgba(0,0,0,.18), 0 0 0 6px #fff; }   /* v155: always at the bottom of the pop-up */
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin td.row, .admin td .row { white-space: nowrap; }
.admin td .btn { white-space: nowrap; }
.admin th, .admin td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin select, .admin input { font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.admin .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.admin .btn.small { padding: 6px 10px; font-size: 13px; }
.admin h3 { margin: 18px 0 6px; font-size: 15px; color: var(--navy); }
.admin .tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #eef1f4; color: var(--muted); }
.admin .tag.pending { background: #fff3cd; color: #7a5a00; }
.admin .tag.accepted, .admin .tag.approved { background: #e3f3e5; color: var(--done); }
.admin .tag.off { background: #fde7e9; color: #b00020; }
.admin .link { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; background: #f5f7f9; padding: 8px; border-radius: 8px; }

/* iPad landscape and desktop: the viewer keeps the full height, the selected spool and its shop sheet live
   in a side panel instead of covering the drawing. 900px splits iPad portrait (820) from landscape (1180). */
@media (min-width: 900px) {
  /* Panel width lives in --side: the tab is tapped to hide/show and dragged to resize, up to the full width (only the shop sheet shows). */
  #stage { --side: min(42%, 520px); }
  #side { display: flex; flex: 0 0 var(--side); flex-direction: column; border-left: 1px solid var(--line); background: #fff; overflow: hidden; transition: flex-basis .25s ease; }
  #zoom-ctl { right: calc(var(--side) + 10px); transition: right .25s ease; }
  #stage.resizing #side, #stage.resizing #zoom-ctl, #stage.resizing #side-tab { transition: none; }
  /* Arrow tab on the panel edge: slides the spool panel closed so the drawing takes the full width; selecting a spool opens it again. */
  #side-tab { display: flex; position: absolute; z-index: 4; top: 70%;   /* 2026-10-23: below the seven-button column (area mark button) */ right: min(var(--side), calc(100% - 30px)); transform: translateY(-50%); width: 30px; height: 72px; cursor: ew-resize; touch-action: none;
    border: 0; border-radius: 10px 0 0 10px; background: rgba(31,56,100,.9); color: #fff; font-size: 22px; align-items: center; justify-content: center;
    box-shadow: -2px 2px 6px rgba(0,0,0,.3); transition: right .25s ease; cursor: pointer; }
  #stage.side-closed #side { flex-basis: 0; border-left: 0; }
  #stage.side-closed #zoom-ctl { right: 10px; }
  #stage.side-closed #side-tab { right: 0; }
  #actionbar, #drawer, #area-panel { position: static; box-shadow: none; border: 0; }
  #area-panel { border-bottom: 1px solid var(--line); }
  #actionbar { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
  #drawer { height: auto; flex: 1 1 auto; min-height: 0; }
  #drawer .drawer-head .icon, #btn-shop { display: none !important; }
  /* Shop drawing navigates like the sheet: wheel zooms at the cursor, drag pans, pinch on touch, double-click fits; a click only pins. */
  .drawer-body { overflow: hidden; touch-action: none; }
  .shop-wrap { width: 100%; cursor: grab; transform-origin: 0 0; will-change: transform; }
  .shop-wrap.dragging { cursor: grabbing; }
  .shop-wrap .pin { transform: translate(-50%, -100%) scale(var(--inv, 1)); transform-origin: 50% 100%; }
  .shop-wrap .pin.tq { transform: translate(-50%, -50%) scale(var(--inv, 1)); transform-origin: 50% 50%; }
  .shop-wrap .pin-form { transform: translate(0, -50%) scale(var(--inv, 1)); transform-origin: 0 50%; }
  .shop-wrap .pin-form.flip { transform: translate(-100%, -50%) scale(var(--inv, 1)); transform-origin: 100% 50%; }
  #side-empty { display: flex; flex: 1; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--muted); }
  #side-empty[hidden] { display: none !important; }
  /* --side is only set inside #stage, so var(--side) here was invalid and every pop-up sized itself to its content, some to the
     full screen with nothing left to tap outside (2026-10-27, v143). A set width now; .big pop-ups stay wider. */
  .sheet { left: auto; right: 0; width: min(600px, 100%); border-radius: 0; top: 0; max-height: none; }
  #modal.big { width: min(78%, 900px); }
  #toast { bottom: 24px; }
}

/* welds */
.btn.small { min-height: 36px; padding: 6px 10px; font-size: 14px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }   /* v114: links styled as buttons centre their text like buttons do (menu: User manual, Export welds CSV) */
#welds { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px; }
.welds-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }   /* v149: Add weld photo was clipped at iPad landscape */
.welds-head b { flex: 1; }
/* v107 (Alex): fold the weld list away so the shop drawing gets the room; the head row with its buttons stays */
.fold-btn { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; line-height: 1; padding: 0; cursor: pointer; flex: none; }
.fold-btn:hover { background: #f1f3f6; }
#welds.folded #welds-body { display: none; }
#welds.folded .fold-btn { transform: rotate(-90deg); }
.btn.place.on, .btn.place-tq.on { background: var(--sel); color: var(--ink); border-color: var(--sel); }
.weld-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.weld-row:first-child { border-top: 0; }
.weld-row .fw { font-weight: 700; min-width: 44px; }
.weld-row .meta { flex: 1; font-size: 13px; color: var(--muted); }
.weld-row .thumbs { display: flex; gap: 4px; }
.weld-row .thumbs img, .photo-new img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #e7ecf2; cursor: pointer; }
.photo-new { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed #e5a0a8; }
.photo-new .meta { flex: 1; font-size: 13px; color: #b00020; }
#modal .record { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; }   /* v149: minmax(0) so a 16 px input cannot push the column past a 390 px phone */
#modal .record label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
#modal .record input, #modal .record select, #modal .record textarea { font-size: 16px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; max-width: 100%; }
#modal .record .wide { grid-column: 1 / -1; }
#modal .record img.preview { width: 100%; max-height: 38vh; object-fit: contain; background: #e7ecf2; border-radius: 8px; grid-column: 1 / -1; }
#modal img.full { width: 100%; }
svg.hot g.wb circle { fill: #fff; stroke: var(--ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
svg.hot g.wb text { font: 700 26px -apple-system, Helvetica, Arial, sans-serif; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
@media (min-width: 900px) { #btn-welds { display: none !important; } #welds[hidden] { display: none !important; } }
@media (max-width: 899.98px) { #welds { display: none !important; } }

/* pins on the shop drawing */
.shop-wrap.pinning { cursor: crosshair; outline: 3px solid var(--sel); outline-offset: -3px; }
.pin { position: absolute; transform: translate(-50%, -100%); background: #e53935; color: #fff; font: 700 12px -apple-system, Helvetica, Arial, sans-serif;
  padding: 3px 6px; border-radius: 8px 8px 8px 0; box-shadow: 0 1px 4px rgba(0,0,0,.4); white-space: nowrap; pointer-events: none; }
.pin::after { content: ''; position: absolute; left: 0; bottom: -6px; border: 6px solid transparent; border-top-color: #e53935; border-left-color: #e53935; }
.pin.ok { background: var(--done); } .pin.ok::after { border-top-color: var(--done); border-left-color: var(--done); }
.pin.new { background: var(--sel); color: var(--ink); } .pin.new::after { border-top-color: var(--sel); border-left-color: var(--sel); }
.weld-row .bad { color: #c62828; }
.pin.open { background: #fff; color: #e53935; outline: 2px solid #e53935; outline-offset: -2px; } .pin.open::after { border-top-color: #e53935; border-left-color: #e53935; }
/* torque pins on the shop drawing (v98): same orange as the layout's V/F/C pins; tappable, unlike weld pins */
.pin.tq { background: #f57c00; pointer-events: auto; cursor: pointer; border-radius: 50%; padding: 0; width: 22px; height: 22px; line-height: 22px; text-align: center; transform: translate(-50%, -50%); }
.pin.tq::after { display: none; }
.pin.tq.open { background: #fff; color: #f57c00; outline: 2px solid #f57c00; outline-offset: -2px; }
.pin.tq.pending { outline-style: dashed; }
svg.hot g.tp.mirror circle { stroke-dasharray: 2 2; }
svg.hot g.tp.selected.anchored circle { stroke: var(--sel); }
/* tap-and-hold name box */
.pin-form { position: absolute; transform: translate(0, -50%); display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--sel);
  border-radius: 10px; padding: 6px 8px; box-shadow: 0 2px 10px rgba(0,0,0,.35); z-index: 5; margin-left: 10px; white-space: nowrap; }
.pin-form.flip { transform: translate(-100%, -50%); margin-left: -10px; }
.pin-form.chooser { gap: 4px; padding: 5px 6px; }   /* v151: weld / flange / coupling at the held spot */
.pin-form.chooser .btn { font-size: 14px; padding: 6px 10px; min-height: 36px; }
.pin-form .dot { position: absolute; left: -16px; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--sel); box-shadow: 0 0 0 3px #fff; }
.pin-form.flip .dot { left: auto; right: -16px; margin: -6px -6px 0 0; }
.pin-form input { width: 7em; font-size: 16px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; text-transform: uppercase; }
.weld-row .btn.pinned { border-color: var(--done); color: var(--done); }
/* VT state */
svg.hot g.wb.vt-pending circle { fill: #ffe082; }
svg.hot g.wb.vt-passed circle { fill: #7ee787; }
svg.hot g.wb.vt-failed circle { fill: #ef9a9a; }
/* Torque pins: screen-sized markers placed by tap-and-hold on a fab layout. Orange = report photo on file, hollow = not yet. */
svg.hot g.tp circle { fill: #f57c00; stroke: #fff; stroke-width: 2.5px; }
svg.hot g.tp.open circle { fill: #fff; stroke: #f57c00; stroke-width: 3px; }
svg.hot g.tp text { font: 700 15px -apple-system, Helvetica, Arial, sans-serif; fill: #fff; text-anchor: middle; dominant-baseline: central; }
svg.hot g.tp.open text { fill: #f57c00; }
/* v100: a submitted (locked) report */
svg.hot g.tp.submitted circle { fill: #2e7d32; stroke: #fff; }
svg.hot g.tp.submitted text { fill: #fff; }
.pin.tq.submitted { background: #2e7d32; color: #fff; outline: 0; }
.locked-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 14px; margin: 10px 0; font-size: 14px; }
.locked-sum .muted { display: block; font-size: 12px; }
.locked-note { background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 6px 10px; margin: 6px 0; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
svg.hot g.tp.selected circle { stroke: var(--sel); stroke-width: 4px; }
.torque-photos { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.torque-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: #e7ecf2; }
#osd { -webkit-touch-callout: none; }
.vt-pill { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; margin-left: 6px; }
.vt-pill.pending { background: #ffe082; } .vt-pill.passed { background: #7ee787; } .vt-pill.failed { background: #ef9a9a; }
/* review screen */
#review-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
#review-head > div { flex: 1; }
#review-body { flex: 1; min-height: 0; display: flex; }
#review-grid { flex: 1; overflow: auto; padding: 10px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); align-content: start; }
#review-grid .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e7ecf2; cursor: pointer; border: 3px solid transparent; }
#review-grid .ph.on { border-color: var(--sel); }
#review-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
#review-grid .ph .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(20,23,26,.7); color: #fff; font-size: 11px; padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#review-detail { flex: 0 0 min(50%, 620px); border-left: 1px solid var(--line); background: #fff; overflow: auto; padding: 12px; }
#review-detail .record { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
#review-detail .record label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
#review-detail .record input, #review-detail .record select { font-size: 16px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
#review-detail .record .wide { grid-column: 1 / -1; }
#review-detail img.preview { width: 100%; max-height: 45vh; object-fit: contain; background: #e7ecf2; border-radius: 8px; grid-column: 1 / -1; cursor: zoom-in; }
#review-detail img.preview.big { max-height: none; object-fit: unset; cursor: zoom-out; }
/* Weld photos (v97): day folders as icons + hover glimpse + archive upload bar */
#review-grid.folders { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; align-content: start; }
#review-grid .wide { grid-column: 1 / -1; }
.fold { position: relative; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 8px 10px; text-align: center; cursor: pointer; min-height: 124px; }
.fold:hover { border-color: var(--navy); box-shadow: 0 2px 10px rgba(0,0,0,.10); }
.fold .ico { font-size: 46px; line-height: 1; }
.fold .lbl { font-weight: 600; margin-top: 6px; font-size: 14px; }
.fold .cnt { position: absolute; top: 6px; right: 8px; background: var(--navy); color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 7px; }
.fold .sub { font-size: 11px; color: #b00020; margin-top: 2px; }
.fold.todo .cnt { background: #b00020; }
.fold.todo.empty { opacity: .6; } .fold.todo.empty .cnt { background: var(--muted); } .fold.todo.empty .sub { color: var(--muted); }
.fold .peek { position: absolute; z-index: 6; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); width: 320px; max-height: 340px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 22px rgba(0,0,0,.18); padding: 8px 10px; text-align: left; font-size: 12px; cursor: default; }
.fold .peek ul { margin: 4px 0 0; padding-left: 14px; }
.fold .peek li { font-family: ui-monospace, Menlo, monospace; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#review-grid .ph.todo { border-color: #ffe082; }
.ship-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; } .ship-head h2 { margin: 0; } .ship-head .muted { flex: 1; }
.ship .folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin-top: 10px; } .ship .folders .wide { grid-column: 1 / -1; }
.ship .review-upload { border: 1px solid #ffe082; border-radius: 10px; margin: 8px 0; }
.review-upload { padding: 8px 12px; background: #fff8e1; border-bottom: 1px solid var(--line); font-size: 13px; }
.review-upload .up-row { align-items: center; gap: 10px; margin: 6px 0; }
.review-upload .fname { font-weight: 600; }
.review-upload input[type=date] { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; margin-left: 4px; }
@media (max-width: 899.98px) { #review-body { flex-direction: column; } #review-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); } #review-body:has(#review-detail:not([hidden])) #review-grid { flex: 0 0 auto; max-height: 30%; } #review-detail { flex: 1; border-left: 0; border-top: 1px solid var(--line); } }   /* v149: folders and To catalog fill the screen; the 30 % strip only once a photo is open under it */

/* offline (2026-10-20) */
.badge.off { background: #b00020; color: #fff; }
/* v146: the waiting-to-send count opens the list */
button.badge { border: 0; cursor: pointer; font-family: inherit; line-height: inherit; }
.waitlist .wi { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line, #ddd); }
.waitlist .wi .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.waitlist .wi.sending .txt b::after { content: ' · sending…'; font-weight: 400; color: #1565c0; }
.waitlist .wi.failed .txt b { color: #b00020; }
.menu-note { font-size: 13px; color: var(--ink); padding: 4px 0 8px; line-height: 1.4; }
.menu-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 2px; }
.menu-h[hidden] { display: none; }
.sheet-card .keep { margin-top: 8px; width: 100%; text-align: center; }
.card.info { cursor: default; background: #f6f8fa; box-shadow: none; } .card.info .name { font-weight: 500; }   /* v149: the combined shop-sheet rows looked like cards and did nothing */
.sheet-card .keep.on { border-color: var(--done); color: var(--done); background: #f0f8f1; }
.sheet-card .keep.busy { border-color: var(--navy); color: var(--navy); }

/* outbox (2026-10-20): things saved on the device, not yet sent */
.pending-note { font-size: 13px; color: #7a5a00; background: #fff3cd; border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
svg.hot g.tp.pending circle { stroke-dasharray: 4 3; }
/* v153: QC photo pins — teal camera circles with the photo count, on the layout and on the shop drawing */
svg.hot g.qp circle { fill: #00838f; stroke: #fff; stroke-width: 2.5px; }
svg.hot g.qp text { font: 700 13px -apple-system, Helvetica, Arial, sans-serif; fill: #fff; text-anchor: middle; dominant-baseline: central; }
svg.hot g.qp.pending circle { fill: #fff; stroke: #00838f; stroke-dasharray: 4 3; }   /* v179: photos still waiting to send from this device */
svg.hot g.qp.pending text { fill: #00838f; }
.pin.qc { background: #00838f; color: #fff; pointer-events: auto; cursor: pointer; border-radius: 50%; padding: 0; width: 24px; height: 24px; line-height: 24px; text-align: center; font-size: 12px; transform: translate(-50%, -50%); }
.pin.qc::after { display: none; }
.shop-wrap .pin.qc { transform: translate(-50%, -50%) scale(var(--inv, 1)); transform-origin: 50% 50%; }
.qcpin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; } .qcpin-grid a img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #e7ecf2; } .qcpin-grid .cap { font-size: 11px; color: var(--muted); word-break: break-all; }
.torque-photos img.local { outline: 2px dashed #fb8c00; outline-offset: -2px; }

/* bolt torque report (2026-10-20): the company field form on a pin, autosaved */
#modal.big { max-height: 94%; }
.treport .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.treport .head h2 { margin: 0; }
.treport h3 { font-size: 13px; margin: 12px 0 6px; padding: 3px 8px; background: #e9eef5; border-left: 4px solid var(--navy); }
.treport .small { font-size: 12px; }
.treport .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 8px; }
.treport .grid.three { grid-template-columns: 1.4fr 0.6fr 1fr; }
.treport label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); min-width: 0; }
.treport input, .treport textarea { font-family: inherit; font-size: 16px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; width: 100%; box-sizing: border-box; background: #fff; }
.treport textarea { resize: vertical; }
.treport .joint { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 6px 0; background: #fbfcfd; }
.treport .joint .jh { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.treport .stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.treport .stages label:last-child input { border-color: #f57c00; }
.treport .methods { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; font-size: 14px; }
.treport .methods label { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.treport .methods input[type=radio] { width: 20px; height: 20px; }
.treport .methods input#tr-method-other { flex: 1 1 160px; }
.treport .signoff { display: grid; grid-template-columns: 1.1fr 1.4fr 1fr; gap: 6px; align-items: center; font-size: 13px; }
.treport .row.wrap { flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn.tiny { padding: 2px 8px; font-size: 12px; }
.savestate { font-size: 12px; color: var(--muted); }
.savestate.saved { color: var(--done); } .savestate.device { color: #fb8c00; } .savestate.error { color: #c62828; } .savestate.saving, .savestate.dirty { color: var(--muted); }
@media (max-width: 899.98px) { .treport .stages { grid-template-columns: repeat(2, 1fr); } .treport .grid.three { grid-template-columns: 1fr 1fr; } }

/* contractor constraint report (2026-10-21): home-screen button, form, signature pad */
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.home-actions .btn { flex: 1 1 240px; min-height: 58px; font-size: 17px; font-weight: 600; border-radius: 14px; }
.home-actions .btn.primary { background: #c75000; border-color: #c75000; }
.constraint > label { margin-top: 8px; }
.constraint .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.constraint canvas { width: 100%; height: 170px; display: block; border: 1.5px dashed var(--navy); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; box-sizing: border-box; }
.constraint .err { margin: 0; }
.constraint #c-save { min-height: 48px; font-size: 16px; }

/* planned blocks (2026-10-21): tile shown before any drawings exist */
.block-btn.planned { background: #8a94a6; cursor: pointer; }
.block-btn.planned .sub { opacity: .95; }
.soon { text-align: center; padding: 18px 8px 8px; }
.soon .icon { font-size: 48px; }
.soon h2 { margin: 8px 0 6px; }
.soon p { color: var(--muted); max-width: 420px; margin: 0 auto; }

/* QC requests (2026-10-21): request button, home-screen inbox, list */
.home-actions .btn.primary.qc { background: var(--done, #2e7d32); border-color: var(--done, #2e7d32); }
.qc-inbox { margin-bottom: 16px; border-left: 5px solid var(--done, #2e7d32); }
.qc-inbox h2 { margin: 0 0 8px; font-size: 16px; }
.qc-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #fbfcfd; }
.qc-card .qc-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.qc-card .qc-ready { font-size: 16px; margin: 4px 0; white-space: pre-wrap; }
.qc-card .row.wrap { margin-top: 8px; }
.qc-list h3 { font-size: 13px; margin: 14px 0 6px; padding: 3px 8px; background: #e9eef5; border-left: 4px solid var(--navy); }

/* bug reports (2026-10-21) */
.home-actions .btn.bug { flex: 0 1 200px; min-height: 48px; font-size: 15px; font-weight: 500; color: var(--muted); }

/* design drawing sets: Mechanical prints (2026-10-21) */
.home-actions .btn.primary.design { background: var(--navy); border-color: var(--navy); }
.home-actions .btn.primary.fdr { background: #00695c; border-color: #00695c; }   /* foreman daily report (2026-10-23) */
.fdr-list h3 { margin: 14px 0 6px; font-size: 14px; color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.fdr-list td.acts { white-space: nowrap; }
.fdr-list .issues { color: #b00020; font-weight: 600; }
.fdr-list .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.fdr-list .filters select, .fdr-list .filters input { font: inherit; font-size: 15px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.fdr-done { text-align: center; padding: 10px 0; } .fdr-done .big { font-size: 40px; } .fdr-done h2 { margin: 6px 0; }
#view-design { overflow-y: auto; padding: 12px; }
#view-design h2 { margin: 14px 0 6px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#view-design h3 { margin: 10px 0 4px; font-size: 13px; color: var(--navy); }
.dhead { position: sticky; top: -12px; background: var(--bg, #f4f6f8); padding: 4px 0 6px; z-index: 2; }
#d-find { width: 100%; box-sizing: border-box; font-size: 17px; padding: 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.dseries .block-btn { min-height: 96px; }
.dseries .block-btn .big { font-size: 22px; }
.drow { display: grid; grid-template-columns: 128px 1fr 28px; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px; margin: 6px 0; cursor: pointer; min-height: 52px; }
.drow:active { background: #eef2f7; }
.drow.off { opacity: .55; cursor: default; }
.drow .dno { font-weight: 700; font-size: 15px; color: var(--navy); word-break: break-all; }
.drow .dtitle { font-size: 15px; }
.drow .dmeta { color: var(--muted); font-size: 22px; text-align: right; }
.drow.off .dmeta { font-size: 12px; }
#view-dsheet { position: relative; }
#dsheet-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); padding: 6px 10px; }
#dsheet-title { flex: 1; font-size: 14px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stage2 { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
#osd2 { flex: 1 1 auto; min-height: 0; min-width: 0; background: #2b2f33; touch-action: none; -webkit-touch-callout: none; }
.zoomctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoomctl .icon { background: rgba(31,56,100,.9); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
/* v164: highlight + PDF on a Mechanical print */
.zoomctl .icon.pdf, .zoomctl .icon.hl { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.zoomctl .icon.hl.on { background: #ffe600; color: var(--ink); }
svg.hl rect.hlbox { fill: #ffe600; fill-opacity: .38; stroke: #d6a000; stroke-width: 2px; vector-effect: non-scaling-stroke; }
svg.hl .hlbadge circle { fill: var(--navy); stroke: #fff; stroke-width: 2px; }
svg.hl .hlbadge text { fill: #fff; font: 700 14px/1 system-ui, -apple-system, sans-serif; text-anchor: middle; }
#hl-note { width: 100%; box-sizing: border-box; font-size: 16px; padding: 10px 12px; border: 1px solid #c8ced6; border-radius: 8px; margin: 6px 0 14px; }
@media (max-width: 599.98px) { .drow { grid-template-columns: 1fr 24px; } .drow .dno { grid-column: 1; } .drow .dtitle { grid-column: 1; } .drow .dmeta { grid-column: 2; grid-row: 1 / 3; } }

/* keep design folders on the device (2026-10-21) */
.keepbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--navy); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; font-size: 14px; }
.keepbar.on { border-left-color: var(--done); }
.keepbar.busy { border-left-color: #fb8c00; }
.drow .ondev { color: var(--done); font-weight: 700; font-size: 18px; }
.block-btn.holding { transform: scale(.97); outline: 3px solid #ffd600; transition: transform .9s; }
.dseries .block-btn { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }

/* QC photos (2026-10-21) */
#kinds-actions { margin-top: 14px; }
#kinds-actions .btn { flex: 0 1 260px; }
.qcp-day { margin-top: 14px; padding-top: 8px; border-top: 2px solid var(--line); }
.qcp-day h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qcp-toggle { background: none; border: 0; padding: 6px 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.qcp-toggle .chev { display: inline-block; transition: transform .15s; transform: rotate(90deg); }
.qcp-day.closed .qcp-toggle .chev { transform: rotate(0deg); }
.qcp-day.closed .qcp-body { display: none; }
.qcp-day h4 { margin: 10px 0 6px; font-size: 14px; }
.qcp-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.qcp-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.qcp-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #e7ecf2; }
.qcp-card .qcp-name { font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; margin-top: 6px; }

.qc-list h3 .btn.tiny { margin-left: 10px; font-weight: 500; }

.token-box { background: #fff8e1; border: 1px solid #ffd54f; border-radius: 10px; padding: 10px 12px; margin: 8px 0; display: grid; gap: 6px; }
.token-box code.tok { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; user-select: all; }

#equip { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px; }
.equip-forms { display: grid; gap: 8px; margin: 6px 0 12px; }
.equip-form { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.equip-form .muted { font-size: 12px; }
.qcp-grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-top: 6px; }
.qcp-grid.small .qcp-card img { aspect-ratio: 1; }
@media (max-width: 899.98px) { #equip { display: none !important; } }
/* v127: the photo grid scrolls inside the side panel (landscape); in portrait the Photos button opens the grid in the big modal */
@media (min-width: 900px) { #equip { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; } #equip .welds-head { position: sticky; top: -8px; background: #fff; z-index: 1; padding: 8px 0 4px; } #btn-equip-photos { display: none !important; } }
#equip-photos-modal { margin-top: 8px; }
.equip-preview { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #f5f7f9; margin-bottom: 6px; } .equip-preview img { width: 100%; max-height: 260px; object-fit: contain; background: #fff; border-radius: 8px; display: block; margin-bottom: 6px; }   /* v137 equipment preview */
.equip-preview-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .equip-preview-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* daily report calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 8px; }
.cal-head b { font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.cal button { min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 15px; position: relative; cursor: pointer; }
.cal button.off { visibility: hidden; }
.cal button:disabled { background: #f1f3f6; color: #b8bec8; cursor: default; }
.cal button.has::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--navy); }
.cal button.sel { border-color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); font-weight: 700; }
.cal button.today { color: var(--navy); }

.home-actions .btn.weld, .btn.weld { background: #b71c1c; border-color: #b71c1c; color: #fff; }

.valve-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; font-size: 15px; }
.valve-name select { font: inherit; font-size: 15px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.valve-name input { font: inherit; font-size: 15px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 260px; }

/* Save a copy to Photos (2026-10-23): panel after a shot, and the unsent-photos list in the menu */
.keep-copy { position: fixed; left: 50%; bottom: calc(16px + var(--sab)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); background: #fff; color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.25); padding: 10px 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; z-index: 60; }
.keep-copy[hidden] { display: none; }
.keep-copy .thumbs, .unsent-item .thumbs { display: flex; gap: 4px; }
.keep-copy img, .unsent-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.keep-copy .more, .unsent-item .more { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 6px; background: var(--bg); color: var(--muted); font-weight: 600; }
.keep-copy .txt, .unsent-item .txt { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.keep-copy .row, .unsent-item .row { display: flex; gap: 6px; flex-wrap: wrap; }
.unsent { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.unsent-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.unsent-item.failed { border-color: #e4b1b8; background: #fff6f7; }

/* Export all data (2026-10-23) */
.export-all .bar { display: inline-block; vertical-align: middle; width: 160px; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin-left: 6px; }
.export-all .bar i { display: block; height: 100%; background: var(--navy); transition: width .4s; }
.export-all ul.small { color: var(--muted); font-size: 14px; }

/* Field documents (2026-10-23) */
.docs .drop { border: 2px dashed var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.docs .drop.over { border-color: var(--navy); background: #e8eef7; }
.docs .drop label.small { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.docs .drop input { font: inherit; font-size: 15px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 240px; }
.docs .doc-folder h3 { margin: 14px 0 6px; }
.docs .doc-folder h3.dfold { cursor: pointer; user-select: none; -webkit-user-select: none; display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; }
.docs .doc-folder h3.dfold:hover, .docs .doc-folder h3.dfold:focus-visible { background: var(--bg); outline: none; }
.docs .doc-folder h3.dfold .chev { display: inline-block; width: 1em; text-align: center; color: var(--muted); transition: transform .15s; }
.docs .doc-folder.folded h3.dfold .chev { transform: rotate(-90deg); }
.docs .doc-folder.folded .doc-rows { display: none; }
.docs.finding .doc-folder .doc-rows { display: block; }
.docs .doc-folder.nomatch, .docs .doc-row.nomatch { display: none; }
.docs .docs-find { display: block; margin: 4px 0 8px; }
.docs .docs-find input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.docs .doc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 6px; }
.docs .doc-row .ic { font-size: 22px; }
.docs .doc-row .txt { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; word-break: break-word; }
.docs .doc-row .row { display: flex; gap: 6px; flex-wrap: wrap; }

/* Guest (view only), 2026-10-23: looks, never files or downloads. The server refuses the same calls. */
body.guest #btn-weld, body.guest #btn-qc-request, body.guest #btn-constraint, body.guest #btn-fdr, body.guest #btn-bug, body.guest #btn-qc-photo,
body.guest #btn-mark, body.guest #btn-received, body.guest #btn-shop-pdf, body.guest #btn-shop-pdf-bar, body.guest #btn-vt, body.guest #btn-place-weld, body.guest #btn-place-tq, body.guest .place-tq, body.guest .treport a.btn, body.guest #btn-pdf, body.guest #btn-export,
body.guest #btn-edit, body.guest #btn-review, body.guest #btn-password, body.guest #menu-daily, body.guest #uploads,
body.guest .keep, body.guest #d-keepbar, body.guest .welds-head .place, body.guest label[for="file-weld"], body.guest label[for="file-torque"], body.guest #lbl-equip-photo, body.guest #lbl-equip-lib,
body.guest #keep-copy, body.guest .qcp-card a[download], body.guest .ship-head label.btn, body.guest .ship a.btn[download], body.guest [data-act="torque-delete"], body.guest [data-act="record"], body.guest [data-act="edit-weld"], body.guest [data-act="pin-weld"], body.guest [data-act="delete-weld"] { display: none !important; }
/* v170: a view-only account (the company leadership) hides the same filing controls as a guest, but keeps the downloads and PDFs */
body.viewonly #btn-weld,
body.viewonly #btn-qc-request,
body.viewonly #btn-constraint,
body.viewonly #btn-fdr,
body.viewonly #btn-bug,
body.viewonly #btn-qc-photo,
body.viewonly #btn-mark,
body.viewonly #btn-received,
body.viewonly #btn-vt,
body.viewonly #btn-place-weld,
body.viewonly #btn-place-tq,
body.viewonly .place-tq,
body.viewonly .treport a.btn,
body.viewonly #btn-pdf,
body.viewonly #btn-export,
body.viewonly #btn-edit,
body.viewonly #btn-review,
body.viewonly #btn-password,
body.viewonly #menu-daily,
body.viewonly #uploads,
body.viewonly .welds-head .place,
body.viewonly label[for="file-weld"],
body.viewonly label[for="file-torque"],
body.viewonly #lbl-equip-photo,
body.viewonly #lbl-equip-lib,
body.viewonly .ship a.btn[download],
body.viewonly [data-act="torque-delete"],
body.viewonly [data-act="record"],
body.viewonly [data-act="edit-weld"],
body.viewonly [data-act="pin-weld"],
body.viewonly [data-act="delete-weld"] { display: none !important; }
body.viewonly #title::after { content: ' · view only'; font-weight: 400; opacity: .8; }

body.guest #title::after { content: ' · view only'; font-weight: 400; opacity: .8; }

/* QC request photos (2026-10-23) */
.q-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.q-thumb { position: relative; display: inline-block; }
.q-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.q-thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 11px; border: 0; background: #b00020; color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer; }
.qc-photos { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.qc-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* Add a spool here (2026-10-23) */
#add-spool label.check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
#add-spool label.check input { width: 22px; height: 22px; }

/* v109: 3D spool view (viewer3d.js), full screen over the app */
@media (min-width: 900px) { #btn-3d-bar { display: none; } }   /* wide screens have the 3D button in the Welds bar */
#v3d { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; background: #15191f; color: #e8ecf2; font-size: 14px; }
#v3d header { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 10px; background: var(--navy); padding-top: max(6px, env(safe-area-inset-top)); }
#v3d header b { font-size: 15px; margin-right: 4px; } #v3d .v3d-sub { color: #c7d0dc; font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#v3d header button { font: inherit; border: 0; border-radius: 8px; padding: 8px 12px; min-height: 36px; background: #fff; color: var(--navy); touch-action: manipulation; }
#v3d header button.on { background: #ffb74d; } #v3d header button.x { font-size: 22px; line-height: 1; padding: 4px 12px; }
#v3d .v3d-stage { display: flex; min-height: 0; min-width: 0; overflow: hidden; } #v3d .v3d-view { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; }
#v3d canvas { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; touch-action: none; }
#v3d .v3d-info { position: absolute; left: 10px; top: 10px; background: rgba(31,36,44,.9); padding: 6px 10px; border-radius: 8px; max-width: min(70vw, 420px); pointer-events: none; }
#v3d .v3d-info .t { color: #9aa4b2; font-size: 12px; }
#v3d .v3d-note { position: absolute; left: 10px; bottom: 10px; max-width: min(80vw, 560px); background: rgba(255,183,77,.92); color: #1a1a1a; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; }
#v3d .v3d-legend { flex: 0 0 auto; width: min(300px, 42vw); margin: 10px 10px 10px 0; overflow: auto; background: rgba(31,36,44,.92); border-radius: 8px; padding: 4px 0; font-size: 12.5px; }
#v3d .v3d-legend div { padding: 5px 10px; cursor: pointer; display: grid; grid-template-columns: 2.6em 1fr auto; gap: 6px; }
#v3d .v3d-legend div:hover, #v3d .v3d-legend div.on { background: rgba(255,183,77,.25); }
#v3d .v3d-legend .tag { font-weight: 600; } #v3d .v3d-legend .len { color: #9aa4b2; white-space: nowrap; } #v3d .v3d-legend.hide { display: none; }
#v3d .v3d-legend h5 { margin: 8px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #9aa4b2; }
#v3d .v3d-legend div.st { grid-template-columns: 5.4em 1fr auto; } #v3d .v3d-legend div.dim { opacity: .55; }
#v3d .v3d-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
#v3d .v3d-legend .dot.ok { background: #3ddc84; } #v3d .v3d-legend .dot.fail { background: #e53935; } #v3d .v3d-legend .dot.open { background: #ffca28; }
#v3d .v3d-info .s { color: #c7d0dc; font-size: 12px; margin-top: 2px; }
#v3d footer { padding: 5px 10px; color: #9aa4b2; font-size: 11.5px; background: #1f242c; padding-bottom: max(5px, env(safe-area-inset-bottom)); }
@media (max-width: 700px) { #v3d .v3d-stage { flex-direction: column; } #v3d .v3d-legend { width: auto; max-height: 42%; margin: 0 10px 10px; } #v3d .v3d-info { max-width: calc(100% - 20px); } #v3d footer { display: none; } }

/* v117/v118: The business case (super admins), in the company colours: navy with the app's yellow (--sel) as the accent */
.case { --yellow: var(--sel); --pale: #f5f7f9; }
.case .hero { background: linear-gradient(160deg, #1f3864 0%, #16294b 100%); color: #fff; border-radius: 16px; padding: 18px 20px 16px; border-bottom: 6px solid var(--yellow); margin-bottom: 14px; }
.case .herotop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .case .hero .logo { background: #fff; border-radius: 10px; padding: 6px 10px; display: flex; } .case .hero img { height: 34px; display: block; }
.case .hero .co { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--yellow); font-weight: 700; }
.case .hero h2 { margin: 16px 0 6px; font-size: 26px; line-height: 1.15; font-weight: 800; color: #fff; text-transform: none; letter-spacing: -.01em; max-width: 22em; }   /* the global h2 rule uppercases; not here */
.case .hero .sub { color: #d6dde8; font-size: 15px; max-width: 60em; margin: 0 0 14px; }
.case .proofstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.case .pf { background: rgba(255,255,255,.08); border-radius: 10px; padding: 8px 12px; border-left: 3px solid var(--yellow); } .case .pf b { display: block; font-size: 24px; color: var(--yellow); font-weight: 800; } .case .pf span { font-size: 12px; color: #d6dde8; }
.case .case-actions { align-items: center; gap: 8px; } .case .hero .when { font-size: 12px; color: #aab6c6; }
.case .btn.yellow { background: var(--yellow); color: var(--navy); border-color: var(--yellow); font-weight: 800; } .case .btn.ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.case .askband .btn.ghost { color: #fff; }
.case .sec { margin: 18px 0 6px; } .case .eyebrow { color: var(--navy); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; padding-left: 10px; border-left: 5px solid var(--yellow); }
.case h3 { background: none; border: 0; color: var(--navy); text-transform: none; letter-spacing: -.01em; font-size: 20px; font-weight: 800; padding: 0 0 0 15px; margin: 4px 0 10px; }
.case .sec > p { margin: 0 0 10px 15px; color: var(--muted); }
.case .pains { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.case .pain { background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 1px 2px rgba(0,0,0,.06); } .case .pain p { margin: 2px 0 0; font-size: 14px; }
.case .n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); color: var(--navy); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.case .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.case .step { background: var(--navy); color: #fff; border-radius: 12px; padding: 14px; } .case .step b { display: block; margin: 8px 0 4px; font-size: 16px; } .case .step p { margin: 0; font-size: 13.5px; color: #d6dde8; }
.case .bigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.case .bg { background: #fff; border-radius: 10px; padding: 10px 12px; border-top: 4px solid var(--yellow); box-shadow: 0 1px 2px rgba(0,0,0,.06); } .case .bg b { display: block; font-size: 30px; color: var(--navy); font-weight: 800; line-height: 1.1; } .case .bg span { font-size: 12.5px; color: var(--muted); }
.case .mores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .case .mr { background: var(--pale); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); } .case .mr b { color: var(--navy); }
.case .tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.case .tier { position: relative; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.case .tier.rec { border: 3px solid var(--yellow); box-shadow: 0 6px 18px rgba(31,56,100,.18); } .case .ribbon { position: absolute; top: 10px; right: -28px; transform: rotate(35deg); background: var(--yellow); color: var(--navy); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 34px; }
.case .th { background: var(--navy); color: #fff; padding: 12px 14px 10px; } .case .tn { font-size: 17px; font-weight: 800; } .case .ts { font-size: 12px; color: #c7d0dc; margin-top: 2px; }
.case .tier.rec .th { background: var(--navy); } .case .tier.top { background: var(--navy); color: #fff; border-color: var(--navy); } .case .tier.top .th { background: rgba(255,255,255,.08); } .case .tier.top .tp, .case .tier.top li { color: #fff; } .case .tier.top .ty { color: #c7d0dc; }
.case .tb { padding: 10px 14px 12px; } .case .tp { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; } .case .tp small { font-size: 13px; font-weight: 600; color: var(--muted); }
.case .ty { font-size: 12px; color: var(--muted); border-bottom: 2px solid var(--yellow); padding-bottom: 6px; margin: 4px 0 6px; }
.case .tier ul { margin: 0; padding-left: 18px; } .case .tier li { margin: 4px 0; font-size: 13.5px; }
.case .tier.edit { padding: 12px 14px; }
.case .hws { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 14px; }
.case .hw { display: flex; gap: 10px; padding: 8px 10px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06); } .case .hw > div { display: flex; flex-direction: column; } .case .hw b { color: var(--navy); } .case .hw span { font-size: 13px; color: var(--muted); }
.case .ck { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); color: var(--navy); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.case .hw.edit { flex-direction: column; gap: 4px; } .case .hw.edit input { width: 100%; }
.case .faq details { background: #fff; border-radius: 10px; padding: 8px 12px; margin: 6px 0; } .case .faq summary { font-weight: 700; color: var(--navy); cursor: pointer; } .case .faq p { margin: 6px 0 2px; font-size: 14px; color: var(--ink); }
.case .askband { background: var(--navy); color: #fff; border-radius: 14px; padding: 16px 18px; margin-top: 18px; border-bottom: 6px solid var(--yellow); } .case .askband .k { color: var(--yellow); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
.case .askband p { font-size: 18px; font-weight: 700; margin: 4px 0 0; } .case .askband p.note { font-weight: 400; font-size: 14px; margin-top: 8px; color: #d6dde8; } .case .askband .row { margin-top: 12px; gap: 8px; }
.case label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin: 6px 0; }
.case input, .case textarea, .case select { font: inherit; font-size: 15px; color: var(--ink); padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
/* v121 interactivity: hover lifts, picked tier, count-up numbers, reveal on scroll, the billing toggle */
.case .tier, .case .step, .case .pain, .case .bg, .case .hw, .case .btn { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
@media (hover: hover) {
  .case .tier:hover, .case .step:hover, .case .pain:hover, .case .bg:hover, .case .hw:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31,56,100,.16); }
  .case .tier:hover { border-color: var(--navy); cursor: pointer; } .case .tier.rec:hover { border-color: var(--yellow); }
  .case .btn.yellow:hover { filter: brightness(1.06); transform: translateY(-1px); } .case .btn.ghost:hover { background: rgba(255,255,255,.12); }
  .case .faq summary:hover { color: #2d4f8a; }
}
.case .tier:active { transform: translateY(-1px) scale(.995); }
.case .tier.picked { border-color: var(--navy); box-shadow: 0 0 0 3px var(--yellow), 0 10px 24px rgba(31,56,100,.18); } .case .tier.picked .pick { background: var(--yellow); color: var(--navy); }
.case .tier.rec.picked { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--navy), 0 10px 24px rgba(31,56,100,.18); }
.case .pick { margin: 10px -14px -12px; padding: 7px 14px; background: var(--pale); color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; letter-spacing: .04em; text-transform: uppercase; }
.case .tier.top .pick { background: rgba(255,255,255,.1); color: #d6dde8; } .case .tier.top.picked .pick { background: var(--yellow); color: var(--navy); }
.case .tier:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
/* v159: the tier footer is a link to the agreement; the invest chooser in the ask band */
.case a.pick { display: block; text-decoration: none; color: var(--navy); background: var(--yellow); } .case a.pick:hover { filter: brightness(1.06); } .case .tier.top a.pick { color: var(--navy); background: var(--yellow); }
.case .pickbox .termslink { color: var(--yellow); font-weight: 700; } .case .pickbox .choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; } .case .pickbox .choices .btn { text-decoration: none; }
.case .pickbox .muted-l { font-size: 12.5px; color: #c7d0dc; } .case .btn.invest { font-size: 16px; }
/* v159: the Safeguards page is linked from the section text, from every safeguard card and from a button under them */
.case .seelink { color: var(--navy); font-weight: 800; text-decoration: none; border-bottom: 2px solid var(--yellow); white-space: nowrap; }
.case a.hw { text-decoration: none; color: inherit; } .case a.hw:hover b { text-decoration: underline; }
.case .btn.safebtn { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; text-decoration: none; }
.case .bill { align-items: center; gap: 10px; margin: 0 0 10px 15px; } .case .bill .seg { margin: 0 10px; } .case .seg { display: inline-flex; border: 1.5px solid var(--navy); border-radius: 999px; overflow: hidden; }
.case .seg button { font: inherit; font-size: 13px; font-weight: 700; padding: 5px 12px; border: 0; background: #fff; color: var(--navy); cursor: pointer; } .case .seg button.on { background: var(--navy); color: #fff; }
.case .pickbox { margin-top: 10px; padding: 10px 12px; background: rgba(255,255,255,.1); border-left: 4px solid var(--yellow); border-radius: 8px; font-size: 14px; color: #fff; } .case .pickbox .k { display: block; color: var(--yellow); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; } .case .pickbox b { font-size: 16px; }
.case .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; } .case .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .case .reveal { opacity: 1; transform: none; transition: none; } .case .tier, .case .step, .case .pain, .case .bg, .case .hw, .case .btn { transition: none; } }

/* v125: equipment photos in bulk (home screen, Upload drawings) */
#equip-bulk-row label.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#equip-bulk-row input[type="date"] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.bulkwrap h2 { margin-top: 0; } .bulkwrap .row { margin-top: 12px; gap: 8px; }
table.bulk { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; } table.bulk th, table.bulk td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); } table.bulk .num { text-align: right; white-space: nowrap; }
.bulk-skip { margin-top: 10px; } .bulk-skip summary { cursor: pointer; font-weight: 600; color: var(--muted); } .bulk-skip ul { margin: 6px 0 0; padding-left: 20px; font-size: 13px; max-height: 30vh; overflow: auto; }
.bulk-marks { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 12px; font-size: 14px; } .bulk-marks label { display: inline-flex; align-items: center; gap: 6px; } .bulk-marks input { width: 18px; height: 18px; } .bulk-marks .muted { font-size: 12.5px; flex-basis: 100%; }
.bulk-bar { height: 10px; background: #e7ecf2; border-radius: 5px; overflow: hidden; margin-top: 12px; } #bulk-bar-fill { height: 100%; width: 0; background: var(--navy); transition: width .3s ease; }
/* v130: paper copies on the daily report + the photo viewer */
.f-att { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; } .f-att-card { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #e7ecf2; }
.f-att-card img { width: 100%; height: 100%; object-fit: cover; } .f-att-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20,23,26,.75); color: #fff; font-size: 13px; cursor: pointer; }
/* v136: the paper report, front and back photographed; one slot per side */
.fpr-side { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px; border: 1.5px dashed var(--line); border-radius: 10px; margin: 4px 0 8px; background: #fafbfc; }
.fpr-side.has { border-style: solid; background: #fff; } .fpr-side .slot { width: 120px; height: 150px; border-radius: 8px; overflow: hidden; background: #e7ecf2; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; flex: 0 0 auto; }
.fpr-side .slot img { width: 100%; height: 100%; object-fit: cover; display: block; } .fpr-side .acts { display: flex; flex-direction: column; gap: 6px; } .fpr-side .acts .btn { justify-content: center; }
.fpr-side .ok { color: #00695c; font-weight: 700; font-size: 13px; }
.fpr-thumb { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; } .fpr-thumb img { width: 64px; height: 84px; }
.fdr-att-row td { background: #f5f7f9; } .fdr-att { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .fdr-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #e7ecf2; display: block; }
#lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,12,16,.96); display: grid; grid-template-rows: 1fr auto; grid-template-columns: 72px 1fr 72px; color: #fff; padding-top: var(--sat, 0px); }
#lightbox[hidden] { display: none; } body.lb-open { overflow: hidden; }
.lb-stage { grid-row: 1; grid-column: 2; display: flex; align-items: center; justify-content: center; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
#lb-img { max-width: 100%; max-height: calc(100vh - 70px - var(--sat, 0px)); object-fit: contain; cursor: zoom-in; transition: transform .15s ease; user-select: none; -webkit-user-drag: none; }
#lb-img.zoom { max-width: none; max-height: none; width: auto; height: 200vh; cursor: zoom-out; }
/* v143: round buttons with a dark backing, visible on a bright photo too, big enough for a thumb */
.lb-nav { grid-row: 1; align-self: center; justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.5); border: 1.5px solid rgba(255,255,255,.55); color: #fff; font-size: 40px; line-height: 44px; cursor: pointer; padding: 0 0 6px; z-index: 2; } .lb-prev { grid-column: 1; } .lb-next { grid-column: 3; } .lb-nav:hover, .lb-nav:focus-visible { background: rgba(31,56,100,.85); outline: none; }
.lb-x { position: absolute; top: calc(10px + var(--sat, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 20px; cursor: pointer; z-index: 1; }
.lb-bar { grid-row: 2; grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + var(--sab, 0px)); font-size: 13px; background: rgba(0,0,0,.4); } .lb-bar #lb-cap { flex: 1; font-family: ui-monospace, Menlo, monospace; word-break: break-all; } .lb-n { opacity: .8; white-space: nowrap; }
.lb-bar .btn { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; } body.guest #lb-dl { display: none !important; }
@media (max-width: 640px) { #lightbox { grid-template-columns: 48px 1fr 48px; } .lb-nav { width: 42px; height: 42px; font-size: 32px; line-height: 36px; } }
/* v132: QC photos / Equipment photos folders */
.qcp-folders { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; } .qcp-folders .btn .n { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.12); font-size: 12px; } .qcp-folders .btn.primary .n { background: rgba(255,255,255,.22); }
h5.qcp-tag { margin: 10px 0 4px; font-size: 13px; color: var(--navy); }

/* ---- the menu, redesigned 2026-10-27 (v143, Alex: the company blue and white, practical): navy band, line icons, big rows ---- */
#menu { padding: 0; gap: 0; background: #fff; }
@media (min-width: 900px) { #menu { width: min(400px, 100%); } }
#menu .menu-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 16px 12px 16px 18px;
  background: var(--navy); color: #fff; }
#menu .who { flex: 1; min-width: 0; }
#menu .who .co { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
#menu #menu-user b { display: block; font-size: 18px; font-weight: 700; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#menu #menu-user span { display: block; font-size: 13px; opacity: .85; margin-top: 1px; }
#menu .menu-x { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
#menu .menu-x:hover, #menu .menu-x:focus-visible { background: rgba(255,255,255,.22); outline: none; }
#menu .menu-x .ic { width: 22px; height: 22px; }
#menu .menu-note { margin: 12px 14px 4px; padding: 10px 12px; border-radius: 10px; background: #eef2f8; border-left: 3px solid var(--navy);
  font-size: 13px; line-height: 1.45; color: var(--ink); }
#menu .menu-note:empty { display: none; }
#menu .menu-list { display: flex; flex-direction: column; padding: 4px 0 calc(16px + var(--sab)); }
#menu .menu-h { margin: 16px 18px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
#menu .mi { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 8px 16px 8px 18px; border: 0;
  border-top: 1px solid #eef1f5; background: #fff; color: var(--ink); font: inherit; font-size: 16px; font-weight: 500; text-align: left;
  text-decoration: none; cursor: pointer; }
#menu .menu-h + .mi, #menu .mi[hidden] + .mi { border-top-color: transparent; }
#menu .mi:hover { background: #f4f7fb; }
#menu .mi:active { background: #e6ecf5; }
#menu .mi:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }
#menu .mi .ic { flex: 0 0 auto; width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: #e9eef6; color: var(--navy); }
#menu .mi .lbl { flex: 1; min-width: 0; }
#menu .mi .cnt { flex: 0 0 auto; min-width: 24px; padding: 2px 8px; border-radius: 999px; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; }
#menu .mi::after { content: ''; flex: 0 0 auto; width: 8px; height: 8px; border-right: 2px solid #b8c2d0; border-top: 2px solid #b8c2d0;
  transform: rotate(45deg); margin-left: 4px; }
#menu #btn-logout { color: var(--navy); font-weight: 600; }
#menu .ic, .menu-x .ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* every pop-up: a tap outside closes it (v143), the same as the menu */
#modal-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(20,23,26,.18); }

/* 3D watermark (Alex, 2026-10-27, v143: "I don't want anyone to think the render is accurate yet"). Behind the render in light white
   lettering (the canvas is transparent), in every 3D view (one spool and 3D area), fixed to the screen whatever the camera does. */
#v3d .v3d-view { background: #15191f; }
#v3d .v3d-view > canvas { position: relative; z-index: 1; }   /* the render over the watermark: pipes pass in front of it */
#v3d .v3d-mark { position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; user-select: none; -webkit-user-select: none; transform: rotate(-18deg); color: rgba(255,255,255,.15);
  font-weight: 800; text-transform: uppercase; letter-spacing: .12em; line-height: 1.05; text-align: center; white-space: nowrap; }
#v3d .v3d-mark span:first-child { font-size: clamp(30px, 7vw, 84px); }
#v3d .v3d-mark span:last-child { font-size: clamp(18px, 3.6vw, 42px); letter-spacing: .3em; margin-top: .3em; }
#v3d .v3d-info, #v3d .v3d-note { z-index: 2; }   /* above the watermark */
/* v157 (2026-11-06): the hanger's cut-list spec card under the tag on a hanger layout, and the Hanger cut lists screen */
#hanger-spec { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px; max-height: 38vh; overflow: auto; -webkit-overflow-scrolling: touch; }
#hanger-spec .hs-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#hanger-spec .hs-head b { font-size: 14px; }
#hanger-spec .hs-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0 4px; }
#hanger-spec .hs-grid span { color: var(--muted); font-size: 13px; white-space: nowrap; }
#hanger-spec .hs-grid b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
#hanger-spec .link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; font: inherit; font-weight: 600; cursor: pointer; }
#hanger-spec .hs-src { font-size: 12px; color: var(--muted); }
#hanger-spec .hs-src a { margin-left: 6px; }
#hanger-spec .hs-none { font-size: 13px; }
.hcut-report { font-size: 13px; margin-top: 6px; padding: 6px 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.hcut-report.err { color: var(--danger, #b00020); }
.hcut-missing { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; margin-top: 4px; }
@media (min-width: 900px) { #hanger-spec { max-height: none; } }
/* v158: tracked equipment pins (FM / CV / FS) and their card */
svg.hot g.ep circle { fill: #fff; stroke: #1565c0; stroke-width: 2.5px; }
svg.hot g.ep text { font: 700 11px -apple-system, Helvetica, Arial, sans-serif; fill: #1565c0; text-anchor: middle; dominant-baseline: central; }
svg.hot g.ep.installed circle { fill: #2e7d32; stroke: #fff; } svg.hot g.ep.installed text { fill: #fff; }
svg.hot g.ep circle.lk { display: none; fill: #f57c00; stroke: #fff; stroke-width: 1.5px; }
svg.hot g.ep.locked circle.lk { display: block; }
svg.hot g.ep.selected circle:first-child { stroke: #ffab00; stroke-width: 4px; }
svg.hot g.ep.pending circle:first-child { stroke-dasharray: 4 3; }
#epin { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--sab)); box-shadow: 0 -4px 12px rgba(0,0,0,.15); font-size: 14px; max-height: 70vh; overflow: auto; -webkit-overflow-scrolling: touch; }
#epin .hs-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#epin .ep-title { font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
#epin .ep-dot, #modal .eq-kinds .btn i { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #1565c0; color: #1565c0; font: 700 10px -apple-system, Helvetica, Arial, sans-serif; font-style: normal; background: #fff; }
#epin .ep-tag { font: 600 13px ui-monospace, Menlo, monospace; color: var(--navy); margin: 2px 0 4px; overflow-wrap: anywhere; }
#epin .ep-part { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); margin: 4px 0 6px; }
#epin .ep-part span { color: var(--muted); font-size: 12px; white-space: nowrap; } #epin .ep-part b { font-size: 16px; overflow-wrap: anywhere; }
#epin .ep-state { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
#epin .ep-pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eceff1; color: #37474f; }
#epin .ep-pill.on { background: #e8f5e9; color: #1b5e20; } #epin .ep-pill.lock { background: #fff3e0; color: #e65100; } #epin .ep-pill.open { background: #e3f2fd; color: #0d47a1; }
#epin .hs-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 4px 0; }
#epin .hs-grid span { color: var(--muted); font-size: 12px; white-space: nowrap; } #epin .hs-grid b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
#epin .hs-src { font-size: 12px; color: var(--muted); margin-top: 2px; } #epin .hs-src a { margin-left: 6px; }
#epin .ep-btns { margin-top: 8px; gap: 6px; flex-wrap: wrap; }
.chip.ep-chip { cursor: default; }
#modal .eq-kinds .btn { display: inline-flex; align-items: center; gap: 8px; }
#modal .eq-kinds .btn.primary i { background: #fff; }
#modal table.ecat { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 12px; }
#modal table.ecat th, #modal table.ecat td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
#modal table.ecat tr.off td { color: var(--muted); text-decoration: line-through; }
#modal .ecat-wrap h3 { margin: 12px 0 4px; font-size: 15px; }
@media (min-width: 900px) { #epin { position: static; box-shadow: none; border: 0; border-bottom: 1px solid var(--line); max-height: none; } }

/* v159 (Alex 2026-11-08): a hover effect on the home screen's buttons, desktop only. Gated on a pointer that can hover AND is
   fine (a mouse or trackpad): phones and the iPad by touch never match, so no sticky hover state after a tap. The transition
   sits outside the gate so the lift eases back on the way out; people who asked for reduced motion get the colour change only. */
.block-btn, .home-actions .btn { transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background-color .18s ease, border-color .18s ease; }
@media (hover: hover) and (pointer: fine) {
  .block-btn:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px #0b1a33, 0 10px 22px rgba(20,30,50,.34); filter: brightness(1.06); }   /* the dark ring is the bug button's hover border, carried to every home button (Alex 2026-11-08) */
  .block-btn.kind-btn[disabled]:hover { transform: none; box-shadow: 0 2px 8px rgba(0,0,0,.15); filter: none; }
  .home-actions .btn:hover { transform: translateY(-2px); border-color: #0b1a33; box-shadow: 0 0 0 1px #0b1a33, 0 8px 18px rgba(20,30,50,.30); filter: brightness(1.06); }
  .home-actions .btn.bug:hover { filter: none; color: var(--ink); background: #f4f7fb; box-shadow: 0 0 0 1px #0b1a33, 0 8px 18px rgba(20,30,50,.18); }
  .block-btn:active, .home-actions .btn:active { transform: translateY(0) scale(.99); box-shadow: 0 2px 8px rgba(0,0,0,.15); filter: none; }
}
@media (prefers-reduced-motion: reduce) { .block-btn, .home-actions .btn { transition: none; } .block-btn:hover, .home-actions .btn:hover { transform: none; } }

/* v160: the block's tracking prints sit under their own heading in the print list; the catalog screen's block chips */
#sheet-list .list-head { grid-column: 1 / -1; flex-basis: 100%; width: 100%; margin: 16px 0 2px; font-size: 1.02rem; color: var(--ink); }
#sheet-list .list-head .small { font-weight: 400; margin-left: 6px; }
.ecat-chips { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
#eq-filter { display: block; width: 100%; margin: 4px 0 6px; }
.ep-sheet { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.ep-sheet .btn { text-decoration: none; }
.treport .pin-lock { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; font-size: .92em; color: var(--muted); }
.treport .pin-lock.on { color: var(--ink); }

/* v168: hydro test packages */
.hy .hy-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.hy .hy-status { font-size: 12px; color: var(--muted); }
.hy .hy-status.err { color: #b00020; }
.hy .hy-sec { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.hy .hy-sec > h3 { margin: 0; padding: 10px 12px; background: #e9eef5; border-left: 4px solid var(--navy); font-size: 14px; cursor: pointer; user-select: none; -webkit-user-select: none; display: flex; align-items: center; gap: 8px; }
.hy .hy-sec > h3 .chev { display: inline-block; width: 1em; text-align: center; color: var(--muted); transition: transform .15s; }
.hy .hy-sec.folded > h3 .chev { transform: rotate(-90deg); }
.hy .hy-sec.folded > .hy-body { display: none; }
.hy .hy-sec > h3 .done { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.hy .hy-body { padding: 10px 12px 12px; }
.hy .hy-intro { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.hy .hy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 12px; align-items: start; }
.hy label.hy-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.hy label.hy-f.wide { grid-column: 1 / -1; }
.hy .hy-f input, .hy .hy-f textarea, .hy .hy-f select { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; box-sizing: border-box; }
.hy .hy-help { font-size: 12px; color: var(--muted); }
.hy .hy-req { color: #b00020; }
.hy .hy-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.hy .hy-item:first-child { border-top: 0; }
.hy .hy-item .t { flex: 1 1 260px; font-size: 14px; }
.hy .hy-item input.note { flex: 1 1 160px; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.hy .hy-seg { display: inline-flex; border: 1.5px solid var(--navy); border-radius: 999px; overflow: hidden; flex: 0 0 auto; }
.hy .hy-seg button { font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; border: 0; background: #fff; color: var(--navy); cursor: pointer; min-width: 48px; }
.hy .hy-seg button.on { background: var(--navy); color: #fff; }
.hy .hy-tick { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hy .hy-tick:first-child { border-top: 0; }
.hy .hy-tick input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
.hy .hy-tick.h { font-weight: 700; color: var(--navy); border-top: 0; padding-top: 12px; }
.hy .hy-rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.hy .hy-rows th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 4px; font-size: 12px; }
.hy .hy-rows td { padding: 3px 3px; vertical-align: middle; }
.hy .hy-rows td input { font: inherit; font-size: 14px; padding: 6px 6px; border: 1px solid var(--line); border-radius: 6px; width: 100%; box-sizing: border-box; min-width: 70px; }
.hy .hy-rows td input[type=date] { min-width: 130px; }
.hy .hy-rows td input[type=time] { min-width: 100px; }
.hy .hy-rowwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hy .hy-rows .rn { color: var(--muted); font-size: 12px; width: 1.6em; }
.hy .hy-sig { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hy .hy-sig .who { font-size: 13px; color: var(--muted); flex: 1 1 160px; }
.hy .hy-sig .who b { color: var(--ink); display: block; }
.hy .hy-sig img { height: 44px; max-width: 180px; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.hy .hy-sig img.sm { height: 30px; max-width: 110px; }
.hy .hy-pad { grid-column: 1 / -1; border: 1px solid var(--navy); border-radius: 12px; padding: 10px; background: #fbfcfe; display: flex; flex-direction: column; gap: 8px; }
.hy .hy-pad canvas { width: 100%; height: 170px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; touch-action: none; display: block; }
.hy .hy-pad input { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.hy .hy-att { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
.hy .hy-att .n { flex: 1 1 200px; }
.hy .hy-att .n b { display: block; word-break: break-word; }
.hy .hy-att .wait { color: #a15c00; }
.hy .hy-list .row { align-items: center; }
.hy .hy-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 10px; margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hy .hy-card .txt { flex: 1 1 220px; }
.hy .hy-card .txt b { display: block; }
.hy .hy-card .st { font-size: 12px; border-radius: 999px; padding: 2px 8px; background: #eef1f6; color: var(--navy); font-weight: 600; }
.hy .hy-card .st.done { background: #e3f3e6; color: #1b6b2f; }
.hy .hy-card .st.wait { background: #fff3df; color: #a15c00; }
.hy .hy-card .st.err { background: #fde8ea; color: #b00020; }
.hy .hy-card .btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* v170: the IT compliance page */

/* v171: the decision package link under each offer card */
.case .tier .pick.pkg { margin-top: 6px; border-top: 1px solid rgba(0,0,0,.08); padding-top: 8px; }

/* v173: two-step sign-in (the password screen) */
.mfa { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line, #dde3ea); }
.mfa h3 { margin: 0 0 6px; } .mfa .row { margin-top: 8px; }
.mfa .tag.ok { background: #e3f3e6; color: #1e6b32; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.mfa-setup { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; } .mfa-setup .qr img { display: block; border: 1px solid var(--line, #dde3ea); border-radius: 8px; background: #fff; }
.mfa-setup ol { margin: 0 0 8px; padding-left: 18px; } .mfa code.key { font-size: 13px; letter-spacing: .06em; user-select: all; }
.mfa .codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 8px 0; } .mfa .codes code { font-size: 14px; padding: 6px 8px; background: #f5f7f9; border-radius: 6px; text-align: center; user-select: all; }
.admin .tag.ok { background: #e3f3e6; color: #1e6b32; font-weight: 700; padding: 1px 7px; border-radius: 10px; font-size: 11px; }

/* v177: MTR (material test reports) — manufacturer folders and rows; the Import button sits in the head */
.mtr .mtr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.mtr .mtr-head h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; }
.mtr .mfr-grid { margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.mtr .mfr-btn { min-height: 96px; background: var(--navy); color: #fff; }
.mtr .mfr-btn .big { font-size: 22px; word-break: break-word; }
.mtr .doc-rows { margin-top: 10px; }
/* v177: the menu's sections fold (tap a heading); the count says how many entries are hidden */
#menu .menu-h { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; -webkit-user-select: none; padding: 6px 0; }
#menu .menu-h .chev { display: inline-block; font-size: 12px; transition: transform .15s ease; }
#menu .menu-h.folded .chev { transform: rotate(-90deg); }
#menu .menu-h .n { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
#menu .menu-h:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 6px; }
#menu .mi.sec-hid { display: none; }

/* v181: two trades. Both sides wear the company navy (Alex: the company brand colour); the chip in the top bar says which side. */
#trade-chip { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
#trade-chip.pick { cursor: pointer; padding-right: 6px; }
#trade-chip.pick::after { content: ' \21C4'; opacity: .85; }   /* ⇄: tap to switch */
.gate { max-width: 720px; margin: 0 auto; padding: 0 16px calc(24px + var(--sab)); text-align: center; }
/* the brand block (logo, slogan, services) is centred in the space between the top bar and the question (Alex, 2026-11-14) */
.gate-brand { min-height: 42vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 8px 0; }
.gate img { display: block; margin: 0 auto 4px; width: 200px; height: auto; }
.gate .slogan { display: inline-block; color: var(--navy); font-weight: 600; letter-spacing: .04em; font-size: 20px; margin: 4px 0 0; white-space: nowrap; }   /* inline-block: its box is the text, so the services line can be fitted to it */
.gate .slogan-rule, .gate .services { display: block; }
.gate .services { display: inline-block; margin-top: 0; }
.gate .slogan-rule { width: 300px; height: 1px; background: var(--navy); opacity: .5; margin: 6px auto; }
.gate .services { white-space: nowrap; letter-spacing: .06em; font-size: 9.4px; }   /* the trades line, fitted by app.js to the slogan's width, edge to edge */
.gate .services span { opacity: .55; padding: 0 .1em; }
@media (max-width: 480px) { .gate .slogan { font-size: 17px; } }
.gate-pick { margin-top: 0; }   /* the question and the tiles follow the centred brand block (was 15vh under the logo) */
.gate h2 { margin: 14px 0 16px; color: var(--navy); }
.gate-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 520px) { .gate-tiles { grid-template-columns: 1fr; } }
.gate-btn { min-height: 120px; background: var(--navy); color: #fff; border: 0; }
.gate-btn .big { font-size: 22px; }
.gate-btn .sub { color: #dbe4ee; }
/* pipefitting-only controls leave the sheet metal side (the server refuses them too) */
body.trade-sheet_metal #btn-weld, body.trade-sheet_metal #btn-review, body.trade-sheet_metal #btn-export, body.trade-sheet_metal #menu-mtr, body.trade-sheet_metal #menu-hydro, body.trade-sheet_metal #menu-acch,
body.trade-sheet_metal #welds, body.trade-sheet_metal #btn-vt, body.trade-sheet_metal #btn-place-weld, body.trade-sheet_metal #btn-place-tq, body.trade-sheet_metal .place-tq, body.trade-sheet_metal label[for="file-weld"], body.trade-sheet_metal label[for="file-torque"],
body.trade-sheet_metal label[for="file-weld-quick"], body.trade-sheet_metal #btn-tq, body.trade-sheet_metal .doc-folder-equipspecs { display: none !important; }

/* demo branch: the DEMO banner under the top bar (site.json demo.enabled) */
#demo-banner { background: #fff3cd; color: #5c4400; border-bottom: 1px solid #ecd58a; font-size: 12.5px; padding: 5px 12px; text-align: center; }
#demo-banner b { color: #7a5200; letter-spacing: .06em; }
