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

:root {
  --navy: #0b1733;
  --accent: #ffc21a;
  --accent-strong: #f5a800;
  --on-accent: #1a1300;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e3e8f0;
  --danger: #dc2626;
  --ok: #16a34a;
  --blue: #2563eb;
  --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: #070c18;
    --surface: #111a2e;
    --surface-2: #17213a;
    --ink: #e8edf6;
    --ink-2: #c3cddd;
    --muted: #8a97ad;
    --line: #22304b;
    --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(17, 26, 46, 0.82);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #070c18;
    --surface: #111a2e;
    --surface-2: #17213a;
    --ink: #e8edf6;
    --ink-2: #c3cddd;
    --muted: #8a97ad;
    --line: #22304b;
    --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(17, 26, 46, 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: #0b1733; }
}
:root[data-theme="dark"] .btn.dark { background: #e8edf6; color: #0b1733; }
.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: #13254a; 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: #13254a; 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, #12224a, #0b1733); 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(4,8,20,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.25); }
.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: #0b1733; }
}
:root[data-theme="dark"] .chip.on { background: #e8edf6; color: #0b1733; }
.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) 80% 50%); 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) 70% 45%); 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) 70% 45%); 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(11,23,51,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(4, 8, 20, 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: #1b2232; 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(11,23,51,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(11,23,51,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(11,23,51,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(11,23,51,0.85); color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ---------- Markup editor ---------- */
.editor { position: fixed; inset: 0; z-index: 70; background: #0b0f19; 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: #121826; 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%, #1a2c5a, #070c18 60%); }
.login-card { width: 100%; max-width: 380px; background: rgba(17, 26, 46, 0.85); 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; }

/* ---------- 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(4, 8, 20, 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(37, 99, 235, 0.75); background: rgba(37, 99, 235, 0.07); border-radius: 2px; pointer-events: none; }
.zone.kind-row { border-color: rgba(245, 168, 0, 0.95); background: rgba(255, 194, 26, 0.14); }
.zone.kind-area { border-color: rgba(22, 163, 74, 0.8); background: rgba(22, 163, 74, 0.07); }
.zone.editing { border-style: dashed; }
.zone.draft { border: 2px dashed #ffc21a; background: rgba(255, 194, 26, 0.22); }
.zone-label { position: absolute; left: 2px; top: 2px; transform-origin: 0 0; white-space: nowrap; font: 700 12px/1.2 -apple-system, Helvetica, Arial, sans-serif; color: #fff; background: rgba(29, 78, 216, 0.88); padding: 3px 7px; border-radius: 6px; }
.zone.kind-row .zone-label { background: rgba(180, 120, 0, 0.92); }
.zone.kind-area .zone-label { background: rgba(21, 128, 61, 0.9); }
.dv-bottom { flex-wrap: wrap; }

/* ---------- As-built comparison ---------- */
.cmp { position: fixed; inset: 0; z-index: 72; background: #0b0f19; 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: #0b1733; }
.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: #0b1733; }
.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: #121a2e; }
.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(11,23,51,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: #0b1733; }
.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: #0b1733; border-color: #0b1733; }

/* ======================= Version 5 ======================= */
:root { --chart-plan: #2563eb; --chart-actual: #d97706; --st-good: #0ca30c; --st-warn: #b77905; --st-serious: #c2410c; --st-critical: #d03b3b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --chart-plan: #3b82f6; --chart-actual: #d97706; --st-good: #22c55e; --st-warn: #fab219; --st-serious: #ec835a; --st-critical: #f87171; }
}
:root[data-theme="dark"] { --chart-plan: #3b82f6; --chart-actual: #d97706; --st-good: #22c55e; --st-warn: #fab219; --st-serious: #ec835a; --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: #0b1733; }
}
:root[data-theme="dark"] .tabstrip button.on { background: #e8edf6; color: #0b1733; }

/* 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-badge.obs { background: #2563eb; } .type-badge.rfi { background: #7c3aed; } .type-badge.blk { background: #d03b3b; } .type-badge.pch { background: #b45309; }
.type-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #64748b; }
.type-dot.obs { background: #2563eb; } .type-dot.rfi { background: #7c3aed; } .type-dot.blk { background: #d03b3b; } .type-dot.pch { background: #b45309; }
.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; }

/* 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 #0b1733; }
.cx-tag i { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.55rem; font-weight: 900; background: #0b1733; 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 #0b1733, 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, #0b1733, #1d3a7a); 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.red { background: #fde2e2; color: #c81e1e; } .mt-icon.yellow { background: #fff4cc; color: #8a5a00; } .mt-icon.green { background: #dcfce7; color: #15803d; }
.mt-icon.blue { background: #e0ebff; color: #1d4ed8; } .mt-icon.purple { background: #ede4ff; color: #6d28d9; } .mt-icon.slate { background: #e5e9f0; color: #334155; }
.mt-icon.teal { background: #d5f5f0; color: #0f766e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mt-icon.red { background: #3b1414; color: #ff9a9a; }
  :root:not([data-theme="light"]) .mt-icon.yellow { background: #3a2e05; color: #ffd45a; }
  :root:not([data-theme="light"]) .mt-icon.green { background: #10301c; color: #6ee7a0; }
  :root:not([data-theme="light"]) .mt-icon.blue { background: #13254a; color: #8bb2ff; }
  :root:not([data-theme="light"]) .mt-icon.purple { background: #2a1a4a; color: #c4a7ff; }
  :root:not([data-theme="light"]) .mt-icon.slate { background: #1f2937; color: #cbd5e1; }
  :root:not([data-theme="light"]) .mt-icon.teal { background: #0c302c; color: #5eead4; }
}
:root[data-theme="dark"] .mt-icon.red { background: #3b1414; color: #ff9a9a; }
:root[data-theme="dark"] .mt-icon.yellow { background: #3a2e05; color: #ffd45a; }
:root[data-theme="dark"] .mt-icon.green { background: #10301c; color: #6ee7a0; }
:root[data-theme="dark"] .mt-icon.blue { background: #13254a; color: #8bb2ff; }
:root[data-theme="dark"] .mt-icon.purple { background: #2a1a4a; color: #c4a7ff; }
:root[data-theme="dark"] .mt-icon.slate { background: #1f2937; color: #cbd5e1; }
:root[data-theme="dark"] .mt-icon.teal { background: #0c302c; color: #5eead4; }
.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; }
.mt-icon.orange { background: #ffedd5; color: #c2410c; } .mt-icon.indigo { background: #e0e7ff; color: #4338ca; }
.icon-tile.green { background: #dcfce7; color: #15803d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mt-icon.orange { background: #3a1d08; color: #fdba74; }
  :root:not([data-theme="light"]) .mt-icon.indigo { background: #1e1b4b; color: #a5b4fc; }
  :root:not([data-theme="light"]) .icon-tile.green { background: #10301c; color: #6ee7a0; }
}
:root[data-theme="dark"] .mt-icon.orange { background: #3a1d08; color: #fdba74; }
:root[data-theme="dark"] .mt-icon.indigo { background: #1e1b4b; color: #a5b4fc; }
: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: #13254a; 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: #13254a; 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: #0b1220; 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: #121826; }
.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: #13254a; 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: #13254a; 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; }
.type-badge.dir { background: #ede4ff; color: #6d28d9; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .type-badge.dir { background: #2a1a4a; color: #c4a7ff; }
}
:root[data-theme="dark"] .type-badge.dir { background: #2a1a4a; color: #c4a7ff; }
.mt-icon.pink { background: #fce7f3; color: #be185d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mt-icon.pink { background: #3b0d24; color: #f9a8d4; }
}
:root[data-theme="dark"] .mt-icon.pink { background: #3b0d24; color: #f9a8d4; }
.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); }
.type-badge.dir { background: #0f766e; }
.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 (preview) */
.bim-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.bim-head .segmented { flex: 1; max-width: 360px; }
.bim-badge { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #1d4ed8; background: #e0ebff; padding: 4px 9px; border-radius: 99px; }
.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: #d97706; 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: #64748b; }
.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; }
/* mock-up */
.mock-shell { border-radius: 16px; overflow: hidden; background: #0f172a; color: #e2e8f0; box-shadow: var(--shadow-lg); }
.mock-tabs { display: flex; gap: 2px; overflow-x: auto; background: #0b1220; padding: 8px; scrollbar-width: none; }
.mock-tabs span { flex: none; padding: 7px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 650; color: #94a3b8; }
.mock-tabs span.on { background: #1d4ed8; color: #fff; }
.mock-ws { display: grid; grid-template-columns: 1fr; }
@media (min-width: 980px) { .mock-ws { grid-template-columns: 220px 1fr 260px; } }
.mock-left, .mock-right { padding: 12px; font-size: 0.82rem; border-color: #1e293b; }
.mock-h { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #64748b; margin: 10px 0 6px; }
.mock-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.mock-row small { display: block; color: #64748b; font-size: 0.72rem; }
.mock-eye { color: #22c55e; }
.mock-chips { display: flex; gap: 5px; flex-wrap: wrap; } .mock-chips span { padding: 3px 8px; border-radius: 99px; background: #1e293b; font-size: 0.75rem; } .mock-chips .on { background: #f5b800; color: #111; }
.mock-tree { color: #94a3b8; line-height: 1.7; font-size: 0.78rem; }
.mock-centre { padding: 12px; }
.mock-3d { position: relative; background: linear-gradient(#e8edf3, #cfd7e2); border-radius: 12px; }
.mock-iso { width: 100%; display: block; }
.mock-toolbar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 4px; background: rgba(15,23,42,0.9); padding: 5px; border-radius: 10px; flex-wrap: wrap; justify-content: center; }
.mock-toolbar span { font-size: 0.7rem; padding: 4px 7px; border-radius: 6px; color: #cbd5e1; }
.mock-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.75rem; color: #94a3b8; margin-top: 8px; }
.mock-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.mock-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; } .mock-kv span { color: #64748b; } .mock-kv b { font-weight: 600; word-break: break-all; }
.mock-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; } .mock-btn { padding: 6px 10px; border-radius: 8px; background: #1e293b; font-size: 0.75rem; font-weight: 700; } .mock-btn.y { background: #f5b800; color: #111; }
.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-badge { background: #13254a; color: #8bb2ff; }
  :root:not([data-theme="light"]) .bim-canvas { background: #1a2333; }
}
:root[data-theme="dark"] .bim-badge { background: #13254a; color: #8bb2ff; }
:root[data-theme="dark"] .bim-canvas { background: #1a2333; }
.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: #050a16;
    --surface: #0d1628;
    --surface-2: #121d34;
    --line: #1d2a45;
    --hair: rgba(148, 178, 255, 0.08);
    --glass: rgba(9, 16, 32, 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: #050a16;
    --surface: #0d1628;
    --surface-2: #121d34;
    --line: #1d2a45;
    --hair: rgba(148, 178, 255, 0.08);
    --glass: rgba(9, 16, 32, 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(59, 130, 246, 0.10), 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(59, 130, 246, 0.16), 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(59, 130, 246, 0.16), 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: var(--accent-strong); }
@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, #1b2a4a, #142039); 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, #1b2a4a, #142039); 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(3, 7, 18, 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%), #050a16; }
.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(3, 7, 18, .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; }
