:root {
  --navy: #003e79; --on-navy: #fff; --accent: #1f7fd1; --on-accent: #fff;
  --bg: #f5f7fb; --card: #fff; --text: #1b2333; --muted: #667085; --line: #e3e8f0; --link: #2e6191; --heading: #003e79;
  --ok: #1a7f4b; --warn: #9a6200; --bad: #b42318;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
}
/* Colours worked out from the theme's own (the theme itself comes from /theme.css). Repeated on
   .theme-scope so a theme preview box can carry its own colours. */
:root, .theme-scope {
  --navy-2: color-mix(in srgb, var(--navy) 82%, white); --accent-d: color-mix(in srgb, var(--accent) 85%, black);
  --soft: color-mix(in srgb, var(--link) 10%, var(--card)); --hover: color-mix(in srgb, var(--text) 4%, var(--card));
  --field-line: color-mix(in srgb, var(--text) 22%, var(--card)); --focus: color-mix(in srgb, var(--link) 50%, var(--card));
  --track: color-mix(in srgb, var(--text) 10%, var(--card));
  --ok-bg: color-mix(in srgb, var(--ok) 13%, var(--card)); --warn-bg: color-mix(in srgb, var(--warn) 13%, var(--card)); --bad-bg: color-mix(in srgb, var(--bad) 12%, var(--card));
  --ok-line: color-mix(in srgb, var(--ok) 40%, var(--card)); --warn-line: color-mix(in srgb, var(--warn) 40%, var(--card)); --bad-line: color-mix(in srgb, var(--bad) 35%, var(--card));
}
.theme-scope { background: var(--bg); color: var(--text); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--link); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; } h2 { font-size: 1.25rem; margin: 1.4em 0 .6em; } h3 { font-size: 1.05rem; margin: 1em 0 .4em; }
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; }
.error-text { color: var(--danger, #b42318); } /* 1.409: a sign-in hint that went wrong (public/app.js viewLogin) */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack > * + * { margin-top: 12px; }

.topbar { background: var(--navy); color: var(--on-navy); display: flex; align-items: center; gap: 16px; padding: 0 16px; min-height: 56px; position: sticky; top: 0; z-index: 10; }
.brand { color: var(--on-navy); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 1.05rem; white-space: nowrap; }
.brand-logo { height: 34px; max-width: 180px; object-fit: contain; display: block; }
.brand-logo.big { height: 64px; max-width: 260px; margin: 0 auto; }
/* 1.69: the theme in view decides which logo shows (--logo-std / --logo-alt come from /theme.css). */
.logo-std { display: var(--logo-std, block) !important; }
.logo-alt { display: var(--logo-alt, none) !important; }
.logo-alt:not(.big) { height: 40px; } /* the oval logo reads small at 34px; the narrow side menu still shrinks it */
.logo-vintage { display: var(--logo-vintage, none) !important; } /* 1.345: the Amax vintage logo (1.357: the oval amax security logo) */
.logo-classic { display: var(--logo-classic, none) !important; } /* 1.358: Amax Classic (flat) and Nostalgia (original) logos */
.logo-nostalgia { display: var(--logo-nostalgia, none) !important; }
.logo-vintage:not(.big), .logo-classic:not(.big), .logo-nostalgia:not(.big) { height: 40px; }
.ts-bar .logo-std, .ts-bar .logo-alt, .ts-bar .logo-vintage, .ts-bar .logo-classic, .ts-bar .logo-nostalgia { height: 18px; width: auto; max-width: 60px; object-fit: contain; }
.logo-band { background: var(--navy); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.logo-preview { background: var(--navy); border-radius: 8px; padding: 16px; display: grid; place-items: center; min-height: 90px; margin-bottom: 10px; }
.logo-preview img { max-height: 70px; max-width: 100%; }
.logo { background: var(--accent); color: var(--on-accent); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; }
#nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
#nav a, #nav button { color: var(--on-navy); opacity: .85; text-decoration: none; padding: 8px 10px; border-radius: 8px; background: none; border: 0; font: inherit; cursor: pointer; }
#nav a:hover, #nav button:hover { background: color-mix(in srgb, var(--on-navy) 10%, transparent); opacity: 1; }
#nav a.active { background: color-mix(in srgb, var(--on-navy) 16%, transparent); opacity: 1; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: var(--on-navy); font-size: 1.4rem; cursor: pointer; }
@media (max-width: 1120px) {
  .menu-btn { display: block; }
  #nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px; }
  #nav.open { display: flex; }
  /* 1.71.2: the open menu scrolls on its own when it is taller than the screen (iPhone Safari and the home-screen app),
     the page behind it stays put, and the end of the list clears the floating page button and the home bar. */
  #nav.open { top: 100%; max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.signed-in #nav.open { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  #nav.open a, #nav.open button { flex: none; }
  body.nav-open { overflow: hidden; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h3 { margin-top: 0; }
/* 1.429: :where() keeps this at no weight, so a link card's own layout (.pr-card, .hd-kpi, .rp-card, .bd-card,
   .settings-item, .mm-tpl: flex) wins; before, a.card's display: block outranked them and their lines ran together. */
a.card { text-decoration: none; color: inherit; } :where(a.card) { display: block; } a.card:hover { border-color: var(--link); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile .n { font-size: 1.7rem; font-weight: 700; color: var(--heading); } .tile .l { color: var(--muted); font-size: .85rem; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--navy); background: var(--navy); color: var(--on-navy); padding: 8px 14px; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-2); } .btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--card); color: var(--heading); border-color: color-mix(in srgb, var(--link) 55%, var(--card)); } .btn.secondary:hover { background: var(--soft); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } .btn.accent:hover { background: var(--accent-d); }
.btn.danger { background: var(--card); color: var(--bad); border-color: var(--bad-line); } .btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; background: var(--card); color: inherit; }
textarea { min-height: 180px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); border-color: var(--link); }
.check { display: flex; gap: 8px; align-items: center; font-weight: normal; }
/* 1.429 (John: "this also is off"): the buttons cell never wrapped, so Invite again, Reset password and Leaver side by
   side took the width and squeezed the role cell (its lists cut to "5 · Ma…", its ticks one word a line) and the status
   list down to "A". The buttons now wrap within a sensible width, and the cells with lists keep room for them. */
.acct-table td.acct-actions { white-space: normal; min-width: 140px; max-width: 230px; }
.acct-table td.acct-actions .btn { margin: 0 4px 4px 0; }
.acct-table td.acct-role { min-width: 220px; }
.acct-table td.acct-role .check { white-space: nowrap; }
.acct-table select { min-width: 8.5em; }
.inline-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.auth-wrap { max-width: 420px; margin: 6vh auto; }
.auth-wrap .brand-big { text-align: center; margin-bottom: 18px; }
.auth-wrap .brand-big .logo { width: 54px; height: 54px; font-size: 1.8rem; margin: 0 auto 10px; border-radius: 14px; }

.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.alert.error { background: var(--bad-bg); color: var(--bad); } .alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.info { background: var(--soft); color: var(--link); }

.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--link); font-weight: 600; white-space: nowrap; }
.badge.beginner { background: var(--ok-bg); color: var(--ok); } .badge.intermediate { background: color-mix(in srgb, #1d4ed8 13%, var(--card)); color: color-mix(in srgb, #1d4ed8 55%, var(--text)); }
.badge.advanced { background: var(--warn-bg); color: var(--warn); } .badge.expert { background: var(--bad-bg); color: var(--bad); }
.badge.completed, .badge.active { background: var(--ok-bg); color: var(--ok); } .badge.in_progress, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.rejected, .badge.disabled { background: var(--bad-bg); color: var(--bad); } .badge.draft { background: var(--track); color: var(--muted); }

.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-2)); }
.bar.done > span { background: var(--ok); }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--hover); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--hover); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--heading); border-color: var(--accent); font-weight: 600; }

.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { border-bottom: 1px solid var(--line); }
.lesson-list a { display: flex; gap: 10px; padding: 10px 4px; text-decoration: none; color: inherit; align-items: center; }
.lesson-list a:hover { background: var(--hover); }
.lesson-list .lesson-locked { display: flex; gap: 10px; padding: 10px 4px; align-items: center; color: var(--muted); cursor: not-allowed; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field-line); display: grid; place-items: center; font-size: .8rem; flex: none; }
.tick.on { background: var(--ok); border-color: var(--ok); color: var(--card); }

.prose { line-height: 1.6; } .prose img { max-width: 100%; } .prose pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow: auto; }
.prose code { background: var(--soft); padding: 1px 5px; border-radius: 4px; } .prose pre code { background: none; padding: 0; }
.prose table { border: 1px solid var(--line); } .prose blockquote { border-left: 4px solid var(--accent); margin: 0; padding: 4px 14px; background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.video { position: relative; padding-top: 56.25%; margin: 12px 0; } .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
video { max-width: 100%; border-radius: 8px; }

.question { margin-bottom: 18px; } .question .opt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; font-weight: normal; cursor: pointer; }
.question .opt:hover { background: var(--hover); } .question.right { border-left: 4px solid var(--ok); padding-left: 10px; } .question.wrong { border-left: 4px solid var(--bad); padding-left: 10px; }

.editor-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--card); }
.editor-item summary { cursor: pointer; font-weight: 600; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: var(--on-navy); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 50; max-width: 90vw; }
.toast.error { background: var(--bad); }
.empty { text-align: center; padding: 32px; color: var(--muted); }
.qr { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; width: 200px; }


