/* Kelmora: modern, mobile-first. Light and dark themes follow the phone's setting. */

:root {
  --navy: #1a1d23;
  --accent: #f5c400;
  --accent-strong: #f5a800;
  --on-accent: #1a1300;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #56657a;
  --line: #e3e8f0;
  --danger: #c81e1e;
  --ok: #15803d;
  --blue: #1d5fd6;
  --link: #1d5fd6;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.22);
  --glass: rgba(255, 255, 255, 0.78);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114;
    --surface: #1a1d23;
    --surface-2: #22262e;
    --ink: #e8edf6;
    --ink-2: #c3cddd;
    --muted: #95a2b8;
    --line: #30343d;
    --danger: #f87171;
    --ok: #4ade80;
    --blue: #7aa7ff;
    --link: #7aa7ff;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.35);
    --glass: rgba(26, 29, 35, 0.82);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0f1114;
    --surface: #1a1d23;
    --surface-2: #22262e;
    --ink: #e8edf6;
    --ink-2: #c3cddd;
    --muted: #95a2b8;
    --line: #30343d;
    --danger: #f87171;
    --ok: #4ade80;
    --blue: #7aa7ff;
    --link: #7aa7ff;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.35);
    --glass: rgba(26, 29, 35, 0.82);
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { padding-bottom: calc(110px + var(--safe-b)); }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.error { color: var(--danger); }
.hidden, [hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(6px + var(--safe-t)) 10px 6px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-row { display: flex; align-items: center; gap: 4px; min-height: 44px; max-width: 980px; margin: 0 auto; }
.topbar .small-title { flex: 1; text-align: center; font-weight: 650; font-size: 1.02rem; opacity: 0; transition: opacity 0.15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.scrolled .small-title { opacity: 1; }
.topbar .side { display: flex; gap: 2px; min-width: 88px; }
.topbar .side.right { justify-content: flex-end; }
.icon-btn {
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:active { background: rgba(127, 127, 127, 0.15); }
.icon-btn.on { background: var(--accent); color: var(--on-accent); }
.back-btn { display: flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--blue); font-weight: 500; font-size: 1rem; padding: 8px 6px; cursor: pointer; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .back-btn { color: #7aa7ff; }
}
:root[data-theme="dark"] .back-btn { color: #7aa7ff; }

main { padding: 4px 16px 16px; max-width: 980px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.large-title { font-size: 2.05rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.section-title { font-size: 1.12rem; font-weight: 750; letter-spacing: -0.01em; margin: 22px 2px 10px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 0; background: var(--surface-2); color: var(--ink); cursor: pointer;
  font-weight: 650; font-size: 0.97rem; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.08s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn.dark { background: var(--navy); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.dark { background: #e8edf6; color: #1a1d23; }
}
:root[data-theme="dark"] .btn.dark { background: #e8edf6; color: #1a1d23; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 54px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; text-decoration: none; color: inherit; }
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.list-item .chev { color: var(--muted); }
.icon-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.icon-tile.yellow { background: #fff4cc; color: #8a5a00; }
.icon-tile.blue { background: #e0ebff; color: #1d4ed8; }
.icon-tile.red { background: #fde2e2; color: #b91c1c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-tile.yellow { background: #3a2e05; color: #ffd45a; }
  :root:not([data-theme="light"]) .icon-tile.blue { background: #2a2e37; color: #8bb2ff; }
  :root:not([data-theme="light"]) .icon-tile.red { background: #3b1414; color: #ff9a9a; }
}
:root[data-theme="dark"] .icon-tile.yellow { background: #3a2e05; color: #ffd45a; }
:root[data-theme="dark"] .icon-tile.blue { background: #2a2e37; color: #8bb2ff; }
:root[data-theme="dark"] .icon-tile.red { background: #3b1414; color: #ff9a9a; }

/* Project cards */
.projects { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.project {
  position: relative; display: block; text-decoration: none; color: #fff; border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 16 / 10; background: linear-gradient(135deg, #2a2e37, #1a1d23); box-shadow: var(--shadow);
}
.project img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(10, 11, 13,0.82)); }
.project .info { position: absolute; left: 16px; right: 16px; bottom: 14px; }
.project h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.project .stats { display: flex; gap: 12px; margin-top: 6px; font-size: 0.85rem; opacity: 0.9; }
.project .stats span { display: inline-flex; align-items: center; gap: 4px; }
.project .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,0.45); }
.project .placeholder svg { width: 64px; height: 64px; }

/* ---------- Segmented control ---------- */
.segmented { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.segmented button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 0.92rem; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented .count { font-size: 0.75rem; background: var(--line); border-radius: 99px; padding: 1px 7px; color: var(--ink-2); }

/* ---------- Chips and tags ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--ink-2);
}
.chip.on { background: var(--navy); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip.on { background: #e8edf6; color: #1a1d23; }
}
:root[data-theme="dark"] .chip.on { background: #e8edf6; color: #1a1d23; }
.chip .x { opacity: 0.6; }
.tag { --h: 45; background: hsl(var(--h) 90% 94%); color: hsl(var(--h) 70% 28%); box-shadow: none; }
.tag.on { background: hsl(var(--h) 70% 29%); color: #fff; }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 75% 48%); }
.tag.on .dot { background: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag { background: hsl(var(--h) 45% 18%); color: hsl(var(--h) 85% 78%); }
  :root:not([data-theme="light"]) .tag.on { background: hsl(var(--h) 60% 32%); color: #fff; }
}
:root[data-theme="dark"] .tag { background: hsl(var(--h) 45% 18%); color: hsl(var(--h) 85% 78%); }
:root[data-theme="dark"] .tag.on { background: hsl(var(--h) 60% 32%); color: #fff; }
.tag-mini { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 75% 50%); box-shadow: 0 0 0 1.5px rgba(0,0,0,0.35); }

/* ---------- Capture context card ---------- */
.context-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.context-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left; min-width: 0;
}
.context-btn .lbl { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.context-btn .val { font-weight: 650; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-btn > div { min-width: 0; }

/* ---------- Toolbar row (filters) ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; }
.toolbar .grow { flex: 1; min-width: 0; }
.filter-btn { position: relative; }
.filter-btn .badge-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-strong); border: 2px solid var(--surface); }

/* ---------- Photo grid ---------- */
.day-head {
  position: sticky; top: calc(56px + var(--safe-t)); z-index: 5; margin: 16px -16px 8px; padding: 6px 18px;
  font-size: 0.82rem; font-weight: 700; color: var(--ink-2);
  background: linear-gradient(var(--bg) 70%, transparent);
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 14px; overflow: hidden; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; } }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); border: 0; padding: 0; cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.tile:active img { transform: scale(0.97); }
.tile .ov { position: absolute; left: 5px; right: 5px; bottom: 5px; display: flex; gap: 4px; align-items: center; }
.tile .glyph { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(0,0,0,0.55); color: #fff; backdrop-filter: blur(6px); }
.tile .glyph svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tile .tags-dots { margin-left: auto; display: flex; gap: 3px; }
.tile .check { position: absolute; top: 7px; right: 7px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,0.25); display: none; }
.selecting .tile .check { display: block; }
.tile.selected .check { background: var(--accent); border-color: var(--accent); }
.tile.selected .check::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.tile.selected img { transform: scale(0.88); border-radius: 8px; }

/* ---------- Drawings list ---------- */
.drawings { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 14px; }
.drawing-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.drawing-card .thumb { aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.drawing-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.drawing-card .meta { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.drawing-card .meta .grow { flex: 1; min-width: 0; }
.drawing-card h3 { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-badge { display: inline-flex; align-items: center; gap: 4px; background: #fff4cc; color: #7a4f00; font-weight: 700; font-size: 0.8rem; padding: 4px 9px; border-radius: 99px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pin-badge { background: #3a2e05; color: #ffd45a; }
}
:root[data-theme="dark"] .pin-badge { background: #3a2e05; color: #ffd45a; }

/* ---------- Bottom capture dock ---------- */
.dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 30;
  display: flex; align-items: center; gap: 6px; padding: 7px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-radius: 999px; box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
}
.dock .d-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 72px; height: 56px; border: 0; background: none; border-radius: 999px; font-size: 0.7rem; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.dock .d-btn:active { background: rgba(127,127,127,0.12); }
.dock .shutter { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(245, 168, 0, 0.45); }
.dock .shutter svg { width: 30px; height: 30px; }
.dock .shutter:active { transform: scale(0.94); }
.fab {
  position: fixed; right: 18px; bottom: calc(22px + var(--safe-b)); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--on-accent); font-weight: 750; font-size: 1rem; box-shadow: 0 10px 26px rgba(245,168,0,0.45); cursor: pointer;
}
.select-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); z-index: 31; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg);
}
.select-bar .grow { flex: 1; font-weight: 650; }
.select-bar .btn { background: rgba(255,255,255,0.12); color: #fff; box-shadow: none; min-height: 40px; padding: 0 14px; }
.select-bar .btn.primary { background: var(--accent); color: var(--on-accent); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty .ring { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 16px; display: grid; place-items: center; background: #fff4cc; color: #8a5a00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .empty .ring { background: #3a2e05; color: #ffd45a; }
}
:root[data-theme="dark"] .empty .ring { background: #3a2e05; color: #ffd45a; }
.empty .ring svg { width: 36px; height: 36px; }
.empty h2 { font-size: 1.2rem; font-weight: 750; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 320px; margin: 0 auto 16px; line-height: 1.45; }

/* ---------- Photo viewer ---------- */
.viewer { margin: 0 -16px; background: #000; position: relative; }
.viewer img { width: 100%; max-height: 66vh; object-fit: contain; margin: 0 auto; }
.viewer .vtabs { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; padding: 3px; border-radius: 99px; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); }
.viewer .vtabs button { border: 0; background: none; color: rgba(255,255,255,0.75); font-weight: 650; font-size: 0.82rem; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.viewer .vtabs button.on { background: rgba(255,255,255,0.92); color: #000; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.45); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.viewer .nav.prev { left: 10px; } .viewer .nav.next { right: 10px; }
.viewer .nav:disabled { opacity: 0; pointer-events: none; }
.detail-sheet { position: relative; margin: -18px -16px 0; padding: 20px 16px 0; background: var(--bg); border-radius: 22px 22px 0 0; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.actions-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 2px; text-align: center; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); font-size: 0.78rem; font-weight: 650; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.action svg { color: var(--ink); }
.action.danger, .action.danger svg { color: var(--danger); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0; }
.kv > div { padding: 12px 16px; border-top: 1px solid var(--line); }
.kv > div:nth-child(-n+2) { border-top: 0; }
.kv .k { color: var(--muted); font-size: 0.9rem; }
.kv .v { text-align: right; font-weight: 550; overflow-wrap: anywhere; }
.kv .v a { color: var(--blue); text-decoration: none; }
.pin-preview { position: relative; height: 150px; border-radius: var(--r); overflow: hidden; background: #fff no-repeat; box-shadow: var(--shadow); border: 0; width: 100%; padding: 0; cursor: pointer; display: block; }
.pin-preview .caption { position: absolute; left: 10px; bottom: 10px; background: rgba(26,29,35,0.86); color: #fff; padding: 6px 10px; border-radius: 10px; font-size: 0.82rem; font-weight: 600; }
.pin-preview .mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); }

/* ---------- Forms ---------- */
.field { display: block; }
.field > span { display: block; font-size: 0.82rem; color: var(--muted); margin: 0 0 6px 4px; font-weight: 600; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink);
}
.field textarea { min-height: 100px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-strong); }
.switch-row { display: flex; align-items: center; gap: 12px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background 0.2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent-strong); width: 0; transition: width 0.2s; border-radius: 99px; }
.logo-preview { max-height: 72px; max-width: 220px; object-fit: contain; background: #fff; padding: 8px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Banner, toast ---------- */
.queue-banner { position: sticky; top: calc(56px + var(--safe-t)); z-index: 20; margin: 0 auto; max-width: 980px; display: flex; align-items: center; gap: 10px; background: #fff4cc; color: #6b4600; padding: 10px 16px; font-size: 0.88rem; font-weight: 650; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .queue-banner { background: #3a2e05; color: #ffd45a; }
}
:root[data-theme="dark"] .queue-banner { background: #3a2e05; color: #ffd45a; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + var(--safe-t)); z-index: 80;
  display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px;
  max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 0.92rem;
  animation: drop 0.25s ease-out;
}
.toast.err { background: var(--danger); }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }

/* ---------- Sheets ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 11, 13, 0.5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--bg); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); max-height: 90vh; overflow: auto; animation: rise 0.28s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(40px); opacity: 0.6; } }
.sheet .grabber { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 4px auto 14px; }
.sheet h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.sheet .lead { color: var(--muted); margin-bottom: 14px; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }

/* ---------- Drawing viewer ---------- */
.dv { position: fixed; inset: 0; z-index: 50; background: #22262e; display: flex; flex-direction: column; color: #fff; }
.dv-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; background: rgba(26,29,35,0.92); backdrop-filter: blur(12px); }
.dv-top .t { flex: 1; min-width: 0; }
.dv-top .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-top .t span { font-size: 0.78rem; color: #aab4c8; }
.dv-top .icon-btn { color: #fff; }
.dv-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; }
.dv-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.dv-inner > img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.pin {
  position: absolute; width: 34px; height: 42px; margin: -42px 0 0 -17px; border: 0; padding: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.45));
}
.pin svg { width: 100%; height: 100%; }
.pin .n { position: absolute; top: 7px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 800; color: #1a1300; }
.pin.active svg path { fill: #2563eb; }
.pin.active .n { color: #fff; }
.pin.ghost { pointer-events: none; animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { to { margin-top: -48px; } }
.dv-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(26,29,35,0.9); color: #fff; padding: 10px 16px; border-radius: 99px; font-weight: 650; font-size: 0.9rem; white-space: nowrap; box-shadow: var(--shadow-lg); z-index: 3; }
.dv-bottom { padding: 10px 12px calc(12px + var(--safe-b)); background: rgba(26,29,35,0.92); backdrop-filter: blur(12px); display: flex; gap: 8px; align-items: center; justify-content: center; }
.dv-bottom .btn { box-shadow: none; }
.dv-bottom .btn:not(.primary) { background: rgba(255,255,255,0.12); color: #fff; }
.dv-card { position: absolute; left: 12px; right: 12px; bottom: 12px; max-width: 460px; margin: 0 auto; display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--surface); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 3; }
.dv-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; flex: none; }
.dv-card .grow { flex: 1; min-width: 0; }
.dv-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.dv-zoom button { width: 42px; height: 42px; border-radius: 12px; border: 0; background: rgba(26,29,35,0.85); color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ---------- Markup editor ---------- */
.editor { position: fixed; inset: 0; z-index: 70; background: #0e1013; display: flex; flex-direction: column; color: #fff; }
.editor-top, .editor-tools { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.editor-top { padding-top: calc(8px + var(--safe-t)); justify-content: space-between; }
.editor-top .btn { box-shadow: none; }
.editor-top .btn:not(.primary) { background: rgba(255,255,255,0.1); color: #fff; }
.editor-tools { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: calc(12px + var(--safe-b)); background: #16181c; scrollbar-width: none; }
.editor-tools::-webkit-scrollbar { display: none; }
.editor-tools > * { flex: none; }
@media (min-width: 720px) { .editor-tools { justify-content: center; } }
.editor-stage { flex: 1; display: grid; place-items: center; overflow: hidden; }
.editor-stage canvas { touch-action: none; }
.tool { width: 46px; height: 46px; border-radius: 14px; border: 0; background: rgba(255,255,255,0.08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool.on { background: var(--accent); color: #111; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.2); cursor: pointer; }
.swatch.on { border-color: #fff; transform: scale(1.12); }
.divider { width: 1px; height: 28px; background: rgba(255,255,255,0.15); margin: 0 4px; }

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, #2e323b, #0f1114 60%); }
.login-card { width: 100%; max-width: 380px; background: rgba(26, 29, 35, 0.9); color: #e8edf6; border-radius: 26px; padding: 18px 18px 22px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.06); backdrop-filter: blur(20px); }
.login-card .login-logo { width: 100%; height: auto; border-radius: 16px; margin-bottom: 10px; }
.login-card .muted { color: #8a97ad; }
.login-card .field { text-align: left; margin: 18px 0 12px; }
.login-card .field input { background: rgba(255,255,255,0.06); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.login-card .error { margin: 0 0 10px; }
.login-card .ok-msg { margin: 0 0 10px; color: var(--ok, #2e9d5b); }

/* ---------- Project view tabs ---------- */
.view-tabs button { padding: 9px 6px; }

/* ---------- Dropdown menu ---------- */
.pop-scrim { position: fixed; inset: 0; z-index: 55; }
.pop-menu {
  position: fixed; z-index: 56; min-width: 220px; padding: 6px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
  animation: pop 0.16s ease-out; transform-origin: top right;
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } }
.pop-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px; border: 0; background: none; border-radius: 10px; font-weight: 600; font-size: 0.97rem; text-align: left; cursor: pointer; color: var(--ink); }
.pop-menu button:hover, .pop-menu button:focus-visible { background: var(--surface-2); outline: none; }
.pop-menu .sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(10, 11, 13, 0.5); animation: fade 0.2s; }
.drawer {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 360px);
  display: flex; flex-direction: column; background: var(--bg);
  padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b));
  box-shadow: var(--shadow-lg); animation: slidein 0.26s cubic-bezier(.2,.8,.2,1);
}
@keyframes slidein { from { transform: translateX(-100%); } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 4px 2px 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.dr-name { font-weight: 750; font-size: 1.05rem; }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.drawer-search input { flex: 1; border: 0; background: none; min-height: 44px; outline: none; color: var(--ink); }
.drawer-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.mini-select { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); min-width: 0; }
.mini-select select { flex: 1; min-width: 0; border: 0; background: none; min-height: 40px; font-size: 0.85rem; font-weight: 600; color: var(--ink); outline: none; }
.drawer-list { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.dr-item { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; text-decoration: none; color: inherit; }
.dr-item:hover { background: var(--surface-2); }
.dr-item.on { background: var(--surface); box-shadow: var(--shadow); }
.dr-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dr-item .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-item .sub { font-size: 0.8rem; color: var(--muted); }
.dr-thumb { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.dr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drawer-foot { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- Area picker, help, share ---------- */
.list-pick { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; cursor: pointer; padding: 0; min-height: 40px; font-weight: 600; color: inherit; }
.help-item summary { list-style: none; cursor: pointer; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item[open] summary svg:last-child { transform: rotate(180deg); }
.help-item + .help-item { border-top: 1px solid var(--line); }
.help-body { padding: 0 16px 14px 64px; color: var(--ink-2); line-height: 1.5; font-size: 0.94rem; }

/* ---------- Map ---------- */
.map-wrap { height: calc(100vh - 290px); min-height: 360px; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: var(--surface-2); }
.photo-marker { background: none; border: 0; }
.photo-marker img { width: 46px; height: 46px; object-fit: cover; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.35); background: #ddd; }
.photo-marker::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
.map-pop { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; font: 13px/1.4 -apple-system, Helvetica, Arial, sans-serif; }
.map-pop img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.map-pop span { color: #555; }
.map-pop button { grid-column: 1 / -1; border: 0; background: #ffc21a; color: #1a1300; font-weight: 700; border-radius: 99px; padding: 8px; cursor: pointer; }
.leaflet-container { font: inherit; }

/* ---------- Shared view ---------- */
.share-page { padding-bottom: 24px; }
.view-badge { font-size: 0.75rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); padding: 5px 10px; border-radius: 99px; }
.switch input:disabled + span { opacity: 0.4; cursor: not-allowed; }
.switch-row .grow { flex: 1; min-width: 0; }
.leaflet-control-layers { border: 0 !important; border-radius: 12px !important; box-shadow: var(--shadow) !important; background: var(--surface) !important; color: var(--ink); }
.leaflet-control-layers-expanded { padding: 6px 10px !important; }
.leaflet-control-layers-base label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.85rem; padding: 4px 0; cursor: pointer; }
.leaflet-control-layers-base label input { accent-color: #f5a800; width: 16px; height: 16px; }

/* ---------- Location hierarchy ---------- */
.loc-row { padding-left: calc(16px + var(--depth, 0) * 22px); }
.loc-row .list-pick .grow { display: flex; flex-direction: column; min-width: 0; }
.loc-row .sub { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.level-head { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 6px; }
.badge-soft { font-size: 0.72rem; font-weight: 700; background: #fff4cc; color: #7a4f00; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-soft { background: #3a2e05; color: #ffd45a; }
}
:root[data-theme="dark"] .badge-soft { background: #3a2e05; color: #ffd45a; }

/* ---------- Zones on plans ---------- */
.zone { position: absolute; border: 2px solid rgba(29, 95, 214, 0.55); background: rgba(29, 95, 214, 0.035); border-radius: 1px; pointer-events: none; }
.zone.kind-row { border-color: rgba(214, 140, 0, 0.8); border-width: 1.5px; background: transparent; }
.zone.kind-area { border-color: rgba(21, 128, 61, 0.55); border-style: dashed; background: transparent; }
.zone.editing { border-style: dashed; background: rgba(29, 95, 214, 0.06); }
.zone.draft { border: 2px dashed #ffc21a; background: rgba(255, 194, 26, 0.22); }
/* Labels read like tags on a drawing: small, white, with a coloured edge for the kind. */
.zone-label { position: absolute; left: 3px; top: 3px; transform-origin: 0 0; white-space: nowrap; font: 650 11px/1.2 -apple-system, "Helvetica Neue", Arial, sans-serif; letter-spacing: .01em; color: #1f2937; background: rgba(255, 255, 255, 0.94); padding: 2px 6px 2px 5px; border-radius: 3px; border-left: 3px solid #1d5fd6; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18); }
.zone.kind-row .zone-label { border-left-color: #d68c00; }
.zone.kind-area .zone-label { border-left-color: #15803d; top: auto; bottom: 3px; transform-origin: 0 100%; }
.dv-bottom { flex-wrap: wrap; }

/* ---------- As-built comparison ---------- */
.cmp { position: fixed; inset: 0; z-index: 72; background: #0e1013; color: #fff; display: flex; flex-direction: column; }
.cmp-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; background: #1a1d23; }
.cmp-top .icon-btn { color: #fff; }
.cmp-top .t { flex: 1; min-width: 0; }
.cmp-top .t b { display: block; }
.cmp-top .t span { font-size: 0.78rem; color: #aab4c8; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-dark { display: flex; background: rgba(255,255,255,0.1); border-radius: 10px; padding: 3px; flex: none; }
.seg-dark button { border: 0; background: none; color: #c3cddd; font-weight: 650; font-size: 0.8rem; padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg-dark button.on { background: #fff; color: #1a1d23; }
.seg-dark.small button { padding: 6px 8px; font-size: 0.75rem; }
.cmp-ref { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: #1a1d23; }
.cmp-ref label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: #c3cddd; }
.cmp-ref select { background: rgba(255,255,255,0.1); color: #fff; border: 0; border-radius: 8px; padding: 8px 10px; max-width: 58vw; font-weight: 600; }
.cmp-ref select option { color: #000; }
.cmp-op input { accent-color: #ffc21a; width: 110px; }
.tool-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,0.1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cmp-body { flex: 1; display: flex; gap: 2px; min-height: 0; }
.cmp-body.side { flex-direction: column; }
@media (orientation: landscape) and (min-width: 700px) { .cmp-body.side { flex-direction: row; } }
.cmp-pane { position: relative; flex: 1; overflow: hidden; background: #000; touch-action: none; min-height: 0; cursor: grab; }
.cmp-pane.light { background: #2a3142; }
.cmp-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.cmp-layer img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.cmp-layer.over { outline: 2px dashed #ffc21a; }
.cmp-tag { position: absolute; left: 10px; top: 10px; background: rgba(26,29,35,0.85); padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.cmp-pin { position: absolute; width: 30px; height: 37px; transform-origin: 50% 100%; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.45)); }
.cmp-pin svg { width: 100%; height: 100%; }
.cmp-bottom { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px 12px calc(12px + var(--safe-b)); background: #1a1d23; }
.verify { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.v-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.18); background: transparent; color: #fff; font-weight: 700; cursor: pointer; }
.v-btn.ok.on { background: #16a34a; border-color: #16a34a; }
.v-btn.bad.on { background: #dc2626; border-color: #dc2626; }
.cmp-note { width: 100%; min-height: 44px; border-radius: 12px; border: 0; padding: 0 12px; background: rgba(255,255,255,0.1); color: #fff; }
.cmp-note::placeholder { color: #8a97ad; }
/* status badges */
.vbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 750; padding: 4px 9px; border-radius: 99px; }
.vbadge.matches { background: #dcfce7; color: #166534; }
.vbadge.deviation { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vbadge.matches { background: #14351f; color: #86efac; }
  :root:not([data-theme="light"]) .vbadge.deviation { background: #3b1414; color: #fca5a5; }
}
:root[data-theme="dark"] .vbadge.matches { background: #14351f; color: #86efac; }
:root[data-theme="dark"] .vbadge.deviation { background: #3b1414; color: #fca5a5; }
.tile .glyph.ok { background: #16a34a; }
.tile .glyph.bad { background: #dc2626; }

/* ---------- Inspections ---------- */
.ins-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 6px 0 4px; }
.ins-bar.big { height: 10px; }
.ins-bar .p { background: var(--ok); } .ins-bar .f { background: var(--danger); } .ins-bar .n { background: #94a3b8; } .ins-bar .o { background: var(--line); }
.ins-item { margin-top: 8px; border-left: 4px solid transparent; }
.ins-item.st-pass { border-left-color: var(--ok); }
.ins-item.st-fail { border-left-color: var(--danger); }
.ins-item.st-na { border-left-color: #94a3b8; }
.ins-text { display: flex; gap: 10px; font-weight: 600; line-height: 1.35; }
.ins-no { flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 0.78rem; color: var(--muted); }
.ins-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.rb { min-height: 42px; border-radius: 10px; border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); font-weight: 700; cursor: pointer; color: var(--ink-2); }
.rb.pass.on { background: var(--ok); color: #fff; box-shadow: none; }
.rb.fail.on { background: var(--danger); color: #fff; box-shadow: none; }
.rb.na.on { background: #64748b; color: #fff; box-shadow: none; }
.rb:disabled { opacity: 0.6; }
.ins-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ins-thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.ins-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-dot { width: 14px; height: 36px; border-radius: 6px; flex: none; }
.swatch-btn { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.swatch-btn.on { border-color: var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.view-tabs button { font-size: 0.86rem; gap: 4px; padding: 9px 4px; }
.view-tabs .count { display: none; }
@media (min-width: 420px) { .view-tabs .count { display: inline; } }
.dv-hint { white-space: normal; text-align: center; max-width: calc(100% - 84px); left: calc(50% - 30px); line-height: 1.3; }
.loc-field { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px 8px 10px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: left; cursor: pointer; font-weight: 600; color: var(--ink); }
.loc-field .grow { flex: 1; min-width: 0; }

/* ---------- Plan markers: blockers, issues, equipment ---------- */
.dv-toggle { border: 0; border-radius: 99px; padding: 8px 12px; font-weight: 750; font-size: 0.8rem; background: rgba(255,255,255,0.12); color: #fff; cursor: pointer; }
.dv-toggle.on { background: #d03b3b; }
.pin.blocker svg path { fill: #d03b3b; }
.pin.blocker .n { color: #fff; }
.heat { position: absolute; left: 0; top: 0; pointer-events: none; mix-blend-mode: multiply; }
.mk { position: absolute; transform-origin: 50% 50%; border: 2px solid #fff; cursor: pointer; padding: 0; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,0.45); font: 800 10px/1 -apple-system, Helvetica, Arial, sans-serif; }
.mk span { padding: 0 4px; white-space: nowrap; }
.mk-blocker { min-width: 26px; height: 26px; border-radius: 6px; background: #d03b3b; color: #fff; }
.mk-issue { min-width: 24px; height: 24px; border-radius: 50%; background: #2563eb; color: #fff; }
.mk-asset { min-width: 30px; height: 22px; border-radius: 4px; background: var(--mk, #94a3b8); color: #1a1d23; border-color: #1a1d23; }

/* ======================= Version 5 ======================= */
:root { --chart-plan: #2563eb; --chart-actual: #d97706; --st-good: #15803d; --st-warn: #8f5b00; --st-serious: #b93d0a; --st-critical: #c42b2b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --chart-plan: #3b82f6; --chart-actual: #d97706; --st-good: #4ade80; --st-warn: #fbbf24; --st-serious: #fb923c; --st-critical: #f87171; }
}
:root[data-theme="dark"] { --chart-plan: #3b82f6; --chart-actual: #d97706; --st-good: #4ade80; --st-warn: #fbbf24; --st-serious: #fb923c; --st-critical: #f87171; }
svg.i.xs { width: 14px; height: 14px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pre { white-space: pre-wrap; line-height: 1.45; margin: 4px 0 0; }

/* Tab strip: scrolls sideways on phones */
.tabstrip { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabstrip::-webkit-scrollbar { display: none; }
.tabstrip button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 650; font-size: 0.9rem; color: var(--muted); cursor: pointer; scroll-snap-align: start; }
.tabstrip button.on { background: var(--navy); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabstrip button.on { background: #e8edf6; color: #1a1d23; }
}
:root[data-theme="dark"] .tabstrip button.on { background: #e8edf6; color: #1a1d23; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpi { border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--ink); }
.kpi b { font-size: 1.4rem; font-weight: 800; }
.kpi span { font-size: 0.72rem; color: var(--muted); font-weight: 650; text-align: center; }
.kpi.bad b { color: var(--st-critical); }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
.kpi-tile { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; }
.kpi-val { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 4px; }

/* Status and severity */
.sev { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.sev-good { color: var(--st-good); } .sev-warning { color: var(--st-warn); } .sev-serious { color: var(--st-serious); } .sev-critical { color: var(--st-critical); } .sev-neutral { color: var(--muted); }
.sev-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.rec { align-items: flex-start; }
.rec .sub { line-height: 1.4; }

/* Issues */
.type-badge { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 46px; height: 46px; border-radius: 12px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; background: #64748b; }
.type-badge b { font-size: 0.95rem; letter-spacing: 0; }
.list-item .type-badge { height: 42px; }
.page-head .type-badge { flex-direction: row; gap: 4px; height: 30px; padding: 0 10px; font-size: 0.75rem; }
.type-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #64748b; }
.st-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.st-pill.st-in_progress { color: var(--chart-plan); } .st-pill.st-answered { color: #7c3aed; } .st-pill.st-closed { color: var(--st-good); } .st-pill.overdue { color: var(--st-critical); }
.prio { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.prio.high { color: var(--st-serious); } .prio.critical { color: #fff; background: var(--st-critical); }
.issue-row .sub { white-space: normal; }
.directive { border-left: 4px solid var(--accent-strong); padding-left: 12px; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.status-actions .btn { flex: 1; }
.timeline { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 14px; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; }
.tl-item + .tl-item { border-top: 1px solid var(--line); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--muted); }
.tl-dot.raised { background: var(--chart-plan); } .tl-dot.status { background: var(--accent-strong); } .tl-dot.assigned { background: #7c3aed; }
.issue-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 650; font-size: 0.85rem; color: var(--chart-plan); text-decoration: none; }
.ins-thumb.big { width: 84px; height: 84px; }
.pick-grid { max-height: 60vh; overflow: auto; border-radius: 12px; }
.pick-grid .tile { position: relative; }
.pick-grid .wp-tag { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: 0.66rem; font-weight: 700; line-height: 1.2; padding: 2px 5px; border-radius: 6px; background: rgba(26, 29, 35, 0.82); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-grid .wp-off { opacity: 0.45; cursor: not-allowed; }

/* Equipment commissioning tags */
.cx-tag { position: relative; flex: none; width: 46px; height: 42px; border-radius: 8px 8px 8px 8px; background: var(--cx); color: var(--cxi); display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.cx-tag::before { content: ""; position: absolute; top: 5px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
.cx-tag.white { box-shadow: inset 0 0 0 2px #1a1d23; }
.cx-tag i { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.55rem; font-weight: 900; background: #1a1d23; color: #fff; padding: 1px 4px; border-radius: 4px; letter-spacing: 0.05em; }
.cx-bar { display: flex; gap: 2px; height: 14px; border-radius: 99px; overflow: hidden; margin: 10px 0 8px; background: var(--line); }
.cx-bar span { min-width: 4px; }
.cx-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.8rem; color: var(--ink-2); }
.cx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
.asset-hero { position: relative; margin-top: 4px; padding: 28px 18px 18px; border-radius: 22px 22px 22px 22px; background: var(--cx); color: var(--cxi); box-shadow: var(--shadow); }
.asset-hero.white { box-shadow: inset 0 0 0 3px #1a1d23, var(--shadow); }
.asset-hero .hole { position: absolute; top: 12px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,0.3); }
.asset-hero h1 { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; margin-top: 4px; }
.asset-hero .lvl { font-weight: 800; margin: 10px 0 4px; }
.hold-banner { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; color: #fff; background: repeating-linear-gradient(135deg, #b91c1c 0 14px, #991b1b 14px 28px); }
.hold-banner .btn { background: #fff; color: #991b1b; box-shadow: none; }
.cx-steps { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 14px; }
.cx-step { display: flex; gap: 12px; padding: 12px 0; }
.cx-step + .cx-step { border-top: 1px solid var(--line); }
.cx-step .title { font-weight: 700; } .cx-step .sub { color: var(--muted); font-size: 0.84rem; }
.cx-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 2px var(--cx); }
.cx-step.done .cx-dot { background: var(--cx); color: var(--cxi); }
.cx-dot.white { box-shadow: inset 0 0 0 2px #64748b; }
.cx-step.next { background: linear-gradient(90deg, rgba(255,194,26,0.10), transparent); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }

/* Handover */
.info-card { display: flex; gap: 12px; align-items: flex-start; }
.info-card > svg { flex: none; margin-top: 2px; color: var(--chart-plan); }
.seal-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #1a1d23, #3d424d); box-shadow: var(--shadow); }
.seal-card h1 { font-size: 1.4rem; font-weight: 800; margin: 4px 0; }
.seal-badge { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,0.14); }
.chk { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.chk.ok { background: var(--st-good); } .chk.warn { background: #b77905; } .chk.bad { background: var(--st-critical); }
.verify-ok, .verify-bad { display: flex; gap: 12px; align-items: flex-start; }
.verify-ok > svg { color: var(--st-good); flex: none; } .verify-bad > svg { color: var(--st-critical); flex: none; }

/* Insights */
.ms-row { align-items: flex-start; }
.ms-row .row .title { flex: 1; min-width: 0; }
.ms-progress { height: 6px; border-radius: 99px; background: var(--line); margin: 8px 0 4px; overflow: hidden; }
.ms-progress span { display: block; height: 100%; background: var(--chart-plan); border-radius: 99px; }
.chart-card { padding: 12px 14px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.legend i.tick { width: 2px; height: 14px; border-radius: 0; background: var(--ink); vertical-align: -3px; }
.ch-label { font-size: 11px; font-weight: 650; fill: var(--ink-2); }
.ch-val { font-size: 10.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.ch-val.bad { fill: var(--st-critical); font-weight: 700; }
.ch-axis { font-size: 10px; fill: var(--muted); }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-track { fill: var(--surface-2); }
.ch-target { stroke: var(--ink); stroke-width: 2; }
.chart [data-tip] { cursor: pointer; }
.ch-tip { position: absolute; z-index: 90; pointer-events: none; background: var(--navy); color: #fff; font-size: 0.8rem; font-weight: 600; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 260px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.cmp-table th, .cmp-table td { padding: 9px 10px; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cmp-table thead th { border-top: 0; font-size: 0.75rem; color: var(--muted); font-weight: 700; vertical-align: bottom; }
.cmp-table th[scope=row] { text-align: left; font-weight: 600; color: var(--ink-2); }
.cmp-table td.better { color: var(--st-good); font-weight: 750; }
.cmp-table td.worse { color: var(--st-critical); }
.card .cmp-table { box-shadow: none; }
.photo-marker.blocker img { border-color: #d03b3b; box-shadow: 0 0 0 3px rgba(208,59,59,0.35), 0 4px 12px rgba(0,0,0,0.35); }
.photo-marker.blocker::after { border-top-color: #d03b3b; }
.list-item.just-added { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* Stakeholder summary */
.sum-input { min-height: 200px; resize: vertical; font-size: 0.95rem; line-height: 1.45; }
.sum-sec { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sum-head { resize: none; overflow: hidden; width: 100%; line-height: 1.3; border: 0; background: none; font: inherit; font-weight: 700; font-size: 1.02rem; color: var(--ink); padding: 4px 2px; border-bottom: 1px dashed var(--line); }
.sum-head:focus { outline: none; border-bottom-color: var(--accent, #f5b800); }
.sum-body { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 0.95rem; line-height: 1.5; padding: 10px 12px; resize: none; overflow: hidden; min-height: 80px; }
.sum-body:focus { outline: 2px solid var(--accent, #f5b800); outline-offset: 0; background: var(--surface); }
.sum-sec.unsorted { border: 1px dashed var(--line); }
.uns-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.uns-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; display: grid; place-items: center; flex: none; }
.uns-btn.x { color: var(--danger); }
.sum-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 12px; }
.warn-text { color: #b26a00; margin: 0; }

/* Audio dictation */
.no-scroll { overflow: hidden; }
.dock .rec-shutter { background: #fff; box-shadow: 0 0 0 4px var(--line), 0 6px 18px rgba(0,0,0,0.18); }
.dock .rec-shutter span { width: 26px; height: 26px; border-radius: 50%; background: #ff3b30; }
.rec-overlay { --rec-red: #ff3b30; position: fixed; inset: 0; z-index: 200; background: #0b0b0c; color: #fff; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 10px) 18px calc(env(safe-area-inset-bottom) + 18px); gap: 10px; }
.rec-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rec-top .btn { color: #ff6961; }
.rec-title { font-weight: 650; font-size: 0.95rem; text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-wave { position: relative; height: 150px; margin-top: 16px; border-top: 1px solid #2c2c2e; border-bottom: 1px solid #2c2c2e; }
.rec-wave canvas { width: 100%; height: 100%; display: block; }
.rec-playhead { position: absolute; top: -6px; bottom: -6px; left: 75%; width: 2px; background: #0a84ff; border-radius: 2px; }
.rec-time { text-align: center; font-size: 3rem; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-top: 6px; }
.rec-time small { font-size: 1.6rem; color: #8e8e93; }
.rec-state { text-align: center; color: #8e8e93; font-size: 0.9rem; }
.rec-live { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.rec-live[hidden] { display: none !important; }
.rec-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: #d1d1d6; }
.rec-select { background: #1c1c1e; color: #fff; border: 1px solid #2c2c2e; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 0.85rem; }
.rec-live > label, .rec-live > select { align-self: flex-start; }
.rec-text { flex: 1; min-height: 60px; overflow-y: auto; background: #1c1c1e; border-radius: 12px; padding: 10px 12px; font-size: 0.95rem; line-height: 1.45; color: #f2f2f7; }
.rec-text .muted { color: #8e8e93; }
.rec-tip { color: #8e8e93; font-size: 0.78rem; text-align: center; margin: 0; }
.rec-controls { display: flex; align-items: center; justify-content: space-around; padding-top: 6px; }
.rec-btn { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: none; display: grid; place-items: center; cursor: pointer; padding: 0; }
.rec-btn span { width: 62px; height: 62px; border-radius: 50%; background: var(--rec-red); transition: all 0.2s ease; }
.rec-btn.on span { width: 30px; height: 30px; border-radius: 7px; }
.rec-side { width: 54px; height: 54px; border-radius: 50%; border: 0; background: #2c2c2e; color: #fff; display: grid; place-items: center; cursor: pointer; }
.rec-side:disabled { opacity: 0.35; }
.rec-side svg { width: 24px; height: 24px; }
.player-card { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.rv-title { border: 0; background: none; padding: 0; text-align: left; font: inherit; font-size: 1.15rem; font-weight: 750; color: var(--ink); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.pl-wave { height: 64px; margin-top: 8px; }
.pl-wave:empty { display: none; }
.pl-wave canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
#pl-seek { width: 100%; accent-color: #ff3b30; }
.pl-controls { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 0; }
.pl-play { width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); display: grid; place-items: center; cursor: pointer; }
.pl-play svg { width: 26px; height: 26px; }
.pl-skip { width: 46px; height: 46px; border: 0; background: none; color: var(--ink); display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.pl-skip svg { width: 30px; height: 30px; }
.pl-speed { min-width: 46px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.au-step { margin-top: 12px; }
.step-head { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 0.85rem; display: grid; place-items: center; flex: none; }
.step-n.sm { width: 22px; height: 22px; font-size: 0.75rem; margin-top: 8px; }
.au-text { min-height: 160px; max-height: 900px; font-size: 0.93rem; line-height: 1.5; resize: vertical; }
.au-small { min-height: 70px; font-size: 0.93rem; line-height: 1.45; resize: vertical; }
.checks { display: flex; flex-direction: column; gap: 8px; font-size: 0.93rem; }
.checks label, .check-row { display: flex; align-items: center; gap: 10px; }
.checks input, .check-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s ease; }
.ok-text { color: #15803d; }
.topic-card { margin-top: 10px; }
.topic-head { font-weight: 700; }
.action-row { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.action-row .row > .input { min-width: 0; }
.chip-s { display: inline-block; font-size: 0.7rem; font-weight: 650; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); margin: 4px 4px 0 0; box-shadow: inset 0 0 0 1px var(--line); }
.chip-s.ok { background: #dcfce7; color: #166534; box-shadow: none; }
.notice-card { margin-top: 14px; border: 1px solid #f5b800; }
.icon-tile.big { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip-s.ok { background: #14361f; color: #86efac; }
  :root:not([data-theme="light"]) .ok-text { color: #4ade80; }
  :root:not([data-theme="light"]) .dock .rec-shutter { background: #1c1c1e; }
}
:root[data-theme="dark"] .chip-s.ok { background: #14361f; color: #86efac; }
:root[data-theme="dark"] .ok-text { color: #4ade80; }
:root[data-theme="dark"] .dock .rec-shutter { background: #1c1c1e; }
.act-meta { display: grid; grid-template-columns: minmax(0, 1fr) 92px 112px; gap: 6px; }
.act-meta .input { min-width: 0; padding-left: 10px; padding-right: 8px; }
.wd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wd-actions #wd-go { grid-column: 1 / -1; }

/* Project views: four main views plus More */
.viewbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 4px; border-radius: 16px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); max-width: 620px; margin: 2px 0 6px; }
.viewbar button { border: 0; background: none; border-radius: 12px; padding: 7px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-weight: 650; font-size: 0.72rem; letter-spacing: 0.01em; cursor: pointer; min-width: 0; transition: background 0.15s ease, color 0.15s ease; }
.viewbar button svg { width: 21px; height: 21px; }
.viewbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewbar button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.viewbar button.more { position: relative; }
.viewbar button.more:not(.on) svg { color: var(--ink-2); }
.viewbar button:active { transform: scale(0.97); }
@media (min-width: 700px) { .viewbar button { flex-direction: row; justify-content: center; gap: 7px; font-size: 0.88rem; padding: 9px 8px; } .viewbar button svg { width: 18px; height: 18px; } }

.more-sheet h2 { margin-bottom: 12px; }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 6px; }
@media (min-width: 560px) { .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.more-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 16px; border: 0; cursor: pointer;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); min-height: 112px; transition: transform 0.12s ease; }
.more-tile:active { transform: scale(0.97); }
.more-tile.on { box-shadow: inset 0 0 0 2px var(--accent); }
.mt-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px; }
.mt-icon svg { width: 22px; height: 22px; }
.mt-name { font-weight: 750; font-size: 0.98rem; }
.mt-sub { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }
.mt-icon.blue { background: #e0ebff; color: #1d4ed8; } .mt-icon.purple { background: #ede4ff; color: #6d28d9; } .mt-icon.slate { background: #e5e9f0; color: #334155; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mt-icon.slate { background: #1f2937; color: #cbd5e1; }
}
:root[data-theme="dark"] .mt-icon.slate { background: #1f2937; color: #cbd5e1; }
.dock .d-audio svg { color: #ff3b30; }
.more-tile:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; min-height: 0; }
.more-tile:last-child .mt-icon { grid-row: span 2; margin: 0; }

.not-happy { margin-top: 12px; }
.not-happy > summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.not-happy > summary::-webkit-details-marker { display: none; }
.not-happy[open] > summary svg:last-child { transform: rotate(180deg); }
.steps-mini { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 0.9rem; line-height: 1.6; }

/* v6: weekly fill, tracker, actions due, diary, AI captions, before/after */
.fill-btn { border-style: dashed; }
.tr-row { padding: 12px; }
.tr-ref { width: 64px; text-align: center; font-weight: 700; padding: 6px 4px; }
.icon-tile.green { background: #dcfce7; color: #15803d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-tile.green { background: #10301c; color: #6ee7a0; }
}
:root[data-theme="dark"] .icon-tile.green { background: #10301c; color: #6ee7a0; }

.dr-actions { display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; font-weight: 650; }
.dr-count { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.dr-count.late { color: #fff; background: var(--danger); padding: 2px 8px; border-radius: 99px; }

.ad-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ad-stat { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; }
.ad-stat b { font-size: 1.6rem; line-height: 1.1; }
.ad-stat span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.ad-stat.red b { color: var(--danger); } .ad-stat.amber b { color: #d97706; }
.ad-item { align-items: center; }
.ad-item a { color: inherit; text-decoration: none; min-width: 0; }
.ad-item.late { box-shadow: inset 3px 0 0 var(--danger); }
.ad-badge { font-size: 0.68rem; font-weight: 800; padding: 3px 7px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); flex: none; letter-spacing: 0.02em; }
.ad-badge.blk { background: #fde2e2; color: #b91c1c; } .ad-badge.rfi { background: #e0ebff; color: #1d4ed8; } .ad-badge.pun { background: #ffedd5; color: #c2410c; }
.ad-badge.hold { background: #fde2e2; color: #b91c1c; } .ad-badge.obs { background: #fff4cc; color: #8a5a00; }
.ad-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: none; color: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.ad-check:hover, .ad-check:focus-visible { color: #15803d; border-color: #15803d; }

.dy-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 10px; }
.dy-date { position: relative; text-align: center; flex: 1; cursor: pointer; }
.dy-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dy-counts { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 4px 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.dy-counts span { display: inline-flex; align-items: center; gap: 5px; }
.dy-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.dy-photo { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; display: block; }
.dy-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dy-photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 0.68rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.tl-item .title { display: block; font-weight: 600; font-size: 0.93rem; }
.tl-item .sub { display: block; font-size: 0.8rem; color: var(--muted); }
.tl-time { width: 42px; flex: none; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 5px; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.tl-dot.issue_closed, .tl-dot.level, .tl-dot.inspection, .tl-dot.handover { background: #dcfce7; color: #15803d; }
.tl-dot.issue_raised { background: #fde2e2; color: #b91c1c; } .tl-dot.recording { background: #fde2e2; color: #c81e1e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-dot.issue_closed, :root:not([data-theme="light"]) .tl-dot.level, :root:not([data-theme="light"]) .tl-dot.inspection, :root:not([data-theme="light"]) .tl-dot.handover { background: #10301c; color: #6ee7a0; }
  :root:not([data-theme="light"]) .tl-dot.issue_raised, :root:not([data-theme="light"]) .tl-dot.recording { background: #3b1414; color: #ff9a9a; }
  :root:not([data-theme="light"]) .ad-badge.blk, :root:not([data-theme="light"]) .ad-badge.hold { background: #3b1414; color: #ff9a9a; }
  :root:not([data-theme="light"]) .ad-badge.rfi { background: #2a2e37; color: #8bb2ff; }
  :root:not([data-theme="light"]) .ad-badge.pun { background: #3a1d08; color: #fdba74; }
  :root:not([data-theme="light"]) .ad-badge.obs { background: #3a2e05; color: #ffd45a; }
}
:root[data-theme="dark"] .tl-dot.issue_closed, :root[data-theme="dark"] .tl-dot.level, :root[data-theme="dark"] .tl-dot.inspection, :root[data-theme="dark"] .tl-dot.handover { background: #10301c; color: #6ee7a0; }
:root[data-theme="dark"] .tl-dot.issue_raised, :root[data-theme="dark"] .tl-dot.recording { background: #3b1414; color: #ff9a9a; }
:root[data-theme="dark"] .ad-badge.blk, :root[data-theme="dark"] .ad-badge.hold { background: #3b1414; color: #ff9a9a; }
:root[data-theme="dark"] .ad-badge.rfi { background: #2a2e37; color: #8bb2ff; }
:root[data-theme="dark"] .ad-badge.pun { background: #3a1d08; color: #fdba74; }
:root[data-theme="dark"] .ad-badge.obs { background: #3a2e05; color: #ffd45a; }

.ai-btn { padding: 4px 10px; font-size: 0.8rem; text-transform: none; letter-spacing: 0; color: #7c3aed; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ai-btn { color: #c4a7ff; }
}
:root[data-theme="dark"] .ai-btn { color: #c4a7ff; }

.ba-overlay { position: fixed; inset: 0; z-index: 200; background: #0b0b0c; color: #fff; display: flex; flex-direction: column; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 14px); }
.ba-top { display: flex; align-items: center; justify-content: space-between; }
.ba-top .btn.ghost { color: #8ab4ff; }
.ba-stage { position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; background: #000; touch-action: none; user-select: none; cursor: ew-resize; }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ba-before { position: absolute; inset: 0; }
.ba-handle { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; pointer-events: none; }
.ba-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #111; border-radius: 99px; padding: 6px 4px; display: flex; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.ba-label { position: absolute; top: 10px; font-size: 0.78rem; font-weight: 700; background: rgba(0,0,0,0.6); padding: 4px 9px; border-radius: 99px; pointer-events: none; }
.ba-label.l { left: 10px; } .ba-label.r { right: 10px; }
.ba-hint { margin: 0; text-align: center; color: #8e8e93; font-size: 0.8rem; }
.ba-pick { background: #1c1c1e; box-shadow: none; max-width: 320px; margin: 0 auto; width: 100%; }
.ba-pick button { color: #aeaeb2; } .ba-pick button.on { background: #3a3a3c; color: #fff; box-shadow: none; }
.ba-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.ba-thumb { position: relative; flex: none; width: 82px; border: 0; padding: 0; background: none; color: #fff; cursor: pointer; text-align: left; }
.ba-thumb img { width: 82px; height: 82px; object-fit: cover; border-radius: 10px; display: block; box-shadow: inset 0 0 0 1px #333; }
.ba-thumb.is-a img { outline: 3px solid #f5b800; outline-offset: -3px; } .ba-thumb.is-b img { outline: 3px solid #0a84ff; outline-offset: -3px; }
.ba-thumb em { position: absolute; top: 4px; left: 4px; font-style: normal; font-size: 0.65rem; font-weight: 800; background: rgba(0,0,0,0.7); padding: 2px 6px; border-radius: 6px; }
.ba-thumb span { display: block; font-size: 0.7rem; color: #aeaeb2; margin-top: 3px; }
.ad-item .title { display: block; font-weight: 650; }
.ad-item .sub { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* Help centre */
.hc-hero { background: var(--surface-2); margin: 0 -16px; padding: 40px 20px 34px; text-align: center; border-bottom: 1px solid var(--line); }
.hc-hero h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 18px; }
.hc-search { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto; background: var(--surface); border-radius: 999px; padding: 4px 18px;
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--line); }
.hc-search:focus-within { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); }
.hc-search input { border: 0; background: none; font: inherit; font-size: 1rem; padding: 12px 0; flex: 1; color: var(--ink); outline: none; min-width: 0; }
.hc-h2 { font-size: 1.3rem; font-weight: 800; margin: 26px 2px 10px; }
.hc-topics { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 720px) { .hc-topics { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
.hc-topic { display: flex; gap: 16px; align-items: flex-start; padding: 18px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.hc-topic b { display: block; font-size: 1.05rem; font-weight: 750; margin-bottom: 3px; }
.hc-topic span span { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.hc-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; color: #d99a00; background: #fff4cc; }
.hc-icon svg { width: 26px; height: 26px; stroke-width: 1.6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hc-icon { background: #3a2e05; color: #ffd45a; }
}
:root[data-theme="dark"] .hc-icon { background: #3a2e05; color: #ffd45a; }
.hc-popular { background: var(--surface-2); border-radius: 16px; padding: 18px 18px 10px; margin-top: 24px; box-shadow: inset 0 0 0 1px var(--line); }
.hc-popular h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 800; }
.hc-popular a { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.hc-popular a svg { color: var(--muted); flex: none; }
.hc-about-card { display: flex; align-items: center; gap: 14px; margin: 24px 0 30px; padding: 14px; border-radius: 16px; background: #0b0b0c; color: #fff; text-decoration: none; }
.hc-about-card img { width: 56px; height: 56px; border-radius: 12px; }
.hc-about-card b { display: block; } .hc-about-card span span { display: block; color: #d4b25a; font-size: 0.82rem; }
.hc-list { display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); overflow: hidden; }
.hc-row { display: flex; align-items: center; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.hc-row:last-child { border-bottom: 0; }
.hc-row.tall b { display: block; } .hc-row.tall .small { display: block; font-weight: 400; margin-top: 3px; }
.hc-topic-head { display: flex; gap: 14px; align-items: center; margin: 18px 0 16px; }
.hc-topic-head h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.hc-topic-head p { margin: 2px 0 0; }
.hc-crumbs { font-size: 0.85rem; color: var(--muted); margin: 16px 2px 6px; }
.hc-crumbs a { color: var(--muted); }
.hc-article { background: var(--surface); border-radius: 16px; padding: 20px 18px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); line-height: 1.6; font-size: 1rem; }
.hc-article h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 12px; line-height: 1.25; }
.hc-article h4 { margin: 16px 0 4px; font-size: 1rem; }
.hc-article p { margin: 0 0 12px; }
.hc-steps { counter-reset: s; list-style: none; padding: 0; margin: 4px 0 12px; }
.hc-steps li { counter-increment: s; position: relative; padding: 2px 0 12px 42px; }
.hc-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 0.85rem; display: grid; place-items: center; }
.hc-tip, .hc-note { border-radius: 12px; padding: 12px 14px; margin: 6px 0 4px; font-size: 0.93rem; }
.hc-tip { background: #e8f5ff; color: #0c4a6e; } .hc-tip b { margin-right: 4px; }
.hc-note { background: #fff7e0; color: #6b4b00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hc-tip { background: #0c2a3d; color: #bae6fd; }
  :root:not([data-theme="light"]) .hc-note { background: #33280a; color: #fde68a; }
}
:root[data-theme="dark"] .hc-tip { background: #0c2a3d; color: #bae6fd; }
:root[data-theme="dark"] .hc-note { background: #33280a; color: #fde68a; }
.hc-code { background: #121418; color: #e5e7eb; padding: 12px; border-radius: 10px; font-size: 0.88rem; overflow-x: auto; }
.ab-hero { text-align: center; padding: 26px 0 10px; }
.ab-app { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow-sm); display: block; margin: 0 auto; }
.ab-hero h1 { font-size: 1.8rem; font-weight: 800; margin: 12px 0 0; }
.ab-hero p { margin: 4px 0; }
.ab-tag { max-width: 440px; margin: 10px auto 0 !important; color: var(--ink-2); }
.ab-maker { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 16px; border-radius: 18px; background: #0b0b0c; color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(212,178,90,0.35); }
.ab-maker img { width: 96px; height: 96px; border-radius: 14px; flex: none; }
.ab-maker div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ab-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #a8a29e; }
.ab-maker b { font-size: 1.15rem; color: #e6c46a; }
.ab-maker a { color: #fff; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; opacity: 0.85; }
.ab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ab-feat { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font-size: 0.86rem; font-weight: 600; }
.ab-feat svg { color: #d99a00; flex: none; }
.hc-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin: 0 0 16px; }
.hc-video iframe, .hc-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.editor-stage.zoomed { display: block; overflow: auto; -webkit-overflow-scrolling: touch; }
.editor-stage.zoomed canvas { display: block; }
.editor-title { font-weight: 700; font-size: 0.9rem; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 4px; }
@media (max-width: 520px) { .editor-title { display: none; } }
.editor-hint { text-align: center; font-size: 0.8rem; color: #aeb6c6; padding: 4px 10px 0; min-height: 1.2em; background: #16181c; }
.editor-tools .tool.zoom { font-size: 1.3rem; font-weight: 700; color: #fff; }

/* Contractor reply page */
.reply-page .page { max-width: 640px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 16px 40px; }
.rp-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.rp-logo { height: 40px; max-width: 120px; object-fit: contain; }
.rp-ref { font-weight: 800; color: #b47800; font-size: 1rem; }
.rp-title { font-size: 1.5rem; font-weight: 800; margin: 4px 0 10px; line-height: 1.25; }
.rp-kv { margin-bottom: 12px; }
.reply-page .card { margin-bottom: 12px; }
.rp-action { background: #fff7e0; box-shadow: inset 0 0 0 1px #f5d77a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rp-action { background: #33280a; box-shadow: inset 0 0 0 1px #6b5313; }
}
:root[data-theme="dark"] .rp-action { background: #33280a; box-shadow: inset 0 0 0 1px #6b5313; }
.rp-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.rp-img { display: block; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: inherit; text-decoration: none; }
.rp-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.rp-img span { display: block; padding: 6px 8px; font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-status { flex-wrap: wrap; }
.rp-status label { flex: 1; min-width: 45%; }
.rp-status input { position: absolute; opacity: 0; pointer-events: none; }
.rp-status span { display: block; text-align: center; padding: 9px 6px; border-radius: 9px; font-weight: 650; font-size: 0.9rem; color: var(--muted); cursor: pointer; }
.rp-status input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.rp-status input:focus-visible + span { outline: 2px solid var(--accent); }
.rp-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.rp-thumb { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; }
.rp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rp-thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.7); color: #fff; cursor: pointer; line-height: 1; }
.mk-items { margin: 4px 0 0; padding-left: 22px; line-height: 1.55; }
.mk-items li { margin-bottom: 4px; }

/* Instructions and markups */
.si-num { font-weight: 800; font-size: 0.8rem; background: #fff4cc; color: #8a5a00; padding: 4px 8px; border-radius: 8px; flex: none; }
.si-num.big { font-size: 0.95rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .si-num { background: #3a2e05; color: #ffd45a; }
}
:root[data-theme="dark"] .si-num { background: #3a2e05; color: #ffd45a; }
.status-pill { font-size: 0.72rem; font-weight: 750; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; flex: none; }
.status-pill.s-issued, .status-pill.s-sent { background: #e0ebff; color: #1d4ed8; box-shadow: none; }
.status-pill.s-acknowledged, .status-pill.s-quoted { background: #fff4cc; color: #8a5a00; box-shadow: none; }
.status-pill.s-approved, .status-pill.s-completed, .status-pill.s-done, .status-pill.s-closed { background: #dcfce7; color: #166534; box-shadow: none; }
.status-pill.s-cancelled { text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status-pill.s-issued, :root:not([data-theme="light"]) .status-pill.s-sent { background: #2a2e37; color: #8bb2ff; }
  :root:not([data-theme="light"]) .status-pill.s-acknowledged, :root:not([data-theme="light"]) .status-pill.s-quoted { background: #3a2e05; color: #ffd45a; }
  :root:not([data-theme="light"]) .status-pill.s-approved, :root:not([data-theme="light"]) .status-pill.s-completed, :root:not([data-theme="light"]) .status-pill.s-done, :root:not([data-theme="light"]) .status-pill.s-closed { background: #10301c; color: #6ee7a0; }
}
:root[data-theme="dark"] .status-pill.s-issued, :root[data-theme="dark"] .status-pill.s-sent { background: #2a2e37; color: #8bb2ff; }
:root[data-theme="dark"] .status-pill.s-acknowledged, :root[data-theme="dark"] .status-pill.s-quoted { background: #3a2e05; color: #ffd45a; }
:root[data-theme="dark"] .status-pill.s-approved, :root[data-theme="dark"] .status-pill.s-completed, :root[data-theme="dark"] .status-pill.s-done, :root[data-theme="dark"] .status-pill.s-closed { background: #10301c; color: #6ee7a0; }
.markup-img { display: block; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); text-decoration: none; color: inherit; }
.markup-img img { width: 100%; display: block; max-height: 60vh; object-fit: contain; background: #fff; }
.markup-img.small img { max-height: 200px; }
.markup-img.small span { display: block; padding: 8px 12px; font-size: 0.85rem; color: var(--muted); background: var(--surface); }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
.mk-card { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); text-decoration: none; color: inherit; }
.mk-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #fff; }
.mk-card .title { font-weight: 700; padding: 8px 10px 0; font-size: 0.92rem; }
.mk-card .sub { font-size: 0.78rem; color: var(--muted); padding: 2px 10px 10px; }
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.send-grid > :first-child { grid-column: 1 / -1; }
.link-box { display: flex; gap: 8px; margin: 10px 0 12px; }
.link-box .input { flex: 1; min-width: 0; font-size: 0.85rem; }
.scope-choice { display: flex; flex-direction: column; gap: 8px; }
.scope-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.scope-opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.scope-opt b { display: block; } .scope-opt .muted { display: block; }
.scope-opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.mini-thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; background: #fff; }
.ins-thumb.add { display: grid; place-items: center; border: 2px dashed var(--line); background: none; color: var(--muted); cursor: pointer; }
.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 150; padding: calc(env(safe-area-inset-top) + 6px) 14px 6px; background: #1f2937; color: #fff;
  font-size: 0.8rem; font-weight: 600; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.ad-badge.dir { background: #ccfbf1; color: #0f766e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ad-badge.dir { background: #0c302c; color: #5eead4; }
}
:root[data-theme="dark"] .ad-badge.dir { background: #0c302c; color: #5eead4; }
.contractor-card { margin-top: 12px; }
.contractor-card .send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contractor-card .send-grid > :first-child { grid-column: 1 / -1; }

/* Video clips and voice notes */
.viewer video { width: 100%; max-height: 62vh; display: block; background: #000; }
.vid-badge { position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,0.65); color: #fff;
  font-size: 0.68rem; font-weight: 700; padding: 2px 6px 2px 4px; border-radius: 6px; }
.vid-badge svg { width: 11px; height: 11px; }
.vn-card { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.vn-card audio { width: 100%; height: 38px; }
.vn-icon { color: #c81e1e; display: none; }
.vn-rec { border-style: dashed; }
.vn-live { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fde2e2; color: #7f1d1d; }
.vn-live .muted { color: #9f4a4a; }
.vn-dot { width: 12px; height: 12px; border-radius: 50%; background: #e53935; animation: vnpulse 1s ease-in-out infinite; flex: none; }
@keyframes vnpulse { 50% { opacity: 0.3; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vn-live { background: #3b1414; color: #fecaca; }
  :root:not([data-theme="light"]) .vn-live .muted { color: #fca5a5; }
}
:root[data-theme="dark"] .vn-live { background: #3b1414; color: #fecaca; }
:root[data-theme="dark"] .vn-live .muted { color: #fca5a5; }
@media (max-width: 420px) { .dock .d-btn { width: 58px; font-size: 0.66rem; } .dock { gap: 2px; padding: 6px; } .dock .shutter { width: 60px; height: 60px; } }
.send-grid, .contractor-card .send-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.send-grid > .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; }
.rp-status label { position: relative; }
.rp-status input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.reply-page { overflow-x: hidden; }
.hc-video.portrait { aspect-ratio: auto; background: #0b0b0c; display: flex; justify-content: center; padding: 0; }
.hc-video.portrait video { position: static; width: auto; max-width: 100%; height: auto; max-height: 72vh; border-radius: 12px; }

/* BIM (ModelSync) */
.bim-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.bim-head .segmented { flex: 1; max-width: 360px; }
.bim-note { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.bim-note svg { flex: none; color: var(--st-warn); margin-top: 2px; }
.bim-ws { display: grid; gap: 10px; grid-template-columns: 1fr; grid-template-areas: "centre" "right" "left"; }
@media (min-width: 980px) { .bim-ws { grid-template-columns: 250px minmax(0, 1fr) 300px; grid-template-areas: "left centre right"; } }
.bim-left { grid-area: left; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bim-centre { grid-area: centre; min-width: 0; }
.bim-right { grid-area: right; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bim-card { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.bim-ttl { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.bim-name { margin: 0 0 8px; font-size: 1.05rem; }
.bim-canvas { position: relative; height: 56vh; min-height: 320px; border-radius: 14px; overflow: hidden; background: #eef1f5; box-shadow: inset 0 0 0 1px var(--line); touch-action: none; }
@media (min-width: 980px) { .bim-canvas { height: 66vh; } }
.bim-canvas canvas { display: block; }
.bim-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.bim-empty > svg { width: 40px; height: 40px; }
.bim-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.bim-sec { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 650; color: var(--muted); }
.bim-sec input { width: 110px; accent-color: #1d4ed8; }
.bim-disc { display: flex; flex-direction: column; gap: 6px; }
.bim-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.bim-check .muted { margin-left: auto; }
.bim-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.d-architecture { background: #c7ccd4; } .d-structure { background: #7b8591; } .d-hvac { background: #3b82f6; } .d-plumbing { background: #10b981; }
.d-fire-protection { background: #ef4444; } .d-electrical { background: #f5b800; } .d-equipment { background: #374151; } .d-other { background: #a78bfa; }
.bim-search { margin-bottom: 6px; }
.bim-tree { max-height: 300px; overflow: auto; font-size: 0.86rem; }
.bim-tree summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.bim-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 5px 4px; border-radius: 8px; text-align: left; color: var(--ink); cursor: pointer; font: inherit; font-size: 0.85rem; }
.bim-item:hover { background: var(--surface-2); }
.kv-mini { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 0.84rem; align-items: baseline; }
.kv-mini > span { color: var(--muted); }
.kv-mini code { font-size: 0.78rem; word-break: break-all; }
.bim-pset summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.bim-pset .kv-mini { margin-top: 8px; }
.bim-clash-n { width: 26px; height: 26px; border-radius: 50%; background: #fde2e2; color: #b91c1c; font-weight: 800; display: grid; place-items: center; flex: none; font-size: 0.8rem; }
.bim-fedrow { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.bim-fedrow .bim-check { min-width: 0; font-size: 0.86rem; }
.bim-madd { flex: none; align-self: center; }
.bim-clash-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.bim-clash-opts .field { width: 130px; }
.bim-clash-checks { display: flex; flex-direction: column; gap: 6px; flex: 1 1 240px; padding-bottom: 4px; }
.bim-co .title { display: block; font-weight: 700; } .bim-co .sub { display: block; font-size: 0.82rem; color: var(--muted); }
.bim-clash { gap: 10px; align-items: center; }
.bim-clash-go { border: 0; background: none; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bim-clash-go .title { font-weight: 700; }
.bim-clash-go .sub { color: var(--muted); font-size: 0.82rem; }
.bim-clash-go .pill { margin-right: 4px; }
:root[data-theme="dark"] .bim-clash-n { background: #4a1d1d; color: #fca5a5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bim-clash-n { background: #4a1d1d; color: #fca5a5; } }
.bim-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bim-plan-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); font-size: 0.86rem; }
.bim-plan-card .mt-icon { width: 36px; height: 36px; margin-bottom: 4px; }
.bim-plan-card span:last-child { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bim-canvas { background: #181b20; }
}
:root[data-theme="dark"] .bim-canvas { background: #181b20; }
.bim-right .bim-card > .bim-ttl:first-child { text-transform: none; letter-spacing: 0; font-size: 0.8rem; color: #1d4ed8; }
body.wide-view main, body.wide-view .topbar-row { max-width: 1480px; }

/* ---------- stakeholder summary: choosing sections ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; background: var(--bg, transparent); }
.sp-list { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.sp-sec { border: 1px solid var(--line); border-radius: 12px; }
.sp-sec.on { border-color: var(--accent, #f5b800); }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; }
.sp-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: .95rem; cursor: pointer; }
.sp-name span, .sp-topic span { overflow-wrap: anywhere; }
.sp-name input, .sp-topic input { width: 20px; height: 20px; flex: none; accent-color: var(--accent, #f5b800); }
.sp-more { display: inline-flex; align-items: center; gap: 4px; flex: none; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .8rem; cursor: pointer; }
.sp-topics { border-top: 1px solid var(--line); padding: 8px 10px 10px; display: grid; gap: 4px; }
.sp-topic { display: flex; align-items: center; gap: 6px; }
.sp-topic label { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: .9rem; padding: 5px 0; cursor: pointer; }
.sp-add { display: flex; gap: 8px; margin-top: 4px; }
.sp-add .input { flex: 1; min-width: 0; min-height: 38px; }
.sum-group { margin: 18px 4px 6px; font-weight: 800; font-size: 1rem; letter-spacing: .01em; }
.uns-sel { max-width: 46%; min-height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card, transparent); color: inherit; font-size: .82rem; padding: 0 6px; }

/* ---------- registers ---------- */
.seg-scroll { overflow: hidden; }
.chip .muted.small { margin-left: 4px; }
.col-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.pill { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.pill.good { color: var(--st-good); } .pill.warn { color: var(--st-warn); } .pill.bad { color: var(--st-critical); }
.pill.demo { background: #ede9fe; color: #6d28d9; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill.demo { background: #2e1f5e; color: #c4b5fd; }
}
:root[data-theme="dark"] .pill.demo { background: #2e1f5e; color: #c4b5fd; }
.sign-dot { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-right: 3px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.sign-dot.on { color: #fff; background: var(--st-good); box-shadow: none; }
.ch-bar { fill: var(--chart-plan); }
.kpi-grid .kpi-tile .eyebrow { font-size: 0.7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi-grid.three .kpi-val { font-size: 1.45rem; }
.hc-list-plain { margin: 8px 0 12px; padding-left: 18px; display: grid; gap: 8px; } .hc-list-plain li { line-height: 1.5; }

/* =====================================================================
   7.4 look: deeper navy, sharper surfaces, soft glow, smooth motion.
   Layered over the styles above so every screen picks it up.
   ===================================================================== */
:root {
  --accent-grad: linear-gradient(180deg, #ffd24d 0%, #ffc21a 45%, #f5a800 100%);
  --blue-grad: linear-gradient(135deg, #3b82f6, #2563eb);
  --glow: 0 8px 24px rgba(245, 168, 0, 0.32);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.28);
  --hair: rgba(15, 23, 42, 0.07);
  --bg: #eef1f6;
  --surface-2: #f4f6fa;
  --shadow: 0 1px 1px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  font-feature-settings: "ss01", "cv11";
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12;
    --surface: #181b20;
    --surface-2: #20242b;
    --line: #2a2e37;
    --hair: rgba(148, 178, 255, 0.08);
    --glass: rgba(16, 18, 22, 0.72);
    --shadow: 0 0 0 1px rgba(148, 178, 255, 0.06) inset, 0 12px 32px rgba(0, 0, 0, 0.4);
    --glow: 0 8px 28px rgba(255, 194, 26, 0.28);
    --ring: 0 0 0 3px rgba(96, 165, 250, 0.35);
  }
}
:root[data-theme="dark"] {
    --bg: #0d0f12;
    --surface: #181b20;
    --surface-2: #20242b;
    --line: #2a2e37;
    --hair: rgba(148, 178, 255, 0.08);
    --glass: rgba(16, 18, 22, 0.72);
    --shadow: 0 0 0 1px rgba(148, 178, 255, 0.06) inset, 0 12px 32px rgba(0, 0, 0, 0.4);
    --glow: 0 8px 28px rgba(255, 194, 26, 0.28);
    --ring: 0 0 0 3px rgba(96, 165, 250, 0.35);
  }
/* Ambient light behind everything: a faint blue glow top right, warm glow bottom left. */
body { background:
  radial-gradient(900px 520px at 100% -10%, rgba(245, 196, 0, 0.08), transparent 60%),
  radial-gradient(700px 480px at -10% 110%, rgba(255, 194, 26, 0.08), transparent 60%),
  var(--bg); background-attachment: fixed; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background:
    radial-gradient(900px 560px at 100% -10%, rgba(245, 196, 0, 0.05), transparent 60%),
    radial-gradient(700px 520px at -10% 110%, rgba(255, 194, 26, 0.07), transparent 60%),
    var(--bg); background-attachment: fixed; }
}
:root[data-theme="dark"] body { background:
    radial-gradient(900px 560px at 100% -10%, rgba(245, 196, 0, 0.05), transparent 60%),
    radial-gradient(700px 520px at -10% 110%, rgba(255, 194, 26, 0.07), transparent 60%),
    var(--bg); background-attachment: fixed; }
svg.i { stroke-width: 1.85; }

/* Top bar: frosted glass */
.topbar { background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); }
.topbar.scrolled { box-shadow: 0 1px 0 var(--hair); }
.icon-btn { transition: background .15s, transform .15s var(--ease); }
.icon-btn:hover { background: rgba(127, 127, 127, 0.1); }
.icon-btn:active { transform: scale(0.92); }
.jump-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .85rem; cursor: pointer; transition: border-color .15s, color .15s; }
.jump-btn:hover { border-color: var(--blue); color: var(--ink); }
.jump-btn kbd { font: 600 .7rem/1 ui-monospace, Menlo, monospace; padding: 3px 5px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
@media (max-width: 520px) { .jump-btn span, .jump-btn kbd { display: none; } .jump-btn { width: 40px; justify-content: center; padding: 0; border: 0; background: none; color: inherit; } }

/* Headings */
.large-title { letter-spacing: -0.035em; }
.eyebrow { letter-spacing: 0.12em; }

/* Cards and lists: crisp hairlines */
.card, .list, .kpi-tile, .more-tile, .context-btn { box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .list, :root:not([data-theme="light"]) .kpi-tile, :root:not([data-theme="light"]) .context-btn { background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0) 40%), var(--surface); }
}
:root[data-theme="dark"] .card, :root[data-theme="dark"] .list, :root[data-theme="dark"] .kpi-tile, :root[data-theme="dark"] .context-btn { background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0) 40%), var(--surface); }
.list-item { transition: background .15s; }
.list-item:hover { background: rgba(127, 127, 127, 0.06); }
.kpi-val { font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

/* Buttons */
.btn { transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s; }
.btn.primary { background: var(--accent-grad); box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.45); }
.btn.primary:hover { filter: brightness(1.04); }
.fab { background: var(--accent-grad) !important; box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.45) !important; transition: transform .2s var(--spring); }
.fab:active { transform: scale(0.94); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.input:focus, select:focus, textarea:focus { border-color: var(--blue) !important; box-shadow: var(--ring); outline: none; }

/* Coloured icon tiles: soft gradient squares */
.icon-tile, .mt-icon { position: relative; }
.icon-tile.yellow, .mt-icon.yellow { background: linear-gradient(135deg, #fff1bf, #ffe08a); color: #7a4f00; }
.icon-tile.blue, .mt-icon.blue { background: linear-gradient(135deg, #e3edff, #c9dbff); color: #1d4ed8; }
.icon-tile.red, .mt-icon.red { background: linear-gradient(135deg, #ffe4e4, #ffcaca); color: #b91c1c; }
.mt-icon.teal, .icon-tile.teal { background: linear-gradient(135deg, #d8f7f1, #b5ece1); color: #0f766e; }
.mt-icon.pink { background: linear-gradient(135deg, #ffe4f1, #ffc9e2); color: #be185d; }
.mt-icon.orange { background: linear-gradient(135deg, #ffedd8, #ffd7ad); color: #c2410c; }
.mt-icon.indigo { background: linear-gradient(135deg, #e6e8ff, #cfd3ff); color: #4338ca; }
.mt-icon.green { background: linear-gradient(135deg, #dcf9e5, #b9f0cc); color: #15803d; }
.mt-icon.purple { background: linear-gradient(135deg, #efe5ff, #dccbff); color: #6d28d9; }
.mt-icon.slate { background: linear-gradient(135deg, #eef1f6, #dde3ec); color: #334155; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-tile.yellow, :root:not([data-theme="light"]) .mt-icon.yellow { background: linear-gradient(135deg, rgba(255,194,26,.22), rgba(255,194,26,.08)); color: #ffd24d; }
  :root:not([data-theme="light"]) .icon-tile.blue, :root:not([data-theme="light"]) .mt-icon.blue { background: linear-gradient(135deg, rgba(59,130,246,.28), rgba(59,130,246,.08)); color: #93c5fd; }
  :root:not([data-theme="light"]) .icon-tile.red, :root:not([data-theme="light"]) .mt-icon.red { background: linear-gradient(135deg, rgba(248,113,113,.26), rgba(248,113,113,.08)); color: #fca5a5; }
  :root:not([data-theme="light"]) .mt-icon.teal, :root:not([data-theme="light"]) .icon-tile.teal { background: linear-gradient(135deg, rgba(45,212,191,.24), rgba(45,212,191,.07)); color: #5eead4; }
  :root:not([data-theme="light"]) .mt-icon.pink { background: linear-gradient(135deg, rgba(244,114,182,.24), rgba(244,114,182,.07)); color: #f9a8d4; }
  :root:not([data-theme="light"]) .mt-icon.orange { background: linear-gradient(135deg, rgba(251,146,60,.24), rgba(251,146,60,.07)); color: #fdba74; }
  :root:not([data-theme="light"]) .mt-icon.indigo { background: linear-gradient(135deg, rgba(129,140,248,.26), rgba(129,140,248,.08)); color: #a5b4fc; }
  :root:not([data-theme="light"]) .mt-icon.green { background: linear-gradient(135deg, rgba(74,222,128,.22), rgba(74,222,128,.07)); color: #86efac; }
  :root:not([data-theme="light"]) .mt-icon.purple { background: linear-gradient(135deg, rgba(167,139,250,.26), rgba(167,139,250,.08)); color: #c4b5fd; }
  :root:not([data-theme="light"]) .mt-icon.slate { background: linear-gradient(135deg, rgba(148,163,184,.22), rgba(148,163,184,.07)); color: #cbd5e1; }
}
:root[data-theme="dark"] .icon-tile.yellow, :root[data-theme="dark"] .mt-icon.yellow { background: linear-gradient(135deg, rgba(255,194,26,.22), rgba(255,194,26,.08)); color: #ffd24d; }
:root[data-theme="dark"] .icon-tile.blue, :root[data-theme="dark"] .mt-icon.blue { background: linear-gradient(135deg, rgba(59,130,246,.28), rgba(59,130,246,.08)); color: #93c5fd; }
:root[data-theme="dark"] .icon-tile.red, :root[data-theme="dark"] .mt-icon.red { background: linear-gradient(135deg, rgba(248,113,113,.26), rgba(248,113,113,.08)); color: #fca5a5; }
:root[data-theme="dark"] .mt-icon.teal, :root[data-theme="dark"] .icon-tile.teal { background: linear-gradient(135deg, rgba(45,212,191,.24), rgba(45,212,191,.07)); color: #5eead4; }
:root[data-theme="dark"] .mt-icon.pink { background: linear-gradient(135deg, rgba(244,114,182,.24), rgba(244,114,182,.07)); color: #f9a8d4; }
:root[data-theme="dark"] .mt-icon.orange { background: linear-gradient(135deg, rgba(251,146,60,.24), rgba(251,146,60,.07)); color: #fdba74; }
:root[data-theme="dark"] .mt-icon.indigo { background: linear-gradient(135deg, rgba(129,140,248,.26), rgba(129,140,248,.08)); color: #a5b4fc; }
:root[data-theme="dark"] .mt-icon.green { background: linear-gradient(135deg, rgba(74,222,128,.22), rgba(74,222,128,.07)); color: #86efac; }
:root[data-theme="dark"] .mt-icon.purple { background: linear-gradient(135deg, rgba(167,139,250,.26), rgba(167,139,250,.08)); color: #c4b5fd; }
:root[data-theme="dark"] .mt-icon.slate { background: linear-gradient(135deg, rgba(148,163,184,.22), rgba(148,163,184,.07)); color: #cbd5e1; }

/* Project view switcher: a pill that slides to the chosen view */
.viewbar { position: relative; isolation: isolate; box-shadow: inset 0 0 0 1px var(--hair); }
.viewbar button.on { background: transparent; box-shadow: none; }
.viewbar button.on svg { color: #a86d00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .viewbar button.on svg { color: var(--accent); }
}
:root[data-theme="dark"] .viewbar button.on svg { color: var(--accent); }
.vb-pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; z-index: -1; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); transition: transform .38s var(--spring), width .38s var(--spring); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vb-pill { background: linear-gradient(180deg, #2a2e37, #22262e); box-shadow: 0 0 0 1px rgba(148,178,255,.12), 0 6px 16px rgba(0,0,0,.35); }
}
:root[data-theme="dark"] .vb-pill { background: linear-gradient(180deg, #2a2e37, #22262e); box-shadow: 0 0 0 1px rgba(148,178,255,.12), 0 6px 16px rgba(0,0,0,.35); }

/* Bottom dock: floating glass */
.dock { background: var(--glass) !important; -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); box-shadow: 0 0 0 1px var(--hair), 0 18px 40px rgba(15, 23, 42, 0.18) !important; }
.dock .shutter { background: var(--accent-grad); box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.5); transition: transform .2s var(--spring); }

/* More panel: grouped, searchable */
.more-search { margin: 6px 0 12px; }
.more-group { margin: 14px 2px 8px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.more-recent { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.more-recent::-webkit-scrollbar { display: none; }
.more-recent button { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; font-weight: 600; cursor: pointer; }
.more-tile { transition: transform .18s var(--ease), box-shadow .2s; border: 1px solid transparent; }
.more-tile:hover { transform: translateY(-2px); }
.more-tile.on { border-color: var(--accent); }

/* Jump to: command palette */
.jump-sheet .sheet { padding-top: 6px; }
.jump-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); margin-bottom: 10px; }
.jump-input input { flex: 1; border: 0; background: none; font-size: 1.05rem; outline: none; min-width: 0; }
.jump-input:focus-within { box-shadow: 0 0 0 1px var(--blue), var(--ring); }
.jump-list { display: grid; gap: 2px; max-height: 58vh; overflow-y: auto; }
.jump-sec { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 10px 6px 4px; }
.jump-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; color: inherit; }
.jump-item .icon-tile { width: 32px; height: 32px; border-radius: 9px; }
.jump-item .jt { font-weight: 600; } .jump-item .js { font-size: .8rem; color: var(--muted); }
.jump-item.sel, .jump-item:hover { background: rgba(37, 99, 235, 0.09); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .jump-item.sel, :root:not([data-theme="light"]) .jump-item:hover { background: rgba(96, 165, 250, 0.12); }
}
:root[data-theme="dark"] .jump-item.sel, :root[data-theme="dark"] .jump-item:hover { background: rgba(96, 165, 250, 0.12); }
.jump-item .kbd { margin-left: auto; font: 600 .7rem/1 ui-monospace, Menlo, monospace; color: var(--muted); }
.jump-empty { padding: 20px; text-align: center; color: var(--muted); }

/* Sheets: spring up, blurred backdrop */
.sheet-backdrop { background: rgba(10, 11, 13, 0.42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .22s var(--ease); }
.sheet { animation: sheetUp .42s var(--spring); box-shadow: 0 -10px 40px rgba(0,0,0,.18); }
@keyframes sheetUp { from { transform: translateY(70px); opacity: 0.4; } }
.sheet-backdrop.closing { animation: fadeOut .2s var(--ease) forwards; }
.sheet-backdrop.closing .sheet { animation: sheetDown .22s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetDown { to { transform: translateY(60px); opacity: 0; } }

/* Toast: floating glass pill */
.toast { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 30px rgba(0,0,0,.25); animation: toastIn .38s var(--spring); }
@keyframes toastIn { from { transform: translate(-50%, -16px) scale(.96); opacity: 0; } }

/* Screens fade and rise in as they open */
#app > *:not(#tab-body), #tab-body > * { animation: viewIn .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.list > *:nth-child(-n+12) { animation: viewIn .34s var(--ease) both; }
.list > *:nth-child(2) { animation-delay: .02s; } .list > *:nth-child(3) { animation-delay: .04s; } .list > *:nth-child(4) { animation-delay: .06s; }
.list > *:nth-child(5) { animation-delay: .08s; } .list > *:nth-child(6) { animation-delay: .1s; } .list > *:nth-child(n+7) { animation-delay: .12s; }
.kpi-grid > * { animation: viewIn .36s var(--ease) both; }
.kpi-grid > *:nth-child(2) { animation-delay: .03s; } .kpi-grid > *:nth-child(3) { animation-delay: .06s; } .kpi-grid > *:nth-child(n+4) { animation-delay: .09s; }
#app.quiet > *, #tab-body.quiet > *, .quiet .list > *, .quiet .kpi-grid > * { animation: none; }

/* Loading: shimmering placeholder instead of plain text */
.skel { display: grid; gap: 10px; margin-top: 16px; }
.skel i { display: block; height: 64px; border-radius: 16px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 40%, var(--surface) 80%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; box-shadow: var(--shadow); }
.skel i:nth-child(1) { height: 84px; } .skel i:nth-child(3) { opacity: .7; } .skel i:nth-child(4) { opacity: .45; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Respect the phone's reduce motion setting */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
.rfi-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 6px; }
.rfi-stats > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.rfi-stats .eyebrow { display: block; font-size: .64rem; margin-bottom: 4px; }
.rfi-stats b { font-size: 1.35rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rfi-stats b.small { font-size: .9rem; }
.rfi-stats .bad b { color: var(--st-critical); }
.rfi-card .kv .k, .rfi-card .kv .v { padding-left: 0; }
/* MEP progress: planned against actual */
.pv-bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; box-shadow: inset 0 0 0 1px var(--hair); }
.pv-bar .pv-plan { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(135deg, rgba(37,99,235,.28) 0 4px, rgba(37,99,235,.12) 4px 8px); border-right: 2px solid var(--blue); }
.pv-bar .pv-act { position: absolute; inset: 2px auto 2px 0; border-radius: 99px; background: var(--st-good); }
.pv-act.warn { background: var(--st-warn); } .pv-act.bad { background: var(--st-critical); }
.pv-var { margin-top: 3px; }
.pv-rows { display: grid; gap: 10px; margin-top: 10px; }
.pv-row { display: grid; grid-template-columns: minmax(84px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.pv-row .pv-bar { margin: 0; height: 10px; }
.pv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pv-num { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 52px; text-align: right; }
.pv-key { display: inline-flex; gap: 6px; align-items: center; font-size: .75rem; color: var(--muted); }
.pv-key i { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin-left: 6px; position: static; }
.pv-key i.pv-plan { background: repeating-linear-gradient(135deg, rgba(37,99,235,.35) 0 3px, rgba(37,99,235,.15) 3px 6px); }
.pv-key i.pv-act { background: var(--st-good); }
/* Sign-in: blueprint grid with a soft glow */
.login-page { position: relative; overflow: hidden; background:
  radial-gradient(900px 500px at 80% -10%, rgba(59,130,246,.35), transparent 60%),
  radial-gradient(700px 500px at 10% 110%, rgba(255,194,26,.16), transparent 60%), #0d0f12; }
.login-page::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(148,178,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(148,178,255,.07) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%); }
.login-card { position: relative; animation: sheetUp .6s var(--spring); box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(148,178,255,.12) inset, 0 0 60px rgba(59,130,246,.15); }
.login-card .field input:focus { box-shadow: inset 0 0 0 1px #60a5fa, 0 0 0 3px rgba(96,165,250,.3); }
/* Project cards on the home screen lift slightly */
.project { transition: transform .2s var(--ease), box-shadow .2s; }
.project:hover { transform: translateY(-2px); }

/* =============== 7.5: Home, tour, BU tracker, Daily log, Dashboards =============== */
.home-today { margin-top: 14px; }
.home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.hs { display: grid; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface-2); text-decoration: none; color: inherit; min-width: 0; transition: transform .15s var(--ease); }
.hs:active { transform: scale(.97); }
.hs b { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hs span { font-size: .72rem; color: var(--muted); line-height: 1.2; }
.hs.bad b { color: var(--st-critical); }
.home-q { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; margin: 22px 2px 10px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-act { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 14px; min-height: 128px; border-radius: 20px; border: 1px solid var(--hair); background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; color: inherit; transition: transform .18s var(--ease), box-shadow .2s; }
.home-act:hover { transform: translateY(-2px); }
.home-act:active { transform: scale(.97); }
.home-act .mt-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 4px; }
.home-act .mt-icon svg { width: 24px; height: 24px; }
.ha-t { font-weight: 750; font-size: 1.02rem; }
.ha-s { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.dock.dock-home { padding: 7px; }

.tour { position: fixed; inset: 0; z-index: 90; }
.tour-spot { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(10, 11, 13, .62), 0 0 0 3px var(--accent); transition: all .35s var(--spring); pointer-events: none; }
.tour-card { position: fixed; left: 50%; transform: translateX(-50%); width: min(380px, calc(100% - 32px)); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 16px 16px 12px; box-shadow: 0 24px 60px rgba(0,0,0,.4); animation: toastIn .4s var(--spring); }
.tour-card h3 { margin: 4px 0 6px; font-size: 1.15rem; }
.tour-card p { margin: 0; color: var(--ink-2); line-height: 1.45; }
.tour-dots { display: flex; gap: 5px; } .tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .tour-dots i.on { background: var(--accent-strong); width: 18px; border-radius: 99px; }

.back-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; border: 0; background: none; color: var(--blue); font-weight: 650; cursor: pointer; padding: 6px 0; }
.pill.next { color: var(--blue); }
.ring-chart { flex: none; }
.ring-chart .rc-track { stroke: var(--surface-2); }
.ring-chart .rc-val { stroke: var(--accent-strong); transition: stroke-dashoffset .8s var(--ease); }
.ring-chart .rc-val.full { stroke: var(--st-good); }
.ring-chart .rc-text { font-size: 22px; font-weight: 800; fill: var(--ink); }
.bu-phases { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; scrollbar-width: none; }
.bu-phases::-webkit-scrollbar { display: none; }
.bu-phase { flex: none; display: grid; gap: 6px; min-width: 132px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; color: inherit; }
.bu-phase.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--glow); }
.bu-phase.add { min-width: 48px; place-items: center; color: var(--muted); }
.bp-name { font-weight: 800; }
.bp-bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; } .bp-bar i { display: block; height: 100%; background: var(--accent-strong); border-radius: 99px; }
.bu-hero { display: flex; gap: 16px; align-items: center; margin-top: 10px; }
.bu-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0 4px; }
.bu-nums.col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.bu-nums div { display: grid; } .bu-nums b { font-size: 1.25rem; font-variant-numeric: tabular-nums; } .bu-nums span { font-size: .72rem; color: var(--muted); }
.bu-nums .bad b { color: var(--st-critical); }
.bu-rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .bu-rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bu-room { display: grid; gap: 6px; padding: 14px; border-radius: 18px; border: 1px solid var(--hair); background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; color: inherit; transition: transform .18s var(--ease); min-width: 0; }
.bu-room:hover { transform: translateY(-2px); }
.br-pct { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; } .br-pct small { font-size: .9rem; color: var(--muted); }
.bu-item.done .title { text-decoration: line-through; color: var(--muted); }
.bu-tick { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: none; color: transparent; display: grid; place-items: center; cursor: pointer; transition: all .2s var(--spring); }
.bu-tick:hover { border-color: var(--st-good); }
.bu-item.done .bu-tick { background: var(--st-good); border-color: var(--st-good); color: #fff; }
.bu-open { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.seg button { border: 0; background: none; border-radius: 10px; padding: 9px 4px; font-weight: 650; font-size: .86rem; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg-n { font-size: .7rem; font-weight: 800; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--line); display: inline-grid; place-items: center; }
.seg-n.bad { background: var(--st-critical); color: #fff; }
.dl-datebar { display: flex; align-items: center; gap: 6px; margin: 12px 0; }
.dl-date { flex: 1; position: relative; display: grid; text-align: center; padding: 8px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.dl-date span { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dl-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dl-missing { margin-top: 12px; border: 1px dashed var(--accent-strong); }
.dl-entry .col-end .btn.sm { min-height: 30px; padding: 0 10px; }

.dash { display: grid; gap: 12px; margin-top: 12px; }
.dtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .dtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dtile { position: relative; overflow: hidden; display: grid; gap: 2px; align-content: start; text-align: left; padding: 14px; border-radius: 18px; border: 1px solid var(--hair); background: var(--surface); box-shadow: var(--shadow); color: inherit; min-width: 0; }
button.dtile { cursor: pointer; }
.dtile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.dtile.ok::before { background: var(--st-good); } .dtile.warn::before { background: var(--st-warn); } .dtile.bad::before { background: var(--st-critical); }
.dt-val { font-size: 2rem; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dt-val small { font-size: .95rem; color: var(--muted); margin-left: 2px; }
.dtile.bad .dt-val { color: var(--st-critical); }
.dt-sub { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dcard { background: var(--surface); border-radius: 18px; border: 1px solid var(--hair); box-shadow: var(--shadow); padding: 14px; min-width: 0; }
.dcard h3 { margin: 0 0 10px; font-size: .95rem; }
.dgrid { display: grid; gap: 12px; } @media (min-width: 820px) { .dgrid { grid-template-columns: 1fr 1fr; } }
.hb { display: grid; gap: 10px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; }
.hb-l { font-weight: 650; font-size: .88rem; display: grid; min-width: 0; } .hb-l small { font-weight: 500; color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); }
.hb-track i { display: block; height: 100%; border-radius: 99px; background: var(--blue-grad); transition: width .8s var(--ease); }
.hb-track i.good { background: var(--st-good); } .hb-track i.warn { background: var(--st-warn); } .hb-track i.bad { background: var(--st-critical); }
.hb-v { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.snap { display: grid; gap: 4px; }
.snap-row { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; border: 0; background: var(--surface-2); text-align: left; color: inherit; cursor: pointer; }
.snap-row > b { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--accent-grad); color: var(--on-accent); font-size: .85rem; }
.snap-t { display: block; font-weight: 650; } .snap-s { display: block; font-size: .78rem; color: var(--muted); }
.spark { width: 100%; height: 70px; } .sp-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; } .sp-fill { fill: rgba(37,99,235,.12); }
.dchart { width: 100%; height: auto; }
.ch-axis.strong { font-weight: 700; fill: var(--ink-2); }
.sc0 { fill: #2563eb; background: #2563eb; } .sc1 { fill: #f5a800; background: #f5a800; } .sc2 { fill: #0f766e; background: #0f766e; } .sc3 { fill: #a855f7; background: #a855f7; }
.sc4 { fill: #ef4444; background: #ef4444; } .sc5 { fill: #64748b; background: #64748b; } .sc6 { fill: #06b6d4; background: #06b6d4; } .sc7 { fill: #84cc16; background: #84cc16; }
.dlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .78rem; color: var(--muted); }
.dlegend span { display: inline-flex; align-items: center; gap: 6px; } .dlegend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cx-strip { display: flex; height: 26px; border-radius: 10px; overflow: hidden; gap: 2px; }
.cx-strip i { display: block; min-width: 6px; }
.cx0 { background: #94a3b8; } .cx1 { background: #ef4444; } .cx2 { background: #facc15; } .cx3 { background: #22c55e; } .cx4 { background: #3b82f6; } .cx5 { background: #e2e8f0; box-shadow: inset 0 0 0 1px #94a3b8; }
.cx1-t { color: #dc2626; font-weight: 700; } .cx2-t { color: #b45309; font-weight: 700; } .cx3-t { color: #15803d; font-weight: 700; } .cx4-t, .cx5-t { color: var(--blue); font-weight: 700; } .cx0-t { color: var(--muted); }
.dtable-wrap { overflow-x: auto; } .dtable { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.dtable th, .dtable td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; } .dtable th:first-child, .dtable td:first-child { text-align: left; }
.dtable th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.phase-line { display: flex; gap: 6px; overflow-x: auto; }
.pl-step { flex: 1; min-width: 90px; display: grid; gap: 2px; text-align: left; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.pl-step i { height: 6px; border-radius: 99px; background: var(--line); margin-bottom: 6px; }
.pl-step.done i { background: var(--st-good); } .pl-step.now i { background: var(--accent-strong); box-shadow: var(--glow); }
.pl-step span { font-size: .75rem; color: var(--muted); }
.present { position: fixed; inset: 0; z-index: 95; overflow: auto; padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left)); background:
  radial-gradient(900px 560px at 100% -10%, rgba(59,130,246,.18), transparent 60%), var(--bg); animation: fade .25s var(--ease); }
.pr-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; max-width: 1200px; margin: 0 auto 16px; }
.pr-top h1 { margin: 2px 0 0; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.03em; }
.pr-body { max-width: 1200px; margin: 0 auto; }
.present .dtiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.present .dt-val { font-size: clamp(2rem, 4vw, 3rem); }
/* Disciplines dashboard */
.disc-chips { margin: 0; }
.disc-chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.disc-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.disc-card { display: grid; gap: 10px; padding: 14px; border-radius: 18px; border: 1px solid var(--hair); background: var(--surface); box-shadow: var(--shadow); text-align: left; color: inherit; cursor: pointer; position: relative; overflow: hidden; transition: transform .18s var(--ease); }
.disc-card:hover { transform: translateY(-2px); }
.disc-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.disc-card.ok::before { background: var(--st-good); } .disc-card.warn::before { background: var(--st-warn); } .disc-card.bad::before { background: var(--st-critical); }
.disc-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.disc-nums div { display: grid; min-width: 0; } .disc-nums b { font-size: 1.2rem; font-variant-numeric: tabular-nums; } .disc-nums span { font-size: .7rem; color: var(--muted); line-height: 1.2; }
.disc-nums .bad b { color: var(--st-critical); }
.disc-foot { font-size: .78rem; color: var(--muted); }
.disc-head { display: flex; gap: 12px; align-items: center; }
.disc-head h3 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.disc-head .icon-tile { width: 46px; height: 46px; border-radius: 14px; background: var(--blue-grad); color: #fff; }
.dtable tr.clickable { cursor: pointer; } .dtable tr.clickable:hover td { background: rgba(127,127,127,.06); }
/* About: maker credit kept small at the foot of the page */
.ab-maker-sm { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px auto 10px; font-size: .75rem; color: var(--muted); text-decoration: none; opacity: .85; }
.ab-maker-sm img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.ab-maker-sm:hover { opacity: 1; text-decoration: underline; }
/* Demo project */
.demo-cta { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: 18px; border: 1px dashed var(--line); background: var(--surface); color: inherit; text-align: left; cursor: pointer; }
.demo-cta > svg:first-child { color: var(--accent, #f5a800); flex: none; }
.demo-cta .grow { display: grid; gap: 2px; } .demo-cta .grow span { font-size: .82rem; color: var(--muted); }
.demo-bar { height: 10px; border-radius: 99px; background: var(--hair); overflow: hidden; margin: 14px 0 8px; }
.demo-bar i { display: block; height: 100%; background: var(--blue-grad, #2563eb); border-radius: 99px; transition: width .4s var(--ease, ease); }
/* Sheet buttons that stay in view at the bottom of long forms */
.sheet-actions { position: sticky; bottom: calc(-20px - var(--safe-b)); z-index: 3; gap: 8px; margin: 14px -16px calc(-20px - var(--safe-b)); padding: 12px 16px calc(14px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.sheet-actions .btn { min-height: 48px; }
.list-pick.picked { background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 12px; }
.pick-tick { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #111; flex: none; }
.toast-act { margin-left: 4px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: #111; font-weight: 800; text-decoration: none; }
.toast > span { white-space: nowrap; }
#top-left { display: flex; align-items: center; gap: 2px; }
.home-btn { flex: none; }
/* Edition badge */
.plan-badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; line-height: 1.3; }
.plan-badge svg { width: 12px; height: 12px; }
.plan-badge.premium { background: linear-gradient(135deg, #f5b400, #ffd75e); color: #1a1200; box-shadow: 0 2px 10px rgba(245,180,0,.35); }
.plan-badge.free { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--ink-2, inherit); box-shadow: inset 0 0 0 1px var(--line); }
.plan-badge.sm { font-size: .6rem; padding: 2px 7px; margin-left: 6px; }
.plan-badge.lg { font-size: .8rem; padding: 6px 12px; }
.plan-card.premium { box-shadow: inset 0 0 0 1.5px #f5b400, var(--shadow); }
/* RFIs split by integration discipline */
.rfi-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.rfi-col { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 4px 0 0 var(--line); }
.rfi-col.ok { box-shadow: inset 4px 0 0 var(--st-good, #16a34a); } .rfi-col.warn { box-shadow: inset 4px 0 0 var(--st-warn, #f59e0b); } .rfi-col.bad { box-shadow: inset 4px 0 0 var(--st-critical, #dc2626); }
.rfi-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rfi-nums button { display: grid; gap: 2px; padding: 8px 6px; border-radius: 12px; border: 0; background: var(--surface); color: inherit; cursor: pointer; text-align: center; min-height: 56px; }
.rfi-nums b { font-size: 1.35rem; font-variant-numeric: tabular-nums; } .rfi-nums span { font-size: .7rem; color: var(--muted); }
.rfi-nums .bad b { color: var(--st-critical, #dc2626); }
.linkish { background: none; border: 0; padding: 0; color: var(--link, #2f6fe0); font: inherit; cursor: pointer; text-decoration: underline; }
/* File inputs kept in the page (not display:none) so iPhone opens the camera when they are clicked */
.vh-input { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- 8.1: notifications bell, team chat, mentions, settings ---------- */
.bell-btn { position: relative; flex: none; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 0.68rem; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.bell-btn.mention .bell-count { background: var(--accent); color: var(--on-accent); }
.bell-btn.has-new svg { animation: bell-ring 1.2s ease 1; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .bell-btn.has-new svg { animation: none; } }
.nt-list .nt-row { text-align: left; }
.nt-row.unread { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.nt-row.is-mention .title { font-weight: 600; }
.nt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.nt-hint { display: flex; gap: 6px; align-items: flex-start; margin: 12px 2px 0; }
.icon-tile.slate { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--ink-2); }

.mention-pop { position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 4px; display: flex; flex-direction: column; }
.mention-pop[hidden] { display: none; }
.mention-pop button { text-align: left; padding: 9px 10px; border-radius: 8px; background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; }
.mention-pop button.on, .mention-pop button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.mention { color: var(--blue); font-weight: 600; }
.mention.me { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--ink); border-radius: 4px; padding: 0 2px; }

.chat-wrap { display: flex; flex-direction: column; gap: 10px; min-height: calc(100dvh - 260px); }
.chat-head { display: flex; align-items: center; gap: 10px; }
.chat-log { flex: 1; overflow-y: auto; max-height: calc(100dvh - 330px); min-height: 240px; padding: 12px; border-radius: var(--r); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.chat-day { align-self: center; font-size: 0.75rem; color: var(--muted); background: var(--surface); padding: 3px 10px; border-radius: 10px; margin: 8px 0 4px; }
.chat-msg { max-width: 82%; align-self: flex-start; display: flex; flex-direction: column; gap: 2px; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-who { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); padding-left: 4px; }
.chat-bubble { background: var(--surface); color: var(--ink); padding: 9px 12px; border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow-sm); white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.chat-msg.mine .chat-bubble { background: var(--navy); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-msg.mine .mention { color: #ffd84d; }
.chat-msg.mine .mention.me { color: #1a1d23; }
.chat-time { font-size: 0.7rem; color: var(--muted); padding: 0 4px; }
.chat-time .linkish { font-size: inherit; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(var(--safe-b) + 8px); }
.chat-input-wrap { flex: 1; }
.chat-form textarea { width: 100%; resize: none; min-height: 44px; max-height: 140px; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; line-height: 1.35; box-sizing: border-box; }
.chat-send { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; display: grid; place-items: center; }

.set-card .field > span:first-child { display: flex; align-items: center; gap: 6px; }
.set-row { display: flex; align-items: center; gap: 12px; }
.set-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.set-version { text-align: center; margin: 14px 0 6px; }
details.adv { margin-top: 6px; }
details.adv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm); }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary .muted { margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0; }
details.adv > summary > svg:last-child { transition: transform .2s; }
details.adv[open] > summary > svg:last-child { transform: rotate(90deg); }

/* Report template gallery and header/footer editor */
.tpl-gallery { display: grid; gap: 10px; margin-top: 12px; }
.tpl-card { display: flex; gap: 14px; align-items: center; text-align: left; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.tpl-card:hover, .tpl-card:focus-visible { border-color: var(--tc, var(--accent)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc, var(--accent)) 35%, transparent); }
.tpl-card .grow { display: flex; flex-direction: column; gap: 3px; }
.tpl-mini { width: 54px; height: 72px; flex: none; border-radius: 5px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); padding: 0 6px 6px; display: grid; gap: 3px; grid-template-columns: 1fr 1fr; grid-template-rows: 10px 1fr 1fr 4px; box-sizing: border-box; overflow: hidden; }
.tpl-mini i { display: block; border-radius: 2px; background: #d6dbe3; }
.tpl-mini .h { grid-column: 1 / -1; background: none; border-bottom: 2px solid var(--tc); margin: 0 -6px; height: 8px; }
.tpl-mini.band .h { background: var(--tc); border: 0; height: 10px; }
.tpl-mini.minimal .h { border-bottom-color: transparent; }
.tpl-mini .f { grid-column: 1 / -1; background: #e5e9ef; }
.tpl-mini.l1 .b:nth-of-type(n+3) { display: none; }
.tpl-mini.l1 .b:nth-of-type(2) { grid-column: 1 / -1; grid-row: 2 / 4; }
.tpl-mini.l2 .b:nth-of-type(n+4) { display: none; }
.tpl-mini.l2 .b { grid-column: 1 / -1; }
.tpl-mini.ltable { grid-template-columns: 1fr; }
.tpl-mini.ltable .b { height: 6px; align-self: start; }
.tpl-mini.blank { display: grid; place-items: center; grid-template: none; color: #64748b; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.hf-3 { gap: 8px; flex-wrap: wrap; }
.hf-3 .field { min-width: 120px; }
.hf-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.hf-preview { background: var(--surface-2); padding: 12px; border-radius: var(--r-sm); }
.hfp-page { background: #fff; color: #334155; border-radius: 4px; box-shadow: 0 1px 6px rgba(0,0,0,.2); font-size: 0.66rem; display: flex; flex-direction: column; aspect-ratio: 210 / 120; overflow: hidden; }
.hfp-head { padding: 8px 10px; text-align: right; border-bottom: 2px solid var(--tc); min-height: 14px; }
.hfp-head.band { background: var(--tc); color: #fff; font-weight: 700; border: 0; }
.hfp-head.minimal { text-align: left; border-color: transparent; }
.hfp-head.none { border-color: transparent; }
.hfp-body { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 10px; }
.hfp-body i { background: #e2e8f0; border-radius: 3px; }
.hfp-foot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 6px 10px; color: #64748b; }
.hfp-foot span:nth-child(2) { text-align: center; }
.hfp-foot span:nth-child(3) { text-align: right; }

/* Transcript in a second language */
.tl-grid { display: grid; gap: 10px; }
.tl-grid.view-both { grid-template-columns: 1fr 1fr; }
.tl-grid.view-original .tl-b, .tl-grid.view-translation .tl-a { display: none; }
@media (max-width: 640px) { .tl-grid.view-both { grid-template-columns: 1fr; } }
.tl-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tl-lab { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); }
.tl-orig { white-space: pre-wrap; font-size: 0.93rem; line-height: 1.5; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); max-height: 420px; overflow-y: auto; }
.tl-actions #tl-dl { grid-column: 1 / -1; }

/* Live chat assistant */
.lc-tabs { margin-bottom: 4px; }
.chat-bubble.bot { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.chat-bubble.bot a { color: var(--blue); font-weight: 600; }
.bot-links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bot-links a { display: flex; align-items: center; gap: 6px; text-decoration: none; padding: 7px 10px; border-radius: 10px; background: var(--surface); font-size: 0.88rem; }
.chat-bubble.typing { display: flex; gap: 4px; padding: 13px 14px; }
.chat-bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dots 1.1s infinite ease-in-out; }
.chat-bubble.typing i:nth-child(2) { animation-delay: .15s; } .chat-bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.lc-starters { margin: 2px 0 0; }
.lc-starters .chip { white-space: normal; text-align: left; }

/* Top bar on narrow phones: back label stays on one line, and the small title gives way to it */
.back-btn { white-space: nowrap; min-width: 0; }
.back-btn .bb-label { overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
#top-left { min-width: 0; flex-shrink: 1; }
@media (max-width: 520px) {
  .topbar:has(.back-btn) .small-title { flex: 0 1 0; min-width: 0; padding: 0; }
  .topbar:has(.back-btn) #top-left { flex: 1 1 auto; }
  .back-btn .bb-label { max-width: 28vw; }
  #top-left .icon-btn { width: 38px; }
}
@media (max-width: 360px) { .back-btn .bb-label { display: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-bubble.bot a { color: #8bb2ff; } }
:root[data-theme="dark"] .chat-bubble.bot a { color: #8bb2ff; }
.topbar .bell-btn { color: var(--ink); }

/* Photos on daily log entries */
.dl-entry { flex-wrap: wrap; }
.dl-thumbs { order: 3; flex-basis: 100%; display: flex; gap: 6px; align-items: center; padding: 2px 0 0; overflow-x: auto; }
.dl-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; display: block; }
.dl-photo { position: relative; }
.dl-pc { position: absolute; top: 0; right: -2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 0.65rem; font-weight: 700; line-height: 16px; text-align: center; }

/* ---------- Mouse and keyboard (Mac, Windows) ---------- */
@media (hover: hover) and (pointer: fine) {
  /* Rows that scroll sideways show a thin scrollbar, and the mouse wheel scrolls them (see app.js). */
  .chips, .tabstrip, .bu-phases, .more-recent, .editor-tools, .phase-line, .ba-strip, .dl-thumbs, .lc-starters { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 50%, transparent) transparent; }
  .chips::-webkit-scrollbar, .tabstrip::-webkit-scrollbar, .bu-phases::-webkit-scrollbar, .more-recent::-webkit-scrollbar, .editor-tools::-webkit-scrollbar { display: block; height: 6px; }
  .chips::-webkit-scrollbar-thumb, .tabstrip::-webkit-scrollbar-thumb, .bu-phases::-webkit-scrollbar-thumb, .more-recent::-webkit-scrollbar-thumb, .editor-tools::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 3px; }
  /* Pop-ups sit in the middle of the screen as dialogs instead of sliding up from the bottom. */
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 20px; max-height: 86vh; padding-bottom: 20px; }
  .sheet .grabber { display: none; }
  .sheet-actions { bottom: -20px; }
  /* Hover feedback, so it is clear what can be clicked. */
  .list-item:hover, .tile:hover, .hm-card:hover, .proj-card:hover { filter: brightness(1.04); }
  :root[data-theme="dark"] .list-item:hover, :root[data-theme="dark"] .tile:hover { filter: brightness(1.15); }
  button, [role="button"], a, label.switch-row, summary { cursor: pointer; }
  button:disabled { cursor: not-allowed; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1280px) {
  main, .topbar-row, .queue-banner { max-width: 1200px; }
  /* Floating buttons stay next to the content instead of the far edge of a wide screen. */
  .fab { right: max(18px, calc((100vw - 1200px) / 2 + 16px)); }
}

/* ---------- In-app document viewer ---------- */
.dvw-bar { position: sticky; top: calc(56px + var(--safe-t)); z-index: 15; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 0; background: var(--bg); }
.dvw-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.dvw-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dvw-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dvw-page { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.dvw-mk { position: sticky; top: calc(116px + var(--safe-t)); z-index: 14; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; margin-bottom: 8px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.dvw-mk[hidden] { display: none; }
.dvw-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.dvw-col { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.dvw-col.on { box-shadow: 0 0 0 2px var(--accent); }
.dvw-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.dvw-links:empty { display: none; }
.dvw-stage { --z: 1; padding-bottom: 40px; overflow-x: auto; }
.dvw-pagewrap { position: relative; width: calc(min(100%, 900px) * var(--z)); margin: 0 auto 14px; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.18); }
.dvw-pagewrap canvas, .dvw-pagewrap img { display: block; width: 100%; height: auto; max-width: none; }
.dvw-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: auto; }
.dvw.marking .dvw-svg { cursor: crosshair; touch-action: none; }
.dvw-pn { position: absolute; right: 8px; bottom: 6px; font-size: .72rem; color: #64748b; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 6px; }
.dvw-sheet th, .dvw-sheet td { white-space: nowrap; padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.dvw-sheet th { position: sticky; top: 0; background: var(--surface); }
/* Attachments on issues and FOKs */
.att-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.att { position: relative; }
.att img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.att-doc a { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; justify-content: space-between; aspect-ratio: 1; padding: 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: .78rem; font-weight: 600; overflow: hidden; }
.att-doc a span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.att-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; padding: 0; }
/* Picture lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10, 11, 13,.92); display: grid; place-items: center; overflow: auto; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; cursor: zoom-in; }
.lightbox.full { place-items: start; }
.lightbox.full img { max-width: none; max-height: none; cursor: zoom-out; }
.lb-x { position: fixed; top: calc(12px + var(--safe-t)); right: 12px; color: #fff; background: rgba(255,255,255,.12); }
.lb-dl { position: fixed; bottom: calc(16px + var(--safe-b)); right: 16px; }

/* ---------- FOK sign-off ---------- */
.sheet.sheet-wide { max-width: 760px; }
.sign-group { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.sign-h { font-size: 1rem; }
.sign-slot { border-top: 1px solid var(--line); padding-top: 10px; }
.sign-group .sign-slot:first-of-type { border-top: 0; padding-top: 0; }
.sign-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: end; }
.sign-form .field:nth-child(3), .sign-form .field:nth-child(4), .sign-form [data-sign] { grid-column: 1 / -1; }
@media (max-width: 520px) { .sign-form { grid-template-columns: 1fr; } }
.sig-pad { position: relative; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; height: 120px; }
.sig-pad.has { border-style: solid; }
.sig-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; border-radius: 12px; }
.sig-hint { position: absolute; left: 14px; bottom: 10px; color: #94a3b8; font-size: .8rem; pointer-events: none; }
.sig-pad.has .sig-hint { display: none; }
.sig-clear { position: absolute; top: 6px; right: 6px; }
.sign-done { display: flex; gap: 14px; align-items: center; }
.sig-img { width: 150px; height: 55px; flex: none; color: #1a1d23; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.sign-slot.done .grow { min-width: 0; }
.wk-card { margin-top: 12px; padding: 6px 4px; }
.wk-table th, .wk-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.wk-table td:first-child, .wk-table th:first-child { text-align: left; white-space: nowrap; }
.wk-table .num { text-align: center; }
.wk-table tfoot th { border-top: 2px solid var(--line); border-bottom: 0; }
.wk-table .linkish { font-weight: 700; line-height: 1.2; }

/* ---------- Programme Intelligence ---------- */
:root { --pg-plan: #94a3b8; --pg-rep: #2563eb; --pg-ver: #0ca30c; --pg-fc: #3b82f6; --pg-crit: #d03b3b; --pg-act: #0f766e; --pg-bl: #cbd5e1; --pg-grid: rgba(15, 23, 42, 0.06); --pg-dd: #f5b400; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pg-plan: #64748b; --pg-rep: #60a5fa; --pg-ver: #22c55e; --pg-fc: #3b82f6; --pg-crit: #f87171; --pg-act: #2dd4bf; --pg-bl: #475569; --pg-grid: rgba(255, 255, 255, 0.06); } }
:root[data-theme="dark"] { --pg-plan: #64748b; --pg-rep: #60a5fa; --pg-ver: #22c55e; --pg-fc: #3b82f6; --pg-crit: #f87171; --pg-act: #2dd4bf; --pg-bl: #475569; --pg-grid: rgba(255, 255, 255, 0.06); }
.pg-empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 18px; }
.pg-empty .lead { max-width: 560px; }
.pg-head { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.pg-title { margin: 0; font-size: 1.15rem; }
.pg-pick { font-weight: 700; max-width: 360px; }
.pg-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pg-warn { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--pg-dd) 14%, var(--surface)); }
.pg-views { margin-bottom: 10px; overflow-x: auto; }
.pg-views button { white-space: nowrap; }
.segmented.sm button { padding: 6px 9px; font-size: 0.84rem; }
.pg-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.pg-filters .jump-input { flex: 1 1 200px; min-width: 160px; }
.pg-filters select.input { width: auto; max-width: 190px; padding-top: 7px; padding-bottom: 7px; }
.input.sm { padding: 6px 8px; font-size: 0.86rem; width: auto; }
.pg-kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 10px; }
.pg-kpis .kpi b { font-size: 1.15rem; text-align: center; }
.pg-kpis .kpi span { line-height: 1.25; }
@media (max-width: 520px) { .pg-kpis { grid-template-columns: repeat(2, 1fr); } }
.pg-bar { display: grid; grid-template-columns: 76px 1fr 46px; align-items: center; gap: 8px; margin: 6px 0; font-size: 0.88rem; }
.pg-bar b { text-align: right; }
.pg-track { height: 10px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pg-track i, .pg-tri i { display: block; height: 100%; border-radius: 99px; }
i.plan { background: var(--pg-plan); } i.rep { background: var(--pg-rep); } i.ver { background: var(--pg-ver); }
.pg-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 10px; }
.pg-grp { display: flex; flex-direction: column; gap: 3px; font-size: 0.88rem; }
.pg-tri { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pg-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.pg-cols .card { margin: 0; }
.pg-li { width: 100%; text-align: left; }
.pg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pg-fc); flex: none; display: inline-block; }
.pg-dot.crit { background: var(--pg-crit); } .pg-dot.done { background: var(--pg-ver); }
.pg-late { color: var(--st-critical); font-weight: 700; } .pg-early { color: var(--st-good); font-weight: 700; }
.pg-conf { font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pg-conf.high { background: color-mix(in srgb, var(--pg-ver) 18%, transparent); color: var(--st-good); }
.pg-conf.medium { background: color-mix(in srgb, var(--st-warn) 18%, transparent); color: var(--st-warn); }
.pg-conf.low { background: color-mix(in srgb, var(--pg-crit) 16%, transparent); color: var(--st-critical); }
.pg-pill-crit { background: color-mix(in srgb, var(--pg-crit) 16%, transparent) !important; color: var(--st-critical) !important; }
.pg-check { padding: 6px 0; border-top: 1px solid var(--line); }
.pg-check summary { cursor: pointer; }
.pg-check .small { padding: 6px 0 2px 16px; line-height: 1.7; }
.pg-tablewrap { overflow: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.pg-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.pg-table th, .pg-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pg-table thead th { position: sticky; top: 0; background: var(--surface-2); font-size: 0.78rem; color: var(--muted); white-space: nowrap; z-index: 1; }
.pg-table tbody tr[data-act] { cursor: pointer; }
.pg-table tbody tr[data-act]:hover, .pg-table tbody tr[data-act]:focus { background: var(--surface-2); outline: none; }
.pg-table tr.crit td:first-child { box-shadow: inset 3px 0 0 var(--pg-crit); }
.pg-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; white-space: nowrap; }
.pg-name { font-weight: 600; min-width: 180px; }
.pg-dates th { white-space: nowrap; }
.pg-evk { font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); flex: none; }
.pg-evk.verified { background: color-mix(in srgb, var(--pg-ver) 18%, transparent); color: var(--st-good); }
.pg-audit { padding: 7px 0; border-bottom: 1px solid var(--line); }
.pg-up .title { text-align: left; font-weight: 700; text-decoration: none; color: var(--ink); }
.pg-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; margin: 10px 0; text-align: center; }
.pg-drop.over, .pg-drop:hover { border-color: var(--accent); background: var(--surface-2); }
.pg-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 10px; }
.pg-prog { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 10px 0; }
.pg-prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
/* Gantt */
.pg-gtools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.pg-legend { display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.pg-legend .lg { display: inline-block; width: 16px; height: 8px; border-radius: 3px; margin-right: 3px; vertical-align: middle; }
.lg.fc { background: var(--pg-fc); } .lg.crit { background: var(--pg-crit); } .lg.act { background: var(--pg-act); } .lg.bl { background: var(--pg-bl); height: 4px; } .lg.dd { background: var(--pg-dd); width: 3px; }
.pg-gantt { position: relative; overflow: auto; height: calc(100vh - 290px); min-height: 360px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overscroll-behavior: contain; outline: none; }
@media (max-width: 700px) { .pg-gantt { --lw: 170px; height: calc(100vh - 250px); } }
.pg-ghead { position: sticky; top: 0; z-index: 5; display: flex; height: 44px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.pg-gcorner { position: sticky; left: 0; z-index: 6; width: 320px; flex: none; background: var(--surface-2); padding: 12px 10px; font-size: 0.78rem; font-weight: 700; color: var(--muted); border-right: 1px solid var(--line); }
.pg-gscale { position: relative; flex: none; }
.pg-trow { position: relative; height: 22px; }
.pg-ts { position: absolute; top: 0; height: 22px; border-left: 1px solid var(--line); font-size: 0.72rem; padding: 4px 4px 0; color: var(--ink-2); white-space: nowrap; overflow: hidden; font-weight: 650; }
.pg-ts.sm { font-weight: 500; color: var(--muted); font-size: 0.68rem; padding: 4px 2px 0; }
.pg-ts.we { background: var(--pg-grid); }
.pg-gbody { position: relative; }
.pg-ddline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--pg-dd); z-index: 2; pointer-events: none; }
.pg-links { position: absolute; top: 0; z-index: 3; pointer-events: none; overflow: visible; }
.pg-links path { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .8; }
.pg-links path.crit { stroke: var(--pg-crit); }
.pg-row { position: absolute; left: 0; right: 0; height: 30px; display: flex; border-bottom: 1px solid var(--pg-grid); cursor: pointer; }
.pg-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.pg-row.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pg-row.sum .pg-cname { font-weight: 750; }
.pg-cell { position: sticky; left: 0; z-index: 4; width: 320px; flex: none; display: flex; align-items: center; gap: 6px; background: var(--surface); border-right: 1px solid var(--line); font-size: 0.82rem; overflow: hidden; padding-right: 8px; }
.pg-row.sel .pg-cell { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.pg-cname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-ccode { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem; margin-right: 6px; }
.pg-tog { border: 0; background: none; width: 18px; padding: 0; cursor: pointer; color: var(--ink-2); font-size: 0.8rem; flex: none; }
.pg-lane { position: relative; flex: none; height: 100%; width: 0; }
.pg-lane > i, .pg-lane > span { position: absolute; }
.pg-bar-fc { top: 8px; height: 13px; border-radius: 4px; background: var(--pg-fc); overflow: hidden; z-index: 2; }
.pg-bar-fc.crit { background: var(--pg-crit); }
.pg-bar-fc.done { background: var(--pg-act); }
.pg-act { display: block; height: 100%; background: var(--pg-act); }
.pg-bar-bl { top: 23px; height: 4px; border-radius: 2px; background: var(--pg-bl); z-index: 1; }
.pg-bar-sum { top: 10px; height: 7px; background: var(--ink); border-radius: 1px; z-index: 2; }
.pg-bar-sum.crit { background: var(--pg-crit); }
.pg-ms { top: 8px; width: 13px; height: 13px; transform: rotate(45deg); background: var(--ink); border-radius: 2px; z-index: 2; }
.pg-ms.crit { background: var(--pg-crit); } .pg-ms.done { background: var(--pg-act); }
.pg-ms.bl { background: none; box-shadow: inset 0 0 0 2px var(--pg-bl); top: 14px; width: 10px; height: 10px; z-index: 1; }
.pg-blabel { top: 7px; font-size: 0.7rem; color: var(--muted); white-space: nowrap; z-index: 2; }
@media (max-width: 700px) { .pg-gcorner, .pg-cell { width: 170px; } }

/* ---------- accounts ---------- */
.login-tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 3px; margin: 4px 0 6px; }
.login-tabs button { flex: 1; border: 0; background: none; color: #8a97ad; font: inherit; font-weight: 650; font-size: .9rem; padding: 8px; border-radius: 9px; cursor: pointer; }
.login-tabs button.on { background: rgba(255,255,255,0.12); color: #fff; }
.login-card form { margin: 0; }
.login-card .field small { display: block; margin-top: 4px; }
.login-switch { display: block; margin: 14px auto 0; color: #9db8ff; font-size: .88rem; }
.acct-banner { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.member-row .role-sel { width: auto; padding: 6px 8px; font-size: .86rem; }
.role-pill { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.invite-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; word-break: break-all; background: var(--surface-2); border-radius: 10px; padding: 10px; user-select: all; }
.member-row .sub { word-break: break-all; }
/* Cx tags against baseline */
.cxc { width: 100%; height: auto; display: block; }
.cxc-grid { stroke: var(--line); stroke-width: 1; }
.cxc-ax { fill: var(--muted); font-size: 10px; }
.cxc-today { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.cx-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.cxw { display: flex; height: 5px; border-radius: 99px; overflow: hidden; margin-top: 3px; min-width: 40px; background: var(--surface-2); }
.cxw i.ok, .cxw-ok { background: var(--st-good); } .cxw i.warn, .cxw-warn { background: var(--st-warn); } .cxw i.bad, .cxw-bad { background: var(--st-critical); }
.dlegend .cxw-ok, .dlegend .cxw-warn, .dlegend .cxw-bad { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.pg-wkbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pg-wk { flex: 0 0 auto; border: 0; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); border-radius: 12px; padding: 8px 12px; display: grid; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.pg-wk span { font-size: .74rem; color: var(--muted); } .pg-wk em { font-style: normal; font-weight: 800; font-size: 1.1rem; }
.pg-wk.now { box-shadow: inset 0 0 0 2px var(--accent); }
.pg-week h3 { font-size: 1rem; }
.pg-miles { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; font-size: .86rem; }
.pg-miles .linkish { text-align: left; color: var(--ink); text-decoration: none; font-weight: 650; }
/* Safety observations and toolbox talks */
.so-badge { font-size: .72rem; font-weight: 750; padding: 3px 8px; border-radius: 7px; white-space: nowrap; flex: none; }
.so-risk { background: color-mix(in srgb, #e0a400 22%, transparent); color: #9a6c00; }
.so-near { background: color-mix(in srgb, #ea580c 20%, transparent); color: #c2410c; }
.so-pos { background: color-mix(in srgb, #16a34a 18%, transparent); color: #15803d; }
.so-stop { background: #d03b3b; color: #fff; }
:root[data-theme="dark"] .so-risk { color: #fbbf24; } :root[data-theme="dark"] .so-near { color: #fb923c; } :root[data-theme="dark"] .so-pos { color: #4ade80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .so-risk { color: #fbbf24; } :root:not([data-theme="light"]) .so-near { color: #fb923c; } :root:not([data-theme="light"]) .so-pos { color: #4ade80; } }
.so-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.so-kind { border: 0; border-radius: 14px; padding: 10px; text-align: left; display: grid; gap: 2px; cursor: pointer; font: inherit; box-shadow: inset 0 0 0 1px var(--line); }
.so-kind span { font-size: .74rem; opacity: .85; font-weight: 500; }
.so-kind.on { box-shadow: inset 0 0 0 3px currentColor; }
.so-yn { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; font-size: .92rem; }
.so-yn .segmented { min-width: 120px; }
.so-bar { display: grid; grid-template-columns: minmax(80px, 160px) 1fr 30px; gap: 8px; align-items: center; margin: 5px 0; font-size: .86rem; }
.so-bar b { text-align: right; }
.tb-ok { color: var(--st-good); font-weight: 700; }
.tb-d .sig-img, #tb-signs .sig-img { width: 90px; height: 33px; flex: none; color: var(--ink); background: #fff; border-radius: 6px; }
.tp-badge { border: 0; cursor: pointer; font: inherit; font-size: .72rem; display: inline-flex; gap: 4px; align-items: center; }
.tp-haz .chip { font-size: .8rem; }
/* bookings calendar */
.bk-week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 6px; overflow-x: auto; margin-top: 10px; }
.bk-day { background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); padding: 6px; min-height: 120px; display: flex; flex-direction: column; gap: 5px; }
.bk-day.now { box-shadow: inset 0 0 0 2px var(--accent); }
.bk-dh { font-size: .8rem; font-weight: 750; padding: 2px 4px; }
.bk-card { border: 0; text-align: left; border-radius: 8px; padding: 6px 7px; font: inherit; font-size: .78rem; cursor: pointer; display: grid; gap: 1px; color: var(--ink); border-left: 4px solid var(--muted); background: var(--surface-2); }
.bk-card span { color: var(--muted); font-size: .72rem; } .bk-card em { font-style: normal; font-size: .68rem; font-weight: 700; color: var(--ink-2); }
.bk-card.bk-req, i.bk-req { border-left-color: #94a3b8; } .bk-card.bk-pm, i.bk-pm { border-left-color: #e0a400; } .bk-card.bk-ok, i.bk-ok { border-left-color: #16a34a; }
.bk-card.bk-done, i.bk-done { border-left-color: #2563eb; } .bk-card.bk-no, i.bk-no { border-left-color: #d03b3b; opacity: .75; }
.dlegend i.bk-req, .dlegend i.bk-pm, .dlegend i.bk-ok, .dlegend i.bk-done, .dlegend i.bk-no { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 0; margin-right: 4px; vertical-align: middle; }
.dlegend i.bk-req { background: #94a3b8; } .dlegend i.bk-pm { background: #e0a400; } .dlegend i.bk-ok { background: #16a34a; } .dlegend i.bk-done { background: #2563eb; } .dlegend i.bk-no { background: #d03b3b; opacity: 1; }
.bk-pill { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border-left: 5px solid var(--muted); }
.bk-pill.bk-pm { border-left-color: #e0a400; } .bk-pill.bk-ok { border-left-color: #16a34a; } .bk-pill.bk-done { border-left-color: #2563eb; } .bk-pill.bk-no { border-left-color: #d03b3b; }
@media (max-width: 700px) { .bk-week { grid-template-columns: repeat(7, 150px); } }
/* morning briefing */
.br-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.br-kpis { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .br-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .br-kpis { grid-template-columns: repeat(2, 1fr); } }
.br-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; }
.br-grid .card { margin: 0; } .br-grid h3 { margin: 0 0 8px; font-size: 1rem; }
body.briefing-present .topbar, body.briefing-present #bottom, body.briefing-present .proj-head { display: none !important; }
body.briefing-present #tab-body { max-width: none; font-size: 1.15rem; }
body.briefing-present .br-kpis .kpi b { font-size: 2.4rem; }
body.briefing-present .br-grid { grid-template-columns: repeat(3, 1fr); }
.mk-headcount { min-width: 34px; height: 34px; border-radius: 50%; background: #2563eb; color: #fff; font-weight: 800; font-size: 14px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.shoot-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60; display: flex; gap: 8px; align-items: center; background: var(--surface); box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.25)); border-radius: 16px; padding: 8px 10px 8px 14px; width: min(520px, calc(100vw - 24px)); font-size: .9rem; }
.aa-dates { margin-bottom: 10px; }
.proj-cover { margin: 8px 0 4px; border-radius: 18px; overflow: hidden; height: 170px; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.proj-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-cover.sm { height: 140px; margin: 6px 0; }
@media (min-width: 900px) { .proj-cover { height: 220px; } }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.cv-grid button { border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--surface-2); }
.cv-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-grid button:hover, .cv-grid button:focus-visible { outline: 3px solid var(--accent); }
.mi-act { margin: 6px 0; padding: 8px; }
.mi-done { display: flex; align-items: center; gap: 4px; font-size: .86rem; white-space: nowrap; }

/* BIM: project models list */
.bim-mlist { display: flex; flex-direction: column; gap: 6px; }
.bim-mrow { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.bim-mrow.on { border-color: var(--accent, #f5b800); box-shadow: 0 0 0 1px var(--accent, #f5b800) inset; }
.bim-mopen { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; width: 100%; font: inherit; }
.bim-mrow details { margin-top: 4px; }
.bim-mrow .link-btn { background: none; border: 0; padding: 0 4px; color: var(--link, #2563eb); cursor: pointer; font: inherit; text-decoration: underline; }

/* PDF editor: page tools */
.pe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 58vh; overflow: auto; padding: 2px; }
.pe-card { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pe-th { width: 140px; height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.pe-th canvas { max-width: 120px; max-height: 120px; box-shadow: 0 1px 3px rgba(0,0,0,.18); background: #fff; transition: transform .15s; }
.pe-n { font-size: .8rem; color: var(--muted); }
.pe-btns { display: flex; gap: 2px; }
.dvw-mk { flex-wrap: wrap; }

/* Notes */
.nt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.nt-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; min-height: 110px; }
.nt-card:hover { box-shadow: var(--shadow); }
.nt-top { display: flex; align-items: center; gap: 8px; }
.nt-ex { font-size: .88rem; color: var(--ink-2, var(--muted)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.nt-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.nt-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-align: left; cursor: pointer; font: inherit; }
.nt-kind:hover { border-color: var(--accent, #f5b800); }
.nt-kind span { font-size: .82rem; color: var(--muted); }
.nt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.nt-title { width: 100%; border: 0; background: none; font: inherit; font-size: 1.7rem; font-weight: 800; color: var(--ink); padding: 4px 2px; outline: none; }
.nb { max-width: 780px; padding: 4px 0 80px; min-height: 40vh; }
.nb-row { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 2px 0; }
.nb-text { flex: 1; min-height: 1.6em; outline: none; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.nb-text:empty::before { content: attr(data-ph); color: var(--muted); opacity: .7; }
.nb-text:not(:focus):empty::before { opacity: 0; }
.nb-row:first-child .nb-text:empty::before, .nb-row:only-child .nb-text:empty::before { opacity: .7; }
.nb-h1 .nb-text { font-size: 1.45rem; font-weight: 800; margin-top: 10px; }
.nb-h2 .nb-text { font-size: 1.15rem; font-weight: 700; margin-top: 6px; }
.nb-quote .nb-text { border-left: 3px solid var(--line); padding-left: 12px; font-style: italic; }
.nb-callout { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.nb-check { margin-top: .42em; width: 17px; height: 17px; accent-color: #16a34a; }
.nb-todo.done .nb-text { text-decoration: line-through; color: var(--muted); }
.nb-dot, .nb-num { min-width: 18px; line-height: 1.6; color: var(--muted); }
.nb-ico { line-height: 1.6; color: #d97706; }
.nb-hr { flex: 1; border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.nb-snag { opacity: 0; transition: opacity .15s; }
.nb-row:hover .nb-snag, .nb-row:focus-within .nb-snag { opacity: 1; }
@media (hover: none) { .nb-snag { opacity: .8; } }
.nb-menu { position: relative; z-index: 20; display: flex; flex-direction: column; width: min(320px, 92vw); max-height: 320px; overflow: auto; padding: 6px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); margin: 2px 0 6px 20px; }
.nb-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.nb-menu button:hover, .nb-menu button:focus { background: var(--surface-2); outline: none; }
.nb-menu span { font-size: .78rem; color: var(--muted); }
.ink-bar { position: sticky; top: calc(64px + var(--safe-t, 0px)); z-index: 12; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; margin-bottom: 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.ink-bar .input.sm { width: auto; padding: 4px 8px; }
.ink-pages { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.ink-page { position: relative; width: min(100%, 820px); }
.ink-svg { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(15, 23, 42, .12); cursor: crosshair; user-select: none; -webkit-user-select: none; }
.ink-pn { position: absolute; right: 10px; bottom: 8px; font-size: .75rem; color: var(--muted); }

/* Sign-in and security */
.sso-ic { font-weight: 800; font-size: .95rem; }
.sso-google { color: #ea4335; } .sso-microsoft { color: #2563eb; } .sso-apple { color: var(--ink); }
.mfa-qr { display: flex; justify-content: center; min-height: 200px; margin: 6px 0; }
.mfa-qr img { border-radius: 10px; background: #fff; }
.mfa-key { font-size: .95rem; letter-spacing: .04em; }
.mfa-steps { padding-left: 20px; margin: 4px 0 8px; } .mfa-steps li { margin: 3px 0; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; } .mfa-codes code { padding: 8px; border-radius: 8px; background: var(--surface-2); text-align: center; font-size: .95rem; letter-spacing: .06em; }
.login-sso { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.login-sso .btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 14px 0 0; } .login-or::before, .login-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .dvw-mk, .ink-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .dvw-mk > *, .ink-bar > * { flex: none; }
  .dvw-mk::-webkit-scrollbar, .ink-bar::-webkit-scrollbar { display: none; }
}

/* 360 photos */
.pano-wrap { position: relative; width: 100%; height: min(66vh, 560px); background: #000; overflow: hidden; }
.pano-wrap.full { position: fixed; inset: 0; z-index: 1000; height: 100dvh; }
.pano-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.pano-canvas:active { cursor: grabbing; }
.pano-marks { position: absolute; inset: 0; pointer-events: none; }
.pano-mark { position: absolute; transform: translate(-9px, -50%); display: flex; align-items: center; gap: 6px; pointer-events: auto; text-decoration: none; }
.pano-mark i { width: 18px; height: 18px; border-radius: 50%; background: #e53935; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.5); flex: none; }
.pano-mark.done i { background: #16a34a; }
.pano-mark.focus { transform: translate(-50%, -50%); }
.pano-mark.focus i { background: transparent; border-color: #ffc21a; width: 34px; height: 34px; box-shadow: 0 0 0 3px rgba(0,0,0,.35); }
.pano-mark span { background: rgba(26,29,35,.8); color: #fff; font-size: .75rem; padding: 3px 7px; border-radius: 6px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.pano-hint { position: absolute; left: 12px; top: 12px; z-index: 2; color: #fff; background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 99px; font-size: .78rem; pointer-events: none; }
.pano-tools { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; gap: 6px; }
.pano-tools .icon-btn { background: rgba(255,255,255,.9); }
.pano-next { padding: 8px 16px 0; }
.pano-badge { left: auto; right: 6px; font-weight: 800; }
.pin.pano .n { font-size: .58rem; }
body.pano-open { overflow: hidden; }

/* Report these */
.rt-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow: auto; margin: 6px 0; }
.rt-item { display: flex; gap: 10px; align-items: flex-start; }
.rt-item img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; background: var(--surface-2); flex: none; }
.rt-item textarea { width: 100%; margin-top: 4px; }
.shoot-bar { flex-wrap: wrap; }

/* Walk reports */
.ws-areas { display: flex; flex-direction: column; gap: 2px; max-height: 42vh; overflow: auto; padding: 4px 0; }
.ws-area { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.wk-progress { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 12px; }
.wk-areas { display: flex; flex-direction: column; gap: 8px; padding-bottom: 90px; }
.wk-area { padding: 0; overflow: hidden; }
.wk-ahead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wk-n { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex: none; }
.wk-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.wk-area.open { box-shadow: var(--shadow); }
.home-walk { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-top: 10px; }
.home-walk .grow { display: flex; flex-direction: column; }

/* Morning briefing: your own message and points */
.br-message { display: flex; gap: 10px; align-items: flex-start; border-left: 4px solid #f5b800; margin: 10px 0; font-size: 1.02rem; }
.br-ol { margin: 0; padding-left: 22px; } .br-ol li { margin: 4px 0; }
.be-sec { padding: 6px 4px; }
body.briefing-present .br-message { font-size: 1.4rem; }
.be-sec input[type="checkbox"], .ws-area input[type="checkbox"], .rt-item input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; border: 0; box-shadow: none; flex: none; accent-color: #16a34a; }
.be-sec label { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.link-btn { background: none; border: 0; padding: 0 2px; color: var(--link, #2563eb); cursor: pointer; font: inherit; text-decoration: underline; }

/* Create panel (BIM tab) */
.bim-create { background: var(--surface); border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); border-top: 3px solid var(--accent); }
.bim-create h3 { font-size: 1.02rem; }
.bc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.bc-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; min-height: 92px; padding: 14px; border: 0; border-radius: 14px; background: var(--surface-2, rgba(127,127,127,.08)); color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, transform .15s; }
.bc-tile:hover { box-shadow: inset 0 0 0 2px var(--accent); transform: translateY(-1px); }
.bc-tile svg { width: 22px; height: 22px; padding: 8px; box-sizing: content-box; border-radius: 10px; background: rgba(255, 194, 26, .16); color: var(--accent-strong); }
.bim-empty { padding: 24px; text-align: center; }
.bim-empty > span { max-width: 460px; line-height: 1.5; }
.bim-empty > b { color: var(--text, inherit); font-size: 1.05rem; }
.fn-thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: none; }

/* Floor plan editor */
.fp-editor { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: var(--bg, #eef1f6); }
.fp-bar { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t, 0px)) 12px 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.fp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-tools { display: flex; gap: 6px; align-items: center; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; }
.fp-tools > * { flex: none; }
.fp-hint { padding: 0 12px 6px; }
.fp-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; background: #dfe5ee; cursor: crosshair; }
.fp-stage svg { display: block; }
.fp-sel path, .fp-sel line, .fp-sel rect, text.fp-sel { stroke: #f59e0b !important; }
.fp-sel path { fill: #fde68a !important; }
/* Sheets and messages stay on top of the full-screen editors */
body.pano-open .sheet-backdrop { z-index: 1100; }
body.pano-open #toast { z-index: 1200; }

/* ---------- 9.8 layout: sidebar on wide screens, calmer Home, list-style More ---------- */
.side-nav { position: fixed; top: 0; left: 0; bottom: 0; width: 248px; z-index: 35; display: flex; flex-direction: column; gap: 2px; padding: calc(14px + var(--safe-t, 0px)) 12px 12px;
  background: var(--surface); border-right: 1px solid var(--line); }
body.with-side { padding-left: 248px; }
body.with-side .dock { left: calc(50% + 124px); }
body.with-side .select-bar { left: 260px; }
.sn-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; font-weight: 800; font-size: 1.05rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.sn-brand img { width: 30px; height: 30px; border-radius: 8px; }
.sn-back { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: .8rem; color: var(--muted); text-decoration: none; }
.sn-back:hover { color: var(--ink); }
.sn-proj { padding: 2px 8px 10px; font-weight: 750; font-size: .98rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sn-find { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; text-align: left; }
.sn-find:hover { color: var(--ink); }
.sn-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.sn-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 9px; border: 0; background: none; color: var(--ink-2, var(--ink)); font: inherit; font-size: .9rem; font-weight: 550; text-decoration: none; cursor: pointer; text-align: left; }
.sn-item svg { flex: none; opacity: .8; }
.sn-item:hover { background: var(--surface-2); color: var(--ink); }
.sn-item.on { background: rgba(245, 184, 0, .16); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 #f5b800; }
.sn-item.on svg { opacity: 1; color: #b7791f; }
.sn-gh { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 12px; padding: 4px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.sn-gh svg { transition: transform .15s; }
.sn-group.closed .sn-gh svg { transform: rotate(-90deg); }
.sn-group.closed .sn-gl { display: none; }
.sn-choose { margin-top: 12px; color: var(--muted); }
.sn-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
body.with-side main { max-width: 1180px; }
body.with-side .topbar-row { max-width: none; }

/* Home */
.home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-act { flex-direction: row; align-items: center; gap: 12px; min-height: 0; padding: 14px; border-radius: 16px; }
.home-act .mt-icon { width: 42px; height: 42px; margin: 0; flex: none; }
.ha-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ha-t { font-size: .95rem; }
.ha-s { font-size: .76rem; }
@media (max-width: 520px) { .home-act { flex-direction: column; align-items: flex-start; } }
.home-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.hs-group { background: var(--surface); border: 1px solid var(--hair, var(--line)); border-radius: 16px; padding: 8px; box-shadow: var(--shadow-sm); }
.hs-gname { font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 4px; }
.hs-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: .92rem; }
.hs-row:hover { background: var(--surface-2); }
.hs-row .mt-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.hs-row .mt-icon svg { width: 16px; height: 16px; }
.home-links { display: flex; gap: 18px; justify-content: center; margin: 18px 0 0; }
.home-links .linkish { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; }

/* More: compact rows rather than big tiles */
.more-sheet .more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; }
.more-sheet .more-tile { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-height: 0; padding: 8px 10px; border-radius: 12px; text-align: left; }
.more-sheet .more-tile .mt-icon { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 10px; margin: 0; }
.more-sheet .more-tile .mt-icon svg { width: 18px; height: 18px; }
.more-sheet .more-tile .mt-name { font-size: .92rem; }
.more-sheet .more-tile .mt-sub { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-panels { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
@media (min-width: 900px) { .home-panels { grid-template-columns: 1.4fr 1fr; } }
.home-panels:empty { display: none; }
.hp-card { padding: 14px; }
.hp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.hp-head a { color: var(--link, #2563eb); text-decoration: none; }
.hp-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hp-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.hs-row .grow { flex: 1; }

/* ---- Document findings (10.0) ---- */
.fi-docpick { margin: 0 0 8px; max-width: 420px; }
.fi-rev { flex-wrap: wrap; margin-bottom: 10px; }
.fi-n { opacity: .7; font-variant-numeric: tabular-nums; margin-left: 2px; }
.fi-list { display: flex; flex-direction: column; gap: 10px; }
.fi-card { padding: 14px; }
.fi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fi-sel { width: 18px; height: 18px; margin: 0; flex: none; }
.fi-type { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(100, 116, 139, .14); color: var(--ink); }
.fi-type.t-defect, .fi-type.t-quality { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.fi-type.t-safety { background: rgba(234, 88, 12, .14); color: #c2410c; }
.fi-type.t-rfi, .fi-type.t-technical_query, .fi-type.t-design { background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.fi-type.t-commissioning { background: rgba(124, 58, 237, .12); color: #6d28d9; }
.fi-type.t-programme { background: rgba(202, 138, 4, .16); color: #a16207; }
.fi-type.t-info { background: rgba(22, 163, 74, .12); color: #15803d; }
.fi-conf { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 7px; border-radius: 6px; }
.fi-conf.hi { color: var(--ok); background: rgba(22, 163, 74, .1); }
.fi-conf.mid { color: #a16207; background: rgba(202, 138, 4, .12); }
.fi-conf.lo { color: var(--danger); background: rgba(220, 38, 38, .1); }
.fi-title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.fi-desc { margin-top: 4px; font-size: 14px; color: var(--ink); }
.fi-quote { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--accent-strong); background: rgba(245, 168, 0, .08); border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.fi-src { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; font-weight: 600; width: 100%; }
.fi-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fi-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.fi-chip.soft { color: var(--muted); border-style: dashed; }
.fi-chip.warn { color: #b45309; border-color: rgba(217, 119, 6, .45); background: rgba(217, 119, 6, .08); }
.fi-note { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.fi-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.an-how { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.an-how input[type=radio] { margin: 3px 0 0; width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; border: 0; box-shadow: none; background: none; appearance: auto; -webkit-appearance: radio; }
.an-progress { font-size: 14px; color: var(--muted); }
.an-summary { font-size: 14px; line-height: 1.55; max-height: 56vh; overflow: auto; padding: 4px 0; }
.dvw-src { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: rgba(245, 168, 0, .12); border: 1px solid rgba(245, 168, 0, .45); }
.dvw-src .small { margin-top: 2px; color: var(--muted); }
.dvw-hits { position: absolute; inset: 0; pointer-events: none; }
.dvw-hits i { position: absolute; background: rgba(255, 194, 26, .45); outline: 2px solid rgba(245, 168, 0, .9); border-radius: 2px; animation: dvw-hit 1.2s ease-out 2; }
@keyframes dvw-hit { 50% { background: rgba(255, 194, 26, .8); } }
.fi-intro { margin: 12px 0 10px; }
/* Pasted emails (10.1) */
.em-raw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 200px; }
.em-msgs { display: flex; flex-direction: column; gap: 6px; max-height: 32vh; overflow: auto; margin: 6px 0 10px; }
.em-mini { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.fi-chip.stance { font-weight: 600; }
.fi-chip.s-request, .fi-chip.s-question { color: #1d4ed8; border-color: rgba(37, 99, 235, .35); }
.fi-chip.s-commitment, .fi-chip.s-decision { color: #6d28d9; border-color: rgba(124, 58, 237, .35); }
.fi-chip.s-action, .fi-chip.s-instruction { color: #b45309; border-color: rgba(217, 119, 6, .4); }
.fi-chip.s-completed, .fi-chip.s-acknowledgement { color: #15803d; border-color: rgba(22, 163, 74, .35); }
.fi-chip.s-cancelled { color: var(--muted); text-decoration: line-through; }
.ev-head { margin: 12px 0; }
.ev-head h2 { margin: 6px 0 2px; }
.ev-msg { padding: 14px; margin-bottom: 10px; }
.ev-msg.on { outline: 2px solid var(--accent-strong); }
.ev-meta { display: flex; gap: 10px; align-items: flex-start; }
.ev-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: rgba(100, 116, 139, .14); }
.ev-body { white-space: pre-wrap; font-size: 14px; line-height: 1.5; margin-top: 10px; overflow-wrap: anywhere; }
.ev-found { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.ev-f { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); font-size: 13px; }

/* ---- PDF viewer upgrade (10.2) ---- */
.dvw-pagewrap.pdf canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dvw-pagewrap .textLayer { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-align: initial; -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; z-index: 2; }
.dvw-pagewrap .textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.dvw-pagewrap .textLayer span.markedContent { top: 0; height: 0; }
.dvw-pagewrap .textLayer ::selection { background: rgba(37, 99, 235, .3); }
.dvw-pagewrap .textLayer br::selection { background: transparent; }
.dvw-pagewrap .textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: -1; cursor: default; user-select: none; }
.dvw-svg { z-index: 3; }
.dvw:not(.marking) .dvw-svg { pointer-events: none; }
.dvw.marking .textLayer { pointer-events: none; user-select: none; }
.dvw-hits { z-index: 4; }
.dvw-notes { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.dvw.marking .dvw-notes { opacity: .6; }
.dvw-note { position: absolute; pointer-events: auto; transform: translate(-2px, -2px); display: inline-flex; align-items: center; gap: 2px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 6px 6px 6px 0; border: 1px solid #a16207; background: #fde047; color: #713f12; box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; font-size: 11px; font-weight: 700; }
.dvw-note.done { background: #bbf7d0; border-color: #15803d; color: #14532d; }
.dvw-note i { font-style: normal; }
button.dvw-page { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
button.dvw-page:hover { background: rgba(100, 116, 139, .12); }
.dvw-selbar { position: fixed; z-index: 1300; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--navy); box-shadow: var(--shadow-lg); }
.dvw-selbar button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: #fff; font: 600 13px/1 inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.dvw-selbar button:hover { background: rgba(255, 255, 255, .14); }
.dvw-selbar .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dvw-tabs { margin: 8px 0 10px; flex-wrap: wrap; }
.dvw-bw { max-height: 62vh; overflow: auto; }
.dvw-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.dvw-thumb { border: 2px solid transparent; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 8px; }
.dvw-thumb canvas { width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); border-radius: 2px; }
.dvw-thumb.on { border-color: var(--accent-strong); }
.dvw-thumb span { font-size: 12px; color: var(--muted); }
.dvw-hit { align-items: flex-start; gap: 10px; }
.dvw-hit mark { background: rgba(255, 194, 26, .6); color: inherit; border-radius: 2px; }
.dvw-hitp { font-weight: 700; font-size: 12px; min-width: 38px; color: var(--muted); }
.dvw-h3 { font-size: 14px; margin: 14px 0 6px; }
.dvw-thread { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.dvw-tm { padding: 8px 10px; border-radius: 10px; background: rgba(100, 116, 139, .08); }
.chip.danger { color: var(--danger); }
.dvw-viewrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
.dvw.full { position: fixed; inset: 0; z-index: 950; background: var(--bg); overflow: auto; padding: 8px 12px 30px; }
body.dvw-full-on { overflow: hidden; }
@media (max-width: 600px) { .dvw-lbl { display: none; } }
body.dvw-full-on .sheet-backdrop { z-index: 1100; }
body.dvw-full-on #toast, body.dvw-full-on .toast { z-index: 1200; }
@media (max-width: 600px) { .dvw-selbar { left: 8px !important; right: 8px; top: auto !important; bottom: calc(14px + var(--safe-b)); flex-wrap: wrap; justify-content: center; } .dvw-selbar button { padding: 10px 9px; } }
.fi-selall { display: flex; justify-content: flex-end; margin: -4px 0 6px; }
.fi-acts .fi-trash { margin-left: auto; color: var(--muted); }
.btn.danger-btn { color: var(--danger); }

/* ---- PDF tools, versions and export (10.4) ---- */
.doc-st { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 4px; background: rgba(100,116,139,.15); color: var(--ink); }
.doc-st.st-draft { background: rgba(100,116,139,.15); }
.doc-st.st-under_review { background: rgba(202,138,4,.18); color: #a16207; }
.doc-st.st-approved { background: rgba(22,163,74,.15); color: #15803d; }
.doc-st.st-superseded { background: rgba(220,38,38,.12); color: #b91c1c; }
.doc-st.st-archived { background: rgba(71,85,105,.18); color: #475569; }
.vs-orig { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(37,99,235,.12); color: #1d4ed8; margin-left: 4px; }
.vs-log { margin-top: 10px; font-size: 13px; }
.vs-log summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.vs-log .small { padding: 3px 0; }
.pe-card { position: relative; }
.pe-card.picked { outline: 2px solid var(--accent-strong); border-radius: 10px; }
.pe-pick { position: absolute; top: 4px; left: 4px; z-index: 2; }
.pe-pick input { width: 18px; height: 18px; }
.pe-pickbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(245,168,0,.12); }
.crop-stage { position: relative; display: inline-block; max-width: 100%; user-select: none; }
.crop-stage canvas { display: block; max-width: 100%; height: auto; box-shadow: 0 1px 6px rgba(0,0,0,.2); }
.crop-box { position: absolute; border: 2px dashed var(--accent-strong); box-shadow: 0 0 0 9999px rgba(15,23,42,.45); pointer-events: none; }
.cm-sum { margin: 8px 0; line-height: 1.5; }
.cm-stage { display: flex; gap: 10px; overflow: auto; max-height: 56vh; }
.cm-stage canvas { max-width: 100%; height: auto; box-shadow: 0 1px 6px rgba(0,0,0,.2); }
.cm-stage.side canvas { max-width: calc(50% - 5px); }
.cm-stage { flex-wrap: wrap; }
.cm-key { width: 100%; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.cm-key span { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cm-key .k-add { background: rgb(22,130,60); } .cm-key .k-del { background: rgb(220,38,38); margin-left: 8px; }
.cm-text { margin-top: 10px; font-size: 13px; max-height: 24vh; overflow: auto; font-family: ui-monospace, Menlo, monospace; }
.cm-add { color: #15803d; } .cm-del { color: #b91c1c; }
.pe-btns { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
.pe-btns .icon-btn { width: 34px; height: 34px; }

/* ---- Briefing weather (10.5) ---- */
.br-wx { grid-column: 1 / -1; }
.wx-now { display: flex; gap: 14px; align-items: center; margin: 8px 0; }
.wx-temp { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1; min-width: 70px; }
.wx-alert { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; margin: 6px 0; font-size: 14px; }
.wx-alert.stop { background: rgba(220,38,38,.1); color: #991b1b; }
.wx-alert.check { background: rgba(202,138,4,.14); color: #854d0e; }
.wx-kit { margin-top: 8px; }
.wx-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.wx-row .pill { min-width: 52px; text-align: center; }
.wx-row .title { font-weight: 600; }
.wx-row .sub { font-size: 13px; color: var(--muted); }
.wx-hours { display: flex; gap: 4px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.wx-h { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 8px; background: rgba(22,163,74,.08); font-size: 12px; }
.wx-h.check { background: rgba(202,138,4,.18); }
.wx-h.stop { background: rgba(220,38,38,.16); }
.wx-h .t { color: var(--muted); }
.wx-h .g { font-weight: 800; font-size: 15px; }
.wx-h i { font-style: normal; font-weight: 700; color: var(--muted); }
.wx-h .r { color: #2563eb; font-size: 11px; min-height: 13px; }
.wx-note { margin: 8px 0 0; }
.ss-lim { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.ss-lim .input { width: 76px; display: inline-block; margin-left: 4px; }
body.briefing-present .wx-temp { font-size: 60px; }
body.briefing-present .wx-h { width: 64px; font-size: 15px; }

/* ---- OCR, document details and revisions (10.5) ---- */
.textLayer.ocr span { line-height: 1; white-space: nowrap; }
.ud-details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.ud-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 500px) { .ud-meta { grid-template-columns: 1fr; } }
.ud-found { font-size: 11px; font-weight: 600; color: #15803d; background: rgba(22,163,74,.1); padding: 1px 6px; border-radius: 6px; }
.ud-revcard { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.3); margin-bottom: 10px; }

/* ---- Subscription tiers and Enterprise (10.6.2) ----
   One family for all three tiers, in the Kelmora colours: Standard is plain, Professional is amber,
   Enterprise is navy with amber. Three dots show the step (one, two or three filled). */
:root { --amber-ink: #8a5a00; --amber-soft: rgba(245, 168, 0, .14); --amber-line: rgba(245, 168, 0, .45); --ent-bg: #1a1d23; --ent-ink: #ffc21a; --ok-ink: #166534; --ok-soft: rgba(22, 163, 74, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --amber-ink: #ffd24d; --amber-soft: rgba(255, 194, 26, .13); --amber-line: rgba(255, 194, 26, .4); --ent-bg: #252931; --ok-ink: #86efac; --ok-soft: rgba(74, 222, 128, .13); } }
:root[data-theme="dark"] { --amber-ink: #ffd24d; --amber-soft: rgba(255, 194, 26, .13); --amber-line: rgba(255, 194, 26, .4); --ent-bg: #252931; --ok-ink: #86efac; --ok-soft: rgba(74, 222, 128, .13); }

.pips { display: inline-flex; gap: 2px; align-items: center; flex: none; }
.pips i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .28; }
.pips.p1 i:nth-child(1), .pips.p2 i:nth-child(-n+2), .pips.p3 i { opacity: 1; }

.plan-badge { gap: 6px; }
.plan-badge.t-standard { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.plan-badge.t-standard .pips { color: var(--accent-strong); }
.plan-badge.t-professional { background: var(--accent-grad, linear-gradient(135deg, #ffd24d, #f5a800)); color: var(--on-accent); box-shadow: 0 2px 10px rgba(245, 168, 0, .3); }
.plan-badge.t-enterprise { background: var(--ent-bg); color: var(--ent-ink); box-shadow: inset 0 0 0 1px var(--amber-line), 0 2px 10px rgba(26, 29, 35, .25); }
.plan-badge .pb-test, .pb-test { font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; padding: 0 4px; margin-left: 2px; box-shadow: inset 0 0 0 1px currentColor; opacity: .85; }
.ent-banner .pb-test { color: var(--amber-ink); }

.tier-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; vertical-align: middle; white-space: nowrap; }
.tier-pill.t-standard { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tier-pill.t-standard .pips { color: var(--accent-strong); }
.tier-pill.t-professional { background: var(--accent); color: var(--on-accent); }
.tier-pill.t-enterprise { background: var(--ent-bg); color: var(--ent-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }

.mod-tag { display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.mod-tag.beta { background: var(--amber-soft); color: var(--amber-ink); }
.mod-tag.planned, .mod-tag.lock { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.mod-tag.lock .i { width: 10px; height: 10px; }
.more-tile.locked .mt-icon, .sn-item.locked > .i { opacity: .5; filter: grayscale(.6); }
.more-tile.locked .title, .sn-item.locked > span:not(.mod-tag) { opacity: .7; }
.mod-st { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.mod-st.available { background: var(--ok-soft); color: var(--ok-ink); }
.mod-st.beta { background: var(--amber-soft); color: var(--amber-ink); }
.mod-st.planned, .mod-st.off { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Enterprise icon tiles: Kelmora navy with amber. */
.mt-icon.brand, .icon-tile.brand { background: linear-gradient(135deg, #2a2e37, #1a1d23); color: #ffc21a; box-shadow: inset 0 0 0 1px rgba(255, 194, 26, .25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mt-icon.brand { background: linear-gradient(135deg, rgba(255, 194, 26, .22), rgba(255, 194, 26, .07)); color: #ffd24d; box-shadow: inset 0 0 0 1px rgba(255, 194, 26, .22); } }
:root[data-theme="dark"] .mt-icon.brand { background: linear-gradient(135deg, rgba(255, 194, 26, .22), rgba(255, 194, 26, .07)); color: #ffd24d; box-shadow: inset 0 0 0 1px rgba(255, 194, 26, .22); }

.mod-head { display: flex; gap: 14px; align-items: center; margin: 14px 0 10px; padding: 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.mod-head.ent { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--amber-line); background: linear-gradient(135deg, var(--amber-soft), transparent 60%), var(--surface); }
.mod-head .mt-icon { width: 46px; height: 46px; flex: none; }
.mod-name { font-size: 1.25rem; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mod-planned { border: 1px dashed var(--line); box-shadow: none !important; }
.mod-planned .mod-st { align-self: flex-start; }
.lock-page { padding-top: 28px; }
.lock-page { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lock-page h2 { margin: 2px 0 0; }
.lock-ico { position: relative; width: 64px !important; height: 64px !important; border-radius: 20px !important; }
.lock-ico > .i { width: 30px; height: 30px; }
.lock-ico > i { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); box-shadow: 0 0 0 2px var(--bg), var(--shadow-sm); }
.lock-ico > i .i { width: 12px; height: 12px; }
.ent-banner { border: 1px solid var(--amber-line); background: linear-gradient(135deg, var(--amber-soft), transparent 70%), var(--surface); margin-bottom: 12px; }
.ent-head { display: flex; align-items: center; gap: 10px; }
.ent-head .mt-icon { width: 32px; height: 32px; flex: none; }
.ent-head b { font-size: 1rem; white-space: nowrap; }
.ent-head .grow { min-width: 0; line-height: 1.25; }
.ent-sub { min-height: 36px; width: 36px; padding: 0; justify-content: center; color: var(--ink-2); flex: none; }
.ent-text { margin: 8px 0 10px; }
.ent-btn { background: var(--accent-grad, var(--accent)); color: var(--on-accent); gap: 6px; }
.sub-plus { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0 6px; }
.sub-plus .i { color: var(--ok-ink); }
.ent-links { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.ent-links a { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 84px; padding: 10px 6px 8px; border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 650; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ent-links .mt-icon { width: 34px; height: 34px; }
.ent-links .mod-tag { margin: 0; }
.sn-group.ent .sn-gh { color: var(--amber-ink); }
.sub-test { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--ink); border: 1px solid var(--amber-line); }
.sub-seg { flex-wrap: wrap; }
.sub-mods summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.sub-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 6px; }
.sub-tier { border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.sub-tier.t-professional { box-shadow: inset 0 3px 0 var(--accent), inset 0 0 0 1px var(--line); }
.sub-tier.t-enterprise { box-shadow: inset 0 3px 0 var(--ent-bg), inset 0 0 0 1px var(--amber-line); }
.sub-th { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 6px; }
.sub-mod { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sub-mod .mt-icon { width: 24px; height: 24px; border-radius: 7px; flex: none; }
.sub-mod .mt-icon .i { width: 13px; height: 13px; }
.pf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 10px; }
.pf-card { display: block; text-decoration: none; color: var(--ink); padding: 14px; border-left: 3px solid var(--accent); }
.pf-name { font-size: 15px; }
.pf-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.pf-stats b { color: var(--ink); }
.pf-stats .bad b { color: var(--danger); }
.sub-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.sub-top > .grow { flex: 1 1 220px; min-width: 0; }
.segmented.sub-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .segmented.sub-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.segmented.sub-seg button { white-space: nowrap; }

/* ---- Colour and contrast (10.6.3) ----
   Issue types: a soft tint with strong lettering, the same in both themes, so each type is clear without shouting.
   Every pair here is at least 4.5 to 1 against its own background, in light and dark. */
:root {
  --ty-obs-bg: #dde8ff; --ty-obs: #1a4fc4; --ty-rfi-bg: #ece5ff; --ty-rfi: #5b21b6; --ty-blk-bg: #fde3e3; --ty-blk: #b01e1e;
  --ty-pch-bg: #fdebd6; --ty-pch: #8a3f06; --ty-dir-bg: #d4f3ec; --ty-dir: #0b6359; --ty-def-bg: #e8ecf2; --ty-def: #3c4a5e;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ty-obs-bg: rgba(96, 165, 250, .2); --ty-obs: #a9cbff; --ty-rfi-bg: rgba(167, 139, 250, .22); --ty-rfi: #d0c2ff; --ty-blk-bg: rgba(248, 113, 113, .22); --ty-blk: #ffb4b4;
  --ty-pch-bg: rgba(251, 146, 60, .22); --ty-pch: #ffc58f; --ty-dir-bg: rgba(45, 212, 191, .2); --ty-dir: #8ff0dc; --ty-def-bg: rgba(148, 163, 184, .2); --ty-def: #d3dbe7;
} }
:root[data-theme="dark"] {
  --ty-obs-bg: rgba(96, 165, 250, .2); --ty-obs: #a9cbff; --ty-rfi-bg: rgba(167, 139, 250, .22); --ty-rfi: #d0c2ff; --ty-blk-bg: rgba(248, 113, 113, .22); --ty-blk: #ffb4b4;
  --ty-pch-bg: rgba(251, 146, 60, .22); --ty-pch: #ffc58f; --ty-dir-bg: rgba(45, 212, 191, .2); --ty-dir: #8ff0dc; --ty-def-bg: rgba(148, 163, 184, .2); --ty-def: #d3dbe7;
}
.type-badge { background: var(--ty-def-bg); color: var(--ty-def); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.type-badge.obs { background: var(--ty-obs-bg); color: var(--ty-obs); }
.type-badge.rfi { background: var(--ty-rfi-bg); color: var(--ty-rfi); }
.type-badge.blk { background: var(--ty-blk-bg); color: var(--ty-blk); }
.type-badge.pch { background: var(--ty-pch-bg); color: var(--ty-pch); }
.type-badge.dir { background: var(--ty-dir-bg); color: var(--ty-dir); }
.type-dot.obs { background: #3b82f6; } .type-dot.rfi { background: #8b5cf6; } .type-dot.blk { background: #ef4444; } .type-dot.pch { background: #f59e0b; } .type-dot.dir { background: #14b8a6; }
.st-pill.st-answered { color: var(--ty-rfi); }

/* Links and small coloured text */
.link-btn, .bim-mrow .link-btn, .linkish { color: var(--link); }
.pill.next, .mention { color: var(--link); }
.sso-microsoft { color: var(--link); } .sso-google { color: #c5221f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sso-google { color: #ff8a80; } }
:root[data-theme="dark"] .sso-google { color: #ff8a80; }

/* Solid badges with white text use the deeper reds and greens, so the text stays readable in both themes. */
.prio.critical, .seg-n.bad { background: #c42b2b; color: #fff; }
.chip.tag.on { color: var(--on-accent); }
.cx-tag[style*="16a34a"], .cx-tag[style*="22c55e"] { color: #1a1d23 !important; }
.chip.on .muted { color: inherit; opacity: .75; }
.leaflet-control-layers label, .leaflet-control-layers span { color: var(--ink); }
.chip.tag.on { color: #fff; }
.bell-count { background: #c42b2b; }
.ent-row { margin-top: 12px; }
.ent-row + .ent-row { padding-top: 10px; border-top: 1px solid var(--line); }
.ent-rh { display: flex; align-items: center; gap: 8px; }
.ent-row .ent-links { margin-top: 8px; }
.ent-row .ent-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); overflow: visible; }
.ent-row .ent-links a { min-width: 0; padding: 9px 4px 7px; font-size: 11.5px; text-align: center; line-height: 1.2; }
/* Names break between words only, never inside one ("ReadyChec k"). */
.ent-row .ent-links a > span:not(.mt-icon) { overflow-wrap: normal; word-break: normal; hyphens: none; max-width: 100%; letter-spacing: -.01em; }

/* Offline: the note on a walk that has changes or photos still on this phone. */
.wk-offline { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; padding: 9px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--ink); border: 1px solid var(--amber-line); font-size: 13.5px; line-height: 1.35; }
.wk-offline .i { color: var(--amber-ink); flex: none; margin-top: 1px; }

/* ---- ReadyCheck (10.8) ---- */
.rc-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .rc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rc-kpis .kpi.warn b { color: var(--st-warn); } .rc-kpis .kpi.bad b { color: var(--st-critical); }
.rc-kpis .kpi small { font-size: .6em; color: var(--muted); font-weight: 700; }
.rc-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.rc-room { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 12px; color: var(--ink); cursor: pointer; border: 0; font: inherit; }
.rc-room .rc-why { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rc-noscore { width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--muted); box-shadow: inset 0 0 0 6px var(--line); }
.rc-noscore.lg { width: 92px; height: 92px; box-shadow: inset 0 0 0 10px var(--line); }
.rc-hero { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.ring-chart.rc-good .rc-val { stroke: var(--st-good); } .ring-chart.rc-warn .rc-val { stroke: var(--st-warn); } .ring-chart.rc-bad .rc-val { stroke: var(--st-critical); }
.rc-parts { display: grid; gap: 12px; }
.rc-ph { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.rc-blockers .list-item { align-items: flex-start; }
.rc-lv { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; }
.rc-lv.l3 { background: var(--st-critical); } .rc-lv.l2 { background: var(--st-warn); } .rc-lv.l1 { background: var(--muted); }
.rc-clear { color: var(--ok-ink); font-weight: 600; }
/* Client sign-off page */
.so-choice { display: grid; gap: 8px; }
.so-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.so-choice label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--amber-soft); }
.so-choice input { margin-top: 3px; accent-color: #d68c00; width: 18px; height: 18px; }
.so-choice small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.so-sig { width: 100%; height: 150px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); touch-action: none; display: block; }
.so-confirm { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.so-confirm input { width: 18px; height: 18px; margin-top: 2px; accent-color: #d68c00; flex: none; }
.so-done { box-shadow: inset 0 0 0 2px var(--st-good); } .so-done.rejected { box-shadow: inset 0 0 0 2px var(--st-critical); }
.so-sigimg { width: 100%; max-width: 420px; background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); display: block; }

/* ---- ProjectIQ (10.9) ---- */
.iq-log { display: grid; gap: 10px; margin-top: 8px; grid-template-columns: minmax(0, 1fr); }
.iq-log > *, .iq-src a { min-width: 0; } .iq-body { overflow-wrap: anywhere; }
.iq-q { display: flex; justify-content: flex-end; }
.iq-q span { max-width: 85%; background: var(--accent-grad, var(--accent)); color: var(--on-accent); padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-weight: 600; white-space: pre-wrap; }
.iq-a { padding: 14px; }
.iq-body p { margin: 0 0 8px; line-height: 1.5; } .iq-body ul { margin: 0 0 8px; padding-left: 20px; } .iq-body li { margin: 3px 0; line-height: 1.45; }
.iq-cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px; border-radius: 6px; font-size: 11px; font-weight: 800; text-decoration: none; vertical-align: 2px; background: var(--amber-soft); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }
.iq-src { display: grid; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.iq-src a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 13.5px; padding: 5px 0; }
.iq-src a b { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; font-size: 11px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); flex: none; }
.iq-src a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iq-meta { margin-top: 8px; }
.iq-thinking { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.iq-start { margin-top: 12px; }
.iq-form { display: flex; gap: 8px; align-items: flex-end; width: 100%; }
.iq-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 14px; border-radius: 14px; border: 0; font: inherit; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.iq-form .btn { min-height: 44px; }

/* ---- InspectAI (10.10) ---- */
.ia-list { display: grid; gap: 10px; }
.ia-card { display: flex; gap: 12px; align-items: flex-start; }
.ia-thumb { width: 84px; height: 84px; flex: none; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.ia-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ia-run .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ia-run .kpi small { font-size: .6em; color: var(--muted); font-weight: 700; }
.ia-run .kpi.warn b { color: var(--st-warn); }
.ia-text { font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.ia-docs { max-height: 50vh; overflow: auto; }

/* ---- Portfolio trends (10.10) ---- */
.pf-trend { margin-top: 12px; }
.pf-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.pf-grid { stroke: var(--line); stroke-width: 1; }
.pf-axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.pf-chart .l-open { stroke: var(--link); } .pf-chart .l-over { stroke: var(--st-critical); }
.pf-chart .b-raised { fill: var(--st-serious); opacity: .55; } .pf-chart .b-closed { fill: var(--st-good); opacity: .55; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.pf-legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.pf-legend .l-open { background: var(--link); } .pf-legend .l-over { background: var(--st-critical); } .pf-legend .l-raised { background: var(--st-serious); opacity: .7; } .pf-legend .l-closed { background: var(--st-good); opacity: .7; }
.pf-spark { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--link); }
.segmented.sm button { padding: 5px 10px; font-size: 12px; min-height: 30px; white-space: nowrap; }

/* RiskRadar */
.rr-top { display: flex; gap: 14px; align-items: center; }
.rr-gauge { flex: none; width: 84px; height: 84px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 0 0 6px currentColor; }
.rr-gauge b { font-size: 1.7rem; line-height: 1; color: var(--ink); } .rr-gauge span { font-size: 0.7rem; color: var(--muted); font-weight: 650; }
.rr-gauge.bad { color: var(--st-critical); } .rr-gauge.warn { color: var(--st-serious); } .rr-gauge.watch { color: var(--st-warn); } .rr-gauge.good { color: var(--st-good); }
.rr-lv { font-size: 0.72rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; white-space: nowrap; box-shadow: inset 0 0 0 1.5px currentColor; }
.rr-lv.bad { color: var(--st-critical); } .rr-lv.warn { color: var(--st-serious); } .rr-lv.watch { color: var(--st-warn); } .rr-lv.good { color: var(--st-good); }
.rr-bar { display: block; width: 64px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.rr-bar i { display: block; height: 100%; border-radius: 3px; }
.rr-bar i.bad { background: var(--st-critical); } .rr-bar i.warn { background: var(--st-serious); } .rr-bar i.watch { background: var(--st-warn); } .rr-bar i.good { background: var(--st-good); }
.rr-score { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin: 0 8px; } .rr-score b { font-size: 1.05rem; }
.rr-row { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); margin-bottom: 8px; }
.rr-row summary { display: flex; align-items: center; gap: 6px; padding: 12px; cursor: pointer; list-style: none; }
.rr-row summary::-webkit-details-marker { display: none; }
.rr-row summary > .grow { flex: 1; min-width: 0; }
.rr-row summary .title { display: block; font-weight: 700; } .rr-row summary .sub { display: block; font-size: 0.82rem; color: var(--muted); }
.rr-detail { padding: 0 12px 12px; }
.rr-list { display: block; }
.rr-sev { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px currentColor; }
.rr-sev.bad { color: var(--st-critical); } .rr-sev.warn { color: var(--st-serious); }
.rr-warn .list-item { align-items: flex-start; }
.rr-ev { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 0.82rem; }
.rr-ev a { color: var(--link); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-ok { color: var(--st-good); font-weight: 700; } .rr-bad { color: var(--st-critical); font-weight: 700; }
.rr-chart .rr-dash { stroke-dasharray: 6 5; }
.rr-chart .rr-ahead { fill: var(--surface-2); opacity: .7; }
.rr-chart .rr-now { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.pf-legend .rr-dash-key { background: repeating-linear-gradient(90deg, var(--link) 0 5px, transparent 5px 8px); }
.rr-how summary { cursor: pointer; }

/* ModelSync: measuring, notes on the model, plans, sharing */
.bim-mbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.bim-mbar .segmented { flex: 1 1 260px; }
.bim-nsec { display: flex; justify-content: space-between; margin: 10px 0 4px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.bim-nsec:first-child { margin-top: 0; }
.bim-nrow { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.bim-nrow .bim-check { min-width: 0; font-size: 0.84rem; }
.bim-nrow .link-btn { text-align: left; font-size: 0.86rem; display: inline-flex; align-items: center; gap: 6px; }
.bim-crow { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 6px 4px; border: 0; background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; border-radius: 10px; }
.bim-crow:hover { background: var(--surface-2); }
.bim-crow.done { opacity: 0.6; }
.bim-cnum { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #ea580c; color: #fff; font-weight: 800; font-size: 0.75rem; display: grid; place-items: center; }
.bim-crow .grow { display: flex; flex-direction: column; min-width: 0; font-size: 0.84rem; }
.bim-ctext { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bim-replies { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.bim-reply { font-size: 0.88rem; }
.rp-wrap { background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); padding: 6px; color: var(--ink); max-height: 52vh; overflow: auto; }
.rp-plan { display: block; width: 100%; height: auto; max-height: 50vh; }
.sh-link { display: block; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bottom action bar (walk reports, notes, ProjectIQ and others): stays at the bottom of the screen. */
.bottom-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 8px; align-items: center;
  max-width: 760px; margin: 0 auto; padding: 14px 16px calc(14px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 62%, transparent); }
.bottom-actions .btn { min-height: 50px; }
body:has(#bottom .bottom-actions) #app { padding-bottom: 96px; }

/* Markups from other PDF apps, and picking one with Select */
.dvw-pdfmk { background: rgba(37, 99, 235, .08); border-color: rgba(37, 99, 235, .35); }
.dvw.marking.tool-select .dvw-svg { cursor: default; }
.dvw-selbox { pointer-events: none; }
.dvw-note.sel { outline: 2px dashed #2563eb; outline-offset: 2px; }

/* Comment colours and what they mean */
.dvw-key { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.dvw-key-t { margin-right: 2px; }
.dvw-kc { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line, rgba(0,0,0,.12)); background: var(--surface, #fff); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.dvw-kc i { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.dvw-kc b { font-weight: 700; opacity: .7; }
.dvw-kc.off { opacity: .45; text-decoration: line-through; }
.dvw-kc.on { outline: 2px solid #2563eb; outline-offset: 1px; }
.dvw-kc input[type=color] { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.dvw-kdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.ck-row input[type=color] { width: 40px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--line, rgba(0,0,0,.15)); background: none; flex: none; }
.linkish { background: none; border: 0; padding: 0; color: #2563eb; text-decoration: underline; font: inherit; cursor: pointer; }

/* Headcount, day summaries and custom reports */
.hc-sum { padding: 12px 14px; border-radius: 14px; background: rgba(22, 163, 74, .1); border: 1px solid rgba(22, 163, 74, .35); margin: 6px 0 12px; }
.hc-big { font-size: 30px; font-weight: 800; line-height: 1.1; }
.hc-big span { font-size: 14px; font-weight: 600; opacity: .7; margin-left: 4px; }
.hc-twice { margin-top: 4px; }
.hc-spa { padding: 12px; }
.wk-est { color: #d97706; font-weight: 800; margin-left: 1px; }
.sm-preview { white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(127, 127, 127, .08); border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 12px; padding: 12px; max-height: 40vh; overflow: auto; margin: 10px 0; }
.cr-report { padding: 18px; margin-top: 12px; }
.cr-h { margin: 22px 0 8px; font-size: 15px; }
.cb-secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 12px; }
.ch { width: 100%; height: auto; display: block; }
.ch-l { font-size: 12px; fill: var(--muted, #64748b); }
.ch-v { font-size: 12px; font-weight: 700; fill: currentColor; }
.ch-axis { stroke: var(--line, rgba(127,127,127,.35)); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin-top: 6px; }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 600px) { .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Photos: quick zone picker */
.zone-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.zone-pick { display: inline-flex; align-items: center; gap: 8px; flex: none; max-width: 60%; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.zone-pick b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.zone-pick .zp-lbl { opacity: .65; font-size: 13px; }
.zone-recent { flex-wrap: nowrap; overflow-x: auto; min-width: 0; }
.zp-list { max-height: 60vh; overflow: auto; margin-top: 6px; }
.zp-level { border-bottom: 1px solid var(--line); padding: 6px 0; }
.zp-level summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 8px 4px; list-style: none; }
.zp-level summary::-webkit-details-marker { display: none; }
.zp-row.on { outline: 2px solid #f5a800; outline-offset: -2px; border-radius: 10px; }

/* Plans and Mark-ups */
.seg a { border: 0; background: none; border-radius: 10px; padding: 9px 4px; font-weight: 650; font-size: .86rem; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.plans-seg { max-width: 420px; }
.sn-item[data-sub] { }
.mk-cols { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 2px; }
.mk-col { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.mk-doc { text-decoration: none; color: inherit; }

/* ConnectX */
.cx-tabs { max-width: 640px; }
.cx-evs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; }
.cx-key { white-space: pre-wrap; word-break: break-all; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(127,127,127,.08); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
.cx-m { max-height: 280px; overflow: auto; word-break: normal; }
.cx-steps { padding-left: 20px; line-height: 1.6; }
.cx-hook .btn { flex: none; }

/* Crew insights */
.cr-card { padding: 16px; margin-top: 12px; }
.cr-tr { font-weight: 700; }
.cr-tr.up { color: #16a34a; } .cr-tr.down { color: #dc2626; }
.cr-hl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 12px; }
.cr-hlc { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.35; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-left: 4px solid #64748b; }
.cr-hlc svg { flex: none; margin-top: 1px; }
.cr-hlc.good { border-left-color: #16a34a; } .cr-hlc.warn { border-left-color: #f59e0b; } .cr-hlc.bad { border-left-color: #dc2626; }
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cr-sc { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 0; border-radius: 16px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s; }
.cr-sc:hover { transform: translateY(-2px); box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.cr-sc .title { font-weight: 750; }
.cr-sc .sub { font-size: .82rem; color: var(--muted); }
.cr-grade { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; font-weight: 900; font-size: 1.35rem; flex: none; }
.cr-grade.sm { width: 30px; height: 30px; font-size: 1rem; border-radius: 9px; margin-right: 6px; }
.cr-grade.big { width: 60px; height: 60px; font-size: 1.9rem; border-radius: 16px; }
.cr-spark { width: 100%; height: 34px; }
.cr-bars { display: grid; gap: 5px; }
.cr-bar { display: grid; grid-template-columns: 112px 1fr 34px; align-items: center; gap: 8px; font-size: .78rem; }
.cr-bars.wide .cr-bar { grid-template-columns: 170px 1fr 40px; font-size: .86rem; }
.cr-bar i { height: 8px; border-radius: 99px; background: rgba(127,127,127,.18); overflow: hidden; display: block; }
.cr-bar i b { display: block; height: 100%; border-radius: 99px; }
.cr-bar em { font-style: normal; text-align: right; font-weight: 700; }
.cr-nums { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .8rem; color: var(--muted); }
.cr-nums b { color: var(--ink, inherit); }
.cr-nums .bad, .section-title .bad { color: #dc2626; }
.cr-heat td.num { min-width: 64px; }
.cr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }

/* Documents: pinch to zoom, and the sharp detail layer when zoomed in far */
.dvw-stage { touch-action: pan-x pan-y; will-change: transform; }
.dvw-pagewrap canvas.dvw-detail { position: absolute; display: block; max-width: none; pointer-events: none; z-index: 1; }
.dvw-pagewrap .textLayer { z-index: 2; }
.dvw-zl { border: 0; background: none; color: inherit; font: inherit; font-size: .8rem; font-weight: 700; min-width: 46px; padding: 4px; border-radius: 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
.dvw-zl:hover { background: rgba(127,127,127,.12); }
.lightbox.lb-zoom { overflow: hidden; touch-action: none; user-select: none; }
.lb-zoom img { max-width: 96vw; max-height: 86vh; transform-origin: center center; cursor: grab; will-change: transform; }
.lb-tools { position: absolute; bottom: calc(14px + var(--safe-b, 0px)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 999px; background: rgba(15, 23, 42, .85); color: #fff; }
.lb-tools .icon-btn { color: #fff; }
.lb-pc { border: 0; background: none; color: #fff; font: inherit; font-weight: 700; min-width: 52px; cursor: pointer; }

/* SafeWork: permit board, plant, Don't Walk By, Stop Work */
.pt-list { display: grid; gap: 8px; }
.pt-card, .pt-type { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-left: 5px solid var(--g); border-radius: 14px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.pt-card .title, .pt-type .title { font-weight: 750; }
.pt-card .sub, .pt-type .sub { font-size: .82rem; color: var(--muted); }
.pt-code { display: inline-grid; place-items: center; min-width: 46px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--g, #64748b); color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .03em; flex: none; vertical-align: middle; }
.pt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.pt-types { display: grid; gap: 6px; }
.pt-type { margin-bottom: 6px; }
.pt-simops { color: #d97706; font-weight: 700; }
.pt-simops-card { display: flex; gap: 8px; align-items: flex-start; border-left: 4px solid #d97706; }
.pt-checks { display: grid; gap: 4px; }
.pt-ck { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.pt-ck.on { color: inherit; } .pt-ck.on svg { color: #16a34a; }
.pt-ring { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 2px; }
.pt-sigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; }
.pt-sig { padding: 8px 10px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.pt-sig .sig-img { width: 100%; height: 50px; color: var(--ink, #1a1d23); }
.pt-log { margin-top: 10px; }
.pc-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.dwb-hero, .sw-hero { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 16px; border-radius: 18px; }
.dwb-hero { background: linear-gradient(135deg, rgba(245,168,0,.18), rgba(245,168,0,.06)); box-shadow: inset 0 0 0 1px rgba(245,168,0,.4); }
.sw-hero { background: linear-gradient(135deg, rgba(220,38,38,.16), rgba(220,38,38,.05)); box-shadow: inset 0 0 0 1px rgba(220,38,38,.4); }
.sw-btn, .fab.sw-fab { background: #dc2626 !important; color: #fff !important; }
.dwb-sev { display: inline-grid; place-items: center; min-width: 56px; padding: 4px 8px; border-radius: 8px; font-size: .75rem; font-weight: 800; flex: none; }
.dwb-sev.low { background: rgba(37,99,235,.14); color: #2563eb; } .dwb-sev.medium { background: rgba(245,158,11,.18); color: #b45309; } .dwb-sev.high { background: rgba(220,38,38,.16); color: #dc2626; } .dwb-sev.pos { background: rgba(22,163,74,.16); color: #16a34a; }
.sw-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 900; flex: none; background: rgba(100,116,139,.18); }
.sw-ico.bad { background: #dc2626; color: #fff; } .sw-ico.warn { background: #f59e0b; color: #111; } .sw-ico.good { background: #16a34a; color: #fff; }
.sw-banner { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #dc2626; color: #fff; text-decoration: none; font-size: .9rem; }
.cr-ct { font-weight: 750; font-size: .92rem; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }

/* Report builder */
.rb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.rb { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 12px; align-items: start; }
@media (min-width: 980px) { .rb { grid-template-columns: 360px minmax(0, 1fr); } .rb-side { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; padding-right: 4px; } }
.rb-side { display: grid; gap: 12px; }
.rb-card { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); display: grid; gap: 8px; }
.rb-h { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: .95rem; justify-content: space-between; }
.rb-h > svg { color: var(--accent-strong); }
.rb-ai { background: linear-gradient(160deg, rgba(255,194,26,.14), transparent 60%), var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(245,168,0,.45); }
.rb-ai .rb-h { justify-content: flex-start; }
.rb-ex { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-chip { border: 0; background: rgba(127,127,127,.1); color: inherit; font: inherit; font-size: .78rem; padding: 6px 10px; border-radius: 999px; cursor: pointer; text-align: left; }
.rb-chip:hover { background: rgba(245,168,0,.2); }
.rb-f { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); }
.rb-f .input, .rb-card select.input { color: var(--ink, inherit); font-size: .95rem; }
.rb-firms { display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.rb-check { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 8px; font-size: .9rem; cursor: pointer; }
.rb-check:hover { background: rgba(127,127,127,.08); }
.rb-check input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--accent-strong); box-shadow: none; border: 0; }
.rb-secs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rb-sec { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.rb-sec:not(.on) { opacity: .62; box-shadow: none; }
.rb-sec .icon-btn { width: 30px; height: 30px; flex: none; }
.rb-sl { font-weight: 650; font-size: .9rem; }
.rb-sd { font-size: .75rem; color: var(--muted); }
.rb-aitag { font-size: .65rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: var(--on-accent, #111); vertical-align: 1px; }
.rb-switch { position: relative; width: 38px; height: 22px; flex: none; cursor: pointer; }
.rb-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.rb-switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(127,127,127,.35); transition: background .15s; pointer-events: none; }
.rb-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.rb-switch input:checked + i { background: #16a34a; }
.rb-switch input:checked + i::after { transform: translateX(16px); }
.rb-switch input:focus-visible + i { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.rb-main { min-width: 0; }
.rb-paper { background: #fff; color: #0f172a; border-radius: 6px; padding: clamp(18px, 4vw, 40px); box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.rb-paper .muted, .rb-paper .ch-l { color: #64748b; fill: #64748b; }
.rb-paper .dtable { color: #0f172a; }
.rb-paper .dtable th { background: #1a1d23; color: #fff; }
.rb-paper .dtable td { border-color: #e2e8f0; }
.rb-paper .dtable tbody tr:nth-child(even) td { background: #f7f8fb; }
.rb-ph { border-bottom: 3px solid #ffc21a; padding-bottom: 12px; margin-bottom: 8px; }
.rb-brand { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.rb-ph h1 { margin: 6px 0 2px; font-size: clamp(1.4rem, 3vw, 1.9rem); color: #1a1d23; }
.rb-meta { font-size: .85rem; color: #475569; }
.rb-ainote { margin: 10px 0; padding: 8px 12px; border-radius: 10px; background: #fff7df; color: #7a5600; font-size: .85rem; }
.rb-s { padding: 14px 0 6px; border-bottom: 1px solid #e2e8f0; }
.rb-s:last-child { border-bottom: 0; }
.rb-s h2 { font-size: 1.02rem; color: #1a1d23; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.rb-s h2 span { font-size: .75rem; background: #eef2f7; color: #334155; padding: 1px 8px; border-radius: 99px; }
.rb-summary { font-size: .98rem; line-height: 1.6; margin: 0 0 6px; color: #1e293b; }
.rb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .rb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rb-kpis div { background: #f4f6fa; border-radius: 10px; padding: 10px 12px; display: grid; }
.rb-kpis b { font-size: 1.5rem; color: #1a1d23; } .rb-kpis span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 700; }
.rb-paper .ch-legend { color: #334155; }
.rb-paper .ch-v { fill: #0f172a; }

/* Sideways strips: arrows, mouse wheel and an "all" list */
.snx-row { scroll-behavior: smooth; }
.snx { flex: none; position: sticky; z-index: 4; display: none; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; padding: 0; align-self: center; background: var(--surface); color: var(--ink, inherit); box-shadow: 0 2px 10px rgba(0,0,0,.22), inset 0 0 0 1px var(--line); font: 700 20px/1 system-ui, sans-serif; cursor: pointer; }
.snx-l { left: 0; } .snx-r { right: 38px; margin-left: auto; } .snx-all { right: 0; display: grid; }
.snx-row.snx-l-on .snx-l, .snx-row.snx-r-on .snx-r { display: grid; }
.snx-row:not(.snx-r-on) .snx-all { margin-left: auto; }
@media (hover: none) { .snx-l, .snx-r { display: none !important; } }
.snx:hover { box-shadow: 0 2px 10px rgba(0,0,0,.25), inset 0 0 0 2px var(--accent); }

/* Docs: search, sort, group and views */
.dl-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.dl-q { flex: 1 1 220px; min-width: 0; }
.dl-sel { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.dl-sel select { border: 0; background: transparent; color: inherit; font: inherit; font-size: .88rem; padding: 10px 0; min-height: 0; box-shadow: none; }
.dl-views { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair, var(--line)); }
.dl-views button { border: 0; background: none; color: var(--ink-2, inherit); font: inherit; font-size: .82rem; font-weight: 650; padding: 7px 10px; border-radius: 9px; cursor: pointer; }
.dl-views button.on { background: var(--surface); color: var(--ink, inherit); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.dl-group { margin-bottom: 10px; }
.dl-group > summary { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.dl-group > summary::-webkit-details-marker { display: none; }
.dl-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: rgba(37,99,235,.1); color: #2563eb; }
.dl-compact { border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.dl-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; border-bottom: 1px solid var(--line); }
.dl-row:last-child { border-bottom: 0; }
.dl-row a { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: inherit; padding: 6px 0; }
.dl-row a b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row a span { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.dl-card { position: relative; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; }
.dl-th { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #f1f4f8 center top / cover no-repeat; text-decoration: none; }
.dl-th.has .dl-ext { display: none; }
.dl-ext { font-weight: 800; font-size: .9rem; color: #64748b; padding: 6px 10px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px #e2e8f0; }
.dl-cap { padding: 8px 10px 10px; display: grid; gap: 2px; }
.dl-cap .title { font-weight: 650; font-size: .88rem; color: inherit; text-decoration: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dl-cap .sub { font-size: .75rem; color: var(--muted); }
.dl-more { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.9); color: #0f172a; }
.dl-table td a { color: inherit; text-decoration: none; }

/* Contractor logos */
.fl-img { display: block; object-fit: contain; flex: none; }
.fl-init { display: inline-grid; place-items: center; flex: none; border-radius: 8px; font-weight: 800; letter-spacing: .02em; }
.fl-box { display: grid; place-items: center; width: 96px; height: 40px; flex: none; background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.rb-check .fl-img, .rb-check .fl-init { margin-right: -2px; }
.rb-logos { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; align-items: flex-end; }
.rb-logo { display: grid; justify-items: start; gap: 4px; font-size: .68rem; color: #64748b; max-width: 140px; }
.cr-sc { position: relative; }
.cr-logo { position: absolute; top: 10px; right: 10px; }
.list-item[data-hc] { gap: 12px; }

/* Report centre */
.rc-hero { margin-top: 14px; padding: 16px; border-radius: 18px; display: grid; gap: 4px; background: linear-gradient(160deg, rgba(255,194,26,.16), transparent 65%), var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(245,168,0,.45); }
@media (min-width: 900px) { .rc-hero { grid-template-columns: 320px 1fr; gap: 18px; align-items: start; } }
.rc-h2 { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 1.15rem; }
.rc-h2 svg { color: var(--accent-strong); }
.rc-ask { display: grid; gap: 8px; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rc-card { display: grid; gap: 6px; align-content: start; text-align: left; padding: 14px; border: 0; border-radius: 16px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); transition: box-shadow .15s, transform .15s; }
.rc-card:hover { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); transform: translateY(-1px); }
.rc-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(245,168,0,.16); color: var(--accent-strong); }
.rc-about { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.rc-meta { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rc-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.rc-link { text-decoration: none; color: inherit; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.rb-grp { list-style: none; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 4px 2px; }
.rb-sub { font-size: .85rem; margin: 12px 0 6px; color: #334155; }

/* Contractor logos around the app */
.title > .fl-img, .title > .fl-init, .v > .fl-img, .v > .fl-init { display: inline-block; vertical-align: -4px; margin-right: 7px; border-radius: 3px; }
.fl-side { flex: none; display: grid; place-items: center; padding: 4px 7px; margin-left: 6px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.chip.fl-chip { gap: 6px; }
.chip .fl-img { background: #fff; border-radius: 3px; padding: 1px; }
.chip .fl-init { border-radius: 5px; }
.rb-logos.one .fl-img { height: 52px !important; max-width: 180px !important; }
.rb-logos.one .fl-init { width: 52px !important; height: 52px !important; font-size: 20px !important; }
.sheet .fl-side { margin-left: auto; }

/* Report builder: sections in the report, more to add, and your own */
.rb-secs .rb-sec { padding: 8px 8px 8px 10px; }
.rb-sec .rb-move { display: inline-flex; gap: 2px; flex: none; }
.rb-sec .icon-btn { width: 32px; height: 32px; }
.rb-sec .icon-btn:disabled { opacity: .3; }
.rb-more { border-radius: 12px; background: rgba(127,127,127,.06); margin-top: 6px; }
.rb-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 650; font-size: .9rem; }
.rb-more > summary::-webkit-details-marker { display: none; }
.rb-more[open] > summary { border-bottom: 1px solid var(--line); }
.rb-more .rb-secs { padding: 4px 6px 8px; max-height: 420px; overflow: auto; }
.rb-more .rb-sec { box-shadow: none; opacity: 1; }
.rb-more .rb-sec:hover { background: rgba(127,127,127,.08); }
.rb-addown { width: 100%; justify-content: center; margin-top: 4px; border: 1px dashed rgba(245,168,0,.7); background: rgba(255,194,26,.08); }
.rb-mytag { font-size: .62rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: #ede9fe; color: #5b21b6; vertical-align: 1px; }
.rb-kpis.one { grid-template-columns: minmax(0, 260px); }
.cs-ai { padding: 12px; border-radius: 14px; background: linear-gradient(160deg, rgba(255,194,26,.14), transparent 60%); box-shadow: inset 0 0 0 1px rgba(245,168,0,.45); display: grid; gap: 8px; margin-bottom: 12px; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 10px; }
.cs-prev { margin-top: 12px; }
.cs-paper { padding: 16px 18px !important; box-shadow: 0 4px 18px rgba(0,0,0,.14); }
.cs-paper .rb-s { border-bottom: 0; padding-top: 0; }
.rb-sec > .grow { flex: 1 1 0; }
.sheet .sheet-actions .btn.primary#cs-ok { flex: 1; }
.fl-hint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: rgba(37,99,235,.08); box-shadow: inset 0 0 0 1px rgba(37,99,235,.3); font-size: .88rem; }
.fl-row .btn.ghost { flex: none; }
.fl-hint { flex-wrap: wrap; }
.fl-hint-b { display: flex; gap: 6px; flex-wrap: wrap; }

.mk-kpi { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.mk-kpi:hover { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); }
.mk-kpi.on { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent-strong); }
.mk-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.mk-note .title { white-space: normal; }
#mk-show { max-width: 100%; overflow-x: auto; scrollbar-width: none; }

/* Logos in charts */
.ch-legend .ch-lg { height: 16px; max-width: 48px; object-fit: contain; background: #fff; border-radius: 3px; padding: 1px 2px; vertical-align: -4px; margin-right: 4px; }
.hb-logo { height: 18px; max-width: 54px; object-fit: contain; background: #fff; border-radius: 4px; padding: 1px 3px; vertical-align: -4px; margin-right: 6px; }
.rb-pseg { display: flex; width: 100%; }
.rb-pseg button { flex: 1; }
.rb-loading { opacity: .5; transition: opacity .2s; }
.dl-firm { white-space: nowrap; }
.dl-firm .fl-img { display: inline-block; vertical-align: -4px; margin-right: 6px; background: #fff; border-radius: 3px; padding: 1px; }
.list-item > .fl-img, .list-item > .fl-init { flex: none; background: #fff; border-radius: 6px; padding: 2px; }
.ch-legend span { display: inline-flex; align-items: center; }
.ch-legend .ch-lg, .hb-logo, .dl-firm .fl-img { display: inline-block; width: auto; flex: none; }
.hb-l { display: inline-flex; align-items: center; }
.rb-paper .rb-kpis b { font-weight: 500; }
.rb-paper .rb-table td b { font-weight: inherit; }
.rb-paper .rb-s h2 { font-weight: 700; }

/* Structured site report review */
.rr-back { display: inline-flex; align-items: center; gap: 4px; margin: 14px 0 8px; font-size: .88rem; color: var(--muted); text-decoration: none; }
.rr-head { padding: 18px 20px; display: grid; gap: 12px; }
.rr-kind { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.rr-title { margin: -6px 0 0; font-size: 1.3rem; line-height: 1.25; }
.rr-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 18px; margin: 0; }
.rr-facts div { min-width: 0; }
.rr-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.rr-facts dd { margin: 2px 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.rr-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .rr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rr-kpis div { background: rgba(127,127,127,.07); border-radius: 12px; padding: 10px 12px; display: grid; }
.rr-kpis b { font-size: 1.35rem; font-weight: 600; } .rr-kpis span { font-size: .72rem; color: var(--muted); }
.rr-kpis .warn { background: rgba(245,158,11,.14); }
.rr-linked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.rr-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 260px; }
.rr-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: rgba(37,99,235,.1); color: #2563eb; font-size: .82rem; text-decoration: none; }
.rr-top-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-seg { margin: 14px 0 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.rr-seg button span { opacity: .6; font-weight: 500; margin-left: 2px; }
.rr-list { display: grid; gap: 12px; }
.rr-item { display: grid; grid-template-columns: 56px minmax(0, 1fr); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); overflow: hidden; }
.rr-item.is-made { box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(22,163,74,.45); }
.rr-ref { display: grid; place-items: start center; padding-top: 16px; font-weight: 700; font-size: 1rem; color: #1a1d23; background: #f4f6fa; border-right: 1px solid var(--line); }
.rr-item.st-open .rr-ref { box-shadow: inset 3px 0 0 #dc2626; } .rr-item.st-note .rr-ref { box-shadow: inset 3px 0 0 #f5a800; } .rr-item.st-closed .rr-ref { box-shadow: inset 3px 0 0 #16a34a; }
.rr-main { padding: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.rr-h { display: flex; gap: 10px; align-items: flex-start; }
.rr-loc { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.rr-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.rr-st { flex: none; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.rr-st.open { background: #fee2e2; color: #b91c1c; } .rr-st.note { background: #fef3c7; color: #92400e; } .rr-st.closed { background: #dcfce7; color: #166534; }
.rr-lbl { font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.rr-block p { margin: 0; line-height: 1.5; font-size: .93rem; }
.rr-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.rr-ph { position: relative; display: block; border-radius: 10px; overflow: hidden; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.rr-img { display: block; aspect-ratio: 3 / 4; background: #eef1f5 center / cover no-repeat; }
.rr-ph input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rr-tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.85); color: transparent; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.rr-ph.on { box-shadow: 0 0 0 3px var(--accent-strong); } .rr-ph.on .rr-tick { background: var(--accent-strong); color: #fff; }
.rr-ph:not(.on) .rr-img { opacity: .55; }
.rr-nophoto { padding: 2px 0; }
.rr-dup { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(245,158,11,.1); box-shadow: inset 0 0 0 1px rgba(245,158,11,.4); font-size: .88rem; }
.rr-dup > svg { color: #b45309; flex: none; }
.rr-made { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: rgba(22,163,74,.08); color: #166534; font-size: .9rem; }
.rr-made a { color: inherit; }
.rr-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.rr-detect { padding: 12px 14px; border-radius: 12px; background: rgba(127,127,127,.07); margin-bottom: 8px; line-height: 1.6; }
.rr-detect b { font-weight: 600; }
.rr-lklist { max-height: 52vh; overflow: auto; margin-top: 8px; }
.rr-lklist .list-item { gap: 10px; }
.rr-lklist input { width: 18px; height: 18px; flex: none; accent-color: var(--accent-strong); }
.rr-lklist .title, .rr-lklist .sub { display: block; }

/* Document findings: reports overview and tidier cards */
.fi-reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.fi-rep { display: grid; gap: 4px; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); text-decoration: none; color: inherit; }
.fi-rep:hover { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); }
.fi-rep b { font-weight: 650; overflow-wrap: anywhere; }
.fi-rep-k { font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-strong); }
.fi-rep-n { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .78rem; color: var(--muted); }
.fi-card { padding: 14px 16px; border-radius: 16px; }
.fi-card .fi-title { font-weight: 650; font-size: 1rem; margin: 6px 0 4px; }
.fi-card .fi-desc { font-size: .92rem; line-height: 1.5; }
.fi-card .fi-quote { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); background: rgba(127,127,127,.05); border-radius: 0 8px 8px 0; font-size: .86rem; color: var(--muted); }
.fi-card .fi-acts { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.ext-ref { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #eef2ff; color: #3730a3; }

/* Report preview: every line wraps so nothing is cut off on screen or on paper */
.rb-paper .dtable-wrap { overflow-x: visible; }
.rb-paper .dtable { table-layout: auto; width: 100%; }
.rb-paper .dtable th, .rb-paper .dtable td { white-space: normal; overflow-wrap: anywhere; word-break: normal; text-align: left; vertical-align: top; font-weight: 400; line-height: 1.4; }
.rb-paper .dtable th { font-weight: 700; }
.rb-paper .dtable th.num, .rb-paper .dtable td.num { text-align: right; white-space: nowrap; }
.rb-paper .dtable td:first-child { white-space: nowrap; }
.rb-paper .rb-table td:not(:first-child):not(.num) { min-width: 70px; }
@media print {
  @page { size: A4; margin: 12mm; }
  body * { visibility: hidden !important; }
  .rb-paper, .rb-paper * { visibility: visible !important; }
  .rb-paper { position: absolute; left: 0; top: 0; width: 100% !important; box-shadow: none !important; border-radius: 0; padding: 0 !important; }
  .rb-s { break-inside: auto; } .rb-s h2 { break-after: avoid; } .rb-paper tr, .rb-kpis, .rb-paper svg { break-inside: avoid; }
  .rb-paper thead { display: table-header-group; }
  .rb-paper .dtable th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #rb-aisum { display: none !important; }
}

.ff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.ff-c { display: grid; gap: 6px; justify-items: center; padding: 8px; border: 0; border-radius: 12px; background: rgba(127,127,127,.07); color: inherit; font: inherit; cursor: pointer; }
.ff-c:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.ff-img { display: grid; place-items: center; width: 100%; height: 80px; background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 1px #e2e8f0; }
.ff-img img { max-width: 90%; max-height: 64px; object-fit: contain; }

.wk-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin: 12px 0; border-radius: 14px; background: rgba(245,168,0,.1); box-shadow: inset 0 0 0 1px rgba(245,168,0,.45); }
.wk-confirm.done { background: rgba(22,163,74,.08); box-shadow: inset 0 0 0 1px rgba(22,163,74,.35); }
.wk-list { max-height: 55vh; overflow: auto; }
.wk-list .list-item { gap: 10px; }
.wk-list input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--accent-strong); }
.wk-list .title, .wk-list .sub { display: block; }
.wk-list .title .fl-img { display: inline-block; width: auto; vertical-align: -3px; margin-right: 6px; }
.wk-n { width: 76px; flex: none; text-align: right; }

/* Choice rows that don't fit become a single picker, the same as Zone on Photos */
.snx-hid { display: none !important; }
.snx-pick { max-width: 100%; margin: 8px 8px 0 0; }
.snx-pick .zp-lbl { white-space: nowrap; }

/* 10.32 Insights: every tile opens its list; charts sit side by side on wide screens and stay a sensible size */
.kpi-go { position: relative; display: block; width: 100%; text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.kpi-go:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--brand, #f5c542), var(--shadow); }
.kpi-go:focus-visible { outline: 2px solid var(--brand, #f5c542); outline-offset: 2px; }
.kpi-go > svg:last-child { position: absolute; top: 12px; right: 12px; opacity: .45; }
.ins-charts { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.ins-chart .chart { max-height: 300px; }
.ins-chart .chart-card { max-width: 620px; }
.chart [data-msgo], .chart [data-wk] { cursor: pointer; }
.drill-list .list-item { text-align: left; width: 100%; font: inherit; color: inherit; background: none; border: 0; }

/* 10.32 close-out suggestions on an issue */
.co-card { margin-top: 12px; }
.co-list { list-style: none; counter-reset: co; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.co-list li { counter-increment: co; display: flex; gap: 10px; align-items: flex-start; padding: 10px 10px 10px 12px; border-radius: 12px; background: var(--surface-2, rgba(127,127,127,.08)); }
.co-list li::before { content: counter(co); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--brand, #f5c542); color: #1a1a1a; margin-top: 1px; }
.co-text { font-size: .95rem; line-height: 1.4; }
.co-meta { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.co-acts { display: flex; gap: 2px; flex: none; }

/* 10.32 HandsFree: big targets, high contrast, usable with gloves */
.hf { max-width: 720px; margin: 0 auto; padding-top: 12px; }
.hf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.hf-head .eyebrow { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hf-area { display: flex; align-items: center; gap: 6px; font-size: 1.25rem; font-weight: 800; margin-top: 2px; }
.hf-cam { position: relative; margin-top: 12px; border-radius: 18px; overflow: hidden; background: #0b0f17; aspect-ratio: 4 / 3; max-height: 38vh; width: 100%; }
.hf-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-cam.flash::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: .7; }
.hf-cam-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #c8d0dc; text-align: center; padding: 16px; font-size: .9rem; }
.hf-cam-off[hidden] { display: none; }
.hf-count { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.65); color: #fff; font-weight: 700; font-size: .85rem; padding: 6px 10px; border-radius: 999px; }
.hf-mic { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 150px; margin-top: 14px; border: 0; border-radius: 22px; cursor: pointer;
  background: linear-gradient(180deg, #ffd24a, #f5b301); color: #1a1a1a; font: inherit; box-shadow: 0 10px 30px rgba(245,179,1,.3); }
.hf-mic svg { width: 46px; height: 46px; }
.hf-mic b { font-size: 1.15rem; }
.hf-mic .hf-ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.hf-mic.on { background: linear-gradient(180deg, #ff6b5a, #e5392b); color: #fff; box-shadow: 0 10px 30px rgba(229,57,43,.35); }
.hf-mic.on .hf-ring { animation: hfPulse 1.4s ease-out infinite; box-shadow: 0 0 0 0 rgba(229,57,43,.55); }
@keyframes hfPulse { to { box-shadow: 0 0 0 18px rgba(229,57,43,0); } }
@media (prefers-reduced-motion: reduce) { .hf-mic.on .hf-ring { animation: none; } }
.hf-heard { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 1.1rem; font-weight: 600; min-height: 56px; line-height: 1.35; }
.hf-type { display: flex; gap: 8px; margin-top: 10px; }
.hf-type .input { flex: 1; min-height: 48px; }
.hf-help { margin-top: 16px; }
.hf-help summary { cursor: pointer; font-weight: 700; padding: 8px 2px; }
.hf-help-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 6px; }
.hf-help-grid > div { background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.hf-help-grid > div span { color: var(--muted); font-size: .85rem; }
.hf-help-grid > div.locked { opacity: .55; }
.hf-help-grid > div.locked b svg { margin-right: 4px; vertical-align: -1px; }

/* 10.33 demo project picker: one per sector */
.demo-sectors { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-top: 12px; }
.demo-sector { display: flex; gap: 12px; align-items: center; text-align: left; font: inherit; color: inherit; background: var(--surface); box-shadow: var(--shadow); border: 0; border-radius: 14px; padding: 12px; cursor: pointer; }
.demo-sector:hover { box-shadow: 0 0 0 1px var(--brand, #f5c542), var(--shadow); }
.demo-sector b { display: block; }
.demo-sector .grow > span { display: block; font-size: .82rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.demo-sector em { display: inline-block; margin-top: 4px; font-style: normal; font-size: .75rem; font-weight: 700; color: var(--brand-ink, #b7791f); }

/* 10.33 change several issues at once */
.bulk-bar { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.bulk-n { margin-right: auto; font-size: .95rem; }
.bulk-tip { display: flex; gap: 8px; align-items: center; margin: 12px 2px 0; padding: 10px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: .9rem; }
.selecting-list .issue-row { cursor: pointer; }
.pick-box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; margin-right: 2px; }
.issue-row.picked .pick-box { background: var(--brand, #f5c542); border-color: var(--brand, #f5c542); color: #1a1a1a; }
.issue-row.picked { box-shadow: inset 3px 0 0 var(--brand, #f5c542); }

/* 10.33 project health score (SitePulse) */
.health-card { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.hc-ring { position: relative; width: 84px; height: 84px; }
.hc-ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.hc-ring circle { fill: none; stroke-width: 9; }
.hc-ring .hc-bg { stroke: rgba(127,127,127,.18); }
.hc-ring .hc-fg { stroke-linecap: round; }
.health-card.good .hc-fg { stroke: #2fa36b; } .health-card.watch .hc-fg { stroke: #e0a100; } .health-card.risk .hc-fg { stroke: #e5484d; }
.hc-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; }
.hc-text .eyebrow { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hc-label { font-size: 1.2rem; font-weight: 800; }
.hc-parts { grid-column: 1 / -1; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.hc-part { display: grid; gap: 4px; text-align: left; font: inherit; color: inherit; background: rgba(127,127,127,.07); border: 0; border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.hc-part > span:first-child { font-weight: 700; font-size: .9rem; }
.hc-part small { color: var(--muted); }
.hc-bar { height: 6px; border-radius: 3px; background: rgba(127,127,127,.18); overflow: hidden; }
.hc-bar i { display: block; height: 100%; border-radius: 3px; }
.hc-bar i.good { background: #2fa36b; } .hc-bar i.watch { background: #e0a100; } .hc-bar i.risk { background: #e5484d; }
/* 10.33 audit log */
.audit-filters { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: center; margin-bottom: 10px; }
.audit-filters .input { min-height: 42px; }
.audit-fail { display: flex; gap: 6px; align-items: center; font-size: .9rem; }
/* 10.33 crew check-ins on the map */
.crew-marker span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #1f6feb; color: #fff; font: 800 13px system-ui, sans-serif; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.crew-dot { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1f6feb; color: #fff; font-weight: 800; font-size: .8rem; }
#home-tour, #home-help { min-height: 32px; display: inline-flex; align-items: center; }

/* 10.34 TwinView */
.tw-head .eyebrow { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tw-head { margin-top: 14px; }
.tw-open { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 12px; }
.tw-mode { display: grid; gap: 4px; justify-items: start; text-align: left; font: inherit; color: inherit; background: var(--surface); box-shadow: var(--shadow); border: 0; border-radius: 16px; padding: 14px; cursor: pointer; }
.tw-mode:hover { box-shadow: 0 0 0 1px var(--brand, #f5c542), var(--shadow); }
.tw-mode b { font-size: 1rem; } .tw-mode > span:last-child { font-size: .85rem; color: var(--muted); }
.tw-list .list-item { text-align: left; width: 100%; font: inherit; color: inherit; background: none; border: 0; gap: 10px; }
.tw-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; display: inline-block; }
.tw-dot.good { background: #22a06b; } .tw-dot.watch { background: #e0a100; } .tw-dot.risk { background: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,.18); } .tw-dot.stale { background: #94a3b8; }
.tw-spark { width: 120px; height: 30px; flex: none; }
.tw-spark polyline { fill: none; stroke: var(--brand, #f5b800); stroke-width: 1.6; }
.tw-spark .tw-band { fill: rgba(34,160,107,.12); }
.tw-big .tw-spark { width: 100%; height: 120px; }
.tw-val { display: grid; justify-items: end; text-align: right; min-width: 88px; }
.tw-val b { font-size: 1.15rem; } .tw-val small { color: var(--muted); font-size: .72rem; }
.tw-code { white-space: pre-wrap; word-break: break-all; background: rgba(127,127,127,.1); padding: 10px 12px; border-radius: 10px; font-size: .8rem; }
.tw-seg { display: flex; flex-wrap: wrap; }
.tw-key { display: inline-flex; align-items: center; gap: 5px; margin: 4px 10px 0 0; }
.tw-key i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); display: inline-block; }
@media (max-width: 600px) { .tw-spark { display: none; } }
/* 10.34 company roles and project access */
.rl-mods { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.rl-mod { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(127,127,127,.07); cursor: pointer; }
.rl-mod span { display: grid; } .rl-mod small { color: var(--muted); font-size: .72rem; }
.ac-list { max-height: 320px; overflow: auto; }
/* 10.34 Insights tables: every number opens its items */
.cmp-table td.cell-go { cursor: pointer; text-decoration: underline dotted rgba(127,127,127,.6); text-underline-offset: 3px; }
.cmp-table td.cell-go:hover, .cmp-table td.cell-go:focus-visible { background: rgba(245,184,0,.12); outline: none; }
.drill-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
/* 10.35 Procore, ACC and Aconex */
.plat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin: 10px 0 4px; }
.plat-card { display: flex; flex-direction: column; justify-content: space-between; }
.pl-link .row .btn { white-space: nowrap; }
/* ReadyCheck readiness rules */
.rc-rules.warn-card { border-color: rgba(202,138,4,.45); background: rgba(202,138,4,.06); }
.rc-rule { flex-wrap: wrap; gap: 8px 14px; }
.rc-rule .rc-w { width: 70px; display: inline-block; padding: 6px 8px; margin-left: 4px; }
/* Commissioning tests */
.ct-reads { display: grid; gap: 6px; }
.ct-read { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)) auto; gap: 6px; align-items: center; }
.ct-read .ct-verdict { min-width: 36px; }
@media (max-width: 520px) { .ct-read { grid-template-columns: 1fr 1fr 1fr; } .ct-read > :first-child { grid-column: 1 / -1; } }
/* Test view banner (platform owner) */
.test-banner { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #7c3aed; color: #fff; font-size: .8rem; line-height: 1.3; }
.test-banner span { flex: 1; min-width: 0; }
.test-banner button { border: 1px solid rgba(255,255,255,.6); background: none; color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 650; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.sub-usage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sub-usage .kpi small { font-size: .7em; color: var(--muted); }
/* Programme stages */
.ps-ladder { display: flex; flex-wrap: wrap; gap: 4px; }
.ps-step { font-size: .75rem; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.ps-step.done { background: rgba(46,157,91,.12); color: var(--ink); border-color: rgba(46,157,91,.35); }
.ps-step.now { font-weight: 750; box-shadow: 0 0 0 2px rgba(46,157,91,.45); }
.pg-li .pill { margin-right: 4px; white-space: nowrap; }
.pt-conflict { display: flex; gap: 8px; border-color: rgba(220,38,38,.45); background: rgba(220,38,38,.07); }
.wf-certs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.wf-certs .pill { font-size: 11px; }
/* SiteMap: zone outlines and plan layers */
.zone-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.zone-svg .zp { fill: rgba(29, 95, 214, 0.035); stroke: rgba(29, 95, 214, 0.6); stroke-width: 2; vector-effect: non-scaling-stroke; }
.zone-svg .zp.kind-row { stroke: rgba(214, 140, 0, 0.85); fill: transparent; }
.zone-svg .zp.kind-area { stroke: rgba(21, 128, 61, 0.6); stroke-dasharray: 6 4; fill: transparent; }
.zone-svg .zp.editing { stroke-dasharray: 6 4; }
.zone-svg .zp-hatch { fill: url(#zp-hatch); stroke: #d03b3b; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.zone-svg .zp-draft { fill: rgba(255, 194, 26, 0.18); stroke: #ffc21a; stroke-width: 2.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.zone-svg .zp-corner { fill: #ffc21a; stroke: #1a1300; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.zone-svg .zp-corner.close { fill: #15803d; }
.zone.outline, .zone.layered { border-color: transparent !important; background: transparent !important; }
.zone-tag { font-weight: 800; margin-left: 4px; color: #1a1d23; }
.dv-layers { position: absolute; left: 12px; bottom: 12px; z-index: 4; display: flex; flex-direction: column; gap: 4px; padding: 10px; min-width: 200px; background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg); }
.dv-layers button { text-align: left; border: 0; border-radius: 10px; padding: 9px 10px; background: transparent; color: inherit; font: inherit; font-weight: 650; cursor: pointer; }
.dv-layers button.on { background: var(--accent-soft, rgba(29,95,214,.12)); color: var(--accent, #1d5fd6); }
.dv-legend { color: #d6dcea; flex: 1; min-width: 0; text-align: left; line-height: 1.5; }
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 8px; vertical-align: middle; }
.dv-seg { background: rgba(255,255,255,0.12); }
.dv-seg button { color: #fff; }
.dv-zone-card { align-items: flex-start; }
.pq-item .mt-icon { margin-bottom: 0; flex: none; }
.pq-item .pill { flex: none; }
.bim-mtools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 2px 0 4px; }
.bim-mtools .pill { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; }
.kpis button.kpi { border: 0; font: inherit; cursor: pointer; text-align: left; }
.kpis button.kpi.on { outline: 2px solid var(--accent, #1d5fd6); }
#pulse-q { min-width: 0; } /* a grid item: let the role chips scroll instead of widening the page */
/* Programme: filters, saved views and the update table */
.pg-picked { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -4px 0 10px; }
.pg-picked .chip { cursor: default; }
.pg-fgroup { border-bottom: 1px solid var(--line); padding: 8px 0; }
.pg-fgroup summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.pg-fvals { max-height: 240px; overflow: auto; margin-top: 6px; }
.pg-fval { display: flex; gap: 10px; align-items: center; padding: 7px 4px; border-radius: 8px; cursor: pointer; }
.pg-fval:hover { background: var(--surface-2); }
.pg-fval input { width: 18px; height: 18px; flex: none; }
.pg-updhead { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pg-upd td { vertical-align: middle; }
.pg-upd .input.sm { min-width: 0; padding: 6px 8px; }
.pg-upd input[type=number] { width: 72px; }
.pg-upd input[type=date] { width: 140px; }
.pu-changed { box-shadow: 0 0 0 2px #e8a400 inset; background: rgba(232, 164, 0, 0.1); }
.pg-pending { color: #b7791f; }
.pg-shutband { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(120, 130, 150, 0.16) 0 6px, rgba(120, 130, 150, 0.06) 6px 12px); pointer-events: none; z-index: 0; }
.pg-shut { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.pg-rec .btn { flex: none; }
.pg-recfacts { margin: 8px 0; line-height: 1.5; }
.mp-act input[type=checkbox] { width: 18px; height: 18px; flex: none; }
/* RiskRadar register */
.rg-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.rg-matrix { display: grid; grid-template-columns: 16px repeat(5, 28px); gap: 3px; font-size: 11px; }
.rg-cell { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; color: #1a1300; }
.rg-cell.low { background: #cfe9cf; } .rg-cell.medium { background: #f6d58a; } .rg-cell.high { background: #f0a3a3; }
.rg-ylab, .rg-xlab { display: grid; place-items: center; color: var(--muted); }
.rg-score { flex: none; min-width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; font-weight: 800; }
.rg-score.bad { background: #f0a3a3; color: #4a0d0d; } .rg-score.warn { background: #f6d58a; color: #3d2a00; } .rg-score.good { background: #cfe9cf; color: #0d3b12; }
.rr-assume { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; }
.rg-ev { margin: 6px 0 10px; }
.rr-warn .list-item > .btn, .rr-warn .list-item > .pill { flex: none; align-self: center; }

/* ---- SPA and LOA (10.41): the public signing page and the sheets in the app ---- */
.sg-kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 12px; font-size: 14px; }
.sg-kv .k { color: var(--muted); }
.sg-kv .v { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.sg-ticks, .sg-team { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-ticks span, .sg-team span { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 13px; }
.sg-team .signed, .sg-team .approved { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.sg-team .absent, .sg-team .withdrawn, .sg-team .not_needed { opacity: .65; text-decoration: line-through; }
.sg-team .rejected { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.sg-steps { display: grid; gap: 8px; }
.sg-step { display: flex; gap: 10px; align-items: flex-start; }
.sg-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); }
.spa-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.spa-sec > h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.spa-sec > h3 .n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; background: var(--ink); color: var(--bg); }
.spa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 10px; }
.spa-chips .chip.must { cursor: default; }
.spa-step { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.spa-step:last-child { border-bottom: 0; }
.spa-step .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.spa-step textarea { min-height: 54px; }
.spa-who { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.spa-who:last-child { border-bottom: 0; }
.spa-who .grow { min-width: 140px; }
.spa-who .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.spa-who img.sig { height: 34px; background: #fff; border-radius: 6px; }
.dl-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.dl-ref { font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--muted); margin-right: 6px; }
.loa-steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 4px; }
.loa-steps span { font-size: 12px; padding: 3px 9px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.loa-steps span.done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); box-shadow: none; }
.loa-steps span.now { background: var(--amber-soft); color: var(--amber-ink); box-shadow: none; font-weight: 700; }
.loa-period { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.loa-period button { padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 13.5px; cursor: pointer; }
.loa-period button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
/* Permit board by section and type (10.41) */
.pt-status { margin: 4px 0 2px; }
.pt-types-list { display: grid; gap: 8px; }
.pt-trow { border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pt-thead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pt-thead .title { font-weight: 700; }
.pt-tsub { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-valid { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; box-shadow: inset 0 0 0 1px currentColor; }
.pt-valid.daily { color: var(--blue, #2563eb); } .pt-valid.weekly { color: #c2410c; } .pt-valid.open { color: var(--ok); }
.pt-n { flex: none; min-width: 34px; text-align: center; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.pt-tbody { padding: 0 10px 10px; display: grid; gap: 6px; }
/* People by company (10.41) */
.wf-firms { margin: 0 0 10px; }
.wf-firmhead { display: flex; align-items: center; gap: 8px; margin: 14px 2px 6px; flex-wrap: wrap; }
.wf-firmhead .link-btn { margin-left: auto; }
.wf-firmhead.big { margin: 8px 0 10px; padding: 12px; border-radius: var(--r); background: var(--surface-2); }
.wf-firmhead.big b { font-size: 1.1rem; }
.wf-noemail { color: var(--muted); font-style: italic; }
/* A fixed space for every logo, whatever its shape: wide logos shrink to fit instead of running over the name. */
.wf-logo { flex: none; width: 72px; height: 40px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wf-logo img, .wf-logo .fl-img { max-width: 100% !important; max-height: 100% !important; width: auto !important; height: auto !important; object-fit: contain; border-radius: 4px; }
.wf-logo .fl-init { flex: none; }
.wf-firmhead .fl-img { max-width: 96px !important; max-height: 40px !important; height: auto !important; object-fit: contain; }
.wf-logobox .fl-img { max-width: 120px !important; max-height: 44px !important; height: auto !important; object-fit: contain; }
@media (max-width: 520px) { .wf-logo { width: 56px; height: 34px; } .wf-co .wf-lbl { display: none; } }
.wf-logobox { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 10px; border-radius: var(--r); background: var(--surface-2); flex-wrap: wrap; }
.wf-colog { display: flex; align-items: center; gap: 8px; margin: -4px 0 8px; min-height: 0; }
.wf-co { gap: 8px; }
.wf-co-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.wf-co-open .title, .wf-co-open .sub { display: block; }
@media (max-width: 520px) { .wf-co .btn.sm { padding: 6px 8px; font-size: 12px; } }
/* Org chart of companies (10.42) */
.wf-seg { margin: 4px 0 12px; max-width: 360px; }
.oc-tools { gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
ul.oc { list-style: none; margin: 0; padding: 0; }
ul.oc ul.oc { margin-left: 18px; padding-left: 14px; border-left: 2px solid var(--line); }
.oc-node { margin: 6px 0; position: relative; }
ul.oc ul.oc > .oc-node::before { content: ''; position: absolute; left: -14px; top: 26px; width: 12px; border-top: 2px solid var(--line); }
.oc-card { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.oc-card.own { box-shadow: inset 0 0 0 2px var(--accent); }
.oc-caret { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--surface-2); color: inherit; display: grid; place-items: center; cursor: pointer; }
.oc-caret.none { background: none; }
.oc-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.oc-main .title, .oc-main .sub { display: block; }
.oc-role { font-size: 11px; }
.wf-rel { margin: -2px 2px 10px; }
@media (max-width: 520px) { ul.oc ul.oc { margin-left: 10px; padding-left: 8px; } ul.oc ul.oc > .oc-node::before { left: -8px; width: 6px; } }
.wf-dups { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; border-left: 4px solid var(--st-warn, #d97706); }
.wf-dups .btn { margin-left: auto; }
.wf-dupg { margin: 6px 0; }
/* Professional in two bundles (audit section 6) */
.ent-bundle { margin-top: 8px; }
.ent-bh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 2px 2px 6px; font-size: 13px; }
.sub-bundle { margin: 10px 0 4px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 13px; }
.pf-lite { margin: 10px 0; border-left: 4px solid var(--accent); }
/* Portfolio patterns and benchmarks (P3-5) */
.pat-card { margin: 8px 0; padding: 12px; }
.pat-worked { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; padding: 8px; border-radius: 10px; background: var(--surface-2); }
.pat-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pat-list a { color: var(--ink-2); text-decoration: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pat-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pat-row { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(5, minmax(0, 1fr)); gap: 6px; padding: 8px 10px; border-top: 1px solid var(--hair); font-size: 13px; align-items: center; }
.pat-row > span { overflow-wrap: anywhere; }
.pat-row.pat-head { border-top: 0; background: var(--surface-2); font-weight: 700; font-size: 12px; color: var(--ink-2); }
.pat-row .bad, .pat-list .bad, .small.bad { color: var(--st-critical); }
.pat-mids { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.pat-mid { padding: 10px; border-radius: 12px; background: var(--surface-2); }
.pat-mid b { font-size: 20px; }
.pat-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
@media (max-width: 560px) { .pat-row { grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); font-size: 12px; padding: 8px 8px; gap: 6px; } .pat-row .pat-wide { display: none; } .pat-row.pat-head { font-size: 11px; } .pat-row.pat-head > span { overflow-wrap: normal; hyphens: none; } }
/* Suggested risks: Kelmora suggests, a person decides */
.rg-sug { margin-bottom: 10px; border-left: 4px solid var(--accent); }
.rg-sug .list-item { align-items: flex-start; }
.rg-sug-row .sub { overflow-wrap: anywhere; }
.rg-sug-why { margin: 6px 0 10px; border-left: 4px solid var(--accent); }
/* ProjectIQ: this project or all projects, and searchable documents (P3-1) */
.iq-scope { max-width: 360px; margin: 6px 0 8px; }
.iq-docs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.iq-start .chip { white-space: normal; text-align: left; max-width: 100%; height: auto; }
/* InspectAI: how well it works (P3-4) */
.iaq-rows { display: flex; flex-direction: column; gap: 6px; }
.iaq-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 2fr) 46px auto; gap: 8px; align-items: center; font-size: 13px; }
.iaq-row > span:first-child { overflow-wrap: anywhere; }
.iaq-bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.iaq-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.iaq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 10px; }
.iaq-pick { border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); cursor: pointer; }
.iaq-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iaq-photo { display: block; max-width: 100%; max-height: 260px; border-radius: 12px; margin: 10px 0; object-fit: contain; }
.iaq-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 6px; }
.iaq-cmp .card { padding: 12px; margin: 0; }
.iaq-cmp b { font-size: 26px; display: block; }
.good-t { color: var(--st-ok, #16a34a); } .bad-t { color: var(--st-critical); }
@media (max-width: 480px) { .iaq-row { grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) 40px; } .iaq-row > span:last-child { display: none; } }
/* People split by project */
.wf-scope { max-width: 520px; margin: 0 0 8px; }
.wf-scope button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wf-onproj { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 10px 12px; flex-wrap: wrap; }
/* Risk register by discipline, with filters */
button.rg-cell { border: 0; padding: 0; font: inherit; font-weight: 800; cursor: pointer; }
button.rg-cell:disabled { cursor: default; }
.rg-cell.sel { outline: 3px solid var(--ink); outline-offset: 1px; }
.rg-disc { padding: 12px; margin-bottom: 10px; }
.rg-dtable { display: flex; flex-direction: column; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rg-drow { display: grid; grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr)); gap: 6px; padding: 8px 10px; border: 0; border-top: 1px solid var(--hair); background: none; font: inherit; font-size: 13px; text-align: left; color: inherit; align-items: center; }
button.rg-drow { cursor: pointer; } button.rg-drow:hover { background: var(--surface-2); }
.rg-drow.on { background: var(--surface-2); box-shadow: inset 4px 0 0 var(--accent); }
.rg-drow > span { overflow-wrap: anywhere; }
.rg-drow.rg-dhead { border-top: 0; background: var(--surface-2); font-weight: 700; font-size: 12px; color: var(--ink-2); }
.rg-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 8px; }
.rg-filters #rg-q { grid-column: 1 / -1; }
.rg-active { margin: 0 0 8px; }
.rg-active .chip { display: inline-flex; align-items: center; gap: 4px; }
.rg-dsec { margin-top: 10px; }
@media (max-width: 560px) { .rg-drow { grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); font-size: 12px; } .rg-drow > span:nth-child(6) { display: none; } }
/* Mitigation planner */
.pl-kpis { margin: 8px 0 10px; }
.pl-act { margin: 8px 0; padding: 12px; }
.pl-steps { margin: 0 0 6px; padding-left: 20px; }
.pl-steps li { margin: 2px 0; }