/* ---------- Home ---------- */
.sections { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.section-icon { font-size: 1.9rem; width: 52px; height: 52px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex: none; }

/* ---------- Compliance ---------- */
.stack > .field { margin-bottom: 0; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 16px; box-shadow: 0 -4px 14px rgba(16,24,40,.08); }
form .sticky-actions, .sticky-actions:not(.card) { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 12px; flex-wrap: wrap; }
[data-save-status].error, .error[data-save-status] { color: var(--bad); }
input[type=date], input[type=search], input[type=time] { width: 100%; padding: 9px 11px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; background: var(--card); color: inherit; }
.stack textarea, .field textarea[data-k], .check-comment { font-family: inherit; }

.photo-strip { display: flex; flex-direction: column; gap: 8px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(17,24,39,.75); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }

.sig { position: relative; border: 1px dashed #b8c2d3; border-radius: 8px; background: #fff; max-width: 520px; touch-action: none; }
.sig canvas { display: block; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #b8c2d3; pointer-events: none; font-size: 1.1rem; }
.sig-clear { position: absolute; right: 8px; top: 6px; }
.sig-current { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.sig-current img { display: block; max-width: 280px; max-height: 80px; }

details.folder { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
details.folder summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600; }
details.folder summary::-webkit-details-marker { display: none; }
details.folder[open] summary { border-bottom: 1px solid var(--line); }
details.folder > :not(summary) { margin-left: 14px; margin-right: 14px; }
.file-list { list-style: none; padding: 0; margin: 8px 0; }
.file-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.file-list li:last-child { border-bottom: 0; }
.file-list a { word-break: break-word; }
.file-actions { white-space: nowrap; }
@media (max-width: 600px) { .file-actions { white-space: normal; } } /* 1.181: an O&M pack file's move, rename and remove links wrap on a phone instead of pushing the page sideways */
.file-actions label.linkbtn { cursor: pointer; display: inline; margin: 0; font-weight: normal; }
.file-list li.folder-form { justify-content: flex-start; align-items: center; }
.file-list li.folder-form .small { margin-left: auto; }
.folder-actions { margin-bottom: 12px; gap: 8px; }
details.folder .new-form { margin-bottom: 12px; background: var(--bg, #f5f7fa); }
.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.video-status { margin: -4px 0 12px; }
.prose video + .video-status { margin-top: 6px; }
.vchip { margin-left: 8px; font-size: .75rem; }
.vc-video .chips, .vc-q .chips { margin: 4px 0 10px; }
.vc-video label.chip-btn { cursor: pointer; font-weight: normal; }

.snag { border-left: 4px solid var(--line); }
.snag:has(.pr-high) { border-left-color: var(--bad); } .snag:has(.pr-medium) { border-left-color: var(--warn); } .snag:has(.pr-low) { border-left-color: var(--ok); }
select.pill { width: auto; border-radius: 99px; padding: 5px 12px; font-weight: 600; font-size: .85rem; }
.pr-high { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.pr-medium { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pr-low { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }

.risk-row { gap: 8px; }
select.score { width: auto; padding: 5px 8px; }
.risk { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 700; font-size: .85rem; }
.risk.low { background: var(--ok-bg); color: var(--ok); } .risk.medium { background: var(--warn-bg); color: var(--warn); } .risk.high { background: var(--bad-bg); color: var(--bad); }
.step { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.step textarea { flex: 1; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--on-navy); display: grid; place-items: center; font-weight: 700; flex: none; margin-top: 6px; }
.step-tools { display: flex; flex-direction: column; gap: 2px; }
.step-tools .linkbtn { text-decoration: none; font-size: 1.1rem; padding: 0 6px; }
.ppe { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; background: var(--card); }
.chip:has(input:checked) { background: var(--soft); border-color: var(--link); color: var(--heading); font-weight: 600; }

.form-heading { margin: 1.2em 0 .2em; padding-bottom: 4px; border-bottom: 2px solid var(--accent); font-size: 1.1rem; }
.form-heading:first-child { margin-top: 0; }
.req { color: var(--bad); margin-left: 3px; }
.check-item { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: center; }
.check-item .check-comment { grid-column: 1 / -1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .9rem; }
.check-q { font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; font-weight: 600; font-size: .9rem; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-left: 1px solid var(--field-line); background: var(--card); color: var(--muted); }
.seg label:first-child span { border-left: 0; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg-yes input:checked + span, .seg-pass input:checked + span { background: var(--ok); color: var(--card); }
.seg-no input:checked + span, .seg-fail input:checked + span { background: var(--bad); color: var(--card); }
.seg-na input:checked + span { background: var(--muted); color: var(--card); }
.seg input:disabled + span { cursor: default; }
#score { font-weight: 600; }

/* ---------- Standards ---------- */
.search-card { margin-bottom: 8px; }
.search-row { display: flex; gap: 10px; margin-bottom: 6px; }
.search-row input { flex: 3; } .search-row select { flex: 2; width: auto; }
.cat-head { color: var(--muted); text-transform: uppercase; font-size: .85rem; letter-spacing: .04em; }
.std-card h3 { margin: 6px 0; } .std-card h3 a { text-decoration: none; color: var(--heading); }
.hit-doc { margin-bottom: 12px; } .hit-doc h3 { margin-bottom: 6px; }
a.hit, button.hit { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
a.hit:hover .hit-text { color: var(--heading); }
.hit-page { flex: none; width: 64px; font-size: .8rem; font-weight: 700; color: var(--link); padding-top: 2px; }
.hit-text { font-size: .92rem; }
mark { background: #ffe58a; color: #1b2333; padding: 0 2px; border-radius: 3px; }

/* ---------- Admin builder ---------- */
.builder-field { margin-bottom: 10px; padding: 12px 14px; }
.builder-field.is-heading { background: var(--soft); border-left: 4px solid var(--accent); }
.builder-field .field { margin-bottom: 8px; }
.builder-field textarea { min-height: 70px; font-family: inherit; }
.builder-field .check { margin-top: 26px; }
.builder-field .field.grow, .inline-fields .field.grow { grid-column: span 2; }
.add-field { gap: 6px; margin: 6px 0 4px; }
.pack-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.pack-row input { flex: 1; }
.folder-icon { font-size: 1.2rem; }


/* ---------- Devices gallery ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-btn { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--text); }
.chip-btn.on { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.g-item { position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--track); cursor: pointer; aspect-ratio: 4 / 3; text-align: left; font: inherit; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-item:hover img { transform: scale(1.03); } .g-item img { transition: transform .2s; }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; display: flex; flex-direction: column; font-size: .85rem; line-height: 1.3; }
.g-cap span { opacity: .85; font-size: .78rem; }
body.no-scroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(10,15,25,.86); display: grid; place-items: center; padding: 16px; }
.lb-inner { background: var(--card); border-radius: var(--radius); width: min(1000px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.lb-close { background: none; border: 0; font-size: 1.3rem; cursor: pointer; padding: 4px 8px; }
.lb-img { position: relative; background: #111; display: grid; place-items: center; min-height: 200px; }
.lb-img img { max-width: 100%; max-height: 65vh; display: block; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #111827; font-size: 1.6rem; cursor: pointer; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
.lb-info { padding: 12px 16px 16px; } .lb-info h3 { margin: 0 0 4px; }
.lb-edit { margin-top: 12px; }
#picked .thumb { width: 84px; height: 84px; }

/* ---------- Admin: backups and job pack ---------- */
.steps { padding-left: 20px; margin: 0; } .steps li { margin-bottom: 6px; }
.pack-group { margin-top: 12px; }
.pack-group .file-list li { align-items: center; }
code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: .85em; word-break: break-word; }
.help-note { background: var(--soft); border-left: 4px solid var(--accent); }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .container { padding: 16px 16px 48px; }
  h1 { font-size: 1.4rem; }
  /* 16px stops iPhones zooming in when a field is tapped */
  input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea { font-size: 16px; }
  .btn { min-height: 44px; justify-content: center; }
  .btn.sm { min-height: 40px; padding: 6px 12px; }
  .linkbtn { padding: 8px 0; }
  .grid, .tiles { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .inline-fields { grid-template-columns: 1fr; }
  .inline-fields .field { max-width: none !important; }
  .row.spread > .row { width: 100%; }
  .question .opt { padding: 12px; }
  .question .opt input { width: 20px; height: 20px; flex: none; }
  input[type=radio], input[type=checkbox] { width: 20px; height: 20px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }
  #nav a, #nav button { padding: 12px 14px; text-align: left; }
  /* UI review (2026-11): Admin → Accounts stacks as cards at phone width; its selects fill the card, tick labels wrap. */
  .acct-table td { flex-wrap: wrap; align-items: flex-start; }
  .acct-table td[data-label]::before { flex: 0 0 100%; }
  .acct-table td > select, .acct-table td > .check { width: 100%; max-width: 100%; }
  .acct-table td > select { min-height: 44px; }
  .acct-table td.acct-role { flex-direction: column; align-items: stretch; gap: 4px; }
  .acct-table td.acct-role::before { flex: none; }
  .acct-table .check { white-space: normal; align-items: flex-start; min-height: 44px; }
  .acct-table td.acct-actions { flex-wrap: wrap; gap: 8px; }
  .acct-table td:empty { display: none; }

  /* Tables become a stack of cards */
  .table-wrap { border: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap table { background: none; }
  .table-wrap thead, .table-wrap tr:has(> th) { display: none; }
  .table-wrap tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 12px; box-shadow: var(--shadow); }
  .table-wrap td { border: 0; padding: 6px 0; display: flex; gap: 12px; align-items: center; min-width: 0 !important; }
  .table-wrap td[data-label]::before { content: attr(data-label); flex: 0 0 38%; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
  .table-wrap td:first-child { font-size: 1.02rem; }
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td > select { flex: 1; }
  .table-wrap td > .bar, .table-wrap td > div { flex: 1; }
  .table-wrap td:empty { display: none; }
  .table-wrap td.right { justify-content: flex-start; }
  .table-wrap td.empty { display: block; }

  .sections { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; } .search-row select { width: 100%; }
  .check-item { grid-template-columns: 1fr; }
  .seg { display: flex; } .seg label { flex: 1; text-align: center; } .seg span { padding: 11px 6px; }
  .thumb { width: calc(33.3% - 6px); height: auto; aspect-ratio: 1; }
  .builder-field .field.grow, .inline-fields .field.grow { grid-column: auto; }
  .pack-row .btn.sm { min-width: 40px; padding: 6px; }
  .sticky-actions { position: static; box-shadow: var(--shadow); }
  .sticky-actions .btn { flex: 1; }
  .sticky-actions [data-save-status] { flex-basis: 100%; order: -1; }
  .builder-field .check { margin-top: 0; }
  .hit-page { width: 52px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .lightbox { padding: 0; }
  .lb-inner { border-radius: 0; height: 100%; }
  .lb-img img { max-height: 55vh; }
}

/* Accounts, email and server */
.temp-pw code.pw { font-size: 1.1rem; background: var(--hover); padding: 4px 8px; border-radius: 6px; letter-spacing: .5px; user-select: all; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 0; width: 38%; vertical-align: top; }
table.kv td { padding: 6px 0; word-break: break-word; }

/* Training structure */
.section-head { margin: 14px 0 8px; font-size: 1rem; color: var(--heading); }
.req-picker { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.req-group { margin-top: 10px; }
.req-list { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.req-list.courses { max-height: 220px; overflow: auto; flex-direction: column; flex-wrap: nowrap; }
.req-opt { font-weight: normal; margin: 0; }
.resume-note { margin: 4px 0 10px; }
.btn.disabled { opacity: .55; pointer-events: none; }

/* Admin → Logs */
pre.log { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--hover); border-radius: 6px; padding: 8px; margin: 6px 0 0; max-height: 320px; overflow: auto; color: var(--text); }
.log-box { font-family: ui-monospace, Consolas, monospace; font-size: 12px; max-height: 420px; overflow: auto; padding: 10px; }
.log-line { white-space: pre-wrap; word-break: break-word; padding: 1px 0; }
.log-line.warn { color: var(--warn); } .log-line.error { color: var(--bad); }
table.mail-log td { vertical-align: top; overflow-wrap: anywhere; }
#logFilter select { width: auto; max-width: 100%; }
.log-line, pre.log { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .table-wrap table.mail-log td:last-child { display: block; }
  .table-wrap table.mail-log td:last-child::before { display: none; }
  .table-wrap table.mail-log td:last-child > * { margin-top: 4px; }
}

/* Home dashboard */
.home-head { margin-bottom: 14px; }
.widgets { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.widget { min-width: 0; grid-column: span var(--cols, 6); position: relative; }
.widget.fixed-h { height: var(--h); display: flex; flex-direction: column; }
.widget.fixed-h .widget-body { flex: 1; min-height: 0; overflow: auto; }
.widget-resize { position: absolute; right: 2px; bottom: 2px; width: 22px; height: 22px; border: 0; background: none; color: var(--muted); cursor: nwse-resize; font-size: .8rem; line-height: 1; padding: 0; opacity: .35; touch-action: none; }
.widget:hover .widget-resize, .widgets.editing .widget-resize, .widget.resizing .widget-resize { opacity: 1; }
.widget.resizing { outline: 2px solid var(--accent); outline-offset: 2px; user-select: none; }
.widget-size-tip { position: absolute; right: 26px; bottom: 4px; background: var(--navy); color: var(--on-navy); font-size: .75rem; padding: 2px 8px; border-radius: 6px; pointer-events: none; }
.w-size { width: auto; padding: 3px 6px; font-size: .82rem; min-height: 0; }
.w-scroll { max-height: 440px; overflow: auto; overscroll-behavior: contain; padding-right: 4px; }
.widget.fixed-h .w-scroll { max-height: none; overflow: visible; }
.widget.size-full { grid-column: span var(--cols, 12); }
.widget-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.widget-head h3 { margin: 0; font-size: 1rem; color: var(--heading); }
.widgets.editing .widget { outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.widget-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn { background: var(--hover); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--text); min-width: 32px; }
.icon-btn:hover:not(:disabled) { background: var(--soft); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.customise-bar { margin-bottom: 14px; border-left: 4px solid var(--accent); }
.w-list { list-style: none; margin: 0; padding: 0; }
.w-list > li { padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.w-list > li:last-child { border-bottom: 0; }
.w-list > li.done > .row a, .w-list > li.done > div > span > a { text-decoration: line-through; color: var(--muted); }
.w-list .bar { margin: 4px 0 2px; }
.w-day + .w-day { margin-top: 8px; }
/* 1.344: My day, the engineer's briefing (public/my-day.js) */
.md-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; }
.md-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 6px 8px; color: var(--muted); font: inherit; cursor: pointer; white-space: nowrap; }
.md-tabs button.active { color: var(--heading); border-color: var(--accent); font-weight: 600; }
.md-summary { background: var(--soft, rgba(127,127,127,.08)); border-radius: 8px; padding: 8px 10px; }
.md-booking details summary { cursor: pointer; }
.md-today > .small:first-child { color: var(--accent); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
a.mini-tile { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); }
a.mini-tile:hover { border-color: var(--accent); background: var(--hover); }
.warn-text { color: var(--warn); font-weight: 600; }
.notify-opt { align-items: flex-start; }
.notify-opt input { margin-top: 3px; }
.pm-pick { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; }
.pm-pick select { width: auto; max-width: 240px; padding: 4px 8px; }

/* Calendar */
.cal-bar { justify-content: space-between; margin: 12px 0 8px; }
.cal-month { min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: .8rem; color: var(--muted); text-align: center; padding: 2px 0; }
.cal-cell { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 96px; padding: 4px; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--text); }
.cal-cell.other { background: var(--hover); opacity: .7; }
.cal-cell.today .cal-num { background: var(--navy); color: var(--on-navy); border-radius: 50%; }
.cal-cell.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.cal-num { font-size: .8rem; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; }
.chip { display: block; font-size: .72rem; line-height: 1.35; padding: 1px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: color-mix(in srgb, #1d4ed8 13%, var(--card)); color: color-mix(in srgb, #1d4ed8 55%, var(--text)); }
.chip.course { background: color-mix(in srgb, #6d28d9 13%, var(--card)); color: color-mix(in srgb, #6d28d9 55%, var(--text)); }
.chip.seen { background: var(--hover); color: var(--muted); }
.chip.late { background: var(--bad-bg); color: var(--bad); }
.chip.done { text-decoration: line-through; opacity: .65; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.cal-legend .chip { display: inline-block; }
.agenda .agenda-day { display: none; }
.agenda .agenda-day.selected { display: block; }
.agenda-day h3 { margin: 0 0 4px; }
.agenda .w-list > li.seen { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.people-pick { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; }
.people-pick .check { margin: 0; padding: 3px 0; }
.edit-dates input { width: auto; }
.menu-table input[type=text] { width: 100%; }
.layout-list li { gap: 8px; }
@media (max-width: 900px) { .widgets { grid-template-columns: 1fr; } .widget, .widget.size-full, .widget-placeholder { grid-column: 1 / -1 !important; } .widget-resize { display: none; } }
@media (max-width: 700px) {
  .cal-grid, .cal-legend { display: none; }
  .agenda .agenda-day { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .agenda .agenda-day.empty-day { display: none; }
  .cal-bar { flex-direction: column; align-items: stretch; }
  .cal-bar > .row { justify-content: space-between; }
  .people-pick { grid-template-columns: 1fr; max-height: 300px; }
  .people-pick .check { padding: 6px 0; }
  .widget-tools .icon-btn { min-height: 36px; min-width: 40px; }
  .pm-pick select { max-width: 60vw; }
  .sp-crumb .crumb-here { display: none; } /* 1.389: the job's name is the heading just below */
}

/* Standards viewer */
.viewer-bar { position: sticky; top: 56px; z-index: 5; padding: 10px 12px; margin-bottom: 12px; }
.viewer-title { gap: 8px; flex-wrap: nowrap; margin-bottom: 8px; }
.viewer-title .clip { flex: 1; min-width: 0; text-align: center; }
.viewer-tools { gap: 8px; justify-content: space-between; }
.page-of { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.page-of input { width: 64px; padding: 4px 6px; text-align: center; }
.viewer-hits { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.hit-list { max-height: 45vh; overflow: auto; margin-top: 6px; }
button.hit { width: 100%; background: none; border: 0; text-align: left; font: inherit; cursor: pointer; color: inherit; }
button.hit.active { background: var(--soft); }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; overflow-x: auto; }
.pdf-page { position: relative; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); flex: none; max-width: none; }
.pdf-page canvas { width: 100%; height: 100%; display: block; }
.pdf-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #c4cad4; font-size: 2rem; }
.pdf-page canvas + .pdf-num, .pdf-page canvas ~ .pdf-num { display: none; }
.hl { position: absolute; background: rgba(255, 213, 0, .45); mix-blend-mode: multiply; border-radius: 2px; pointer-events: none; }
.text-doc .text-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; margin: 0; }
@media (max-width: 1120px) { .viewer-bar { top: 56px; } }
@media (max-width: 700px) {
  .viewer-bar { margin-left: -12px; margin-right: -12px; border-radius: 0; padding: 8px 12px; }
  .viewer-title > span:first-child { display: none; }
  .viewer-tools > .row { width: 100%; justify-content: space-between; }
  .pdf-pages { gap: 8px; }
}

/* Dragging home page boxes */
.drag-handle { background: none; border: 0; cursor: grab; color: var(--muted); font-size: 1.05rem; line-height: 1; padding: 4px 6px 4px 0; margin-right: 2px; touch-action: none; user-select: none; vertical-align: -1px; }
.drag-handle:hover { color: var(--heading); }
.widget.dragging { box-shadow: 0 12px 30px rgba(16, 24, 40, .25); opacity: .95; cursor: grabbing; }
.widget-placeholder { border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.widget-placeholder { grid-column: span var(--cols, 6); }
body:has(.widget.dragging) { user-select: none; }
@media (max-width: 700px) { .drag-handle { padding: 8px 10px 8px 0; font-size: 1.2rem; } }

/* Calendar events and company news */
.chip.ev { background: color-mix(in srgb, #0b5cad 13%, var(--card)); color: color-mix(in srgb, #0b5cad 55%, var(--text)); }
.chip.ev.people { background: color-mix(in srgb, #0f7a4a 13%, var(--card)); color: color-mix(in srgb, #0f7a4a 55%, var(--text)); }
.chip.ev.company { background: color-mix(in srgb, #c27a00 16%, var(--card)); color: color-mix(in srgb, #c27a00 55%, var(--text)); font-weight: 600; }
.event-item.focus { background: color-mix(in srgb, var(--warn) 10%, var(--card)); box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.remind-pick .check { margin: 0; }
.news-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.news-post h3 { font-size: 1.1rem; }
.news-post.pinned h3 { color: var(--heading); }
.news-body { margin-top: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.news-body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: .92rem; }
.news-widget .news-post + .news-post { border-top: 1px solid var(--line); padding-top: 10px; }
.news-widget .news-post h3 { font-size: 1rem; }
@media (max-width: 700px) { .news-layout { grid-template-columns: 1fr; } }
.q-with-photos .q-photos { margin: -4px 0 10px; }
.log-line .lvl { font-size: .72rem; letter-spacing: .03em; color: var(--muted); }
.log-line.warn .lvl, .log-line.error .lvl { color: inherit; }
.log-line.activity .lvl { color: var(--link); }
.activity-log { max-height: 420px; overflow: auto; }
.visit-kinds .btn { flex: 1 1 160px; }
.pct input { display: inline-block; }

/* One floating button that opens to Back / Home / top / bottom and the assistant (1.25) */
.page-nav { position: fixed; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 41; width: 50px; height: 50px; }
.page-nav .pn-main { width: 50px; height: 50px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--navy); color: var(--on-navy);
  font-size: 1.3rem; line-height: 1; display: grid; place-items: center; box-shadow: 0 4px 16px rgba(16,24,40,.28); user-select: none; -webkit-tap-highlight-color: transparent; }
.page-nav .pn-main:hover, .page-nav.open .pn-main { filter: brightness(1.15); }
.page-nav .pn-main, .pn-tools > .ai-fab { outline: 2px solid color-mix(in srgb, var(--on-navy) 70%, transparent); outline-offset: -2px; }
.pn-dots { width: 6px; height: 6px; border-radius: 50%; background: currentColor; transform: translate(-5px, -5px); box-shadow: 10px 0 currentColor, 0 10px currentColor, 10px 10px currentColor; }
.pn-x::before { content: '✕'; }
.pn-tools { position: absolute; left: 50%; bottom: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 8px;
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px); transition: opacity .15s .25s, transform .15s .25s, visibility 0s linear .4s; }
.page-nav.pn-down .pn-tools { bottom: auto; top: 100%; flex-direction: column-reverse; padding: 8px 0 0; transform: translate(-50%, -8px); }
.page-nav.open .pn-tools, .page-nav:has(:focus-visible) .pn-tools { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .15s, transform .15s, visibility 0s; }
@media (hover: hover) and (pointer: fine) { .page-nav:not(.float-dragging):hover .pn-tools { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .15s, transform .15s, visibility 0s; } }
.pn-tools > * { width: 42px; height: 42px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--link) 30%, var(--card)); background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--heading); font-size: 1.15rem; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; text-decoration: none; padding: 0; backdrop-filter: blur(4px); flex: none; }
.pn-tools > [hidden] { display: none; }
.pn-tools [data-pn="back"] { font-size: 1.6rem; padding-bottom: 3px; }
.pn-tools > *:hover { background: var(--navy); color: var(--on-navy); }
.pn-tools button:disabled { opacity: .35; cursor: default; background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--heading); }
.pn-tools .current { opacity: .35; pointer-events: none; }
.page-nav.float-moved { right: auto; bottom: auto; }
.float-dragging, .float-dragging .pn-main { cursor: grabbing; opacity: .85; }
@media (max-width: 700px) {
  .page-nav { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .pn-tools > * { width: 46px; height: 46px; }
  .container { padding-bottom: 76px; }
  .toast { bottom: 76px; }
}
@media print { .page-nav { display: none !important; } }

/* Job timeline (Gantt chart) */
.chip.task { background: color-mix(in srgb, #17603f 13%, var(--card)); color: color-mix(in srgb, #17603f 55%, var(--text)); }
.chip.task.ms { background: color-mix(in srgb, #6b21a8 13%, var(--card)); color: color-mix(in srgb, #6b21a8 55%, var(--text)); font-weight: 600; }
.badge.overdue { background: var(--bad-bg); color: var(--bad); }
.gantt-tools { margin-bottom: 10px; }
.job-dates input[type=date] { width: auto; padding: 5px 8px; }
.seg-btns { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btns button { border: 0; background: var(--card); padding: 6px 10px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--text); }
.seg-btns button + button { border-left: 1px solid var(--line); }
.seg-btns button.on { background: var(--navy); color: var(--on-navy); }
.gantt { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; --row: 38px; }
.g-names { border-right: 1px solid var(--line); background: var(--hover); position: relative; z-index: 2; }
.g-head-cell { height: 46px; border-bottom: 1px solid var(--line); padding: 14px 10px 0; font-weight: 600; font-size: .85rem; }
.g-name { height: var(--row); padding: 3px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; line-height: 1.2; overflow: hidden; cursor: pointer; }
.g-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-name > span:first-child { font-size: .88rem; }
.g-name.mine { background: var(--soft); }
.g-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.g-canvas { position: relative; min-height: 100%; }
.g-months, .g-ticks { position: relative; height: 23px; border-bottom: 1px solid var(--line); font-size: .74rem; color: var(--muted); }
.g-months span { position: absolute; top: 3px; padding-left: 4px; border-left: 1px solid var(--line); white-space: nowrap; font-weight: 600; color: var(--text); }
.g-ticks span { position: absolute; top: 3px; text-align: center; border-left: 1px solid var(--line); }
.g-ticks span.we { background: var(--hover); }
.g-body { position: relative; }
.g-we { position: absolute; top: 0; bottom: 0; width: var(--gw); background: var(--hover); }
.g-row { position: relative; height: var(--row); border-bottom: 1px solid var(--line); }
.g-bar { position: absolute; top: 8px; height: 22px; border-radius: 6px; background: color-mix(in srgb, #1f7fd1 25%, var(--card)); border: 1px solid color-mix(in srgb, #1f7fd1 50%, var(--card)); overflow: hidden; touch-action: pan-y; }
.g-bar.movable { cursor: grab; }
.g-bar.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 2px 10px rgba(0,0,0,.2); z-index: 3; }
.g-bar.done { background: color-mix(in srgb, var(--ok) 22%, var(--card)); border-color: var(--ok-line); }
.g-bar.late { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 20%, var(--card)); }
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy); opacity: .55; }
.g-bar.done .g-fill { background: var(--ok); }
.g-in { position: relative; font-size: .72rem; padding: 0 6px; line-height: 20px; color: var(--text); font-weight: 600; }
.g-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; cursor: ew-resize; background: linear-gradient(90deg, transparent, rgba(0,0,0,.12)); }
.g-ms { position: absolute; top: 10px; width: 18px; height: 18px; background: #7c3aed; transform: rotate(45deg); border-radius: 3px; cursor: pointer; touch-action: pan-y; }
.g-ms.done { background: var(--ok); } .g-ms.late { background: var(--bad); }
.g-label { position: absolute; top: 10px; font-size: .76rem; color: var(--muted); white-space: nowrap; pointer-events: none; }
.g-line { position: absolute; top: -46px; bottom: 0; width: 0; border-left: 2px dashed var(--muted); z-index: 1; pointer-events: none; }
.g-line span { position: absolute; top: 2px; left: 3px; font-size: .68rem; background: var(--card); padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.g-line.today { border-left: 2px solid var(--bad); } .g-line.today span { color: var(--bad); top: 24px; }
.g-line.start, .g-line.end { border-left-color: var(--ok); } .g-line.start span, .g-line.end span { color: var(--ok); font-weight: 600; }
.task-table select { width: auto; padding: 4px 6px; }
.task-form { margin-bottom: 12px; }
@media (max-width: 700px) {
  .gantt { grid-template-columns: 112px 1fr; }
  .g-name { padding: 3px 6px; } .g-name > span:last-child { display: none; }
  .gantt-tools .job-dates { width: 100%; }
}

/* Laid-out news posts */
.news-body.clamp:has(.nb) { display: block; -webkit-line-clamp: unset; max-height: 260px; -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.nb > * { margin: 0 0 12px; }
.nb-heading { font-size: 1.15rem; margin: 16px 0 8px !important; clear: both; }
.nb-text p { margin: 0 0 8px; } .nb-text ul, .nb-text ol { margin: 0 0 8px; padding-left: 22px; } .nb-text h3 { margin: 10px 0 6px; }
.nb-divider { border: 0; border-top: 1px solid var(--line); clear: both; }
.nb-clear { clear: both; margin: 0 !important; }
.nb-image figure { margin: 0; }
.nb-image img { display: block; width: 100%; border-radius: 8px; background: var(--hover); }
.nb-image figcaption, .nb-video figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.nb-image.left { float: left; width: 42%; margin: 4px 16px 10px 0; }
.nb-image.right { float: right; width: 42%; margin: 4px 0 10px 16px; }
.nb-image.left figure + figure, .nb-image.right figure + figure { margin-top: 8px; }
.nb-image.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.nb-image.grid img { aspect-ratio: 4 / 3; object-fit: cover; }
.nb-video { margin: 0 0 12px; clear: both; } .nb-video video { width: 100%; border-radius: 8px; background: #000; max-height: 70vh; }
.nb-card { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; text-decoration: none; color: var(--text); background: var(--hover); clear: both; }
.nb-card:hover { background: var(--soft); }
.nb-button { text-decoration: none; }
.news-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.news-preview { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.block-ed { padding: 10px 12px; } .block-ed > * + * { margin-top: 8px; }
.block-head { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.add-block { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.nb-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.nb-thumb { display: flex; flex-direction: column; gap: 4px; } .nb-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.nb-thumb input { font-size: .82rem; padding: 4px 6px; }
@media (max-width: 900px) { .news-editor { grid-template-columns: 1fr; } .news-preview { position: static; max-height: none; } }
@media (max-width: 700px) { .nb-image.left, .nb-image.right { float: none; width: 100%; margin: 0 0 12px; } }
.import-box { border-style: dashed; background: var(--hover); margin-bottom: 12px; }
.import-box.compact { padding: 10px 14px; }

/* Drawings viewer */
.dw-open #app.container { max-width: none; padding-bottom: 12px; }
.dw-open .pn-tools [data-pn="top"], .dw-open .pn-tools [data-pn="bottom"] { display: none; }
.dw { display: flex; flex-direction: column; gap: 10px; height: calc(100dvh - 56px - 32px); min-height: 480px; }
.dw-top { padding: 8px 12px; }
.dw-top > * + * { margin-top: 8px; }
.dw-tools { gap: 4px; }
.dw-tool { min-width: 38px; height: 36px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; font-size: 1.05rem; cursor: pointer; }
.dw-tool.on { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.dw-colour { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.dw-colour.on { box-shadow: 0 0 0 2px var(--navy); }
.dw-tools select { width: auto; padding: 5px 8px; }
.dw-sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.dw-syms { gap: 4px; }
.dw-sym { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 2px 8px 2px 4px; cursor: pointer; color: #e11d48; }
.dw-sym span { color: var(--text); } .dw-sym.on { border-color: var(--heading); box-shadow: 0 0 0 1px var(--heading); }
.dw-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 10px; }
.dw-wrap { position: relative; overflow: hidden; background: #5f6b7d; border-radius: var(--radius); touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.dw-wrap[data-tool="pan"] { cursor: grab; } .dw-wrap[data-tool="pan"]:active { cursor: grabbing; } .dw-wrap[data-tool="select"] { cursor: default; } .dw-wrap[data-tool="erase"] { cursor: not-allowed; } .dw-wrap[data-tool="pin"] { cursor: copy; }
.dw-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.dw-stage canvas { display: block; background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.35); }
.dw-stage svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.dw-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 600; }
.dw-side { overflow: auto; padding: 12px 14px; }
.dw-comments { padding-left: 22px; margin: 0; } .dw-comments li { margin-bottom: 8px; } .dw-comments textarea { min-height: 50px; font-size: .88rem; }
.dw-pick { display: flex; flex-direction: column; gap: 8px; }
.dw-pick input { margin: 0; }
.subfolder { margin: 8px 0 0 18px; }
.loc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 8px; }
.loc-item { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--hover); }
.loc-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; display: block; margin-bottom: 4px; }
.loc-picker { margin-top: 8px; }
@media (max-width: 900px) {
  .dw { height: auto; }
  .dw-main { grid-template-columns: 1fr; }
  .dw-wrap { height: 68dvh; }
  .dw-side { max-height: none; }
}
/* Lesson videos above or below the text (1.6.0) */
.lesson-videos { margin: 12px 0; } .lesson-videos video { display: block; width: 100%; margin-top: 12px; }
.lesson-videos .video-status { margin-top: 6px; }
/* Drag and drop uploads */
.drop-over { outline: 2px dashed var(--accent, #1f7fd1); outline-offset: 3px; background-color: color-mix(in srgb, var(--accent, #1f7fd1) 7%, transparent) !important; }
.drop-hint { display: none; }
.can-drop .drop-hint { display: inline; }
/* Table questions (asset register, device list): a scrolling grid on computers, a card per row on phones */
@media (min-width: 701px) {
  .form-table td { padding: 4px 6px; vertical-align: middle; }
  .form-table td input, .form-table td select { min-width: 130px; margin: 0; }
  .form-table td input[type=number] { min-width: 80px; }
  .form-table td input[type=date] { min-width: 150px; }
}

/* 1.9.0: questions side by side, audit types menu, RAMS editor, software and devices tabs */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 14px; row-gap: 10px; align-items: start; }
.form-grid > .fcell { grid-column: span var(--span, 12); min-width: 0; }
.form-grid > .fcell > .field { margin-bottom: 0; }
.form-grid > .fcell.part > .check-item { grid-template-columns: 1fr; }
.qref { display: inline-block; min-width: 2.2em; font-weight: 700; color: var(--heading); }
.radio-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.radio-list .check { font-weight: normal; align-items: flex-start; }
.side-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.side-menu { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; position: sticky; top: 76px; }
.side-menu a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.side-menu a:hover { background: var(--hover); }
.side-menu a.active { background: var(--navy); color: var(--on-navy); }
.side-menu a.active .badge { background: rgba(255,255,255,.2); color: inherit; }
.side-menu-title { padding: 4px 10px 6px; text-transform: uppercase; letter-spacing: .04em; }
.side-menu .side-menu-manage { color: var(--muted); margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 10px; }
a.audit-type-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
a.audit-type-card:hover { border-color: var(--accent); }
.audit-type-row { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rams-sec { margin-top: 18px; }
.rams-sec > h2 { display: flex; gap: 10px; align-items: baseline; font-size: 1.1rem; background: var(--soft); padding: 8px 12px; border-radius: 8px; margin: 0 0 10px; }
.rams-sec > h2 .num { color: var(--heading); min-width: 2.4em; }
.rams-rows .field { display: grid; grid-template-columns: 52px 210px minmax(0, 1fr); gap: 8px; align-items: start; margin-bottom: 8px; }
.rams-rows .field > .num { color: var(--muted); font-weight: 600; padding-top: 8px; }
.rams-rows .field > label { padding-top: 8px; margin: 0; }
.rams-rows textarea { min-height: 44px; font-family: inherit; }
.rams-rev { border-left: 4px solid var(--accent); }
.annex-list { list-style: none; padding: 0; margin: 0; }
.annex-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sig-typed { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.25rem; }
.lib-tabs { margin-bottom: 12px; }
@media (max-width: 700px) {
  .form-grid > .fcell { grid-column: 1 / -1; }
  .side-layout { grid-template-columns: 1fr; }
  .side-menu { flex-direction: row; overflow-x: auto; position: static; padding: 6px; scrollbar-width: thin; }
  .side-menu a { white-space: nowrap; flex: 0 0 auto; }
  .side-menu-title { display: none; }
  .side-menu .side-menu-manage { margin: 0; border: 0; padding-top: 8px; }
  .rams-rows .field { grid-template-columns: 40px minmax(0, 1fr); }
  .rams-rows .field > :last-child { grid-column: 1 / -1; }
}
.lib-tab-row { gap: 10px; flex-wrap: nowrap; }
.lib-tab-row > span { flex: 0 0 34%; }
.lib-tab-row input[type=text] { flex: 1; min-width: 0; }
@media (max-width: 640px) { .lib-tab-row { flex-wrap: wrap; } .lib-tab-row > span { flex-basis: 100%; } }
.rams-sec textarea { min-height: 56px; field-sizing: content; max-height: 70vh; }
/* ---------- Themes ---------- */
.seg-pick { flex-wrap: wrap; }
.seg-pick input:checked + span { background: var(--navy); color: var(--on-navy); }
.theme-sample { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: .85rem; pointer-events: none; }
.ts-bar { background: var(--navy); color: var(--on-navy); padding: 7px 10px; display: flex; gap: 12px; align-items: center; }
.ts-bar span { opacity: .8; }
.ts-body { padding: 10px; }
.ts-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; box-shadow: var(--shadow); }
/* My account → Appearance: pick your own light and dark themes */
.theme-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 8px; }
.theme-pick { position: relative; cursor: pointer; display: block; }
.theme-pick input { position: absolute; opacity: 0; pointer-events: none; }
.theme-mini { display: block; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; padding: 0 0 8px; }
.theme-pick { border-radius: 12px; }
.theme-pick:has(input:checked) { outline: 3px solid var(--link); outline-offset: 2px; }
.theme-pick:has(input:checked)::after { content: '✓'; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--link); color: var(--card); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.theme-pick:has(input:focus-visible) { outline: 3px dashed var(--link); outline-offset: 2px; }
.tm-bar { display: block; height: 14px; background: var(--navy); }
.tm-card { display: block; margin: 8px 8px 0; padding: 6px 8px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font-size: .8rem; }
.tm-card b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-line { display: block; height: 5px; width: 70%; margin: 9px 0 8px; border-radius: 3px; background: var(--muted); opacity: .5; }
.tm-tag { display: inline-block; margin: 3px 0 4px; padding: 0 6px; border-radius: 6px; font-size: .7rem; background: var(--soft, var(--bg)); color: var(--muted); border: 1px solid var(--line); }
.tm-btn { display: block; width: 38px; height: 10px; border-radius: 4px; background: var(--navy); margin-right: 4px; }

/* Maxi, the assistant (its button sits in the floating page button) */
.pn-tools > .ai-fab { background: var(--navy); color: var(--on-navy); border: 0; font-size: 1.2rem; display: grid; place-items: center; padding: 0; }
.maxi-icon { display: block; }
.maxi-badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--on-navy) 16%, transparent); flex: none; }
.pn-tools > .ai-fab:hover, .pn-tools > .ai-fab.on { background: var(--navy); filter: brightness(1.15); }
.ai-panel { position: fixed; right: 72px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 45; width: min(420px, calc(100vw - 96px)); height: min(640px, calc(100dvh - 90px));
  display: flex; flex-direction: column; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(16,24,40,.28); overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--navy); color: var(--on-navy); }
.ai-head > div { flex: 1; min-width: 0; } .ai-head .small { opacity: .8; }
.ai-icon { background: transparent; border: 0; color: inherit; font-size: 1.1rem; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; }
.ai-icon:hover { background: rgba(255,255,255,.15); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-msg.me { align-self: flex-end; background: var(--navy); color: var(--on-navy); white-space: pre-wrap; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.ai-msg.bot > :first-child { margin-top: 0; } .ai-msg.bot > :last-child { margin-bottom: 0; }
.ai-msg.bot p, .ai-msg.bot ul, .ai-msg.bot ol { margin: 6px 0; } .ai-msg.bot ul, .ai-msg.bot ol { padding-left: 20px; }
.ai-msg.bot h1, .ai-msg.bot h2, .ai-msg.bot h3, .ai-msg.bot h4 { font-size: 1rem; margin: 10px 0 4px; }
.ai-msg.bot table { font-size: .85rem; } .ai-msg.bot pre { white-space: pre-wrap; }
.ai-msg.err { align-self: flex-start; background: var(--bad-bg); color: var(--bad); }
.ai-srcs { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-srcs .small { width: 100%; }
.ai-src { display: inline-block; max-width: 100%; padding: 3px 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.ai-meta { margin-top: 6px; }
/* 1.428: 👍 / 👎 under Maxi's answers, the AI allowance meter, bug reports (public/assistant.js, ai-feedback.js, bug-reports.js) */
.ai-rate { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.ai-msg.bot > .ai-rate { display: flex; margin: 6px 0 0; }
.ai-rate .ai-icon { font-size: .95rem; padding: 2px 6px; color: inherit; }
.ai-rate-note { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ai-rate-note textarea { width: 100%; }
.ai-meter { display: flex; align-items: center; gap: 8px; padding: 4px 12px; background: var(--soft); flex-wrap: wrap; }
.ai-meter-bar { flex: 1 1 80px; min-width: 60px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ai-meter-bar > span { display: block; height: 100%; background: var(--ok, var(--link)); }
.ai-meter.lvl-near .ai-meter-bar > span { background: var(--warn, #b26a00); }
.ai-meter.lvl-high .ai-meter-bar > span, .ai-meter.lvl-used_up .ai-meter-bar > span { background: var(--bad); }
.bug-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bug-shot { max-width: 100%; max-height: 320px; border: 1px solid var(--line); border-radius: 6px; }
.bug-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.bug-dialog textarea, .bug-form textarea { width: 100%; }
.eh-rate { margin-left: 6px; }
.ai-hello p { margin: 0 0 10px; color: var(--muted); }
.ai-idea { display: block; width: 100%; text-align: left; margin-bottom: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--link); cursor: pointer; font: inherit; }
.ai-idea:hover { background: var(--hover); }
.ai-wait { display: flex; gap: 4px; padding: 12px 14px; }
.ai-wait span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ai-dot 1s infinite ease-in-out; }
.ai-wait span:nth-child(2) { animation-delay: .15s; } .ai-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.ai-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; font: inherit; }
.ai-form .btn { height: 40px; padding: 0 14px; }
@media (max-width: 700px) {
  .ai-panel { left: 0; right: 0; bottom: 0; top: 0; width: auto; height: auto; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  .ai-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .ai-open .page-nav { display: none; }
}
@media print { .ai-panel { display: none !important; } }

/* ---------- Round 15: page setup, layout blocks, job details, idle timer, AI keys ---------- */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; flex: none; }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .status-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.keys-table td { vertical-align: middle; } .keys-table td:last-child { white-space: nowrap; text-align: right; }
.keys-table code, .keys-table td:nth-child(3) { font-size: .82rem; white-space: nowrap; }
@media (min-width: 900px) { .keys-table td:last-child .row { flex-wrap: nowrap; } }

.job-info { display: grid; gap: 14px 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); position: relative; margin-bottom: 12px; }
.job-info.empty-info { display: block; }
.ji-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.ji-address, .ji-text { white-space: pre-line; }
.ji-contacts { list-style: none; margin: 0; padding: 0; } .ji-contacts li + li { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.ji-notes { grid-column: 1 / -1; } .ji-notes .ji-text { background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.contact-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.contact-row { grid-template-columns: 1.2fr 1fr 1fr 1.3fr auto; gap: 6px; align-items: center; }
@media (max-width: 700px) { .contact-row { grid-template-columns: 1fr 1fr; } }

.idle-warn { position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, #000 45%, transparent); display: grid; place-items: center; padding: 16px; }
.idle-warn .card { max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.idle-warn h3 { margin-top: 0; color: var(--heading); }
.idle-admin select, #idleBox select { max-width: 260px; }

.page-setup { display: flex; gap: 16px; align-items: center; }
.page-setup .grow { flex: 1; }
.page-shape { position: relative; flex: none; width: 45px; height: 64px; background: var(--card); border: 1px solid var(--field-line); border-radius: 3px; box-shadow: var(--shadow); transition: width .2s, height .2s; }
.page-shape span { position: absolute; inset: 5px; background: repeating-linear-gradient(var(--track) 0 2px, transparent 2px 6px); border-radius: 1px; }
.page-setup-card summary { cursor: pointer; }
.page-setup-card[open] summary { margin-bottom: 10px; }
@media (max-width: 600px) { .page-setup { align-items: flex-start; } }

.builder-field.is-sub { border-left-width: 2px; background: color-mix(in srgb, var(--link) 5%, var(--card)); }
.builder-field.is-info { border-left: 4px solid var(--link); }
.builder-field.is-break { background: var(--hover); border-style: dashed; }
.page-break-line { border-top: 2px dashed var(--field-line); padding-top: 6px; color: var(--muted); font-size: .85rem; text-align: center; }
.form-subheading { margin: 1em 0 .2em; font-size: 1rem; color: var(--heading); }
.form-info { border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; white-space: pre-line; }
.form-info.note { background: var(--soft); border-left: 4px solid var(--link); }
.form-info.warning { background: var(--warn-bg); border-left: 4px solid var(--warn); }
.form-info.plain { padding: 0; }
.form-pagebreak { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.form-pagebreak::before, .form-pagebreak::after { content: ''; flex: 1; border-top: 2px dashed var(--line); }

/* ---------- Device plans ---------- */
.dp-plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dp-plan { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; background: var(--card); }
.dp-plan:hover { border-color: var(--link); box-shadow: var(--shadow); }
.dp-thumb { height: 140px; background: #e8ecf2; display: grid; place-items: center; font-size: 2rem; overflow: hidden; }
.dp-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.dp-plan-body { padding: 10px 12px; min-width: 0; }
.dp-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dp-count { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; background: var(--hover); border-radius: 99px; padding: 1px 8px; }
.dp-count i, .dp-leg-status i, .dp-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dp-import { background: var(--hover); }
.dp-icon { flex: none; vertical-align: middle; }
.dw-tool.dp-add-tool { padding: 0 10px; font-size: .9rem; font-weight: 600; }
.dw-wrap[data-tool="add"] { cursor: copy; }
.dp-status-pick { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.dp-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 99px; padding: 4px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
.dp-chip i { background: var(--c); }
.dp-chip.on { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); font-weight: 600; }
.dp-export { margin-top: 8px; background: var(--hover); }
.dp-side h3 { font-size: .95rem; margin: 14px 0 6px; }
.dp-editor { padding: 12px; border-color: var(--link); background: var(--soft); }
.dp-editor .field { margin-bottom: 8px; } .dp-editor textarea { min-height: 54px; font-family: inherit; }
.dp-editor b .dp-icon { margin-right: 4px; }
.dp-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-seg label { margin: 0; font-weight: normal; font-size: .85rem; }
.dp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.dp-seg span { display: inline-block; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.dp-seg span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 5px; }
.dp-seg input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.dp-seg input:checked + span::before { background: #fff; }
.dp-seg input:focus-visible + span { outline: 2px solid var(--focus); }
.dp-legend { display: flex; flex-direction: column; gap: 3px; }
.dp-legend.types { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.dp-leg-status { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid transparent; background: none; color: var(--text); font: inherit; font-size: .9rem; padding: 4px 6px; border-radius: 6px; cursor: pointer; text-align: left; }
.dp-leg-status:hover { background: var(--hover); } .dp-leg-status.on { border-color: var(--link); background: var(--soft); }
.dp-leg-status i { width: 14px; height: 14px; }
.dp-leg-status b, .dp-leg-type b { margin-left: auto; font-size: .8rem; color: var(--muted); }
.dp-leg-type { display: flex; align-items: center; gap: 6px; font-size: .83rem; min-width: 0; }
.dp-leg-type span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-leg-edit input[type=color] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.dp-leg-edit input[type=text], .dp-leg-edit select { padding: 5px 8px; }
.dp-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.dp-list li button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 6px 4px; font: inherit; font-size: .88rem; color: var(--text); cursor: pointer; text-align: left; }
.dp-list li button .clip { flex: 1; min-width: 0; }
.dp-list li button:hover { background: var(--hover); } .dp-list li.on button { background: var(--soft); }
.dp-side input[type=range] { width: 100%; }
@media (max-width: 900px) { .dp .dw-tools { gap: 6px; } }

/* ---------- Layout: side menu and app bar (after 2N Access Commander) ----------
   Wide screens get a navy menu down the left with icons, which can be narrowed to the icons alone,
   and a light bar along the top saying where you are and who is signed in. Tablets (1.38) get the same menu as icons,
   which opens over the page; phones keep the top bar and drawer, with the light bar under it. */
.nav-icon { flex: none; display: block; }
#nav a, #nav button { display: flex; align-items: center; gap: 10px; }
.side-collapse { display: none; }
.appbar { display: none; }
@media (max-width: 1120px) { #nav .nav-icon { opacity: .9; } }
@media (min-width: 701px) {
  body.signed-in { --side: 236px; padding-left: var(--side); }
  body.signed-in.side-mini, body.signed-in.dw-open { --side: 68px; }
  body.signed-in .topbar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); flex-direction: column; align-items: stretch; gap: 0; padding: 0;
    overflow-y: auto; overflow-x: hidden; z-index: 30; box-shadow: 1px 0 0 color-mix(in srgb, #000 12%, transparent); transition: width .18s; }
  body.signed-in .brand { padding: 16px 18px 14px; min-height: 64px; border-bottom: 1px solid color-mix(in srgb, var(--on-navy) 12%, transparent); }
  body.signed-in .brand span { overflow: hidden; text-overflow: ellipsis; }
  body.signed-in .menu-btn { display: none; }
  body.signed-in #nav { display: flex; position: static; background: none; flex-direction: column; flex-wrap: nowrap; align-items: stretch; margin: 0; padding: 10px 0; gap: 2px; flex: 1; }
  body.signed-in #nav a, body.signed-in #nav button { border-radius: 0; padding: 10px 22px; opacity: .78; position: relative; white-space: nowrap; font-size: .93rem; text-align: left; }
  body.signed-in #nav a:hover, body.signed-in #nav button:hover { opacity: 1; background: color-mix(in srgb, var(--on-navy) 8%, transparent); }
  body.signed-in #nav a.active { opacity: 1; font-weight: 600; background: color-mix(in srgb, var(--on-navy) 14%, transparent); }
  body.signed-in #nav a.active::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 0 3px 3px 0; background: var(--accent); }
  body.signed-in #logoutBtn { margin-top: auto; border-top: 1px solid color-mix(in srgb, var(--on-navy) 12%, transparent) !important; padding-top: 14px !important; }
/* 1.429: Report a problem and Request a feature or change sit at the foot with Sign out (public/app.js renderNav). */
body.signed-in #nav .nav-report[data-bug-open="bug"] { margin-top: auto; border-top: 1px solid color-mix(in srgb, var(--on-navy) 12%, transparent); padding-top: 12px; }
body.signed-in #nav .nav-report ~ #logoutBtn { margin-top: 0; }
body.signed-in #nav .nav-report > span { white-space: normal; line-height: 1.25; }
  body.signed-in .side-collapse { display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--on-navy); opacity: .6; padding: 10px; cursor: pointer;
    border-top: 1px solid color-mix(in srgb, var(--on-navy) 12%, transparent); }
  body.signed-in .side-collapse:hover { opacity: 1; }
  body.side-mini .side-collapse svg, body.dw-open .side-collapse svg { transform: scaleX(-1); }
  body.side-mini #nav a > span, body.side-mini #nav button > span, body.dw-open #nav a > span, body.dw-open #nav button > span,
  body.side-mini .brand span, body.dw-open .brand span { display: none; }
  body.side-mini #nav a, body.side-mini #nav button, body.dw-open #nav a, body.dw-open #nav button { justify-content: center; padding: 11px 0; }
  body.side-mini .brand, body.dw-open .brand { padding: 14px 6px; justify-content: center; }
  body.side-mini .brand-logo, body.dw-open .brand-logo { max-width: 54px; height: 26px; }
  body.dw-open .side-collapse { display: none; }
  body.signed-in .appbar:not([hidden]) { display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 24px;
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .appbar-title { flex: 1; min-width: 0; font-weight: 700; color: var(--heading); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.signed-in .container { max-width: 1240px; padding: 22px 28px 60px; }
}
/* Tablets: the menu stays as icons beside the page, and the arrow at its foot opens it over the page. */
@media (min-width: 701px) and (max-width: 1120px) {
  body.signed-in.side-peek { padding-left: 68px; }
  body.signed-in.side-peek .topbar { z-index: 60; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .35); }
  body.signed-in .appbar:not([hidden]) { padding: 0 18px; gap: 12px; }
  body.signed-in .container { padding: 18px 18px 60px; }
}
/* Phones: the light bar under the top bar says where you are and who is signed in. */
@media (max-width: 700px) {
  body.signed-in .appbar:not([hidden]) { display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-height: 44px;
    background: var(--card); border-bottom: 1px solid var(--line); }
  .appbar-title { flex: 1; min-width: 0; font-weight: 700; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .appbar .help-btn, .appbar .user-chip .who { display: none; }
  .appbar .user-chip { padding: 0; }
  .appbar .user-chip .avatar { width: 30px; height: 30px; font-size: .78rem; }
  body.dw-open .appbar:not([hidden]) { display: none; } /* the drawing editors need the whole screen */
}
.user-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid transparent; }
.user-chip:hover { border-color: var(--line); background: var(--hover); }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.user-chip .who { display: flex; flex-direction: column; line-height: 1.2; } .user-chip .who b { font-size: .9rem; } .user-chip .who span { font-size: .75rem; color: var(--muted); }

/* Cards, tiles and tables: flatter panels with a clear header line, like the 2N console. */
.card { box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.card > h3:first-child, .card > .row:first-child > h3 { color: var(--heading); }
.tile { position: relative; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); opacity: .85; }
tbody tr:hover > td { background: var(--hover); }
th { font-weight: 700; }
h1 { color: var(--heading); letter-spacing: -.01em; }

/* ---------- Help (1.13) ---------- */
.help-btn { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); color: var(--heading); background: var(--card);
  font-weight: 800; font-size: 1.05rem; text-decoration: none; }
.help-btn:hover, .help-btn.on { border-color: var(--link); background: var(--soft); }
.help-btn.top { display: none; }
@media (max-width: 700px) {
  .help-btn.top { display: grid; margin-left: auto; background: transparent; color: var(--on-navy); border-color: color-mix(in srgb, var(--on-navy) 45%, transparent); }
  .help-btn.top + .menu-btn { margin-left: 4px; }
}
@media (min-width: 701px) { body:not(.signed-in) .help-btn.top { display: none; } }
.help-find { width: 100%; max-width: 640px; font-size: 1.05rem; padding: 12px 14px; margin: 4px 0 6px; }
.help-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.help-card b { color: var(--heading); } .help-card .small { margin-top: 4px; }
.help-snip { margin-top: 6px; color: var(--text); } .help-snip mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.help-article { max-width: 860px; }
.help-article .lead { font-size: 1.05rem; color: var(--muted); margin-top: 0; }
.help-body h2 { font-size: 1.15rem; margin: 22px 0 8px; } .help-body h3 { font-size: 1rem; margin: 16px 0 6px; }
.help-body ol, .help-body ul { padding-left: 22px; } .help-body li { margin: 4px 0; }
.help-body li::marker { color: var(--link); font-weight: 700; }
.help-body blockquote { margin: 10px 0; padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--soft); border-radius: 0 8px 8px 0; }
.help-body code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.help-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help-edit textarea { min-height: 420px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; }
.help-preview { max-height: 470px; overflow: auto; margin: 0; }
.help-roles { gap: 6px 16px; }
@media (max-width: 800px) { .help-edit { grid-template-columns: 1fr; } }

/* ---------- Job details (1.13) ---------- */
.job-more { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 4px 0 10px; }
.job-more legend { font-weight: 700; padding: 0 6px; color: var(--heading); }
.job-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.job-more-grid .wide { grid-column: 1 / -1; }
.ji-more { grid-column: 1 / -1; }
.ji-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px; margin: 0; }
.ji-dl > div.wide { grid-column: 1 / -1; }
.ji-dl dt { font-size: .78rem; color: var(--muted); font-weight: 600; } .ji-dl dd { margin: 1px 0 0; }

/* ---------- Drawing markups and symbols (1.13) ---------- */
.dp-icon.dp-img { object-fit: contain; background: #fff; border-radius: 3px; }
.mk-palette { max-height: min(46vh, 320px); overflow: auto; }
.mk-palette-list { display: flex; flex-direction: column; gap: 10px; }
.mk-cat-name { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.mk-syms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.mk-sym { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: .82rem; cursor: pointer; }
.mk-sym:hover { border-color: var(--link); background: var(--soft); } .mk-sym.used { border-color: color-mix(in srgb, var(--link) 50%, var(--line)); }
.mk-sym img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 4px; flex: none; }
.mk-sym span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dp-leg-type.mk-pick { border: 1px solid transparent; background: none; color: var(--text); font: inherit; font-size: .83rem; padding: 3px 5px; border-radius: 6px; cursor: pointer; text-align: left; }
.dp-leg-type.mk-pick:hover { background: var(--hover); } .dp-leg-type.mk-pick.on { border-color: var(--link); background: var(--soft); }
.mk-sheet-form details { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.mk-sheet-form summary { cursor: pointer; }
.mk-sheet-form .field { margin: 6px 0 0; } .mk-sheet-form .field input { padding: 5px 8px; }
.mk-rev { gap: 4px; margin-top: 6px; flex-wrap: nowrap; }
.mk-rev input { padding: 5px 6px; min-width: 0; } .mk-rev input[data-r="rev"] { width: 46px; flex: none; } .mk-rev input[data-r="details"] { flex: 1; } .mk-rev input[data-r="date"] { width: 76px; flex: none; }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sym-card { display: flex; align-items: center; gap: 10px; padding: 10px; }
.sym-card > div:nth-child(2) { flex: 1; min-width: 0; }
.sym-pic { width: 70px; height: 70px; flex: none; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.sym-pic img { max-width: 64px; max-height: 64px; object-fit: contain; }

/* 1.14: drawing markups — shapes toolbar, move/crop bar, deleting drafts from the lists */
.mk-draw { gap: 4px; align-items: center; }
.mk-draw .dw-tool { font-size: 1rem; }
.mk-wide-tool { padding: 0 10px; font-size: .88rem !important; font-weight: 600; }
.mk-mode-bar { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 8px; padding: 6px 10px; gap: 8px; }
.dw-wrap[data-tool="move"] { cursor: move; }
.mk-place { border-top: 1px dashed var(--line); padding-top: 8px; }
.mk-mark-ed { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.flash { animation: mk-flash 1.2s ease-out; }
@keyframes mk-flash { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.dp-plan-wrap { position: relative; display: flex; flex-direction: column; }
.dp-plan-wrap > .dp-plan { flex: 1; }
.dp-del { position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; box-shadow: var(--shadow); }
.dp-del:hover { border-color: var(--bad); background: var(--bad-bg); }
/* 1.368: a set of drawings (the floors of one building) is one folder across the list; 📦 downloads its drawing pack. */
.dp-set { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.dp-set[open] { padding-bottom: 12px; }
.dp-set > .dp-plans { padding: 0 12px; }
.dp-set-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; min-width: 0; }
.dp-set-head::-webkit-details-marker { display: none; }
.dp-set-head:hover { background: var(--bg, transparent); border-radius: 12px; }
.dp-set-icon { font-size: 1.5rem; }
.dp-set-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dp-set-caret::before { content: '▾'; color: var(--muted); }
.dp-set:not([open]) .dp-set-caret::before { content: '▸'; }
.dp-pack { border: 1px solid var(--line); background: var(--card); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; text-decoration: none; font-size: 1rem; flex: none; }
.dp-pack:hover { border-color: var(--brand); }
/* 1.14: the job's site details, folded to one line by default */
.job-info-box { margin-bottom: 12px; padding: 10px 14px; }
.job-info-box .job-info { margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.ji-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ji-brief { display: flex; flex-wrap: wrap; gap: 4px 18px; min-width: 0; flex: 1; }
.ji-brief-item { min-width: 0; overflow-wrap: anywhere; }
/* 1.14: calendar day and week views with hours */
.cal-views { margin-left: 6px; }
.cal-views button, .cal-layout button { border: 0; border-left: 1px solid var(--field-line); background: var(--card); color: var(--muted); padding: 5px 12px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.cal-views button:first-child, .cal-layout button:first-child { border-left: 0; }
.cal-views button.on, .cal-layout button.on { background: var(--navy); color: var(--on-navy); }
.tg { --gut: 52px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow-x: auto; margin-bottom: 12px; }
.tg-row { display: grid; grid-template-columns: var(--gut) repeat(var(--days), minmax(110px, 1fr)); min-width: calc(var(--gut) + var(--days) * 110px); }
.tg.one-day .tg-row { grid-template-columns: var(--gut) minmax(0, 1fr); min-width: 0; }
.tg-head { position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); }
.tg-day-head { border: 0; border-left: 1px solid var(--line); background: none; padding: 6px 4px; font: inherit; cursor: pointer; color: var(--text); text-align: center; }
.tg-day-head.today b { background: var(--navy); color: var(--on-navy); border-radius: 50%; padding: 1px 6px; }
.tg-day-head.selected, .tg-ad.selected { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.tg-allday { border-bottom: 2px solid var(--line); }
.tg-allday .tg-gutter { padding: 6px 4px; font-size: .72rem; text-align: right; }
.tg-ad { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 28px; min-width: 0; cursor: pointer; }
.tg-body .tg-gutter { position: relative; }
.tg-h { height: var(--hour); font-size: .72rem; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-.55em); }
.tg-h:first-child { transform: none; }
.tg-col { position: relative; border-left: 1px solid var(--line); cursor: copy; min-width: 0;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--hour) / 2), color-mix(in srgb, var(--line) 45%, transparent) calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour)); }
.tg-col.today { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.tg-block { position: absolute; margin-left: 1px; border: 0; border-left: 3px solid #1d4ed8; border-radius: 5px; padding: 2px 5px; text-align: left; font: inherit; font-size: .74rem; line-height: 1.25; overflow: hidden; cursor: pointer; z-index: 1;
  background: color-mix(in srgb, #1d4ed8 15%, var(--card)); color: color-mix(in srgb, #1d4ed8 60%, var(--text)); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.tg-block { display: flex; flex-direction: column; justify-content: flex-start; }
.tg-block .tg-time { font-weight: 700; display: block; }
.tg-block.course { border-left-color: #6d28d9; background: color-mix(in srgb, #6d28d9 15%, var(--card)); color: color-mix(in srgb, #6d28d9 60%, var(--text)); }
.tg-block.ev { border-left-color: #0b5cad; background: color-mix(in srgb, #0b5cad 14%, var(--card)); }
.tg-block.ev.people { border-left-color: #0f7a4a; background: color-mix(in srgb, #0f7a4a 14%, var(--card)); color: color-mix(in srgb, #0f7a4a 60%, var(--text)); }
.tg-block.ev.company { border-left-color: #c27a00; background: color-mix(in srgb, #c27a00 16%, var(--card)); color: color-mix(in srgb, #c27a00 60%, var(--text)); }
.tg-block.done { opacity: .6; text-decoration: line-through; }
@media (max-width: 700px) { .agenda.by-hours .agenda-day { display: none; } .agenda.by-hours .agenda-day.selected { display: block; } .cal-views { margin: 6px 0 0; } }

/* 1.15: drawing tools, CCTV designs, map capture and the document look */
.mk-draw, .cc-tools { flex-wrap: wrap; }
.cc-tools { border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 4px; }
#mkColour { width: 32px; height: 28px; padding: 1px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); cursor: pointer; }
.mk-mode-bar { gap: 8px; flex-wrap: wrap; align-items: center; background: var(--soft); border: 1px solid var(--link); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.mk-mode-bar input[type="number"] { padding: 4px 6px; }
.mk-style { flex-wrap: wrap; margin: 2px 0 8px; }
.mk-toggle { display: inline-flex; align-items: center; cursor: pointer; }
.mk-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mk-toggle > b, .mk-toggle > i, .mk-toggle > u, .mk-toggle > span { display: inline-block; min-width: 30px; text-align: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: .85rem; }
.mk-toggle input:checked + * { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.mk-toggle input:focus-visible + * { outline: 2px solid var(--link); outline-offset: 1px; }
.mk-scale { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.mk-scale input[type="number"], .mk-place input[type="number"] { padding: 3px 6px; }
.cc-h { margin: 10px 0 4px; font-size: .9rem; }
.cc-warn { background: var(--warn-bg, #fff7e6); color: var(--warn, #8a5a00); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.cc-dori { width: 100%; font-size: .82rem; margin: 6px 0; }
.cc-dori th, .cc-dori td { padding: 3px 6px; }
.cc-dori i, .cc-dori-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.cc-dori-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; }
.cc-cam-ed .inline-fields .field { min-width: 0; }
.cc-rec { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.cc-rec summary { cursor: pointer; }
.cc-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin-bottom: 6px; }
.cc-totals > div { background: var(--soft); border-radius: 8px; padding: 6px 8px; text-align: center; }
.cc-totals b { display: block; font-size: 1.2rem; color: var(--heading); }
.cc-totals span { font-size: .75rem; color: var(--muted); }
.cc-system .inline-fields .field input, .cc-system select { padding: 4px 6px; }
.cc-calc td { padding: 4px; vertical-align: middle; }
.cc-calc input, .cc-calc select { padding: 4px 6px; }
.cc-calc input[type="text"] { min-width: 120px; }
.logo-preview.doc-logo { background: #fff; border: 1px solid var(--line); }
.mapcap { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); padding: 8px; gap: 8px; }
.mapcap-top { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.mapcap-find input { flex: 1; min-width: 160px; }
.mapcap-hits { display: flex; flex-direction: column; gap: 4px; max-height: 30vh; overflow: auto; }
.mapcap-map { position: relative; flex: 1; min-height: 200px; overflow: hidden; border-radius: var(--radius); background: #cbd5e1; touch-action: none; cursor: grab; user-select: none; }
.mapcap-tiles { position: absolute; inset: 0; }
.mapcap-tiles img { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.mapcap-static { position: absolute; pointer-events: none; }
.mapcap-frame { position: absolute; border: 2px dashed #fff; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .35); outline: 1px solid rgba(15, 23, 42, .6); pointer-events: none; }
.mapcap-credit { position: absolute; right: 4px; bottom: 4px; background: rgba(255, 255, 255, .85); color: #111827; padding: 1px 6px; border-radius: 4px; pointer-events: none; }
.mapcap-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; z-index: 2; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.mapcap-preview img { width: 100%; max-height: 45vh; object-fit: contain; background: #e2e8f0; border-radius: 6px; }
.mapcap-top select { width: auto; max-width: 100%; padding: 5px 8px; }
/* 1.54: the pin, the area drawn to capture and its corners */
.mapcap-map.drawing { cursor: crosshair; }
.mapcap-frame.drawn { border-style: solid; border-color: #fff; outline-color: rgba(217, 45, 32, .9); }
.mapcap-size { position: absolute; left: 4px; top: 4px; background: rgba(15, 23, 42, .75); color: #fff; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.mapcap-size:empty { display: none; }
.mapcap-h { position: absolute; width: 18px; height: 18px; margin: -10px; background: #fff; border: 2px solid #d92d20; border-radius: 50%; pointer-events: auto; touch-action: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.mapcap-h-nw { left: 0; top: 0; cursor: nwse-resize; } .mapcap-h-se { right: 0; bottom: 0; cursor: nwse-resize; }
.mapcap-h-ne { right: 0; top: 0; cursor: nesw-resize; } .mapcap-h-sw { left: 0; bottom: 0; cursor: nesw-resize; }
@media (pointer: coarse) { .mapcap-h { width: 28px; height: 28px; margin: -15px; } }
.mapcap-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 1; }
.mapcap-pin::before { content: ""; position: absolute; left: -13px; top: -31px; width: 26px; height: 26px; box-sizing: border-box; background: #d92d20; border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.mapcap-pin::after { content: ""; position: absolute; left: -4px; top: -22px; width: 8px; height: 8px; background: #fff; border-radius: 50%; }
.mapcap-acc { position: absolute; border-radius: 50%; background: rgba(31, 127, 209, .15); border: 1px solid rgba(31, 127, 209, .7); pointer-events: none; }
.mapcap-pinrow { gap: 10px; flex-wrap: wrap; align-items: center; }
.mapcap-hint { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 16px); background: rgba(15, 23, 42, .85); color: #fff; padding: 6px 10px; border-radius: 6px; pointer-events: none; z-index: 2; text-align: center; }
.mk-count { margin-left: 6px; color: var(--link); white-space: nowrap; }
.cc-calc select { min-width: 96px; }
.cc-calc td[data-out] { min-width: 120px; white-space: nowrap; line-height: 1.3; }
@media (max-width: 700px) {
  /* On a phone the drawing and CCTV tools scroll sideways in one line each, so the drawing keeps most of the screen. */
  .dw-tools.mk-draw, .dw-tools.cc-tools { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 4px; }
  .dw-tools.mk-draw > *, .dw-tools.cc-tools > * { flex: none; }
  .mk-draw select, .cc-tools select { max-width: 170px; }
  .cc-tools label.check { white-space: nowrap; }
}

/* 1.16: drawing editor — typing on the border, the legend's editor, several selected, device numbers */
.mk-inline { position: absolute; z-index: 6; gap: 6px; padding: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .25); }
.mk-inline textarea { font-family: inherit; }
.dw-wrap[data-tool="text"] { cursor: text; }
.dw-colour.plain { background: #fff; color: var(--muted); font-size: 13px; line-height: 20px; text-align: center; }
.mk-leg-items { display: flex; flex-direction: column; gap: 6px; }
.mk-leg-item { border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.mk-leg-item.on { border-color: var(--link); background: var(--soft); }
.mk-leg-item.off { opacity: .55; }
.mk-leg-item input[type="text"] { min-width: 0; }
.mk-an-types { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow: auto; margin: 6px 0; }
.mk-an-types svg { vertical-align: middle; }
.mk-grid-t { margin-left: 4px; }
/* 1.16: form builder tools */
.builder-bar { position: sticky; top: 0; z-index: 4; padding: 8px 10px; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 4px; user-select: none; touch-action: none; }
.builder-field.is-folded { padding-top: 8px; padding-bottom: 8px; }
.builder-field.is-folded .clip { max-width: min(52vw, 560px); }
.builder-field.find-hit { outline: 2px solid var(--accent, #f59e0b); }
.builder-field.dragging { opacity: .45; }
.builder-field.drop-before { box-shadow: 0 -3px 0 var(--link); }
.builder-field.drop-after { box-shadow: 0 3px 0 var(--link); }
.fold-btn { text-decoration: none; min-width: 16px; }
/* 1.16: website boxes and the gallery of boxes */
.web-frame { width: 100%; border: 0; border-radius: 8px; background: #fff; display: block; }
.web-under { margin-top: 4px; }
.web-fallback { align-items: center; text-align: center; padding: 18px 8px; gap: 8px; }
.web-fallback-icon { font-size: 30px; line-height: 1; color: var(--navy); }
.widget-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 6px; }
.gallery-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer; border: 1px solid var(--line); font: inherit; color: inherit; }
.gallery-item:hover { border-color: var(--link); }
.gallery-add { color: var(--link); margin-top: auto; }
.widget-access { display: grid; grid-template-columns: minmax(180px, 1.3fr) 3fr; gap: 6px 12px; align-items: center; }
.widget-access .roles { display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* Outlook and shared calendars */
.chip.ext { background: color-mix(in srgb, var(--c, #0f766e) 15%, var(--card)); color: color-mix(in srgb, var(--c, #0f766e) 60%, var(--text)); border-left: 3px solid var(--c, #0f766e); }
.chip.ext.free, .tg-block.ext.free { opacity: .7; border-left-style: dashed; }
.tg-block.ext { border-left-color: var(--c, #0f766e); background: color-mix(in srgb, var(--c, #0f766e) 15%, var(--card)); color: color-mix(in srgb, var(--c, #0f766e) 60%, var(--text)); }
.ext-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #0f766e); vertical-align: middle; }
.ext-item { border-left: 3px solid var(--c, #0f766e); padding-left: 8px; }
.cal-shared { gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.my-cals section { border-top: 1px solid var(--line); padding-top: 10px; }
.my-cals h4 { margin: 0 0 6px; }
.my-cals .card-inner { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 8px 0; }
.my-cals select { width: auto; max-width: 100%; }
.my-cals #shareList li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.w-list li.ext-item { padding-left: 10px; }

/* 1.17: signing, toolbox talks, job progress, invitations */
input.invalid, select.invalid, textarea.invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 2px var(--bad-bg); }
.req { color: var(--bad); font-weight: 700; }
.completion-field input { font-size: 1.15rem; font-weight: 600; }
.stage-fields { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin: 4px 0; }
.stage-field { display: flex; flex-direction: column; gap: 2px; font-weight: normal; margin: 0; }
.stage-overall { font-size: 1.15rem; line-height: 2.2; color: var(--heading); }
.prog-stages { display: grid; gap: 4px; margin-top: 8px; }
.prog-stages > div { display: grid; grid-template-columns: 7.5em 1fr 3em; gap: 8px; align-items: center; }
.prog-stages .bar { margin: 0; }
.sign-panel h2 { font-size: 1.15rem; }
.sign-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.sign-list li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.sign-list li:last-child { border-bottom: 0; }
.sign-mine { border-top: 1px solid var(--line); padding-top: 10px; }
.sign-ask summary { cursor: pointer; }
.tb-read h3 { margin: 14px 0 6px; font-size: 1rem; color: var(--heading); }
.tb-read ol { padding-left: 1.3em; margin: 0; }
.tb-read li { margin: 4px 0; }
.tb-row .num { min-width: 1.6em; font-weight: 600; color: var(--muted); padding-top: 6px; }
.prog-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.prog-grid > .focus > .card { outline: 3px solid var(--focus); }
.prog-card { display: block; color: inherit; text-decoration: none; border-left: 5px solid var(--ok); }
.prog-card.health-watch { border-left-color: var(--warn); }
.prog-card.health-late { border-left-color: var(--bad); }
.prog-figures { display: flex; gap: 16px; align-items: flex-end; margin: 10px 0 6px; flex-wrap: wrap; }
.prog-figures > div { display: flex; flex-direction: column; }
.prog-figures .big { font-size: 1.7rem; line-height: 1; color: var(--heading); }
.prog-figures .spark { width: 90px; height: 24px; color: var(--link); margin-left: auto; }
.prog-bar { position: relative; display: block; height: 10px; border-radius: 6px; background: var(--track); overflow: visible; }
.prog-bar .done { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--accent); }
.health-late .prog-bar .done { background: var(--bad); }
.health-watch .prog-bar .done { background: var(--warn); }
.prog-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .7; }
.prog-flags { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--bad); }
.health-watch .prog-flags { color: var(--warn); }
.prog-summary { gap: 8px; }
.prog-mini { display: grid; gap: 8px; }
.prog-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; gap: 10px; align-items: center; color: inherit; text-decoration: none; padding: 4px 0 4px 8px; border-left: 4px solid var(--ok); }
.prog-row.health-watch { border-left-color: var(--warn); }
.prog-row.health-late { border-left-color: var(--bad); }
.prog-row .prog-name { display: flex; flex-direction: column; min-width: 0; }
.prog-row .prog-name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-row .prog-pct { text-align: right; }
.invites-card { border-left: 4px solid var(--accent); }
.invite-answer { align-items: center; }
.teams-btn { background: #4b53bc; border-color: #4b53bc; color: #fff; margin: 4px 0; }
.roles-help summary { cursor: pointer; }
.roles-list { margin: 8px 0; padding-left: 1.4em; }
.roles-list li { margin: 4px 0; }
.doc-meta summary { cursor: pointer; }
.cal-shared summary { cursor: pointer; }

/* 1.17: drawings library (folders, kinds) and wiring diagrams */
.dl-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.dl-folders { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.dl-folder { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; text-decoration: none; min-width: 0; }
.dl-folder:hover { border-color: var(--brand); }
.dl-folder > span:first-child { font-size: 1.3rem; }
.dl-folder b { flex: 1; min-width: 0; }
.dl-move { gap: 8px; padding: 8px 10px; border: 1px solid var(--brand); border-radius: 10px; background: var(--card); position: sticky; bottom: 8px; flex-wrap: wrap; }
.dl-move select { max-width: 280px; }
.dp-pick { position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 7px; line-height: 0; box-shadow: var(--shadow); }
.dp-plan-wrap.picked > .dp-plan { outline: 2px solid var(--brand); }
.wr-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg-soft, rgba(0,0,0,.05)); margin: 2px 2px 0 0; }
.wr-sources li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.wr-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.wr-bar { gap: 10px; flex-wrap: wrap; }
.wr-roles { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.wr-pick summary { cursor: pointer; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.wr-pick-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 6px 8px; display: grid; gap: 2px; }
.wr-pick-list img { width: 22px; height: 18px; object-fit: contain; vertical-align: middle; }
.wr-pick-cat { margin-top: 6px; font-weight: 600; }
.wr-params .field { max-width: 230px; }

/* Health and safety tab (1.18) */
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.hs-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hs-card { display: flex; flex-direction: column; gap: 6px; border-left: 4px solid var(--line, #d0d7e2); }
.hs-card.hs-ok { border-left-color: var(--ok); } .hs-card.hs-due { border-left-color: var(--warn); } .hs-card.hs-overdue { border-left-color: var(--bad); }
.hs-about { color: var(--muted); }
/* Calendar entries that aren't a job or a course (1.18) */
.chip.other { background: color-mix(in srgb, #0e7490 13%, var(--card)); color: color-mix(in srgb, #0e7490 60%, var(--text)); }
.tg-block.other { border-left-color: #0e7490; background: color-mix(in srgb, #0e7490 14%, var(--card)); color: color-mix(in srgb, #0e7490 60%, var(--text)); }

/* Quotes: counting devices on a PDF or picture (1.18) */
.ct-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 12px; align-items: start; margin-top: 10px; }
.ct-side { position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; }
.ct-side hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.ct-type { border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; gap: 4px; cursor: pointer; }
.ct-type.on { border-color: var(--accent, #1570ef); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #1570ef) 25%, transparent); }
.ct-type input[type=color] { width: 30px; height: 28px; padding: 0; border: 0; background: none; flex: none; }
.ct-main { min-width: 0; }
.ct-stage { position: relative; overflow: auto; max-height: calc(100vh - 130px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ct-stage canvas { display: block; }
.ct-stage #ctOver { position: absolute; left: 0; top: 0; cursor: crosshair; touch-action: none; }
.ct-stage.finding #ctOver { cursor: cell; }
.ct-stage.picking #ctOver { cursor: pointer; }
.ct-more > summary { cursor: pointer; }
.qt-lines input { width: 100%; min-width: 60px; }
@media (max-width: 760px) { .ct-wrap { grid-template-columns: 1fr; } .ct-side { position: static; max-height: none; } }
.qt-lines tr.from-dwg td:first-child { box-shadow: inset 3px 0 0 var(--accent, #1570ef); }
/* The drawing space (1.19): sized by a preset (A3 unless chosen), tools in tabs that fold away, full screen */
.dw.dp { height: auto; min-height: 0; }
.dp .dw-main { height: 70vh; justify-content: center; grid-template-rows: minmax(0, 1fr); flex: none; }
.dp .dw-side { min-height: 0; overflow: auto; }
.dw-main.no-side { grid-template-columns: minmax(0, 1fr); }
.dw-grip { align-self: flex-end; margin-top: -8px; width: 26px; height: 22px; display: grid; place-items: center; cursor: nwse-resize; color: var(--muted); font-size: 14px; touch-action: none; user-select: none; border-radius: 6px; }
.dw-grip:hover { background: var(--hover); color: var(--text); }
.dw-view .dw-space { width: auto; max-width: 200px; padding: 4px 6px; font-size: .85rem; }
.dw-tabs { gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 0; flex-wrap: wrap; align-items: flex-end; }
.dw-tab { border: 1px solid var(--line); border-bottom: none; background: var(--hover); color: var(--text); border-radius: 8px 8px 0 0; padding: 5px 12px; font-size: .88rem; cursor: pointer; margin-bottom: -1px; }
.dw-tab.on { background: var(--card); font-weight: 600; box-shadow: inset 0 2px 0 var(--navy); }
#dwFold { flex: none; white-space: nowrap; align-self: center; }
.dw-pane { padding-top: 4px; }
.dw-group { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 4px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.dw-glabel { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 4px 0 2px; }
/* 1.378: the tool tabs as a ribbon, as CAD programs lay them out: each group is a panel with its name underneath. */
@media (min-width: 701px) {
  .dw-pane .dw-tools { align-items: stretch; }
  .dw-pane .dw-group { border-radius: 6px; padding: 3px 6px 1px; row-gap: 1px; }
  .dw-pane .dw-group > .dw-glabel { order: 99; flex: 1 0 100%; contain: inline-size; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; margin: 0; font-size: .66rem; line-height: 1.3; border-top: 1px solid var(--line); padding-top: 1px; }
}
.dw.dw-fs { position: fixed; inset: 0; z-index: 900; background: var(--bg); padding: 8px; overflow: auto; }
.dw.dw-fs .dw-grip { display: none; }
@media (max-width: 1400px) { .dw-long { display: none; } }
@media (max-width: 900px) { .dp .dw-main { height: auto !important; grid-template-rows: auto; } .dp .dw-side { max-height: 70vh; } .dw-view .dw-space { max-width: 130px; } .dw-grip { display: none; } }
@media (max-width: 700px) { .dw-tabs { flex-wrap: nowrap; overflow-x: auto; } .dw-tab { flex: none; } .dw-pane .dw-tools { flex-wrap: nowrap; overflow-x: auto; } .dw-group { flex-wrap: nowrap; flex: none; } }
/* The preview over the page (1.19) */
.pv-over { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .88); display: flex; flex-direction: column; }
.pv-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); color: var(--text); border-bottom: 1px solid var(--line); }
.pv-pages { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; outline: none; }
.pv-pages canvas, .pv-pages img { background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.45); max-width: 100%; height: auto; }
.cc-checks { list-style: none; padding: 0; margin: 4px 0; } .cc-checks li.ok { color: var(--ok, #15803d); } .cc-checks li.bad { color: #b91c1c; font-weight: 600; }
/* 1.20: automatic symbol counts */
.ct-auto-row { border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; gap: 4px; }
.ct-auto-row:hover { border-color: #7a5af8; }
.ct-auto-thumb { width: 34px; height: 34px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; flex: none; }
.ct-auto-row .clip { min-width: 0; }

/* 1.20: fill in by voice */
.vc-sheet { position: fixed; inset: 0; z-index: 950; background: color-mix(in srgb, #000 40%, transparent); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.vc-card { width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow: auto; margin: 0; box-shadow: var(--shadow); }
@media (min-width: 700px) { .vc-sheet { align-items: center; } }
.vc-mic-row { display: flex; align-items: center; gap: 12px; }
.vc-mic { width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; background: var(--navy); color: var(--on-navy); font-size: 28px; display: grid; place-items: center; flex: none; }
.vc-mic.on { background: #dc2626; color: #fff; animation: vc-pulse 1.2s ease-in-out infinite; }
@keyframes vc-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 50% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); } }
.vc-card textarea { width: 100%; font-family: inherit; min-height: 100px; }
.vc-changes { gap: 6px; max-height: 40dvh; overflow: auto; }
.vc-change { align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-weight: normal; }
.vc-change input { margin-top: 3px; }
.vc-diff { font-size: .9em; overflow-wrap: anywhere; }
.vc-diff s { color: var(--muted); }
.voice-btn { white-space: nowrap; }
/* 1.373: Start audit with Maxi: a panel along the bottom, the question being asked marked in the form above it. */
.mx-start-btn { white-space: nowrap; }
.mx-sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 940; width: min(640px, 100%); margin: 0; border-radius: 14px 14px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18); padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 5px; max-height: 55dvh; overflow: auto; }
body.mx-on { padding-bottom: 55dvh; }
.mx-head { gap: 8px; }
.mx-head b { flex: none; }
.mx-q-label { font-weight: 600; overflow-wrap: anywhere; }
.mx-ans { margin-top: 2px; }
.mx-said { color: var(--navy); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.mx-heard { min-height: 1.2em; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mx-q .muted:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mx-controls .mx-mic { width: 60px; height: 60px; font-size: 26px; }
.mx-photo { font-size: 20px; margin: 0; }
.mx-pulse { animation: vc-pulse 1.2s ease-in-out infinite; outline: 2px solid #dc2626; }
.mx-type input { flex: 1; min-width: 0; }
.mx-opts { gap: 14px; flex-wrap: wrap; }
.mx-current { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
@media print { .mx-sheet { display: none; } body.mx-on { padding-bottom: 0; } }
/* Find devices on survey drawings (1.20): one line per group on wide screens. */
.dp-findbox { margin-top: 8px; }
.dp-findbox .ct-auto-list { max-height: 300px !important; }
@media (min-width: 760px) {
  .dp-findbox .ct-auto-row { grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); align-items: center; }
  .dp-findbox .ct-auto-row [data-f-name] { grid-column: 2; }
}
/* Pictures and graphics in a lesson (1.24) */
.lesson-pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; margin-bottom: 12px; }
.lesson-pictures figure { margin: 0; }
.lesson-pictures img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; background: var(--bg, #f3f4f6); }
.lesson-pictures:has(figure:only-child) { grid-template-columns: 1fr; }
.prose img { max-width: 100%; height: auto; }
.prose img.zoomable { cursor: zoom-in; }
.vc-pics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vc-pic { display: flex; align-items: center; gap: 6px; max-width: 240px; padding: 4px 6px; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.vc-pic img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.cc-parts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
/* The quote builder (1.26): sections and cost centres, the catalogue search, and the preview of the client's copy */
.qt-block .qt-block-title { flex: 1; min-width: 0; font-weight: 600; font-size: 1rem; }
.qt-block .badge { flex: none; }
.qt-cc { border-left: 3px solid var(--accent, #1f7fd1); }
/* 1.92: named sections and the cost centres in them */
.qt-sec { border-left: 5px solid var(--primary, #003e79); background: color-mix(in srgb, var(--primary, #003e79) 6%, var(--card)); }
.qt-cc.qt-in-sec { margin-left: 22px; }
@media (max-width: 700px) { .qt-cc.qt-in-sec { margin-left: 10px; } }
.qt-paper .qt-pv-sec h2 { margin: 22px 0 6px; padding: 6px 8px; border-bottom: 2px solid #003e79; font-size: 1.15rem; }
.sup-internal { border-left: 4px solid var(--warn, #b45309); background: color-mix(in srgb, var(--warn-bg, #fff4dd) 60%, var(--card)); } /* 1.93 */
.badge.danger { background: var(--danger-bg, #fde8e8); color: var(--danger, #b42318); }
.job-sec-row td { background: color-mix(in srgb, var(--primary, #003e79) 8%, var(--card)); font-weight: 600; }
.qt-lines .nowrap, #mqLabour .nowrap { white-space: nowrap; }
.qt-lines select.small { width: 100%; margin-top: 4px; }
.qt-lines tr.qt-labour td { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.qt-cc .grow { flex: 1; }
.qt-find { position: absolute; left: 0; top: 100%; z-index: 30; width: min(520px, 100%); max-height: 320px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.qt-find-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; font: inherit; }
.qt-find-row:hover, .qt-find-row:focus { background: var(--hover); }
.qt-find-row .muted { grid-column: 1; }
.qt-pref { color: #d97706; }
.qt-find-row > span:last-child { grid-row: 1; grid-column: 2; }
#qtTabs a { cursor: pointer; }
.qt-paper { position: relative; overflow: hidden; background: #fff; color: #111827; border: 1px solid var(--line); border-radius: 6px; padding: 28px 32px; max-width: 860px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.qt-paper h2, .qt-paper h3 { color: #003e79; }
.qt-paper h3 { margin: 18px 0 6px; padding: 4px 8px; background: #eef2f8; font-size: 1rem; }
.qt-paper table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.qt-paper th, .qt-paper td { padding: 4px 6px; border-bottom: 1px solid #e3e8f0; text-align: left; color: #111827; background: none; }
.qt-paper thead th { background: #003e79; color: #fff; }
.qt-paper .right, .qt-paper th.right { text-align: right; }
.qt-paper .muted { color: #667085; }
.qt-paper .qt-pv-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 3px solid #003e79; padding-bottom: 8px; margin-bottom: 10px; }
.qt-paper .qt-pv-details th { width: 16%; color: #667085; font-weight: 600; }
.qt-paper .qt-pv-tot { max-width: 380px; margin-left: auto; }
.qt-paper.wm::after { content: attr(data-wm); position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) rotate(-38deg); font: 700 clamp(28px, 7vw, 64px)/1 Helvetica, Arial, sans-serif; color: rgba(110, 120, 135, .16); white-space: nowrap; pointer-events: none; }
.qt-pv-edit { margin-left: 6px; font-weight: normal; }
@media (max-width: 700px) { .qt-paper { padding: 16px 12px; } .qt-block .row.spread { flex-wrap: wrap !important; } }
.qt-block textarea, #qtPrivate { min-height: 56px; field-sizing: content; max-height: 60vh; font-family: inherit; font-size: .95rem; }
.qt-block textarea[data-bk=description] { min-height: 40px; }
#mqTerms textarea, #mqTermAdd textarea, #mqWm textarea { min-height: 80px; font-family: inherit; }
/* 1.28: suppliers on quote lines */
.qt-sup select { max-width: 220px; }
.qt-flag { border: 1px solid var(--warn-line); background: var(--warn-bg); color: inherit; border-radius: 999px; padding: 2px 8px; font-size: .8rem; cursor: pointer; }
.qt-flag:hover { filter: brightness(.96); }
fieldset:disabled .qt-flag { cursor: default; opacity: .7; }
@media (max-width: 700px) {
  .qt-lines td { flex-wrap: wrap; }
  .qt-lines input[data-k=description] { min-width: 0 !important; flex: 1 1 100%; }
  .qt-lines td > .small, .qt-sup { flex: 1 1 100%; }
}

/* ---------- Photos: drawing tools and sizes (1.27) ---------- */
.photo-strip .thumbs { align-items: flex-start; }
.photo-strip .thumb { height: auto; overflow: visible; display: flex; flex-direction: column; }
.photo-strip .thumb > a { display: block; height: 96px; overflow: hidden; border-radius: 8px 8px 0 0; }
.photo-strip .thumb.photo-small { width: 76px; } .photo-strip .thumb.photo-small > a { height: 76px; }
.photo-strip .thumb.photo-large { width: 150px; } .photo-strip .thumb.photo-large > a { height: 112px; }
.thumb-drawn { position: absolute; top: 4px; left: 4px; background: rgba(17,24,39,.75); color: #fff; border-radius: 10px; font-size: .7rem; padding: 1px 6px; }
.thumb-tools { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--card); }
.thumb-draw { flex: 1 1 100%; border: 1px solid var(--line); background: var(--hover); color: var(--text); border-radius: 5px; font: inherit; font-size: .75rem; padding: 3px 4px; cursor: pointer; }
.thumb-size { display: flex; flex: 1 1 100%; }
.thumb-size button { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: .72rem; padding: 2px 0; cursor: pointer; }
.thumb-size button:first-child { border-radius: 5px 0 0 5px; } .thumb-size button:last-child { border-radius: 0 5px 5px 0; }
.thumb-size button + button { border-left: 0; }
.thumb-size button.active { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
@media (max-width: 700px) {
  .photo-strip .thumb, .photo-strip .thumb.photo-small, .photo-strip .thumb.photo-large { width: calc(33.3% - 6px); aspect-ratio: auto; }
  .photo-strip .thumb > a, .photo-strip .thumb.photo-small > a, .photo-strip .thumb.photo-large > a { height: auto; aspect-ratio: 1; }
  .thumb-draw, .thumb-size button { padding: 6px 0; }
}
.pd-over { position: fixed; inset: 0; z-index: 1000; background: #0f172a; display: flex; flex-direction: column; }
.pd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; background: var(--card); color: var(--text); border-bottom: 1px solid var(--line); }
.pd-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pd-tools .icon-btn { min-width: 36px; height: 34px; font-size: 1rem; }
.pd-tools .icon-btn.active { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.pd-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.pd-sw.active { outline: 3px solid var(--accent); outline-offset: 1px; }
.pd-tools input[type=color] { width: 32px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.pd-range { display: flex; align-items: center; gap: 4px; } .pd-range input { width: 90px; }
.pd-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px; overflow: hidden; }
.pd-stage canvas { touch-action: none; box-shadow: 0 6px 24px rgba(0,0,0,.45); cursor: crosshair; }
.pd-hint { color: #e5e7eb; text-align: center; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); }
.em-over { position: fixed; inset: 0; z-index: 1000; background: color-mix(in srgb, #000 45%, transparent); display: grid; place-items: center; padding: 16px; overflow: auto; }
.em-box { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
/* 1.29: the upload link page (server/inbox.js) */
.upl-page { display: flex; justify-content: center; padding: 16px; min-height: 100vh; background: var(--bg); }
.upl-box { width: 100%; max-width: 520px; align-self: flex-start; }
.upl-pick { align-self: flex-start; font-size: 1.05rem; padding: 12px 18px; cursor: pointer; }
.upl-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.upl-list li { padding: 8px 10px; border-radius: 8px; background: var(--soft); word-break: break-word; }
.upl-list li.ok { background: var(--ok-bg); color: var(--ok); } .upl-list li.bad { background: var(--bad-bg); color: var(--bad); }
/* 1.29: layers in the drawing editor */
.dp-layer-list li { display: flex; align-items: center; gap: 6px; padding: 3px 4px; }
.dp-layer-list li.on { background: var(--soft); border-radius: 6px; }
.dp-layer-list input[type=text] { flex: 1; min-width: 0; padding: 4px 6px; }
.dp-layer-list li button { width: auto; flex: none; border-bottom: 0; padding: 2px 6px; } /* not the full-width list buttons */
.dp-ly-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dp-layer-pick select { max-width: 170px; }
/* 1.30: the right-click / press-and-hold menu on drawings for adding a symbol at that spot. */
.mk-ctx { position: fixed; z-index: 60; gap: 2px; padding: 8px; min-width: 200px; max-width: 280px; box-shadow: 0 8px 24px rgba(15, 23, 42, .28); }
.mk-ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 36px; }
.mk-ctx-item:hover, .mk-ctx-item:focus-visible { background: var(--soft); outline: none; }
.mk-ctx-item svg { flex: none; }
/* 1.30: the drawings of a CCTV design over several floors or buildings. */
.cc-design { padding: 4px 0 2px; }
.cc-dw { border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; background: var(--card); text-decoration: none; color: inherit; }
.cc-dw.on { background: var(--soft); border-color: var(--link); }
.cc-dw a { color: inherit; text-decoration: none; }
/* 1.40: the pages of a PDF imported together, as tabs, each with ✕ to discard it; and the page chooser on import. */
.dp-set-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 6px; font-size: .8rem; line-height: 1; }
.dp-set-x:hover, .dp-set-x:focus-visible { color: var(--danger, #b91c1c); }
.dp-pdf-layers { max-height: 260px; overflow: auto; }
.dp-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; padding: 2px; }
.dp-page { position: relative; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); border-radius: 8px; padding: 6px; background: var(--card); cursor: pointer; }
.dp-page.on { border-color: var(--link); }
.dp-page:not(.on) .dp-page-pic { opacity: .35; }
.dp-page-pic { display: flex; align-items: center; justify-content: center; height: 110px; background: #fff; border-radius: 4px; overflow: hidden; }
.dp-page-pic canvas { max-width: 100%; max-height: 110px; }
.dp-page input { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; }
@media (max-width: 700px) { .dp-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dp-in-design { margin-left: 18px; border-left: 3px solid var(--line); padding-left: 6px; }
/* 1.30: drawing projects (not on a job) on the Drawings page. */
.pr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
/* 1.429: the design project's name wraps instead of running off the card (its lines: see :where(a.card) at the top). */
.pr-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; min-width: 0; overflow-wrap: anywhere; }
.pr-card > b.clip { white-space: normal; overflow: visible; }
.pr-card:hover { border-color: var(--link); }
/* 1.30: layers of a red-pen mark-up in the drawing viewer. */
.dw-layers li { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.dw-layers li.on { background: var(--soft); }
.dw-layers li button { width: auto; display: inline; border-bottom: 0; padding: 0; }

/* 1.35: Admin → Updates history stays a fixed height and scrolls, with its headings kept in view. */
.history-scroll { max-height: 340px; overflow: auto; overscroll-behavior: contain; }
.history-scroll th { position: sticky; top: 0; z-index: 1; background: var(--card); }
@media (max-width: 700px) { .history-scroll { max-height: 60vh; } }

/* 1.35: lesson narration player, course resources and training sections. */
.narr-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.narr-controls input[type=range] { flex: 1 1 160px; min-width: 120px; max-width: none; }
.narr-controls select { width: auto; max-width: 90px; }
/* 1.351: a lesson shown as slides (slides.js): one slide at a time, the controls on top of it (they stay in view). */
.slide-deck { position: relative; padding-top: 0; }
.slide-deck .slide { display: none; }
.slide-deck .slide.on { display: block; animation: slide-in .25s ease; }
.slide-deck .slide img { display: block; width: 100%; height: auto; border-radius: 6px; }
.slide-deck .slide > h2:first-child, .slide-deck .slide > h3:first-child { margin-top: 10px; }
.deck-bar { position: sticky; top: 56px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 -16px 8px; padding: 8px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.deck-bar input[type=range] { flex: 1 1 140px; min-width: 100px; max-width: none; }
.deck-bar select { width: auto; max-width: 80px; }
.deck-bar .deck-gap { flex: 1 1 auto; }
.deck-bar [data-dnext] { margin-left: auto; }
.deck-count { min-width: 3.5em; text-align: center; font-variant-numeric: tabular-nums; }
.deck-time { font-variant-numeric: tabular-nums; }
.deck-note { margin: -2px 0 8px; }
.deck-start { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 5; padding: 14px 26px; font-size: 1.1rem; font-weight: 600;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 24px rgba(0,0,0,.25); cursor: pointer; }
.deck-bar .pulse { animation: vc-pulse 1.6s ease-in-out 3; }
.slide-deck:fullscreen { overflow: auto; background: var(--card); padding: 0 24px 24px; }
.slide-deck:fullscreen .deck-bar { top: 0 !important; margin: 0 -24px 10px; padding: 10px 24px; border-radius: 0; }
.slide-deck:fullscreen .slide img { max-height: calc(100vh - 90px); width: auto; max-width: 100%; margin: 0 auto; }
@keyframes slide-in { from { opacity: .3; } to { opacity: 1; } }
@media (max-width: 600px) { .deck-bar { gap: 4px; } .deck-bar input[type=range] { order: 9; flex-basis: 100%; } }
.narr-time { min-width: 72px; text-align: right; }
.res-list { margin: 4px 0 0; padding-left: 18px; }
.res-list li { margin: 4px 0; }
.section-courses { margin: 0; padding-left: 18px; font-size: .92rem; }
.section-courses li { margin: 2px 0; }
.cert-offer { align-items: center; }
.training-section.clickable { cursor: pointer; } .training-section.clickable:hover { border-color: var(--accent); }

/* 1.39.1: a box in a grid that holds a lot scrolls inside itself and can be dragged taller or shorter (fitBoxes in app.js). */
.grid:has(> .box-long) { align-items: start; }
/* 1.410: boxes packed like bricks (packGrids in app.js): small rows, each box spanning as many as its height needs. */
.grid.grid-pack { grid-auto-rows: 4px; align-items: start; }
.box-long { max-height: 600px; min-height: 160px; overflow: auto; resize: vertical; overscroll-behavior: contain; }
.box-long::-webkit-resizer { background: linear-gradient(135deg, transparent 50%, var(--muted) 50%, var(--muted) 58%, transparent 58%, transparent 70%, var(--muted) 70%, var(--muted) 78%, transparent 78%); }

/* ---------- 1.44: a sleeker, more modern look ----------
   Softer layered shadows, rounder corners, a cleaner type scale, pill navigation and tabs, and a focus ring
   on everything that can be used from the keyboard. Colours still come only from the theme (themes.js), so
   every theme, light or dark, picks this up; documents and certificates are drawn elsewhere and don't change. */
:root, .theme-scope {
  --radius: 14px; --radius-sm: 10px;
  --shadow-lg: 0 2px 4px color-mix(in srgb, #0b1220 6%, transparent), 0 12px 32px color-mix(in srgb, #0b1220 12%, transparent);
  --ring: 0 0 0 3px color-mix(in srgb, var(--link) 28%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
body { font-family: "Inter var", Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3 { color: var(--heading); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 1.85rem; letter-spacing: -.025em; margin: .1em 0 .7em; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.06rem; }
.card h3, .widget-head h3 { letter-spacing: -.01em; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }
:focus-visible { outline: none; box-shadow: var(--ring); }
a:focus-visible { border-radius: 4px; }

/* Panels */
.card, .tile, details.folder, .editor-item, .side-menu, .table-wrap, .sticky-actions {
  border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 85%, transparent); }
.card, .tile { box-shadow: var(--shadow); }
.card { padding: 16px 24px; }
a.card, .training-section.clickable, .pr-card, a.mini-tile { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; }
a.card:hover, .training-section.clickable:hover, .pr-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--link) 40%, var(--line)); }
a.mini-tile { border-radius: var(--radius-sm); }
.tile { padding: 16px; }
.tile::before { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 3px; opacity: 1; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent)); }
.tile .n { font-size: 2rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.tile .l { font-size: .8rem; font-weight: 500; }
.section-icon { border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--card)), var(--soft)); }
details.folder summary { padding: 12px 16px; }
.empty { padding: 32px 24px; }
.question .opt { border-radius: var(--radius-sm); transition: background-color .15s, border-color .15s; }
.question .opt:has(input:checked) { border-color: var(--link); background: var(--soft); }

/* Buttons and fields */
.btn { border-radius: var(--radius-sm); font-weight: 600; min-height: 38px; padding: 8px 16px; letter-spacing: .005em;
  box-shadow: 0 1px 2px color-mix(in srgb, #0b1220 14%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.secondary { color: var(--heading); border-color: var(--field-line); box-shadow: 0 1px 2px color-mix(in srgb, #0b1220 6%, transparent); }
.btn.secondary:hover { border-color: color-mix(in srgb, var(--link) 55%, var(--card)); }
.btn.danger { box-shadow: none; }
.btn.sm { min-height: 30px; padding: 4px 11px; border-radius: 8px; }
.btn:focus-visible { box-shadow: var(--ring); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], input[type=time], select, textarea {
  border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
label { font-weight: 600; letter-spacing: .005em; }
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; padding: 12px 16px; }
.alert.error { border-color: var(--bad-line); } .alert.ok { border-color: var(--ok-line); } .alert.info { border-color: color-mix(in srgb, var(--link) 22%, var(--card)); }
.badge { padding: 3px 9px; letter-spacing: .01em; }
.bar { height: 7px; } .bar > span { border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--navy)); }
.icon-btn { border-radius: 8px; }
.toast { border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 16px; font-weight: 500; }

/* Tabs: a row of pills rather than an underline, which wraps neatly when there are many */
.tabs { gap: 2px; border-bottom: 0; padding: 4px; background: color-mix(in srgb, var(--text) 3%, var(--bg)); border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs a { padding: 8px 12px; border: 0; border-radius: 9px; margin: 0; font-weight: 500; transition: background-color .15s, color .15s; }
.tabs a:hover { color: var(--text); background: color-mix(in srgb, var(--card) 60%, transparent); }
.tabs a.active { color: var(--heading); background: var(--card); box-shadow: 0 1px 3px color-mix(in srgb, #0b1220 12%, transparent); font-weight: 600; }

/* Tables */
.table-wrap { box-shadow: var(--shadow); background: var(--card); }
th { background: color-mix(in srgb, var(--text) 3%, var(--card)); font-size: .74rem; font-weight: 600; letter-spacing: .05em; padding: 8px 12px; }
td { padding: 12px; }
.table-wrap tr:last-child > td { border-bottom: 0; }

/* Navigation: the menu down the side has rounded items with a little room around them */
@media (min-width: 701px) {
  body.signed-in .topbar { background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 92%, white), var(--navy) 40%, color-mix(in srgb, var(--navy) 88%, black)); }
  body.signed-in .brand { border-bottom-color: color-mix(in srgb, var(--on-navy) 10%, transparent); font-weight: 600; letter-spacing: -.01em; }
  body.signed-in #nav { padding: 10px; gap: 2px; }
  body.signed-in #nav a, body.signed-in #nav button { border-radius: 10px; padding: 9px 12px; font-weight: 500; transition: background-color .15s, opacity .15s; }
  body.signed-in #nav a.active { background: color-mix(in srgb, var(--on-navy) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-navy) 10%, transparent); }
  body.signed-in #nav a.active::before { left: -10px; top: 9px; bottom: 9px; }
  body.side-mini #nav a, body.side-mini #nav button, body.dw-open #nav a, body.dw-open #nav button { padding: 10px 0; }
  body.signed-in #logoutBtn { border-radius: 10px !important; }
  body.signed-in .appbar:not([hidden]) { height: 60px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(12px);
    border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
  .appbar-title { font-size: 1rem; letter-spacing: -.01em; }
  body.signed-in .container { padding-top: 26px; }
}
@media (max-width: 1120px) { #nav { padding: 8px 10px 12px; box-shadow: 0 16px 32px color-mix(in srgb, #0b1220 25%, transparent); } #nav a, #nav button { border-radius: 10px; } }
@media (max-width: 700px) {
  .topbar { min-height: 56px; box-shadow: 0 1px 0 color-mix(in srgb, #000 15%, transparent); }
  body.signed-in .appbar:not([hidden]) { background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
  h1 { font-size: 1.5rem; }
  .card { padding: 16px; }
  .tabs { width: auto; }
  .table-wrap { box-shadow: none; background: none; }
  .table-wrap tr { border-radius: var(--radius); }
}
.user-chip { transition: background-color .15s, border-color .15s; }
.user-chip .avatar { background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: var(--on-navy); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.help-btn { transition: background-color .15s, border-color .15s; }
.side-menu { padding: 6px; }
.side-menu a { border-radius: 9px; transition: background-color .15s; }
.page-nav .pn-main { background: linear-gradient(135deg, var(--navy-2), var(--navy)); box-shadow: 0 8px 24px color-mix(in srgb, var(--navy) 40%, transparent); }

/* Sign-in pages: a soft wash of the brand colours behind the card */
body:not(.signed-in) { background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg) 70%) fixed; }
.auth-wrap { margin-top: 8vh; }
.auth-wrap .card { box-shadow: var(--shadow-lg); padding: 24px; }
.auth-wrap .logo-band { box-shadow: var(--shadow-lg); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--navy) 85%, white), var(--navy)); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } a.card:hover, .training-section.clickable:hover, .pr-card:hover { transform: none; } }

/* 1.46: Mine / Everyone / one person on the quotes, takeoffs and drawings lists. */
.who-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.who-bar .who-tabs { margin: 0; }
.who-bar .who-n { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 999px; font-size: 12px; line-height: 18px; text-align: center;
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); font-weight: 500; }
.who-bar .who-tabs a.active .who-n { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--heading); }
.who-bar select { width: auto; max-width: 260px; }
.who-bar select.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); font-weight: 600; }
.qt-views { margin-bottom: 4px; }
@media (max-width: 700px) {
  .who-bar { gap: 6px; }
  .who-bar .who-tabs { flex: 1 1 auto; flex-wrap: nowrap; }
  .who-bar .who-tabs a { flex: 1; text-align: center; padding: 8px 6px; }
  .who-bar select { flex: 1 1 100%; max-width: none; }
}
/* 1.46: sharing your own drawing folders. */
.dl-share { margin-top: 8px; }
.dl-share-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; max-height: 320px; overflow-y: auto; }
.dl-share-row { gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.dl-share-row select { width: auto; min-width: 130px; }
@media (max-width: 700px) { .dl-share-list { grid-template-columns: 1fr; max-height: none; } }

/* 1.50: the 🔒 / 🔓 layout button by Help, and arranging the boxes on a page while it is unlocked. */
.layout-btn { cursor: pointer; padding: 0; }
.layout-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card)); color: var(--heading); }
.help-btn.top.layout-btn.on { background: color-mix(in srgb, var(--on-navy) 22%, transparent); color: var(--on-navy); }
@media (max-width: 700px) { .help-btn.top.layout-btn + .help-btn.top { margin-left: 4px; } }
body:not(.signed-in) .layout-btn { display: none !important; }
body.layout-unlocked .arr-item { position: relative; padding-top: 44px; outline: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.arr-bar { position: absolute; top: 6px; right: 8px; z-index: 5; display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg, 0 2px 8px rgba(0,0,0,.15)); }
.layout-note .btn { white-space: nowrap; }
.arr-bar button { border: 0; background: none; color: var(--heading); width: 30px; height: 28px; border-radius: 999px; cursor: pointer; font-size: .95rem; line-height: 1; padding: 0; }
.arr-bar button:hover, .arr-bar button:focus-visible { background: var(--soft); }
.arr-bar .arr-handle { cursor: grab; touch-action: none; user-select: none; font-size: 1.1rem; }
.arr-dragging { opacity: .9; box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.25)); cursor: grabbing; }
.arr-placeholder { border: 2px dashed var(--accent) !important; background: color-mix(in srgb, var(--accent) 8%, transparent) !important; box-shadow: none !important; visibility: visible; }
.arr-placeholder > * { visibility: hidden; }
.grid > .box-wide { grid-column: 1 / -1; }
.layout-note { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 70; display: flex; align-items: center; gap: 12px; max-width: min(860px, calc(100% - 110px));
  padding: 10px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--accent); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.2)); font-size: .9rem; }
body.dw-open .layout-note { display: none; }
@media (max-width: 700px) {
  .layout-note { left: 8px; right: 76px; transform: none; max-width: none; flex-wrap: wrap; gap: 8px; padding: 8px 10px; bottom: 10px; }
  .layout-note .ln-more { display: none; }
  .arr-bar button { width: 36px; height: 34px; }
}
/* Locked: the home page's boxes and long boxes stay as they are (Customise still moves the home page's boxes). */
body:not(.layout-unlocked) .widgets:not(.editing) .drag-handle, body:not(.layout-unlocked) .widgets:not(.editing) .widget-resize { display: none; }
body:not(.layout-unlocked) .box-long { resize: none; }
@media print { .arr-bar, .layout-note, .layout-btn { display: none !important; } }
@media (max-width: 700px) { .arr-bar [data-arr="wide"] { display: none; } }
body.dw-open .layout-btn { display: none !important; }
/* 1.48: choosing several people for a team leader at once (teamPicker in app.js). */
.team-picker .tp-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px; }
.team-picker .tp-head { position: sticky; top: 0; background: var(--card); font-weight: 600; font-size: .85rem; color: var(--muted); padding: 8px 0 4px; border-bottom: 1px solid var(--line); z-index: 1; }
.team-picker .tp-person { padding: 8px 2px; border-bottom: 1px solid var(--line); align-items: flex-start; cursor: pointer; }
.team-picker .tp-person:last-child { border-bottom: 0; }
.team-picker .tp-person input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.team-picker .tp-locked { opacity: .6; cursor: default; }
.team-picker .tp-empty { padding: 8px 0; }
@media (max-width: 700px) {
  .team-picker .tp-list { max-height: 55vh; }
  .team-picker .tp-actions { padding-right: 56px; } /* clear of the Maxi button */
  .team-picker .tp-actions .btn { flex: 1; }
}

/* 1.52: the device picker in the drawing editors: category tabs and device tiles that can be dragged onto the drawing. */
.mk-devpick { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; min-width: 0; }
.mk-devtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.mk-devtab { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.mk-devtab:hover { background: var(--hover); }
.mk-devtab.on { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.mk-devtab.on .muted { color: inherit; opacity: .8; }
.mk-dtiles { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; touch-action: pan-x; }
.mk-dtile { position: relative; flex: none; width: 82px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 4px 5px; font: inherit; font-size: .7rem; line-height: 1.15; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-x; -webkit-touch-callout: none; }
.mk-dtile .dp-icon { width: 30px; height: 30px; background: #fff; border-radius: 4px; pointer-events: none; }
.mk-dtile span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; max-width: 100%; pointer-events: none; }
.mk-dtile:hover { border-color: var(--link); background: var(--soft); }
.mk-dtile.on { border-color: var(--link); box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 35%, transparent); }
.mk-dtile.dragging { opacity: .45; }
.mk-dn { position: absolute; top: 2px; right: 3px; font-size: .62rem; line-height: 1.4; background: var(--link); color: #fff; border-radius: 999px; padding: 0 5px; }
.dp-drag-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; margin: -22px 0 0 -22px; width: 44px; height: 44px; display: grid; place-items: center; background: #fff;
  border: 2px solid var(--link); border-radius: 10px; box-shadow: var(--shadow-lg, 0 8px 20px rgba(0, 0, 0, .25)); }
.dp-drag-ghost img, .dp-drag-ghost svg { width: 32px; height: 32px; }
body.dp-dragging, body.dp-dragging * { cursor: grabbing !important; }
.mk-palette .mk-devtabs { margin: 6px 0 2px; }
.mk-palette .mk-sym { user-select: none; -webkit-user-select: none; }
.mk-an-types { display: flex; flex-direction: column; gap: 4px; }
.mk-an-row { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.mk-an-row select { max-width: 55%; font-size: .78rem; padding: 2px 4px; }
@media (max-width: 700px) { .mk-dtile { width: 72px; } .mk-an-row { flex-wrap: wrap; } .mk-an-row select { max-width: 100%; width: 100%; } }

/* 1.53: tasks as a board and a priority list (job Timeline tab and the Tasks page). */
.t-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; }
.t-col { background: color-mix(in srgb, var(--soft) 55%, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-width: 0; }
.t-col h4 { margin: 2px 4px 8px; font-size: .9rem; display: flex; gap: 6px; align-items: baseline; }
.t-col-doing h4 { color: var(--link); } .t-col-blocked h4 { color: var(--warn); } .t-col-done h4 { color: var(--ok); }
.t-drop { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 8px; transition: background .15s; }
.t-drop.over { background: color-mix(in srgb, var(--link) 12%, transparent); outline: 2px dashed var(--link); outline-offset: -2px; }
.t-empty { padding: 10px 6px; text-align: center; }
.t-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 8px; }
.t-group { margin: 14px 0 8px; }
.t-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; box-shadow: var(--shadow); min-width: 0; }
.t-card:hover, .t-card:focus-visible { border-color: var(--link); }
.t-card[draggable="true"] { cursor: grab; }
.t-card.dragging { opacity: .45; }
.t-card.done .t-title { text-decoration: line-through; color: var(--muted); }
.t-card.pri-edge-urgent { border-left-color: var(--bad); } .t-card.pri-edge-high { border-left-color: var(--warn); } .t-card.pri-edge-low { border-left-color: var(--muted); }
.t-head { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.t-title { overflow-wrap: anywhere; }
.t-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.t-cat, .t-tag { font-size: .72rem; border-radius: 999px; padding: 1px 8px; background: var(--soft); color: var(--text); }
.t-cat { background: color-mix(in srgb, var(--link) 14%, var(--card)); font-weight: 600; }
.t-meta { display: flex; gap: 10px; }
.t-move { font-size: .78rem; padding: 2px 4px; align-self: flex-start; }
.pri { flex: none; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; text-transform: uppercase; letter-spacing: .02em; }
.pri-urgent { background: var(--bad-bg); color: var(--bad); } .pri-high { background: var(--warn-bg); color: var(--warn); } .pri-low { background: var(--soft); color: var(--muted); }
.t-checks { display: flex; flex-direction: column; gap: 6px; }
.t-check-row { display: flex; gap: 6px; align-items: center; } .t-check-row input[type=text] { flex: 1; min-width: 0; }
.t-ticks { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1120px) { .t-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .t-board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; padding-bottom: 6px; }
  .t-col { flex: 0 0 86%; scroll-snap-align: start; }
  .t-filters select { max-width: 46%; }
}

/* 1.54: comparing drawing revisions (#/compare). */
.cmp { display: flex; flex-direction: column; gap: 8px; height: calc(100dvh - 120px); min-height: 420px; }
.cmp-top { padding: 10px 12px; }
.cmp-old { color: #d00; } .cmp-new { color: #0040ff; }
.cmp-body { flex: 1; display: flex; gap: 8px; min-height: 0; }
.cmp-stage { flex: 1; min-width: 0; display: flex; }
.cmp-view { position: relative; flex: 1; overflow: hidden; background: #e9edf3; border: 1px solid var(--line); border-radius: var(--radius); touch-action: none; cursor: grab; min-height: 200px; }
.cmp-view:active { cursor: grabbing; }
.cmp-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.cmp-layer canvas { display: block; }
.cmp-pair { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.cmp-pane { display: flex; flex-direction: column; min-width: 0; }
.cmp-label { font-size: .8rem; font-weight: 600; padding: 2px 4px; }
.cmp-side { width: 260px; flex: none; overflow: auto; }
.cmp-words { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.dw-revs li { padding: 4px 0; }
@media (max-width: 900px) {
  .cmp { height: auto; }
  .cmp-body { flex-direction: column; }
  .cmp-stage { flex: none; height: 62dvh; }
  .cmp-side { width: auto; max-height: 40dvh; }
  .cmp-pair { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}

/* 1.56: working offline and alerts on this device. */
.offline-bar { position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 560px);
  background: var(--warn, #b7791f); color: #fff; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow-lg, var(--shadow)); font-size: 13px; font-weight: 500; text-align: center; }
.offline-bar[hidden] { display: none; }
.offline-bar .linkbtn { color: #fff; text-decoration: underline; margin-left: 6px; }
.photo-waiting { position: relative; opacity: .75; }
.photo-waiting span { position: absolute; left: 4px; right: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 2px 4px; text-align: center; }
.notify-push { margin: 6px 0 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.notify-opt input[type=checkbox] { flex: none; }

/* 1.57: photos and videos on site: before and after, spots on drawings, the photo log. */
.thumb-stage { position: absolute; top: 4px; left: 4px; z-index: 2; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; color: #fff; pointer-events: none; }
.stage-before { background: #c2410c; }
.stage-after { background: #15803d; }
.thumb-stage + .thumb-drawn { top: 26px; }
.photo-strip .thumb-video video { aspect-ratio: 1; height: auto; }
.thumb-video video { width: 100%; height: 100%; object-fit: cover; background: #000; border-radius: inherit; display: block; }
.thumb-vid-wait { display: grid; place-items: center; font-size: 34px; height: 100%; min-height: 90px; background: var(--surface-2, #eef2f8); }
.thumb-stage-pick { flex: 1 1 100%; font-size: 12px; padding: 2px 4px; min-height: 0; height: auto; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.ph-tile { margin: 0; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ph-pic { position: relative; aspect-ratio: 4 / 3; background: #0f172a; }
.ph-pic img, .ph-pic video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-kind { position: absolute; right: 6px; top: 4px; font-size: 16px; }
.ph-tile figcaption { padding: 6px 8px 8px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.ph-pair { margin-bottom: 12px; }
.ph-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.ph-col h4 { margin: 0 0 6px; }
.ph-col .ph-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ph-filters select, .photo-strip [data-photo-stage] { width: auto; max-width: 100%; }
.spot { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 14px; align-items: start; }
.spot-crop { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
@media (max-width: 700px) {
  .spot { grid-template-columns: 1fr; }
  .ph-cols { gap: 8px; } /* before and after stay side by side */
  .ph-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ph-col .ph-grid { grid-template-columns: 1fr; }
}

/* 1.58: timesheets and the RFI / change order / submittal register. */
.ts-wrap { overflow-x: auto; }
.ts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ts-table th, .ts-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ts-table th { font-size: 12px; white-space: nowrap; }
.ts-table input[type=number] { width: 4.2em; padding: 6px 4px; text-align: right; min-height: 0; }
.ts-table select { min-width: 9em; max-width: 220px; }
.ts-table input[type=text] { min-width: 8em; }
.ts-table tfoot td { border-bottom: 0; }
.ts-decide { background: var(--hover); }
.reg-list { display: grid; gap: 8px; }
.reg-item { text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; display: grid; gap: 4px; padding: 12px 14px; }
.reg-item.on { outline: 2px solid var(--navy); }
.reg-form { margin-bottom: 12px; }
.reg-files { display: grid; gap: 2px; max-height: 220px; overflow: auto; padding: 4px 0; }
.reg-sig { max-width: 300px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: block; }
@media (max-width: 700px) {
  .ts-table thead { display: none; }
  .ts-table, .ts-table tbody, .ts-table tfoot, .ts-table tr, .ts-table td { display: block; width: 100%; }
  .ts-table tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .ts-table td { border: 0; padding: 2px; }
  .ts-table td:nth-child(1), .ts-table td:nth-child(2), .ts-table td[data-label="Notes"] { grid-column: 1 / -1; }
  .ts-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .ts-table input[type=number] { width: 100%; }
  .ts-table select { max-width: none; width: 100%; }
  .ts-table tfoot tr { background: var(--hover); }
  .ts-table tfoot td:first-child { grid-column: 1 / -1; }
}
.dw-tool.dw-pick-tool { padding: 0 10px; font-size: .9rem; font-weight: 600; }
/* 1.59: scheduled report emails and QR code sheets. */
.rp-sched.off { opacity: .7; }
.rp-sched-form .people-pick, .qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 14px; max-height: 320px; overflow: auto; }
.qr-list .check { align-items: flex-start; }
@media (max-width: 700px) { .rp-sched-form .people-pick, .qr-list { grid-template-columns: 1fr; } }
/* 1.60: the live parts list on markups. */
.mk-parts { margin: 10px 0; }
.mk-parts-t { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 6px; }
.mk-parts-t th, .mk-parts-t td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.mk-parts-t .num { text-align: right; white-space: nowrap; }
.mk-parts-t tfoot td { border-bottom: 0; }

/* 1.61: guest links and comments on drawings */
.ps-comments, .ps-links { margin-bottom: 12px; }
.ps-comments summary, .ps-links summary { cursor: pointer; }
.ps-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.ps-c { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--card); transition: box-shadow .3s; }
.ps-c.done { opacity: .65; }
.ps-c.flash { box-shadow: 0 0 0 3px var(--accent); }
.ps-form textarea { min-height: 64px; height: 64px; }
.ps-acts { gap: 12px; justify-content: flex-end; margin-top: 4px; }
.ps-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.ps-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; border: 0; background: #f59e0b; color: #111; font-weight: 700; font-size: .75rem; cursor: pointer; }
.ps-pin { position: absolute; z-index: 2; transform: translate(-50%, -100%); min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px 13px 13px 2px; border: 2px solid #fff;
  background: #f59e0b; color: #111; font-weight: 700; font-size: .8rem; line-height: 22px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer; }
.ps-pin.done { background: #94a3b8; }
.ps-pin.new { background: var(--accent); color: var(--on-accent); pointer-events: none; }
.ps-pin.flash { animation: ps-flash .5s 3; }
@keyframes ps-flash { 50% { transform: translate(-50%, -100%) scale(1.5); } }
.ps-picking .pdf-page { cursor: crosshair; outline: 2px dashed var(--accent); }
#psPick.on { background: var(--accent); color: var(--on-accent); }
.ps-shares td, .ps-shares th { vertical-align: top; }
.ps-guest .viewer-bar { top: 0; }
.viewer-split { display: flex; flex-direction: column; gap: 12px; }
.viewer-split > .pdf-pages { min-width: 0; }
@media (min-width: 1121px) {
  .viewer-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .viewer-side { position: sticky; top: 180px; max-height: calc(100vh - 196px); overflow-y: auto; }
  .viewer-side .ps-list { max-height: none; }
}
@media (max-width: 700px) { .ps-list { max-height: 260px; } }

/* 1.62: AI notetaker */
.mt-item { display: block; color: inherit; text-decoration: none; }
.mt-rows { display: flex; flex-direction: column; gap: 6px; }
.mt-row { display: grid; gap: 6px; align-items: center; }
.mt-actions .mt-row { grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr) 150px auto; }
.mt-scope .mt-row { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) auto; }
.mt-resp .mt-row { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) auto; }
#mtText { font-family: inherit; min-height: 220px; }
@media (max-width: 700px) {
  .mt-actions .mt-row { grid-template-columns: 1fr 1fr auto; }
  .mt-scope .mt-row, .mt-resp .mt-row { grid-template-columns: 1fr auto; }
  .mt-row input:first-child { grid-column: 1 / -1; }
}

/* 1.65: resizing boxes from their edges and bottom corners while the layout is unlocked (public/app.js layoutLock),
   home page boxes too (public/work.js), and the drawing editor's right-click menus (public/devplan.js). */
.arr-rs { display: none; }
body.layout-unlocked .arr-rs { display: block; position: absolute; z-index: 4; touch-action: none; user-select: none; color: var(--accent); font-size: .85rem; line-height: 1; }
body.layout-unlocked .arr-item.box-sized { overflow: hidden !important; }
.arr-rs.rs-e, .arr-rs.rs-w { top: 44px; bottom: 18px; width: 12px; cursor: ew-resize; }
.arr-rs.rs-e { right: -4px; } .arr-rs.rs-w { left: -4px; }
.arr-rs.rs-s { left: 18px; right: 18px; bottom: -4px; height: 12px; cursor: ns-resize; }
.arr-rs.rs-se, .arr-rs.rs-sw { bottom: 0; width: 22px; height: 22px; display: grid; place-items: center; }
body.layout-unlocked .arr-rs.rs-se, body.layout-unlocked .arr-rs.rs-sw { display: grid; }
.arr-rs.rs-se { right: 0; cursor: nwse-resize; } .arr-rs.rs-sw { left: 0; cursor: nesw-resize; }
.arr-rs.rs-e::after, .arr-rs.rs-w::after, .arr-rs.rs-s::after { content: ''; position: absolute; border-radius: 3px; background: color-mix(in srgb, var(--accent) 45%, transparent); opacity: .5; }
.arr-rs.rs-e::after, .arr-rs.rs-w::after { top: 50%; left: 4px; width: 4px; height: 36px; margin-top: -18px; }
.arr-rs.rs-s::after { left: 50%; top: 4px; height: 4px; width: 36px; margin-left: -18px; }
.arr-rs:hover::after, .arr-item.resizing .arr-rs::after { opacity: 1; }
.arr-item.resizing { outline-style: solid; }
.arr-item .widget-size-tip, .widget .widget-size-tip { z-index: 6; }
@media (max-width: 700px) { body.layout-unlocked .arr-rs.rs-e, body.layout-unlocked .arr-rs.rs-w, body.layout-unlocked .arr-rs.rs-sw, body.layout-unlocked .arr-rs.rs-se, body.layout-unlocked .arr-rs.rs-s { display: none; } .arr-bar [data-arr="fit"] { display: none; } }
.widget-resize.rs-e, .widget-resize.rs-w { top: 40px; bottom: 24px; width: 10px; height: auto; cursor: ew-resize; }
.widget-resize.rs-e { right: 0; left: auto; } .widget-resize.rs-w { left: 0; right: auto; }
.widget-resize.rs-s { left: 24px; right: 24px; bottom: 0; width: auto; height: 10px; cursor: ns-resize; }
.widget-resize.rs-sw { left: 2px; right: auto; cursor: nesw-resize; }
.widget-resize.rs-e::after, .widget-resize.rs-w::after, .widget-resize.rs-s::after { content: ''; position: absolute; border-radius: 3px; background: var(--muted); }
.widget-resize.rs-e::after, .widget-resize.rs-w::after { top: 50%; left: 3px; width: 4px; height: 30px; margin-top: -15px; }
.widget-resize.rs-s::after { left: 50%; top: 3px; height: 4px; width: 30px; margin-left: -15px; }
.mk-ctx-sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
/* 1.283: a row of colour swatches in the right-click menu (a device's colour). */
.mk-ctx-colours { flex-wrap: wrap; cursor: default; }
.mk-ctx-colours .dw-colour { width: 22px; height: 22px; }
.mk-ctx-item:disabled { opacity: .45; cursor: default; background: none; }
.mk-ctx-item.danger { color: var(--danger, #b91c1c); }
.mk-ctx-ic { width: 22px; text-align: center; flex: none; }
.mk-ctx { max-height: calc(100vh - 16px); overflow-y: auto; }
/* 1.68: the design check in the drawing editor (Amax's design rules from its knowledge base). */
.mk-dcheck { margin: 10px 0; }
.mk-dcheck summary { cursor: pointer; }
.dc-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.dc-list li { border-left: 3px solid var(--line, #cbd5e1); padding: 4px 0 4px 8px; display: grid; gap: 3px; }
.dc-list li.dc-problem { border-left-color: var(--bad); }
.dc-list li.dc-check { border-left-color: var(--warn); }
.dc-items { gap: 4px; flex-wrap: wrap; }
.dc-items .btn.sm { min-height: 26px; padding: 2px 8px; font-size: .8rem; }
/* 1.69: the Rooms layer (rooms found on a PDF) under the layers list. */
.dp-rooms-layer { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #cbd5e1); }

/* 1.69: the job's Design tab (public/job-design.js). */
.jd-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
.jd-stages button { width: 100%; text-align: left; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.jd-stages button:disabled { cursor: default; }
.jd-stages li.past button { background: var(--soft); color: var(--muted); }
.jd-stages li.on button { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.jd-tasks ul { margin: 6px 0 0; padding-left: 4px; list-style: none; }
.jd-provisional { border-left: 3px solid var(--bad); }
.jd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; }
.jd-grid .field.wide { grid-column: 1 / -1; }
.jd-grid .check-line { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-top: 22px; }
.jd-sec { margin: 14px 0 4px; }
.jd-list { list-style: none; margin: 0; padding: 0; }
.jd-item { padding: 8px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.jd-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
/* 1.131: the Consultancy tabs on a consultancy job (public/consultancy.js) */
.cg-stage > summary { cursor: pointer; list-style: none; gap: 8px; flex-wrap: wrap; }
.cg-stage > summary::-webkit-details-marker { display: none; }
.cg-stage.cg-approved { border-left: 4px solid #2e9d5b; }
.cg-stage.cg-exception { border-left: 4px solid #d99a1e; }
.cg-stage.cg-late { border-left: 4px solid #c4372c; }
.cg-criteria { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.cg-criteria .check-line, .cg-appointed .check-line { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.cg-appointed { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 16px; margin-top: 6px; }
.cg-approve { border-top: 1px solid var(--line); padding-top: 10px; }
.cg-raci select { min-width: 58px; padding: 4px; }
.cg-raci td input { min-width: 140px; }
.cg-raci-cell { text-align: center; font-weight: 600; }
/* 1.147: consultancy deliverables and document registers */
.cr-stage { margin: 14px 0 4px; font-size: 1rem; }
.cr-item > summary { cursor: pointer; list-style: none; gap: 8px; flex-wrap: wrap; }
.cr-item > summary::-webkit-details-marker { display: none; }
.cr-docs td { vertical-align: top; }
.jd-item .jd-reason { width: 100%; }
.jd-item.jd-open .jd-reason:placeholder-shown { opacity: .7; }
.jd-links a { word-break: break-word; }
.seg-open input:checked + span { background: var(--warn-bg); color: var(--warn); }
/* 1.69: datasheets and specification appendices on catalogue items and quotes */
.qt-doc-chips { margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.qt-doc-list { margin: 0; padding-left: 18px; }
.qt-doc-list li { margin: 3px 0; overflow-wrap: anywhere; }
/* 1.69: a rating the portal works out (e.g. likelihood × impact), coloured by its level. */
.rating-out { display: inline-block; min-width: 4.5em; padding: 3px 10px; border-radius: 99px; background: var(--track); color: var(--muted); font-weight: 600; font-size: .85rem; text-align: center; }
.rating-out[data-v="low"] { background: var(--ok-bg); color: var(--ok); } .rating-out[data-v="medium"] { background: var(--warn-bg); color: var(--warn); }
.rating-out[data-v="high"] { background: var(--bad-bg); color: var(--bad); } .rating-out[data-v="critical"] { background: var(--bad); color: var(--card); }
/* 1.69: the door and camera schedules in the markup and CCTV editor */
.mk-sched { margin: 10px 0; }
.mk-sched summary { cursor: pointer; }
.sch-box { width: min(1100px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.sch-card { border: 1px solid var(--line, #cbd5e1); border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.sch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 10px; }
.sch-grid .field { margin: 0; }
.sch-grid .sch-wide { grid-column: 1 / -1; }
.sch-gaps { color: var(--bad); }
.sch-grid textarea { min-height: 0; height: auto; }

/* 1.68.1 install labour matrix: the table scrolls inside its own box so the sideways scrollbar is always in view */
#mxRows textarea { min-height: 44px; height: 52px; font-family: inherit; resize: vertical; }
@media (min-width: 701px) {
  .mx-wrap { max-height: 70vh; overflow: auto; overscroll-behavior: contain; }
  .mx-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
  .mx-wrap td:first-child, .mx-wrap th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); }
  .mx-wrap thead th:first-child { z-index: 2; }
}

/* 1.70: ASD sampling pipes and their schedule */
.mk-asd { margin: 10px 0; }
.mk-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); border-radius: 6px; padding: 4px 8px; margin: 4px 0; }
.mk-asd-det { margin: 8px 0; }
.mk-asd-pipe { margin: 4px 0 4px 8px; }
.mk-asd-pipe > summary { cursor: pointer; }

/* ---- 1.72: menus and help ---- */
/* Page tips now live in the help guides: each page has one Help button, and the ? at the top picks what to read about. */
.tip { display: none !important; }
.page-help { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; padding: 2px 10px; vertical-align: middle; font-size: .8rem; font-weight: 600;
  border: 1.5px solid var(--line); border-radius: 999px; color: var(--link); background: var(--card); text-decoration: none; line-height: 1.6; }
.page-help:hover { border-color: var(--link); background: var(--soft); }
body.help-pick, body.help-pick * { cursor: help !important; }
.help-pick-dot { position: fixed; z-index: 10000; pointer-events: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--link); color: #fff; font: 700 14px/1 system-ui, sans-serif; box-shadow: 0 2px 6px rgba(0,0,0,.3); transform: translate(10px, 12px); }
body.help-pick .help-pick-target { outline: 2px dashed var(--link); outline-offset: 2px; }
.help-btn.picking { background: var(--link); border-color: var(--link); color: #fff; }
.admin-groups a { display: inline-flex; align-items: center; gap: 6px; }
.admin-groups .nav-icon { width: 16px; height: 16px; }
.admin-pages { margin-top: -4px; font-size: .92rem; }
.resources-tabs { margin-bottom: 6px; }

/* ---- 1.73: customers, sites and assets ---- */
.site-row { padding: 6px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; gap: 8px; }
.site-row:last-child { border-bottom: 0; }
.site-row:hover b { color: var(--link); }
.asset-photos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.asset-photos img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.asset-table td { vertical-align: top; }
.asset-test .btn.sm { padding: 3px 8px; }

/* ---- 1.74: job types, stages, archive, list view ---- */
.job-table tbody tr { cursor: pointer; }
.job-table tbody tr:hover { background: var(--soft); }
.job-table td { vertical-align: top; }
.view-pick span { padding: 5px 11px; font-size: 1rem; }
.job-badges { align-self: flex-start; }
.job-pinned { border-left: 4px solid var(--link); margin-top: 12px; }
.job-archived { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-design-ask { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.job-design-ask legend { font-weight: 600; padding: 0 4px; }
.job-type-pick input:checked + span, .view-pick input:checked + span { background: var(--link); color: #fff; }

/* 1.75: jobcards, the programme dropline */
.g-dropline { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 2; overflow: visible; }
.g-dropline polyline { fill: none; stroke: var(--bad); stroke-width: 2; stroke-linejoin: round; }
.jobcard { margin-bottom: 10px; }
.jobcard.done { opacity: .8; }
.jobcard-log { margin: 6px 0 0; padding-left: 18px; }
.jobcard-log li { margin: 3px 0; }
.jc-vals tr.current td { background: var(--panel, rgba(0,0,0,.03)); }
.jc-vals input { min-width: 0; }

/* 1.76: design drawings and the CDP on the Design tab */
#ddCdpTarget { width: auto; max-width: 280px; }
.dd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .dd-cols { grid-template-columns: 1fr; } }
.dd-table td, .dd-table th { padding: 6px 8px; }
.dd-tools > summary { cursor: pointer; padding: 6px 0; }
/* 1.78: sharing outside the portal */
.sh-panel { margin-top: 8px; }
.sh-qr { width: 180px; height: 180px; image-rendering: pixelated; background: #fff; border-radius: 8px; padding: 6px; }
/* 1.127: quotes and variations clients approve online (#/qa/<token>) */
.qa-wrap { overflow-x: auto; }
.qa-table { width: 100%; border-collapse: collapse; }
.qa-table th, .qa-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.qa-table td.num, .qa-table th.num { text-align: right; white-space: nowrap; vertical-align: top; }
.qa-table tfoot th, .qa-table tfoot td { border-top: 1px solid var(--line); background: none; color: var(--text); font-size: 1rem; text-transform: none; letter-spacing: 0; }
.qa-table .qa-desc { color: var(--muted); margin-top: 2px; max-width: 60ch; }
.qa-table tr.qa-opt td { background: var(--soft, transparent); }
.qa-terms { white-space: normal; margin: 6px 0 10px; color: var(--muted); max-height: 320px; overflow: auto; }
.sh-img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
/* 1.79: news posts as boxes: width (--span of 12) and height (--nh, scrolling inside) set by the people who post */
.news-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.news-grid > .card { grid-column: span var(--span, 12); margin: 0; min-width: 0; }
.news-box.news-fixed .news-box-body { max-height: var(--nh, 500px); overflow-y: auto; padding-right: 4px; }
.news-grid.arranging .news-box { outline: 1px dashed var(--line); cursor: grab; }
.news-grid .news-box.dragging { opacity: .5; }
.news-arrange { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) { .news-grid > .card { grid-column: span 12; } }
.t-people summary { cursor: pointer; }
.t-filters select { width: auto; max-width: 200px; }
/* 1.79.2: quote lines: drag handle, tick box, Time (mins) + Fit time, Price + keep, Markup, Sell Price, Qty, Total, Options */
.qt-lines th, .qt-lines td { vertical-align: middle; }
.qt-lines .qt-n { width: 72px; min-width: 56px; padding: 6px 6px; text-align: right; }
.qt-lines [data-k=qty].qt-n { width: 60px; }
.qt-lines input:disabled, .qt-lines select:disabled { opacity: .6; }
.qt-lines .qt-menu > summary.btn { padding: 6px 8px; }
.qt-lines th { white-space: nowrap; }
.qt-lines td, .qt-lines th { padding-left: 4px; padding-right: 4px; }
.qt-lines td .qt-n + input[type=checkbox], .qt-lines td input[type=checkbox] { width: auto; min-width: 0; }
.qt-lines .qt-r { text-align: right; }
.qt-lines .qt-grip { width: 14px; padding: 0 2px; color: var(--muted); cursor: grab; user-select: none; letter-spacing: -2px; text-align: center; }
.qt-lines .qt-grip[draggable]:active { cursor: grabbing; }
.qt-lines .qt-sel { width: 24px; }
.qt-lines tr.picked td { background: color-mix(in srgb, var(--accent, #1570ef) 8%, transparent); }
.qt-lines tr.dragging { opacity: .45; }
.qt-lines tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent, #1570ef); }
.qt-lines tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent, #1570ef); }
.qt-lines .qt-descc { min-width: 150px; max-width: 360px; }
.qt-lines .qt-desc { text-align: left; font-weight: 500; }
.qt-lines tr.qt-detail td { background: var(--soft); }
.qt-menu { display: inline-block; position: relative; }
.qt-menu > summary { list-style: none; white-space: nowrap; }
.qt-menu > summary::-webkit-details-marker { display: none; }
.qt-pop { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 6px; min-width: 200px; max-width: 280px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); text-align: left; }
.qt-pop .linkbtn { text-align: left; }
.qt-pop label { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.qt-pop select.small { width: 100%; margin-top: 0; }
.qt-pop .qt-danger { color: var(--bad); }
.qt-bulk { gap: 6px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: var(--soft); }

/* 1.79.3: home page boxes for each role: the week's hours and the quote pipeline. */
.w-hours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 90px; align-items: end; }
.w-hours > div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; }
.w-hours > div > span { width: 100%; max-width: 28px; min-height: 2px; background: linear-gradient(0deg, var(--navy), var(--accent)); border-radius: 4px 4px 0 0; }
.w-hours > div > small { color: var(--muted); font-size: 11px; }
.w-hours > div.today > small { color: var(--text); font-weight: 700; }
.w-pipe { display: grid; gap: 4px; }
.w-pipe-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.w-pipe-bar { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.w-pipe-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--navy)); }
.w-pipe-row.st-won .w-pipe-bar > i { background: var(--ok); }
.w-pipe-row.st-lost .w-pipe-bar > i { background: var(--bad); }

/* 1.80: quotes laid out like a job costing system: info bar, tabs and sub-tabs, Summary with the estimate breakdown and
   activity, and the project overview's charts. */
.qt-info { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.qt-info > div { display: flex; flex-direction: column; min-width: 120px; }
.qt-info b { font-size: 1rem; }
/* 1.245 (A4): the quote checks (public/quote-checks.js) */
#qtChecks .qc { margin-top: 10px; padding: 10px 14px; }
#qtChecks .qc > summary { cursor: pointer; }
.qc-stages { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.qc-stages ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; }
.qc-stages li.qc-ok { color: var(--muted); }
.qc-stages li.qc-block { font-weight: 600; }
.qt-sub { margin: 0 0 12px; flex-wrap: wrap; }
.qt-summary { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
#qtSummary, #jobSummary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.qt-pie { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.qt-pie svg path, .qt-pie svg circle { stroke: var(--card); stroke-width: 2; }
.qt-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.qt-legend-row { display: flex; gap: 14px; margin-bottom: 8px; }
.qt-legend li { display: flex; align-items: center; gap: 6px; }
.qt-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.qt-ch-c1 { fill: var(--navy); background: var(--navy); }
.qt-ch-c2 { fill: var(--accent); background: var(--accent); }
.qt-ch-c3 { fill: var(--ok); background: var(--ok); }
.qt-ch-c4 { fill: var(--warn); background: var(--warn); }
.qt-ch-empty { fill: var(--track); }
.qt-breakdown { width: 100%; }
.qt-breakdown th { font-weight: 500; text-align: left; }
.qt-breakdown td, .qt-breakdown th { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.qt-bd-strong th, .qt-bd-strong td { font-weight: 700; }
.qt-res summary { cursor: pointer; }
.qt-res div { margin: 4px 0 0 14px; color: var(--muted); }
.qt-act-h { margin: 6px 0 2px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.qt-sched { width: 100%; font-size: 13px; }
.qt-sched th { text-align: left; font-weight: 500; color: var(--muted); padding: 2px 6px 2px 0; width: 40%; }
.qt-timeline { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: grid; gap: 8px; font-size: 13px; }
.qt-timeline li { position: relative; }
.qt-timeline li::before { content: ''; position: absolute; left: -18px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.qt-adj { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.qt-bars { display: grid; gap: 8px; }
.qt-bar-row { display: grid; grid-template-columns: minmax(100px, 22%) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.qt-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-bar-set { display: grid; gap: 3px; }
.qt-bar { display: flex; align-items: center; gap: 6px; }
.qt-bar i { display: block; height: 12px; border-radius: 0 4px 4px 0; min-width: 2px; }
.qt-bar small { color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) {
  .qt-summary, #qtSummary, #jobSummary { grid-template-columns: minmax(0, 1fr); }
}
.qt-breakdown th, .qt-sched th { text-transform: none; letter-spacing: normal; font-size: inherit; background: none; }
.qt-breakdown th { color: var(--text); }
/* 1.80: a job's tabs, grouped: the main row, then the group's own row. */
.job-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.job-sub[hidden], .job-sub a[hidden], .job-sub .job-sub-label[hidden] { display: none; }
/* 1.379: a section label in a long row of job sub-tabs (Project Overview: Money, Running the job, Contract and set-up). */
.job-sub-label { align-self: center; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 2px 0 8px; }
.job-sub a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); font-size: .9rem; background: var(--card); }
.job-sub a.active { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.job-info { margin-bottom: 4px; }

/* 1.81: Manage → Courses grouped by training discipline */
.course-disc { padding: 0; margin-bottom: 12px; }
.course-disc > summary { cursor: pointer; padding: 12px 16px; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.course-disc > summary::-webkit-details-marker { display: none; }
.course-disc > summary::before { content: '▸'; color: var(--muted); }
.course-disc[open] > summary::before { content: '▾'; }
.course-disc .table-wrap { margin: 0; border-radius: 0 0 var(--radius, 12px) var(--radius, 12px); }
.course-disc .empty { padding: 0 16px 14px; }
/* 1.80: timesheets: choosing a range of days */
.ts-range-cols { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .ts-range-cols { grid-template-columns: 1fr; } }
.rp { user-select: none; }
.rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 6px 0; touch-action: none; }
.rp-h { font-size: .75rem; color: var(--muted); text-align: center; }
.rp-d { border: 0; background: transparent; padding: 8px 0; border-radius: 6px; cursor: pointer; color: inherit; font: inherit; }
.rp-d.out { opacity: .45; }
.rp-d.today { box-shadow: inset 0 0 0 1px var(--navy); }
.rp-d.in { background: color-mix(in srgb, var(--navy) 18%, transparent); }
.rp-d.end { background: var(--navy); color: var(--on-navy); }
.ts-range-table td.out { opacity: .4; }
.ts-range-table th, .ts-range-table td { padding: 4px 6px; text-align: center; }
/* 1.80: calendars side by side: a column per person in each day */
.tg-lanes { display: flex; width: 100%; gap: 2px; margin-top: 2px; }
.tg-lane-name { flex: 1; min-width: 0; font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-top: 3px solid var(--c); color: var(--muted); }
.tg-lane-line { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--line); pointer-events: none; }
.cal-layout { margin-left: 6px; }

/* 1.85: working on it together: who else has it open, their pointers on drawings, and the drawing editor for guests */
.cl-bar { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: 6px; }
.cl-bar[hidden] { display: none; }
.cal-live { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); margin: 8px 0; }
.cal-live[hidden] { display: none; }
#qtPeople, #jobPeople { display: flex; margin: 6px 0 0; }
#qtPeople[hidden], #jobPeople[hidden] { display: none; }
.cl-label { font-size: .78rem; color: var(--muted); }
.cl-chip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--cl, #667085); color: #fff; font-size: .68rem; font-weight: 700; box-shadow: 0 0 0 2px var(--card, #fff); cursor: default; }
.cl-names { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-off { font-size: .78rem; color: var(--warning, #b54708); }
.cl-layer { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.cl-cur { position: absolute; transform: scale(calc(1 / var(--z, 1))); transform-origin: 0 0; transition: left .12s linear, top .12s linear; }
.cl-cur[hidden] { display: none; }
.cl-dot { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--cl); box-shadow: 0 0 0 2px #fff; }
.cl-tag { position: absolute; left: 8px; top: 6px; padding: 1px 6px; border-radius: 8px; background: var(--cl); color: #fff; font-size: 11px; white-space: nowrap; }
body.dp-guest #dpExport, body.dp-guest #dpShare, body.dp-guest #dpQuote, body.dp-guest #dpFinal, body.dp-guest [data-dc="delete"], body.dp-guest [data-dc="over"],
body.dp-guest #ccAddDw, body.dp-guest .dp-set-x, body.dp-guest .dw-tab[data-pane="wiring"] { display: none !important; }
.ps-work { margin-bottom: 10px; }

/* 1.90: theme looks. A look (server/themes.js LOOKS, e.g. the SimPRO themes) sets --look-* variables; without them
   everything below falls back to the portal's own look. */
:root { --radius: var(--look-radius, 14px); --radius-sm: var(--look-radius, 10px); }
body { font-family: var(--look-font, "Inter var", Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif); }
h1, h2, h3 { font-weight: var(--look-h-weight, 700); letter-spacing: var(--look-h-spacing, -.015em); }
.btn, .btn.sm { border-radius: var(--look-btn-radius, var(--radius-sm)); }
.btn.sm { border-radius: var(--look-btn-radius, 8px); }
.tabs { background: var(--look-tabbar, color-mix(in srgb, var(--text) 3%, var(--bg))); border-radius: var(--look-tabs-radius, 12px); width: var(--look-tabs-width, fit-content); }
.tabs a { border-radius: var(--look-tab-radius, 9px); color: var(--look-tab-text, var(--muted)); }
.tabs a.active { background: var(--look-tab-active, var(--card)); color: var(--look-tab-active-text, var(--heading)); box-shadow: var(--look-tab-shadow, 0 1px 3px color-mix(in srgb, #0b1220 12%, transparent)); }
.badge, .chip, .chip-btn, .dp-chip, select.pill { border-radius: var(--look-radius, 99px); }
.side-menu a, body.signed-in #nav a, body.signed-in #nav button { border-radius: var(--look-radius, 10px); }
/* The second row of tabs (a quote's or job's Summary, Info, Settings…): a grey bar of blue links under the first, as Simpro has. */
.qt-sub, .job-sub { background: var(--look-subbar, transparent); border-radius: var(--look-tabs-radius, 8px); padding: var(--look-sub-pad, 0); width: var(--look-sub-width, auto); }
.qt-sub { border-color: var(--look-sub-line, var(--line)); display: var(--look-sub-display, inline-flex); }
.qt-sub button, .job-sub a { background: var(--look-sub-btn, var(--card)); color: var(--look-tab-text, var(--text)); border-color: var(--look-sub-line, var(--line)); }
.job-sub a { border-radius: var(--look-sub-btn-radius, 8px); }
.qt-sub button.on, .job-sub a.active { background: var(--look-sub-active, var(--navy)); color: var(--look-sub-active-text, var(--on-navy)); border-color: var(--look-sub-active, var(--navy)); font-weight: var(--look-sub-active-weight, inherit); }

/* 1.94: drawings imported with their CAD files (public/drawing-import.js) */
.di-box { width: min(1100px, 100%); }
.di-table td { vertical-align: middle; }
.di-table input, .di-table select { width: 100%; }
.di-table tr.di-ss td { color: var(--muted); }
/* 1.93.1: the Support menu's count of tickets with something new, and new tickets on the list */
#nav a .nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger, #d92d20); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; opacity: 1; }
#nav a .nav-count[hidden] { display: none !important; }
@media (min-width: 701px) {
  body.side-mini #nav a > span.nav-count:not([hidden]), body.dw-open #nav a > span.nav-count:not([hidden]) { display: block !important; position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; font-size: .62rem; }
}
tr.sup-news td { font-weight: 600; }

/* 1.99: chat (public/chat.js). Conversations down the left, the open one beside them; on phones one at a time. */
.chat { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 12px; height: calc(100dvh - 120px); min-height: 420px; }
.chat > .card { margin: 0; min-height: 0; }
.chat-list { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
#chRooms { overflow-y: auto; flex: 1; margin: 0 -8px; }
.chat-room { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: var(--radius-sm, 8px); color: var(--text); text-decoration: none; }
.chat-room:hover { background: var(--hover); }
.chat-room.active { background: var(--soft); }
.chat-room.unread b { color: var(--heading); }
.chat-room-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-room-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.chat-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger, #d92d20); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.chat-av { font-size: 1.2rem; width: 28px; text-align: center; flex: none; }
.chat-people { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.chat-pane { display: flex; flex-direction: column; padding: 0; overflow: hidden; position: relative; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-head-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chat-back { display: none; font-size: 1.3rem; text-decoration: none; padding: 0 6px; }
.chat-people-box { padding: 10px 14px; border-bottom: 1px solid var(--line); max-height: 45%; overflow-y: auto; }
.chat-member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-member-list li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.chat-empty { margin: auto; text-align: center; padding: 24px; }
.chat-day { text-align: center; margin: 8px 0 2px; }
.chat-sys { text-align: center; }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 560px); }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-who { color: var(--muted); margin: 0 8px 2px; }
.chat-bubble { background: var(--soft); color: var(--text); border-radius: 14px 14px 14px 4px; padding: 8px 12px; overflow-wrap: anywhere; max-width: 100%; display: flex; flex-direction: column; gap: 6px; }
.chat-msg.me .chat-bubble { background: var(--navy); color: var(--on-navy); border-radius: 14px 14px 4px 14px; }
.chat-msg.me .chat-bubble a { color: inherit; }
.chat-text { white-space: pre-wrap; }
.chat-img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; }
.chat-video { max-width: 100%; max-height: 320px; border-radius: 8px; }
.chat-bubble audio { max-width: 260px; height: 40px; }
.chat-meta { margin: 2px 8px 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chat-msg.me .chat-meta { flex-direction: row-reverse; }
.chat-meta button { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; opacity: 0; }
.chat-msg:hover .chat-meta button, .chat-meta button:focus { opacity: 1; }
@media (hover: none) { .chat-meta button { opacity: 1; } }
.chat-typing { min-height: 1.2em; padding: 0 14px; }
.chat-uploading { padding: 4px 14px; display: flex; align-items: center; gap: 8px; }
.chat-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: chatPulse 1s infinite; }
@keyframes chatPulse { 50% { opacity: .3; } }
.chat-compose { display: flex; gap: 6px; align-items: flex-end; padding: 10px 72px 10px 14px; /* clear of the floating page button */ border-top: 1px solid var(--line); margin: 0; }
.chat-compose textarea { flex: 1; resize: none; font: inherit; min-height: 40px; max-height: 160px; margin: 0; }
.chat-tool { flex: none; min-width: 40px; height: 40px; padding: 0 10px; }
.chat-tool.recording { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.chat-drop-hint { display: none; }
.chat-pane.drop-over .chat-drop-hint { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 1.1rem; background: color-mix(in srgb, var(--card) 80%, transparent); pointer-events: none; }
@media (max-width: 700px) {
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 90px); }
  .chat.chat-open .chat-list, .chat:not(.chat-open) .chat-pane { display: none; }
  .chat-back { display: inline; }
  .chat-msg { max-width: 88%; }
}

/* 1.100: inviting people from a page's people bar to work on it together. */
.cl-invite { padding: 2px 8px; min-height: 0; }
.cl-invite-box { margin: 8px 0; max-width: 520px; }
.chat-invite { display: flex; flex-direction: column; gap: 6px; }

/* 1.101: floating toolbars on the drawing editor (as Fieldwire has): a tool rail that can be dragged about and folded,
   and a bar over whatever is selected. */
.dw-float { position: absolute; z-index: 6; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(15, 23, 42, .25); cursor: default; touch-action: none; }
.dw-rail { left: 6px; top: 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; width: 48px; max-height: calc(100% - 12px); }
.dw-rail-body { display: flex; flex-direction: column; align-items: center; gap: 3px; overflow-y: auto; scrollbar-width: thin; }
.dw-rail.folded .dw-rail-body { display: none; }
.dw-rail.folded .dw-rail-fold { transform: rotate(-90deg); }
.dw-rail-grip, .dw-rail-fold { width: 38px; height: 20px; border: 0; background: none; color: var(--muted); cursor: grab; font-size: 14px; line-height: 1; padding: 0; border-radius: 6px; }
.dw-rail-fold, .dw-rail-turn { cursor: pointer; }
.dw-rail-turn { width: 38px; height: 20px; border: 0; background: none; color: var(--muted); font-size: 14px; line-height: 1; padding: 0; border-radius: 6px; }
.dw-rail-grip:active { cursor: grabbing; }
.dw-rail-grip:focus-visible, .dw-rail-fold:focus-visible, .dw-rail-turn:focus-visible { outline: 2px solid var(--navy); }
.dw-rail-grip:hover, .dw-rail-fold:hover, .dw-rail-turn:hover { background: var(--soft); color: var(--text); }
/* 1.284: the rail's head (grip, fold, turn) and the rail laid across the drawing instead of down it. */
.dw-rail-head { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.dw-rail.horiz { flex-direction: row; width: auto; max-width: calc(100% - 12px); max-height: none; padding: 4px 6px; }
.dw-rail.horiz .dw-rail-head { flex-direction: row; }
.dw-rail.horiz .dw-rail-grip, .dw-rail.horiz .dw-rail-fold, .dw-rail.horiz .dw-rail-turn { width: 20px; height: 36px; }
.dw-rail.horiz .dw-rail-fold { transform: rotate(-90deg); }
.dw-rail.horiz.folded .dw-rail-fold { transform: rotate(0deg); }
.dw-rail.horiz .dw-rail-body { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
.dw-rail.horiz .dw-rail-sep { width: 1px; height: 28px; margin: 0 3px; }
/* 1.286: the snap toggles (OSNAP, ORTHO, POLAR) beside the zoom buttons, as a CAD status bar has them. */
.dw-snaps { display: inline-flex; gap: 2px; margin: 0 2px; }
.dw-snap { border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: .68rem; font-weight: 700; letter-spacing: .02em; padding: 0 6px; height: 28px; border-radius: 6px; cursor: pointer; }
.dw-snap:hover { background: var(--soft); color: var(--text); }
.dw-snap[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
@media (max-width: 700px) { .dw-snap { font-size: .62rem; padding: 0 4px; } }
.dw-rt { width: 38px; min-width: 38px; height: 36px; padding: 0; border: 1px solid transparent; background: none; border-radius: 8px; font-size: 1.05rem; cursor: pointer; color: inherit; }
.dw-rt:hover { background: var(--soft); }
.dw-rt.on { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.dw-rt:disabled { opacity: .35; cursor: default; background: none; }
.dw-rail-sep { width: 28px; height: 1px; background: var(--line); margin: 3px 0; flex: none; }
/* 1.296: the ⚙ dialog for the rail's tools. */
.rail-cfg { max-width: 520px; }
.rail-cfg-list { margin: 0; padding: 0 0 0 18px; max-height: min(50vh, 420px); overflow-y: auto; }
.rail-cfg-row { padding: 2px 0; border-bottom: 1px solid var(--line); }
.rail-cfg-ic { display: inline-block; width: 1.6em; text-align: center; }
.dw-rail-empty { padding: 6px 0; }
.dw-rail-colour input { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
.dw-ctxbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 4px 6px; max-width: min(560px, calc(100% - 12px)); }
.dw-ctxbar[hidden] { display: none; }
.dw-cb { min-width: 34px; height: 32px; padding: 0 6px; border: 0; background: none; border-radius: 8px; font-size: 1rem; cursor: pointer; color: inherit; }
.dw-cb:hover, .dw-cb:focus-visible { background: var(--soft); outline: none; }
.dw-cb.danger { color: var(--bad); }
.dw-cb:disabled { opacity: .35; cursor: default; }
.dw-cb-what { font-size: .8rem; font-weight: 600; max-width: 150px; padding: 0 4px; }
.dw-cb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.dw-ctxbar .dw-colour { width: 22px; height: 22px; }
.dw-ctxbar select.dw-cb-w { width: auto; min-width: 0; height: 30px; font-size: .8rem; padding: 0 4px; margin: 0; }
@media (max-width: 700px) {
  .dw-rail { width: 44px; }
  .dw-rt { width: 34px; min-width: 34px; height: 34px; }
  .dw-cb-what { display: none; }
}
@media print { .dw-float { display: none !important; } }
/* 1.103: job finances (public/job-finance.js) */
.fin-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.fin-tile .n { font-size: 1.35rem; }
.fin-tile.fin-bad { border-color: var(--bad); } .fin-tile.fin-bad .n { color: var(--bad); }
.fin-tile.fin-warn { border-color: var(--warn); }
.fin-tile.fin-good .n { color: var(--ok); }
.fin-strip { margin-bottom: 14px; } .fin-strip .tiles { margin: 10px 0 0; }
.fin-head { margin-bottom: 10px; }
.fin-watch { display: grid; gap: 6px; margin-bottom: 10px; } .fin-watch .alert { margin: 0; }
.fin-grid { margin: 14px 0; }
.fin-big { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: var(--track); margin-bottom: 6px; }
.fin-big i { display: block; min-width: 2px; }
.fin-spent { background: var(--navy); } .fin-committed { background: var(--accent); } .fin-ctc { background: var(--warn); } .fin-free { background: var(--track); outline: 1px solid var(--line); outline-offset: -1px; }
.qt-legend i.fin-spent, .qt-legend i.fin-committed, .qt-legend i.fin-ctc, .qt-legend i.fin-free { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fin-bar { position: relative; display: inline-flex; gap: 2px; width: 110px; height: 10px; border-radius: 4px; background: var(--track); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.fin-bar i { display: block; height: 100%; } .fin-bar.over { outline: 1px solid var(--bad); }
.fin-bar .fin-limit { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); }
.fin-in { max-width: 100px; text-align: right; padding: 3px 6px; }
.fin-cc td, .fin-costs td { vertical-align: top; }
.fin-cc tfoot td, .fin-cc tfoot th { border-top: 2px solid var(--line); font-weight: 600; }
.fin-form { border-top: 1px solid var(--line); padding-top: 10px; margin: 10px 0; }
.fin-spark { width: 100%; max-width: 560px; height: auto; display: block; margin: 8px 0; }
.fin-line { fill: none; stroke: var(--navy); stroke-width: 2; } .fin-dot { fill: var(--navy); stroke: var(--card); stroke-width: 2; }
.fin-zero { stroke: var(--bad); stroke-dasharray: 4 3; stroke-width: 1; } .fin-axis { fill: var(--muted); font-size: 11px; }
.fin-w td { vertical-align: top; }
@media (max-width: 700px) { .fin-tiles { grid-template-columns: 1fr 1fr; } .fin-tile .n { font-size: 1.1rem; } }
.fin-lab td { white-space: nowrap; }
.fin-review { flex-wrap: nowrap; } .fin-review input { flex: 1; }
@media (max-width: 700px) { .fin-review { flex-wrap: wrap; } }

/* 1.104: the camera advisor in a CCTV camera's panel */
.cc-adv { border: 1px solid var(--line, #d0d7e2); border-radius: 10px; padding: 6px 10px; margin: 8px 0; }
.cc-adv > summary { cursor: pointer; padding: 2px 0; }
.cc-adv[open] > summary { margin-bottom: 6px; }
.cc-adv-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.cc-adv-r { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 8px; border: 1px solid var(--line, #d0d7e2); border-radius: 8px; }
.cc-adv-r.on { border-color: var(--primary, #003e79); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #003e79) 25%, transparent); }
.cc-adv-r.miss { opacity: .78; }
.cc-adv-ok { color: #15803d; font-weight: 600; }
.cc-adv-no { color: #b45309; }
.cc-adv-pv { margin: 8px 0 2px; }
.cc-adv-pv canvas { width: min(100%, 300px); height: auto; aspect-ratio: 533 / 551; display: block; margin: 0 auto; border-radius: 6px; background: #000; image-rendering: pixelated; }
.cc-adv-pv.big canvas { width: min(560px, 100%); }
.cc-adv-pv { cursor: zoom-in; }
.cc-adv-pv.big { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(960px, 94vw); z-index: 3000; margin: 0; padding: 12px; border-radius: 12px; background: var(--card, #fff); box-shadow: var(--shadow-lg, 0 20px 50px rgba(0,0,0,.35)); cursor: zoom-out; }

/* 1.105: cabling (cabinets, containment and the cable estimate) */
.cb-totals { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.cb-totals li { display: grid; grid-template-columns: 12px 1fr; column-gap: 6px; align-items: baseline; }
.cb-totals li > span { grid-column: 2; color: var(--muted, #667085); }
.cb-key { display: inline-block; width: 12px; height: 4px; border-radius: 2px; vertical-align: middle; }
.cb-rows { margin: 4px 0; padding-left: 18px; max-height: 260px; overflow-y: auto; font-size: .85rem; }
.cb-rows li { margin: 2px 0; }
.cb-set .inline-fields .field { min-width: 0; }
/* 1.106: Boards (public/boards.js) */
.bd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.bd-card { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; padding: 14px; }
.bd-card:hover { box-shadow: var(--shadow-lg, var(--shadow)); }
.bd-card-ic { font-size: 1.8rem; line-height: 1; }
.bd-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.bd-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.bd-tpl { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); cursor: pointer; min-width: 0; font: inherit; }
.bd-tpl.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.bd-tpl-ic { font-size: 1.4rem; }
.bd-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bd-icon { font-size: 1.8rem; background: none; border: 0; cursor: pointer; padding: 2px; line-height: 1; }
.bd-h1 { margin: 0; overflow-wrap: anywhere; }
.bd-title { outline: none; border-radius: 6px; padding: 0 4px; }
.bd-head-l { gap: 10px; min-width: 0; flex: 1 1 320px; flex-wrap: nowrap; align-items: center; }
.bd-head-l > div { min-width: 0; flex: 1; }
.bd-head-r { gap: 6px; flex-wrap: wrap; }
.bd-title[contenteditable]:hover, .bd-title:focus { box-shadow: inset 0 0 0 1px var(--line); }
.bd-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 12px; }
.bd-bar input[type=search] { max-width: 220px; }
.bd-bar select { width: auto; }
.bd-group { margin-bottom: 18px; }
.bd-ghead { display: flex; align-items: center; gap: 8px; color: var(--g); margin-bottom: 4px; }
.bd-ghead.over, .bd-ghead.over-top { outline: 2px dashed var(--g); outline-offset: 2px; border-radius: 6px; }
.bd-gtitle { font-size: 1.05rem; outline: none; padding: 0 4px; border-radius: 6px; }
.bd-gtitle[contenteditable]:hover, .bd-gtitle:focus { box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
.bd-gtog { background: none; border: 0; color: var(--g); cursor: pointer; font-size: 1rem; width: 22px; }
.bd-scroll { overflow-x: auto; border-left: 5px solid var(--g); border-radius: 6px; }
.bd-table { border-collapse: separate; border-spacing: 0; width: max-content; table-layout: fixed; background: var(--card); }
.bd-table th, .bd-table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0 8px; height: 38px; font-size: .9rem; text-align: center; white-space: nowrap; vertical-align: middle; }
.bd-table th { font-weight: 600; color: var(--muted); font-size: .8rem; background: var(--card); }
.bd-th { cursor: pointer; width: 150px; user-select: none; overflow: hidden; text-overflow: ellipsis; }
.bd-th:hover { background: var(--hover); }
.bd-th.over { box-shadow: inset -3px 0 0 var(--accent); } .bd-th.over-top { box-shadow: inset 3px 0 0 var(--accent); }
.bd-table .bd-name { position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; width: 280px; }
.bd-table td.bd-name > * { vertical-align: middle; }
.bd-table td.bd-name { overflow: hidden; }
.bd-nwrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bd-iname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.bd-iname:hover { color: var(--link); }
.bd-grip { color: var(--muted); cursor: grab; opacity: 0; font-size: .8rem; letter-spacing: -2px; }
tr:hover .bd-grip { opacity: .7; }
.bd-chat { background: none; border: 0; cursor: pointer; opacity: .35; font-size: .95rem; padding: 2px; display: inline-flex; align-items: center; gap: 1px; color: var(--text); }
.bd-chat.has, tr:hover .bd-chat { opacity: 1; }
.bd-chat small { font-size: .7rem; background: var(--accent); color: var(--on-accent, #fff); border-radius: 8px; padding: 0 5px; }
.bd-cell { cursor: pointer; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.bd-table tbody tr:hover td { background-color: var(--hover); }
.bd-table tbody tr:hover td.bd-t-status[style] { filter: brightness(.96); }
.bd-table td.bd-t-status { color: #fff; font-weight: 500; min-width: 130px; }
.bd-table td.bd-t-text, .bd-table td.bd-t-long_text { text-align: left; }
.bd-table tr.dragging { opacity: .4; }
.bd-table tr.over td { box-shadow: inset 0 -2px 0 var(--accent); } .bd-table tr.over-top td { box-shadow: inset 0 2px 0 var(--accent); }
tbody.over { outline: 2px dashed var(--accent); }
.bd-addcol { width: 48px; } .bd-addcol .linkbtn { font-size: 1.1rem; }
.bd-add td { padding: 0; } .bd-add input { border: 0; background: transparent; height: 36px; padding: 0 10px; width: 100%; box-shadow: none; }
.bd-add input:focus { background: var(--soft); }
.bd-sum td { border-bottom: 0; border-right: 0; font-size: .82rem; }
.bd-dist { display: flex; height: 20px; border-radius: 4px; overflow: hidden; gap: 2px; min-width: 100px; }
.bd-dist i { display: block; min-width: 4px; }
.bd-label { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: .8rem; }
.bd-tag { display: inline-block; border: 1px solid var(--bd); color: var(--text); border-radius: 10px; padding: 0 8px; font-size: .78rem; margin: 0 2px; background: color-mix(in srgb, var(--bd) 14%, transparent); }
.bd-avs { display: inline-flex; vertical-align: middle; }
.bd-av { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--on-navy); font-size: .7rem; font-weight: 600; border: 2px solid var(--card); margin-left: -6px; flex: none; }
.bd-avs .bd-av:first-child { margin-left: 0; }
.bd-pname { margin-left: 6px; font-size: .82rem; vertical-align: middle; }
.bd-late { color: var(--bad); font-weight: 600; }
.bd-tl { display: inline-block; position: relative; overflow: hidden; min-width: 120px; border-radius: 12px; background: var(--soft); color: var(--text); font-size: .78rem; padding: 2px 10px 4px; }
.bd-tl::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p); background: var(--navy); }
.bd-tick { color: var(--ok); font-weight: 700; font-size: 1.1rem; }
.bd-pop { position: absolute; z-index: 1200; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.18)); padding: 10px; min-width: 200px; max-width: min(92vw, 340px); }
.bd-pop-wide { min-width: 280px; }
.bd-labels { display: grid; gap: 5px; min-width: 180px; }
.bd-lab { border: 0; border-radius: 4px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: .88rem; text-align: center; display: flex; gap: 6px; justify-content: center; }
.bd-lab:hover { filter: brightness(.94); }
.bd-chk { width: 14px; text-align: left; }
.bd-clear { background: var(--soft) !important; color: var(--text) !important; }
.bd-plist { max-height: 260px; overflow: auto; margin-top: 6px; display: grid; gap: 2px; }
.bd-person { padding: 4px 2px; display: flex; gap: 8px; align-items: center; }
.bd-person .bd-av { margin-left: 0; }
.bd-pick { text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--text); font: inherit; }
.bd-pick:hover { background: var(--hover); }
.bd-menu { display: grid; gap: 2px; min-width: 200px; }
.bd-menu > button { text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--text); font: inherit; font-size: .9rem; }
.bd-menu > button:hover { background: var(--hover); }
.bd-menu > button.danger { color: var(--bad); }
.bd-types { grid-template-columns: 1fr 1fr; }
.bd-swatches { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 6px 8px; }
.bd-swatches button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.bd-swatches button.on { border-color: var(--text); }
.bd-icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.bd-icons button { font-size: 1.3rem; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 6px; }
.bd-icons button:hover { background: var(--hover); }
.bd-kanban { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 10px; }
.bd-lane { flex: 0 0 270px; background: color-mix(in srgb, var(--soft) 55%, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bd-lane.over, .bd-lane.over-top { outline: 2px dashed var(--accent); }
.bd-lane-h { padding: 8px 12px; font-weight: 600; display: flex; justify-content: space-between; }
.bd-lane-b { padding: 8px; display: grid; gap: 8px; min-height: 60px; }
.bd-kcard { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--g); border-radius: 8px; padding: 8px 10px; cursor: grab; }
.bd-kcard.dragging { opacity: .4; }
.bd-kname { font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.bd-kname:hover { color: var(--link); }
.bd-kval { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.bd-kval .bd-label { color: #fff; }
.bd-kadd { width: 100%; }
.bd-panel-bg { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 1000; }
.bd-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 1001; overflow-y: auto; border-radius: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.bd-ptitle { margin: 0; outline: none; overflow-wrap: anywhere; border-radius: 6px; padding: 0 4px; }
.bd-ptitle[contenteditable]:hover, .bd-ptitle:focus { box-shadow: inset 0 0 0 1px var(--line); }
.bd-panel select[data-pgroup] { width: auto; display: inline-block; }
.bd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.bd-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bd-fv { min-height: 34px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: .9rem; overflow: hidden; }
.bd-fv.can { cursor: pointer; } .bd-fv.can:hover { border-color: var(--accent); }
.bd-fv.bd-t-status[style] { justify-content: center; font-weight: 500; }
.bd-ptabs { margin-top: 6px; }
.bd-upd { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bd-upd-b { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.bd-log { padding: 5px 0; border-bottom: 1px solid var(--line); }
.bd-loglist { max-height: 60vh; overflow: auto; }
.bd-pfoot { margin-top: auto; padding-top: 10px; }
.bd-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1100; display: grid; place-items: center; padding: 16px; }
.bd-modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; margin: 0; }
.bd-lrow { gap: 6px; flex-wrap: nowrap; align-items: center; }
.bd-lrow input[type=color] { width: 38px; height: 34px; padding: 2px; flex: none; }
.bd-lrow input[data-k=text] { flex: 1; min-width: 0; }
.bd-mrow { padding: 4px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.bd-mrow select { width: auto; }
@media (max-width: 700px) {
  .bd-table .bd-name { width: 190px; }
  .bd-head-r { width: 100%; }
  .bd-fields { grid-template-columns: 1fr; }
  .bd-lane { flex-basis: 84vw; }
  .bd-bar input[type=search] { max-width: none; flex: 1; }
  .bd-grip { display: none; }
}

/* 1.108: Amax's clarity reference image under the camera advisor's picture */
.cc-ref-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 6px 0 4px; background: #000; padding: 4px; border-radius: 6px; }
.cc-ref-row figure { min-width: 0; margin: 0; text-align: center; opacity: .55; border-radius: 4px; padding: 2px; }
.cc-ref-row figure.on { opacity: 1; outline: 2px solid #facc15; }
.cc-ref-row img { width: 100%; height: auto; display: block; }
.cc-ref-row figcaption { color: #fff; font-size: 9px; overflow-wrap: anywhere; line-height: 1.2; font-weight: 700; margin-top: 2px; }

/* 1.109: board views (public/board-views.js): saved views, filters, calendar, timeline and Gantt */
.bd-views { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 4px 0 8px; scrollbar-width: thin; }
.bd-views button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); font: inherit; font-size: .9rem; white-space: nowrap; }
.bd-views button:hover { color: var(--text); }
.bd-views button.on { color: var(--heading, var(--navy)); border-bottom-color: var(--accent); font-weight: 600; }
.bd-views button.saved { font-style: normal; }
.bd-vmenu { padding: 0 4px; border-radius: 4px; }
.bd-vmenu:hover { background: var(--hover); }
.bd-bar .btn.on { border-color: var(--accent); color: var(--accent); }
.bd-pop-filters { min-width: min(92vw, 520px); max-width: min(96vw, 620px); }
.bd-filters { display: grid; gap: 8px; }
.bd-filters label.check { display: flex; }
.bd-frow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bd-frow select, .bd-frow input:not([type=checkbox]) { width: auto; flex: 1 1 120px; min-width: 0; }
.bd-cal-top { gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.bd-cal-m { min-width: 150px; text-align: center; }
.bd-cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.bd-cal-h, .bd-cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bd-cal-h div { padding: 6px 8px; font-size: .78rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.bd-cday { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.bd-cday:nth-child(7n) { border-right: 0; }
.bd-cday.other { background: color-mix(in srgb, var(--soft) 50%, transparent); }
.bd-cday.other .bd-cnum { opacity: .5; }
.bd-cday.today .bd-cnum { background: var(--accent); color: var(--on-accent, #fff); border-radius: 10px; padding: 0 6px; }
.bd-cday.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.bd-cnum { font-size: .78rem; align-self: flex-start; }
.bd-cchip { background: color-mix(in srgb, var(--c) 18%, var(--card)); border-left: 3px solid var(--c); border-radius: 4px; padding: 2px 6px; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.bd-cchip:hover { background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.bd-agenda { display: grid; gap: 8px; }
.bd-aday { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.bd-aday.today { border-color: var(--accent); }
.bd-aday .bd-cchip { font-size: .9rem; padding: 6px 8px; }
.bd-tlv { --tl-name: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); max-height: 75vh; }
.bd-tl-in { position: relative; width: max-content; min-width: 100%; }
.bd-tl-row { display: flex; min-height: 36px; border-bottom: 1px solid var(--line); }
.bd-tl-name { position: sticky; left: 0; z-index: 4; flex: 0 0 var(--tl-name); width: var(--tl-name); background: var(--card); border-right: 1px solid var(--line); padding: 6px 10px; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.bd-tl-g .bd-tl-name { border-left: 4px solid var(--g); color: var(--g); }
.bd-tl-g { background: color-mix(in srgb, var(--soft) 45%, transparent); }
.bd-tl-track { position: relative; flex: none; background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--px, 14px) * 7 - 1px), color-mix(in srgb, var(--line) 60%, transparent) calc(var(--px, 14px) * 7 - 1px) calc(var(--px, 14px) * 7)); }
.bd-tl-head { position: sticky; top: 0; z-index: 5; background: var(--card); min-height: 44px; }
.bd-tl-head .bd-tl-name { z-index: 6; }
.bd-scale { height: 44px; background: var(--card); }
.bd-sc-ms, .bd-sc-ds { position: relative; height: 22px; }
.bd-sc-m, .bd-sc-d { position: absolute; top: 0; height: 22px; font-size: .72rem; color: var(--muted); padding: 3px 4px; overflow: hidden; white-space: nowrap; border-left: 1px solid var(--line); }
.bd-sc-m { font-weight: 600; color: var(--text); }
.bd-sc-d.we { background: color-mix(in srgb, var(--soft) 70%, transparent); }
.bd-tl-bar { position: absolute; z-index: 2; top: 6px; height: 24px; border-radius: 12px; background: var(--c); color: var(--ink); font-size: .75rem; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: grab; touch-action: none; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.bd-tl-bar span { padding: 0 10px; overflow: hidden; text-overflow: ellipsis; flex: 1; pointer-events: none; }
.bd-tl-bar .bd-h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.bd-tl-bar .bd-h.l { left: 0; } .bd-tl-bar .bd-h.r { right: 0; }
.bd-tl-bar:hover .bd-h { background: rgba(255,255,255,.35); }
.bd-tl-bar.ms { width: 18px !important; height: 18px; top: 9px; border-radius: 3px; transform: rotate(45deg); }
.bd-ms-l { position: absolute; top: 9px; white-space: nowrap; }
.bd-tl-gbar { position: absolute; top: 14px; height: 8px; border-radius: 4px; background: var(--c); opacity: .55; }
.bd-tl-set { position: absolute; left: 8px; top: 9px; }
.bd-today { position: absolute; top: 44px; bottom: 0; width: 2px; background: var(--bad); z-index: 1; pointer-events: none; opacity: .7; }
.bd-arrows { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; overflow: visible; }
.bd-arrows path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.bd-arrows path.late { stroke: var(--bad); }
@media (max-width: 700px) { .bd-tlv { --tl-name: 130px; } .bd-pop-filters { min-width: 0; } }
/* 1.110: the DWG editor list (public/cad-editor.js) and its dialogs, also used by public/pdf-import.js */
.cd-modal-back { position: fixed; inset: 0; z-index: 200; background: #0006; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cd-modal { width: 100%; max-height: 90dvh; overflow-y: auto; }
.cd-card { display: flex; flex-direction: column; gap: 4px; }
/* 1.126: the drawing editor's palette buttons and edge-strip tabs (public/devplan.js), first made for the DWG editor. */
.cad-pb { border: 1px solid transparent; background: none; color: var(--text); cursor: pointer; width: 28px; height: 26px; border-radius: 5px; font-size: .95rem; padding: 0; }
.cad-pb:hover { background: var(--hover); border-color: var(--line); }
.cad-pb[aria-pressed="true"] { background: color-mix(in srgb, var(--navy) 14%, var(--card)); border-color: color-mix(in srgb, var(--navy) 45%, transparent); }
.cad-pb.off { opacity: .55; }
.cad-stab { writing-mode: vertical-rl; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 10px 3px; border-radius: 5px; cursor: pointer; font: inherit; font-size: .78rem; white-space: nowrap; }
.cad-stab:hover, .cad-stab[aria-expanded="true"] { background: color-mix(in srgb, var(--navy) 12%, var(--card)); border-color: color-mix(in srgb, var(--navy) 45%, transparent); color: var(--navy); }
@media (max-width: 800px) { .cad-stab { writing-mode: horizontal-tb; transform: none; padding: 5px 10px; } }


/* 1.111: board automations (public/board-auto.js) */
.ba-modal { width: min(680px, 100%); }
.ba-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--card); }
.ba-card.off { opacity: .6; }
.ba-err { color: var(--bad); margin-top: 4px; }
.bd-sw { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; cursor: pointer; }
.bd-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.bd-sw span { position: absolute; inset: 0; border-radius: 11px; background: var(--line); transition: background .15s; }
.bd-sw span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.bd-sw input:checked + span { background: var(--good, #00c875); }
.bd-sw input:checked + span::after { transform: translateX(16px); }
.bd-sw input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.ba-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ba-recipe { display: flex; gap: 8px; align-items: flex-start; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); padding: 10px; cursor: pointer; font: inherit; font-size: .88rem; }
.ba-recipe:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.ba-recipe span { font-size: 1.2rem; line-height: 1; }
.ba-sec { border-left: 3px solid var(--navy); padding: 4px 0 4px 10px; display: flex; flex-direction: column; gap: 6px; }
.ba-h { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.ba-h select { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ba-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ba-row select, .ba-row input { width: auto; max-width: 100%; min-width: 0; padding: 5px 8px; font-size: .88rem; }
.ba-row .ba-wide, .ba-row textarea { flex: 1 1 100%; width: 100%; }
.ba-who { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; flex: 1 1 100%; }
.ba-chip { background: var(--soft); border-radius: 12px; padding: 2px 8px; font-size: .82rem; }
.ba-preview { background: var(--soft); border-radius: var(--radius); padding: 8px 10px; }
.ba-sec > .linkbtn { align-self: flex-start; }
.ba-sec .ba-row + .ba-row { border-top: 1px dashed var(--line); padding-top: 8px; }

/* 1.113: dashboards (public/board-dash.js) */
.bd-tabs { margin: 8px 0 4px; }
.bd-tabs a { text-decoration: none; }
.dw-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin-top: 10px; align-items: start; }
.dw-w { grid-column: span var(--span, 6); margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dw-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dw-h h3 { margin: 0; font-size: .95rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-wtools { display: flex; gap: 6px; flex: none; }
.dw-wtools .linkbtn[disabled] { opacity: .3; pointer-events: none; }
.dw-grid.editing .dw-w { outline: 2px dashed color-mix(in srgb, var(--navy) 35%, transparent); outline-offset: 2px; }
.dw-b { min-width: 0; }
.dw-big { font-size: 2.2rem; font-weight: 700; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.dw-big.sm { font-size: 1.5rem; }
.dw-bad { color: var(--bad); }
.dw-battery { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin: 8px 0 6px; background: var(--soft); }
.dw-battery i { display: block; min-width: 3px; }
.dw-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--text); }
.dw-legend.col { flex-direction: column; gap: 4px; }
.dw-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dw-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dw-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: .84rem; }
.dw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dw-val { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; min-width: 36px; }
.dw-track { position: relative; display: flex; gap: 2px; height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.dw-track.bare { background: transparent; overflow: visible; }
.dw-track i { display: block; height: 100%; background: var(--navy); border-radius: 0 4px 4px 0; }
.dw-track.bare i:first-child { border-radius: 4px 0 0 4px; }
.dw-track.bare i:only-child, .dw-progress .dw-track i { border-radius: 4px; }
.dw-budget .dw-track:not(.bare) { overflow: visible; background: transparent; }
.dw-budget .dw-track em { position: absolute; left: 0; top: 0; bottom: 0; background: var(--soft); border-radius: 4px; }
.dw-budget .dw-track:not(.bare) i { position: relative; border-radius: 4px; background: var(--navy); }
.dw-budget .dw-row.over .dw-track i { background: var(--bad) !important; }
.dw-row.over .dw-val { color: var(--bad); }
.dw-cap { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .6; }
.dw-donut { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.dw-donut svg { width: 130px; height: 130px; flex: none; }
.dw-donut-t { font-size: 15px; font-weight: 700; fill: var(--text); }
.dw-donut .dw-legend { flex: 1; min-width: 140px; }
.dw-list { display: flex; flex-direction: column; max-height: 380px; overflow: auto; }
.dw-li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.dw-li:last-child { border-bottom: 0; }
.dw-li:hover { background: var(--soft); }
.dw-li-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dw-li-n b, .dw-li-n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-li-n b { font-weight: 600; font-size: .88rem; }
.dw-date { flex: none; width: 58px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dw-li.late .dw-date { color: var(--bad); font-weight: 600; }
.dw-chip { flex: none; font-size: .75rem; padding: 2px 8px; border-radius: 10px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-text { white-space: normal; line-height: 1.5; }
.dw-modal { width: min(620px, 100%); }
.dw-boardpick, .dw-show { display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: 200px; overflow: auto; padding: 4px 0; }
@media (max-width: 900px) { .dw-w { grid-column: span 12; } .dw-w[style*="--span:4"] { grid-column: span 6; } }
@media (max-width: 560px) { .dw-w, .dw-w[style*="--span:4"] { grid-column: span 12; } .dw-big { font-size: 1.8rem; } }

/* 1.114: workdocs (public/workdocs.js) and where the others are on boards and dashboards */
.wd-wrap { display: flex; gap: 14px; align-items: flex-start; margin-top: 10px; }
.wd-doc { flex: 1; min-width: 0; max-width: 900px; margin: 0 auto; padding: 22px 26px 40px 10px; }
.wd-side { width: 340px; flex: none; position: sticky; top: 70px; max-height: calc(100dvh - 90px); overflow: auto; margin: 0; }
.wd-b { position: relative; display: flex; align-items: flex-start; gap: 2px; padding-left: calc(var(--ind, 0) * 26px); border-radius: 6px; }
.wd-b.cm-on { background: color-mix(in srgb, #f5b301 14%, transparent); }
.wd-b.flash { animation: wdFlash 1.5s ease; }
@keyframes wdFlash { 0%, 40% { background: color-mix(in srgb, var(--navy) 18%, transparent); } 100% { background: transparent; } }
.wd-gut { width: 40px; flex: none; display: flex; justify-content: flex-end; gap: 1px; padding-top: 4px; opacity: 0; transition: opacity .12s; }
.wd-b:hover .wd-gut, .wd-b:focus-within .wd-gut { opacity: 1; }
.wd-plus, .wd-grip { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 3px; font-size: .9rem; line-height: 1.4; border-radius: 4px; }
.wd-grip { cursor: grab; letter-spacing: -2px; }
.wd-plus:hover, .wd-grip:hover { background: var(--soft); color: var(--text); }
.wd-c { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.wd-t:focus, .wd-t:focus-visible { outline: none !important; box-shadow: none !important; }
.wd-t { flex: 1; min-width: 0; outline: none; padding: 3px 2px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.wd-t:empty::before { content: attr(data-ph); color: var(--muted); opacity: 0; pointer-events: none; }
.wd-t:focus:empty::before, .wd-doc > .wd-b:only-of-type .wd-t:empty::before { opacity: .7; }
.wd-h1 .wd-t { font-size: 1.75rem; font-weight: 700; margin-top: 14px; line-height: 1.25; }
.wd-h2 .wd-t { font-size: 1.35rem; font-weight: 700; margin-top: 12px; line-height: 1.3; }
.wd-h3 .wd-t { font-size: 1.1rem; font-weight: 700; margin-top: 8px; }
.wd-mark { flex: none; min-width: 16px; text-align: right; padding-top: 3px; line-height: 1.6; color: var(--text); font-variant-numeric: tabular-nums; }
.wd-chk { flex: none; margin-top: 7px; width: 17px; height: 17px; accent-color: var(--navy); }
.wd-check.done .wd-t { text-decoration: line-through; color: var(--muted); }
.wd-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding-top: 4px; flex: none; max-width: 45%; }
.wd-who, .wd-due, .wd-item { border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 0 8px; font-size: .78rem; color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.wd-due.late { color: var(--bad); border-color: currentColor; }
.wd-chk-tools { display: none; gap: 2px; }
.wd-b:hover .wd-chk-tools, .wd-b:focus-within .wd-chk-tools { display: inline-flex; }
.wd-quote .wd-t { border-left: 3px solid var(--line); padding-left: 12px; color: var(--muted); font-style: italic; }
.wd-callout .wd-c { background: var(--soft); border-radius: 8px; padding: 8px 10px; border-left: 4px solid var(--navy); }
.wd-callout.tone-warn .wd-c { border-left-color: #e6a700; background: color-mix(in srgb, #e6a700 12%, var(--card)); }
.wd-callout.tone-good .wd-c { border-left-color: #2e9b5f; background: color-mix(in srgb, #2e9b5f 10%, var(--card)); }
.wd-callout.tone-bad .wd-c { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--card)); }
.wd-tone { border: 0; background: none; font-size: 1.1rem; cursor: pointer; padding: 2px 0 0; }
.wd-code .wd-t { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; background: var(--soft); border-radius: 6px; padding: 10px 12px; }
.wd-divider .wd-c hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.wd-t a { color: var(--link, var(--navy)); }
.wd-t code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--soft); padding: 1px 4px; border-radius: 4px; }
.wd-at { display: inline-block; background: color-mix(in srgb, var(--navy) 12%, transparent); color: var(--navy); border-radius: 8px; padding: 0 5px; font-weight: 600; white-space: nowrap; }
.wd-here { position: absolute; right: 30px; top: -9px; display: flex; gap: 4px; pointer-events: none; z-index: 2; }
.wd-here span { background: var(--cl, #667085); color: #fff; font-size: .68rem; font-weight: 600; padding: 0 6px; border-radius: 6px; line-height: 16px; white-space: nowrap; }
.wd-here span.typing { animation: wdPulse 1.2s ease-in-out infinite; }
@keyframes wdPulse { 50% { opacity: .55; } }
.wd-cm { flex: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 4px 2px; opacity: 0; }
.wd-b:hover .wd-cm, .wd-cm.has { opacity: 1; }
.wd-cm small { font-size: .7rem; margin-left: 1px; color: var(--text); font-weight: 600; }
.wd-b.dragging { opacity: .4; }
.wd-b.drop-above { box-shadow: inset 0 2px 0 var(--navy); }
.wd-b.drop-below { box-shadow: inset 0 -2px 0 var(--navy); }
.wd-end { min-height: 80px; cursor: text; }
.wd-embed { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0; background: var(--card); }
.wd-eh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.wd-eh a { text-decoration: none; }
.wd-ev { margin-left: auto; }
.wd-ev button { padding: 2px 8px; }
.wd-tbl { overflow: auto; max-height: 460px; }
.wd-tbl .bd-table { width: 100%; table-layout: auto; }
.wd-tbl .bd-name { text-align: left; }
.wd-kan { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.wd-lane { flex: 0 0 190px; background: var(--soft); border-radius: 8px; padding: 0 0 6px; display: flex; flex-direction: column; gap: 5px; max-height: 420px; overflow: auto; }
.wd-lane-h { font-size: .8rem; font-weight: 600; padding: 5px 8px; border-radius: 8px 8px 0 0; }
.wd-card { margin: 0 6px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: .84rem; color: var(--text); text-decoration: none; }
.wd-eadd input { width: 100%; margin-top: 8px; border-style: dashed; }
.wd-wbody { border: 0; box-shadow: none; padding: 0; }
.wd-fbar { position: fixed; z-index: 1300; display: flex; gap: 1px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.18)); padding: 3px; }
.wd-fbar button { border: 0; background: none; color: var(--text); min-width: 32px; height: 30px; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.wd-fbar button:hover { background: var(--soft); }
.wd-mpop { position: fixed; z-index: 1300; display: grid; min-width: 220px; max-width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.18)); padding: 4px; }
.wd-mpop button { text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-mpop button.on, .wd-mpop button:hover { background: var(--soft); }
.wd-tmenu { max-height: 360px; overflow: auto; }
.wd-tmenu input { margin-bottom: 4px; }
.wd-tmenu button[hidden] { display: none; }
.wd-tmenu button { display: flex; gap: 10px; align-items: center; text-align: left; }
.wd-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; font-size: .8rem; }
.wd-thread { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.wd-thread.resolved { opacity: .7; }
.wd-cmt + .wd-cmt { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.wd-cb { font-size: .88rem; line-height: 1.45; word-break: break-word; }
.wd-cq { border: 0; background: none; padding: 0; color: var(--muted); font-style: italic; text-align: left; cursor: pointer; display: block; margin-bottom: 4px; }
.wd-preview { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.wd-preview .wd-gut, .wd-preview .wd-cm { display: none; }
.bd-here { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--cl, #667085); color: #fff; font-size: .6rem; font-weight: 700; margin-left: 3px; flex: none; box-shadow: 0 0 0 2px var(--card); vertical-align: middle; }
.bd-cell-here { box-shadow: inset 0 0 0 2px var(--cl, var(--navy)) !important; }
.bd-phere { margin: 4px 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dw-busy { margin: 6px 0 0; color: var(--muted); }
@media (max-width: 900px) {
  .wd-wrap { flex-direction: column; }
  .wd-side { width: 100%; position: static; max-height: none; }
  .wd-doc { padding: 14px 10px 30px 0; }
  .wd-gut { width: 30px; }
  .wd-b:hover .wd-gut, .wd-b:hover .wd-cm:not(.has) { opacity: 0; }
  .wd-b:focus-within .wd-gut, .wd-b:focus-within .wd-cm { opacity: 1; }
  .wd-meta { max-width: 100%; }
  .wd-check .wd-c { flex-wrap: wrap; }
}

/* 1.115: boards integrations (public/board-integ.js) */
.bd-menu > a { display: block; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .9rem; }
.bd-menu > a:hover { background: var(--hover); }
.bdi-hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.bdi-modal { max-width: 620px; }
.bdi-body { display: grid; gap: 10px; }
.bdi-map { display: grid; gap: 6px; max-height: 46vh; overflow: auto; }
.bdi-maprow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.bdi-h { display: grid; font-weight: 600; overflow: hidden; }
.bdi-h .small { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-pteams { margin-left: 4px; }
@media (max-width: 560px) { .bdi-maprow { grid-template-columns: 1fr; gap: 2px; } }
.bdi-ch { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.bdi-ch:not(:has([data-test])) { grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto; }
@media (max-width: 560px) { .bdi-ch, .bdi-ch:not(:has([data-test])) { grid-template-columns: 1fr auto auto; } .bdi-ch > input:first-child { grid-column: 1 / -1; } }

/* 1.116: ✦ AI on boards and workdocs (public/board-ai.js) */
.bai-md { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 46vh; overflow: auto; background: var(--soft); font-size: .92rem; line-height: 1.5; }
.bai-h { font-weight: 700; color: var(--heading); margin: 8px 0 2px; }
.bai-h:first-child { margin-top: 0; }
.bai-li { padding-left: 14px; text-indent: -14px; }
.bai-q { border-left: 3px solid var(--line); padding-left: 8px; color: var(--muted); }
.bai-gap { height: 6px; }
.bai-items { display: grid; gap: 6px; max-height: 44vh; overflow: auto; }
.bai-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-weight: 400; }
.bai-item input { margin-top: 3px; width: auto; }
.bai-vals { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
/* 1.116.2: a dropdown sized by a long option (a person's or a view's name) never pushes a phone page wider than the screen. */
select { max-width: 100%; text-overflow: ellipsis; }
.bd-bar > * { max-width: 100%; min-width: 0; }

/* 1.117: a board dashboard in a home page box: its widgets flow in columns as wide as the box allows. */
.hb-dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hb-dw { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.hb-dw.wide { grid-column: 1 / -1; }
.hb-dw .dw-big { font-size: 1.8rem; }

/* 1.122: People (public/people.js): A–Z letter bar, plant types beside the plant list, catalogue picker, low stock rows. */
.az-bar { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 10px; }
.az-bar button { min-width: 26px; padding: 3px 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 6px; font-size: 12px; cursor: pointer; }
.az-bar button.active { background: var(--primary, #003e79); color: #fff; border-color: transparent; }
.az-bar button:disabled { opacity: .35; cursor: default; }
.people-tabs { width: auto; max-width: 100%; }
.pe-split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.pe-types { display: flex; flex-direction: column; gap: 2px; }
.pe-types a { padding: 5px 8px; border-radius: 6px; text-decoration: none; color: inherit; }
.pe-types a.active, .pe-types a:hover { background: color-mix(in srgb, var(--primary, #003e79) 12%, transparent); }
.pe-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; float: left; margin-right: 8px; }
.pe-pick { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; max-height: 240px; overflow: auto; }
.pe-pick button { text-align: left; padding: 6px 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 6px; cursor: pointer; }
.pe-pick button:hover { border-color: var(--primary, #003e79); }
tr.pe-low td { background: color-mix(in srgb, #d92d20 7%, transparent); }
/* 1.144: the camera barcode scanner and kit lists */
.scan-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow: auto; }
.scan-box { width: 100%; max-width: 460px; margin-top: 4vh; display: flex; flex-direction: column; gap: 8px; }
.scan-video { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.scan-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-aim { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.scan-bad { color: var(--bad); }
.kt-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kt-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.kt-tick { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kt-inst { padding: 8px 0; border-bottom: 1px solid var(--line); }
.kt-return { margin: 8px 0; }
.kt-collect { border-left: 4px solid var(--accent); }
.jc-kit { margin: 2px 0 6px; }
@media (max-width: 700px) { .pe-split { grid-template-columns: 1fr; } .pe-types { flex-direction: row; flex-wrap: wrap; } .pe-types > b, .pe-types > p { width: 100%; } }
/* 1.120: Simpro's hover flyouts on Quotes, Jobs and Materials in the side menu: the lists to open and what to create. */
.nav-fly { position: fixed; z-index: 2000; min-width: 300px; max-width: min(460px, calc(100vw - 20px)); background: color-mix(in srgb, var(--navy, #003e79) 88%, #000); color: var(--on-navy, #fff);
  border-radius: 0 var(--look-radius, 10px) var(--look-radius, 10px) 0; box-shadow: 0 14px 34px rgba(11, 18, 32, .35); padding: 10px 14px 12px; }
.nav-fly[hidden] { display: none; }
.nav-fly-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin-bottom: 4px; }
.nav-fly-cols { display: flex; gap: 28px; }
.nav-fly-col { display: flex; flex-direction: column; min-width: 120px; }
.nav-fly-h { font-size: .74rem; opacity: .7; margin: 2px 0 4px; }
.nav-fly a { color: inherit; text-decoration: none; padding: 5px 0; font-size: .9rem; opacity: .92; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.nav-fly a:hover, .nav-fly a:focus-visible { opacity: 1; text-decoration: underline; }
.nav-fly-plus { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--on-navy, #fff); color: var(--navy, #003e79); font-weight: 700; font-size: .75rem; line-height: 1; }

/* 1.120: Simpro's list pages: a row of record tabs, a grey band of stage tabs, the heading with its count, and the table. */
.sp-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line, #dde3ea); margin: 6px 0 0; }
.sp-tabs a { padding: 8px 16px; text-decoration: none; color: var(--link, #1f7fd1); font-size: .88rem; border-radius: 6px 6px 0 0; }
.sp-tabs a.active { background: var(--soft, #eef2f6); color: var(--heading, #1b2430); font-weight: 600; }
.sp-stages { display: flex; gap: 4px; flex-wrap: wrap; background: var(--soft, #eef2f6); padding: 6px 10px; margin-bottom: 12px; }
.sp-stages a { padding: 6px 14px; text-decoration: none; color: var(--link, #1f7fd1); font-size: .85rem; border-radius: 6px; }
.sp-stages a.active { color: var(--heading, #1b2430); font-weight: 700; }
.sp-stages a .badge { margin-left: 4px; font-size: .7rem; }
.sp-crumb { font-size: .85rem; margin: 0 0 4px; }
.sp-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: middle; background: var(--sp-dot, #c7ced8); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
table.sp-list { font-size: .84rem; }
table.sp-list th { white-space: nowrap; font-size: .78rem; }
table.sp-list th[data-sort] { cursor: pointer; user-select: none; }
table.sp-list th[data-sort]::after { content: ' ▾'; opacity: .45; }
table.sp-list th[data-sort].asc::after { content: ' ▴'; opacity: 1; }
table.sp-list th[data-sort].desc::after { content: ' ▾'; opacity: 1; }
table.sp-list td.num, table.sp-list th.num { text-align: right; white-space: nowrap; }
table.sp-list tbody tr { cursor: pointer; }
@media (max-width: 700px) { .sp-stages { overflow-x: auto; flex-wrap: nowrap; } .sp-stages a { white-space: nowrap; } }

/* 1.121: Simpro's yellow Warnings bar on a job. */
.sp-warn { background: #fde68a; color: #3d2c00; border-radius: var(--look-radius, 8px); padding: 8px 14px; margin: 8px 0; }
.sp-warn summary { cursor: pointer; font-weight: 600; }
.sp-warn ul { margin: 6px 0 2px 18px; padding: 0; }

/* 1.123: Cost Centre List → Linked Variations: Simpro's Create Variation menu. */
.lv-panel .lv-make { position: relative; }
.lv-panel .lv-make > summary { list-style: none; cursor: pointer; }
.lv-panel .lv-make > summary::-webkit-details-marker { display: none; }
.lv-panel .lv-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 260px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }

/* 1.125: a job's Attachments as Simpro's: the bar (drop zone, Templates, Create Folder, list or grid), the list's
   columns and the grid's tiles. */
.att-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.att-drop { display: block; border: 2px dashed var(--field-line); border-radius: var(--look-radius, 8px); padding: 18px; text-align: center; cursor: pointer; margin: 0; font-weight: normal; }
.att-drop:hover, .att-bar.drop-over .att-drop { border-color: var(--accent, #2563eb); background: color-mix(in srgb, var(--accent, #2563eb) 6%, transparent); }
.att-menu-wrap { position: relative; }
.att-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 5; min-width: 240px; gap: 6px; padding: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.att-view { display: inline-flex; gap: 0; margin-left: auto; }
.att-view .btn { border-radius: 0; }
.att-view .btn:first-child { border-radius: 8px 0 0 8px; }
.att-view .btn:last-child { border-radius: 0 8px 8px 0; }
.att-table { width: 100%; margin: 6px 0; }
.att-table td { vertical-align: top; }
.att-table td:nth-child(n+5), .att-table th:nth-child(n+5) { text-align: center; width: 56px; }
.att-table .file-actions { margin-top: 2px; }
.att-aud { max-width: 190px; } /* 1.248 (A7): who a file is for */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 8px 0; }
.att-tile { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--field-line); border-radius: var(--look-radius, 8px); padding: 8px; min-width: 0; background: var(--card); }
.att-thumb { display: flex; align-items: center; justify-content: center; height: 110px; background: color-mix(in srgb, var(--muted) 8%, transparent); border-radius: 6px; overflow: hidden; font-size: 2.6rem; text-decoration: none; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-email-pick { max-height: 220px; overflow: auto; border: 1px solid var(--field-line); border-radius: 8px; padding: 6px 10px; }
@media (max-width: 700px) {
  .att-table .att-by, .att-table .att-size { display: none; }
  .att-view { margin-left: 0; }
  .att-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.att-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.att-tile .file-actions { display: flex; flex-wrap: wrap; gap: 2px 4px; overflow-wrap: anywhere; }
.att-tile .file-actions select { max-width: 100% !important; width: 100%; }
.att-table th.att-by { width: 130px; } .att-table th:nth-child(3) { width: 130px; } .att-table th.att-size { width: 70px; }
@media (max-width: 700px) {
  .table-wrap .att-table td:first-child { display: block; overflow-wrap: anywhere; }
  .att-table .file-actions { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 6px; }
  .att-table .file-actions select { max-width: 100% !important; }
}
/* 1.136: a job's Project controls tab (public/project-controls.js). RAG colours are fixed so they mean the same everywhere. */
.pc-rag { display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; background: #e5e7eb; color: #374151; }
.pc-rag-green { background: #1f8a4c; color: #fff; } .pc-rag-amber { background: #f0a020; color: #1a1a1a; } .pc-rag-red { background: #c62828; color: #fff; }
.pc-ragline .pc-rag { font-size: 1.15rem; padding: 4px 16px; }
.pc-ragcard { border-left: 6px solid #c7ced8; } .pc-ragcard-green { border-left-color: #1f8a4c; } .pc-ragcard-amber { border-left-color: #f0a020; } .pc-ragcard-red { border-left-color: #c62828; }
.pc-ragform { flex: 1; min-width: 240px; max-width: 460px; } .pc-ragform textarea { min-height: 0; font-family: inherit; }
.pc-ragpick { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.pc-five { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pc-five li { display: grid; grid-template-columns: minmax(150px, 250px) 1fr; gap: 10px; padding: 8px 10px; border-radius: 8px; border-left: 4px solid #c7ced8; background: var(--bg, transparent); }
.pc-five li.pc-ok { border-left-color: #1f8a4c; } .pc-five li.pc-warn { border-left-color: #f0a020; } .pc-five li.pc-bad { border-left-color: #c62828; }
@media (max-width: 700px) { .pc-five li { grid-template-columns: 1fr; gap: 2px; } }
.pc-score { display: inline-block; min-width: 26px; text-align: center; padding: 1px 6px; border-radius: 6px; background: #e5e7eb; color: #1a1a1a; font-weight: 700; }
.pc-score-mid { background: #fde7b0; } .pc-score-high { background: #c62828; color: #fff; }
tr.pc-overdue td:first-child { box-shadow: inset 3px 0 0 #c62828; }
.pc-in { width: 100%; min-width: 140px; }
.pc-tiles { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.pc-cdm { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; display: grid; gap: 8px; }
/* 1.143: gates, the handover grid and the daily huddle (public/project-gates.js). */
/* 1.247 (A6): the six lifecycle stages */
.pg-lifecycle { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.pg-lifecycle li span { margin-left: 8px; }
.pg-lifecycle li.pg-lc-done b { color: var(--muted); }
.pg-lifecycle li.pg-lc-current b { color: var(--accent, #1e7a4c); }
.pg-lifecycle li.pg-lc-current::marker { content: "▶ "; }
.pg-gates { display: grid; gap: 8px; }
.pg-gate { border: 1px solid var(--line); border-left: 4px solid #c7ced8; border-radius: var(--radius); padding: 8px 12px; }
.pg-gate.pg-ready { border-left-color: #f0a020; } .pg-gate.pg-signed { border-left-color: #1f8a4c; }
.pg-gate > summary { cursor: pointer; }
.pg-gate table { width: 100%; }
.pg-grid th { font-size: .75rem; white-space: normal; min-width: 70px; }
.pg-cell { min-width: 40px; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); cursor: pointer; font-weight: 700; }
.pg-cell.pg-yes { background: #1f8a4c; color: #fff; border-color: #1f8a4c; } .pg-cell.pg-na { background: #e5e7eb; color: #374151; }
.pg-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.pg-huddle { margin-bottom: 12px; }

/* 1.144: the markup, CCTV and ASD editors' side panel as dockable palettes (public/devplan.js applySpace), as the
   DWG editor's: docked left or right (stacked, with a width bar), or hidden at the side as tabs that slide them out on hover. */
.dp .dw-main { position: relative; }
.dw-dock { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.dw-dock[hidden], .dw-dstrip[hidden], .dw-dfly[hidden], .dw-hold, .dw-palmenu[hidden] { display: none; }
.dw-main > [data-dstrip="left"] { order: -2; } .dw-main > [data-ddock="left"] { order: -1; }
.dw-main > [data-ddock="right"] { order: 1; } .dw-main > [data-dstrip="right"] { order: 2; }
.dw-pal { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dw-pal > .dw-pal-b { flex: 1; min-height: 0; overflow: auto; border: 0; border-radius: 0; box-shadow: none; }
.dw-dockh { display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: .85rem; flex: none; }
.dw-dsplit { position: absolute; top: 0; bottom: 0; left: -8px; width: 6px; cursor: col-resize; touch-action: none; z-index: 2; border-radius: 3px; }
[data-ddock="left"] > .dw-dsplit { left: auto; right: -8px; }
.dw-dsplit:hover, .dw-dsplit.on, .dw-dsplit:focus-visible { background: color-mix(in srgb, var(--navy) 35%, transparent); outline: none; }
.dw-dfly { position: absolute; top: 0; bottom: 0; z-index: 30; display: flex; flex-direction: column; min-width: 200px; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); border-radius: var(--radius); }
.dw-dfly > .dw-pal { flex: 1; }
.dw-dstrip { display: flex; flex-direction: column; gap: 4px; padding: 6px 2px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; overflow-y: auto; }
.dw-dstrip[data-dstrip="left"] .cad-stab { transform: rotate(180deg); }
.dw-palmenu { position: absolute; top: 4px; right: 4px; z-index: 40; min-width: 220px; box-shadow: var(--shadow); }
@media (max-width: 900px) {
  .dw-dsplit, [data-dpal-act="side"], [data-dpal-act="pin"] { display: none !important; }
  .dw-dock { order: 1 !important; }
  .dw-pal { flex: none; max-height: 70vh; }
}
/* 1.145: a cost centre's Schedule tab, as Simpro's: hours, the week calendar (half-hour rows, lunch, bookings coloured by
   whose they are, the slot being dragged) and Help me decide's map. */
.ccs-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.ccs-stats label { margin: 0; font-weight: normal; }
.ccs-over { color: var(--danger, #b42318); }
.ccs-weeknav { gap: 8px; align-items: center; }
.ccs-bulk { gap: 8px; flex-wrap: wrap; align-items: center; }
.ccs-cal { margin-top: 8px; }
.ccs-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.ccs-legend span { padding: 1px 8px; border-radius: 6px; }
.ccs-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ccs-grid { display: grid; grid-template-columns: 48px repeat(5, minmax(96px, 1fr)) repeat(2, minmax(70px, .7fr)); min-width: 640px; border: 1px solid var(--field-line); border-radius: 8px; overflow: hidden; background: var(--card); }
.ccs-head { position: sticky; top: 0; padding: 4px; font-size: .8rem; font-weight: 600; text-align: center; border-left: 1px solid var(--field-line); border-bottom: 1px solid var(--field-line); background: var(--card); }
.ccs-head:first-child { border-left: 0; }
.ccs-head.today { color: var(--accent, #2563eb); }
.ccs-allday { margin-top: 3px; font-weight: normal; font-size: .72rem; border-radius: 4px; padding: 1px 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ccs-times { font-size: .7rem; color: var(--muted); }
.ccs-times div { border-top: 1px solid var(--field-line); padding: 1px 4px; box-sizing: border-box; }
.ccs-col { position: relative; height: calc(var(--rows) * var(--row)); border-left: 1px solid var(--field-line); cursor: crosshair; user-select: none;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row) * 2 - 1px), var(--field-line) calc(var(--row) * 2 - 1px), var(--field-line) calc(var(--row) * 2)); }
.ccs-col.weekend { background-color: color-mix(in srgb, var(--muted) 6%, transparent); }
.ccs-lunch { position: absolute; left: 0; right: 0; font-size: .68rem; color: var(--muted); text-align: center; background: repeating-linear-gradient(45deg, transparent 0 4px, color-mix(in srgb, var(--muted) 18%, transparent) 4px 8px); pointer-events: none; }
.ccs-blk { position: absolute; left: 2px; right: 2px; border-radius: 4px; padding: 1px 4px; font-size: .7rem; line-height: 1.2; overflow: hidden; cursor: default; box-sizing: border-box; }
.ccs-this { background: #2563eb; color: #fff; }
.ccs-job { background: #93c5fd; color: #0b2a55; }
.ccs-other_job { background: #fcd34d; color: #3d2c00; }
.ccs-leave { background: #d1d5db; color: #1f2937; }
.ccs-ghost { position: absolute; left: 2px; right: 2px; border: 2px dashed #2563eb; background: rgba(37, 99, 235, .15); border-radius: 4px; font-size: .72rem; font-weight: 600; padding: 1px 4px; pointer-events: none; box-sizing: border-box; }
.ccs-map { position: relative; overflow: hidden; max-width: 100%; border-radius: 8px; background: #e5e7eb; }
.ccs-map img { position: absolute; width: 256px; height: 256px; }
.ccs-pin { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); border: 2px solid #fff; }
.ccs-pin.site { background: none; border: 0; box-shadow: none; font-size: 1.6rem; transform: translate(-50%, -90%); }
.ccs-pin.free { background: #15803d; }
.ccs-pin.busy { background: #6b7280; }
.ccs-attr { position: absolute; right: 4px; bottom: 2px; font-size: .62rem; background: rgba(255,255,255,.8); color: #333; padding: 0 4px; border-radius: 3px; }
/* 1.146: a cost centre's Contractor tab and work orders (public/work-orders.js). */
.wo-group { margin-top: 6px; }
.wo-ghead { flex-wrap: wrap; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.wo-row { cursor: pointer; }
.wo-row:hover td, .wo-row:focus-visible td { background: var(--hover, rgba(0,0,0,.03)); }
.wo-row[aria-expanded="true"] td { border-bottom: 0; }
.wo-detail { padding: 4px 0 8px; min-width: 0; }
.wo-log { margin: 4px 0; padding-left: 18px; }
.wo-form .inline-fields { flex-wrap: wrap; }
/* 1.147: the catalogue in Simpro's layout (public/catalogue.js) */
.ct-det { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 760px) { .ct-det { grid-template-columns: 1fr; } }
.ct-sup > div { display: grid; grid-template-columns: minmax(60px, auto) 52px auto; gap: 8px; white-space: nowrap; }
.ct-items td { vertical-align: top; }

/* 1.148: the site diary and client updates (public/site-diary.js) */
.sd-wf { overflow-x: auto; }
.sd-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.sd-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 2px 4px; }
.sd-table td { padding: 2px 4px; }
.sd-table input { width: 100%; }
.sd-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.sd-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.sd-pick label { position: relative; cursor: pointer; margin: 0; }
.sd-pick input { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; }
.sd-pick input:checked + img { outline: 3px solid var(--link); }

/* 1.154: the customer portal (public/client-portal.js) */
.cp-wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
.cp-head { border-bottom: 3px solid var(--heading); padding-bottom: 10px; align-items: flex-end; }
.cp-docs { margin: 6px 0 0; padding-left: 18px; }
.cp-visit { padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent, #2a78d6) 12%, transparent); } /* 1.186: today's visit */
.cp-docs li { margin: 3px 0; }
.cp-person { border-top: 1px solid var(--line); padding-top: 6px; gap: 8px; flex-wrap: wrap; }
.cpr .inline-fields { align-items: center; }

/* 1.156: Simpro's new quote flow (public/quote-new.js) */
.nq-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .nq-grid { grid-template-columns: 1fr; } }
.nq-find { position: relative; }
.qt-cclist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 12px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.qt-cclist label[hidden] { display: none; }
dialog.qt-convert { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--line); }
dialog.qt-convert::backdrop { background: rgb(11 18 32 / 45%); }
.qt-steps li { color: var(--muted); }
.qt-steps li.now { color: var(--text); font-weight: 600; }
.qt-steps li.done { color: var(--muted); text-decoration: line-through; }

/* 1.155: leads and sales analysis (public/leads.js) */
.ld-grid { align-items: start; }
.ld-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ld-acts li { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.ld-gng { width: 100%; } .ld-gng td { padding: 4px 6px; vertical-align: middle; } .ld-gng td:last-child { width: 70px; }
.ld-bar { display: inline-block; height: 8px; width: var(--w, 0%); max-width: 100%; min-width: 2px; background: var(--navy, #1b3a5c); border-radius: 4px; vertical-align: middle; }
td .ld-bar { margin-left: 6px; max-width: 60px; }
td:last-child > .ld-bar:only-child { margin-left: 0; max-width: 100%; }
.ld-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ld-reasons li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 3px 0; }
.ld-big { font-size: 1.6rem; font-weight: 700; }
.ld-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.ld-grid input[type=datetime-local], #ldNew input[type=datetime-local] { width: 100%; padding: 9px 11px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; background: var(--card); color: inherit; }
/* 1.157: a job's Transmittals tab and the recipient's page (public/transmittals.js) */
.tx-docs td { vertical-align: top; }
.tx-rec { align-items: flex-end; }
.tx-card > summary { cursor: pointer; }
.tx-links { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.tx-doc { min-width: 0; overflow-wrap: anywhere; }
/* 1.161: design reviews on transmittals */
.tx-revs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tx-revs li { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.tx-cmts td { vertical-align: top; min-width: 0; overflow-wrap: anywhere; } .tx-cmts textarea { width: 100%; min-width: 0; margin: 4px 0; } .tx-cmts .row { flex-wrap: wrap; }
/* 1.159: the job's ⋯ More menu (QR codes, tech support, download, copy to cloud, keep on this device). */
.job-more, .job-more[open] { position: relative; display: inline-block; border: 0; padding: 0; margin: 0; background: none; box-shadow: none; }
.job-more > summary { list-style: none; cursor: pointer; }
.job-more > summary::-webkit-details-marker { display: none; }
.job-more-menu { position: absolute; z-index: 30; left: 0; top: calc(100% + 4px); min-width: 220px; max-width: calc(100vw - 32px); gap: 8px; padding: 10px 12px; }
.job-more-menu > * { display: block; text-align: left; margin: 0; }


/* 1.162: the Reports page as Simpro's: categories down the side, a card for each report (public/reports.js) */
.rp-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 10px; }
.rp-cats { display: flex; flex-direction: column; padding: 6px; gap: 2px; position: sticky; top: 70px; }
.rp-cats a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.rp-cats a:hover { background: var(--hover, rgb(0 0 0 / 5%)); }
.rp-cats a.active { background: var(--heading); color: #fff; }
.rp-cats a.active .muted { color: inherit; opacity: .8; }
.rp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.rp-card { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--text); }
.rp-card > span.stack { display: flex; flex-direction: column; min-width: 0; }
.rp-card:hover { border-color: var(--link); }
.rp-ic { font-size: 1.6rem; line-height: 1; flex: none; width: 36px; text-align: center; }
@media (max-width: 760px) {
  .rp-layout { grid-template-columns: 1fr; }
  .rp-cats { position: static; flex-direction: row; overflow-x: auto; }
  .rp-cats a { white-space: nowrap; }
}

/* 1.160: the weekly report card on Project controls (public/project-reports.js). */
.pr-suggest { border-left: 4px solid var(--border, #d0d5dd); padding: 8px 10px; border-radius: 6px; background: var(--soft, rgba(0,0,0,.03)); }
.pr-suggest.pc-ok { border-left-color: #1f8a4c; } .pr-suggest.pc-warn { border-left-color: #f0a020; } .pr-suggest.pc-bad { border-left-color: #c62828; }
.pr-reasons { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.pr-reasons li { padding: 4px 8px; border-left: 3px solid #c7ced8; } .pr-reasons li.pc-ok { border-left-color: #1f8a4c; } .pr-reasons li.pc-warn { border-left-color: #f0a020; } .pr-reasons li.pc-bad { border-left-color: #c62828; }
.pr-weekly textarea { min-height: 64px; font-family: inherit; field-sizing: content; max-height: 50vh; }
.pr-exceptions summary { cursor: pointer; }
.pr-weekly textarea[readonly] { background: var(--soft, rgba(0,0,0,.03)); }
/* 1.167: QR site sign-in on the Diary tab (public/site-signin.js) */
.si-card > summary { cursor: pointer; }
.si-url { overflow-wrap: anywhere; }
.si-table td { vertical-align: top; overflow-wrap: anywhere; }
.si-in { border-left: 4px solid var(--ok, #12805c); }

/* 1.166: the home page as Simpro's dashboard, classic and new (public/home-dash.js) */
.hd > * + * { margin-top: 14px; }
.hd-view { width: auto; max-width: 100%; }
.hd-weather { white-space: nowrap; }
.hd-tools { justify-content: flex-end; align-items: center; }
#hdSettings { font-size: 1.05rem; line-height: 1; min-width: 36px; }
.hd-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hd-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
/* 1.423: My day and Email help side by side on the dashboard; one alone takes the row, none leaves no gap. */
.hd-today > :only-child { grid-column: 1 / -1; }
.hd-today:empty { display: none; }
/* 1.424: an email's to-do: closed ones fade, "looks done" ones stand out until confirmed or kept. */
.eh-state { margin-top: 2px; }
.eh-state.done { color: var(--muted); }
.eh-state.looks { padding: 4px 6px; border-radius: 6px; background: var(--warn-bg); }
li.eh-closed b { text-decoration: line-through; color: var(--muted); }
/* 1.432: Email help sections that fold away (as the side menu's), the Outlook app / web links and the folder line. */
.eh-sec-h { margin: 18px 0 6px; }
.eh-sec.eh-sub .eh-sec-h { margin: 8px 0 4px; font-size: .9rem; }
.eh-sec-btn { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.eh-sec-btn:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 2px; border-radius: 4px; }
.eh-caret { display: inline-block; width: 1em; font-size: .8em; }
.eh-open a + a { margin-left: 4px; font-size: .85em; }
.eh-move { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eh-filed { color: var(--muted); }
.t-card .t-src { color: var(--muted); }
.hd-table td:first-child a { white-space: nowrap; }
/* 1.420: one Dashboard layout (public/home-dash.js hdDashboard): every colour from the theme, headings in sentence case. */
.hd-panel { min-width: 0; }
.hd-h { font-size: 1.05rem; margin: 0 0 8px; color: var(--heading); letter-spacing: -0.01em; }
.hd-head { gap: 8px 16px; align-items: flex-end; }
.hd-hello h1 { margin: 0; letter-spacing: -0.02em; }
.hd-jobs { min-width: 0; }
.hd-jobs .table-wrap { max-width: 100%; }
.hd-jobs .hd-table td { overflow-wrap: anywhere; }
.hd-seg button { min-height: 44px; }
.hd-seg button:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.hd-scroll { max-height: 260px; overflow: auto; }
.hd-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hd-alerts a { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.hd-alerts a:hover { border-color: var(--link); }
.hd-count { background: var(--bad); color: var(--card); font-weight: 700; border-radius: 4px; padding: 0 8px; min-width: 32px; text-align: center; }
.hd-count.zero { background: var(--track); color: var(--muted); }
.hd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hd-list li { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; overflow-wrap: anywhere; }
.hd-time { display: inline-block; background: var(--soft); color: var(--link); border-radius: 999px; padding: 0 8px; font-size: .8rem; font-weight: 600; }
.hd-rem-head { margin-bottom: 6px; gap: 6px; }
.hd-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.hd-seg button { border: 0; background: var(--card); color: var(--text); padding: 4px 12px; cursor: pointer; font: inherit; }
.hd-seg button.on { background: var(--accent); color: var(--on-accent); }
.hd-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.hd-table th, .hd-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.hd-table th { position: sticky; top: 0; background: var(--card); white-space: nowrap; }
.hd-table .right { text-align: right; white-space: nowrap; }
.hd-table .neg, .hd .neg { color: var(--bad); }
.hd-pager { margin-top: 8px; }
.hd-chart { width: 100%; height: auto; display: block; }
.hd-chart .hd-grid { stroke: var(--line); stroke-width: 1; }
.hd-chart .hd-axis { fill: var(--muted); font-size: 11px; }
.hd-chart .hd-cross { stroke: var(--muted); stroke-width: 1; opacity: 0; }
.hd-chart .hd-hit circle { opacity: 0; }
.hd-chart .hd-hit:hover .hd-cross, .hd-chart .hd-hit:hover circle { opacity: 1; }
.hd-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; color: var(--muted); }
.hd-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.hd-bars { display: grid; gap: 8px; }
.hd-bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 48px; gap: 8px; align-items: center; cursor: default; }
.hd-bar-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-bar-track { display: grid; gap: 2px; }
.hd-bar { display: block; height: 10px; border-radius: 0 4px 4px 0; min-width: 2px; }
.hd-bar-row.two .hd-bar { height: 8px; }
.hd-bar-val { text-align: right; color: var(--muted); }
.hd-tip { position: fixed; z-index: 100; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 6px; padding: 6px 8px; font-size: .8rem; pointer-events: none; max-width: 260px; }
.hd-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hd-kpi { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); border-top: 4px solid var(--link); }
.hd-kpi.bad { border-top-color: var(--bad); } .hd-kpi.warn { border-top-color: var(--warn); } .hd-kpi.info { border-top-color: var(--link); }
.hd-kpi:hover { border-color: var(--link); }
.hd-kpi-n { font-size: 1.8rem; line-height: 1.1; }
.hd-kpi-ic { font-size: 1.4rem; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); flex: none; }
.hd-kpi-act { color: var(--link); }
.hd-dialog { max-width: min(560px, calc(100vw - 32px)); width: 100%; }
.hd-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.hd-targets { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
@media (max-width: 900px) { .hd-row3, .hd-row2, .hd-row2.wide-r { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .hd-kpis { grid-template-columns: 1fr; } .hd-tools { justify-content: flex-start; } }
.hd-chart { max-height: 300px; }
.hd-kpi > span.stack { display: flex; flex-direction: column; min-width: 0; }
.hd-pager select { width: auto; }
.hd-bar[style*="width:0%"] { min-width: 0; }

/* 1.164: the portfolio page and its home box (public/portfolio.js, public/home-boxes.js). */
.pf-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 10px 0; font-size: .75rem; font-weight: 700; }
.pf-bar > span { display: flex; align-items: center; justify-content: center; min-width: 22px; border-radius: 0; padding: 0; }
.pf-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.pf-job { border-left: 5px solid #c7ced8; } .pf-job.pf-red { border-left-color: #c62828; } .pf-job.pf-amber { border-left-color: #f0a020; } .pf-job.pf-green { border-left-color: #1f8a4c; }
.pf-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 0; font-size: .85rem; }
.pf-facts dt { color: var(--muted, #667085); font-size: .75rem; } .pf-facts dd { margin: 0; }
.tile.pf-t-red .n { color: #c62828; } .tile.pf-t-amber .n { color: #b7791f; } .tile.pf-t-green .n { color: #1f8a4c; }
a.tile { text-decoration: none; color: inherit; }
.pf-ai p { line-height: 1.5; }
.pf-bar > .pc-rag-none { background: #e5e7eb; color: #374151; }

/* 1.171: Schedules → Day view, Simpro's dispatch board (public/day-board.js) */
.db-head { margin: 6px 0 10px; }
.db-strip { display: flex; gap: 4px; align-items: stretch; overflow-x: auto; padding-bottom: 4px; }
.db-day { display: flex; flex-direction: column; align-items: center; min-width: 44px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); text-decoration: none; font-size: .72rem; line-height: 1.2; }
.db-day b { font-size: 1rem; }
.db-day.wkend { background: var(--hover); }
.db-day.today { border-color: var(--accent); }
.db-day.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.db-tools { margin: 10px 0; gap: 14px; }
.db-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.db-wrap.with-swift { grid-template-columns: minmax(0, 1fr) 300px; }
.db-board { overflow: auto; padding: 0; max-height: calc(100vh - 220px); }
.db-grid { position: relative; }
.db-row { display: flex; border-bottom: 1px solid var(--line); min-height: var(--rowh); }
.db-row.away .db-name { color: var(--muted); }
.db-row.drop { background: var(--soft); }
.db-name { position: sticky; left: 0; z-index: 3; width: 190px; flex: none; padding: 6px 8px; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.db-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-line { position: relative; flex: none; }
.db-axis { position: sticky; top: 0; z-index: 4; min-height: 26px; background: var(--card); }
.db-axis .db-name { z-index: 5; }
.db-axis .db-line span { position: absolute; top: 5px; font-size: .72rem; color: var(--muted); padding-left: 4px; border-left: 1px solid var(--line); height: 20px; }
.db-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.db-now { position: absolute; top: 0; bottom: 0; border-left: 2px solid #c62828; z-index: 2; }
.db-lunch { position: absolute; top: 2px; bottom: 2px; background: color-mix(in srgb, #c62828 14%, var(--card)); color: #a11d1d; font-size: .7rem; padding: 2px 4px; border-radius: 4px; overflow: hidden; }
.db-allday { position: absolute; left: 0; right: 0; top: 2px; display: flex; gap: 4px; overflow: hidden; z-index: 1; }
.db-chip { font-size: .7rem; padding: 0 6px; border-radius: 4px; background: var(--track); color: var(--text); text-decoration: none; white-space: nowrap; }
.db-chip.job { background: var(--soft); color: var(--link); }
.db-row:has(.db-allday) .db-block { top: 20px; }
.db-block { position: absolute; top: 4px; bottom: 4px; z-index: 2; background: color-mix(in srgb, var(--accent) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--card)); border-left: 4px solid var(--accent);
  border-radius: 4px; padding: 2px 5px; font-size: .74rem; line-height: 1.25; overflow: hidden; cursor: pointer; color: var(--text); touch-action: none; user-select: none; }
.db-block.other { background: var(--track); border-color: var(--line); border-left-color: var(--muted); cursor: default; }
.db-block.movable { cursor: grab; }
.db-block.approved { border-left-color: var(--ok); }
/* 1.207: suggested bookings, to approve or reject */
.db-block.suggested { border: 2px dashed var(--accent, #c8102e); background: color-mix(in srgb, var(--card, #fff) 80%, var(--accent, #c8102e) 20%); opacity: .92; padding-right: 64px; }
.db-sug-act { position: absolute; right: 4px; top: 4px; display: flex; gap: 2px; }
.db-sug-act .btn { padding: 0 6px; min-height: 22px; line-height: 20px; }
.db-sugbar { margin: 8px 0; }
.db-block.missing { border-left-color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.db-block .db-miss { color: var(--bad); font-weight: 600; white-space: nowrap; }
.db-block .db-sub, .db-block .db-pc { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-block .db-pc { font-weight: 600; }
.db-dragging { opacity: .35; }
.db-ghost { position: absolute; bottom: auto; height: calc(var(--rowh) - 8px); z-index: 6; opacity: .9; box-shadow: var(--shadow); pointer-events: none; }
.db-swift { position: sticky; top: 70px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; gap: 6px; }
.db-swift-list { overflow: auto; display: grid; gap: 6px; }
.db-un { border: 1px solid var(--line); border-left: 4px solid #e0a100; border-radius: 6px; padding: 6px 8px; background: var(--card); cursor: grab; touch-action: none; user-select: none; }
.db-un-ghost { position: fixed; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 4px 8px; border-radius: 6px; font-size: .8rem; pointer-events: none; box-shadow: var(--shadow); }
@media (max-width: 900px) { .db-wrap.with-swift { grid-template-columns: minmax(0, 1fr); } .db-swift { position: static; max-height: 70vh; } .db-name { width: 120px; } }

/* 1.168: the capacity heat map (public/capacity.js) */
.cap-wrap { overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); max-width: 100%; }
.cap-map { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.cap-map th, .cap-map td { padding: 3px; text-align: center; white-space: nowrap; font-size: 13px; }
.cap-map .cap-name { position: sticky; left: 0; z-index: 1; background: var(--card, var(--bg)); text-align: left; min-width: 130px; max-width: 180px; white-space: normal; padding: 4px 8px; }
.cap-map th.cap-name { text-transform: none; letter-spacing: 0; font-size: 13px; color: inherit; }
.cap-map .cap-wk { font-weight: 600; font-size: 12px; }
.cap-cell { width: 54px; min-height: 30px; border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12px; color: #1d2939; }
.cap-cell.on { outline: 2px solid var(--accent, #1f4e8c); outline-offset: 1px; }
.cap-free { background: #e8f1fb; } .cap-ok { background: #b7e4c7; } .cap-busy { background: #ffd98a; } .cap-over { background: #f4a3a3; } .cap-away { background: #e4e7ec; color: #667085; }
.cap-tot td, .cap-tot th { font-size: 12px; border-top: 1px solid var(--line); }
.cap-short { color: #b42318; font-weight: 700; }
.cap-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.cap-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cap-items, .cap-uns { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; overflow-wrap: anywhere; }

/* 1.175: custom fields on jobs and quotes (public/custom-fields.js) */
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; }
.cf-grid .field { margin: 0; }
.cf-req { color: #c0392b; font-weight: 700; }
.cf-missing input, .cf-missing select { border-color: #c0392b; box-shadow: 0 0 0 1px #c0392b33; }
.cf-need { background: #c0392b; color: #fff; }
.cf-dialog { max-width: min(440px, calc(100vw - 32px)); }
.cf-dialog::backdrop { background: #0006; }
/* 1.328: My share links (public/share-links.js) */
.sl-dialog { max-width: min(520px, calc(100vw - 32px)); width: 100%; }
.sl-dialog::backdrop { background: #0006; }
.sl-table td:last-child { white-space: nowrap; }
@media (max-width: 700px) { .sl-table td:last-child { white-space: normal; } }
.cf-table input:not([type=checkbox]), .cf-table select { min-width: 110px; width: 100%; }

/* 1.172: the look-ahead on Project controls (public/look-ahead.js) */
.la-weeks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.la-week { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; display: grid; gap: 6px; align-content: start; }
.la-tasks, .la-other, .la-cons { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.la-tasks > li { border-left: 3px solid var(--line); padding: 2px 0 2px 8px; }
.la-tasks > li.la-ready { border-left-color: #1f8a4c; } .la-tasks > li.la-blocked { border-left-color: #c62828; }
.la-cons li, .la-other li { padding-left: 8px; border-left: 3px solid transparent; }
.la-cons li.pc-warn, .la-other li.pc-warn { border-left-color: #f0a020; } .la-cons li.pc-bad, .la-other li.pc-bad { border-left-color: #c62828; }
.la-ok { color: #1f8a4c; }
.la-behind { border: 1px solid #f3c2c2; border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; }

/* 1.180: purchase orders (public/purchase-orders.js) */
.pord-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
.pord-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pord-row { cursor: pointer; }
.pord-row:hover td { background: var(--hover, #f3f6fa); }
.pord-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pord-hits { display: grid; gap: 4px; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.pord-hit { text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: inherit; font: inherit; overflow-wrap: anywhere; }
.pord-hit:hover, .pord-hit:focus { background: var(--hover, #eef3f9); }
.pord-lines input { min-width: 0; width: 100%; }
.pord-total td { border-top: 2px solid var(--line); }
.pord-dialog { max-width: min(560px, calc(100vw - 32px)); }
.pord-dialog::backdrop { background: #0006; }
/* 1.183: the customer's feedback survey (public/job-feedback.js): five big score buttons that wrap on a phone. */
.fb-scores { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fb-score { margin: 0; cursor: pointer; }
.fb-score input { position: absolute; opacity: 0; pointer-events: none; }
.fb-score span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; text-align: center; font-weight: 600; }
.fb-score span b { font-size: 1.8em; line-height: 1; }
.fb-score span small { font-weight: normal; font-size: .72em; color: var(--muted); }
.fb-score input:checked + span { border-color: var(--accent, #0b4f8a); box-shadow: 0 0 0 2px var(--accent, #0b4f8a) inset; }
.fb-score input:focus-visible + span { outline: 2px solid var(--accent, #0b4f8a); outline-offset: 2px; }

/* 1.182: customer invoices (public/invoices.js) */
.inv-totals { display: grid; gap: 4px; justify-content: end; margin-top: 8px; }
.inv-totals > div { display: flex; justify-content: space-between; gap: 24px; min-width: min(360px, 100%); }
.inv-grand { border-top: 2px solid var(--line); padding-top: 4px; font-size: 1.05em; }
/* 1.184: the maintenance planner (public/maintenance.js) */
.mnt-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 8px 0; }
.mnt-filters .field { margin: 0; min-width: 130px; flex: 1 1 130px; }
.mnt-table tr.mnt-assets > td { background: var(--surface-2, rgba(0,0,0,.03)); padding: 8px 10px; }
.mnt-bulk select, .mnt-bulk input { width: auto; }
@media (max-width: 640px) { .mnt-table tr.mnt-assets > td { display: block; } .mnt-filters .field { flex-basis: 45%; } }

/* 1.189: Help → Workflows, the mindmaps (public/workflows.js). */
a.card.wf-banner { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; margin: 14px 0 4px; border-left: 4px solid var(--accent); }
.wf-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wf-banner b { color: var(--heading); font-size: 1.05rem; }
.wf-banner-icon { font-size: 1.8rem; }
.wf-card { position: relative; padding-left: 52px; }
.wf-num { position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--wf); color: #fff; font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.wf-map { padding: 10px; overflow-x: auto; }
.wf-map svg { display: block; width: 100%; height: auto; max-height: 78vh; }
.wf-node { cursor: pointer; } .wf-node:hover rect:first-child, .wf-node:focus rect:first-child { stroke-width: 4; }
.wf-outline { padding-left: 0; list-style: none; counter-reset: wf; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.wf-outline > li { counter-increment: wf; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--wf); border-radius: var(--radius); padding: 10px 12px; }
.wf-outline > li > b::before { content: counter(wf) ". "; color: var(--wf); }
.wf-outline ul { margin: 6px 0 0; padding-left: 18px; }
.wf-pager { margin-top: 16px; }
.wf-present { position: fixed; inset: 0; z-index: 1000; background: var(--bg); color: var(--text); display: flex; flex-direction: column; padding: 18px 24px; outline: none; }
.wf-present-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.wf-present-head h1 { margin: 2px 0 4px; color: var(--heading); } .wf-present-head p { margin: 0; max-width: 900px; }
.wf-present-map { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px 0; }
.wf-present-map svg { width: 100%; height: 100%; }
.wf-present-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* 1.202: ⚡ automatic and ✦ AI marks, the ⬇ Picture choices, and Work → Mindmaps (public/mindmaps.js). */
.wf-tag { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: -3px; }
.wf-tag-auto { background: #d97706; } .wf-tag-ai { background: #7c3aed; }
.wf-counts { margin: -6px 0 10px; }
.wf-pic { position: relative; } .wf-pic > summary { list-style: none; cursor: pointer; } .wf-pic > summary::-webkit-details-marker { display: none; }
.wf-pic-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; padding: 6px; display: grid; gap: 2px; box-shadow: var(--shadow-lg, var(--shadow)); }
.wf-pic-menu button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.wf-pic-menu button:hover { background: var(--hover); }
.mm-group { margin-top: 18px; } .mm-group h2 { margin: 0; }
.mm-edit { display: grid; grid-template-columns: minmax(280px, 2fr) 3fr; gap: 14px; align-items: start; }
.mm-edit textarea { width: 100%; min-height: 420px; }
.mm-help { margin-top: 6px; } .mm-help .linkbtn { font-size: 1rem; padding: 0 2px; }
.mm-preview { min-height: 420px; position: sticky; top: 70px; }
@media (max-width: 900px) { .mm-edit { grid-template-columns: minmax(0, 1fr); } .mm-preview { position: static; } }
.mm-edit > * { min-width: 0; } /* 1.376: the preview scrolls inside its box on a phone instead of widening the page */
/* 1.277: the visual mindmap editor (public/mindmap-editor.js) and the templates. */
.mm-tpl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-tpl { display: flex; flex-direction: column; gap: 4px; }
.mm-thumb { height: 120px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; overflow: hidden; margin-bottom: 6px; }
.mm-thumb svg { width: 100%; height: 100%; } .mm-thumb-text { font-size: 2.6rem; color: var(--muted); }
.mme { display: flex; flex-direction: column; gap: 8px; height: calc(100vh - 120px); min-height: 440px; }
/* 1.279: the whole browser window, as the drawing editors (see public/mindmap-editor.js space()). */
body.mme-open #app.container { max-width: none; padding: 8px 10px; }
@media (min-width: 701px) { body.mme-open .appbar:not([hidden]) { display: none; } body.mme-open .menu-tabs { display: none; } }
body.mme-full-on { overflow: hidden; }
.mme.mme-full { position: fixed; inset: 0; z-index: 48; height: auto; padding: 8px 10px; background: var(--bg); overflow: auto; }
.mme.mme-bare .mme-body { grid-template-columns: 1fr; } .mme.mme-bare .mme-pal, .mme.mme-bare .mme-props { display: none; }
.mme-tools [aria-pressed="true"] { background: var(--navy, #003e79); color: var(--on-navy, #fff); border-color: var(--navy, #003e79); }
.mme-bar, .mme-bar2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mme-title { flex: 1 1 260px; font-size: 1.2rem; font-weight: 700; }
.mme-bar2 > input { flex: 1 1 300px; } .mme-bar2 select { max-width: 320px; }
.mme-tools { gap: 6px; flex-wrap: wrap; } .mme-zoom { display: inline-flex; align-items: center; gap: 4px; } .mme-zoom span { min-width: 42px; text-align: center; }
.mme-snap { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mme-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr 270px; gap: 10px; }
.mme-pal, .mme-props { overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mme-props h3 { margin: 0; } .mme-props .field { margin: 0; } .mme-props input[type=text] { width: 100%; }
.mme-chip { padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); cursor: grab; user-select: none; touch-action: none; font-weight: 600; font-size: .9rem; }
.mme-chip:hover, .mme-chip:focus { border-color: var(--accent); outline: none; }
.mme-chip-topic { border-radius: 18px; border-color: #1f7fd1; background: color-mix(in srgb, #1f7fd1 12%, var(--card)); }
.mme-chip-note { background: #fff4c2; border-color: #d4b84a; color: #1b2333; border-radius: 4px; }
.mme-ghost { position: fixed; z-index: 2000; pointer-events: none; opacity: .85; box-shadow: var(--shadow); max-width: 220px; }
.mme-lib summary, .mme-keys summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.mme-lib input { width: 100%; margin: 6px 0; } .mme-lib-list { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow: auto; }
.mme-lib-list .mme-chip { font-weight: 500; font-size: .82rem; padding: 5px 8px; }
.mme-stage { position: relative; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; outline: none;
  background-color: var(--card); background-image: radial-gradient(circle, color-mix(in srgb, var(--muted) 35%, transparent) 1px, transparent 1.2px); }
.mme-stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.mme-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; }
.mme-svg:active { cursor: grabbing; }
.mme-node { cursor: move; } .mme-link { cursor: pointer; }
.mme-selbox { fill: none; stroke: var(--accent, #1f7fd1); stroke-width: 2; stroke-dasharray: 5 4; }
.mme-handle { fill: var(--card); stroke: var(--accent, #1f7fd1); stroke-width: 2; opacity: 0; cursor: crosshair; transition: opacity .12s; }
.mme-node:hover .mme-handle, .mme-node.sel .mme-handle { opacity: 1; }
.mme-handle:hover { fill: var(--accent, #1f7fd1); }
.mme-rubber { fill: none; stroke: var(--accent, #1f7fd1); stroke-width: 2.5; stroke-dasharray: 6 4; } .mme-rubber-end { fill: var(--accent, #1f7fd1); }
.mme-band { fill: color-mix(in srgb, var(--accent, #1f7fd1) 12%, transparent); stroke: var(--accent, #1f7fd1); stroke-dasharray: 4 3; }
.mme-seg { display: flex; flex-wrap: wrap; gap: 4px; } .mme-seg button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: .85rem; }
.mme-seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.mme-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.mme-sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--card); background: var(--sw); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.mme-sw.on { box-shadow: 0 0 0 2px var(--text); } .mme-sw-auto { width: auto; border-radius: 11px; padding: 0 8px; background: var(--card); color: var(--text); font-size: .75rem; }
@media (max-width: 1100px) { .mme-body { grid-template-columns: 170px 1fr 230px; } }
@media (max-width: 800px) {
  .mme:not(.mme-full) { height: auto; }
  .mme.mme-bare .mme-pal, .mme.mme-bare .mme-props { display: flex; }
  .mme-body { grid-template-columns: 1fr; }
  .mme-stage { height: 62vh; order: -1; }
  .mme-pal { flex-direction: row; flex-wrap: wrap; } .mme-pal > .small, .mme-keys { display: none; } .mme-lib { flex-basis: 100%; }
}
@media (max-width: 700px) {
  .wf-map svg { width: 900px; max-width: none; max-height: none; }
  .wf-present { padding: 12px 16px; } .wf-present-head h1 { font-size: 1.2rem; }
  .wf-banner .btn { display: none; }
}
@media print {
  .wf-tools, .wf-pager, .page-help, .wf-pic-menu { display: none !important; }
  .wf-map { border: 0; box-shadow: none; } .wf-map svg { max-height: none; }
}
/* 1.193: a customer request's conversation in the customer portal */
.cp-thread > div { padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.cp-thread > .cp-us { border-left: 3px solid var(--heading); }
.cp-thread > .cp-them { border-left: 3px solid var(--line); }
/* 1.219: Administration → Deployment & compliance (public/briefing.js). The presentation keeps 16:9; the analysis gets
   most of the screen. Printing the compliance pack prints the pack alone. */
.briefing-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0b1d36; }
.briefing-frame iframe { display: block; width: 100%; border: 0; }
.briefing-frame.deck iframe { aspect-ratio: 16 / 9; height: auto; max-height: 75vh; }
.briefing-frame.page { background: #f4f6fa; }
.briefing-frame.page iframe { height: calc(100vh - 230px); min-height: 480px; }
/* 1.266: presenting where a frame can't go full screen (iPhone): the frame fills the window, with ✕ to come back. */
.briefing-frame.filling { position: fixed; inset: 0; z-index: 10000; border: 0; border-radius: 0; }
.briefing-frame.filling iframe, .briefing-frame.page.filling iframe { width: 100%; height: 100%; max-height: none; min-height: 0; aspect-ratio: auto; }
.briefing-close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 1; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(14, 39, 71, .85); color: #ffffff; font-size: 18px; line-height: 1; cursor: pointer; }
body.briefing-filling { overflow: hidden; }
.briefing-slides { columns: 2 260px; margin: 8px 0 0; padding-left: 1.6em; }
.briefing-slides li { break-inside: avoid; padding: 2px 0; }
.briefing-pack table { font-size: .9rem; }
@media print {
  body.briefing-printing .topbar, body.briefing-printing .appbar, body.briefing-printing .admin-groups, body.briefing-printing .admin-pages,
  body.briefing-printing #app > h1, body.briefing-printing .no-print { display: none !important; }
  body.briefing-printing .briefing-pack { border: 0; box-shadow: none; padding: 0; }
}
.briefing-slides .linkbtn { text-align: left; }
/* 1.250 (B1): device stages */
.dv-dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; background: var(--dv); vertical-align: -1px; }
.dv-dot.dv-ring { box-shadow: 0 0 0 2px var(--card, #fff), 0 0 0 3.5px var(--dv); margin: 0 3px; }
.dv-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 6px; background: var(--line); }
.dv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 12px; margin-top: 8px; }
.dv-item { font-weight: normal; margin: 0; align-items: center; gap: 6px; }
/* 1.251 (B2): the contract register */
.ct-table textarea { min-height: 2.2em; }
.ct-rag.ct-red { border-color: #dc2626; } .ct-rag.ct-amber { border-color: #f59e0b; } .ct-rag.ct-green { border-color: #16a34a; }

/* 1.254 (B5): handover note text keeps its line breaks */
.pre-wrap { white-space: pre-wrap; margin: 0; font: inherit; }
.qt-bid summary { cursor: pointer; }

/* 1.255 (B6): a simple bar for planned maintenance hours */
.meter { height: 10px; border-radius: 6px; background: var(--line, #e5e7eb); overflow: hidden; }
.meter > span { display: block; height: 100%; }
/* 1.273: files for Maxi (dropped, pasted or chosen with 📎) */
.ai-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; border-top: 1px solid var(--line); max-height: 120px; overflow-y: auto; }
.ai-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); font-size: .8rem; }
.ai-file.err { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.ai-file.up { opacity: .8; }
.ai-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-file.err .ai-file-name { white-space: normal; }
.ai-file-x { background: transparent; border: 0; color: inherit; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; flex: none; }
.ai-file-x:hover { background: var(--hover); }
.ai-files:not([hidden]) ~ .ai-form { border-top: 0; }
.ai-clip { color: var(--text); flex: none; height: 40px; }
.ai-clip:hover { background: var(--hover); }
.ai-sent-file { display: block; margin-top: 4px; font-size: .8rem; opacity: .85; }
.ai-drop-hint { display: none; }
.ai-panel.drop-over { outline: 3px dashed var(--accent, #1f7fd1); outline-offset: -3px; }
.ai-panel.drop-over .ai-drop-hint { display: flex; position: absolute; inset: 56px 0 0; align-items: center; justify-content: center; font-weight: 600; background: color-mix(in srgb, var(--card) 85%, transparent); pointer-events: none; z-index: 2; }
.mk-tb-note { margin: 4px 0 8px; padding: 6px 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent, #2563eb) 12%, transparent); }
/* 1.289: the part of the drawing in view, drawn again sharp once a zoom or pan settles (over the base canvas, under the shapes). */
.dw-stage .dw-detail { position: absolute; left: 0; top: 0; pointer-events: none; background: transparent; box-shadow: none; }
.dw-stage .dw-detail[hidden] { display: none; }
/* 1.316: the AI clean-up's preview panel over the drawing */
.cl-prev { top: 10px; left: 10px; width: min(340px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; touch-action: auto; }
.cl-prev .cl-parts { display: flex; flex-direction: column; gap: 2px; }
.cl-prev .cl-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.cl-prev .cl-note { background: var(--bg); border-radius: 8px; padding: 6px 8px; }
/* 1.329: AI lesson videos (ai-video.js) */
.ai-video .aiv-stage { position: relative; width: 100%; background: #000; border-radius: 8px; overflow: hidden; }
.ai-video .aiv-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ai-video .aiv-caption { position: absolute; left: 4%; right: 4%; bottom: 5%; padding: 6px 10px; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: clamp(13px, 2.2vw, 20px); line-height: 1.35; text-align: center; }
.ai-video .aiv-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 30px; cursor: pointer; }
.ai-video .aiv-stage:fullscreen { border-radius: 0; }
.aiv-scenes textarea { min-height: 64px; min-width: 180px; }

/* 1.339: course content protection (public/content-protect.js) */
.cp-on { position: relative; }
.cp-nocopy, .cp-nocopy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cp-nocopy input, .cp-nocopy textarea, .cp-nocopy select { -webkit-user-select: text; user-select: text; }
.cp-on img, .cp-on video { -webkit-user-drag: none; }
.cp-wm-wrap { position: relative; display: block; }
.cp-wm-wrap > video { display: block; width: 100%; }
.cp-wm-wrap:fullscreen { background: #000; display: flex; align-items: center; justify-content: center; }
.cp-wm-wrap:fullscreen > video { max-height: 100vh; }
.cp-full-open { overflow: hidden; }
.cp-full-button { display: block; margin: 6px 0; }
.cp-full-player { position: relative; background: #000; color: #fff; }
.cp-full-page { position: fixed !important; inset: 0 !important; z-index: 100000 !important; width: 100% !important; height: 100vh; height: 100dvh; margin: 0 !important; border-radius: 0 !important; box-sizing: border-box; }
.cp-full-player:is(.cp-full-page, :fullscreen, :-webkit-full-screen) { display: flex; flex-direction: column; justify-content: center; padding: 52px 12px 12px; padding-top: max(52px, env(safe-area-inset-top)); overflow: auto; }
.cp-full-player > video { min-height: 0; max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); object-fit: contain; }
.cp-full-player.ai-video .aiv-stage { flex: 1; min-height: 0; border-radius: 0; }
.cp-full-player.ai-video .narr-controls { flex-shrink: 0; flex-wrap: wrap; }
.cp-full-player.ai-video .muted { color: #ddd; }
.cp-full-close { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); z-index: 5; }
.cp-full-player > .cp-full-button { display: none; }
.slide-deck.cp-full-player { display: block; background: var(--card); color: var(--text); }
.slide-deck.cp-full-player .deck-bar { top: 0 !important; }
.slide-deck.cp-full-player .slide img { max-height: calc(100dvh - 160px); width: auto; max-width: 100%; margin: 0 auto; }
.cp-wm { position: absolute; z-index: 3; pointer-events: none; padding: 2px 6px; border-radius: 4px; font: 600 12px/1.3 Arial, sans-serif;
  color: rgba(255, 255, 255, .62); background: rgba(0, 0, 0, .18); text-shadow: 0 1px 2px rgba(0, 0, 0, .55); white-space: nowrap; transition: left 1.2s, top 1.2s; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.aiv-stage { position: relative; }
.cp-wm-page { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .07; background-repeat: repeat; }
.cp-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, .85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cp-lightbox img { max-width: 100%; max-height: 92vh; -webkit-user-drag: none; user-select: none; }
.cp-lightbox > button { position: absolute; top: 12px; right: 12px; }
@media print { body.cp-noprint #app, body.cp-noprint .cp-lightbox { display: none !important; } body.cp-noprint::after { content: 'Course content can\'t be printed.'; display: block; padding: 40px; font: 16px Arial, sans-serif; } }
/* Guest learners' pages (#/learn) */
.gl-wrap { max-width: 960px; margin: 0 auto; }
.gl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gl-head img { height: 40px; }
/* 1.341: scrambled lesson text stays hidden until its own font has loaded (public/content-protect.js) */
.cp-text-wait { visibility: hidden; min-height: 3em; }
/* 1.363: the lesson's own font on the box and everything in it: code, pre, kbd and headings would otherwise pick a font
   that can't draw the private codes and show boxes (the passwords in Cyber Security lesson 4). Code keeps its shaded box. */
.cp-text-on, .cp-text-on *:not(button, button *, input, select, textarea) { font-family: var(--cp-font) !important; }
/* 1.346: 🎙 Talk to Maxi, the day's jobcard by voice (public/voice-jobcard.js) */
.vj { max-width: 720px; }
.vj-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%; padding: 12px 14px; }
.vj-go { font-size: 1.05rem; padding: 12px 16px; }
.vj-chat { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding: 10px; }
.vj-turn { display: flex; }
.vj-turn span { padding: 8px 12px; border-radius: 14px; max-width: 85%; line-height: 1.4; }
.vj-turn.maxi span { background: color-mix(in srgb, var(--navy) 12%, transparent); }
.vj-turn.engineer { justify-content: flex-end; }
.vj-turn.engineer span { background: var(--navy); color: var(--on-navy); }
.vj-controls { display: flex; align-items: center; gap: 12px; }
.vj-controls .vc-mic { width: 76px; height: 76px; font-size: 32px; }
.vj-field { border-top: 1px solid var(--line, #e5e7eb); padding-top: 6px; }
.vj-field.need > div:nth-child(2) { color: var(--warn, #b45309); }
.vj-dialog { max-width: 640px; width: calc(100% - 32px); }
.jc-fields { margin-top: 6px; }

/* 1.355: Schedules → Engineer board (public/engineer-board.js), made to look like a paper wall calendar: ring binding,
   tear-off day pages, and each booking a coloured chip like a sticky note. Colours come from the theme. */
:root, .theme-scope {
  --eb-install: #3466a0; --eb-maintenance: #a8721a; --eb-service: #2c7a53; --eb-callout: #b13838; --eb-remote: #5b6470;
  --eb-survey: #6d4fa3; --eb-office: #2f7f8f; --eb-training: #8a5a9e; --eb-leave: #8c857a; --eb-other: #667085;
  --eb-paper: color-mix(in srgb, #e9d39a 12%, var(--card)); --eb-rule: color-mix(in srgb, var(--text) 7%, transparent);
}
@media (min-width: 701px) { body.signed-in.eb-open .container { max-width: 1560px; } }
.eb-head { margin: 4px 0 8px; align-items: flex-end; }
.eb-wk { min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }
.eb-tools { gap: 8px; margin-bottom: 8px; }
.eb-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-left: auto; }
.eb-key { display: inline-flex; align-items: center; gap: 4px; } .eb-key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--t); }
.eb-alerts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.eb-alert { flex: 1 1 280px; display: flex; gap: 8px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: .86rem; min-width: 0; }
.eb-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.eb-alert.bad { border-color: var(--bad-line); background: var(--bad-bg); } .eb-alert.bad .eb-dot { background: var(--bad); }
.eb-alert.warn { border-color: var(--warn-line); } .eb-alert.warn .eb-dot { background: var(--warn); }
.eb-alert.ok .eb-dot { background: var(--ok); } .eb-alert.info .eb-dot { background: var(--link); }
.eb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
@media (max-width: 1700px) { .eb-grid { grid-template-columns: minmax(0, 1fr); } }
.eb-paper { position: relative; padding: 18px 0 0; background: var(--eb-paper); overflow: hidden; }
.eb-rings { position: absolute; top: 0; left: 0; right: 0; height: 18px; display: flex; justify-content: space-around; background: color-mix(in srgb, var(--navy) 88%, black); }
.eb-rings i { width: 9px; height: 22px; margin-top: -8px; border-radius: 5px; background: linear-gradient(90deg, #8a8f99, #e6e8ec 45%, #8a8f99); box-shadow: 0 1px 2px #0005; }
.eb-scroll { overflow-x: auto; }
.eb-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; table-layout: fixed; }
.eb-table th, .eb-table td { border-right: 1px solid var(--eb-rule); border-bottom: 1px solid var(--eb-rule); vertical-align: top; padding: 6px; }
.eb-page { text-align: center; padding: 8px 6px 6px !important; background: var(--card); border-top: 4px solid color-mix(in srgb, var(--accent) 70%, var(--card)); }
.eb-page .eb-wd { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.eb-page b { display: block; font-size: 1.7rem; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--heading); }
.eb-page .eb-mo { font-size: .72rem; color: var(--muted); }
.eb-page.today { border-top-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--card)); } .eb-page.today b { color: var(--bad); }
.eb-page.wkend { background: var(--hover); }
.eb-eng { width: 150px; text-align: left; position: sticky; left: 0; z-index: 1; background: var(--eb-paper); }
.eb-corner { background: var(--card); font-size: .8rem; vertical-align: bottom !important; color: var(--muted); font-weight: 600; }
.eb-name { display: block; font-weight: 700; } .eb-role { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; line-height: 1.3; }
.eb-cell { background-image: repeating-linear-gradient(to bottom, transparent 0 23px, var(--eb-rule) 23px 24px); }
.eb-cell.today { background-color: color-mix(in srgb, var(--bad) 3%, transparent); }
.eb-stack { display: flex; flex-direction: column; gap: 5px; min-height: 40px; }
.eb-cell.free .eb-stack::after, .eb-free { content: "Free"; color: var(--muted); font-size: .75rem; font-style: italic; opacity: .75; }
.eb-add { border: 1px dashed transparent; background: none; color: var(--muted); font-size: .75rem; border-radius: 6px; padding: 1px 4px; margin-top: 3px; cursor: pointer; }
.eb-cell:hover .eb-add, .eb-add:focus-visible, .eb-mrow .eb-add { border-color: var(--line); }
.eb-chip { --t: var(--eb-other); display: block; width: 100%; text-align: left; font: inherit; font-size: .8rem; line-height: 1.3; color: var(--text); cursor: pointer;
  background: color-mix(in srgb, var(--t) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--t) 35%, var(--card)); border-left: 4px solid var(--t);
  border-radius: 4px 7px 7px 4px; padding: 4px 6px; box-shadow: 0 1px 1px color-mix(in srgb, #000 8%, transparent); transition: transform .1s; }
.eb-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 5px color-mix(in srgb, #000 14%, transparent); }
.eb-chip .eb-t { display: block; font-weight: 600; overflow-wrap: anywhere; } .eb-tm { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.eb-chip .eb-m { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: .72rem; color: var(--muted); }
.eb-chip .eb-sec, .eb-chip .eb-kit { display: block; font-size: .72rem; } .eb-chip .eb-kit { color: var(--warn); }
.eb-pill { font-weight: 700; color: var(--warn); text-transform: uppercase; letter-spacing: .03em; }
.eb-chip.s-provisional, .eb-chip.s-tbc { border-style: dashed; border-left-style: solid; }
.eb-chip.closed { opacity: .65; text-decoration: line-through; }
.t-install { --t: var(--eb-install); } .t-maintenance { --t: var(--eb-maintenance); } .t-service { --t: var(--eb-service); } .t-callout { --t: var(--eb-callout); } .t-remote { --t: var(--eb-remote); }
.t-survey { --t: var(--eb-survey); } .t-office { --t: var(--eb-office); } .t-training { --t: var(--eb-training); } .t-leave { --t: var(--eb-leave); } .t-other { --t: var(--eb-other); }
.eb-chip.t-leave { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--t) 14%, var(--card)) 0 6px, color-mix(in srgb, var(--t) 6%, var(--card)) 6px 12px); font-style: italic; }
.eb-oncall th, .eb-oncall td { background: color-mix(in srgb, var(--warn) 10%, var(--card)); } .eb-oncall select { width: auto; }
.eb-phone { display: none; }
@media (max-width: 700px) {
  .eb-scroll { display: none; } .eb-phone { display: block; padding: 0 10px 10px; }
  .eb-legend { margin-left: 0; } .eb-head { align-items: flex-start; }
}
.eb-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 8px 0; }
.eb-tab { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 3px 0; font-size: .72rem; color: var(--text); }
.eb-tab b { font-size: 1.05rem; } .eb-tab[aria-selected="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); } .eb-tab.today:not([aria-selected="true"]) { border-color: var(--bad); }
.eb-mrow { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--eb-rule); }
.eb-mrow.eb-oncall { background: none; }
.eb-side { display: flex; flex-direction: column; gap: 14px; }
.eb-chat { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.eb-msg { padding: 7px 10px; border-radius: 10px; font-size: .88rem; max-width: 92%; overflow-wrap: anywhere; }
.eb-msg.me { align-self: flex-end; background: var(--navy); color: var(--on-navy); } .eb-msg.ai { align-self: flex-start; background: var(--soft); } .eb-msg.err { background: var(--bad-bg); color: var(--bad); }
.eb-ask { display: flex; gap: 6px; align-items: flex-end; } .eb-ask textarea { flex: 1; resize: vertical; }
.eb-ideas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.eb-props { display: flex; flex-direction: column; gap: 8px; }
.eb-prop, .eb-req { display: flex; flex-direction: column; gap: 3px; border: 1px dashed var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px; font-size: .86rem; margin-top: 8px; }
.eb-prop.ai { border-left-color: color-mix(in srgb, var(--accent) 60%, #8a5a9e); }
.eb-dialog { max-width: min(560px, calc(100vw - 32px)); width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); }
.eb-dialog.wide { max-width: min(760px, calc(100vw - 32px)); }
.eb-dialog::backdrop { background: rgb(11 18 32 / 45%); }
/* 1.426: the Engineers Diary link dialog (public/diary-link.js) */
.dl-table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.dl-table th, .dl-table td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dl-table select { width: 100%; min-width: 160px; }
.dl-key { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dl-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 4px; font-size: .82rem; }
.dl-sw { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.dl-flags { margin: 6px 0 0; padding-left: 18px; } .dl-flags li.info { color: var(--muted); }
.eb-pick { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.eb-pick label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.eb-jobs { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow-y: auto; }
.eb-job { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer; }
.eb-job:hover { background: var(--hover); }
.eb-dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; font-size: .9rem; } .eb-dl dt { color: var(--muted); } .eb-dl dd { margin: 0; }
.eb-trows { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.eb-trow { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.4fr) auto auto auto; gap: 6px; align-items: center; }
.eb-trow.off .eb-tn { opacity: .55; }
@media (max-width: 700px) { .eb-trow { grid-template-columns: 1fr auto auto; } .eb-trow input[data-k="skills"] { grid-column: 1 / -1; } }
/* 1.371: questions added to one copy while it is filled in */
.form-grid > .addq-cell { margin: -2px 0 6px; }
.form-grid > .addq-cell .addq-form { margin-top: 6px; max-width: 640px; }
.form-grid > .added-q { border-left: 3px solid var(--accent, #f39200); padding-left: 8px; }
.addq-tag { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
/* 1.372: graded lines (a client's walk-round checklist: C / P / N / NA with Evidence and Source ticks) */
.grade-item .grade-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.grade-seg span { padding: 7px 10px; }
.grade-seg .g-name { display: inline; padding: 0; border: 0; background: none; color: inherit; font-weight: 500; }
.seg-part input:checked + span { background: #c27c00; color: #fff; }
.seg-pick input:checked + span { background: var(--navy); color: var(--on-navy); }
.grade-ticks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.grade-ticks > .small { min-width: 64px; }
.tick-chip { margin: 0; cursor: pointer; font-weight: 500; font-size: .85rem; }
.tick-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tick-chip span { display: inline-block; padding: 5px 10px; border: 1px solid var(--field-line); border-radius: 999px; background: var(--card); color: var(--muted); }
.tick-chip input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.tick-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.tick-chip input:disabled + span { cursor: default; }
.grade-item textarea.check-comment { min-height: 0; resize: vertical; }
.form-brand { font-weight: 700; letter-spacing: .02em; margin: 0 0 2px; }
.form-marking { text-align: center; font-size: .75rem; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
@media (max-width: 700px) {
  .grade-item .grade-pick { justify-content: stretch; }
  .grade-item .grade-seg { flex: 1; }
  .grade-seg .g-name { display: none; }
  .grade-seg span { padding: 11px 4px; }
  .tick-chip span { padding: 7px 11px; }
}
/* 1.376: a wide table in written content (privacy notice, the data protection pack, lessons, help) scrolls on its own on a
   phone instead of widening the whole page. */
.prose table, .lesson-body table, .help-body table { display: block; max-width: 100%; overflow-x: auto; }
/* 1.377: the PDF editor (public/pdf-edit.js). */
.pdfe .row select, .pdfe .row input[type=text], .pdfe .row input[type=number] { width: auto; }
.pdfe-tabs button { background: none; border: 0; font: inherit; cursor: pointer; }
.pdfe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pdfe-thumb { border: 2px solid var(--line); border-radius: 8px; padding: 6px; cursor: grab; background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pdfe-thumb.picked { border-color: var(--primary, #003e79); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #003e79) 30%, transparent); }
.pdfe-thumb canvas { max-width: 100%; height: auto !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); background: #fff; }
.pdfe-thumb .small { text-align: center; overflow-wrap: anywhere; }
.pdfe-thumb-btns { gap: 2px; flex-wrap: wrap; justify-content: center; }
.pdfe-thumb-btns .icon-btn { min-width: 26px; padding: 2px 4px; }
.pdfe-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.pdfe-stage { overflow: auto; max-width: 100%; }
.pdfe-page { position: relative; display: inline-block; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); background: #fff; }
.pdfe-page canvas { display: block; }
.pdfe-over { position: absolute; left: 0; top: 0; touch-action: none; }
.pdfe-over.pdfe-placing { cursor: crosshair; }
.pdfe-item { position: absolute; cursor: move; line-height: 1.2; font-family: Helvetica, Arial, sans-serif; color: #000; }
.pdfe-item .pdfe-x { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #c62828; color: #fff; font-size: 11px; line-height: 20px; padding: 0; cursor: pointer; display: none; }
.pdfe-item:hover .pdfe-x, .pdfe-item:focus-within .pdfe-x { display: block; }
.pdfe-stampbox { display: inline-block; border: 2px solid; padding: 0 .3em; font-weight: 700; white-space: pre; }
.pdfe-box { border: 2px solid var(--c, #c62828); }
.pdfe-highlight { background: color-mix(in srgb, var(--c, #ffeb3b) 40%, transparent); }
.pdfe-cover { background: #fff; outline: 1px dashed #999; }
.pdfe-redact { background: #000; }
.pdfe-dialog { max-width: min(520px, 94vw); }
@media (hover: none) { .pdfe-item .pdfe-x { display: block; } }

/* 1.385: the page bar under long lists (public/app.js pageBarHtml), as in Simpro. */
.pg-off { display: none !important; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 12px 0 4px; font-size: .9rem; }
.pager-count { color: var(--muted); }
.pager-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-btn { min-width: 36px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--card); color: var(--link); font: inherit; cursor: pointer; }
.pager-btn:hover { background: var(--soft); }
.pager-btn.on { background: var(--link); border-color: var(--link); color: #fff; font-weight: 600; cursor: default; }
.pager-gap { padding: 0 4px; color: var(--muted); }

/* 1.391: work focus menus (public/focus.js): 📌 pins, the Find box (Ctrl+K) and Start here on Home. */
.find-btn { cursor: pointer; padding: 0; }
.find-btn .nav-icon { width: 17px; height: 17px; }
@media (max-width: 700px) { .help-btn.top.find-btn + .help-btn.top { margin-left: 4px; } }
/* 1.392 (John: "sections shown compressed with the ability to collapse"): ★ My menu / ☰ All tabs, and headings that fold. */
#nav .nav-tabs { display: flex; gap: 4px; padding: 4px 6px 6px; }
body #nav .nav-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border-radius: 8px; font-size: .82rem; font-weight: 600; opacity: .7;
  border: 1px solid color-mix(in srgb, var(--on-navy) 18%, transparent); }
body #nav .nav-tab.on { opacity: 1; background: color-mix(in srgb, var(--on-navy) 16%, transparent); border-color: transparent; }
body #nav button.nav-sec { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px 3px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .55; }
body #nav button.nav-sec:hover, body #nav button.nav-sec:focus-visible { opacity: .9; background: none; }
body #nav button.nav-sec.here { opacity: .8; }
#nav .nav-caret { margin-left: auto; font-size: .75rem; letter-spacing: 0; }
#nav .nav-sec-list { display: flex; flex-direction: column; gap: 2px; }
#nav .nav-sec.closed + .nav-sec-list { display: none; }
#nav .nav-more-row { display: flex; align-items: center; }
#nav .nav-more-row > a { flex: 1; min-width: 0; }
body #nav .nav-more-row .nav-pin { flex: none; width: auto; padding: 4px 10px; font-size: .78rem; opacity: 0; }
body #nav .nav-more-row:hover .nav-pin, body #nav .nav-more-row .nav-pin:focus-visible { opacity: .8; }
@media (hover: none) { body #nav .nav-more-row .nav-pin { opacity: .55; } }
@media (min-width: 701px) {
  body.signed-in #nav .nav-tabs { padding: 2px 0 8px; }
  body.signed-in #nav button.nav-sec { display: flex; width: auto; padding: 12px 12px 3px; font-size: .68rem; opacity: .55; }
  body.signed-in #nav button.nav-sec:hover, body.signed-in #nav button.nav-sec:focus-visible { opacity: .9; background: none; }
  body.signed-in #nav .nav-sec-list { gap: 0; }
  body.signed-in #nav .nav-sec-list a { padding-top: 7px; padding-bottom: 7px; }
  /* The narrow (icon) menu has no room for words: tabs become icons, headings thin rules, and every section shows. */
  body.side-mini #nav .nav-tabs, body.dw-open #nav .nav-tabs { flex-direction: column; padding: 2px 8px 6px; }
  body.side-mini #nav .nav-tab, body.dw-open #nav .nav-tab { padding: 6px 0; }
  body.side-mini #nav .nav-tab > span:not(.nav-tab-i), body.dw-open #nav .nav-tab > span:not(.nav-tab-i) { display: none; }
  body.side-mini #nav button.nav-sec, body.dw-open #nav button.nav-sec { font-size: 0; padding: 0; margin: 8px 14px; height: 1px; width: auto; background: color-mix(in srgb, var(--on-navy) 18%, transparent); pointer-events: none; }
  body.side-mini #nav .nav-sec.closed + .nav-sec-list, body.dw-open #nav .nav-sec.closed + .nav-sec-list { display: flex; }
  body.side-mini #nav .nav-pin, body.dw-open #nav .nav-pin { display: none; }
  body.side-mini #nav .nav-more-row > a, body.dw-open #nav .nav-more-row > a { padding-left: 0; }
}
/* UI review (2026-11): a menu item with a flyout has a ▸ button beside it that opens the flyout's links as a list under
   it (public/app.js navFly). Only where hovering can't open the flyout: touch screens and 700px or narrower. */
#nav .nav-fly-row { display: flex; align-items: stretch; min-width: 0; }
#nav .nav-fly-row > a { flex: 1; min-width: 0; }
body #nav .nav-fly-row > .nav-sub-t { flex: none; width: 44px; min-width: 44px; min-height: 44px; padding: 0; justify-content: center; font-size: .85rem; opacity: .8; }
#nav .nav-sub { display: flex; flex-direction: column; gap: 0; margin: 0 0 4px 32px; border-left: 1px solid color-mix(in srgb, var(--on-navy) 22%, transparent); }
#nav .nav-sub[hidden] { display: none; }
body #nav .nav-sub a { min-height: 44px; padding: 8px 12px; font-size: .88rem; font-weight: 400; opacity: .88; white-space: normal; border-radius: 0 8px 8px 0; }
body #nav .nav-sub a::before { display: none; }
#nav .nav-sub .nav-fly-plus { flex: none; }
#nav .nav-sub-h { padding: 8px 12px 2px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
@media (hover: hover) and (pointer: fine) and (min-width: 701px) { #nav .nav-sub-t, #nav .nav-sub { display: none !important; } }
@media (min-width: 701px) { body.side-mini #nav .nav-sub-t, body.side-mini #nav .nav-sub, body.dw-open #nav .nav-sub-t, body.dw-open #nav .nav-sub { display: none !important; } }
.finder { position: fixed; inset: 0; z-index: 2000; background: color-mix(in srgb, #000 38%, transparent); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 12px 12px; }
.finder[hidden] { display: none; }
.finder-box { width: min(620px, 100%); background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); overflow: hidden; display: flex; flex-direction: column; max-height: 75vh; }
.finder-in { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.finder-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1.05rem; padding: 6px 0; box-shadow: none; }
.finder-in kbd { font-size: .7rem; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.finder-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.finder-list li a { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.finder-list li.on a, .finder-list li a:hover { background: var(--soft); }
.finder-kind { flex: none; width: 66px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.finder-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-note { flex: none; max-width: 35%; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-empty { padding: 14px 10px; color: var(--muted); font-size: .92rem; }
.start-here { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.start-here a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 10px; background: var(--navy); color: var(--on-navy); font-weight: 600; text-decoration: none; }
.start-here a:hover { background: var(--navy-2); }
/* UI review (2026-11): one primary button; the rest of Start here are outlined, as .btn.secondary. */
.start-here a:not(:first-of-type) { background: var(--card); color: var(--heading); border: 1px solid var(--field-line, var(--line)); font-weight: 600; }
.start-here a:not(:first-of-type):hover { background: var(--soft); border-color: color-mix(in srgb, var(--link) 55%, var(--card)); }
.start-here .start-label { flex-basis: 100%; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 700px) { .start-here a { flex: 1 1 calc(50% - 8px); justify-content: center; text-align: center; } }
.my-menu-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 2px 10px; margin: 6px 0; }

/* Workspace navigation: theme tokens keep every existing light, dark and branded look. */
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1000; padding: 12px 16px; background: var(--card); color: var(--text); border: 2px solid var(--link); border-radius: 8px; }
.skip-link:focus { top: 8px; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.workspace-heading h1 { margin: 0; }
.workspace-heading p { margin: 4px 0; }
.workspace-filter { margin-bottom: 24px; max-width: 640px; }
.workspace-filter label { display: block; font-weight: 600; margin-bottom: 8px; }
.workspace-filter input { width: 100%; min-height: 44px; }
.workspace-directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; align-items: start; }
.workspace-area h2 { margin: 0 0 12px; font-size: 1rem; }
.workspace-area ul { list-style: none; margin: 0; padding: 0; }
.workspace-area a { display: block; padding: 10px 8px; border-radius: 8px; text-decoration: none; overflow-wrap: anywhere; }
.workspace-area a:hover { background: var(--hover); }
.workspace-create { position: relative; flex-shrink: 0; }
.workspace-create > summary { list-style: none; white-space: nowrap; cursor: pointer; }
.workspace-create > summary::-webkit-details-marker { display: none; }
.workspace-create > .card { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; max-width: calc(100vw - 24px); max-height: 65vh; overflow-y: auto; z-index: 65; box-shadow: var(--shadow); }
.workspace-create .linkbtn, .workspace-create .card a { display: block; text-align: left; padding: 8px; min-height: 44px; }
.workspace-density { max-width: 165px; font-size: .8rem; }
/* 1.429 (John: "this toggle doesn't actually seem to do anything"): Compact lists only tightened the Jobs and Quotes lists
   (.sp-list) by a few pixels. It now tightens every table, list and box of lists in the portal: rows, cells, the
   home page boxes and dashboard panels, and the menu, so a page shows clearly more at once. */
.workspace-compact th, .workspace-compact td { padding: 4px 10px; }
.workspace-compact .sp-list td, .workspace-compact .sp-list th { padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.workspace-compact table { font-size: 14px; }
.workspace-compact .w-list > li { padding: 4px 0; }
.workspace-compact .card { padding: 10px 14px; }
.workspace-compact .stack { gap: 8px; }
.workspace-compact .grid, .workspace-compact .hd-row2, .workspace-compact .hd-row3, .workspace-compact .hd-kpis { gap: 10px; }
.workspace-compact .hd-alerts li a { padding-top: 4px; padding-bottom: 4px; }
.workspace-compact h1 { margin-bottom: 6px; }
.workspace-compact h2, .workspace-compact h3 { margin-top: 8px; margin-bottom: 6px; }
body.signed-in.workspace-compact #nav .nav-sec-list a { padding-top: 4px; padding-bottom: 4px; }
.job-navigation-tools { display: flex; align-items: center; justify-content: flex-end; margin: 16px 0 8px; gap: 16px; }
.job-section-picker { display: none; }
.job-main { flex-wrap: wrap; }
.job-sub { gap: 8px; }
.job-sub a { min-height: 40px; display: inline-flex; align-items: center; }
.workspace-bottom { display: none; }
.job-quick-actions { display: none; }
/* UI review (2026-11): the jobs list's Columns picker (public/compliance.js viewJobs), up to 1600px wide (a 1440px laptop too, where every column made the table 1900px wide). */
.job-cols { position: relative; }
.job-cols > summary { list-style: none; cursor: pointer; min-height: 44px; }
.job-cols > summary::-webkit-details-marker { display: none; }
.job-cols-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 260px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto; box-shadow: var(--shadow); gap: 4px; }
.job-cols-menu .check { min-height: 44px; }
@media (min-width: 1601px) { .job-cols { display: none; } }
@media (max-width: 1600px) {
  .job-table.jc-no-site [data-col="site"], .job-table.jc-no-created [data-col="created"], .job-table.jc-no-scheduled [data-col="scheduled"],
  .job-table.jc-no-category [data-col="category"], .job-table.jc-no-sell [data-col="sell"], .job-table.jc-no-est [data-col="est"],
  .job-table.jc-no-actual [data-col="actual"], .job-table.jc-no-kind [data-col="kind"], .job-table.jc-no-lifecycle [data-col="lifecycle"],
  .job-table.jc-no-pm [data-col="pm"], .job-table.jc-no-postcode [data-col="postcode"], .job-table.jc-no-start [data-col="start"],
  .job-table.jc-no-stage [data-col="stage"] { display: none !important; }
}
.quote-workspace-tabs { flex-wrap: wrap; }
.quote-workspace-tabs .active, .quote-workspace-sub [aria-pressed="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.quote-workspace-sub { margin: 8px 0 16px; }
@media (min-width: 901px) and (max-width: 1120px) {
  body.signed-in:not(.side-mini):not(.dw-open) { --side: 224px; }
}
@media (max-width: 1100px) {
  .job-main { display: none; }
  .job-navigation-tools { justify-content: space-between; flex-wrap: wrap; }
  .job-section-picker { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
  .job-section-picker select { min-height: 44px; max-width: 100%; }
}
@media (max-width: 700px) {
  body.signed-in .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  body.signed-in .brand { min-width: 0; flex: 1; }
  body.signed-in .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar > button, .topbar > .help-btn { flex-shrink: 0; }
  .job-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
  .job-quick-actions > * { flex: 1; min-height: 44px; justify-content: center; }
  .job-tools .job-photos-tool { display: none !important; } /* UI review (2026-11): Photos is already in the quick actions above */
  .workspace-density { display: none; }
  .appbar .workspace-create > summary { min-height: 40px; padding: 6px 10px; }
  .workspace-bottom:not([hidden]) { display: flex; justify-content: space-around; position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 25; padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .workspace-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; text-decoration: none; color: var(--muted); font-size: 12px; }
  .workspace-bottom a[aria-current="page"] { color: var(--link); font-weight: 700; background: var(--soft); border-radius: 8px; }
  body:has(.workspace-bottom:not([hidden])) .container { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  body:has(.workspace-bottom:not([hidden])) .page-nav { margin-bottom: 64px; }
  body.dw-open .workspace-bottom { display: none; }
  .job-sub a { min-height: 44px; }
}
@media print { .workspace-bottom, .workspace-create, .workspace-density, .job-navigation-tools { display: none !important; } }

/* ---------- 1.404: the UI design rules (ui-design-rules checklist), checked by test/ui-rules.test.js ----------
   Laid over everything above, so each rule holds on every page and in every theme. */

/* Asking before doing something (public/ask-first.js): buttons that name the action; on phones it comes up from the bottom. */
.ask-sheet { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); padding: 0;
  width: min(480px, calc(100% - 32px)); max-width: none; box-shadow: var(--shadow-lg); }
.ask-sheet::backdrop { background: rgb(11 18 32 / 45%); }
.ask-in { padding: 24px; }
.ask-body p { margin: 0 0 8px; line-height: 1.5; max-width: 65ch; }
.ask-body p:first-child { font-weight: 600; color: var(--heading); }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: var(--card); }
.btn.danger.solid:hover { background: color-mix(in srgb, var(--bad) 88%, black); }
@media (max-width: 700px) {
  .ask-sheet { margin: auto 0 0; width: 100%; max-height: 85dvh; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .ask-in { padding: 24px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .ask-actions { flex-direction: column; } /* Keep above, the action at the bottom under the thumb */
  .ask-actions .btn { width: 100%; min-height: 48px; }
}

/* Phones: every kind of field at 16px, so iPhones don't zoom in when it is tapped. */
@media (max-width: 700px) {
  input[type=tel], input[type=time], input[type=datetime-local], input[type=month], input[type=week] { font-size: 16px; }
}

/* Touch screens: every tap target at least 44 × 44 px. */
@media (pointer: coarse) {
  .btn, .btn.sm, .icon-btn, .linkbtn, .side-collapse, .menu-btn { min-height: 44px; }
  .icon-btn, .menu-btn { min-width: 44px; }
  .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
  .tabs a { min-height: 44px; display: inline-flex; align-items: center; }
  .linkbtn { display: inline-flex; align-items: center; }
  #nav a, #nav button, .side-menu a { min-height: 44px; }
  input[type=radio], input[type=checkbox] { width: 22px; height: 22px; }
}

/* Touch screens have no hover: the actions that only appeared under the mouse stay in view. */
@media (hover: none) {
  .chat-meta button, .wd-gut, .wd-cm, .mme-handle, .bd-chat { opacity: 1; }
  .wd-chk-tools { display: inline-flex; }
  .pdfe-item .pdfe-x { display: block; width: 32px; height: 32px; line-height: 32px; top: -14px; right: -14px; font-size: 14px; }
  .wd-preview .wd-gut, .wd-preview .wd-cm { display: none; }
}

/* Type: body line height 1.4–1.6 and written content no wider than about 70 characters a line. */
.prose > p, .prose > ul, .prose > ol, .prose > blockquote, .prose > h2, .prose > h3 { max-width: 72ch; }

/* Numbers line up: right-aligned columns use figures of one width. */
td.right, th.right, td.num, th.num, .tile .n, .num { font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; }

/* Never colour alone: a marked quiz answer says in words whether it was right. */
.question.right::before, .question.wrong::before { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.question.right::before { content: '✓ Right'; color: var(--ok); }
.question.wrong::before { content: '✗ Not right'; color: var(--bad); }

/* 1.405: typed answers in the sheet (askText), and visible labels for boxes that only had a placeholder (linkFieldLabels). */
.ask-field { margin: 0; }
.ask-field label { font-weight: 600; color: var(--heading); margin-bottom: 8px; }
.ask-field textarea { font-family: inherit; font-size: 1rem; min-height: 96px; }
.ask-field p { margin: 8px 0 0; max-width: 65ch; }
.ask-actions button:disabled { opacity: .5; cursor: not-allowed; }
.ph-label { flex-basis: 100%; width: 100%; grid-column: 1 / -1; font-size: .85rem; margin: 0 0 4px; }
.row:has(> .ph-label) { flex-wrap: wrap; row-gap: 4px; }

/* 1.420: the Reports & dashboards area's name and tabs over each of its pages (public/app.js MENU_TABS). */
.area-head { margin: 0 0 8px; }
.area-name { margin: 0 0 4px; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.area-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.area-tabs a { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.area-tabs a:focus-visible, .admin-groups a:focus-visible, .admin-pages a:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
/* 1.420: the Settings hub (public/settings.js). */
.settings-lead { max-width: 65ch; }
.settings-group { margin-top: 24px; }
.settings-group h2 { margin: 0 0 4px; }
.settings-group > p { margin: 0 0 8px; max-width: 65ch; }
.settings-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.settings-item { display: flex; flex-direction: column; gap: 4px; min-height: 44px; text-decoration: none; color: var(--text); height: 100%; box-sizing: border-box; }
.settings-item b { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.settings-item:hover, .settings-item:focus-visible { border-color: var(--link); }
.box-here { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 1.420: My day's Visit and Photo on each job card (public/my-day.js). */
.md-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.md-actions .btn { min-height: 44px; min-width: 88px; display: inline-flex; align-items: center; justify-content: center; }
.ph-add-now { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 1.421: a development or test copy (PORTAL_ENV): a fixed amber bar above everything else on the page (public/public-address.js).
   The page moves down by its height so it covers nothing; the same dark-on-amber in light and dark mode (contrast 9:1). */
:root { --env-h: 0px; }
body.env-flag { --env-h: 28px; padding-top: var(--env-h); }
.env-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 35; height: 28px; display: flex; align-items: center; justify-content: center; padding: 0 12px;
  background: #f5b400; color: #1f1300; font: 700 .85rem/1 system-ui, sans-serif; letter-spacing: .02em; border-bottom: 2px solid #8a5a00;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-banner.env-test { background: #ffd54a; }
.env-banner::before { content: '⚠'; margin-right: 6px; }
body.env-flag .topbar { top: var(--env-h); }
@media (min-width: 701px) {
  body.env-flag.signed-in .topbar { top: var(--env-h); }
  body.env-flag.signed-in .appbar:not([hidden]) { top: var(--env-h); }
}
@media print { .env-banner { position: static; } body.env-flag { padding-top: 0; } }

/* 1.422: version notes (public/whats-new.js): Help → What's new, Admin → Updates, and the one-time "Updated to X" card. */
.cl-find { width: 100%; max-width: 480px; margin-bottom: 10px; }
.cl-entry { border-bottom: 1px solid var(--line); padding: 8px 0; }
.cl-entry:last-child { border-bottom: 0; }
.cl-entry > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-height: 32px; }
.cl-entry .cl-title { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.cl-notes { margin-top: 6px; overflow-wrap: anywhere; }
.cl-current .cl-title { margin-top: 4px; overflow-wrap: anywhere; }
.whats-new-card { position: fixed; right: 16px; bottom: 16px; z-index: 900; max-width: min(360px, calc(100vw - 32px)); display: flex; align-items: center; gap: 8px; padding: 12px; }
.whats-new-card .whats-new-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.whats-new-card .btn { flex: none; }
@media (max-width: 700px) { .whats-new-card { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px) + 56px); max-width: none; } }
@media print { .whats-new-card { display: none; } }
/* 1.427: an AI key's budget bar (public/ai.js aiKeyBudget). */
.key-bar { height: 6px; border-radius: 3px; background: var(--line, rgba(127,127,127,.25)); overflow: hidden; margin-top: 3px; max-width: 220px; }
.key-bar span { display: block; height: 100%; background: var(--ok); }
.key-budget.warn .key-bar span { background: var(--warn); }
.key-budget.bad .key-bar span { background: var(--bad); }
